Skip to content

Commit

Permalink
Updated to 1.1.5 version
Browse files Browse the repository at this point in the history
  • Loading branch information
josantonius committed Sep 18, 2017
1 parent 69cc4fa commit e5c1b59
Show file tree
Hide file tree
Showing 1,365 changed files with 118,715 additions and 297 deletions.
6 changes: 5 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
/tests export-ignore
/src/Exception export-ignore
/src/bootstrap.php export-ignore
/vendor export-ignore
.gitattributes export-ignore
.gitignore export-ignore
_config.yml export-ignore
.travis.yml export-ignore
CHANGELOG.md export-ignore
phpunit.xml.dist export-ignore
CONDUCT.md export-ignore
contributors.txt export-ignore
README.md export-ignore
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ phpunit.xml
composer.phar
composer.lock
composer-test.lock
vendor/
build/artifacts/
artifacts/
docs/_build
Expand Down
27 changes: 27 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
language: php

sudo: false

dist: trusty

git:
depth: 5

php:
- 5.6
- 7.0
- 7.1
- hhvm
- nightly

matrix:
fast_finish: true
allow_failures:
- php: nightly

before_script:
- composer self-update
- composer install

script:
- composer test
69 changes: 67 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,98 @@

## 1.1.5 - 2017-09-17

* Unit tests supported by `PHPUnit` were added.

* The repository was synchronized with `Travis CI` to implement continuous integration.

* Added `Url/src/bootstrap.php` file

* Added `Url/tests/bootstrap.php` file.

* Added `Url/phpunit.xml.dist` file.
* Added `Url/_config.yml` file.
* Added `Url/.travis.yml` file.

* Added `Josantonius\Url\Url::setUrlParams()` method.

* Deleted `Josantonius\Url\Url::segment()` method.

* Added `Josantonius\Url\Url::segmentUri()` method.

* Deleted `Josantonius\Url\Tests\UrlTest` class.
* Deleted `Josantonius\Url\Tests\UrlTest::testGetCurrentPage()` method.
* Deleted `Josantonius\Url\Tests\UrlTest::testGetProtocol()` method.
* Deleted `Josantonius\Url\Tests\UrlTest::testIsSSL()` method.
* Deleted `Josantonius\Url\Tests\UrlTest::getDomain()` method.
* Deleted `Josantonius\Url\Tests\UrlTest::testGetUri()` method.
* Deleted `Josantonius\Url\Tests\UrlTest::testGetPort()` method.
* Deleted `Josantonius\Url\Tests\UrlTest::testAddBackslash()` method.
* Deleted `Josantonius\Url\Tests\UrlTest::testPrevious()` method.
* Deleted `Josantonius\Url\Tests\UrlTest::testRedirect()` method.
* Deleted `Josantonius\Url\Tests\UrlTest::testAutoLink()` method.
* Deleted `Josantonius\Url\Tests\UrlTest::testCustomAutoLink()` method.
* Deleted `Josantonius\Url\Tests\UrlTest::testGenerateSafeSlug()` method.
* Deleted `Josantonius\Url\Tests\UrlTest::testSegment()` method.
* Deleted `Josantonius\Url\Tests\UrlTest::testGetFirstSegment()` method.
* Deleted `Josantonius\Url\Tests\UrlTest::testGetLastSegment()` method.
* Deleted `Josantonius\Url\Tests\UrlTest::testGetBaseUrl()` method.

