Skip to content

Commit 4b0b74b

Browse files
committed
The repository was updated to version 1.1.1
1 parent beac4fc commit 4b0b74b

File tree

9 files changed

+635
-0
lines changed

9 files changed

+635
-0
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_size = 4
6+
indent_style = space
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
phpunit.xml
2+
composer.phar
3+
composer.lock
4+
composer-test.lock
5+
vendor/
6+
build/artifacts/
7+
artifacts/
8+
docs/_build
9+
docs/*.pyc
10+
.git*/
11+
.idea
12+
.DS_STORE

CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# CHANGELOG
2+
3+
## 1.1.1 - 2017-03-18
4+
* Some files were excluded from download and comments and readme files were updated.
5+
6+
## 1.1.0 - 2017-01-30
7+
* Compatible with PHP 5.6 or higher.
8+
9+
## 1.0.0 - 2017-01-30
10+
* Compatible only with PHP 7.0 or higher. In the next versions, the library will be modified to make it compatible with PHP 5.6 or higher.
11+
12+
## 1.0.0 - 2016-12-19
13+
* Added `Josantonius\HTTPStatusCode\HTTPStatusCode` class.
14+
* Added `Josantonius\HTTPStatusCode\HTTPStatusCode::load()` method.
15+
* Added `Josantonius\HTTPStatusCode\HTTPStatusCode::get()` method.
16+
* Added `Josantonius\HTTPStatusCode\HTTPStatusCode::getAll()` method.
17+
18+
## 1.0.0 - 2016-12-19
19+
* Added `Josantonius\HTTPStatusCode\Exception\HTTPStatusCodeException` class.
20+
* Added `Josantonius\HTTPStatusCode\Exception\Exceptions` abstract class.
21+
* Added `Josantonius\HTTPStatusCode\Exception\HTTPStatusCodeException->__construct()` method.
22+
23+
## 1.0.0 - 2016-12-19
24+
* Added `Josantonius\HTTPStatusCode\Tests\HTTPStatusCodeTest` class.
25+
* Added `Josantonius\HTTPStatusCode\Tests\HTTPStatusCodeTest::testLoad()` method.
26+
* Added `Josantonius\HTTPStatusCode\Tests\HTTPStatusCodeTest::testLoadES()` method.
27+
* Added `Josantonius\HTTPStatusCode\Tests\HTTPStatusCodeTest::testGetEN()` method.
28+
* Added `Josantonius\HTTPStatusCode\Tests\HTTPStatusCodeTest::testGetES()` method.
29+
* Added `Josantonius\HTTPStatusCode\Tests\HTTPStatusCodeTest::testGetLargeEN()` method.
30+
* Added `Josantonius\HTTPStatusCode\Tests\HTTPStatusCodeTest::testGetLargeES()` method.
31+
* Added `Josantonius\HTTPStatusCode\Tests\HTTPStatusCodeTest::testGetShortEN()` method.
32+
* Added `Josantonius\HTTPStatusCode\Tests\HTTPStatusCodeTest::testGetShortES()` method.
33+
* Added `Josantonius\HTTPStatusCode\Tests\HTTPStatusCodeTest::testGetUndefinedEN()` method.
34+
* Added `Josantonius\HTTPStatusCode\Tests\HTTPStatusCodeTest::testGetUndefinedES()` method.
35+
* Added `Josantonius\HTTPStatusCode\Tests\HTTPStatusCodeTest::testGetAllEN()` method.
36+
* Added `Josantonius\HTTPStatusCode\Tests\HTTPStatusCodeTest::testGetAllES()` method.

CONDUCT.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Contributor Code of Conduct
2+
3+
As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4+
5+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality.
6+
7+
Examples of unacceptable behavior by participants include:
8+
9+
* The use of sexualized language or imagery
10+
* Personal attacks
11+
* Trolling or insulting/derogatory comments
12+
* Public or private harassment
13+
* Publishing other's private information, such as physical or electronic addresses, without explicit permission
14+
* Other unethical or unprofessional conduct.
15+
16+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team.
17+
18+
This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community in a direct capacity. Personal views, beliefs and values of individuals do not necessarily reflect those of the organisation or affiliated individuals and organisations.
19+
20+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
21+
22+
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/)

