Skip to content

Commit e5c1b59

Browse files
committed
Updated to 1.1.5 version
1 parent 69cc4fa commit e5c1b59

File tree

1,365 files changed

+118715
-297
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,365 files changed

+118715
-297
lines changed

.gitattributes

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
/tests export-ignore
2-
/src/Exception export-ignore
2+
/src/bootstrap.php export-ignore
3+
/vendor export-ignore
34
.gitattributes export-ignore
45
.gitignore export-ignore
6+
_config.yml export-ignore
7+
.travis.yml export-ignore
58
CHANGELOG.md export-ignore
9+
phpunit.xml.dist export-ignore
610
CONDUCT.md export-ignore
711
contributors.txt export-ignore
812
README.md export-ignore

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ phpunit.xml
22
composer.phar
33
composer.lock
44
composer-test.lock
5-
vendor/
65
build/artifacts/
76
artifacts/
87
docs/_build

.travis.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
language: php
2+
3+
sudo: false
4+
5+
dist: trusty
6+
7+
git:
8+
depth: 5
9+
10+
php:
11+
- 5.6
12+
- 7.0
13+
- 7.1
14+
- hhvm
15+
- nightly
16+
17+
matrix:
18+
fast_finish: true
19+
allow_failures:
20+
- php: nightly
21+
22+
before_script:
23+
- composer self-update
24+
- composer install
25+
26+
script:
27+
- composer test

CHANGELOG.md

Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,98 @@
22

33
## 1.1.5 - 2017-09-17
44

5+
* Unit tests supported by `PHPUnit` were added.
6+
7+
* The repository was synchronized with `Travis CI` to implement continuous integration.
8+
9+
* Added `Url/src/bootstrap.php` file
10+
11+
* Added `Url/tests/bootstrap.php` file.
12+
13+
* Added `Url/phpunit.xml.dist` file.
14+
* Added `Url/_config.yml` file.
15+
* Added `Url/.travis.yml` file.
16+
517
* Added `Josantonius\Url\Url::setUrlParams()` method.
618

19+
* Deleted `Josantonius\Url\Url::segment()` method.
20+
21+
* Added `Josantonius\Url\Url::segmentUri()` method.
22+
23+
* Deleted `Josantonius\Url\Tests\UrlTest` class.
24+
* Deleted `Josantonius\Url\Tests\UrlTest::testGetCurrentPage()` method.
25+
* Deleted `Josantonius\Url\Tests\UrlTest::testGetProtocol()` method.
26+
* Deleted `Josantonius\Url\Tests\UrlTest::testIsSSL()` method.
27+
* Deleted `Josantonius\Url\Tests\UrlTest::getDomain()` method.
28+
* Deleted `Josantonius\Url\Tests\UrlTest::testGetUri()` method.
29+
* Deleted `Josantonius\Url\Tests\UrlTest::testGetPort()` method.
30+
* Deleted `Josantonius\Url\Tests\UrlTest::testAddBackslash()` method.
31+
* Deleted `Josantonius\Url\Tests\UrlTest::testPrevious()` method.
32+
* Deleted `Josantonius\Url\Tests\UrlTest::testRedirect()` method.
33+
* Deleted `Josantonius\Url\Tests\UrlTest::testAutoLink()` method.
34+
* Deleted `Josantonius\Url\Tests\UrlTest::testCustomAutoLink()` method.
35+
* Deleted `Josantonius\Url\Tests\UrlTest::testGenerateSafeSlug()` method.
36+
* Deleted `Josantonius\Url\Tests\UrlTest::testSegment()` method.
37+
* Deleted `Josantonius\Url\Tests\UrlTest::testGetFirstSegment()` method.
38+
* Deleted `Josantonius\Url\Tests\UrlTest::testGetLastSegment()` method.
39+
* Deleted `Josantonius\Url\Tests\UrlTest::testGetBaseUrl()` method.
40+
41+
* Added `Josantonius\Url\Test\UrlTest` class.
42+
* Added `Josantonius\Url\Test\UrlTest::testGetCurrentPage()` method.
43+
* Added `Josantonius\Url\Test\UrlTest::testGetBaseUrl()` method.
44+
* Added `Josantonius\Url\Test\UrlTest::testGetProtocol()` method.
45+
* Added `Josantonius\Url\Test\UrlTest::testIsSSL()` method.
46+
* Added `Josantonius\Url\Test\UrlTest::getDomain()` method.
47+
* Added `Josantonius\Url\Test\UrlTest::testGetUri()` method.
48+
* Added `Josantonius\Url\Test\UrlTest::testGetUriMethods()` method.
49+
* Added `Josantonius\Url\Test\UrlTest::testSetUrlParams()` method.
50+
* Added `Josantonius\Url\Test\UrlTest::testSetUrlParamsAlternativeVersion()` method.
51+
* Added `Josantonius\Url\Test\UrlTest::testGetPort()` method.
52+
* Added `Josantonius\Url\Test\UrlTest::testAddBackslashEnd()` method.
53+
* Added `Josantonius\Url\Test\UrlTest::testAddBackslashEndAlternativeVersion()` method.
54+
* Added `Josantonius\Url\Test\UrlTest::testAddBackslashTop()` method.
55+
* Added `Josantonius\Url\Test\UrlTest::testAddBackslashBoth()` method.
56+
* Added `Josantonius\Url\Test\UrlTest::testPrevious()` method.
57+
* Added `Josantonius\Url\Test\UrlTest::testRedirect()` method.
58+
* Added `Josantonius\Url\Test\UrlTest::testAutoLink()` method.
59+
* Added `Josantonius\Url\Test\UrlTest::testCustomAutoLink()` method.
60+
* Added `Josantonius\Url\Test\UrlTest::testGenerateSafeSlug()` method.
61+
* Added `Josantonius\Url\Test\UrlTest::testSegment()` method.
62+
* Added `Josantonius\Url\Test\UrlTest::testGetFirstSegmentFromString()` method.
63+
* Added `Josantonius\Url\Test\UrlTest::estGetFirstSegmentFromArray()` method.
64+
* Added `Josantonius\Url\Test\UrlTest::testGetLastSegmentFromString()` method.
65+
* Added `Josantonius\Url\Test\UrlTest::testGetLastSegmentFromArray()` method.
66+
767
## 1.1.4 - 2017-07-16
68+
869
* Deleted `Josantonius\Url\Exception\UrlException` class.
970
* Deleted `Josantonius\Url\Exception\Exceptions` abstract class.
1071
* Deleted `Josantonius\Url\Exception\UrlException->__construct()` method.
1172

