Skip to content
This repository was archived by the owner on Aug 19, 2022. It is now read-only.

Commit 43aee58

Browse files
committed
Initial upload files
0 parents  commit 43aee58

12 files changed

+815
-0
lines changed

.editorconfig

+12
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

+12
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

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# CHANGELOG
2+
3+
## 1.0.0 - 2017-01-17
4+
* Added `Josantonius\Request\Request` class.
5+
* Added `Josantonius\Request\Request::get()` method.
6+
* Added `Josantonius\Request\Request::post()` method.
7+
* Added `Josantonius\Request\Request::files()` method.
8+
* Added `Josantonius\Request\Request::put()` method.
9+
* Added `Josantonius\Request\Request::del()` method.
10+
* Added `Josantonius\Request\Request::isGet()` method.
11+
* Added `Josantonius\Request\Request::isPost()` method.
12+
* Added `Josantonius\Request\Request::isPut()` method.
13+
* Added `Josantonius\Request\Request::isDelete()` method.
14+
* Added `Josantonius\Request\Request::isAjax()` method.
15+
16+
## 1.0.0 - 2017-01-17
17+
* Added `Josantonius\Request\Exception\RequestException` class.
18+
* Added `Josantonius\Request\Exception\Exceptions` abstract class.
19+
* Added `Josantonius\Request\Exception\RequestException->__construct()` method.
20+
21+
## 1.0.0 - 2017-01-17
22+
* Added `Josantonius\Request\Tests\RequestTest` class.
23+
* Added `Josantonius\Request\Tests\RequestTest::testGet()` method.
24+
* Added `Josantonius\Request\Tests\RequestTest::testGetSpecificKey()` method.
25+
* Added `Josantonius\Request\Tests\RequestTest::testPost()` method.
26+
* Added `Josantonius\Request\Tests\RequestTest::testPostSpecificKey()` method.
27+
* Added `Josantonius\Request\Tests\RequestTest::testFiles()` method.
28+
* Added `Josantonius\Request\Tests\RequestTest::testFilesSpecificKey()` method.
29+
* Added `Josantonius\Request\Tests\RequestTest::testPut()` method.
30+
* Added `Josantonius\Request\Tests\RequestTest::testPutSpecificKey()` method.
31+
* Added `Josantonius\Request\Tests\RequestTest::testDel()` method.
32+
* Added `Josantonius\Request\Tests\RequestTest::testDelSpecificKey()` method.
33+
* Added `Josantonius\Request\Tests\RequestTest::testIsGet()` method.
34+
* Added `Josantonius\Request\Tests\RequestTest::testIsPost()` method.
35+
* Added `Josantonius\Request\Tests\RequestTest::testIsPut()` method.
36+
* Added `Josantonius\Request\Tests\RequestTest::testIsDelete()` method.
37+
* Added `Josantonius\Request\Tests\RequestTest::testIsAjax()` method.

CONDUCT.md

+22
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/)

LICENSE

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License (MIT)
2+
=====================
3+
4+
Copyright (c) `2017` `Josantonius, https://github.com/Josantonius <[email protected]>`
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy of
7+
this software and associated documentation files (the "Software"), to deal in
8+
the Software without restriction, including without limitation the rights to
9+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
10+
of the Software, and to permit persons to whom the Software is furnished to do
11+
so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
SOFTWARE.

README-ES.md