* Added `Josantonius\Url\Test\UrlTest` class.
* Added `Josantonius\Url\Test\UrlTest::testGetCurrentPage()` method.
* Added `Josantonius\Url\Test\UrlTest::testGetBaseUrl()` method.
* Added `Josantonius\Url\Test\UrlTest::testGetProtocol()` method.
* Added `Josantonius\Url\Test\UrlTest::testIsSSL()` method.
* Added `Josantonius\Url\Test\UrlTest::getDomain()` method.
* Added `Josantonius\Url\Test\UrlTest::testGetUri()` method.
* Added `Josantonius\Url\Test\UrlTest::testGetUriMethods()` method.
* Added `Josantonius\Url\Test\UrlTest::testSetUrlParams()` method.
* Added `Josantonius\Url\Test\UrlTest::testSetUrlParamsAlternativeVersion()` method.
* Added `Josantonius\Url\Test\UrlTest::testGetPort()` method.
* Added `Josantonius\Url\Test\UrlTest::testAddBackslashEnd()` method.
* Added `Josantonius\Url\Test\UrlTest::testAddBackslashEndAlternativeVersion()` method.
* Added `Josantonius\Url\Test\UrlTest::testAddBackslashTop()` method.
* Added `Josantonius\Url\Test\UrlTest::testAddBackslashBoth()` method.
* Added `Josantonius\Url\Test\UrlTest::testPrevious()` method.
* Added `Josantonius\Url\Test\UrlTest::testRedirect()` method.
* Added `Josantonius\Url\Test\UrlTest::testAutoLink()` method.
* Added `Josantonius\Url\Test\UrlTest::testCustomAutoLink()` method.
* Added `Josantonius\Url\Test\UrlTest::testGenerateSafeSlug()` method.
* Added `Josantonius\Url\Test\UrlTest::testSegment()` method.
* Added `Josantonius\Url\Test\UrlTest::testGetFirstSegmentFromString()` method.
* Added `Josantonius\Url\Test\UrlTest::estGetFirstSegmentFromArray()` method.
* Added `Josantonius\Url\Test\UrlTest::testGetLastSegmentFromString()` method.
* Added `Josantonius\Url\Test\UrlTest::testGetLastSegmentFromArray()` method.

## 1.1.4 - 2017-07-16

* Deleted `Josantonius\Url\Exception\UrlException` class.
* Deleted `Josantonius\Url\Exception\Exceptions` abstract class.
* Deleted `Josantonius\Url\Exception\UrlException->__construct()` method.

## 1.1.3 - 2017-07-09

* Added option to analyze concrete urls in some methods.

## 1.1.2 - 2017-05-08

* Now you can choose to place backslash at the beginning, end or both ends in the addBackslash() method.

* The getUriMethods() method was improved to prevent it from replacing single characters that also matched.

## 1.1.1 - 2017-03-18

* Some files were excluded from download and comments and readme files were updated.

## 1.1.0 - 2017-02-28

* Added `Josantonius\Url\Url::getBaseUrl()` method.

## 1.1.0 - 2017-02-28

* Added `Josantonius\Url\Tests\UrlTest::testGetBaseUrl()` method.

## 1.0.0 - 2017-02-02

* Added `Josantonius\Url\Url` class.
* Added `Josantonius\Url\Url::getCurrentPage()` method.
* Added `Josantonius\Url\Url::getProtocol()` method.
Expand All @@ -44,12 +111,10 @@
* Added `Josantonius\Url\Url::getFirstSegment()` method.
* Added `Josantonius\Url\Url::getLastSegment()` method.

## 1.0.0 - 2017-02-02
* Added `Josantonius\Url\Exception\UrlException` class.
* Added `Josantonius\Url\Exception\Exceptions` abstract class.
* Added `Josantonius\Url\Exception\UrlException->__construct()` method.

## 1.0.0 - 2017-02-02
* Added `Josantonius\Url\Tests\UrlTest` class.
* Added `Josantonius\Url\Tests\UrlTest::testGetCurrentPage()` method.
* Added `Josantonius\Url\Tests\UrlTest::testGetProtocol()` method.
Expand Down
52 changes: 13 additions & 39 deletions README-ES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PHP Url library