1273
## 1.1.3 - 2017-07-09
74+
1375
* Added option to analyze concrete urls in some methods.
1476

1577
## 1.1.2 - 2017-05-08
78+
1679
* Now you can choose to place backslash at the beginning, end or both ends in the addBackslash() method.
1780

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

2083
## 1.1.1 - 2017-03-18
84+
2185
* Some files were excluded from download and comments and readme files were updated.
2286

2387
## 1.1.0 - 2017-02-28
88+
2489
* Added `Josantonius\Url\Url::getBaseUrl()` method.
2590

2691
## 1.1.0 - 2017-02-28
92+
2793
* Added `Josantonius\Url\Tests\UrlTest::testGetBaseUrl()` method.
2894

2995
## 1.0.0 - 2017-02-02
96+
3097
* Added `Josantonius\Url\Url` class.
3198
* Added `Josantonius\Url\Url::getCurrentPage()` method.
3299
* Added `Josantonius\Url\Url::getProtocol()` method.
@@ -44,12 +111,10 @@
44111
* Added `Josantonius\Url\Url::getFirstSegment()` method.
45112
* Added `Josantonius\Url\Url::getLastSegment()` method.
46113

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

52-
## 1.0.0 - 2017-02-02
53118
* Added `Josantonius\Url\Tests\UrlTest` class.
54119
* Added `Josantonius\Url\Tests\UrlTest::testGetCurrentPage()` method.
55120
* Added `Josantonius\Url\Tests\UrlTest::testGetProtocol()` method.

README-ES.md

Lines changed: 13 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# PHP Url library
22

