Skip to content

Commit

Permalink
Old PHP versions dropped and doc updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Florent Morselli committed Oct 24, 2015
1 parent c4a607a commit f0223c3
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 23 deletions.
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
language: php

php:
- 5.3
- 5.4
- 5.5
- 5.6
- 7.0
- hhvm
Expand Down
44 changes: 25 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Punycode
Punycode
========

[![Build Status](https://travis-ci.org/Spomky-Labs/php-punycode.svg)](https://travis-ci.org/Spomky-Labs/php-punycode)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/Spomky-Labs/php-punycode/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/Spomky-Labs/php-punycode/?branch=master)
Expand All @@ -15,38 +16,43 @@

A Bootstring encoding of Unicode for Internationalized Domain Names in Applications (IDNA).

## Install
# The Release Process

```
composer require spomky-labs/php-punycode:~2.0
```
The release process [is described here](doc/Release.md).

# Prerequisites

This library needs at least ![PHP 5.6+](https://img.shields.io/badge/PHP-5.6%2B-ff69b4.svg).

## Usage
It has been successfully tested using `PHP 5.6`, `PHP 7` and `HHVM`.

# Installation

The preferred way to install this library is to rely on Composer:

```sh
composer require "spomky-labs/php-punycode" "~3.0"
```

# How to use

```php
<?php

// Import Punycode
use TrueBV\Punycode;
use SpomkyLabs\Punycode;

$Punycode = new Punycode();
var_dump($Punycode->encode('renangonçalves.com'));
var_dump(Punycode::encode('renangonçalves.com'));
// outputs: xn--renangonalves-pgb.com

var_dump($Punycode->decode('xn--renangonalves-pgb.com'));
var_dump(Punycode::decode('xn--renangonalves-pgb.com'));
// outputs: renangonçalves.com
```

# Contributing

## FAQ

### 1. What is this library for?

This library converts a Unicode encoded domain name to a IDNA ASCII form and vice-versa.

Requests for new features, bug fixed and all other ideas to make this library useful are welcome. [Please follow these best practices](doc/Contributing.md).

### 2. Why should I use this instead of [PHP's IDN Functions](http://php.net/manual/en/ref.intl.idn.php)?
# Licence

If you can compile the needed dependencies (intl, libidn) there is not much difference.
But if you want to write portable code between hosts (including Windows and Mac OS), or can't install PECL extensions, this is the right library for you.
This library is release under [MIT licence](LICENSE.txt).
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
}
},
"require": {
"php": ">=5.3.0",
"php": ">=5.6",
"ext-mbstring": "*"
},
"require-dev": {
Expand Down
26 changes: 26 additions & 0 deletions doc/Contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Contributing
============

First of all, **thank you** for contributing.

Bugs or feature requests can be posted online on the GitHub issues section of the project.

Few rules to ease code reviews and merges:

- You MUST follow the [PSR-1](http://www.php-fig.org/psr/psr-1/), [PSR-2](http://www.php-fig.org/psr/psr-2/) and [PSR-4](http://www.php-fig.org/psr/psr-4/) coding standards.
- You MUST run the test suite.
- You MUST write (or update) unit tests when bugs are fixed or features are added.
- You SHOULD write documentation.

We use [Git-Flow](http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/) to automate our git branching workflow.

To contribute use [Pull Requests](https://help.github.com/articles/using-pull-requests), please, write commit messages that make sense, and rebase your branch before submitting your PR.

May be asked to squash your commits too. This is used to "clean" your Pull Request before merging it, avoiding commits such as fix tests, fix 2, fix 3, etc.

Run test suite
------------

* install composer: `curl -s http://getcomposer.org/installer | php`
* install dependencies: `php composer.phar install`
* run tests: `vendor/bin/phpunit`
19 changes: 19 additions & 0 deletions doc/Release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
The Release Process
===================

We manage its releases through features and time-based models.

- A new patch version comes out every month when you made backwards-compatible bug fixes.
- A new minor version comes every six months when we added functionality in a backwards-compatible manner.
- A new major version comes every year when we make incompatible API changes.

The meaning of "patch" "minor" and "major" comes from the Semantic [Versioning strategy](http://semver.org/).

This release process applies from version 3.0.x.

Backwards Compatibility
-----------------------

We allow developers to upgrade with confidence from one minor version to the next one.

Whenever keeping backward compatibility is not possible, the feature, the enhancement or the bug fix will be scheduled for the next major version.

0 comments on commit f0223c3

Please sign in to comment.