[![Latest Stable Version](https://poser.pugx.org/josantonius/url/v/stable)](https://packagist.org/packages/josantonius/url) [![Total Downloads](https://poser.pugx.org/josantonius/url/downloads)](https://packagist.org/packages/josantonius/url) [![Latest Unstable Version](https://poser.pugx.org/josantonius/url/v/unstable)](https://packagist.org/packages/josantonius/url) [![License](https://poser.pugx.org/josantonius/url/license)](https://packagist.org/packages/josantonius/url)
[![Latest Stable Version](https://poser.pugx.org/josantonius/url/v/stable)](https://packagist.org/packages/josantonius/url) [![Total Downloads](https://poser.pugx.org/josantonius/url/downloads)](https://packagist.org/packages/josantonius/url) [![Latest Unstable Version](https://poser.pugx.org/josantonius/url/v/unstable)](https://packagist.org/packages/josantonius/url) [![License](https://poser.pugx.org/josantonius/url/license)](https://packagist.org/packages/josantonius/url) [![Travis](https://travis-ci.org/Josantonius/PHP-Url.svg)](https://travis-ci.org/Josantonius/PHP-Url)

[English version](README.md)

Expand All @@ -14,23 +14,14 @@ Biblioteca para manipulación de urls.
- [Métodos disponibles](#métodos-disponibles)
- [Uso](#uso)
- [Tests](#tests)
- [Tareas pendientes](#-tareas-pendientes)
- [Contribuir](#contribuir)
- [Repositorio](#repositorio)
- [Licencia](#licencia)
- [Copyright](#copyright)

---

<p align="center"><strong>Echa un vistazo al código</strong></p>

<p align="center">
<a href="https://youtu.be/94V12hdQWiY" title="Echa un vistazo al código">
<img src="https://raw.githubusercontent.com/Josantonius/PHP-Algorithm/master/resources/youtube-thumbnail.jpg">
</a>
</p>

---

### Instalación

La mejor forma de instalar esta extensión es a través de [composer](http://getcomposer.org/download/).
Expand Down Expand Up @@ -77,9 +68,10 @@ Url::previous();
Url::redirect();
Url::autoLink();
Url::generateSafeSlug();
Url::segment();
Url::segmentUri();
Url::getFirstSegment();
Url::getLastSegment();
Url::setUrlParams();
```
### Uso

Expand Down Expand Up @@ -123,7 +115,7 @@ var_dump(Url::autoLink('https://github.com', 'GitHub'));
var_dump(Url::generateSafeSlug('https://github.com'));
# string(16) "https-github-com"

var_dump($segments = Url::segment());
var_dump($segments = Url::segmentUri());
/*
array(2) {
[0]=>
Expand All @@ -143,36 +135,18 @@ print('</pre>');

### Tests

Para utilizar la clase de [pruebas](tests), simplemente:
Para ejecutar las [pruebas](tests/Url/Test) simplemente:

```php
<?php
$loader = require __DIR__ . '/vendor/autoload.php';
$ git clone https://github.com/Josantonius/PHP-Url.git
$ cd PHP-Url

$loader->addPsr4('Josantonius\\Url\\Tests\\', __DIR__ . '/vendor/josantonius/url/tests');
$ phpunit

use Josantonius\Url\Tests\UrlTest;
```
Métodos de prueba disponibles en esta biblioteca:
### ☑ Tareas pendientes

```php
UrlTest::testGetCurrentPage();
UrlTest::testGetProtocol();
UrlTest::testIsSSL();
UrlTest::getDomain();
UrlTest::testGetUri();
UrlTest::testGetUriMethods();
UrlTest::testGetPort();
UrlTest::testAddBackslash();
UrlTest::testPrevious();
UrlTest::testRedirect();
UrlTest::testAutoLink();
UrlTest::testCustomAutoLink();
UrlTest::testGenerateSafeSlug();
UrlTest::testSegment();
UrlTest::testGetFirstSegment();
UrlTest::testGetLastSegment();
```
- [x] Completar tests
- [ ] Mejorar la documentación

### Contribuir
1. Comprobar si hay incidencias abiertas o abrir una nueva para iniciar una discusión en torno a un fallo o función.
Expand Down
55 changes: 15 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PHP Url library

[![Latest Stable Version](https://poser.pugx.org/josantonius/url/v/stable)](https://packagist.org/packages/josantonius/url) [![Total Downloads](https://poser.pugx.org/josantonius/url/downloads)](https://packagist.org/packages/josantonius/url) [![Latest Unstable Version](https://poser.pugx.org/josantonius/url/v/unstable)](https://packagist.org/packages/josantonius/url) [![License](https://poser.pugx.org/josantonius/url/license)](https://packagist.org/packages/josantonius/url)
[![Latest Stable Version](https://poser.pugx.org/josantonius/url/v/stable)](https://packagist.org/packages/josantonius/url) [![Total Downloads](https://poser.pugx.org/josantonius/url/downloads)](https://packagist.org/packages/josantonius/url) [![Latest Unstable Version](https://poser.pugx.org/josantonius/url/v/unstable)](https://packagist.org/packages/josantonius/url) [![License](https://poser.pugx.org/josantonius/url/license)](https://packagist.org/packages/josantonius/url) [![Travis](https://travis-ci.org/Josantonius/PHP-Url.svg)](https://travis-ci.org/Josantonius/PHP-Url)

[Versión en español](README-ES.md)

Expand All @@ -14,23 +14,14 @@ Library for urls manipulation.
- [Available Methods](#available-methods)
- [Usage](#usage)
- [Tests](#tests)
- [TODO](#-todo)
- [Contribute](#contribute)
- [Repository](#repository)
- [License](#license)
- [Copyright](#copyright)

---

<p align="center"><strong>Take a look at the code</strong></p>

<p align="center">
<a href="https://youtu.be/94V12hdQWiY" title="Take a look at the code">
<img src="https://raw.githubusercontent.com/Josantonius/PHP-Algorithm/master/resources/youtube-thumbnail.jpg">
</a>
</p>

---

### Installation

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
Expand Down Expand Up @@ -78,10 +69,12 @@ Url::previous();
Url::redirect();
Url::autoLink();
Url::generateSafeSlug();
Url::segment();
Url::segmentUri();
Url::getFirstSegment();
Url::getLastSegment();
Url::setUrlParams();
```

### Usage

Example of use for this library:
Expand Down Expand Up @@ -124,7 +117,7 @@ var_dump(Url::autoLink('https://github.com', 'GitHub'));
var_dump(Url::generateSafeSlug('https://github.com'));
# string(16) "https-github-com"

var_dump($segments = Url::segment());
var_dump($segments = Url::segmentUri());
/*
array(2) {
[0]=>
Expand All @@ -144,39 +137,21 @@ print('</pre>');

### Tests

To use the [test](tests) class, simply:

```php
<?php
$loader = require __DIR__ . '/vendor/autoload.php';
To run [tests](tests/Url/Test) simply:

$loader->addPsr4('Josantonius\\Url\\Tests\\', __DIR__ . '/vendor/josantonius/url/tests');
$ git clone https://github.com/Josantonius/PHP-Url.git

$ cd PHP-Url

use Josantonius\Url\Tests\UrlTest;
$ phpunit

```
Available test methods in this library:
### ☑ TODO

```php
UrlTest::testGetCurrentPage();
UrlTest::testGetProtocol();
UrlTest::testIsSSL();
UrlTest::getDomain();
UrlTest::testGetUri();
UrlTest::testGetUriMethods();
UrlTest::testGetPort();
UrlTest::testAddBackslash();
UrlTest::testPrevious();
UrlTest::testRedirect();
UrlTest::testAutoLink();
UrlTest::testCustomAutoLink();
UrlTest::testGenerateSafeSlug();
UrlTest::testSegment();
UrlTest::testGetFirstSegment();
UrlTest::testGetLastSegment();
```
- [x] Create tests
- [ ] Improve documentation

### Contribute

1. Check for open issues or open a new issue to start a discussion around a bug or feature.
1. Fork the repository on GitHub to start making your changes.
1. Write one or more tests for the new feature or that expose the bug.
Expand Down
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
theme: jekyll-theme-cayman
Loading

0 comments on commit e5c1b59

Please sign in to comment.