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

Commit 4a91d4e

Browse files
committed
Last update before archiving
1 parent 8f68e1d commit 4a91d4e

File tree

9 files changed

+278
-253
lines changed

9 files changed

+278
-253
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: [Josantonius]

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.git*/
1+
.git/
22
vendor/
33
docs/*.pyc
44
docs/_build
@@ -9,4 +9,7 @@ composer-test.lock
99
phpcbf-fixed.diff
1010
.idea
1111
.DS_STORE
12-
.php_cs.cache
12+
.php_cs.cache
13+
.repository.md
14+
php-database.code-workspace
15+
.vscode

CHANGELOG.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
# CHANGELOG
22

3+
## 1.2.1 - 2022-08-18
4+
5+
* The repository was archived.
6+
7+
* Fixed bug in `insert` and `update` methods of the `PDOprovider` class. Now correctly accepts null and boolean data types when the query is not prepared.
8+
9+
* The `$settings` attribute of the `Josantonius\Database\Database` class has been renamed to `$items`.
10+
11+
* The `$settings` attribute of the `Josantonius\Database\Database` class will now be used as a public attribute and will save an array with the database options passed by the user when connecting.
12+
13+
* Compatibility was added to refer to data types in prepared queries:
14+
15+
* boolean
16+
* integer
17+
* string
18+
19+
* `USE` was added as a valid query type.
20+
321
## 1.2.0 - 2018-02-25
422

523
* Some methods were modified to adapt them to the new version of Eliasis Framework.
@@ -40,15 +58,14 @@
4058

4159
* Changed `Josantonius\Database\Test\` namespace to `Josantonius\Database\` namespace .
4260

43-
4461
## 1.1.6 - 2017-09-26
4562

4663
* Unit tests supported by `PHPUnit` were added.
4764

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

5067
* Type attributes were deleted from HTML tags. Since HTML5 doesn't longer necessary.
51-
68+
5269
* Added `Database/src/bootstrap.php` file
5370

5471
* Added `Database/tests/bootstrap.php` file.
@@ -57,7 +74,7 @@
5774
* Added `Database/_config.yml` file.
5875
* Added `Database/.travis.yml` file.
5976

60-
* Renamed `Josantonius\Provider\PDOprovider` class to `Josantonius\Provider\PDOprovider\PDOprovider` class.
77+
* Renamed `Josantonius\Provider\PDOprovider` class to `Josantonius\Provider\PDOprovider\PDOprovider` class.
6178

6279
* Renamed `Josantonius\Provider\MSSQLprovider` class to `Josantonius\Provider\MSSQLprovider\MSSQLprovider` class.
6380

@@ -213,7 +230,7 @@
213230
],
214231
]
215232

216-
* Eliasis Framework url: https://github.com/Eliasis-Framework/Eliasis
233+
* Eliasis Framework url: <https://github.com/Eliasis-Framework/Eliasis>
217234

218235
## 1.1.3 - 2017-05-14
219236

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
The MIT License (MIT)
22
=====================
33

4-
Copyright (c) `2017 - 2018` `Josantonius, https://josantonius.com <[email protected]>`
4+
Copyright (c) 2017, Josantonius
55

66
Permission is hereby granted, free of charge, to any person obtaining a copy of
77
this software and associated documentation files (the "Software"), to deal in

README-ES.md

Lines changed: 62 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# PHP Database library
22

3-
[![Latest Stable Version](https://poser.pugx.org/josantonius/Database/v/stable)](https://packagist.org/packages/josantonius/Database) [![Latest Unstable Version](https://poser.pugx.org/josantonius/Database/v/unstable)](https://packagist.org/packages/josantonius/Database) [![License](https://poser.pugx.org/josantonius/Database/license)](LICENSE) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/bc05a7b06c554a3e844ece8f360a05ed)](https://www.codacy.com/app/Josantonius/PHP-Database?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=Josantonius/PHP-Database&amp;utm_campaign=Badge_Grade) [![Total Downloads](https://poser.pugx.org/josantonius/Database/downloads)](https://packagist.org/packages/josantonius/Database) [![Travis](https://travis-ci.org/Josantonius/PHP-Database.svg)](https://travis-ci.org/Josantonius/PHP-Database) [![PSR2](https://img.shields.io/badge/PSR-2-1abc9c.svg)](http://www.php-fig.org/psr/psr-2/) [![PSR4](https://img.shields.io/badge/PSR-4-9b59b6.svg)](http://www.php-fig.org/psr/psr-4/) [![CodeCov](https://codecov.io/gh/Josantonius/PHP-Database/branch/master/graph/badge.svg)](https://codecov.io/gh/Josantonius/PHP-Database)
3+
[![Latest Stable Version](https://poser.pugx.org/josantonius/Database/v/stable)](https://packagist.org/packages/josantonius/Database)
4+
[![License](https://poser.pugx.org/josantonius/Database/license)](LICENSE)
45

56
[English version](README.md)
67

@@ -21,49 +22,46 @@ Biblioteca para la administración de bases de datos SQL para ser utilizada por
2122
- [DELETE](#delete)
2223
- [TRUNCATE TABLE](#truncate)
2324
- [DROP TABLE](#drop)
25+
- [Tipos de datos soportados para sentencias preparadas](#tipos-de-datos-soportados-para-sentencias-preparadas)
2426
- [Tests](#tests)
25-
- [Tareas pendientes](#-tareas-pendientes)
26-
- [Manejador de excepciones](#manejador-de-excepciones)
27-
- [Contribuir](#contribuir)
28-
- [Repositorio](#repositorio)
27+
- [Patrocinar](#patrocinar)
2928
- [Licencia](#licencia)
30-
- [Copyright](#copyright)
3129

3230
---
3331

3432
## Requisitos
3533

3634
Esta clase es soportada por versiones de **PHP 5.6** o superiores y es compatible con versiones de **HHVM 3.0** o superiores.
3735

38-
## Instalación
36+
## Instalación
3937

4038
La mejor forma de instalar esta extensión es a través de [Composer](http://getcomposer.org/download/).
4139

4240
Para instalar **PHP Database library**, simplemente escribe:
4341

44-
$ composer require Josantonius/Database
42+
composer require Josantonius/Database
4543

4644
El comando anterior sólo instalará los archivos necesarios, si prefieres **descargar todo el código fuente** puedes utilizar:
4745

48-
$ composer require Josantonius/Database --prefer-source
46+
composer require Josantonius/Database --prefer-source
4947

5048
También puedes **clonar el repositorio** completo con Git:
5149

52-
$ git clone https://github.com/Josantonius/PHP-Database.git
50+
git clone https://github.com/Josantonius/PHP-Database.git
5351

5452
O **instalarlo manualmente**:
5553

5654
Descargar [Database.php](https://raw.githubusercontent.com/Josantonius/PHP-Database/master/src/Database.php), [Provider.php](https://raw.githubusercontent.com/Josantonius/PHP-Database/master/src/Provider/Provider.php), [PDOprovider.php](https://raw.githubusercontent.com/Josantonius/PHP-Database/master/src/Provider/PDOprovider.php), [MSSQLprovider.php](https://raw.githubusercontent.com/Josantonius/PHP-Database/master/src/Provider/MSSQLprovider.php) and [DBException.php](https://raw.githubusercontent.com/Josantonius/PHP-Database/master/src/Exception/DBException.php):
5755

58-
$ wget https://raw.githubusercontent.com/Josantonius/PHP-Database/master/src/Database.php
59-
$ wget https://raw.githubusercontent.com/Josantonius/PHP-Database/master/src/Provider/Provider.php
60-
$ wget https://raw.githubusercontent.com/Josantonius/PHP-Database/master/src/Provider/PDOprovider.php
61-
$ wget https://raw.githubusercontent.com/Josantonius/PHP-Database/master/src/Provider/MSSQLprovider.php
62-
$ wget https://raw.githubusercontent.com/Josantonius/PHP-Database/master/src/Exception/DBException.php
56+
wget https://raw.githubusercontent.com/Josantonius/PHP-Database/master/src/Database.php
57+
wget https://raw.githubusercontent.com/Josantonius/PHP-Database/master/src/Provider/Provider.php
58+
wget https://raw.githubusercontent.com/Josantonius/PHP-Database/master/src/Provider/PDOprovider.php
59+
wget https://raw.githubusercontent.com/Josantonius/PHP-Database/master/src/Provider/MSSQLprovider.php
60+
wget https://raw.githubusercontent.com/Josantonius/PHP-Database/master/src/Exception/DBException.php
6361

6462
## Get connection
6563

66-
### - Get connection:
64+
### - Get connection
6765

6866
```php
6967
Database::getConnection($id, $provider, $host, $user, $name, $password, $settings);
@@ -76,11 +74,11 @@ Database::getConnection($id, $provider, $host, $user, $name, $password, $setting
7674
| $host | Host. | string | No | null |
7775
| $user | Usuario. | string | No | null |
7876
| $name | Nombre. | string | No | null |
79-
| $password | Password . | string | No | null |
77+
| $password | Password. | string | No | null |
8078

8179
| Attribute | Key | Description | Type | Required | Default
8280
| --- | --- | --- | --- | --- | --- |
83-
| $settings | | Opciones | array | No | null |
81+
| $settings | | Opciones. Una vez realizada la conexión, esta configuración estará disponible en el objeto de conexión a la base de datos: $db->settings. | array | No | null |
8482
| $settings | 'port' | Puerto. | string | No | |
8583
| $settings | 'charset' | Charset. | string | No | |
8684

@@ -116,7 +114,7 @@ $externalDB = Database::getConnection('external');
116114

117115
## Query
118116

119-
### - Procesar la consulta y prepararla para el proveedor:
117+
### - Procesar la consulta y prepararla para el proveedor
120118

121119
```php
122120
$db->query($query, $statements, $result);
@@ -161,7 +159,7 @@ $db->query(
161159

162160
## CREATE TABLE
163161

164-
### - CREATE TABLE:
162+
### - CREATE TABLE
165163

166164
```php
167165
$db->create($data)
@@ -220,7 +218,7 @@ $db->create($params)
220218

221219
## SELECT
222220

223-
### - Declaración SELECT:
221+
### - Declaración SELECT
224222

225223
```php
226224
$db->select($columns)
@@ -288,7 +286,7 @@ $db->select('name')
288286

289287
## INSERT INTO
290288

291-
### - Declaración INSERT INTO:
289+
### - Declaración INSERT INTO
292290

293291
```php
294292
$db->insert($data, $statements)
@@ -347,7 +345,7 @@ $db->insert($data, $statements)
347345

348346
## UPDATE
349347

350-
### - Declaración UPDATE:
348+
### - Declaración UPDATE
351349

352350
```php
353351
$db->update($data, $statements)
@@ -367,7 +365,7 @@ $db->update($data, $statements)
367365
| | $statements | Declaraciones preparadas. | array | No | null |
368366
| execute() | | Ejecutar consulta. | method || |
369367

370-
**# Return** (int) → número de filas afectadas
368+
**# Return** (int) → número de filas afectadas
371369

372370
```php
373371
#UPDATE ejemplo básico
@@ -438,7 +436,7 @@ $db->update($data, $statements['data'])
438436

439437
## REPLACE
440438

441-
### - Reemplazar una línea en una tabla si existe o insertar una nueva línea si no existe:
439+
### - Reemplazar una línea en una tabla si existe o insertar una nueva línea si no existe
442440

443441
```php
444442
$db->replace($data, $statements)
@@ -500,7 +498,7 @@ $db->replace($data, $statements)
500498

501499
## DELETE
502500

503-
### - Declaración DELETE:
501+
### - Declaración DELETE
504502

505503
```php
506504
$db->delete($data, $statements)
@@ -520,7 +518,7 @@ $db->delete($data, $statements)
520518
| | $statements | Declaraciones preparadas. | array | No | null |
521519
| execute() | | Ejecutar consulta. | method || |
522520

523-
**# Return** (int) → número de filas afectadas
521+
**# Return** (int) → número de filas afectadas
524522

525523
```php
526524
#DELETE all
@@ -567,7 +565,7 @@ $db->delete()
567565

568566
## TRUNCATE TABLE
569567

570-
### - Declaración TRUNCATE TABLE:
568+
### - Declaración TRUNCATE TABLE
571569

572570
```php
573571
$db->truncate()
@@ -591,7 +589,7 @@ $db->truncate()
591589

592590
## DROP TABLE
593591

594-
### - Declaración DROP TABLE:
592+
### - Declaración DROP TABLE
595593

596594
```php
597595
$db->drop()
@@ -613,70 +611,65 @@ $db->drop()
613611
->execute();
614612
```
615613

616-
## Tests
614+
## Tipos de datos soportados para sentencias preparadas
617615

618-
Para ejecutar las [pruebas](tests) necesitarás [Composer](http://getcomposer.org/download/) y seguir los siguientes pasos:
616+
### Booleano
619617

620-
$ git clone https://github.com/Josantonius/PHP-Database.git
621-
622-
$ cd PHP-Database
618+
- bool
619+
- boolean
623620

624-
$ composer install
621+
### Nulo
625622

626-
Ejecutar pruebas unitarias con [PHPUnit](https://phpunit.de/):
623+
- null
627624

628-
$ composer phpunit
625+
### Números enteros
629626

630-
Ejecutar pruebas de estándares de código [PSR2](http://www.php-fig.org/psr/psr-2/) con [PHPCS](https://github.com/squizlabs/PHP_CodeSniffer):
627+
- int
628+
- integer
631629

632-
$ composer phpcs
630+
### Cadenas de texto
633631

634-
Ejecutar pruebas con [PHP Mess Detector](https://phpmd.org/) para detectar inconsistencias en el estilo de codificación:
632+
- str
633+
- string
635634

636-
$ composer phpmd
635+
**Si algún tipo de dato no coincide con los anteriores, será validado como una cadena de texto.**
637636

638-
Ejecutar todas las pruebas anteriores:
637+
**Si no se especifica ningún tipo de dato, el tipo de dato no será validado en la consulta preparada.**
639638

640-
$ composer tests
639+
## Tests
641640

642-
## ☑ Tareas pendientes
641+
Para ejecutar las [pruebas](tests) necesitarás [Composer](http://getcomposer.org/download/) y seguir los siguientes pasos:
643642

644-
- [ ] Añadir nueva funcionalidad.
645-
- [ ] Mejorar pruebas.
646-
- [ ] Mejorar documentación.
647-
- [ ] Refactorizar código para las reglas de estilo de código deshabilitadas. Ver [phpmd.xml](phpmd.xml) y [.php_cs.dist](.php_cs.dist).
643+
git clone https://github.com/Josantonius/PHP-Database.git
644+
645+
cd PHP-Database
648646

649-
## Manejador de excepciones
647+
composer install
650648

651-
Esta biblioteca utiliza [control de excepciones](src/Exception) que puedes personalizar a tu gusto.
649+
Ejecutar pruebas unitarias con [PHPUnit](https://phpunit.de/):
652650

653-
## Contribuir
651+
composer phpunit
654652

655-
Si deseas colaborar, puedes echar un vistazo a la lista de
656-
[issues](https://github.com/Josantonius/PHP-Database/issues) o [tareas pendientes](#-tareas-pendientes).
653+
Ejecutar pruebas de estándares de código [PSR2](http://www.php-fig.org/psr/psr-2/) con [PHPCS](https://github.com/squizlabs/PHP_CodeSniffer):
657654

658-
**Pull requests**
655+
composer phpcs
659656

660-
* [Fork and clone](https://help.github.com/articles/fork-a-repo).
661-
* Ejecuta el comando `composer install` para instalar dependencias.
662-
Esto también instalará las [dependencias de desarrollo](https://getcomposer.org/doc/03-cli.md#install).
663-
* Ejecuta el comando `composer fix` para estandarizar el código.
664-
* Ejecuta las [pruebas](#tests).
665-
* Crea una nueva rama (**branch**), **commit**, **push** y envíame un
666-
[pull request](https://help.github.com/articles/using-pull-requests).
657+
Ejecutar pruebas con [PHP Mess Detector](https://phpmd.org/) para detectar inconsistencias en el estilo de codificación:
667658

668-
## Repositorio
659+
composer phpmd
669660

670-
La estructura de archivos de este repositorio se creó con [PHP-Skeleton](https://github.com/Josantonius/PHP-Skeleton).
661+
Ejecutar todas las pruebas anteriores:
671662

672-
## Licencia
663+
composer tests
673664

674-
Este proyecto está licenciado bajo **licencia MIT**. Consulta el archivo [LICENSE](LICENSE) para más información.
665+
## Patrocinar
675666

676-
## Copyright
667+
Si este proyecto te ayuda a reducir el tiempo de desarrollo,
668+
[puedes patrocinarme](https://github.com/josantonius/lang/es-ES/README.md#patrocinar)
669+
para apoyar mi trabajo :blush:
677670

678-
2017 - 2018 Josantonius, [josantonius.com](https://josantonius.com/)
671+
## Licencia
679672

680-
Si te ha resultado útil, házmelo saber :wink:
673+
Este repositorio tiene una licencia [MIT License](LICENSE).
681674

682-
Puedes contactarme en [Twitter](https://twitter.com/Josantonius) o a través de mi [correo electrónico](mailto:hello@josantonius.com).
675+
Copyright © 2017-2022, [Josantonius](https://github.com/josantonius/lang/es-ES/README.md#contacto)

0 commit comments

Comments
 (0)