Update file headers
This commit is contained in:
parent
f0373e468e
commit
c735c27559
130
.gitignore
vendored
130
.gitignore
vendored
@ -1,3 +1,133 @@
|
|||||||
|
|
||||||
|
# Created by https://www.gitignore.io/api/linux,macos,windows,jetbrains+all
|
||||||
|
|
||||||
|
### JetBrains+all ###
|
||||||
|
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
|
||||||
|
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
||||||
|
|
||||||
|
# User-specific stuff:
|
||||||
|
.idea/**/workspace.xml
|
||||||
|
.idea/**/tasks.xml
|
||||||
|
.idea/dictionaries
|
||||||
|
|
||||||
|
# Sensitive or high-churn files:
|
||||||
|
.idea/**/dataSources/
|
||||||
|
.idea/**/dataSources.ids
|
||||||
|
.idea/**/dataSources.xml
|
||||||
|
.idea/**/dataSources.local.xml
|
||||||
|
.idea/**/sqlDataSources.xml
|
||||||
|
.idea/**/dynamic.xml
|
||||||
|
.idea/**/uiDesigner.xml
|
||||||
|
|
||||||
|
# Gradle:
|
||||||
|
.idea/**/gradle.xml
|
||||||
|
.idea/**/libraries
|
||||||
|
|
||||||
|
# CMake
|
||||||
|
cmake-build-debug/
|
||||||
|
|
||||||
|
# Mongo Explorer plugin:
|
||||||
|
.idea/**/mongoSettings.xml
|
||||||
|
|
||||||
|
## File-based project format:
|
||||||
|
*.iws
|
||||||
|
|
||||||
|
## Plugin-specific files:
|
||||||
|
|
||||||
|
# IntelliJ
|
||||||
|
/out/
|
||||||
|
|
||||||
|
# mpeltonen/sbt-idea plugin
|
||||||
|
.idea_modules/
|
||||||
|
|
||||||
|
# JIRA plugin
|
||||||
|
atlassian-ide-plugin.xml
|
||||||
|
|
||||||
|
# Cursive Clojure plugin
|
||||||
|
.idea/replstate.xml
|
||||||
|
|
||||||
|
# Ruby plugin and RubyMine
|
||||||
|
/.rakeTasks
|
||||||
|
|
||||||
|
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||||
|
com_crashlytics_export_strings.xml
|
||||||
|
crashlytics.properties
|
||||||
|
crashlytics-build.properties
|
||||||
|
fabric.properties
|
||||||
|
|
||||||
|
### JetBrains+all Patch ###
|
||||||
|
# Ignores the whole idea folder
|
||||||
|
# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360
|
||||||
|
|
||||||
|
.idea/
|
||||||
|
|
||||||
|
### Linux ###
|
||||||
|
*~
|
||||||
|
|
||||||
|
# temporary files which can be created if a process still has a handle open of a deleted file
|
||||||
|
.fuse_hidden*
|
||||||
|
|
||||||
|
# KDE directory preferences
|
||||||
|
.directory
|
||||||
|
|
||||||
|
# Linux trash folder which might appear on any partition or disk
|
||||||
|
.Trash-*
|
||||||
|
|
||||||
|
# .nfs files are created when an open file is removed but is still being accessed
|
||||||
|
.nfs*
|
||||||
|
|
||||||
|
### macOS ###
|
||||||
|
*.DS_Store
|
||||||
|
.AppleDouble
|
||||||
|
.LSOverride
|
||||||
|
|
||||||
|
# Icon must end with two \r
|
||||||
|
Icon
|
||||||
|
|
||||||
|
# Thumbnails
|
||||||
|
._*
|
||||||
|
|
||||||
|
# Files that might appear in the root of a volume
|
||||||
|
.DocumentRevisions-V100
|
||||||
|
.fseventsd
|
||||||
|
.Spotlight-V100
|
||||||
|
.TemporaryItems
|
||||||
|
.Trashes
|
||||||
|
.VolumeIcon.icns
|
||||||
|
.com.apple.timemachine.donotpresent
|
||||||
|
|
||||||
|
# Directories potentially created on remote AFP share
|
||||||
|
.AppleDB
|
||||||
|
.AppleDesktop
|
||||||
|
Network Trash Folder
|
||||||
|
Temporary Items
|
||||||
|
.apdisk
|
||||||
|
|
||||||
|
### Windows ###
|
||||||
|
# Windows thumbnail cache files
|
||||||
|
Thumbs.db
|
||||||
|
ehthumbs.db
|
||||||
|
ehthumbs_vista.db
|
||||||
|
|
||||||
|
# Folder config file
|
||||||
|
Desktop.ini
|
||||||
|
|
||||||
|
# Recycle Bin used on file shares
|
||||||
|
$RECYCLE.BIN/
|
||||||
|
|
||||||
|
# Windows Installer files
|
||||||
|
*.cab
|
||||||
|
*.msi
|
||||||
|
*.msm
|
||||||
|
*.msp
|
||||||
|
|
||||||
|
# Windows shortcuts
|
||||||
|
*.lnk
|
||||||
|
|
||||||
|
|
||||||
|
# End of https://www.gitignore.io/api/linux,macos,windows,jetbrains+all
|
||||||
|
|
||||||
|
|
||||||
test_config.json
|
test_config.json
|
||||||
index.html
|
index.html
|
||||||
tests/db_files/*
|
tests/db_files/*
|
||||||
|
@ -24,3 +24,8 @@ test:7.1:
|
|||||||
image: php:7.1
|
image: php:7.1
|
||||||
script:
|
script:
|
||||||
- phpunit -c build --no-coverage
|
- phpunit -c build --no-coverage
|
||||||
|
|
||||||
|
test:7.2:
|
||||||
|
image: php:7.2
|
||||||
|
script:
|
||||||
|
- phpunit -c build --no-coverage
|
||||||
|
@ -3,11 +3,11 @@
|
|||||||
*
|
*
|
||||||
* SQL Query Builder / Database Abstraction Layer
|
* SQL Query Builder / Database Abstraction Layer
|
||||||
*
|
*
|
||||||
* PHP version 7
|
* PHP version 7.1
|
||||||
*
|
*
|
||||||
* @package Query
|
* @package Query
|
||||||
* @author Timothy J. Warren <tim@timshomepage.net>
|
* @author Timothy J. Warren <tim@timshomepage.net>
|
||||||
* @copyright 2012 - 2016 Timothy J. Warren
|
* @copyright 2012 - 2018 Timothy J. Warren
|
||||||
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||||
* @link https://git.timshomepage.net/aviat4ion/Query
|
* @link https://git.timshomepage.net/aviat4ion/Query
|
||||||
*/
|
*/
|
@ -2,8 +2,11 @@
|
|||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
$file_patterns = [
|
$file_patterns = [
|
||||||
|
'src/**/*.php',
|
||||||
'src/*.php',
|
'src/*.php',
|
||||||
'tests/**/*.php',
|
'tests/**/*.php',
|
||||||
|
'tests/*.php',
|
||||||
|
'Robofile.php'
|
||||||
];
|
];
|
||||||
|
|
||||||
if ( ! function_exists('glob_recursive'))
|
if ( ! function_exists('glob_recursive'))
|
||||||
@ -25,28 +28,30 @@ if ( ! function_exists('glob_recursive'))
|
|||||||
|
|
||||||
function get_text_to_replace($tokens)
|
function get_text_to_replace($tokens)
|
||||||
{
|
{
|
||||||
if ($tokens[0][0] !== T_OPEN_TAG)
|
$output = '';
|
||||||
|
|
||||||
|
// Tokens have the follow structure if arrays:
|
||||||
|
// [0] => token type constant
|
||||||
|
// [1] => raw sytax parsed to that token
|
||||||
|
// [2] => line number
|
||||||
|
foreach($tokens as $token)
|
||||||
{
|
{
|
||||||
return NULL;
|
// Since we only care about opening docblocks,
|
||||||
|
// bail out when we get to the namespace token
|
||||||
|
if (is_array($token) && $token[0] === T_NAMESPACE)
|
||||||
|
{
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If there is already a docblock, as the second token after the
|
if (is_array($token))
|
||||||
// open tag, get the contents of that token to replace
|
|
||||||
if ($tokens[1][0] === T_DOC_COMMENT)
|
|
||||||
{
|
{
|
||||||
return "<?php\n" . $tokens[1][1];
|
$token = $token[1];
|
||||||
}
|
}
|
||||||
// If there is a declare strict types,
|
|
||||||
else if ($tokens[1][0] === T_DECLARE && $tokens[9][0] === T_DOC_COMMENT)
|
$output .= $token;
|
||||||
{
|
|
||||||
// '<?php' and 'declare(strict_types=1);' makes for 8 tokens
|
|
||||||
// replace it all
|
|
||||||
return "<?php\ndeclare(strict_types=1);\n" . $tokens[9][1];
|
|
||||||
}
|
|
||||||
else if ($tokens[1][0] !== T_DOC_COMMENT)
|
|
||||||
{
|
|
||||||
return "<?php";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_tokens($source)
|
function get_tokens($source)
|
||||||
@ -56,11 +61,17 @@ function get_tokens($source)
|
|||||||
|
|
||||||
function replace_files(array $files, $template)
|
function replace_files(array $files, $template)
|
||||||
{
|
{
|
||||||
|
print_r($files);
|
||||||
foreach ($files as $file)
|
foreach ($files as $file)
|
||||||
{
|
{
|
||||||
$source = file_get_contents($file);
|
$source = file_get_contents($file);
|
||||||
|
|
||||||
|
if (stripos($source, 'namespace') === FALSE)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$tokens = get_tokens($source);
|
$tokens = get_tokens($source);
|
||||||
//print_r($tokens);
|
|
||||||
$text_to_replace = get_text_to_replace($tokens);
|
$text_to_replace = get_text_to_replace($tokens);
|
||||||
|
|
||||||
$header = file_get_contents(__DIR__ . $template);
|
$header = file_get_contents(__DIR__ . $template);
|
||||||
@ -68,8 +79,6 @@ function replace_files(array $files, $template)
|
|||||||
|
|
||||||
$new_source = str_replace($text_to_replace, $new_text, $source);
|
$new_source = str_replace($text_to_replace, $new_text, $source);
|
||||||
file_put_contents($file, $new_source);
|
file_put_contents($file, $new_source);
|
||||||
|
|
||||||
//break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"coverage": "phpdbg -qrr -- vendor/bin/phpunit -c build",
|
"coverage": "phpdbg -qrr -- vendor/bin/phpunit -c build",
|
||||||
"phpstan": "phpstan analyse src tests",
|
"phpstan": "phpstan analyse -l 3 -c phpstan.neon src tests",
|
||||||
"test": "vendor/bin/phpunit"
|
"test": "vendor/bin/phpunit"
|
||||||
},
|
},
|
||||||
"scripts-descriptions": {
|
"scripts-descriptions": {
|
||||||
|
6
phpstan.neon
Normal file
6
phpstan.neon
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
parameters:
|
||||||
|
autoload_files:
|
||||||
|
- %rootDir%/../../../tests/bootstrap.php
|
||||||
|
ignoreErrors:
|
||||||
|
- '#Access to an undefined property Aviat\\\Ion\\\Friend::\$[a-zA-Z0-9_]+#'
|
||||||
|
- '#Call to an undefined method Aviat\\\Ion\\\Friend::[a-zA-Z0-9_]+\(\)#'
|
@ -4,15 +4,14 @@
|
|||||||
*
|
*
|
||||||
* SQL Query Builder / Database Abstraction Layer
|
* SQL Query Builder / Database Abstraction Layer
|
||||||
*
|
*
|
||||||
* PHP version 7
|
* PHP version 7.1
|
||||||
*
|
*
|
||||||
* @package Query
|
* @package Query
|
||||||
* @author Timothy J. Warren <tim@timshomepage.net>
|
* @author Timothy J. Warren <tim@timshomepage.net>
|
||||||
* @copyright 2012 - 2016 Timothy J. Warren
|
* @copyright 2012 - 2018 Timothy J. Warren
|
||||||
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||||
* @link https://git.timshomepage.net/aviat4ion/Query
|
* @link https://git.timshomepage.net/aviat4ion/Query
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Query;
|
namespace Query;
|
||||||
|
|
||||||
use PDOStatement;
|
use PDOStatement;
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
*
|
*
|
||||||
* SQL Query Builder / Database Abstraction Layer
|
* SQL Query Builder / Database Abstraction Layer
|
||||||
*
|
*
|
||||||
* PHP version 7
|
* PHP version 7.1
|
||||||
*
|
*
|
||||||
* @package Query
|
* @package Query
|
||||||
* @author Timothy J. Warren <tim@timshomepage.net>
|
* @author Timothy J. Warren <tim@timshomepage.net>
|
||||||
* @copyright 2012 - 2016 Timothy J. Warren
|
* @copyright 2012 - 2018 Timothy J. Warren
|
||||||
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||||
* @link https://git.timshomepage.net/aviat4ion/Query
|
* @link https://git.timshomepage.net/aviat4ion/Query
|
||||||
*/
|
*/
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
*
|
*
|
||||||
* SQL Query Builder / Database Abstraction Layer
|
* SQL Query Builder / Database Abstraction Layer
|
||||||
*
|
*
|
||||||
* PHP version 7
|
* PHP version 7.1
|
||||||
*
|
*
|
||||||
* @package Query
|
* @package Query
|
||||||
* @author Timothy J. Warren <tim@timshomepage.net>
|
* @author Timothy J. Warren <tim@timshomepage.net>
|
||||||
* @copyright 2012 - 2016 Timothy J. Warren
|
* @copyright 2012 - 2018 Timothy J. Warren
|
||||||
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||||
* @link https://git.timshomepage.net/aviat4ion/Query
|
* @link https://git.timshomepage.net/aviat4ion/Query
|
||||||
*/
|
*/
|
||||||
|
@ -4,15 +4,14 @@
|
|||||||
*
|
*
|
||||||
* SQL Query Builder / Database Abstraction Layer
|
* SQL Query Builder / Database Abstraction Layer
|
||||||
*
|
*
|
||||||
* PHP version 7
|
* PHP version 7.1
|
||||||
*
|
*
|
||||||
* @package Query
|
* @package Query
|
||||||
* @author Timothy J. Warren <tim@timshomepage.net>
|
* @author Timothy J. Warren <tim@timshomepage.net>
|
||||||
* @copyright 2012 - 2016 Timothy J. Warren
|
* @copyright 2012 - 2018 Timothy J. Warren
|
||||||
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||||
* @link https://git.timshomepage.net/aviat4ion/Query
|
* @link https://git.timshomepage.net/aviat4ion/Query
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Query\Drivers;
|
namespace Query\Drivers;
|
||||||
|
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
|
@ -4,15 +4,14 @@
|
|||||||
*
|
*
|
||||||
* SQL Query Builder / Database Abstraction Layer
|
* SQL Query Builder / Database Abstraction Layer
|
||||||
*
|
*
|
||||||
* PHP version 7
|
* PHP version 7.1
|
||||||
*
|
*
|
||||||
* @package Query
|
* @package Query
|
||||||
* @author Timothy J. Warren <tim@timshomepage.net>
|
* @author Timothy J. Warren <tim@timshomepage.net>
|
||||||
* @copyright 2012 - 2016 Timothy J. Warren
|
* @copyright 2012 - 2018 Timothy J. Warren
|
||||||
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||||
* @link https://git.timshomepage.net/aviat4ion/Query
|
* @link https://git.timshomepage.net/aviat4ion/Query
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Query\Drivers;
|
namespace Query\Drivers;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -4,15 +4,14 @@
|
|||||||
*
|
*
|
||||||
* SQL Query Builder / Database Abstraction Layer
|
* SQL Query Builder / Database Abstraction Layer
|
||||||
*
|
*
|
||||||
* PHP version 7
|
* PHP version 7.1
|
||||||
*
|
*
|
||||||
* @package Query
|
* @package Query
|
||||||
* @author Timothy J. Warren <tim@timshomepage.net>
|
* @author Timothy J. Warren <tim@timshomepage.net>
|
||||||
* @copyright 2012 - 2016 Timothy J. Warren
|
* @copyright 2012 - 2018 Timothy J. Warren
|
||||||
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||||
* @link https://git.timshomepage.net/aviat4ion/Query
|
* @link https://git.timshomepage.net/aviat4ion/Query
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Query\Drivers;
|
namespace Query\Drivers;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
*
|
*
|
||||||
* SQL Query Builder / Database Abstraction Layer
|
* SQL Query Builder / Database Abstraction Layer
|
||||||
*
|
*
|
||||||
* PHP version 7
|
* PHP version 7.1
|
||||||
*
|
*
|
||||||
* @package Query
|
* @package Query
|
||||||
* @author Timothy J. Warren <tim@timshomepage.net>
|
* @author Timothy J. Warren <tim@timshomepage.net>
|
||||||
* @copyright 2012 - 2016 Timothy J. Warren
|
* @copyright 2012 - 2018 Timothy J. Warren
|
||||||
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||||
* @link https://git.timshomepage.net/aviat4ion/Query
|
* @link https://git.timshomepage.net/aviat4ion/Query
|
||||||
*/
|
*/
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
*
|
*
|
||||||
* SQL Query Builder / Database Abstraction Layer
|
* SQL Query Builder / Database Abstraction Layer
|
||||||
*
|
*
|
||||||
* PHP version 7
|
* PHP version 7.1
|
||||||
*
|
*
|
||||||
* @package Query
|
* @package Query
|
||||||
* @author Timothy J. Warren <tim@timshomepage.net>
|
* @author Timothy J. Warren <tim@timshomepage.net>
|
||||||
* @copyright 2012 - 2016 Timothy J. Warren
|
* @copyright 2012 - 2018 Timothy J. Warren
|
||||||
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||||
* @link https://git.timshomepage.net/aviat4ion/Query
|
* @link https://git.timshomepage.net/aviat4ion/Query
|
||||||
*/
|
*/
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
*
|
*
|
||||||
* SQL Query Builder / Database Abstraction Layer
|
* SQL Query Builder / Database Abstraction Layer
|
||||||
*
|
*
|
||||||
* PHP version 7
|
* PHP version 7.1
|
||||||
*
|
*
|
||||||
* @package Query
|
* @package Query
|
||||||
* @author Timothy J. Warren <tim@timshomepage.net>
|
* @author Timothy J. Warren <tim@timshomepage.net>
|
||||||
* @copyright 2012 - 2016 Timothy J. Warren
|
* @copyright 2012 - 2018 Timothy J. Warren
|
||||||
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||||
* @link https://git.timshomepage.net/aviat4ion/Query
|
* @link https://git.timshomepage.net/aviat4ion/Query
|
||||||
*/
|
*/
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
*
|
*
|
||||||
* SQL Query Builder / Database Abstraction Layer
|
* SQL Query Builder / Database Abstraction Layer
|
||||||
*
|
*
|
||||||
* PHP version 7
|
* PHP version 7.1
|
||||||
*
|
*
|
||||||
* @package Query
|
* @package Query
|
||||||
* @author Timothy J. Warren <tim@timshomepage.net>
|
* @author Timothy J. Warren <tim@timshomepage.net>
|
||||||
* @copyright 2012 - 2016 Timothy J. Warren
|
* @copyright 2012 - 2018 Timothy J. Warren
|
||||||
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||||
* @link https://git.timshomepage.net/aviat4ion/Query
|
* @link https://git.timshomepage.net/aviat4ion/Query
|
||||||
*/
|
*/
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
*
|
*
|
||||||
* SQL Query Builder / Database Abstraction Layer
|
* SQL Query Builder / Database Abstraction Layer
|
||||||
*
|
*
|
||||||
* PHP version 7
|
* PHP version 7.1
|
||||||
*
|
*
|
||||||
* @package Query
|
* @package Query
|
||||||
* @author Timothy J. Warren <tim@timshomepage.net>
|
* @author Timothy J. Warren <tim@timshomepage.net>
|
||||||
* @copyright 2012 - 2016 Timothy J. Warren
|
* @copyright 2012 - 2018 Timothy J. Warren
|
||||||
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||||
* @link https://git.timshomepage.net/aviat4ion/Query
|
* @link https://git.timshomepage.net/aviat4ion/Query
|
||||||
*/
|
*/
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
*
|
*
|
||||||
* SQL Query Builder / Database Abstraction Layer
|
* SQL Query Builder / Database Abstraction Layer
|
||||||
*
|
*
|
||||||
* PHP version 7
|
* PHP version 7.1
|
||||||
*
|
*
|
||||||
* @package Query
|
* @package Query
|
||||||
* @author Timothy J. Warren <tim@timshomepage.net>
|
* @author Timothy J. Warren <tim@timshomepage.net>
|
||||||
* @copyright 2012 - 2016 Timothy J. Warren
|
* @copyright 2012 - 2018 Timothy J. Warren
|
||||||
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||||
* @link https://git.timshomepage.net/aviat4ion/Query
|
* @link https://git.timshomepage.net/aviat4ion/Query
|
||||||
*/
|
*/
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
*
|
*
|
||||||
* SQL Query Builder / Database Abstraction Layer
|
* SQL Query Builder / Database Abstraction Layer
|
||||||
*
|
*
|
||||||
* PHP version 7
|
* PHP version 7.1
|
||||||
*
|
*
|
||||||
* @package Query
|
* @package Query
|
||||||
* @author Timothy J. Warren <tim@timshomepage.net>
|
* @author Timothy J. Warren <tim@timshomepage.net>
|
||||||
* @copyright 2012 - 2016 Timothy J. Warren
|
* @copyright 2012 - 2018 Timothy J. Warren
|
||||||
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||||
* @link https://git.timshomepage.net/aviat4ion/Query
|
* @link https://git.timshomepage.net/aviat4ion/Query
|
||||||
*/
|
*/
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
*
|
*
|
||||||
* SQL Query Builder / Database Abstraction Layer
|
* SQL Query Builder / Database Abstraction Layer
|
||||||
*
|
*
|
||||||
* PHP version 7
|
* PHP version 7.1
|
||||||
*
|
*
|
||||||
* @package Query
|
* @package Query
|
||||||
* @author Timothy J. Warren <tim@timshomepage.net>
|
* @author Timothy J. Warren <tim@timshomepage.net>
|
||||||
* @copyright 2012 - 2016 Timothy J. Warren
|
* @copyright 2012 - 2018 Timothy J. Warren
|
||||||
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||||
* @link https://git.timshomepage.net/aviat4ion/Query
|
* @link https://git.timshomepage.net/aviat4ion/Query
|
||||||
*/
|
*/
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
*
|
*
|
||||||
* SQL Query Builder / Database Abstraction Layer
|
* SQL Query Builder / Database Abstraction Layer
|
||||||
*
|
*
|
||||||
* PHP version 7
|
* PHP version 7.1
|
||||||
*
|
*
|
||||||
* @package Query
|
* @package Query
|
||||||
* @author Timothy J. Warren <tim@timshomepage.net>
|
* @author Timothy J. Warren <tim@timshomepage.net>
|
||||||
* @copyright 2012 - 2016 Timothy J. Warren
|
* @copyright 2012 - 2018 Timothy J. Warren
|
||||||
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||||
* @link https://git.timshomepage.net/aviat4ion/Query
|
* @link https://git.timshomepage.net/aviat4ion/Query
|
||||||
*/
|
*/
|
||||||
|
@ -4,15 +4,14 @@
|
|||||||
*
|
*
|
||||||
* SQL Query Builder / Database Abstraction Layer
|
* SQL Query Builder / Database Abstraction Layer
|
||||||
*
|
*
|
||||||
* PHP version 7
|
* PHP version 7.1
|
||||||
*
|
*
|
||||||
* @package Query
|
* @package Query
|
||||||
* @author Timothy J. Warren <tim@timshomepage.net>
|
* @author Timothy J. Warren <tim@timshomepage.net>
|
||||||
* @copyright 2012 - 2016 Timothy J. Warren
|
* @copyright 2012 - 2018 Timothy J. Warren
|
||||||
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||||
* @link https://git.timshomepage.net/aviat4ion/Query
|
* @link https://git.timshomepage.net/aviat4ion/Query
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Query\Drivers;
|
namespace Query\Drivers;
|
||||||
|
|
||||||
use PDO;
|
use PDO;
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
*
|
*
|
||||||
* SQL Query Builder / Database Abstraction Layer
|
* SQL Query Builder / Database Abstraction Layer
|
||||||
*
|
*
|
||||||
* PHP version 7
|
* PHP version 7.1
|
||||||
*
|
*
|
||||||
* @package Query
|
* @package Query
|
||||||
* @author Timothy J. Warren <tim@timshomepage.net>
|
* @author Timothy J. Warren <tim@timshomepage.net>
|
||||||
* @copyright 2012 - 2016 Timothy J. Warren
|
* @copyright 2012 - 2018 Timothy J. Warren
|
||||||
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||||
* @link https://git.timshomepage.net/aviat4ion/Query
|
* @link https://git.timshomepage.net/aviat4ion/Query
|
||||||
*/
|
*/
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
*
|
*
|
||||||
* SQL Query Builder / Database Abstraction Layer
|
* SQL Query Builder / Database Abstraction Layer
|
||||||
*
|
*
|
||||||
* PHP version 7
|
* PHP version 7.1
|
||||||
*
|
*
|
||||||
* @package Query
|
* @package Query
|
||||||
* @author Timothy J. Warren <tim@timshomepage.net>
|
* @author Timothy J. Warren <tim@timshomepage.net>
|
||||||
* @copyright 2012 - 2016 Timothy J. Warren
|
* @copyright 2012 - 2018 Timothy J. Warren
|
||||||
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||||
* @link https://git.timshomepage.net/aviat4ion/Query
|
* @link https://git.timshomepage.net/aviat4ion/Query
|
||||||
*/
|
*/
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
*
|
*
|
||||||
* SQL Query Builder / Database Abstraction Layer
|
* SQL Query Builder / Database Abstraction Layer
|
||||||
*
|
*
|
||||||
* PHP version 7
|
* PHP version 7.1
|
||||||
*
|
*
|
||||||
* @package Query
|
* @package Query
|
||||||
* @author Timothy J. Warren <tim@timshomepage.net>
|
* @author Timothy J. Warren <tim@timshomepage.net>
|
||||||
* @copyright 2012 - 2016 Timothy J. Warren
|
* @copyright 2012 - 2018 Timothy J. Warren
|
||||||
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||||
* @link https://git.timshomepage.net/aviat4ion/Query
|
* @link https://git.timshomepage.net/aviat4ion/Query
|
||||||
*/
|
*/
|
||||||
|
@ -4,15 +4,14 @@
|
|||||||
*
|
*
|
||||||
* SQL Query Builder / Database Abstraction Layer
|
* SQL Query Builder / Database Abstraction Layer
|
||||||
*
|
*
|
||||||
* PHP version 7
|
* PHP version 7.1
|
||||||
*
|
*
|
||||||
* @package Query
|
* @package Query
|
||||||
* @author Timothy J. Warren <tim@timshomepage.net>
|
* @author Timothy J. Warren <tim@timshomepage.net>
|
||||||
* @copyright 2012 - 2016 Timothy J. Warren
|
* @copyright 2012 - 2018 Timothy J. Warren
|
||||||
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||||
* @link https://git.timshomepage.net/aviat4ion/Query
|
* @link https://git.timshomepage.net/aviat4ion/Query
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Query\Drivers;
|
namespace Query\Drivers;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
*
|
*
|
||||||
* SQL Query Builder / Database Abstraction Layer
|
* SQL Query Builder / Database Abstraction Layer
|
||||||
*
|
*
|
||||||
* PHP version 7
|
* PHP version 7.1
|
||||||
*
|
*
|
||||||
* @package Query
|
* @package Query
|
||||||
* @author Timothy J. Warren <tim@timshomepage.net>
|
* @author Timothy J. Warren <tim@timshomepage.net>
|
||||||
* @copyright 2012 - 2016 Timothy J. Warren
|
* @copyright 2012 - 2018 Timothy J. Warren
|
||||||
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||||
* @link https://git.timshomepage.net/aviat4ion/Query
|
* @link https://git.timshomepage.net/aviat4ion/Query
|
||||||
*/
|
*/
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
*
|
*
|
||||||
* SQL Query Builder / Database Abstraction Layer
|
* SQL Query Builder / Database Abstraction Layer
|
||||||
*
|
*
|
||||||
* PHP version 7
|
* PHP version 7.1
|
||||||
*
|
*
|
||||||
* @package Query
|
* @package Query
|
||||||
* @author Timothy J. Warren <tim@timshomepage.net>
|
* @author Timothy J. Warren <tim@timshomepage.net>
|
||||||
* @copyright 2012 - 2016 Timothy J. Warren
|
* @copyright 2012 - 2018 Timothy J. Warren
|
||||||
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||||
* @link https://git.timshomepage.net/aviat4ion/Query
|
* @link https://git.timshomepage.net/aviat4ion/Query
|
||||||
*/
|
*/
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
*
|
*
|
||||||
* SQL Query Builder / Database Abstraction Layer
|
* SQL Query Builder / Database Abstraction Layer
|
||||||
*
|
*
|
||||||
* PHP version 7
|
* PHP version 7.1
|
||||||
*
|
*
|
||||||
* @package Query
|
* @package Query
|
||||||
* @author Timothy J. Warren <tim@timshomepage.net>
|
* @author Timothy J. Warren <tim@timshomepage.net>
|
||||||
* @copyright 2012 - 2016 Timothy J. Warren
|
* @copyright 2012 - 2018 Timothy J. Warren
|
||||||
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||||
* @link https://git.timshomepage.net/aviat4ion/Query
|
* @link https://git.timshomepage.net/aviat4ion/Query
|
||||||
*/
|
*/
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
*
|
*
|
||||||
* SQL Query Builder / Database Abstraction Layer
|
* SQL Query Builder / Database Abstraction Layer
|
||||||
*
|
*
|
||||||
* PHP version 7
|
* PHP version 7.1
|
||||||
*
|
*
|
||||||
* @package Query
|
* @package Query
|
||||||
* @author Timothy J. Warren <tim@timshomepage.net>
|
* @author Timothy J. Warren <tim@timshomepage.net>
|
||||||
* @copyright 2012 - 2016 Timothy J. Warren
|
* @copyright 2012 - 2018 Timothy J. Warren
|
||||||
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||||
* @link https://git.timshomepage.net/aviat4ion/Query
|
* @link https://git.timshomepage.net/aviat4ion/Query
|
||||||
*/
|
*/
|
||||||
|
@ -4,15 +4,14 @@
|
|||||||
*
|
*
|
||||||
* SQL Query Builder / Database Abstraction Layer
|
* SQL Query Builder / Database Abstraction Layer
|
||||||
*
|
*
|
||||||
* PHP version 7
|
* PHP version 7.1
|
||||||
*
|
*
|
||||||
* @package Query
|
* @package Query
|
||||||
* @author Timothy J. Warren <tim@timshomepage.net>
|
* @author Timothy J. Warren <tim@timshomepage.net>
|
||||||
* @copyright 2012 - 2016 Timothy J. Warren
|
* @copyright 2012 - 2018 Timothy J. Warren
|
||||||
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||||
* @link https://git.timshomepage.net/aviat4ion/Query
|
* @link https://git.timshomepage.net/aviat4ion/Query
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Query;
|
namespace Query;
|
||||||
|
|
||||||
use PDOStatement;
|
use PDOStatement;
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
*
|
*
|
||||||
* SQL Query Builder / Database Abstraction Layer
|
* SQL Query Builder / Database Abstraction Layer
|
||||||
*
|
*
|
||||||
* PHP version 7
|
* PHP version 7.1
|
||||||
*
|
*
|
||||||
* @package Query
|
* @package Query
|
||||||
* @author Timothy J. Warren <tim@timshomepage.net>
|
* @author Timothy J. Warren <tim@timshomepage.net>
|
||||||
* @copyright 2012 - 2016 Timothy J. Warren
|
* @copyright 2012 - 2018 Timothy J. Warren
|
||||||
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||||
* @link https://git.timshomepage.net/aviat4ion/Query
|
* @link https://git.timshomepage.net/aviat4ion/Query
|
||||||
*/
|
*/
|
||||||
|
@ -21,27 +21,10 @@ define('QBASE_DIR', realpath(QTEST_DIR.'/../') . '/');
|
|||||||
define('QDS', DIRECTORY_SEPARATOR);
|
define('QDS', DIRECTORY_SEPARATOR);
|
||||||
|
|
||||||
// Set up autoloader
|
// Set up autoloader
|
||||||
require_once(QBASE_DIR . 'vendor/autoload.php');
|
require_once QBASE_DIR . 'vendor/autoload.php';
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
|
||||||
* Quercus detection for workarounds
|
|
||||||
*/
|
|
||||||
if ( ! defined('IS_QUERCUS'))
|
|
||||||
{
|
|
||||||
if ( ! isset($_sERVERSOFTWARE))
|
|
||||||
{
|
|
||||||
define('IS_QUERCUS', FALSE);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$test = strpos($_sERVER["SERVER_SOFTWARE"],'Quercus') !== FALSE;
|
|
||||||
define('IS_QUERCUS', $test);
|
|
||||||
unset($test);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function get_json_config()
|
function get_json_config()
|
||||||
{
|
{
|
||||||
$files = array(
|
$files = array(
|
||||||
|
@ -52,13 +52,13 @@ class SQLiteTest extends DBTest {
|
|||||||
//Check
|
//Check
|
||||||
$dbs = self::$db->getTables();
|
$dbs = self::$db->getTables();
|
||||||
|
|
||||||
$this->assertTrue(in_array('TEST1', $dbs));
|
$this->assertTrue(in_array('TEST1', $dbs, TRUE));
|
||||||
$this->assertTrue(in_array('TEST2', $dbs));
|
$this->assertTrue(in_array('TEST2', $dbs, TRUE));
|
||||||
$this->assertTrue(in_array('NUMBERS', $dbs));
|
$this->assertTrue(in_array('NUMBERS', $dbs, TRUE));
|
||||||
$this->assertTrue(in_array('NEWTABLE', $dbs));
|
$this->assertTrue(in_array('NEWTABLE', $dbs, TRUE));
|
||||||
$this->assertTrue(in_array('create_test', $dbs));
|
$this->assertTrue(in_array('create_test', $dbs, TRUE));
|
||||||
$this->assertTrue(in_array('create_join', $dbs));
|
$this->assertTrue(in_array('create_join', $dbs, TRUE));
|
||||||
$this->assertTrue(in_array('create_delete', $dbs));
|
$this->assertTrue(in_array('create_delete', $dbs, TRUE));
|
||||||
}
|
}
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
@ -224,11 +224,6 @@ SQL;
|
|||||||
|
|
||||||
public function testCommitTransaction()
|
public function testCommitTransaction()
|
||||||
{
|
{
|
||||||
if (IS_QUERCUS)
|
|
||||||
{
|
|
||||||
$this->markTestSkipped("JDBC Driver doesn't support transactions");
|
|
||||||
}
|
|
||||||
|
|
||||||
$res = self::$db->beginTransaction();
|
$res = self::$db->beginTransaction();
|
||||||
|
|
||||||
$sql = 'INSERT INTO "create_test" ("id", "key", "val") VALUES (10, 12, 14)';
|
$sql = 'INSERT INTO "create_test" ("id", "key", "val") VALUES (10, 12, 14)';
|
||||||
@ -242,11 +237,6 @@ SQL;
|
|||||||
|
|
||||||
public function testRollbackTransaction()
|
public function testRollbackTransaction()
|
||||||
{
|
{
|
||||||
if (IS_QUERCUS)
|
|
||||||
{
|
|
||||||
$this->markTestSkipped("JDBC Driver doesn't support transactions");
|
|
||||||
}
|
|
||||||
|
|
||||||
$res = self::$db->beginTransaction();
|
$res = self::$db->beginTransaction();
|
||||||
|
|
||||||
$sql = 'INSERT INTO "create_test" ("id", "key", "val") VALUES (182, 96, 43)';
|
$sql = 'INSERT INTO "create_test" ("id", "key", "val") VALUES (182, 96, 43)';
|
||||||
|
@ -11,23 +11,6 @@
|
|||||||
* @license http://philsturgeon.co.uk/code/dbad-license
|
* @license http://philsturgeon.co.uk/code/dbad-license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* Quercus detection for workarounds
|
|
||||||
*/
|
|
||||||
if ( ! defined('IS_QUERCUS'))
|
|
||||||
{
|
|
||||||
if ( ! array_key_exists('SERVER_SOFTWARE', $_SERVER))
|
|
||||||
{
|
|
||||||
define('IS_QUERCUS', FALSE);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$test = strpos($_SERVER["SERVER_SOFTWARE"],'Quercus') !== FALSE;
|
|
||||||
define('IS_QUERCUS', $test);
|
|
||||||
unset($test);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function get_json_config()
|
function get_json_config()
|
||||||
{
|
{
|
||||||
$files = array(
|
$files = array(
|
||||||
@ -49,8 +32,8 @@ function get_json_config()
|
|||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
// Set up autoloaders
|
// Set up autoloaders
|
||||||
require_once(__DIR__ . '/../vendor/autoload.php');
|
require_once __DIR__ . '/../vendor/autoload.php';
|
||||||
require_once(__DIR__ . '/../vendor/simpletest/simpletest/autorun.php');
|
require_once __DIR__ . '/../vendor/simpletest/simpletest/autorun.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base class for TestCases
|
* Base class for TestCases
|
||||||
@ -150,11 +133,11 @@ define('QDS', DIRECTORY_SEPARATOR);
|
|||||||
$testPath = QTEST_DIR.'/databases/';
|
$testPath = QTEST_DIR.'/databases/';
|
||||||
|
|
||||||
// Require base testing classes
|
// Require base testing classes
|
||||||
require_once(QTEST_DIR . '/core/core_test.php');
|
require_once QTEST_DIR . '/core/core_test.php';
|
||||||
require_once(QTEST_DIR . '/core/connection_manager_test.php');
|
require_once QTEST_DIR . '/core/connection_manager_test.php';
|
||||||
require_once(QTEST_DIR . '/core/base_db_test.php');
|
require_once QTEST_DIR . '/core/base_db_test.php';
|
||||||
require_once(QTEST_DIR . '/core/query_parser_test.php');
|
require_once QTEST_DIR . '/core/query_parser_test.php';
|
||||||
require_once(QTEST_DIR . '/core/base_query_builder_test.php');
|
require_once QTEST_DIR . '/core/base_query_builder_test.php';
|
||||||
|
|
||||||
$drivers = PDO::getAvailableDrivers();
|
$drivers = PDO::getAvailableDrivers();
|
||||||
|
|
||||||
@ -163,23 +146,23 @@ if (function_exists('fbird_connect'))
|
|||||||
$drivers[] = 'interbase';
|
$drivers[] = 'interbase';
|
||||||
}
|
}
|
||||||
|
|
||||||
$driverTestMap = array(
|
$driverTestMap = [
|
||||||
'MySQL' => in_array('mysql', $drivers),
|
'MySQL' => in_array('mysql', $drivers, TRUE),
|
||||||
'SQLite' => in_array('sqlite', $drivers),
|
'SQLite' => in_array('sqlite', $drivers, TRUE),
|
||||||
'PgSQL' => in_array('pgsql', $drivers),
|
'PgSQL' => in_array('pgsql', $drivers, TRUE),
|
||||||
'Firebird' => in_array('interbase', $drivers),
|
// 'Firebird' => in_array('interbase', $drivers),
|
||||||
//'PDOFirebird' => in_array('firebird', $drivers)
|
//'PDOFirebird' => in_array('firebird', $drivers)
|
||||||
);
|
];
|
||||||
|
|
||||||
// Determine which testcases to load
|
// Determine which testcases to load
|
||||||
foreach($driverTestMap as $name => $doLoad)
|
foreach($driverTestMap as $name => $doLoad)
|
||||||
{
|
{
|
||||||
$path = $testPath . strtolower($name) . '/';
|
$path = $testPath . strtolower($name) . '/';
|
||||||
|
|
||||||
if ($doLoad && (! IS_QUERCUS))
|
if ($doLoad)
|
||||||
{
|
{
|
||||||
require_once("{$path}{$name}Test.php");
|
require_once "{$path}{$name}Test.php";
|
||||||
require_once("{$path}{$name}QBTest.php");
|
require_once "{$path}{$name}QBTest.php";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// End of index.php
|
// End of index.php
|
Loading…
Reference in New Issue
Block a user