+134
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
# PHP Request library
2+
3+
[![Latest Stable Version](https://poser.pugx.org/josantonius/request/v/stable)](https://packagist.org/packages/josantonius/request) [![Total Downloads](https://poser.pugx.org/josantonius/request/downloads)](https://packagist.org/packages/josantonius/request) [![Latest Unstable Version](https://poser.pugx.org/josantonius/request/v/unstable)](https://packagist.org/packages/josantonius/request) [![License](https://poser.pugx.org/josantonius/request/license)](https://packagist.org/packages/josantonius/request)
4+
5+
[Spanish version](README-ES.md)
6+
7+
Librería PHP para manejo de peticiones.
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+
- [Autor](#autor)
21+
- [Licencia](#licencia)
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 Request library, simplemente escribe:
30+
31+
$ composer require Josantonius/Request
32+
33+
### Requisitos
34+
35+
Esta ĺibrería es soportada por versiones de PHP 7.0 o superiores y es compatible con versiones de HHVM 3.0 o superiores.
36+
37+
Para utilizar esta librería en HHVM (HipHop Virtual Machine) tendrás que activar los tipos escalares. Añade la siguiente ĺínea "hhvm.php7.scalar_types = true" en tu "/etc/hhvm/php.ini".
38+
39+
### Cómo empezar y ejemplos
40+
41+
Para utilizar esta librería, simplemente:
42+
43+
```php
44+
require __DIR__ . '/vendor/autoload.php';
45+
46+
use Josantonius\Request\Request;
47+
```
48+
### Métodos disponibles
49+
50+
Métodos disponibles en esta librería:
51+
52+
```php
53+
Request::get();
54+
Request::post();
55+
Request::files();
56+
Request::put();
57+
Request::del();
58+
Request::isGet();
59+
Request::isPost();
60+
Request::isPut();
61+
Request::isDelete();
62+
Request::isAjax();
63+
```
64+
### Uso
65+
66+
Ejemplo de uso para esta librería:
67+
68+
```php
69+
<?php
70+
require __DIR__ . '/vendor/autoload.php';
71+
72+
use Josantonius\Request\Request;
73+
74+
if (Request::isPost()) {
75+
76+
$name = Request::post('name');
77+
}
78+
```
79+
80+
### Tests
81+
82+
Para utilizar la clase de [pruebas](tests), simplemente:
83+
84+
```php
85+
<?php
86+
$loader = require __DIR__ . '/vendor/autoload.php';
87+
88+
$loader->addPsr4('Josantonius\\Request\\Tests\\', __DIR__ . '/vendor/josantonius/request/tests');
89+
90+
use Josantonius\Request\Tests\RequestTest;
91+
```
92+
Métodos de prueba disponibles en esta librería:
93+
94+
```php
95+
RequestTest::testGet();
96+
RequestTest::testGetSpecificKey();
97+
RequestTest::testPost();
98+
RequestTest::testPostSpecificKey();
99+
RequestTest::testFiles();
100+
RequestTest::testFilesSpecificKey();
101+
RequestTest::testPut();
102+
RequestTest::testPutSpecificKey();
103+
RequestTest::testDel();
104+
RequestTest::testDelSpecificKey();
105+
RequestTest::testIsGet();
106+
RequestTest::testIsPost();
107+
RequestTest::testIsPut();
108+
RequestTest::testIsDelete();
109+
RequestTest::testIsAjax();
110+
```
111+
112+
### Manejador de excepciones
113+
114+
Esta librería utiliza [control de excepciones](src/Exception) que puedes personalizar a tu gusto.
115+
### Contribuir
116+
1. Comprobar si hay incidencias abiertas o abrir una nueva para iniciar una discusión en torno a un fallo o función.
117+
1. Bifurca la rama del repositorio en GitHub para iniciar la operación de ajuste.
118+
1. Escribe una o más pruebas para la nueva característica o expón el error.
119+
1. Haz cambios en el código para implementar la característica o reparar el fallo.
120+
1. Envía pull request para fusionar los cambios y que sean publicados.
121+
122+
Esto está pensado para proyectos grandes y de larga duración.
123+
124+
### Repositorio
125+
126+
Los archivos de este repositorio se crearon y subieron automáticamente con [Reposgit Creator](https://github.com/Josantonius/BASH-Reposgit).
127+
128+
### Autor
129+
130+
Mantenido por [Josantonius](https://github.com/Josantonius/).
131+
132+
### Licencia
133+
134+
Este proyecto está licenciado bajo la **licencia MIT**. Consulta el archivo [LICENSE](LICENSE) para más información.

README.md

+135
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
# PHP Request library
2+
3+
[![Latest Stable Version](https://poser.pugx.org/josantonius/request/v/stable)](https://packagist.org/packages/josantonius/request) [![Total Downloads](https://poser.pugx.org/josantonius/request/downloads)](https://packagist.org/packages/josantonius/request) [![Latest Unstable Version](https://poser.pugx.org/josantonius/request/v/unstable)](https://packagist.org/packages/josantonius/request) [![License](https://poser.pugx.org/josantonius/request/license)](https://packagist.org/packages/josantonius/request)
4+
5+
[Spanish version](README-ES.md)
6+
7+
PHP library for handling requests.
8+
9+
---
10+
11+
- [Installation](#installation)
12+
- [Requirements](#requirements)
13+
- [Quick Start and Examples](#quick-start-and-examples)
14+
- [Available Methods](#available-methods)
15+
- [Usage](#usage)
16+
- [Tests](#tests)
17+
- [Exception Handler](#exception-handler)
18+
- [Contribute](#contribute)
19+
- [Repository](#repository)
20+
- [Author](#author)
21+
- [Licensing](#licensing)
22+
23+
---
24+
25+
### Installation
26+
27+
The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
28+
29+
To install PHP Request library, simply:
30+
31+
$ composer require Josantonius/Request
32+
33+
### Requirements
34+
35+
This library is supported by PHP versions 7.0 or higher and is compatible with HHVM versions 3.0 or higher.
36+
37+
To use this library in HHVM (HipHop Virtual Machine) you will have to activate the scalar types. Add the following line "hhvm.php7.scalar_types = true" in your "/etc/hhvm/php.ini".
38+
39+
### Quick Start and Examples
40+
41+
To use this class, simply:
42+
43+
```php
44+
require __DIR__ . '/vendor/autoload.php';
45+
46+
use Josantonius\Request\Request;
47+
```
48+
### Available Methods
49+
50+
Available methods in this library:
51+
52+
```php
53+
Request::get();
54+
Request::post();
55+
Request::files();
56+
Request::put();
57+
Request::del();
58+
Request::isGet();
59+
Request::isPost();
60+
Request::isPut();
61+
Request::isDelete();
62+
Request::isAjax();
63+
```
64+
### Usage
65+
66+
Example of use for this library:
67+
68+
```php
69+
<?php
70+
require __DIR__ . '/vendor/autoload.php';
71+
72+
use Josantonius\Request\Request;
73+
74+
if (Request::isPost()) {
75+
76+
$name = Request::post('name');
77+
}
78+
```
79+
80+
### Tests
81+
82+
To use the [test](tests) class, simply:
83+
84+
```php
85+
<?php
86+
$loader = require __DIR__ . '/vendor/autoload.php';
87+
88+
$loader->addPsr4('Josantonius\\Request\\Tests\\', __DIR__ . '/vendor/josantonius/request/tests');
89+
90+
use Josantonius\Request\Tests\RequestTest;
91+
92+
```
93+
Available test methods in this library:
94+
95+
```php
96+
RequestTest::testGet();
97+
RequestTest::testGetSpecificKey();
98+
RequestTest::testPost();
99+
RequestTest::testPostSpecificKey();
100+
RequestTest::testFiles();
101+
RequestTest::testFilesSpecificKey();
102+
RequestTest::testPut();
103+
RequestTest::testPutSpecificKey();
104+
RequestTest::testDel();
105+
RequestTest::testDelSpecificKey();
106+
RequestTest::testIsGet();
107+
RequestTest::testIsPost();
108+
RequestTest::testIsPut();
109+
RequestTest::testIsDelete();
110+
RequestTest::testIsAjax();
111+
```
112+
113+
### Exception Handler
114+
115+
This library uses [exception handler](src/Exception) that you can customize.
116+
### Contribute
117+
1. Check for open issues or open a new issue to start a discussion around a bug or feature.
118+
1. Fork the repository on GitHub to start making your changes.
119+
1. Write one or more tests for the new feature or that expose the bug.
120+
1. Make code changes to implement the feature or fix the bug.
121+
1. Send a pull request to get your changes merged and published.
122+
123+
This is intended for large and long-lived objects.
124+
125+
### Repository
126+
127+
All files in this repository were created and uploaded automatically with [Reposgit Creator](https://github.com/Josantonius/BASH-Reposgit).
128+
129+
### Author
130+
131+
Maintained by [Josantonius](https://github.com/Josantonius/).
132+
133+
### Licensing
134+
135+
This project is licensed under **MIT license**. See the [LICENSE](LICENSE) file for more info.

0 commit comments

Comments
 (0)