README-ES.md

Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
# PHP HTTPStatusCode library
2+
3+
[![Latest Stable Version](https://poser.pugx.org/josantonius/httpstatuscode/v/stable)](https://packagist.org/packages/josantonius/httpstatuscode) [![Total Downloads](https://poser.pugx.org/josantonius/httpstatuscode/downloads)](https://packagist.org/packages/josantonius/httpstatuscode) [![Latest Unstable Version](https://poser.pugx.org/josantonius/httpstatuscode/v/unstable)](https://packagist.org/packages/josantonius/httpstatuscode) [![License](https://poser.pugx.org/josantonius/httpstatuscode/license)](https://packagist.org/packages/josantonius/httpstatuscode)
4+
5+
[English version](README.md)
6+
7+
Librería PHP para obtener significado de códigos de estado de respuesta HTTP.
8+
9+
---
10+
11+
- [Instalación](#instalación)
12+
- [Requisitos](#requisitos)
13+
- [Cómo empezar y ejemplos](#cómo-empezar-y-ejemplos)
14+
- [Métodos disponibles](#métodos-disponibles)
15+
- [Uso](#uso)
16+
- [Tests](#tests)
17+
- [Manejador de excepciones](#manejador-de-excepciones)
18+
- [Contribuir](#contribuir)
19+
- [Repositorio](#repositorio)
20+
- [Licencia](#licencia)
21+
- [Copyright](#copyright)
22+
23+
---
24+
25+
### Instalación
26+
27+
La mejor forma de instalar esta extensión es a través de [composer](http://getcomposer.org/download/).
28+
29+
Para instalar PHP HTTPStatusCode library, simplemente escribe:
30+
31+
$ composer require Josantonius/HTTPStatusCode
32+
33+
El comando anterior solamente instalará los archivos necesarios, si prefieres descargar todo el código, incluyendo tests, puedes utilizar:
34+
35+
$ composer require Josantonius/HTTPStatusCode --prefer-source
36+
37+
También puedes clonar el repositorio completo con Git:
38+
39+
$ git clone https://github.com/Josantonius/PHP-HTTPStatusCode.git
40+
41+
### Requisitos
42+
43+
Esta ĺibrería es soportada por versiones de PHP 5.6 o superiores y es compatible con versiones de HHVM 3.0 o superiores.
44+
45+
### Cómo empezar y ejemplos
46+
47+
Para utilizar esta librería, simplemente:
48+
49+
```php
50+
require __DIR__ . '/vendor/autoload.php';
51+
52+
use Josantonius\HTTPStatusCode\HTTPStatusCode;
53+
```
54+
### Métodos disponibles
55+
56+
Métodos disponibles en esta librería:
57+
58+
```php
59+
HTTPStatusCode::load();
60+
HTTPStatusCode::get();
61+
HTTPStatusCode::getAll();
62+
```
63+
### Uso
64+
65+
Ejemplo de uso para esta librería:
66+
67+
```php
68+
<?php
69+
require __DIR__ . '/vendor/autoload.php';
70+
71+
use Josantonius\HTTPStatusCode\HTTPStatusCode;
72+
73+
### Obtener significado corto
74+
75+
echo "<br>[200] · " . HTTPStatusCode::get(100);
76+
echo "<br>[200] · " . HTTPStatusCode::get(100, 'es');
77+
78+
/*
79+
[100] · Continue
80+
[100] · Continuar
81+
*/
82+
83+
### Obtener significado detallado
84+
85+
echo "<br>[100] · " . HTTPStatusCode::get(100, 'es', 'large');
86+
echo "<br>[100] · " . HTTPStatusCode::get(100, 'en', 'large');
87+
88+
/*
89+
[100] · El navegador puede continuar realizando su petición (se utiliza para indicar que la primera parte de la petición del navegador se ha recibido correctamente).
90+
[100] · The server has received the request headers and the client should proceed to send the request body (in the case of a request for which a body needs to be sent; for example, a POST request). Sending a large request body to a server after a request has been rejected for inappropriate headers would be inefficient. To have a server check the request's headers, a client must send Expect: 100-continue as a header in its initial request and receive a 100 Continue status code in response before sending the body. The response 417 Expectation Failed indicates the request should not be continued.
91+
*/
92+
93+
### Obtener un array con todos los significados y códigos de estado HTTP en inglés
94+
95+
$HTTPStatusCodes = HTTPStatusCode::getAll();
96+
97+
echo '<pre>'; var_dump($HTTPStatusCodes); echo '</pre>';
98+
99+
/*
100+
array(67) {
101+
["1xx"]=>
102+
array(2) {
103+
["short"]=>
104+
string(13) "Informational"
105+
["large"]=>
106+
string(339) "Request received, continuing process. This class of status code indicates a provisional response, consisting only of the Status-Line and optional headers, and is terminated by an empty line. Since HTTP/1.0 did not define any 1xx status codes, servers must not send a 1xx response to an HTTP/1.0 client except under experimental conditions."
107+
}
108+
(...)
109+
*/
110+
111+
### Obtener un array con todos los significados y códigos de estado HTTP en español
112+
113+
$HTTPStatusCodes = HTTPStatusCode::getAll('es');
114+
115+
echo '<pre>'; var_dump($HTTPStatusCodes); echo '</pre>';
116+
117+
/*
118+
array(67) {
119+
["1xx"]=>
120+
array(2) {
121+
["short"]=>
122+
string(23) "Respuestas informativas"
123+
["large"]=>
124+
string(875) "Petición recibida, continuando proceso. Esta respuesta significa que el servidor ha recibido los encabezados de la petición, y que el cliente debería proceder a enviar el cuerpo de la misma (en el caso de peticiones para las cuales el cuerpo necesita ser enviado; por ejemplo, una petición Hypertext Transfer Protocol). Si el cuerpo de la petición es largo, es ineficiente enviarlo a un servidor, cuando la petición ha sido ya rechazada, debido a encabezados inapropiados. Para hacer que un servidor cheque si la petición podría ser aceptada basada únicamente en los encabezados de la petición, el cliente debe enviar Expect: 100-continue como un encabezado en su petición inicial (vea Plantilla:Web-RFC: Expect header) y verificar si un código de estado 100 Continue es recibido en respuesta, antes de continuar (o recibir 417 Expectation Failed y no continuar)."
125+
}
126+
(...)
127+
*/
128+
```
129+
130+
### Tests
131+
132+
Para utilizar la clase de [pruebas](tests), simplemente:
133+
134+
```php
135+
<?php
136+
$loader = require __DIR__ . '/vendor/autoload.php';
137+
138+
$loader->addPsr4('Josantonius\\HTTPStatusCode\\Tests\\', __DIR__ . '/vendor/josantonius/httpstatuscode/tests');
139+
140+
use Josantonius\HTTPStatusCode\Tests\HTTPStatusCodeTest;
141+
```
142+
Métodos de prueba disponibles en esta librería:
143+
144+
```php
145+
HTTPStatusCodeTest::testLoad();
146+
HTTPStatusCodeTest::testLoadES();
147+
HTTPStatusCodeTest::testGetEN();
148+
HTTPStatusCodeTest::testGetES();
149+
HTTPStatusCodeTest::testGetLargeEN();
150+
HTTPStatusCodeTest::testGetLargeES();
151+
HTTPStatusCodeTest::testGetShortEN();
152+
HTTPStatusCodeTest::testGetShortES();
153+
HTTPStatusCodeTest::testGetUndefinedEN();
154+
HTTPStatusCodeTest::testGetUndefinedES();
155+
HTTPStatusCodeTest::testGetAllEN();
156+
HTTPStatusCodeTest::testGetAllES();
157+
```
158+
159+
### Manejador de excepciones
160+
161+
Esta librería utiliza [control de excepciones](src/Exception) que puedes personalizar a tu gusto.
162+
### Contribuir
163+
1. Comprobar si hay incidencias abiertas o abrir una nueva para iniciar una discusión en torno a un fallo o función.
164+
1. Bifurca la rama del repositorio en GitHub para iniciar la operación de ajuste.
165+
1. Escribe una o más pruebas para la nueva característica o expón el error.
166+
1. Haz cambios en el código para implementar la característica o reparar el fallo.
167+
1. Envía pull request para fusionar los cambios y que sean publicados.
168+
169+
Esto está pensado para proyectos grandes y de larga duración.
170+
171+
### Repositorio
172+
173+
Los archivos de este repositorio se crearon y subieron automáticamente con [Reposgit Creator](https://github.com/Josantonius/BASH-Reposgit).
174+
175+
### Licencia
176+
177+
Este proyecto está licenciado bajo **licencia MIT**. Consulta el archivo [LICENSE](LICENSE) para más información.
178+
179+
## Copyright
180+
181+
2017 Josantonius, [josantonius.com](https://josantonius.com/)
182+
183+
Si te ha resultado útil, házmelo saber :wink:
184+
185+
Puedes contactarme en [Twitter](https://twitter.com/Josantonius) o a través de mi [correo electrónico](mailto:hello@josantonius.com).

0 commit comments

Comments
 (0)