3-
[![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)
3+
[![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)
44

55
[English version](README.md)
66

@@ -14,23 +14,14 @@ Biblioteca para manipulación de urls.
1414
- [Métodos disponibles](#métodos-disponibles)
1515
- [Uso](#uso)
1616
- [Tests](#tests)
17+
- [Tareas pendientes](#-tareas-pendientes)
1718
- [Contribuir](#contribuir)
1819
- [Repositorio](#repositorio)
1920
- [Licencia](#licencia)
2021
- [Copyright](#copyright)
2122

2223
---
2324

24-
<p align="center"><strong>Echa un vistazo al código</strong></p>
25-
26-
<p align="center">
27-
<a href="https://youtu.be/94V12hdQWiY" title="Echa un vistazo al código">
28-
<img src="https://raw.githubusercontent.com/Josantonius/PHP-Algorithm/master/resources/youtube-thumbnail.jpg">
29-
</a>
30-
</p>
31-
32-
---
33-
3425
### Instalación
3526

3627
La mejor forma de instalar esta extensión es a través de [composer](http://getcomposer.org/download/).
@@ -77,9 +68,10 @@ Url::previous();
7768
Url::redirect();
7869
Url::autoLink();
7970
Url::generateSafeSlug();
80-
Url::segment();
71+
Url::segmentUri();
8172
Url::getFirstSegment();
8273
Url::getLastSegment();
74+
Url::setUrlParams();
8375
```
8476
### Uso
8577

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

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

144136
### Tests
145137

146-
Para utilizar la clase de [pruebas](tests), simplemente:
138+
Para ejecutar las [pruebas](tests/Url/Test) simplemente:
147139

148-
```php
149-
<?php
150-
$loader = require __DIR__ . '/vendor/autoload.php';
140+
$ git clone https://github.com/Josantonius/PHP-Url.git
141+
142+
$ cd PHP-Url
151143

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

154-
use Josantonius\Url\Tests\UrlTest;
155-
```
156-
Métodos de prueba disponibles en esta biblioteca:
146+
### ☑ Tareas pendientes
157147

158-
```php
159-
UrlTest::testGetCurrentPage();
160-
UrlTest::testGetProtocol();
161-
UrlTest::testIsSSL();
162-
UrlTest::getDomain();
163-
UrlTest::testGetUri();
164-
UrlTest::testGetUriMethods();
165-
UrlTest::testGetPort();
166-
UrlTest::testAddBackslash();
167-
UrlTest::testPrevious();
168-
UrlTest::testRedirect();
169-
UrlTest::testAutoLink();
170-
UrlTest::testCustomAutoLink();
171-
UrlTest::testGenerateSafeSlug();
172-
UrlTest::testSegment();
173-
UrlTest::testGetFirstSegment();
174-
UrlTest::testGetLastSegment();
175-
```
148+
- [x] Completar tests
149+
- [ ] Mejorar la documentación
176150

177151
### Contribuir
178152
1. Comprobar si hay incidencias abiertas o abrir una nueva para iniciar una discusión en torno a un fallo o función.

README.md

Lines changed: 15 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# PHP Url library
22

3-
[![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)
3+
[![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)
44

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

@@ -14,23 +14,14 @@ Library for urls manipulation.
1414
- [Available Methods](#available-methods)
1515
- [Usage](#usage)
1616
- [Tests](#tests)
17+
- [TODO](#-todo)
1718
- [Contribute](#contribute)
1819
- [Repository](#repository)
1920
- [License](#license)
2021
- [Copyright](#copyright)
2122

2223
---
2324

24-
<p align="center"><strong>Take a look at the code</strong></p>
25-
26-
<p align="center">
27-
<a href="https://youtu.be/94V12hdQWiY" title="Take a look at the code">
28-
<img src="https://raw.githubusercontent.com/Josantonius/PHP-Algorithm/master/resources/youtube-thumbnail.jpg">
29-
</a>
30-
</p>
31-
32-
---
33-
3425
### Installation
3526

3627
The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
@@ -78,10 +69,12 @@ Url::previous();
7869
Url::redirect();
7970
Url::autoLink();
8071
Url::generateSafeSlug();
81-
Url::segment();
72+
Url::segmentUri();
8273
Url::getFirstSegment();
8374
Url::getLastSegment();
75+
Url::setUrlParams();
8476
```
77+
8578
### Usage
8679

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

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

145138
### Tests
146139

147-
To use the [test](tests) class, simply:
148-
149-
```php
150-
<?php
151-
$loader = require __DIR__ . '/vendor/autoload.php';
140+
To run [tests](tests/Url/Test) simply:
152141

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

155-
use Josantonius\Url\Tests\UrlTest;
146+
$ phpunit
156147

157-
```
158-
Available test methods in this library:
148+
### ☑ TODO
159149

160-
```php
161-
UrlTest::testGetCurrentPage();
162-
UrlTest::testGetProtocol();
163-
UrlTest::testIsSSL();
164-
UrlTest::getDomain();
165-
UrlTest::testGetUri();
166-
UrlTest::testGetUriMethods();
167-
UrlTest::testGetPort();
168-
UrlTest::testAddBackslash();
169-
UrlTest::testPrevious();
170-
UrlTest::testRedirect();
171-
UrlTest::testAutoLink();
172-
UrlTest::testCustomAutoLink();
173-
UrlTest::testGenerateSafeSlug();
174-
UrlTest::testSegment();
175-
UrlTest::testGetFirstSegment();
176-
UrlTest::testGetLastSegment();
177-
```
150+
- [x] Create tests
151+
- [ ] Improve documentation
178152

179153
### Contribute
154+
180155
1. Check for open issues or open a new issue to start a discussion around a bug or feature.
181156
1. Fork the repository on GitHub to start making your changes.
182157
1. Write one or more tests for the new feature or that expose the bug.

_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
theme: jekyll-theme-cayman

0 commit comments

Comments
 (0)