Skip to content

Commit a769a96

Browse files
committed
Merge branch 'v3', master is ezSQL 3.0.8, archive ezSQL 2.1.7 to v2 branch
2 parents 7e6629c + cfab2cb commit a769a96

File tree

144 files changed

+40622
-8766
lines changed

Some content is hidden

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

144 files changed

+40622
-8766
lines changed

.gitignore

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
1+
/nbproject/private/
2+
/nbproject/
3+
~
4+
~*.*
5+
*.lock
26
clover.xml
3-
composer.lock
7+
*.sqlite
8+
*.sqlite3
49
vendor
10+
build/logs/clover.xml
11+
tests/pdo/ez_test.sqlite
12+
tests/sqlite/ez_test.sqlite
13+
tests/sqlite/ez_test.sqlite3

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,11 @@ before_script:
2525
- psql -c "CREATE USER ez_test WITH PASSWORD 'ezTest';" -U postgres
2626

2727
after_success:
28-
- travis_retry php vendor/bin/php-coveralls
28+
- bash <(curl -s https://codecov.io/bash)
2929

3030
# Commands you want to run that will verify your build.
3131
script:
32-
- mkdir -p build/logs
33-
- phpunit --coverage-clover build/logs/clover.xml
32+
- phpunit --coverage-clover=coverage.xml
3433

3534
# allow_failures: Allow this build to fail under the specified environments.
3635
# fast_finish: If your build fails do not continue trying to build, just stop.

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
ezSQL
22
=====
3+
[![Build Status](https://travis-ci.org/ezSQL/ezSQL.svg?branch=v3)](https://travis-ci.org/ezSQL/ezSQL)
4+
[![Build status](https://ci.appveyor.com/api/projects/status/6s8oqnoxa2i5k04f/branch/v3?svg=true)](https://ci.appveyor.com/project/jv2222/ezsql/branch/v3)
5+
[![codecov](https://codecov.io/gh/ezSQL/ezSQL/branch/v3/graph/badge.svg)](https://codecov.io/gh/ezSQL/ezSQL)
6+
[![Maintainability](https://api.codeclimate.com/v1/badges/8db71512a019ab280a16/maintainability)](https://codeclimate.com/github/techno-express/ezSQL/maintainability)
37

48
Author
59
------
@@ -17,6 +21,31 @@ Change Log
1721
==========
1822
Note: This change log isn't being used any more due to automated github tracking
1923

24+
3.08 - Merged fork https://github.com/sjstoelting/ezSQL3 to be current with this repo.
25+
* Added/Updated PHPunit tests, some marked as incomplete or not fully implemented, SQL drivers not loaded will be skipped.
26+
* Refactor class code to use `spl_autoload_register`.
27+
Simply using `require_once "ez_sql_loader.php";` then `$database = new database_driver_class;`. This will allow multi SQLdb to be loaded if need be.
28+
* Added methods `create_select`, `insert_select`, `update`, `insert`, `replace`, `delete`, and `selecting` an alias for select.
29+
These are part of the new ezQuery SQL builder class. They are shortcut calls, these new methods will create proper SQL statements, from supplied arguments variable or array, prevent injections, then execute guery, in case of `selecting` execute get_results.
30+
* Added many additional functions to support ezQuery builder and to easily process SQL prepare statements. Supplied arguments will be replace with necessary placeholder and values added to parameter array.
31+
* All new methods has been fully PHPunit tested under current supported database systems, and should be able to handle most use cases as is.
32+
* Todo: Implement WHERE IN sub selection and shortcut method calls for the remainder of SQL standard statements.
33+
34+
```
35+
ezSQL3 - From Author: Stefanie Janine Stoelting - http://stefanie-stoelting.de
36+
37+
News about ezSQL3 are available at http://stefanie-stoelting.de/ezsql3-news.html
38+
39+
* 3.07 - Added the new class ezSQL_mysql to use mysqli. To update existing projects, just change the class you are using from ezSQL_mysql to ezSQL_mysqli. This class is downward compatible to ezSQL_mysql, but is able to use prepared statements.
40+
* 3.06 - Extended ezSQL_mysql method quick_connect with a charset parameter
41+
* 3.05 - Extended ez_sql_oracleTNS class, that does now support client site connection pooling
42+
* 3.04 - Added a new class for Oracle database connection to get rid of TNSNAMES.ORA configuration files
43+
* 3.03 - Changed error messages, wrong classname used in a messages
44+
* 3.02 - Improved ezSQL_recordset, array results of rows are faster
45+
* 3.01 - Added a class for query result handling. The ezSQL_recordset contains methods that behave like fetch_assoc, fetch_row, and fetch_object
46+
* 3.00 - Changed the code to PHP5, added PHPDoc tags, and added unit tests
47+
```
48+
2049
2.17 - Updates to ezSQL_postgresql (thx Stefanie Janine Stoelting)
2150

2251
2.16 - Added profiling functions to mySQL version & added fix to stop mySQL hanging on very long runnign scripts

appveyor.yml

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
build: false
2+
platform:
3+
- x64
4+
clone_folder: c:\projects\php-project-workspace
5+
6+
## Build matrix for lowest and highest possible targets
7+
environment:
8+
matrix:
9+
- php_ver_target: 7.0
10+
MYSQL_DATABASE: ez_test
11+
MYSQL_HOST: localhost
12+
MYSQL_USER: root
13+
MYSQL_PASSWORD: Password12!
14+
MYSQL_PATH: C:\Program Files\MySQL\MySQL Server 5.7
15+
16+
services:
17+
- mssql2014
18+
- mysql
19+
- postgresql
20+
21+
## Cache composer, chocolatey and php bits
22+
cache:
23+
- composer.phar
24+
# Cache chocolatey packages
25+
- C:\ProgramData\chocolatey\bin -> .appveyor.yml
26+
- C:\ProgramData\chocolatey\lib -> .appveyor.yml
27+
# Cache php install
28+
- c:\tools\php -> .appveyor.yml
29+
30+
## Set up environment variables
31+
init:
32+
- SET PATH=C:\Program Files\OpenSSL;c:\tools\php;C:\Program Files\PostgreSQL\9.4\bin\;%PATH%
33+
- SET COMPOSER_NO_INTERACTION=1
34+
- SET PHP=1 # This var is connected to PHP install cache
35+
- SET ANSICON=121x90 (121x90)
36+
37+
## Install PHP and composer, and run the appropriate composer command Get the MSSQL DLL's and XDEBUG
38+
install:
39+
- IF EXIST c:\tools\php (SET PHP=0)
40+
- ps: >-
41+
If ($env:php_ver_target -eq "5.6") {
42+
appveyor-retry cinst --params '""/InstallDir:C:\tools\php""' --ignore-checksums -y --forcex86 php --version ((choco search php --exact --all-versions -r | select-string -pattern $env:php_ver_target | sort { [version]($_ -split '\|' | select -last 1) } -Descending | Select-Object -first 1) -replace '[php|]','')
43+
} Else {
44+
appveyor-retry cinst --params '""/InstallDir:C:\tools\php""' --ignore-checksums -y php --version ((choco search php --exact --all-versions -r | select-string -pattern $env:php_ver_target | sort { [version]($_ -split '\|' | select -last 1) } -Descending | Select-Object -first 1) -replace '[php|]','')
45+
}
46+
- appveyor-retry cinst -y sqlite
47+
- cd c:\tools\php
48+
# Get the MSSQL DLL's
49+
- ps: >-
50+
If ($env:PHP -eq "1") {
51+
If ($env:php_ver_target -eq "5.6") {
52+
$source = "https://cdn.joomla.org/ci/php-sqlsrv.zip"
53+
$destination = "c:\tools\php\php-sqlsrv.zip"
54+
Invoke-WebRequest $source -OutFile $destination
55+
#appveyor-retry appveyor DownloadFile https://cdn.joomla.org/ci/php-sqlsrv.zip
56+
7z x php-sqlsrv.zip > $null
57+
copy SQLSRV\php_sqlsrv_56_nts.dll ext\php_sqlsrv_nts.dll
58+
copy SQLSRV\php_pdo_sqlsrv_56_nts.dll ext\php_pdo_sqlsrv_nts.dll
59+
Remove-Item c:\tools\php\* -include .zip
60+
} Else {
61+
$DLLVersion = "4.3.0"
62+
cd c:\tools\php\ext
63+
$source = "http://windows.php.net/downloads/pecl/releases/sqlsrv/$($DLLVersion)/php_sqlsrv-$($DLLVersion)-$($env:php_ver_target)-nts-vc14-x64.zip"
64+
$destination = "c:\tools\php\ext\php_sqlsrv-$($DLLVersion)-$($env:php_ver_target)-nts-vc14-x64.zip"
65+
Invoke-WebRequest $source -OutFile $destination
66+
#appveyor-retry appveyor DownloadFile http://windows.php.net/downloads/pecl/releases/sqlsrv/$($DLLVersion)/php_sqlsrv-$($DLLVersion)-$($env:php_ver_target)-nts-vc14-x64.zip
67+
7z x -y php_sqlsrv-$($DLLVersion)-$($env:php_ver_target)-nts-vc14-x64.zip > $null
68+
$source = "http://windows.php.net/downloads/pecl/releases/pdo_sqlsrv/$($DLLVersion)/php_pdo_sqlsrv-$($DLLVersion)-$($env:php_ver_target)-nts-vc14-x64.zip"
69+
$destination = "c:\tools\php\ext\php_pdo_sqlsrv-$($DLLVersion)-$($env:php_ver_target)-nts-vc14-x64.zip"
70+
Invoke-WebRequest $source -OutFile $destination
71+
#appveyor-retry appveyor DownloadFile http://windows.php.net/downloads/pecl/releases/pdo_sqlsrv/$($DLLVersion)/php_pdo_sqlsrv-$($DLLVersion)-$($env:php_ver_target)-nts-vc14-x64.zip
72+
7z x -y php_pdo_sqlsrv-$($DLLVersion)-$($env:php_ver_target)-nts-vc14-x64.zip > $null
73+
Remove-Item c:\tools\php\ext* -include .zip
74+
cd c:\tools\php}}
75+
- IF %PHP%==1 copy php.ini-production php.ini /Y
76+
- IF %PHP%==1 echo date.timezone="UTC" >> php.ini
77+
- IF %PHP%==1 echo extension_dir=ext >> php.ini
78+
- IF %PHP%==1 echo extension=php_openssl.dll >> php.ini
79+
- IF %PHP%==1 echo extension=php_mbstring.dll >> php.ini
80+
- IF %PHP%==1 echo extension=php_fileinfo.dll >> php.ini
81+
- ps: >-
82+
If ($env:php_ver_target -eq "5.6") {
83+
Add-Content php.ini "`nextension=php_sqlsrv_nts.dll"
84+
Add-Content php.ini "`nextension=php_pdo_sqlsrv_nts.dll"
85+
Add-Content php.ini "`n"
86+
} Else {
87+
Add-Content php.ini "`nextension=php_sqlsrv.dll"
88+
Add-Content php.ini "`nextension=php_pdo_sqlsrv.dll"
89+
Add-Content php.ini "`n"
90+
}
91+
- IF %PHP%==1 echo extension=php_pgsql.dll >> php.ini
92+
- IF %PHP%==1 echo extension=php_pdo_pgsql.dll >> php.ini
93+
- IF %PHP%==1 echo extension=php_sqlite3.dll >> php.ini
94+
- IF %PHP%==1 echo extension=php_pdo_sqlite.dll >> php.ini
95+
- IF %PHP%==1 echo extension=php_mysqli.dll >> php.ini
96+
- IF %PHP%==1 echo extension=php_pdo_mysql.dll >> php.ini
97+
- IF %PHP%==1 appveyor-retry appveyor DownloadFile https://xdebug.org/files/php_xdebug-2.5.5-7.0-vc14-nts-x86_64.dll -FileName c:\tools\php\ext\php_xdebug-2.5.5-7.0-vc14-nts-x86_64.dll
98+
- IF %PHP%==1 echo [xdebug] >> php.ini
99+
- IF %PHP%==1 echo zend_extension=php_xdebug-2.5.5-7.0-vc14-nts-x86_64.dll >> php.ini
100+
- IF %PHP%==1 echo zend.assertions=1 >> php.ini
101+
- IF %PHP%==1 echo assert.exception=On >> php.ini
102+
- IF %PHP%==1 echo xdebug.remote_enable=1 >> php.ini
103+
- IF %PHP%==1 echo xdebug.remote_autostart=1 >> php.ini
104+
- IF %PHP%==1 echo xdebug.profiler_enable=off >> php.ini
105+
- IF %PHP%==1 echo @php %%~dp0composer.phar %%* > composer.bat
106+
- appveyor-retry appveyor DownloadFile https://getcomposer.org/composer.phar
107+
- cd c:\projects\php-project-workspace
108+
- composer self-update
109+
- composer require php-coveralls/php-coveralls
110+
111+
build_script:
112+
# postgres
113+
- SET PGUSER=postgres
114+
- SET PGPASSWORD=Password12!
115+
- createdb ez_test
116+
- psql -c "CREATE USER ez_test WITH PASSWORD 'ezTest';"
117+
# sqlserver
118+
- sqlcmd -S localhost,1433 -U sa -P Password12! -Q "CREATE DATABASE ez_test"
119+
- sqlcmd -S localhost,1433 -U sa -P Password12! -d ez_test -Q "CREATE LOGIN ez_test WITH PASSWORD=N'ezTest', DEFAULT_DATABASE=ez_test, CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF; ALTER SERVER ROLE [sysadmin] ADD MEMBER ez_test"
120+
121+
before_test:
122+
- SET PATH=%MYSQL_PATH%\bin;%PATH%
123+
- mysqladmin --host=%MYSQL_HOST% --user=%MYSQL_USER% --password=%MYSQL_PASSWORD% create %MYSQL_DATABASE%
124+
# mysql
125+
- mysql -u root -p"Password12!" -e "CREATE DATABASE IF NOT EXISTS ez_test;"
126+
- mysql -u root -p"Password12!" -e "GRANT ALL PRIVILEGES ON ez_test.* TO ez_test@localhost IDENTIFIED BY 'ezTest'";
127+
- mysql -u root -p"Password12!" -e "FLUSH PRIVILEGES;"
128+
129+
on_success:
130+
- ps: |
131+
$env:PATH = 'C:\msys64\usr\bin;' + $env:PATH
132+
Invoke-WebRequest -Uri 'https://codecov.io/bash' -OutFile codecov.sh
133+
bash codecov.sh -f "coverage.xml"
134+
135+
## Run the actual test
136+
test_script:
137+
- cd c:\projects\php-project-workspace
138+
- vendor/bin/phpunit --coverage-clover=coverage.xml
139+

codecov.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
ignore:
2+
- "unsupported/."
3+
- "tests/."
4+
- "vendor/."
5+
- "docs/." # regexp accepted

codeigniter/Ezsql_codeigniter.php

Lines changed: 0 additions & 161 deletions
This file was deleted.

0 commit comments

Comments
 (0)