diff --git a/build.number b/build.number index 22c11f4..87f415d 100644 --- a/build.number +++ b/build.number @@ -1,3 +1,3 @@ #Build Number for ANT. Do not edit! -#Fri Mar 01 10:00:27 MST 2013 -build.number=11929 +#Tue Jan 06 15:49:59 MST 2015 +build.number=11967 diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index cb26f7a..976f788 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -3,7 +3,47 @@ Change log 1. Version History -version 6.4.18-rc2 - 03.01.13 +May 15, 2013 - Retiring changelog, use Git to track changes + +version 6.4.22 - 05.13.13 + - fixed bug in FileTranslator where not caching + - fixed bug in FileTranslator where not comparing the correct language + +version 6.4.21 - 05.08.13 + - fixed bug in ApplicationBase where clearing empty buffer on exception + - fixed bug in LoginForm where email address lookup was case sensitive + - fixed bug in DBCache where not caching + +version 6.4.20 - 04.11.13 + - fixed bug in FileBrowser where uploaded files that contain an error are ignored as filesize is 0 + - fixed bug in FileSizeValidator where files that are 0 bytes do not result in error + - patched source code in FileSizeValidator so code completion has appropriate description + - changed FileSizeValidator constructor now accepts minSize in KB + - fixed bug in Selectors: DateSelector, TimeSelector, and DateTimeSelector + - fixed bug in Selectors where setting onchange javascript event for null element when allowNull is false + - fixed bug in Selectors where ajax validation not sending entire value + - fixed bug in Selectors where ajax validation postback not being sent + - added DateRangeValidator (Steph) + - fixed bug in FileSizeValidator where always failing + - changed FileBrowser removed auto filesize validator + - fixed bug in WebApplicationBase where not logging ajax exceptions to the console + - fixed bug in PageControllerBase where trying to render ajax messages when no message element exists + +version 6.4.19 - 03.29.13 + - fixed bug in GridView when setting filter values when filter value = '' + - fixed bug in WebControlBase::setEnableVieState() where not cascading + +version 6.4.18-rc4 - 03.26.13 + - fixed bug in TestCaseBase where setting dataAdapter when no dsn connection specified + - fixed bug where upgrade changes default page param + - fixed bug in PageController when OS can't determine if glob is empty or an error has occurred + +version 6.4.18-rc3 - 03.14.13 + - fixed bug in WebApplicationBase where not rendering async exceptions - now uses javascript popup + - removed broken DataAdapters + - remove auto dismiss on syncronous flash message + +version 6.4.18-rc2 - 03.07.13 - patched security hole in credentials where session could remain active after user authorization is revoked - fixed bug in TableCredential where not using ActiveRecords to update source - fixed bug in TableCredential where source contained multiple tables diff --git a/docs/LICENSE.txt b/docs/LICENSE.txt index ba1c204..8aee7b6 100644 --- a/docs/LICENSE.txt +++ b/docs/LICENSE.txt @@ -1,8 +1,8 @@ License =================== - Copyright: (c) 2009, Authors/Developers - Darnell S. + Copyright: (c) 2015, Authors/Developers + Darnell Shinbine This software is released under the terms of the GNU Lesser Gerneral Public License. See /docs/GNU.txt for the complete license diff --git a/docs/TODO.txt b/docs/TODO.txt deleted file mode 100644 index 380bd9b..0000000 --- a/docs/TODO.txt +++ /dev/null @@ -1,23 +0,0 @@ -TODO -==== - - [Due in 6.5.0] - Compress assets (one time manually?) - Integrate with JQuery - Reduce HTML output - - Maybe:Compress themes using tool? - -Components (BOD) -========== - - - PDODataADapter - - MSSQLDataAdapter - -CONTROLS (BOD) -======== - -BUGS/ISSUES -=========== - - ENT_QUOTES causes GridViewControls to fail epically diff --git a/export-package.xml b/export-package.xml index b8a4442..f5aa686 100644 --- a/export-package.xml +++ b/export-package.xml @@ -1,245 +1,167 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <?php - /** - * @license see /docs/license.txt - * @package PHPRum - * @author ${authors} - * @copyright Copyright (c) 2013 - * @version ${build.version.number}.${build.revision.number} - */ - namespace System\Base; - - /** - * build name - * @var string - */ - const FRAMEWORK_BUILD_NAME = '${build.name}'; - - /** - * framework version number - * @var string - */ - const FRAMEWORK_BUILD_VERSION = '${build.version.number}'; - - /** - * framework revision number - * @var string - */ - const FRAMEWORK_BUILD_REVISION = '${build.revision.number}'; - - /** - * build number - * @var string - */ - const FRAMEWORK_BUILD_NUMBER = '${TSTAMP}'; - - /** - * build date - * @var string - */ - const FRAMEWORK_BUILD_TIME = '${DATE}'; - - /** - * build time - * @var string - */ - const FRAMEWORK_BUILD_DATE = '${TIME}'; - - /** - * framework authors - * @var string - */ - const FRAMEWORK_AUTHORS = '${authors}'; - - /** - * framework version string - * @var string - */ - const FRAMEWORK_VERSION_STRING = '${build.version.number}.${build.revision.number} (Build ${TSTAMP})'; - - /** - * framework date string - * @var string - */ - const FRAMEWORK_DATE_STRING = 'last build on ${DATE} at ${TIME}'; -?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <?php + /** + * @license see /docs/license.txt + * @package PHPRum + * @author ${authors} + * @copyright Copyright (c) 2013 + * @version ${build.version.number}.${build.revision.number} + */ + namespace System\Base; + + /** + * build name + * @var string + */ + const FRAMEWORK_BUILD_NAME = '${build.name}'; + + /** + * framework version number + * @var string + */ + const FRAMEWORK_BUILD_VERSION = '${build.version.number}'; + + /** + * framework revision number + * @var string + */ + const FRAMEWORK_BUILD_REVISION = '${build.revision.number}'; + + /** + * build number + * @var string + */ + const FRAMEWORK_BUILD_NUMBER = '${TSTAMP}'; + + /** + * build date + * @var string + */ + const FRAMEWORK_BUILD_TIME = '${DATE}'; + + /** + * build time + * @var string + */ + const FRAMEWORK_BUILD_DATE = '${TIME}'; + + /** + * framework authors + * @var string + */ + const FRAMEWORK_AUTHORS = '${authors}'; + + /** + * framework version string + * @var string + */ + const FRAMEWORK_VERSION_STRING = '${build.version.number}.${build.revision.number} (Build ${TSTAMP})'; + + /** + * framework date string + * @var string + */ + const FRAMEWORK_DATE_STRING = 'last build on ${DATE} at ${TIME}'; +?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/local.properties b/local.properties index 2ec7088..1c379fc 100644 --- a/local.properties +++ b/local.properties @@ -1,6 +1,6 @@ hello_world.path = ../Rum.hello_world -blog.path = ../Rum.blog -rum.path = ../Rum.web -test.path = ../Rum.tests +blog.path = ../Rum.blog +rum.path = ../Rum.web +test.path = ../Rum.tests -test.output = ../test \ No newline at end of file +test.output = ../test \ No newline at end of file diff --git a/public/.htaccess b/public/.htaccess index c3dca1c..43a7c2a 100644 --- a/public/.htaccess +++ b/public/.htaccess @@ -1,31 +1,31 @@ -order deny,allow -allow from all - -# Turn Rewrite Engine On -RewriteEngine On - -# This file contains default page routing for typical applications -# Modify this script as needed - -# REST Web service routing - -# /rest/u/{user}/t/{token}/{collection}/ -RewriteRule ^(json|xml|rest)/u/(.+?)/t/(.+?)/(.+)/$ index.php?path=rest/$4&format=$1&uid=$2&token=$3 [L,QSA] -# /rest/u/{user}/t/{token}/{collection}/{identifier} -RewriteRule ^(json|xml|rest)/u/(.+?)/t/(.+?)/(.+)/(.+)$ index.php?path=rest/$4&format=$1&uid=$2&token=$3&id=$5 [L,QSA] -# /rest/{collection}/ -RewriteRule ^(json|xml|rest)/(.+)/$ index.php?path=rest/$2&format=$1&path=rest/$2 [L,QSA] - -# Page routing with language - -# /{lang}/{page}/ -RewriteRule ^([a-z][a-z])/(.*)?/$ index.php?lang=$1&path=$2 [L,QSA] -# /{lang}/{page}/{identifier} -RewriteRule ^([a-z][a-z])/(.*)?/(.*)?$ index.php?lang=$1&path=$2&id=$3 [L,QSA] - -# Page routing - -# /{page}/ -RewriteRule ^(.*)?/$ index.php?path=$1 [L,QSA] -# /{page}/{identifier} -RewriteRule ^(.*)?/(.*)?$ index.php?path=$1&id=$2 [L,QSA] +order deny,allow +allow from all + +# Turn Rewrite Engine On +RewriteEngine On + +# This file contains default page routing for typical applications +# Modify this script as needed + +# REST Web service routing + +# /rest/u/{user}/t/{token}/{collection}/ +RewriteRule ^(json|xml|rest)/u/(.+?)/t/(.+?)/(.+)/$ index.php?page=rest/$4&format=$1&uid=$2&token=$3 [L,QSA] +# /rest/u/{user}/t/{token}/{collection}/{identifier} +RewriteRule ^(json|xml|rest)/u/(.+?)/t/(.+?)/(.+)/(.+)$ index.php?page=rest/$4&format=$1&uid=$2&token=$3&id=$5 [L,QSA] +# /rest/{collection}/ +RewriteRule ^(json|xml|rest)/(.+)/$ index.php?page=rest/$2&format=$1&path=rest/$2 [L,QSA] + +# Page routing with language + +# /{lang}/{page}/ +RewriteRule ^([a-z][a-z])/(.*)?/$ index.php?lang=$1&page=$2 [L,QSA] +# /{lang}/{page}/{identifier} +RewriteRule ^([a-z][a-z])/(.*)?/(.*)?$ index.php?lang=$1&page=$2&id=$3 [L,QSA] + +# Page routing + +# /{page}/ +RewriteRule ^(.*)?/$ index.php?page=$1 [L,QSA] +# /{page}/{identifier} +RewriteRule ^(.*)?/(.*)?$ index.php?page=$1&id=$2 [L,QSA] diff --git a/system/activerecord/activerecordbase.class.php b/system/activerecord/activerecordbase.class.php index 64980d0..a900aa7 100644 --- a/system/activerecord/activerecordbase.class.php +++ b/system/activerecord/activerecordbase.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\ActiveRecord; use System\Web\FormModelBase; diff --git a/system/activerecord/activerecordcollection.class.php b/system/activerecord/activerecordcollection.class.php index 2238e20..2f142c1 100644 --- a/system/activerecord/activerecordcollection.class.php +++ b/system/activerecord/activerecordcollection.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\ActiveRecord; use \System\Collections\CollectionBase; diff --git a/system/activerecord/activerecordexception.class.php b/system/activerecord/activerecordexception.class.php index b309d96..bdb1693 100644 --- a/system/activerecord/activerecordexception.class.php +++ b/system/activerecord/activerecordexception.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\ActiveRecord; diff --git a/system/activerecord/relationshiptype.class.php b/system/activerecord/relationshiptype.class.php index 1dd1f2b..f7530d5 100644 --- a/system/activerecord/relationshiptype.class.php +++ b/system/activerecord/relationshiptype.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\ActiveRecord; diff --git a/system/base/appconfiguration.class.php b/system/base/appconfiguration.class.php index 5ae406f..194d55a 100644 --- a/system/base/appconfiguration.class.php +++ b/system/base/appconfiguration.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Base; diff --git a/system/base/applicationbase.class.php b/system/base/applicationbase.class.php index 1e54b12..99d1d89 100644 --- a/system/base/applicationbase.class.php +++ b/system/base/applicationbase.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Base; @@ -506,7 +506,6 @@ private function handleShutDown() } catch(\ErrorException $e) { - ob_end_clean(); $this->handleException($e); } } diff --git a/system/base/appmessage.class.php b/system/base/appmessage.class.php index e0d4782..0364616 100644 --- a/system/base/appmessage.class.php +++ b/system/base/appmessage.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Base; diff --git a/system/base/appmessagecollection.class.php b/system/base/appmessagecollection.class.php index 52f3403..4726ed9 100644 --- a/system/base/appmessagecollection.class.php +++ b/system/base/appmessagecollection.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Base; use \System\Collections\CollectionBase; diff --git a/system/base/appmessagetype.class.php b/system/base/appmessagetype.class.php index 507aae7..87ab9d6 100644 --- a/system/base/appmessagetype.class.php +++ b/system/base/appmessagetype.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Base; diff --git a/system/base/appsettingscollection.class.php b/system/base/appsettingscollection.class.php index 8b1e6c5..4101002 100644 --- a/system/base/appsettingscollection.class.php +++ b/system/base/appsettingscollection.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Base; use \System\Collections\StringDictionary; diff --git a/system/base/appstate.class.php b/system/base/appstate.class.php index d0daae9..bda262a 100644 --- a/system/base/appstate.class.php +++ b/system/base/appstate.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Base; diff --git a/system/base/argumentoutofrangeexception.class.php b/system/base/argumentoutofrangeexception.class.php index 36a7666..2c7ba8a 100644 --- a/system/base/argumentoutofrangeexception.class.php +++ b/system/base/argumentoutofrangeexception.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Base; diff --git a/system/base/badmembercallexception.class.php b/system/base/badmembercallexception.class.php index 5130011..0de017e 100644 --- a/system/base/badmembercallexception.class.php +++ b/system/base/badmembercallexception.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Base; diff --git a/system/base/badmethodcallexception.class.php b/system/base/badmethodcallexception.class.php index 69457b5..8cb92cc 100644 --- a/system/base/badmethodcallexception.class.php +++ b/system/base/badmethodcallexception.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Base; diff --git a/system/base/build.class.php b/system/base/build.class.php index f008301..c32d738 100644 --- a/system/base/build.class.php +++ b/system/base/build.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Base; @@ -149,7 +149,7 @@ public static function clean() * * @return void */ - public static function build() + public static function rebuild() { $app = ApplicationBase::getInstance(); if($app instanceof \System\Web\WebApplicationBase) diff --git a/system/base/classloader.inc.php b/system/base/classloader.inc.php index 83ef17e..ec6edec 100644 --- a/system/base/classloader.inc.php +++ b/system/base/classloader.inc.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Base; diff --git a/system/base/debug.inc.php b/system/base/debug.inc.php index 71445ed..ceac7b3 100644 --- a/system/base/debug.inc.php +++ b/system/base/debug.inc.php @@ -5,7 +5,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ diff --git a/system/base/eventargs.class.php b/system/base/eventargs.class.php index 87a1100..00503d5 100644 --- a/system/base/eventargs.class.php +++ b/system/base/eventargs.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Base; use \System\Collections\CollectionBase; diff --git a/system/base/eventbase.class.php b/system/base/eventbase.class.php index e6da32f..9e5d6d6 100644 --- a/system/base/eventbase.class.php +++ b/system/base/eventbase.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Base; diff --git a/system/base/eventcollection.class.php b/system/base/eventcollection.class.php index 14df733..c537bc4 100644 --- a/system/base/eventcollection.class.php +++ b/system/base/eventcollection.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Base; use \System\Collections\CollectionBase; diff --git a/system/base/eventhandlerbase.class.php b/system/base/eventhandlerbase.class.php index 4220a0c..288f6af 100644 --- a/system/base/eventhandlerbase.class.php +++ b/system/base/eventhandlerbase.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Base; diff --git a/system/base/eventhandlercollection.class.php b/system/base/eventhandlercollection.class.php index c78764e..2cf41ab 100644 --- a/system/base/eventhandlercollection.class.php +++ b/system/base/eventhandlercollection.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Base; use \System\Collections\CollectionBase; diff --git a/system/base/events/applicationrunevent.class.php b/system/base/events/applicationrunevent.class.php index 5110e07..4b2f393 100644 --- a/system/base/events/applicationrunevent.class.php +++ b/system/base/events/applicationrunevent.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Base\Events; use System\Base\EventBase; diff --git a/system/base/events/applicationruneventhandler.class.php b/system/base/events/applicationruneventhandler.class.php index 90830d9..3832501 100644 --- a/system/base/events/applicationruneventhandler.class.php +++ b/system/base/events/applicationruneventhandler.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Base\Events; use System\Base\EventHandlerBase; diff --git a/system/base/exceptionbase.class.php b/system/base/exceptionbase.class.php index 1b2cfa2..733ea5e 100644 --- a/system/base/exceptionbase.class.php +++ b/system/base/exceptionbase.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Base; use \Exception; diff --git a/system/base/framework.info.file b/system/base/framework.info.file index 7fda4c9..3dd58c3 100644 --- a/system/base/framework.info.file +++ b/system/base/framework.info.file @@ -4,7 +4,7 @@ * @package PHPRum * @author darnell.shinbine * @copyright Copyright (c) 2013 - * @version 6.4.18-rc2 + * @version 6.4.29 */ namespace System\Base; @@ -12,7 +12,7 @@ * build name * @var string */ - const FRAMEWORK_BUILD_NAME = 'Ice cube'; + const FRAMEWORK_BUILD_NAME = 'Rum'; /** * framework version number @@ -24,25 +24,25 @@ * framework revision number * @var string */ - const FRAMEWORK_BUILD_REVISION = '18-rc2'; + const FRAMEWORK_BUILD_REVISION = '29'; /** * build number * @var string */ - const FRAMEWORK_BUILD_NUMBER = '201303011000'; + const FRAMEWORK_BUILD_NUMBER = '201501061549'; /** * build date * @var string */ - const FRAMEWORK_BUILD_TIME = '01 Mar 13'; + const FRAMEWORK_BUILD_TIME = '06 Jan 15'; /** * build time * @var string */ - const FRAMEWORK_BUILD_DATE = '10:00:27 MST'; + const FRAMEWORK_BUILD_DATE = '15:49:59 MST'; /** * framework authors @@ -54,11 +54,11 @@ * framework version string * @var string */ - const FRAMEWORK_VERSION_STRING = '6.4.18-rc2 (Build 201303011000)'; + const FRAMEWORK_VERSION_STRING = '6.4.29 (Build 201501061549)'; /** * framework date string * @var string */ - const FRAMEWORK_DATE_STRING = 'last build on 01 Mar 13 at 10:00:27 MST'; + const FRAMEWORK_DATE_STRING = 'last build on 06 Jan 15 at 15:49:59 MST'; ?> \ No newline at end of file diff --git a/system/base/indexoutofrangeexception.class.php b/system/base/indexoutofrangeexception.class.php index 0fe49a0..c41f0b4 100644 --- a/system/base/indexoutofrangeexception.class.php +++ b/system/base/indexoutofrangeexception.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Base; diff --git a/system/base/invalidargumentexception.class.php b/system/base/invalidargumentexception.class.php index dec2088..e67eeeb 100644 --- a/system/base/invalidargumentexception.class.php +++ b/system/base/invalidargumentexception.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Base; diff --git a/system/base/invalidoperationexception.class.php b/system/base/invalidoperationexception.class.php index b33e949..b286544 100644 --- a/system/base/invalidoperationexception.class.php +++ b/system/base/invalidoperationexception.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Base; diff --git a/system/base/methodnotimplementedexception.class.php b/system/base/methodnotimplementedexception.class.php index f01eed3..d462061 100644 --- a/system/base/methodnotimplementedexception.class.php +++ b/system/base/methodnotimplementedexception.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Base; diff --git a/system/base/missingargumentexception.class.php b/system/base/missingargumentexception.class.php index 4656357..6fe2624 100644 --- a/system/base/missingargumentexception.class.php +++ b/system/base/missingargumentexception.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Base; diff --git a/system/base/modelbase.class.php b/system/base/modelbase.class.php index 9b22904..81e8163 100644 --- a/system/base/modelbase.class.php +++ b/system/base/modelbase.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Base; diff --git a/system/base/rum.php b/system/base/rum.php index b8a70b6..4419b43 100644 --- a/system/base/rum.php +++ b/system/base/rum.php @@ -14,7 +14,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Base; @@ -128,7 +128,7 @@ /** * specifies the page request parameter */ - if( !defined( '__PATH_REQUEST_PARAMETER__' )) define( '__PATH_REQUEST_PARAMETER__', 'path' ); + if( !defined( '__PATH_REQUEST_PARAMETER__' )) define( '__PATH_REQUEST_PARAMETER__', 'page' ); /** * specifies the async request parameter diff --git a/system/base/typemismatchexception.class.php b/system/base/typemismatchexception.class.php index 77e6b5a..32bfb37 100644 --- a/system/base/typemismatchexception.class.php +++ b/system/base/typemismatchexception.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Base; diff --git a/system/caching/cachebase.class.php b/system/caching/cachebase.class.php index 1870fe9..4c755c6 100644 --- a/system/caching/cachebase.class.php +++ b/system/caching/cachebase.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Caching; diff --git a/system/caching/cacheexception.class.php b/system/caching/cacheexception.class.php index 44a663c..3aa86dd 100644 --- a/system/caching/cacheexception.class.php +++ b/system/caching/cacheexception.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Caching; use \System\Base\ExceptionBase; diff --git a/system/caching/dbcache.class.php b/system/caching/dbcache.class.php index 7d2eb3b..dec754e 100644 --- a/system/caching/dbcache.class.php +++ b/system/caching/dbcache.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Caching; @@ -64,10 +64,10 @@ public function get( $id ) { try { - $value = \unserialize($this->db->queryBuilder() + $value = ($this->db->queryBuilder() ->select($this->table, 'value') ->from($this->table) - ->where($this->table, 'cache_id', '>', (string)$id) + ->where($this->table, 'cache_id', '=', (string)$id) ->where($this->table, 'expires', '>', time()) ->openDataSet() ->row["value"]); @@ -81,7 +81,8 @@ public function get( $id ) { \System\Base\ApplicationBase::getInstance()->dataAdapter->addTableSchema(new \System\DB\TableSchema( array( - 'name' => $this->table), + 'name' => $this->table, + 'primaryKey' => 'cache_id'), array(), array(new \System\DB\ColumnSchema(array( 'name' => 'cache_id', @@ -100,9 +101,9 @@ public function get( $id ) new \System\DB\ColumnSchema(array( 'name' => 'expires', 'table' => $this->table, - 'type' => 'DATETIME', + 'type' => 'INTEGER', 'notNull' => true, - 'datetime' => true))))); + 'integer' => true))))); } return null; @@ -130,6 +131,8 @@ public function put( $id, $value, $expires = 0 ) $expires = 2147483647; } + $this->clear($id); + $this->db->queryBuilder() ->insertInto($this->table, array('cache_id', 'value', 'expires')) ->values(array((string)$id, \serialize($value), $expires)) @@ -148,7 +151,7 @@ public function clear( $id ) $this->db->queryBuilder() ->delete() ->from($this->table) - ->where($this->table, 'cache_id', '=', $id) + ->where($this->table, 'cache_id', '=', (string)$id) ->runQuery(); } diff --git a/system/caching/filecache.class.php b/system/caching/filecache.class.php index 914532f..5cdc0de 100644 --- a/system/caching/filecache.class.php +++ b/system/caching/filecache.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Caching; @@ -64,8 +64,15 @@ public function get( $id ) */ public function put( $id, $value, $expires = 0 ) { + if($expires) { + $expires = time() + (int)$expires; + } + else { + $expires = 2147483647; + } + $file = $this->getPath( (string)$id ); - $value = time() + (int)$expires . "\n" . \serialize( $value ); + $value = $expires . "\n" . \serialize( $value ); $fp = @fopen( $file, 'wb+' ); if( $fp ) diff --git a/system/caching/memcache.class.php b/system/caching/memcache.class.php index 1832d26..7f588a1 100644 --- a/system/caching/memcache.class.php +++ b/system/caching/memcache.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Caching; diff --git a/system/collections/collectionbase.class.php b/system/collections/collectionbase.class.php index 3efd532..00a7065 100644 --- a/system/collections/collectionbase.class.php +++ b/system/collections/collectionbase.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Collections; diff --git a/system/collections/dictionarybase.class.php b/system/collections/dictionarybase.class.php index 821a281..36d4cd4 100644 --- a/system/collections/dictionarybase.class.php +++ b/system/collections/dictionarybase.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Collections; diff --git a/system/collections/iteratorbase.class.php b/system/collections/iteratorbase.class.php index 76f99b7..c735386 100644 --- a/system/collections/iteratorbase.class.php +++ b/system/collections/iteratorbase.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Collections; use \ArrayAccess; diff --git a/system/collections/keycollection.class.php b/system/collections/keycollection.class.php index e1af9af..70230c2 100644 --- a/system/collections/keycollection.class.php +++ b/system/collections/keycollection.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Collections; diff --git a/system/collections/stringcollection.class.php b/system/collections/stringcollection.class.php index 7022599..73af102 100644 --- a/system/collections/stringcollection.class.php +++ b/system/collections/stringcollection.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Collections; diff --git a/system/collections/stringdictionary.class.php b/system/collections/stringdictionary.class.php index 3e77488..03a99ce 100644 --- a/system/collections/stringdictionary.class.php +++ b/system/collections/stringdictionary.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Collections; diff --git a/system/collections/valuecollection.class.php b/system/collections/valuecollection.class.php index a63cf49..9a3e174 100644 --- a/system/collections/valuecollection.class.php +++ b/system/collections/valuecollection.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Collections; diff --git a/system/comm/httpwebrequest.class.php b/system/comm/httpwebrequest.class.php index 6cb2724..0bb96b5 100644 --- a/system/comm/httpwebrequest.class.php +++ b/system/comm/httpwebrequest.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Comm; @@ -17,6 +17,7 @@ * @property string $timeout timeout * @property string $httpVersion HTTP version * @property string $url URL to send to + * @property bool $keepAlive Specifies whether to keep connection alive * * @package PHPRum * @subpackage Comm @@ -60,6 +61,12 @@ class HTTPWebRequest */ private $url = ''; + /** + * Specifies whether to keep connection alive + * @var bool + */ + private $keepAlive = false; + /** * headers to send * @var array @@ -106,6 +113,10 @@ public function __get( $field ) { return $this->url; } + elseif( $field === 'keepAlive' ) + { + return $this->keepAlive; + } else { throw new \System\Base\BadMemberCallException("call to undefined property $field in ".get_class($this)); @@ -157,6 +168,10 @@ public function __set( $field, $value ) { $this->url = (string)$value; } + elseif( $field === 'keepAlive' ) + { + $this->keepAlive = (bool)$value; + } else { throw new \System\Base\BadMemberCallException("call to undefined property $field in ".get_class($this)); @@ -313,7 +328,12 @@ protected function getRequestString() $request .= "$header\r\n"; } - $request .= "Connection: keep-alive\r\n\r\n"; + if($this->keepAlive) { + $request .= "Connection: keep-alive\r\n\r\n"; + } + else { + $request .= "Connection: Close\r\n\r\n"; + } if( strtoupper( $this->method ) === 'POST' ) { diff --git a/system/comm/httpwebresponse.class.php b/system/comm/httpwebresponse.class.php index a88ba0f..9800aff 100644 --- a/system/comm/httpwebresponse.class.php +++ b/system/comm/httpwebresponse.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Comm; @@ -93,7 +93,7 @@ public function readFromStream( \System\Utils\StreamBase &$stream ) // handle Continue condition if( strstr( $this->httpStatus, "HTTP/1.1 100 Continue" ) !== false ) { - while( !$stream->oes() && ( $headers = $stream->readln() )) + while( !$stream->eos() && ( $headers = $stream->readln() )) { if( str_replace( "\r", '', $headers ) === "\n" ) { @@ -113,7 +113,7 @@ public function readFromStream( \System\Utils\StreamBase &$stream ) break; } - $data = explode( ':', str_replace( "\r", '', str_replace( "\n", '', $headers ))); + $data = explode( ':', str_replace( "\r", '', str_replace( "\n", '', $headers )), 2); if( isset( $data[1] )) { diff --git a/system/comm/mail/imailclient.class.php b/system/comm/mail/imailclient.class.php index c58ce6e..dc360b6 100644 --- a/system/comm/mail/imailclient.class.php +++ b/system/comm/mail/imailclient.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Comm\Mail; diff --git a/system/comm/mail/phpmailclient.class.php b/system/comm/mail/phpmailclient.class.php index bd585bd..fee5052 100644 --- a/system/comm/mail/phpmailclient.class.php +++ b/system/comm/mail/phpmailclient.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Comm\Mail; diff --git a/system/comm/mail/sendmailclient.class.php b/system/comm/mail/sendmailclient.class.php index 6f89966..7d15e97 100644 --- a/system/comm/mail/sendmailclient.class.php +++ b/system/comm/mail/sendmailclient.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Comm\Mail; diff --git a/system/comm/mail/smtpclient.class.php b/system/comm/mail/smtpclient.class.php index eb9dcb3..41f39b8 100644 --- a/system/comm/mail/smtpclient.class.php +++ b/system/comm/mail/smtpclient.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Comm\Mail; diff --git a/system/console/consoleapplicationbase.class.php b/system/console/consoleapplicationbase.class.php index 5829bab..75f94d3 100644 --- a/system/console/consoleapplicationbase.class.php +++ b/system/console/consoleapplicationbase.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Console; use System\Base\ApplicationBase; diff --git a/system/db/columncompare.class.php b/system/db/columncompare.class.php index 6a4c905..5bedeee 100644 --- a/system/db/columncompare.class.php +++ b/system/db/columncompare.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\DB; diff --git a/system/db/columnschema.class.php b/system/db/columnschema.class.php index 126f829..365bcb9 100644 --- a/system/db/columnschema.class.php +++ b/system/db/columnschema.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\DB; diff --git a/system/db/dataadapter.class.php b/system/db/dataadapter.class.php index 5ef967c..2fbd1e2 100644 --- a/system/db/dataadapter.class.php +++ b/system/db/dataadapter.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\DB; @@ -241,28 +241,6 @@ final static public function create( $dsn ) } - /** - * creates a connection object to a datasource - * - * Examples: - * - * adapter=mysql;uid=root;pwd=;server=localhost;database=northwind;charset=utf8;pconnect=false;cache_enabled=false;cache_expires=300; - * adapter=mssql;uid=root;pwd=;server=localhost;database=northwind;charset=utf8; - * adapter=text;format=TabDelimited;source=/northwind.csv;charset=utf8; - * adapter=dir;source=/northwind; - * - * - * @param string $dsn connection string - * @return DataAdapter - * / - final static public function createPDO( $dsn ) - { - include_once __SYSTEM_PATH__ . '/db/pdo/pdodataadapter' . __CLASS_EXTENSION__; - $da = new PDO\PDODataAdapter($args); - return $da; - } - - /** * opens a DataSet specified by the source * diff --git a/system/db/dataadapterexception.class.php b/system/db/dataadapterexception.class.php index 5dcac95..a895876 100644 --- a/system/db/dataadapterexception.class.php +++ b/system/db/dataadapterexception.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\DB; use \System\Base\ExceptionBase; diff --git a/system/db/databaseexception.class.php b/system/db/databaseexception.class.php index bdbfd8a..dcca55d 100644 --- a/system/db/databaseexception.class.php +++ b/system/db/databaseexception.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\DB; use \System\Base\ExceptionBase; diff --git a/system/db/databaseschema.class.php b/system/db/databaseschema.class.php index f9d679c..ca6febe 100644 --- a/system/db/databaseschema.class.php +++ b/system/db/databaseschema.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\DB; diff --git a/system/db/dataset.class.php b/system/db/dataset.class.php index c2a7c6a..63f22bb 100644 --- a/system/db/dataset.class.php +++ b/system/db/dataset.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\DB; use \System\Base\ModelBase; diff --git a/system/db/datasettype.class.php b/system/db/datasettype.class.php index a291bb7..3130879 100644 --- a/system/db/datasettype.class.php +++ b/system/db/datasettype.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\DB; diff --git a/system/db/dir/dirdataadapter.class.php b/system/db/dir/dirdataadapter.class.php index 055a62e..31f2b69 100644 --- a/system/db/dir/dirdataadapter.class.php +++ b/system/db/dir/dirdataadapter.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\DB\Dir; use \System\DB\DataAdapter; diff --git a/system/db/mssql/mssqldataadapter.class.php b/system/db/mssql/mssqldataadapter.class.php deleted file mode 100644 index 133c8cd..0000000 --- a/system/db/mssql/mssqldataadapter.class.php +++ /dev/null @@ -1,1247 +0,0 @@ -link ) - { - if( isset( $this->args['server'] ) && - isset( $this->args['uid'] ) && - isset( $this->args['pwd'] ) && - isset( $this->args['database'] )) - { - $this->link = \sqlsrv_connect( $this->args['server'] , array( "UID"=>$this->args['uid'], "PWD"=>$this->args['pwd'], "Database"=>$this->args["database"] )); - - if( $this->link ) - { - return true; - } - else - { - throw new \System\DB\DatabaseException("could not connect to database " . implode(' ', array_pop(sqlsrv_errors()))); - } - } - else - { - throw new \System\DB\DataAdapterException("missing required connection string parameter"); - } - } - else - { - throw new \System\Base\InvalidOperationException("connection already open"); - } - } - - /** - * creats a TableSchema object - * - * @return DatabaseSchema - */ - public function addTableSchema( \System\DB\TableSchema &$tableSchema ) - { - $columns = ""; - - foreach($tableSchema->columnSchemas as $columnSchema) - { - $primaryKeys = array(); - $indexKeys = array(); - $uniqueKeys = array(); - $type = ""; - - if($columnSchema->integer) - { - $type = "INT({$columnSchema->length})"; - } - elseif($columnSchema->real) - { - $type = "FLOAT({$columnSchema->length})"; - } - elseif($columnSchema->boolean) - { - $type = "BIT"; - } - elseif($columnSchema->year) - { - $type = "YEAR"; - } - elseif($columnSchema->date) - { - $type = "DATE"; - } - elseif($columnSchema->time) - { - $type = "TIME"; - } - elseif($columnSchema->datetime) - { - $type = "DATETIME"; - } - elseif($columnSchema->blob) - { - $type = "VARBINARY(MAX)"; - } - else - { - $type = "VARCHAR({$columnSchema->length}) "; - } - - if($columns) $columns .= ",\n "; - $columns .= "{$columnSchema->name} {$type}".($columnSchema->notNull?' NOT NULL':'').($columnSchema->autoIncrement?' AUTO_INCREMENT':''); - - if($columnSchema->primaryKey) - { - $primaryKeys[] = $columnSchema->name; - } - - if($columnSchema->foreignKey) - { - $indexKeys[] = $columnSchema->name; - } - - if($columnSchema->unique) - { - $uniqueKeys[] = $columnSchema->name; - } - } - - if($primaryKeys) - { - $column = ""; - foreach($primaryKeys as $primaryKey) - { - if($column) $column .= ", "; - $column .= "{$primaryKey}"; - } - - $columns .= ",\n PRIMARY KEY ({$column})"; - } - - if($indexKeys) - { - $column = ""; - foreach($indexKeys as $indexKey) - { - if($column) $column .= ", "; - $column .= "{$indexKey}"; - } - - $columns .= ",\n INDEX ({$column})"; - } - - if($uniqueKeys) - { - $column = ""; - foreach($uniqueKeys as $uniqueKey) - { - if($column) $column .= ", "; - $column .= "{$uniqueKey}"; - } - - $columns .= ",\n UNIQUE ({$column})"; - } - - $this->execute("CREATE TABLE {$tableSchema->name} (\n {$columns}\n);"); - } - - - /** - * alters a TableSchema object - * - * @return DatabaseSchema - */ - public function alterTableSchema( \System\DB\TableSchema &$tableSchema ) - { - throw new \System\Base\MethodNotImplementedException(); - } - /** - * drops a TableSchema object - * - * @return DatabaseSchema - */ - public function dropTableSchema( \System\DB\TableSchema &$tableSchema ) - { - throw new \System\Base\MethodNotImplementedException(); - } - /** - * returns true if a connection to a datasource is currently open - * - * @return bool true if connection open - */ - public function opened() - { - return (bool)$this->link; - } - /** - * builds a DataBaseSchema object - * - * @return DatabaseSchema - */ - public function buildSchema() - { - $databaseProperties = array(); - $tableSchemas = array(); - - $tables = $this->runQuery( "SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE';" ); - - while($table = \sqlsrv_fetch_array($tables)) - { - $i=0; - $tableProperties = array('name'=>$table[0]); - $foreignKeys = array(); - $columnSchemas = array(); - - $columns = $this->runQuery( "SELECT * FROM {$table[0]} " ); - - // get table of mssql types - $mssql_type = array(); - // int - $mssql_type[-7] = 'BIT'; - $mssql_type[-6] = 'TINYINT'; - $mssql_type[5] = 'SMALLINT'; - $mssql_type[4] = 'INT'; - $mssql_type[-5] = 'BIGINT'; - $mssql_type[-2] = 'TIMESTAMP'; - $mssql_type[-11] = 'UNIQUEIDENTIFIER'; - - $mssql_type[2] = 'NUMERIC'; - $mssql_type[3] = 'DECIMAL'; - $mssql_type[6] = 'FLOAT'; - $mssql_type[7] = 'REAL'; - - $mssql_type[91] = 'DATE'; - $mssql_type[93] = 'DATETIME'; - $mssql_type[-155] = 'DATETIMEOFFSET'; - $mssql_type[-154] = 'TIME'; - - $mssql_type[1] = 'CHAR'; - $mssql_type[-8] = 'NCHAR'; - $mssql_type[12] = 'VARCHAR'; - $mssql_type[-9] = 'NVARCHAR'; - $mssql_type[-1] = 'TEXT'; - $mssql_type[-10] = 'NTEXT'; - - $mssql_type[-2] = 'BINARY'; - $mssql_type[-3] = 'VARBINARY'; - $mssql_type[-4] = 'IMAGE'; - $mssql_type[-151] = 'UDT'; - $mssql_type[-152] = 'XML'; - - $fieldMeta = sqlsrv_field_metadata( $columns ); - while($i < \sqlsrv_num_fields($columns)) - { - - $field = $this->getField($table[0], $fieldMeta[$i]["Name"]); - // setting primary key - if((bool) $field['primaryKey']) - { - $tableProperties['primaryKey'] = $fieldMeta[$i]["Name"]; - } - - // mssql field info - $columnSchemas[] = new \System\DB\ColumnSchema(array( - 'name' => (string) $fieldMeta[$i]["Name"], - 'table' => (string) $table[0], - 'type' => (string) $mssql_type[$fieldMeta[$i]["Type"]], - 'length' => intval($fieldMeta[$i]["Size"])==0?intval($fieldMeta[$i]["Precision"]):intval($fieldMeta[$i]["Size"]), - 'notNull' => (bool) ( !$fieldMeta[$i]["Nullable"] ), - 'primaryKey' => (bool) $field['primaryKey'], - 'multipleKey' => false, - 'foreignKey' => false, - 'unique' => (bool) $field['unique'], - 'numeric' => (bool) (( $fieldMeta[$i]["Type"] === -7 ) || - ( $fieldMeta[$i]["Type"] === -6 ) || - ( $fieldMeta[$i]["Type"] === 5 ) || - ( $fieldMeta[$i]["Type"] === 4 ) || - ( $fieldMeta[$i]["Type"] === -5 ) || - ( $fieldMeta[$i]["Type"] === -2 ) || - ( $fieldMeta[$i]["Type"] === -11 ) || - ( $fieldMeta[$i]["Type"] === 2 ) || - ( $fieldMeta[$i]["Type"] === 3 ) || - ( $fieldMeta[$i]["Type"] === 6 ) || - ( $fieldMeta[$i]["Type"] === 7 )), - 'blob' => (bool) (( $fieldMeta[$i]["Type"] === -3 ) || - ( $fieldMeta[$i]["Type"] === -4 )), - 'string' => (bool) (( $fieldMeta[$i]["Type"] === 1 ) || - ( $fieldMeta[$i]["Type"] === -8 ) || - ( $fieldMeta[$i]["Type"] === 12 ) || - ( $fieldMeta[$i]["Type"] === -9 ) || - ( $fieldMeta[$i]["Type"] === -1 ) || - ( $fieldMeta[$i]["Type"] === -10 )), - 'integer' => (bool) (( $fieldMeta[$i]["Type"] === -7 ) || - ( $fieldMeta[$i]["Type"] === -6 ) || - ( $fieldMeta[$i]["Type"] === 5 ) || - ( $fieldMeta[$i]["Type"] === 4 ) || - ( $fieldMeta[$i]["Type"] === -5 ) || - ( $fieldMeta[$i]["Type"] === -11 )), - 'real' => (bool) (( $fieldMeta[$i]["Type"] === 2 ) || - ( $fieldMeta[$i]["Type"] === 3 ) || - ( $fieldMeta[$i]["Type"] === 6 ) || - ( $fieldMeta[$i]["Type"] === 7 )), - 'year' => '', - 'date' => (bool) ( $fieldMeta[$i]["Type"] === 91 ), - 'time' => (bool) ( $fieldMeta[$i]["Type"] === -154 ), - 'datetime' => (bool) ( $fieldMeta[$i]["Type"] === 93 ), - 'boolean' => (bool) ( $fieldMeta[$i]["Type"] === -7 ), - 'autoIncrement' => $field['autoIncrement'], - 'binary' => (bool) (( $fieldMeta[$i]["Type"] === -2 ) || - ( $fieldMeta[$i]["Type"] === -3 )) - )); - - $i++; - } - - $tableSchemas[] = new \System\DB\TableSchema($tableProperties, $foreignKeys, $columnSchemas); - } - - return new \System\DB\DatabaseSchema($databaseProperties, $tableSchemas); - } - /** - * creats a Transaction object - * - * @return MSSQLTransaction - */ - public function beginTransaction() - { - return new MSSQLTransaction($this); - } - /** - * creats a QueryBuilder object - * - * @return MySQLQueryBuilder - */ - public function queryBuilder() - { - return new MSSQLQueryBuilder($this); - } - /** - * Executes a query procedure on the current connection and return the result - * - * @param string $query sql query - * @param bool $buffer buffer resultset - * @return resource - */ - protected function query( $query, $buffer ) - { - if( $this->link ) - { - $result = \sqlsrv_query( $this->link , $query ); - if( !$result ) - { - dmp($query); - throw new \System\DB\DatabaseException(implode(' ', array_pop(sqlsrv_errors()))); - - } - - return $result; - } - else - { - throw new \System\DB\DataAdapterException("MSSQL resource in not a valid link identifier"); - } - } - /** - * Returns escaped string - * - * @param string $unescaped_string String to escape - * @return string Escaped string - */ - public function escapeString( $unescaped_string ) - { - if(is_numeric($unescaped_string)) - return $unescaped_string; - $unpacked = unpack('H*hex', $unescaped_string); - return '0x' . $unpacked['hex']; - } - /** - * fetches DataSet from database string using source string - * - * @param DataSet &$ds empty DataSet object - * @return void - */ - public function fill( \System\DB\DataSet &$ds ) - { - if( $this->link ) - { - $source = ''; - if( $ds->source instanceof QueryBuilder ) - { - $source = $this->getQuery( $ds->source ); - } - elseif( !strstr( strtoupper($ds->source), 'SELECT' ) && - !strstr( strtoupper($ds->source), 'DESCRIBE' ) && - !strstr( strtoupper($ds->source), 'SHOW' )) - { - // source is table name - $source = 'SELECT * FROM [' . $ds->source . ']'; - } - else - { - $source = $ds->source; - } - // establish link to db resource - // replaced mysql_query with $this->execute - $result = $this->runQuery( $ds->source ); - - $fields = array(); - if( $result ) - { - // get table of mssql types - $mssql_type = array(); - // int - $mssql_type[-7] = 'BIT'; - $mssql_type[-6] = 'TINYINT'; - $mssql_type[5] = 'SMALLINT'; - $mssql_type[4] = 'INT'; - $mssql_type[-5] = 'BIGINT'; - $mssql_type[-2] = 'TIMESTAMP'; - $mssql_type[-11] = 'UNIQUEIDENTIFIER'; - - $mssql_type[2] = 'NUMERIC'; - $mssql_type[3] = 'DECIMAL'; - $mssql_type[6] = 'FLOAT'; - $mssql_type[7] = 'REAL'; - - $mssql_type[91] = 'DATE'; - $mssql_type[93] = 'DATETIME'; - $mssql_type[-155] = 'DATETIMEOFFSET'; - $mssql_type[-154] = 'TIME'; - - $mssql_type[1] = 'CHAR'; - $mssql_type[-8] = 'NCHAR'; - $mssql_type[12] = 'VARCHAR'; - $mssql_type[-9] = 'NVARCHAR'; - $mssql_type[-1] = 'TEXT'; - $mssql_type[-10] = 'NTEXT'; - - $mssql_type[-2] = 'BINARY'; - $mssql_type[-3] = 'VARBINARY'; - $mssql_type[-4] = 'IMAGE'; - $mssql_type[-151] = 'UDT'; - $mssql_type[-152] = 'XML'; - - - /* - * create field objects - * - * this code loops through fields of resultset - * checks is field is primary key, if so, set the primary key field name - * then adds all field names to an array - * - * cannot be used when resultset is emtpy (mysql_num_fields wil fail) - */ - $colcount = sqlsrv_num_fields( $result ); - // set table property - $ds->setTable($this->getTableFromSQL( $source )); - $fieldMeta = sqlsrv_field_metadata( $result ); - //dmp($fieldMeta); - for( $i=0; $i < $colcount; $i++ ) - { - $field = $this->getField($ds->table, $fieldMeta[$i]["Name"]); - // mssql field info - $fieldMetas[] = new \System\DB\ColumnSchema(array( - 'name' => (string) $fieldMeta[$i]["Name"], - 'table' => (string) $ds->table, - 'type' => (string) $mssql_type[$fieldMeta[$i]["Type"]], - 'length' => intval($fieldMeta[$i]["Size"])==0?intval($fieldMeta[$i]["Precision"]):intval($fieldMeta[$i]["Size"]), - 'notNull' => (bool) ( !$fieldMeta[$i]["Nullable"] ), - 'primaryKey' => (bool) $field['primaryKey'], - 'multipleKey' => false, - 'foreignKey' => false, - 'unique' => (bool) $field['unique'], - 'numeric' => (bool) (( $fieldMeta[$i]["Type"] === -7 ) || - ( $fieldMeta[$i]["Type"] === -6 ) || - ( $fieldMeta[$i]["Type"] === 5 ) || - ( $fieldMeta[$i]["Type"] === 4 ) || - ( $fieldMeta[$i]["Type"] === -5 ) || - ( $fieldMeta[$i]["Type"] === -2 ) || - ( $fieldMeta[$i]["Type"] === -11 ) || - ( $fieldMeta[$i]["Type"] === 2 ) || - ( $fieldMeta[$i]["Type"] === 3 ) || - ( $fieldMeta[$i]["Type"] === 6 ) || - ( $fieldMeta[$i]["Type"] === 7 )), - 'blob' => (bool) (( $fieldMeta[$i]["Type"] === -3 ) || - ( $fieldMeta[$i]["Type"] === -4 )), - 'string' => (bool) (( $fieldMeta[$i]["Type"] === 1 ) || - ( $fieldMeta[$i]["Type"] === -8 ) || - ( $fieldMeta[$i]["Type"] === 12 ) || - ( $fieldMeta[$i]["Type"] === -9 ) || - ( $fieldMeta[$i]["Type"] === -1 ) || - ( $fieldMeta[$i]["Type"] === -10 )), - 'integer' => (bool) (( $fieldMeta[$i]["Type"] === -7 ) || - ( $fieldMeta[$i]["Type"] === -6 ) || - ( $fieldMeta[$i]["Type"] === 5 ) || - ( $fieldMeta[$i]["Type"] === 4 ) || - ( $fieldMeta[$i]["Type"] === -5 ) || - ( $fieldMeta[$i]["Type"] === -11 )), - 'real' => (bool) (( $fieldMeta[$i]["Type"] === 2 ) || - ( $fieldMeta[$i]["Type"] === 3 ) || - ( $fieldMeta[$i]["Type"] === 6 ) || - ( $fieldMeta[$i]["Type"] === 7 )), - 'year' => '', - 'date' => (bool) ( $fieldMeta[$i]["Type"] === 91 ), - 'time' => (bool) ( $fieldMeta[$i]["Type"] === -154 ), - 'datetime' => (bool) ( $fieldMeta[$i]["Type"] === 93 ), - 'boolean' => (bool) ( $fieldMeta[$i]["Type"] === -7 ), - 'autoIncrement' => $field['autoIncrement'], - 'binary' => (bool) (( $fieldMeta[$i]["Type"] === -2 ) || - ( $fieldMeta[$i]["Type"] === -3 )) - )); - - // add field to field collection - - $fields[]=$fieldMeta[$i]["Name"]; - } - /* - * create record objects - * - * this code loops through all rows and fields - * then creates the following array... - * DataSet[row number][field name] = value - */ - - $rowcount = sqlsrv_num_rows( $result ); - - $rows = array();$j=0; - while($row = sqlsrv_fetch_array( $result )) - { - // add row to DataSet - for( $i=0; $i < $colcount; $i++ ) $rows[$j][$fields[$i]]=$row[$i]; - $j++; - } - // set rows - $ds->setRows( $rows ); - // set field meta - $ds->setFieldMeta( $fieldMetas ); - // set fields - $ds->setFields($fields); - // cleanup - sqlsrv_free_stmt( $result ); - } - else - { - throw new \System\DB\DatabaseException(implode(' ', array_pop(sqlsrv_errors()))); - } - } - else - { - throw new \System\Base\InvalidOperationException("connection is closed"); - } - } - - /** - * closes an open connection - * - * @return bool true if successfull - */ - public function close() - { - if( $this->link ) - { - if( sqlsrv_close( $this->link )) - { - $this->link = null; - return true; - } - else - { - throw new DatabaseException("could not close mssql connection"); - } - } - else - { - throw new \System\Base\InvalidOperationException("connection already closed"); - } - } - - - /** - * attempt to insert a record into the datasource - * - * @param DataSet &$ds reference to a DataSet - * @return void - */ - final public function insert(\System\DB\DataSet &$ds ) - { - if( $this->link ) - { - $tableSchema = $ds->dataAdapter->getSchema()->seek($ds->table); - $auto_increment=false;$not_null=false; - for($i=0,$index=-1;$icolumnSchemas);$i++) - { - $column = $tableSchema->columnSchemas[$i]; - if($column->name == $tableSchema->primaryKey ) - { - if((bool)$column->autoIncrement) $auto_increment=true; - if((bool)$column->notNull )$not_null=true; - } - } - - if(!$auto_increment && $not_null && $ds->row[$tableSchema->primaryKey] == null) - { - throw new \System\DB\DataAdapterException("Primary key can't be null"); - } - - $this->queryBuilder() - ->insertInto($ds->table, $ds->fields) - ->values($ds->row) - ->runQuery(); - - if($tableSchema->primaryKey) - { - $ds[$tableSchema->primaryKey] = (int) $this->getLastInsertId(); - - } - - - } - else - { - throw new \System\DB\DataAdapterException("Connection is closed"); - } - } - - - /** - * attempt to update a record in the datasource - * - * @param DataSet &$ds reference to a DataSet - * @return void - */ - final public function update( \System\DB\DataSet &$ds ) - { - if( $this->link ) - { - $tableSchema = $ds->dataAdapter->getSchema()->seek($ds->table); - - if($tableSchema->primaryKey) - { - $this->queryBuilder() - ->update($ds->table) - ->setColumns($ds->table, $ds->fields, $ds->row) - ->where($ds->table, $tableSchema->primaryKey, '=', $ds[$tableSchema->primaryKey]) - ->runQuery(); - } - else - { - throw new \System\DB\DataAdapterException("Cannot update record, no primary key is defined"); - } - } - else - { - throw new \System\DB\DataAdapterException("Connection is closed"); - } - } - - - /** - * attempt to delete a record in the datasource - * - * @param DataSet &$ds reference to a DataSet - * @return void - */ - final public function delete( \System\DB\DataSet &$ds ) - { - if( $this->link ) - { - $tableSchema = $ds->dataAdapter->getSchema()->seek($ds->table); - - if($tableSchema->primaryKey) - { - $this->queryBuilder() - ->delete() - ->from($ds->table) - ->where($ds->table, $tableSchema->primaryKey, '=', $ds[$tableSchema->primaryKey]) - ->runQuery(); - } - else - { - throw new \System\DB\DataAdapterException("Cannot delete record, no primary key is defined"); - } - } - else - { - throw new \System\DB\DataAdapterException("Connection is closed"); - } - } - - - /** - * Executes a sql query or procedure on the current connection - * - * @param string $query sql query - * @return void - - public function execute( $query ) - { - $this->executeInternal( $query ); - } - - - /** - * begin transaction - * - * @return void - */ - public function begin() - { - if( $this->link ) - { - sqlsrv_begin_transaction( $this->link ); - } - else - { - throw new \System\Base\InvalidOperationException("mssql resource is not a valid link identifier"); - } - } - - - /** - * rollback transaction - * - * @return void - */ - public function rollback() - { - if( $this->link ) - { - sqlsrv_rollback( $this->link ); - } - else - { - throw new \System\Base\InvalidOperationException("mssql resource is not a valid link identifier"); - } - } - - - /** - * commit transaction - * - * @return void - */ - public function commit() - { - if( $this->link ) - { - sqlsrv_commit( $this->link ); - } - else - { - throw new \System\Base\InvalidOperationException("mssql resource is not a valid link identifier"); - } - } - - - /** - * set foreign key checks - * - * @param bool $set set/unset foreign key checks - * @return void - */ - final public function setForeignKeyChecks( $set ) - { - if((bool)$set) - { - $this->runQuery( 'SET FOREIGN_KEY_CHECKS=1;' ); - } - else - { - $this->runQuery( 'SET FOREIGN_KEY_CHECKS=0;' ); - } - } - - - /** - * returns a DataSet of tables - * - * @return DataSet - */ - public function getTables() - { - return $this->openDataSet( "SHOW TABLES FROM [{$this->args['database']}]" ); - } - - - /** - * return id of last record inserted - * - * @return int - */ - public function getLastInsertId() - { - if($this->link) - { - - $id= \sqlsrv_fetch_array($this->runQuery("SELECT @@Identity")); - return $id[0]; - } - else - { - throw new \System\Base\InvalidOperationException("mssql resource is not a valid link identifier"); - - } - } - /** - * return id of last record inserted for a column in table - * - * @return int - */ - public function getLastColumnIdOfTable($table,$column) - { - if($this->link) - { - - $max_id = \sqlsrv_fetch($this->runQuery("SELECT max({$column}) FROM {$table}")); - return $max_id; - } - else - { - throw new \System\Base\InvalidOperationException("mssql resource is not a valid link identifier"); - - } - - } - /** - * return affected rows - * - * @return int - */ - public function getAffectedRows() - { - if( $this->link ) - { - return sqlsrv_rows_affected( $this->link ); - } - else - { - throw new \System\Base\InvalidOperationException("mssql resource is not a valid link identifier"); - } - } - - - /** - * Executes a sql query or procedure on the current connection - * - * @param string $query sql query - * @return resource mysql resultset - */ - protected function executeInternal( $query ) - { - $sql = ''; - if( $query instanceof QueryBuilder ) - { - $sql = $this->getQuery( $query ); - } - else - { - $sql = $query; - } - - if( $this->link ) - { - // start timer - $timer = new \System\Utils\Timer(true); - $this->lastQuery = $sql; - $this->lastQueryTime = 0; - - $link = sqlsrv_query( $this->link, $sql ); - - if( !$link ) - { - throw new SQLException(implode(' ', array_pop(sqlsrv_errors()))); - } - - // end time - $this->lastQueryTime = $timer->elapsed(); - $this->queryCount++; - $this->queryTime += $this->lastQueryTime; - - return $link; - } - else - { - throw new \System\Base\InvalidOperationException("mysql resource in not a valid link identifier"); - } - } - - - /** - * Returns SQL based on the QueryBuilder - * - * @param QueryBuilder $queryBuilder QueryBuilder object - * @return string SQL query - */ - final protected function getQuery( QueryBuilder $queryBuilder ) { - - // select - if( $queryBuilder->getStatement() === 'select' ) { - $sql = 'select'; - - // columns - $columns = ''; - foreach( $queryBuilder->getColumns() as $column ) { - - if( strlen( $columns ) > 0 ) { - $columns .= ' - , '; - } - else { - $columns = ' '; - } - - if( $column['table'] === '*' ) { - $columns .= '*'; - } - else { - $columns .= '`' . $column['table'] . '`'; - - if( $column['column'] === '*' ) { - $columns .= '.*'; - } - else { - $columns .= '.`' . $column['column'] . '`'; - $columns .= ' as `' . $column['alias'] . '`'; - } - } - } - - $sql .= isset( $columns )?$columns:''; - - // from - $tables = ''; - foreach( $queryBuilder->getTables() as $table ) { - if( strlen( $tables ) > 0 ) { - $tables .= ' - , `' . $table['table'] . '`' . ' as `' . $table['alias'] . '`'; - } - else { - $tables = ' - from `' . $table['table'] . '`' . ' as `' . $table['alias'] . '`'; - } - } - - $sql .= isset( $tables )?$tables:''; - } - - // insert - elseif( $queryBuilder->getStatement() === 'insert' ) { - $sql = 'insert'; - - $tables = $queryBuilder->getTables(); - - $sql .= ' - into `' . $tables[0]['table'] . '` ('; - - // columns - $columns = ''; - foreach( $queryBuilder->getColumns() as $column ) { - if( strlen( $columns ) > 0 ) { - $columns .= ',`' . $column['column'] . '`'; - } - else { - $columns = '`' . $column['column'] . '`'; - } - } - - $sql .= isset( $columns )?$columns:''; - $sql .= ')'; - - $sql .= ' - values('; - - // values - $values = ''; - foreach( $queryBuilder->getValues() as $value ) { - if( strlen( $values ) > 0 ) { - $values .= ','; - } - else { - $values = ''; - } - if( is_null( $value )) { - $values .= 'null'; - } - elseif( is_bool( $value )) { - $values .= $value?'true':'false'; - } - elseif( is_int( $value )) { - $values .= (int)$value; - } - elseif( is_float( $value )) { - $values .= (real)$value; - } - else { - $values .= '"' . $this->getEscapeString( $value ) . '"'; - } - } - - $sql .= $values . ')'; - } - - // update - elseif( $queryBuilder->getStatement() === 'update' ) { - $sql = 'update'; - - $tables = $queryBuilder->getTables(); - $sql .= ' `' . $tables[0]['table'] . '`'; - - // set - $columns = $queryBuilder->getColumns(); - $values = $queryBuilder->getValues(); - $setClause = ''; - for( $i = 0; $i < count( $columns ); $i++ ) { - if( strlen( $setClause ) > 0 ) { - $setClause .= ' - , '; - } - else { - $setClause = ' -set '; - } - - if( is_null( $values[$i] )) { - $setClause .= '`' . $columns[$i]['table'] . '`.`' . $columns[$i]['column'] . '` = null'; - } - elseif( is_bool( $values[$i] )) { - $setClause .= '`' . $columns[$i]['table'] . '`.`' . $columns[$i]['column'] . '` = ' . ($values[$i]?'true':'false'); - } - elseif( is_int( $values[$i] )) { - $setClause .= '`' . $columns[$i]['table'] . '`.`' . $columns[$i]['column'] . '` = ' . (int)$values[$i]; - } - elseif( is_float( $values[$i] )) { - $setClause .= '`' . $columns[$i]['table'] . '`.`' . $columns[$i]['column'] . '` = ' . (real)$values[$i]; - } - else { - $setClause .= '`' . $columns[$i]['table'] . '`.`' . $columns[$i]['column'] . '` = "' . $this->getEscapeString( $values[$i] ) . '"'; - } - } - - $sql .= isset( $setClause )?$setClause:''; - } - - // delete - elseif( $queryBuilder->getStatement() === 'delete' ) { - $sql = 'delete'; - - // from - $tables = ''; - foreach( $queryBuilder->getTables() as $table ) { - if( strlen( $tables ) > 0 ) { - $tables .= ' - , `' . $table['table'] . '`'; - } - else { - $tables = ' - from `' . $table['table'] . '`'; - } - } - - $sql .= isset( $tables )?$tables:''; - } - - // joins - foreach( $queryBuilder->getJoins() as $join ) { - $sql .= ' -' . $join['type'] . ' - join `' . $join['lefttable'] . '` as `' . $join['alias'] . '` - on `' . $join['alias'] . '`.`' . $join['leftcolumn'] . '` = `' . $join['righttable'] . '`.`' . $join['rightcolumn'] . '`'; - - - } - - // where - $whereClause = ''; - foreach( $queryBuilder->getWhereClauses() as $where ) { - if( strlen( $whereClause ) > 0 ) { - $whereClause .= ' -and'; - } - else { - $whereClause = ' -where'; - } - if( is_null( $where['value'] )) { - $whereClause .= ' - `' . $where['table'] . '`.`' . $where['column'] . '` is null'; - } - elseif( is_bool( $where['value'] )) { - $whereClause .= ' - `' . $where['table'] . '`.`' . $where['column'] . '` = ' . ($where['value']?'true':'false'); - } - elseif( is_int( $where['value'] )) { - $whereClause .= ' - `' . $where['table'] . '`.`' . $where['column'] . '` ' . $where['operand'] . ' ' . (int)$where['value'] . ''; - } - elseif( is_float( $where['value'] )) { - $whereClause .= ' - `' . $where['table'] . '`.`' . $where['column'] . '` ' . $where['operand'] . ' ' . (real)$where['value'] . ''; - } - else { - $whereClause .= ' - `' . $where['table'] . '`.`' . $where['column'] . '` ' . $where['operand'] . ' "' . $this->getEscapeString( $where['value'] ) . '"'; - } - } - - if( $queryBuilder->empty ) { - if( strlen( $whereClause ) === 0 ) { - $whereClause = ' -where - 0'; - } - } - - $sql .= isset( $whereClause )?$whereClause:''; - - // orderby - $orderByClause = ''; - foreach( $queryBuilder->getOrderByClauses() as $orderby ) { - if( strlen( $orderByClause ) > 0 ) { - $orderByClause .= ' - , `' . $orderby['table'] . '`.`' . $orderby['column'] . '` ' . $orderby['direction']; - } - else { - $orderByClause = ' -order - by `' . $orderby['table'] . '`.`' . $orderby['column'] . '` ' . $orderby['direction']; - } - } - - $sql .= isset( $orderByClause )?$orderByClause:''; - - // groupby - $groupByClause = ''; - foreach( $queryBuilder->getGroupByClauses() as $groupby ) { - if( strlen( $groupByClause ) > 0 ) { - $groupByClause .= ' - , `' . $groupby['table'] . '`.`' . $groupby['column'] . '`'; - } - else { - $groupByClause = ' -group - by `' . $groupby['table'] . '`.`' . $groupby['column'] . '`'; - } - } - - $sql .= isset( $groupByClause )?$groupByClause:''; - - // having - $havingClause = ''; - foreach( $queryBuilder->getHavingClauses() as $having ) { - if( strlen( $havingClause ) > 0 ) { - $havingClause .= ' -and'; - } - else { - $havingClause = ' -having'; - } - $havingClause .= ' - `' . $having['column'] . '` ' . $having['operand'] . ' "' . $this->getEscapeString( $having['value'] ) . '"'; - } - - $sql .= isset( $havingClause )?$havingClause:''; - - return $sql; - } - - - - - private function getTableFromSQL($sql) - { - $posStart = stripos($sql,'from'); - while(!$this->removeWhitespace($sql,$posStart) && $posStart < strlen($sql)){ - $posStart++; - } - $posEnd = $posStart + 1; - while(!$this->removeWhitespace($sql,$posEnd) && $posEnd < strlen($sql)){ - $posEnd++; - } - - $table = substr($sql,$posStart,$posEnd - $posStart + 1); - - $table = rtrim(ltrim(str_replace('[','',str_replace(']','',$table)))); - - return $table; - } - - - public function getField($table, $fieldName) - { - $sql = "select c.status as status, case when pc.colid = c.colid then '1' else '' end as xtype, case when systypes.name = 'uniqueidentifier' then 1 else 0 end as guid - from sysobjects o - left join (sysindexes i - join sysobjects pk ON i.name = pk.name - and pk.parent_obj = i.id - and pk.xtype = 'PK' - join sysindexkeys ik on i.id = ik.id - and i.indid = ik.indid - join syscolumns pc ON ik.id = pc.id - AND ik.colid = pc.colid) ON i.id = o.id - join syscolumns c ON c.id = o.id - left join systypes on c.xusertype = systypes.xusertype - where o.name = '".$table."' - AND c.name = '".$fieldName."' - order by ik.keyno - "; - $link = $this->runQuery( $sql ); - //dmp($link); - $result = sqlsrv_fetch_array( $link ); - //dmp($result); - //dmp($fieldName); - $field = array(); - $field['name'] = $fieldName; - $field['table'] = $table; - $field['autoIncrement'] = ($result[0] & 128) == 128; - $field['primaryKey'] = ($result[1] == '1'); - $field['unique'] = ($result[2] == '1'); - return $field; - } - - - - private function removeWhitespace($string,$start) - { - if($start >= strlen($string)){ - return false; - } - return substr($string,$start,1)==' ' || - substr($string,$start,1)=="\t" || - substr($string,$start,1)=="\n" || - substr($string,$start,1)=="\r"; - } - } -?> \ No newline at end of file diff --git a/system/db/mssql/mssqlquerybuilder.class.php b/system/db/mssql/mssqlquerybuilder.class.php deleted file mode 100644 index c7de272..0000000 --- a/system/db/mssql/mssqlquerybuilder.class.php +++ /dev/null @@ -1,505 +0,0 @@ -columns[] = array( - 'table' => (string) $table - , 'column' => (string) $column - , 'alias' => $alias?(string)$alias:(string)$column ); - } - - - /** - * add value - * - * @return void - */ - protected function addValue( $value ) { - $this->values[] = $value; - - } - - - /** - * add table - * - * @return void - */ - protected function addTable( $table, $alias = '' ) { - $this->tables[] = array( - 'table' => (string) $table - , 'alias' => $alias?(string)$alias:(string)$table ); - } - - - /** - * add join - * - * @return void - */ - protected function addJoin( $type, $lefttable, $leftcolumn, $righttable, $rightcolumn, $alias = '' ) { - $this->joins[] = array( - 'type' => (string) $type - , 'lefttable' => (string) $lefttable - , 'leftcolumn' => (string) $leftcolumn - , 'righttable' => (string) $righttable - , 'rightcolumn' => (string) $rightcolumn - , 'alias' => $alias?(string)$alias:(string)$lefttable ); - } - - - /** - * add where clause - * - * @return void - */ - protected function addWhereClause( $table, $column, $operand, $value ) { - $this->whereClauses[] = array( - 'table' => (string) $table - , 'column' => (string) $column - , 'operand' => (string) $operand - , 'value' => $value ); - } - - - /** - * add order by clause - * - * @return void - */ - protected function addOrderByClause( $table, $column, $direction = 'asc' ) { - $this->orderByClauses[] = array( - 'table' => (string) $table - , 'column' => (string) $column - , 'direction' => (string) $direction=='desc'?'desc':'asc' ); - } - - - /** - * add having clause - * - * @return void - */ - protected function addHavingClause( $column, $operand, $value ) { - $this->havingClauses[] = array( - 'column' => (string) $column - , 'operand' => (string) $operand - , 'value' => $value ); - } - - - /** - * add group by clause - * - * @return void - */ - protected function addGroupByClause( $table, $column ) { - $this->groupByClauses[] = array( - 'table' => (string) $table - , 'column' => (string) $column ); - } - - - /** - * get SQL query - * - * @return string SQL query - */ - public function getQuery() { - // select - - if( $this->statement === 'select' ) { - $sql = 'select'; - - // columns - $columns = ''; - foreach( $this->columns as $column ) { - - if( strlen( $columns ) > 0 ) { - $columns .= ' - , '; - } - else { - $columns = ' '; - } - - if( $column['table'] === '*' ) { - $columns .= '*'; - } - else { - $columns .= '' . $column['table'] . ''; - - if( $column['column'] === '*' ) { - $columns .= '.*'; - } - else { - $columns .= '.' . $column['column'] . ''; - $columns .= ' as ' . $column['alias'] . ''; - } - } - } - - $sql .= isset( $columns )?$columns:''; - - // from - $tables = ''; - foreach( $this->tables as $table ) { - if( strlen( $tables ) > 0 ) { - $tables .= ' - , ' . $table['table'] . '' . ' as ' . $table['alias'] . ''; - } - else { - $tables = ' - from ' . $table['table'] . '' . ' as ' . $table['alias'] . ''; - } - } - - $sql .= isset( $tables )?$tables:''; - } - - // insert - elseif( $this->statement === 'insert' ) { - $sql = 'insert'; - - $tables = $this->tables; - - $sql .= ' - into ' . $tables[0]['table'] . ' ('; - - // columns - $columns = '';$i=0;$pKeyIndex=-1; - foreach( $this->columns as $column ) { - $metaColumn = $this->dataAdapter->getField($column['table'], $column['column']); - if((bool)$metaColumn['primaryKey']) - { - $columns .=""; - $pKeyIndex=$i; - } - else if( strlen( $columns ) > 0 ) { - $columns .= ',' . $column['column'] . ''; - } - else { - $columns = '' . $column['column'] . ''; - } - $i++; - } - $sql .= isset( $columns )?$columns:''; - $sql .= ')'; - - $sql .= ' - values('; - - // values - $values = '';$i=0; - foreach( $this->values as $value ) { - if($pKeyIndex!= -1 && $i==$pKeyIndex) $values .=""; - else { - if( strlen( $values ) > 0 ) { - $values .= ','; - } - else { - $values = ''; - } - if( is_null( $value )) { - $values .= 'null'; - } - elseif( is_bool( $value )) { - $values .= $value?'true':'false'; - } - elseif( is_int( $value )) { - $values .= (int)$value; - } - elseif( is_float( $value )) { - $values .= (real)$value; - } - elseif( is_string( $value )) { - $values .= "'".(string)$value."'"; - } - else { - - $values .= '"' . $this->dataAdapter->escapeString( $value ) . '"'; - } - } - - $i++; - } - $sql .= $values . ')'; - - } - // update - elseif( $this->statement === 'update' ) { - $sql = 'update'; - $tables = $this->tables; - $sql .= ' ' . $tables[0]['table'] . ''; - // set - $columns = $this->columns; - $values = $this->values; - $setClause = ''; - $fieldsAdded=0; - for( $i = 0; $i < count( $columns ); $i++ ) { - - if( $fieldsAdded == 0 ) { - $setClause = ' - set '; - } - $metaColumn = $this->dataAdapter->getField($columns[$i]['table'], $columns[$i]['column']); - - if((bool)$metaColumn['primaryKey'] || is_null( $values[$i])) $setClause .=""; - else { - if( $fieldsAdded > 0) $setClause .= " - ,"; - if( is_bool( $values[$i] )) { - $setClause .= '' . $columns[$i]['table'] . '.' . $columns[$i]['column'] . ' = ' . ($values[$i]?'true':'false'); - } - elseif( is_int( $values[$i] )) { - $setClause .= '' . $columns[$i]['table'] . '.' . $columns[$i]['column'] . ' = ' . (int)$values[$i]; - } - elseif( is_float( $values[$i] )) { - $setClause .= '' . $columns[$i]['table'] . '.' . $columns[$i]['column'] . ' = ' . (real)$values[$i]; - } - elseif( is_string( $values[$i])) { - $setClause .= '' . $columns[$i]['table'] . '.' . $columns[$i]['column'] . " = '" . $values[$i]."'"; - } - else { - $setClause .= '' . $columns[$i]['table'] . '.' . $columns[$i]['column'] . ' = "' . $this->dataAdapter->escapeString( $values[$i] ) . '"'; - } - $fieldsAdded++; - } - - } - $sql .= isset( $setClause )?$setClause:''; - - } - - // delete - elseif( $this->statement === 'delete' ) { - $sql = 'delete'; - - // from - $tables = ''; - foreach( $this->tables as $table ) { - if( strlen( $tables ) > 0 ) { - $tables .= ' - , ' . $table['table'] . ''; - } - else { - $tables = ' - from ' . $table['table'] . ''; - } - } - - $sql .= isset( $tables )?$tables:''; - - } - - // delete - elseif( $this->statement === 'truncate' ) { - $sql = 'truncate'; - - // from - $tables = ''; - foreach( $this->tables as $table ) { - if( strlen( $tables ) > 0 ) { - $tables .= ', ' . $table['table'] . ''; - } - else { - $tables = ' ' . $table['table'] . ''; - } - } - - $sql .= isset( $tables )?$tables:''; - } - - // joins - foreach( $this->joins as $join ) { - $sql .= ' -' . $join['type'] . ' - join ' . $join['lefttable'] . ' as ' . $join['alias'] . ' - on ' . $join['alias'] . '.' . $join['leftcolumn'] . ' = ' . $join['righttable'] . '.' . $join['rightcolumn'] . ''; - - - } - - // where - $whereClause = ''; - foreach( $this->whereClauses as $where ) { - if( strlen( $whereClause ) > 0 ) { - $whereClause .= ' -and'; - } - else { - $whereClause = ' -where'; - } - - if( is_null( $where['value'] )) { - $whereClause .= ' - ' . $where['table'] . '.' . $where['column'] . ' is null'; - } - elseif( is_int( $where['value'] )) { - $whereClause .= ' - ' . $where['table'] . '.' . $where['column'] . ' ' . $where['operand'] . ' ' . (int)$where['value'] . ''; - } - elseif( is_float( $where['value'] )) { - $whereClause .= ' - ' . $where['table'] . '.' . $where['column'] . ' ' . $where['operand'] . ' ' . (real)$where['value'] . ''; - } - elseif( is_bool( $where['value'] )) { - $whereClause .= ' - ' . $where['table'] . '.' . $where['column'] . ' = ' . ($where['value']?'true':'false'); - } - else { - $whereClause .= ' - ' . $where['table'] . '.' . $where['column'] . ' ' . $where['operand'] . ' "' . $this->dataAdapter->escapeString( $where['value'] ) . '"'; - } - } - - if( $this->empty ) { - if( strlen( $whereClause ) === 0 ) { - $whereClause = ' -where - 0'; - } - } - - $sql .= isset( $whereClause )?$whereClause:''; - - // orderby - $orderByClause = ''; - foreach( $this->orderByClauses as $orderby ) { - if( strlen( $orderByClause ) > 0 ) { - $orderByClause .= ' - , ' . $orderby['table'] . '.' . $orderby['column'] . ' ' . $orderby['direction']; - } - else { - $orderByClause = ' -order - by ' . $orderby['table'] . '.' . $orderby['column'] . ' ' . $orderby['direction']; - } - } - - $sql .= isset( $orderByClause )?$orderByClause:''; - - // groupby - $groupByClause = ''; - foreach( $this->groupByClauses as $groupby ) { - if( strlen( $groupByClause ) > 0 ) { - $groupByClause .= ' - , ' . $groupby['table'] . '.' . $groupby['column'] . ''; - } - else { - $groupByClause = ' -group - by ' . $groupby['table'] . '.' . $groupby['column'] . ''; - } - } - - $sql .= isset( $groupByClause )?$groupByClause:''; - - // having - $havingClause = ''; - foreach( $this->havingClauses as $having ) { - if( strlen( $havingClause ) > 0 ) { - $havingClause .= ' -and'; - } - else { - $havingClause = ' -having'; - } - $havingClause .= ' - ' . $having['column'] . ' ' . $having['operand'] . ' "' . $this->dataAdapter->escapeString( $having['value'] ) . '"'; - } - - $sql .= isset( $havingClause )?$havingClause:''; - - - return $sql; - } - - function is_date( $str ) - { - $stamp = strtotime( $str ); - if (!is_numeric($stamp)) - return FALSE; - $month = date( 'm', $stamp ); - $day = date( 'd', $stamp ); - $year = date( 'Y', $stamp ); - if (checkdate($month, $day, $year)) return TRUE; - return FALSE; - } - } -?> \ No newline at end of file diff --git a/system/db/mssql/mssqltransaction.class.php b/system/db/mssql/mssqltransaction.class.php deleted file mode 100644 index 0f1c122..0000000 --- a/system/db/mssql/mssqltransaction.class.php +++ /dev/null @@ -1,49 +0,0 @@ -dataAdapter->execute( 'SET autocommit=0' ); - $this->dataAdapter->execute( 'START TRANSACTION' ); - } - - - /** - * Implements a rollback - */ - protected function rollbackTransaction() - { - $this->dataAdapter->execute( 'ROLLBACK' ); - } - - - /** - * Implements a commit - */ - protected function commitTransaction() - { - $this->dataAdapter->execute( 'COMMIT' ); - } - } -?> \ No newline at end of file diff --git a/system/db/mysql/mysqldataadapter.class.php b/system/db/mysql/mysqldataadapter.class.php index d9de41a..187ad40 100644 --- a/system/db/mysql/mysqldataadapter.class.php +++ b/system/db/mysql/mysqldataadapter.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\DB\MySQL; use \System\DB\DataAdapter; @@ -296,11 +296,12 @@ public function buildSchema() public function addTableSchema( \System\DB\TableSchema &$tableSchema ) { $columns = ""; + $primaryKeys = array(); + $indexKeys = array(); + $uniqueKeys = array(); + foreach($tableSchema->columnSchemas as $columnSchema) { - $primaryKeys = array(); - $indexKeys = array(); - $uniqueKeys = array(); $type = ""; if($columnSchema->integer) diff --git a/system/db/mysql/mysqlquerybuilder.class.php b/system/db/mysql/mysqlquerybuilder.class.php index e772328..4757ab0 100644 --- a/system/db/mysql/mysqlquerybuilder.class.php +++ b/system/db/mysql/mysqlquerybuilder.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\DB\MySQL; use System\DB\QueryBuilderBase; diff --git a/system/db/mysql/mysqltransaction.class.php b/system/db/mysql/mysqltransaction.class.php index 290d4b6..a078d46 100644 --- a/system/db/mysql/mysqltransaction.class.php +++ b/system/db/mysql/mysqltransaction.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\DB\MySQL; use \System\DB\TransactionBase; diff --git a/system/db/mysqli/mysqlidataadapter.class.php b/system/db/mysqli/mysqlidataadapter.class.php index 978bb26..ae46972 100644 --- a/system/db/mysqli/mysqlidataadapter.class.php +++ b/system/db/mysqli/mysqlidataadapter.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\DB\MySQLi; use \System\DB\DataAdapter; @@ -243,11 +243,12 @@ public function buildSchema() public function addTableSchema( \System\DB\TableSchema &$tableSchema ) { $columns = ""; + $primaryKeys = array(); + $indexKeys = array(); + $uniqueKeys = array(); + foreach($tableSchema->columnSchemas as $columnSchema) { - $primaryKeys = array(); - $indexKeys = array(); - $uniqueKeys = array(); $type = ""; if($columnSchema->integer) diff --git a/system/db/mysqli/mysqliquerybuilder.class.php b/system/db/mysqli/mysqliquerybuilder.class.php index 38d168a..21f924d 100644 --- a/system/db/mysqli/mysqliquerybuilder.class.php +++ b/system/db/mysqli/mysqliquerybuilder.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\DB\MySQLi; use System\DB\QueryBuilderBase; diff --git a/system/db/mysqli/mysqlitransaction.class.php b/system/db/mysqli/mysqlitransaction.class.php index 938a4cc..b4a64c2 100644 --- a/system/db/mysqli/mysqlitransaction.class.php +++ b/system/db/mysqli/mysqlitransaction.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\DB\MySQLi; use \System\DB\TransactionBase; @@ -23,7 +23,6 @@ final class MySQLiTransaction extends TransactionBase */ protected function beginTransaction() { - $this->dataAdapter->execute( 'SET autocommit=0' ); $this->dataAdapter->execute( 'START TRANSACTION' ); } diff --git a/system/db/pdo/pdodataadapter.class.php b/system/db/pdo/pdodataadapter.class.php deleted file mode 100644 index 611327d..0000000 --- a/system/db/pdo/pdodataadapter.class.php +++ /dev/null @@ -1,706 +0,0 @@ -pdo ) - { - try - { - $this->db=$this->args['databasetype']; - if($this->db == "mysql" || $this->db == "mysqli") - { - $dsn= "mysql:dbname=".$this->args['database'].";host=".$this->args['server']; - $this->pdo = new \PDO($dsn,$this->args['uid'],$this->args['pwd']); - } - else if($this->db == "mssql") - { - $dsn= "sqlsrv:Server=".$this->args['server'].";Database=".$this->args['database']; - $this->pdo = new \PDO($dsn,$this->args['uid'],$this->args['pwd']); - } - } - catch(\PDOException $e) - { - throw new \System\DB\DataAdapterException("Could not connect to database " . $e->getMessage()); - } - } - else - { - throw new \System\DB\DataAdapterException("Connection already open"); - } - } - - - /** - * closes an open connection - * - * @return bool true if successfull - */ - public function close() - { - if( $this->pdo ) - { - $this->pdo = null; - return true; - } - else - { - throw new \System\DB\DataAdapterException("Connection already closed"); - } - } - - - /** - * returns true if a connection to a datasource is currently open - * - * @return bool true if connection open - */ - public function opened() - { - return (bool)$this->pdo; - } - - - /** - * Executes a query procedure on the current connection and return the result - * - * @param string $query sql query - * @return resource - */ - protected function query( $query,$buffer ) - { - if( $this->pdo ) - { - $result = $this->pdo->query( $query ); - - if( !$result ) - { - $pdo_error = $this->pdo->errorInfo()[2]; - throw new \System\DB\DatabaseException($pdo_error); - } - - return $result; - } - else - { - throw new \System\DB\DataAdapterException("PDO resource in not a valid PDO object"); - } - } - - - /** - * fills a DataSet object with the current DataAdapter - * - * @param DataSet &$ds empty DataSet object - * @return void - */ - public function fill( \System\DB\DataSet &$ds ) - { - if( $this->pdo ) - { - $result = $this->runQuery( $ds->source ); - - if( $result ) - { - $fields = array(); - $fieldMeta = array(); - $fieldCount = $result->columnCount(); - $table=""; - for($i=0; $i < $fieldCount; $i++) - { - $meta = $result->getColumnMeta($i); - $fields[] = $meta['name']; - if($this->db == "mssql") $meta['table']=$this->getTableFromSQL( $ds->source ); - $fieldMeta[] = $this->getColumnSchema($meta); - $table=$meta['table']; - } - - $rows = array(); - $rowCount = $result->rowCount(); - for( $row=0; $row < $rowCount; $row++ ) - { - $rows[] = $result->fetch( \PDO::FETCH_ASSOC); - } - $ds->setTable($table); - $ds->setFieldMeta( $fieldMeta ); - $ds->setFields( $fields ); - $ds->setRows( $rows ); - $result->closeCursor();; - } - else - { - $pdo_error = $this->pdo->errorInfo()[2]; - throw new \System\DB\DatabaseException($pdo_error); - } - } - else - { - throw new \System\DB\DataAdapterException("Connection is closed"); - } - } -/** - * builds a MSSQL DataBaseSchema object - * - * @return DatabaseSchema - */ - - - public function buildSchema() - { - - $databaseProperties = array(); - $tableSchemas = array(); - - if($this->db == "mysql" || $this->db == "mysqli") $tables = $this->runQuery( "SHOW TABLES" ); - else if($this->db == "mssql") $tables = $this->runQuery( "SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE';" ); - - while($table = $tables->fetch( \PDO::FETCH_NUM)) - { - $i=0; - $tableProperties = array('name'=>$table[0]); - $foreignKeys = array(); - $columnSchemas = array(); - - if($this->db == "mysql" || $this->db == "mysqli") $columns = $this->runQuery( "SELECT * FROM `{$table[0]}` WHERE 0" ); - else if($this->db == "mssql") $columns = $this->runQuery( "SELECT * FROM {$table[0]} " ); - - - $fieldCount = $columns->columnCount(); - for($i=0; $i < $fieldCount; $i++) - { - $meta = $columns->getColumnMeta($i); - $meta['table']=$table[0]; - $columnSchemas[] = $this->getColumnSchema($meta); - if(is_array($meta['flags']) && in_array("primary_key", $meta['flags'])) - { - $tableProperties['primaryKey'] = $meta['name']; - } - } - - - $tableSchemas[] = new \System\DB\TableSchema($tableProperties, $foreignKeys, $columnSchemas); - } - - return new \System\DB\DatabaseSchema($databaseProperties, $tableSchemas); - - } - - - - /** - * creats a TableSchema object - * - * @return DatabaseSchema - */ - public function addTableSchema( \System\DB\TableSchema &$tableSchema ) - { - $columns = ""; - foreach($tableSchema->columnSchemas as $columnSchema) - { - $primaryKeys = array(); - $indexKeys = array(); - $uniqueKeys = array(); - $type = ""; - - if($columnSchema->integer) - { - $type = "INT({$columnSchema->length})"; - } - elseif($columnSchema->real) - { - $type = "DOUBLE({$columnSchema->length})"; - } - elseif($columnSchema->boolean) - { - $type = "TINYINT(1)"; - } - elseif($columnSchema->year) - { - $type = "YEAR"; - } - elseif($columnSchema->date) - { - $type = "DATE"; - } - elseif($columnSchema->time) - { - $type = "TIME"; - } - elseif($columnSchema->datetime) - { - $type = "DATETIME"; - } - elseif($columnSchema->blob) - { - $type = "MEDIUMBLOB"; - } - else - { - $type = "VARCHAR({$columnSchema->length}) CHARACTER SET {$this->charset} COLLATE {$this->collation}"; - } - - if($columns) $columns .= ",\n "; - $columns .= "`{$columnSchema->name}` {$type}".($columnSchema->notNull?' NOT NULL':'').($columnSchema->autoIncrement?' AUTO_INCREMENT':''); - - if($columnSchema->primaryKey) - { - $primaryKeys[] = $columnSchema->name; - } - - if($columnSchema->foreignKey) - { - $indexKeys[] = $columnSchema->name; - } - - if($columnSchema->unique) - { - $uniqueKeys[] = $columnSchema->name; - } - } - - if($primaryKeys) - { - $column = ""; - foreach($primaryKeys as $primaryKey) - { - if($column) $column .= ", "; - $column .= "`{$primaryKey}`"; - } - - $columns .= ",\n PRIMARY KEY ({$column})"; - } - - if($indexKeys) - { - $column = ""; - foreach($indexKeys as $indexKey) - { - if($column) $column .= ", "; - $column .= "`{$indexKey}`"; - } - - $columns .= ",\n INDEX ({$column})"; - } - - if($uniqueKeys) - { - $column = ""; - foreach($uniqueKeys as $uniqueKey) - { - if($column) $column .= ", "; - $column .= "`{$uniqueKey}`"; - } - - $columns .= ",\n UNIQUE ({$column})"; - } - - $this->execute("CREATE TABLE `{$tableSchema->name}` (\n {$columns}\n);"); - } - - - /** - * alters a TableSchema object - * - * @return DatabaseSchema - */ - public function alterTableSchema( \System\DB\TableSchema &$tableSchema ) - { - throw new \System\Base\MethodNotImplementedException(); - } - - - /** - * drops a TableSchema object - * - * @return DatabaseSchema - */ - public function dropTableSchema( \System\DB\TableSchema &$tableSchema ) - { - throw new \System\Base\MethodNotImplementedException(); - } - - - /** - * attempt to insert a record into the datasource - * - * @param DataSet &$ds empty DataSet object - * @return void - */ - public function insert( \System\DB\DataSet &$ds ) - { - if( $this->pdo ) - { - $tableSchema = $ds->dataAdapter->getSchema()->seek($ds->table); - - $this->queryBuilder() - ->insertInto($ds->table, $ds->fields) - ->values($ds->row) - ->runQuery(); - - $ds[$tableSchema->primaryKey] = $this->getLastInsertId(); - - } - else - { - throw new \System\DB\DataAdapterException("Connection is closed"); - } - } - - - /** - * attempt to update a record in the datasource - * - * @param DataSet &$ds empty DataSet object - * @return void - */ - public function update( \System\DB\DataSet &$ds ) - { - if( $this->pdo ) - { - $tableSchema = $ds->dataAdapter->getSchema()->seek($ds->table); - - $this->queryBuilder() - ->update($ds->table) - ->setColumns($ds->table, $ds->fields, $ds->row) - ->where($ds->table, $tableSchema->primaryKey, '=', $ds[$tableSchema->primaryKey]) - ->runQuery(); - } - else - { - throw new \System\DB\DataAdapterException("Connection is closed"); - } - } - - - /** - * attempt to delete a record in the datasource - * - * @param DataSet &$ds empty DataSet object - * @return void - */ - public function delete( \System\DB\DataSet &$ds ) - { - if( $this->pdo ) - { - $tableSchema = $ds->dataAdapter->getSchema()->seek($ds->table); - $this->queryBuilder() - ->delete() - ->from($ds->table) - ->where($ds->table, $tableSchema->primaryKey, '=', $ds[$tableSchema->primaryKey]) - ->runQuery(); - } - else - { - throw new \System\DB\DataAdapterException("Connection is closed"); - } - } - - - /** - * creats a QueryBuilder object - * - * @return MySQLQueryBuilder - */ - public function queryBuilder() - { - return new PDOQueryBuilder($this); - //else if($this->db == "mysqli") return new \System\DB\MySQLi\MySQLiQueryBuilder($this); - } - - - /** - * creats a Transaction object - * - * @return MySQLTransaction - */ - public function beginTransaction() - { - if( $this->pdo) - { - return $this->pdo->beginTransaction(); - } - else - { - throw new \System\DB\DataAdapterException("PDO resource is not a valid link identifier"); - } - } - - - /** - * return id of last record inserted - * - * @return int - */ - public function getLastInsertId() - { - if( $this->pdo ) - { - return (int)$this->pdo->lastInsertId(); - } - else - { - throw new \System\DB\DataAdapterException("MySQLi resource is not a valid link identifier"); - } - } - - - /** - * return affected rows - * - * @return int - */ - public function getAffectedRows() - { - if( $this->pdo ) - { - return $this->pdo->rowCount(); - } - else - { - throw new \System\DB\DataAdapterException("MySQLi resource is not a valid link identifier"); - } - } - - - /** - * Returns escaped string - * - * @param string $unescaped_string String to escape - * @return string Escaped string - */ - public function escapeString( $unescaped_string ) - { - return $this->pdo->quote($unescaped_string); - } - - - /** - * returns a populated ColumnSchema object - * @param object $meta - * @return \System\DB\ColumnSchema - */ - private function getColumnSchema($meta) - { - - - /* - * MySQL Problems with PDO: - * YEAR, BINARY, VAR_BINARY, TINY_INT AND BIT FIELDS NOT SUPPORTED YET BY PDO - * Auto_increment is also not supported - * - * MSSQL Problems with PDO: - * Null, autoincrement not supported - * - */ - if(!isset($meta['native_type'])) $meta['native_type']=null; - /* - if($meta['name'] == "test_date") - { - var_dump($meta); - dmp($meta); - - } - * - */ - - if($this->db == "mssql") - { - $flags = explode(" ", $meta['sqlsrv:decl_type']); - $type=$flags[0]; - $field= $this->getField($meta['table'], $meta['name']); - - return new \System\DB\ColumnSchema(array( - 'name' => $meta['name'], - 'table' => $meta['table'], - 'type' => $type==null?"":$type, - 'length' => $meta['len'], - 'notNull' => is_array($meta['flags'])==true?in_array("not_null", $meta['flags']):false , - 'primaryKey' => is_array($flags)==true?in_array("identity", $flags):false , - 'multipleKey' => is_array($meta['flags'])==true?in_array("multiple_key", $meta['flags']):false, - 'foreignKey' => FALSE, - 'unique' => (bool) ($field['autoIncrement']), - 'numeric' => (bool) ( $type == "int" || - $type == "smallint" || - $type == "tinyint" || - $type == "numeric" || - $type == "bit"|| - $type == "money" || - $type == "timestamp"|| - $type == "decimal" || - $type == "double" || - $type == "float"|| - $type == "real" - ), - 'blob' => (bool) ($type == "varbinary" && $meta['len'] == 0), - 'string' => (bool) ( $type == "varchar" || - $type == "nvarchar" || - ($type == "varbinary" && $meta['len'] >0) || - $type == "char" || - $type == "nchar" || - $type == "text" || - $type == "ntext" - ), - 'integer' => (bool) ( $type == "int" || - $type == "smallint" || - $type == "tinyint" || - $type == "numeric" || - $type == "bit" - ), - 'real' => (bool) ( $type == "decimal" || - $type == "double" || - $type == "float"|| - $type == "real" - ), - 'year' => FALSE, - 'date' => (bool) ( $type == "date" ), - 'time' => (bool) ( $type == "time" ), - 'datetime' => (bool) ( $type == "datetime" || - $type == "datetime2" || - $type == "smalldatetime" || - $type == "datetimeoffset" - ), - 'boolean' => (bool) ($type == "bit"), - 'autoIncrement' => (bool) ($field['autoIncrement']), - 'binary' => (bool) ( ($type == "varbinary" && $meta['len'] >0) || - $type == "binary" - ) - )); - - } - else if($this->db == "mysql" || $this->db == "mysqli") - { - return new \System\DB\ColumnSchema(array( - 'name' => $meta['name'], - 'table' => $meta['table'], - 'type' => $meta['native_type']==null?"":$meta['native_type'], - 'length' => $meta['len'], - 'notNull' => is_array($meta['flags'])==true?in_array("not_null", $meta['flags']):"" , - 'primaryKey' => is_array($meta['flags'])==true?in_array("primary_key", $meta['flags']):"" , - 'multipleKey' => is_array($meta['flags'])==true?in_array("multiple_key", $meta['flags']):"", - 'foreignKey' => FALSE, - 'unique' => is_array($meta['flags'])==true?in_array("unique_key", $meta['flags']):"", - 'numeric' => (bool) ( $meta['native_type'] == "LONG" || - $meta['native_type'] == "SHORT"|| - $meta['native_type'] == "LONGLONG" || - $meta['native_type'] == "TIMESTAMP" || - $meta['native_type'] == "NEWDECIMAL" || - $meta['native_type'] == "FLOAT"|| - $meta['native_type'] == "DOUBLE" || - (!$meta['native_type'] && $meta['len']===1) - ), - 'blob' => is_array($meta['flags'])==true?in_array("blob", $meta['flags']):"", - 'string' => (bool) ( $meta['native_type'] == "STRING" || - $meta['native_type'] == "VAR_STRING"|| - $meta['native_type'] == "VAR_STRING" - ), - 'integer' => (bool) ( $meta['native_type'] == "LONG" || - $meta['native_type'] == "SHORT"|| - $meta['native_type'] == "LONGLONG" || - (!$meta['native_type'] && $meta['len']===1) - ), - 'real' => (bool) ( $meta['native_type'] == "NEWDECIMAL" || - $meta['native_type'] == "FLOAT"|| - $meta['native_type'] == "DOUBLE" - ), - 'year' => FALSE, - 'date' => (bool) ( $meta['native_type'] == "DATE" ), - 'time' => (bool) ( $meta['native_type'] == "TIME" ), - 'datetime' => (bool) ( $meta['native_type'] == "DATETIME" ), - 'boolean' => (bool) ($meta['len']===1 && !$meta['native_type']), - 'autoIncrement' => FALSE, - 'binary' => false)); - - } - } - private function getTableFromSQL($sql) - { - $posStart = stripos($sql,'from'); - while(!$this->removeWhitespace($sql,$posStart) && $posStart < strlen($sql)){ - $posStart++; - } - $posEnd = $posStart + 1; - while(!$this->removeWhitespace($sql,$posEnd) && $posEnd < strlen($sql)){ - $posEnd++; - } - - $table = substr($sql,$posStart,$posEnd - $posStart + 1); - - $table = rtrim(ltrim(str_replace('[','',str_replace(']','',$table)))); - - return $table; - } - - private function removeWhitespace($string,$start) - { - if($start >= strlen($string)){ - return false; - } - return substr($string,$start,1)==' ' || - substr($string,$start,1)=="\t" || - substr($string,$start,1)=="\n" || - substr($string,$start,1)=="\r"; - } - - public function getField($table, $fieldName) - { - $sql = "select c.status as status, case when pc.colid = c.colid then '1' else '' end as xtype, case when systypes.name = 'uniqueidentifier' then 1 else 0 end as guid - from sysobjects o - left join (sysindexes i - join sysobjects pk ON i.name = pk.name - and pk.parent_obj = i.id - and pk.xtype = 'PK' - join sysindexkeys ik on i.id = ik.id - and i.indid = ik.indid - join syscolumns pc ON ik.id = pc.id - AND ik.colid = pc.colid) ON i.id = o.id - join syscolumns c ON c.id = o.id - left join systypes on c.xusertype = systypes.xusertype - where o.name = '".$table."' - AND c.name = '".$fieldName."' - order by ik.keyno - "; - $result = $this->runQuery( $sql ); - $attributes = $result->Fetch(\PDO::FETCH_BOTH); - //dmp($result); - //dmp($fieldName); - $field = array(); - $field['name'] = $fieldName; - $field['table'] = $table; - $field['autoIncrement'] = ($attributes[0] & 128) == 128; - $field['primaryKey'] = ($attributes[1] == '1'); - $field['unique'] = ($attributes[2] == '1'); - return $field; - } - - } -?> \ No newline at end of file diff --git a/system/db/pdo/pdoquerybuilder.class.php b/system/db/pdo/pdoquerybuilder.class.php deleted file mode 100644 index 5c70b49..0000000 --- a/system/db/pdo/pdoquerybuilder.class.php +++ /dev/null @@ -1,814 +0,0 @@ -columns[] = array( - 'table' => (string) $table - , 'column' => (string) $column - , 'alias' => $alias?(string)$alias:(string)$column ); - } - - - /** - * add value - * - * @return void - */ - protected function addValue( $value ) { - $this->values[] = $value; - } - - - /** - * add table - * - * @return void - */ - protected function addTable( $table, $alias = '' ) { - $this->tables[] = array( - 'table' => (string) $table - , 'alias' => $alias?(string)$alias:(string)$table ); - } - - - /** - * add join - * - * @return void - */ - protected function addJoin( $type, $lefttable, $leftcolumn, $righttable, $rightcolumn, $alias = '' ) { - $this->joins[] = array( - 'type' => (string) $type - , 'lefttable' => (string) $lefttable - , 'leftcolumn' => (string) $leftcolumn - , 'righttable' => (string) $righttable - , 'rightcolumn' => (string) $rightcolumn - , 'alias' => $alias?(string)$alias:(string)$lefttable ); - } - - - /** - * add where clause - * - * @return void - */ - protected function addWhereClause( $table, $column, $operand, $value ) { - $this->whereClauses[] = array( - 'table' => (string) $table - , 'column' => (string) $column - , 'operand' => (string) $operand - , 'value' => $value ); - } - - - /** - * add order by clause - * - * @return void - */ - protected function addOrderByClause( $table, $column, $direction = 'asc' ) { - $this->orderByClauses[] = array( - 'table' => (string) $table - , 'column' => (string) $column - , 'direction' => (string) $direction=='desc'?'desc':'asc' ); - } - - - /** - * add having clause - * - * @return void - */ - protected function addHavingClause( $column, $operand, $value ) { - $this->havingClauses[] = array( - 'column' => (string) $column - , 'operand' => (string) $operand - , 'value' => $value ); - } - - - /** - * add group by clause - * - * @return void - */ - protected function addGroupByClause( $table, $column ) { - $this->groupByClauses[] = array( - 'table' => (string) $table - , 'column' => (string) $column ); - } - - - /** - * get SQL query - * - * @return string SQL query - */ - public function getQuery() { - - return $this->getMSSQLQuery(); - - } - - /** - * get MySQL SQL query - * - * @return string SQL query - */ - public function getMySQLQuery() { - - // select - if( $this->statement === 'select' ) { - $sql = 'select'; - - // columns - $columns = ''; - foreach( $this->columns as $column ) { - - if( strlen( $columns ) > 0 ) { - $columns .= ' - , '; - } - else { - $columns = ' '; - } - - if( $column['table'] === '*' ) { - $columns .= '*'; - } - else { - $columns .= '`' . $column['table'] . '`'; - - if( $column['column'] === '*' ) { - $columns .= '.*'; - } - else { - $columns .= '.`' . $column['column'] . '`'; - $columns .= ' as `' . $column['alias'] . '`'; - } - } - } - - $sql .= isset( $columns )?$columns:''; - - // from - $tables = ''; - foreach( $this->tables as $table ) { - if( strlen( $tables ) > 0 ) { - $tables .= ' - , `' . $table['table'] . '`' . ' as `' . $table['alias'] . '`'; - } - else { - $tables = ' - from `' . $table['table'] . '`' . ' as `' . $table['alias'] . '`'; - } - } - - $sql .= isset( $tables )?$tables:''; - } - - // insert - elseif( $this->statement === 'insert' ) { - $sql = 'insert'; - - $tables = $this->tables; - - $sql .= ' - into `' . $tables[0]['table'] . '` ('; - - // columns - $columns = ''; - foreach( $this->columns as $column ) { - if( strlen( $columns ) > 0 ) { - $columns .= ',`' . $column['column'] . '`'; - } - else { - $columns = '`' . $column['column'] . '`'; - } - } - - $sql .= isset( $columns )?$columns:''; - $sql .= ')'; - - $sql .= ' - values('; - - // values - $values = ''; - foreach( $this->values as $value ) { - if( strlen( $values ) > 0 ) { - $values .= ','; - } - else { - $values = ''; - } - if( is_null( $value )) { - $values .= 'null'; - } - elseif( is_bool( $value )) { - $values .= $value?'true':'false'; - } - elseif( is_int( $value )) { - $values .= (int)$value; - } - elseif( is_float( $value )) { - $values .= (real)$value; - } - else { - $values .= '"' . $this->dataAdapter->escapeString( $value ) . '"'; - } - } - - $sql .= $values . ')'; - } - - // update - elseif( $this->statement === 'update' ) { - $sql = 'update'; - - $tables = $this->tables; - $sql .= ' `' . $tables[0]['table'] . '`'; - - // set - $columns = $this->columns; - $values = $this->values; - $setClause = ''; - for( $i = 0; $i < count( $columns ); $i++ ) { - if( strlen( $setClause ) > 0 ) { - $setClause .= ' - , '; - } - else { - $setClause = ' -set '; - } - - if( is_null( $values[$i] )) { - $setClause .= '`' . $columns[$i]['table'] . '`.`' . $columns[$i]['column'] . '` = null'; - } - elseif( is_bool( $values[$i] )) { - $setClause .= '`' . $columns[$i]['table'] . '`.`' . $columns[$i]['column'] . '` = ' . ($values[$i]?'true':'false'); - } - elseif( is_int( $values[$i] )) { - $setClause .= '`' . $columns[$i]['table'] . '`.`' . $columns[$i]['column'] . '` = ' . (int)$values[$i]; - } - elseif( is_float( $values[$i] )) { - $setClause .= '`' . $columns[$i]['table'] . '`.`' . $columns[$i]['column'] . '` = ' . (real)$values[$i]; - } - else { - $setClause .= '`' . $columns[$i]['table'] . '`.`' . $columns[$i]['column'] . '` = "' . $this->dataAdapter->escapeString( $values[$i] ) . '"'; - } - } - - $sql .= isset( $setClause )?$setClause:''; - } - - // delete - elseif( $this->statement === 'delete' ) { - $sql = 'delete'; - - // from - $tables = ''; - foreach( $this->tables as $table ) { - if( strlen( $tables ) > 0 ) { - $tables .= ' - , `' . $table['table'] . '`'; - } - else { - $tables = ' - from `' . $table['table'] . '`'; - } - } - - $sql .= isset( $tables )?$tables:''; - } - - // delete - elseif( $this->statement === 'truncate' ) { - $sql = 'truncate'; - - // from - $tables = ''; - foreach( $this->tables as $table ) { - if( strlen( $tables ) > 0 ) { - $tables .= ', `' . $table['table'] . '`'; - } - else { - $tables = ' `' . $table['table'] . '`'; - } - } - - $sql .= isset( $tables )?$tables:''; - } - - // joins - foreach( $this->joins as $join ) { - $sql .= ' -' . $join['type'] . ' - join `' . $join['lefttable'] . '` as `' . $join['alias'] . '` - on `' . $join['alias'] . '`.`' . $join['leftcolumn'] . '` = `' . $join['righttable'] . '`.`' . $join['rightcolumn'] . '`'; - - - } - - // where - $whereClause = ''; - foreach( $this->whereClauses as $where ) { - if( strlen( $whereClause ) > 0 ) { - $whereClause .= ' -and'; - } - else { - $whereClause = ' -where'; - } - - if( is_null( $where['value'] )) { - $whereClause .= ' - `' . $where['table'] . '`.`' . $where['column'] . '` is null'; - } - elseif( is_bool( $where['value'] )) { - $whereClause .= ' - `' . $where['table'] . '`.`' . $where['column'] . '` = ' . ($where['value']?'true':'false'); - } - elseif( is_int( $where['value'] )) { - $whereClause .= ' - `' . $where['table'] . '`.`' . $where['column'] . '` ' . $where['operand'] . ' ' . (int)$where['value'] . ''; - } - elseif( is_float( $where['value'] )) { - $whereClause .= ' - `' . $where['table'] . '`.`' . $where['column'] . '` ' . $where['operand'] . ' ' . (real)$where['value'] . ''; - } - else { - $whereClause .= ' - `' . $where['table'] . '`.`' . $where['column'] . '` ' . $where['operand'] . ' "' . $this->dataAdapter->escapeString( $where['value'] ) . '"'; - } - } - - if( $this->empty ) { - if( strlen( $whereClause ) === 0 ) { - $whereClause = ' -where - 0'; - } - } - - $sql .= isset( $whereClause )?$whereClause:''; - - // orderby - $orderByClause = ''; - foreach( $this->orderByClauses as $orderby ) { - if( strlen( $orderByClause ) > 0 ) { - $orderByClause .= ' - , `' . $orderby['table'] . '`.`' . $orderby['column'] . '` ' . $orderby['direction']; - } - else { - $orderByClause = ' -order - by `' . $orderby['table'] . '`.`' . $orderby['column'] . '` ' . $orderby['direction']; - } - } - - $sql .= isset( $orderByClause )?$orderByClause:''; - - // groupby - $groupByClause = ''; - foreach( $this->groupByClauses as $groupby ) { - if( strlen( $groupByClause ) > 0 ) { - $groupByClause .= ' - , `' . $groupby['table'] . '`.`' . $groupby['column'] . '`'; - } - else { - $groupByClause = ' -group - by `' . $groupby['table'] . '`.`' . $groupby['column'] . '`'; - } - } - - $sql .= isset( $groupByClause )?$groupByClause:''; - - // having - $havingClause = ''; - foreach( $this->havingClauses as $having ) { - if( strlen( $havingClause ) > 0 ) { - $havingClause .= ' -and'; - } - else { - $havingClause = ' -having'; - } - $havingClause .= ' - `' . $having['column'] . '` ' . $having['operand'] . ' "' . $this->dataAdapter->escapeString( $having['value'] ) . '"'; - } - - $sql .= isset( $havingClause )?$havingClause:''; - - //if($this->statement === 'update') dmp($sql); - - return $sql; - } - - /** - * get MSSQL SQL query - * - * @return string SQL query - */ - public function getMSSQLQuery() { - // select - - if( $this->statement === 'select' ) { - $sql = 'select'; - - // columns - $columns = ''; - foreach( $this->columns as $column ) { - - if( strlen( $columns ) > 0 ) { - $columns .= ' - , '; - } - else { - $columns = ' '; - } - - if( $column['table'] === '*' ) { - $columns .= '*'; - } - else { - $columns .= '' . $column['table'] . ''; - - if( $column['column'] === '*' ) { - $columns .= '.*'; - } - else { - $columns .= '.' . $column['column'] . ''; - $columns .= ' as ' . $column['alias'] . ''; - } - } - } - - $sql .= isset( $columns )?$columns:''; - - // from - $tables = ''; - foreach( $this->tables as $table ) { - if( strlen( $tables ) > 0 ) { - $tables .= ' - , ' . $table['table'] . '' . ' as ' . $table['alias'] . ''; - } - else { - $tables = ' - from ' . $table['table'] . '' . ' as ' . $table['alias'] . ''; - } - } - - $sql .= isset( $tables )?$tables:''; - } - - // insert - elseif( $this->statement === 'insert' ) { - $sql = 'insert'; - - $tables = $this->tables; - - $sql .= ' - into ' . $tables[0]['table'] . ' ('; - - // columns - $columns = '';$i=0;$pKeyIndex=-1; - foreach( $this->columns as $column ) { - $metaColumn = $this->dataAdapter->getField($column['table'], $column['column']); - if((bool)$metaColumn['primaryKey']) - { - $columns .=""; - $pKeyIndex=$i; - } - else if( strlen( $columns ) > 0 ) { - $columns .= ',' . $column['column'] . ''; - } - else { - $columns = '' . $column['column'] . ''; - } - $i++; - } - $sql .= isset( $columns )?$columns:''; - $sql .= ')'; - - $sql .= ' - values('; - - // values - $values = '';$i=0; - foreach( $this->values as $value ) { - if($pKeyIndex!= -1 && $i==$pKeyIndex) $values .=""; - else { - if( strlen( $values ) > 0 ) { - $values .= ','; - } - else { - $values = ''; - } - if( is_null( $value )) { - $values .= 'null'; - } - elseif( is_bool( $value )) { - $values .= $value?'true':'false'; - } - elseif( is_int( $value )) { - $values .= (int)$value; - } - elseif( is_float( $value )) { - $values .= (real)$value; - } - elseif( is_string( $value )) { - $values .= "'".(string)$value."'"; - } - else { - - $values .= '"' . $this->dataAdapter->escapeString( $value ) . '"'; - } - } - - $i++; - } - $sql .= $values . ')'; - - } - // update - elseif( $this->statement === 'update' ) { - $sql = 'update'; - $tables = $this->tables; - $sql .= ' ' . $tables[0]['table'] . ''; - // set - $columns = $this->columns; - $values = $this->values; - $setClause = ''; - $fieldsAdded=0; - for( $i = 0; $i < count( $columns ); $i++ ) { - - if( $fieldsAdded == 0 ) { - $setClause = ' - set '; - } - $metaColumn = $this->dataAdapter->getField($columns[$i]['table'], $columns[$i]['column']); - - if((bool)$metaColumn['primaryKey'] || is_null( $values[$i])) $setClause .=""; - else { - if( $fieldsAdded > 0) $setClause .= " - ,"; - if( is_bool( $values[$i] )) { - $setClause .= '' . $columns[$i]['table'] . '.' . $columns[$i]['column'] . ' = ' . ($values[$i]?'true':'false'); - } - elseif( is_int( $values[$i] )) { - $setClause .= '' . $columns[$i]['table'] . '.' . $columns[$i]['column'] . ' = ' . (int)$values[$i]; - } - elseif( is_float( $values[$i] )) { - $setClause .= '' . $columns[$i]['table'] . '.' . $columns[$i]['column'] . ' = ' . (real)$values[$i]; - } - elseif( is_string( $values[$i])) { - $setClause .= '' . $columns[$i]['table'] . '.' . $columns[$i]['column'] . " = '" . $values[$i]."'"; - } - else { - $setClause .= '' . $columns[$i]['table'] . '.' . $columns[$i]['column'] . ' = "' . $this->dataAdapter->escapeString( $values[$i] ) . '"'; - } - $fieldsAdded++; - } - - } - $sql .= isset( $setClause )?$setClause:''; - - } - - // delete - elseif( $this->statement === 'delete' ) { - $sql = 'delete'; - - // from - $tables = ''; - foreach( $this->tables as $table ) { - if( strlen( $tables ) > 0 ) { - $tables .= ' - , ' . $table['table'] . ''; - } - else { - $tables = ' - from ' . $table['table'] . ''; - } - } - - $sql .= isset( $tables )?$tables:''; - - } - - // delete - elseif( $this->statement === 'truncate' ) { - $sql = 'truncate'; - - // from - $tables = ''; - foreach( $this->tables as $table ) { - if( strlen( $tables ) > 0 ) { - $tables .= ', ' . $table['table'] . ''; - } - else { - $tables = ' ' . $table['table'] . ''; - } - } - - $sql .= isset( $tables )?$tables:''; - } - - // joins - foreach( $this->joins as $join ) { - $sql .= ' -' . $join['type'] . ' - join ' . $join['lefttable'] . ' as ' . $join['alias'] . ' - on ' . $join['alias'] . '.' . $join['leftcolumn'] . ' = ' . $join['righttable'] . '.' . $join['rightcolumn'] . ''; - - - } - - // where - $whereClause = ''; - foreach( $this->whereClauses as $where ) { - if( strlen( $whereClause ) > 0 ) { - $whereClause .= ' -and'; - } - else { - $whereClause = ' -where'; - } - - if( is_null( $where['value'] )) { - $whereClause .= ' - ' . $where['table'] . '.' . $where['column'] . ' is null'; - } - elseif( is_int( $where['value'] )) { - $whereClause .= ' - ' . $where['table'] . '.' . $where['column'] . ' ' . $where['operand'] . ' ' . (int)$where['value'] . ''; - } - elseif( is_float( $where['value'] )) { - $whereClause .= ' - ' . $where['table'] . '.' . $where['column'] . ' ' . $where['operand'] . ' ' . (real)$where['value'] . ''; - } - elseif( is_bool( $where['value'] )) { - $whereClause .= ' - ' . $where['table'] . '.' . $where['column'] . ' = ' . ($where['value']?'true':'false'); - } - else { - $whereClause .= ' - ' . $where['table'] . '.' . $where['column'] . ' ' . $where['operand'] . ' "' . $this->dataAdapter->escapeString( $where['value'] ) . '"'; - } - } - - if( $this->empty ) { - if( strlen( $whereClause ) === 0 ) { - $whereClause = ' -where - 0'; - } - } - - $sql .= isset( $whereClause )?$whereClause:''; - - // orderby - $orderByClause = ''; - foreach( $this->orderByClauses as $orderby ) { - if( strlen( $orderByClause ) > 0 ) { - $orderByClause .= ' - , ' . $orderby['table'] . '.' . $orderby['column'] . ' ' . $orderby['direction']; - } - else { - $orderByClause = ' -order - by ' . $orderby['table'] . '.' . $orderby['column'] . ' ' . $orderby['direction']; - } - } - - $sql .= isset( $orderByClause )?$orderByClause:''; - - // groupby - $groupByClause = ''; - foreach( $this->groupByClauses as $groupby ) { - if( strlen( $groupByClause ) > 0 ) { - $groupByClause .= ' - , ' . $groupby['table'] . '.' . $groupby['column'] . ''; - } - else { - $groupByClause = ' -group - by ' . $groupby['table'] . '.' . $groupby['column'] . ''; - } - } - - $sql .= isset( $groupByClause )?$groupByClause:''; - - // having - $havingClause = ''; - foreach( $this->havingClauses as $having ) { - if( strlen( $havingClause ) > 0 ) { - $havingClause .= ' -and'; - } - else { - $havingClause = ' -having'; - } - $havingClause .= ' - ' . $having['column'] . ' ' . $having['operand'] . ' "' . $this->dataAdapter->escapeString( $having['value'] ) . '"'; - } - - $sql .= isset( $havingClause )?$havingClause:''; - - - return $sql; - } - - function is_date( $str ) - { - $stamp = strtotime( $str ); - if (!is_numeric($stamp)) - return FALSE; - $month = date( 'm', $stamp ); - $day = date( 'd', $stamp ); - $year = date( 'Y', $stamp ); - if (checkdate($month, $day, $year)) return TRUE; - return FALSE; - } - } -?> \ No newline at end of file diff --git a/system/db/pdo/pdotransaction.class.php b/system/db/pdo/pdotransaction.class.php deleted file mode 100644 index eec4a44..0000000 --- a/system/db/pdo/pdotransaction.class.php +++ /dev/null @@ -1,47 +0,0 @@ -dataAdapter->pdo->beginTransaction(); - } - - - /** - * Implements a rollback - */ - protected function rollbackTransaction() - { - $this->dataAdapter->pdo->rollBack; - } - - - /** - * Implements a commit - */ - protected function commitTransaction() - { - $this->dataAdapter->pdo->commit(); - } - } -?> \ No newline at end of file diff --git a/system/db/querybuilderbase.class.php b/system/db/querybuilderbase.class.php index 3adaae1..547fba7 100644 --- a/system/db/querybuilderbase.class.php +++ b/system/db/querybuilderbase.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\DB; diff --git a/system/db/queryexception.class.php b/system/db/queryexception.class.php index 34d6061..dd014bd 100644 --- a/system/db/queryexception.class.php +++ b/system/db/queryexception.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\DB; use \System\Base\ExceptionBase; diff --git a/system/db/schemaexception.class.php b/system/db/schemaexception.class.php index 82395db..6c75451 100644 --- a/system/db/schemaexception.class.php +++ b/system/db/schemaexception.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\DB; use \System\Base\ExceptionBase; diff --git a/system/db/tableschema.class.php b/system/db/tableschema.class.php index 7faee3f..a2830ec 100644 --- a/system/db/tableschema.class.php +++ b/system/db/tableschema.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\DB; diff --git a/system/db/text/textdataadapter.class.php b/system/db/text/textdataadapter.class.php index 3308e91..ed37121 100644 --- a/system/db/text/textdataadapter.class.php +++ b/system/db/text/textdataadapter.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\DB\Text; use \System\DB\DataAdapter; diff --git a/system/db/transactionbase.class.php b/system/db/transactionbase.class.php index 1246e6c..575bba6 100644 --- a/system/db/transactionbase.class.php +++ b/system/db/transactionbase.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\DB; diff --git a/system/db/transactionexception.class.php b/system/db/transactionexception.class.php index b0e9161..ac41ba1 100644 --- a/system/db/transactionexception.class.php +++ b/system/db/transactionexception.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\DB; use \System\Base\ExceptionBase; diff --git a/system/deploy/deploy.class.php b/system/deploy/deploy.class.php index 62e9a56..b8c433b 100644 --- a/system/deploy/deploy.class.php +++ b/system/deploy/deploy.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Deploy; use System\Console\ConsoleApplicationBase; diff --git a/system/deploy/deploymentbase.class.php b/system/deploy/deploymentbase.class.php index ef9180b..acb89e1 100644 --- a/system/deploy/deploymentbase.class.php +++ b/system/deploy/deploymentbase.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Deploy; diff --git a/system/deploy/sshclientbase.class.php b/system/deploy/sshclientbase.class.php index 171d32b..43d73ed 100644 --- a/system/deploy/sshclientbase.class.php +++ b/system/deploy/sshclientbase.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Deploy; diff --git a/system/get/get.class.php b/system/get/get.class.php index 49c6583..6743408 100644 --- a/system/get/get.class.php +++ b/system/get/get.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Get; use System\Console\ConsoleApplicationBase; diff --git a/system/i18n/dbtranslator.class.php b/system/i18n/dbtranslator.class.php index 87d6aa4..737cbf5 100644 --- a/system/i18n/dbtranslator.class.php +++ b/system/i18n/dbtranslator.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\I18N; @@ -93,7 +93,8 @@ public function get($stringId, $default = '') { \System\Base\ApplicationBase::getInstance()->dataAdapter->addTableSchema(new \System\DB\TableSchema( array( - 'name' => $this->table), + 'name' => $this->table, + 'primaryKey' => 'string_id'), array(), array(new \System\DB\ColumnSchema(array( 'name' => 'string_id', diff --git a/system/i18n/filetranslator.class.php b/system/i18n/filetranslator.class.php index 60156b6..fd07fb5 100644 --- a/system/i18n/filetranslator.class.php +++ b/system/i18n/filetranslator.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\I18N; @@ -42,8 +42,14 @@ public function __construct($file = '') $this->file = $file; } - $xmlParser = new \System\XML\XMLParser(); - $this->langs = $xmlParser->parse(\file_get_contents($this->file)); + $this->langs = \System\Base\Build::get('langs'.$file); + + if(!$this->langs) + { + $xmlParser = new \System\XML\XMLParser(); + $this->langs = $xmlParser->parse(\file_get_contents($this->file)); + \System\Base\Build::put('langs'.$file, $this->langs); + } } @@ -61,7 +67,7 @@ public function get($stringId, $default = '') foreach($this->langs->children as $lang) { - if($lang["lang"]==$this->langs) + if($lang["lang"]==$this->lang) { foreach($lang->children as $string) { diff --git a/system/i18n/translatorbase.class.php b/system/i18n/translatorbase.class.php index f98e864..8b42440 100644 --- a/system/i18n/translatorbase.class.php +++ b/system/i18n/translatorbase.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\I18N; diff --git a/system/i18n/translatorexception.class.php b/system/i18n/translatorexception.class.php index f33889c..ca9279f 100644 --- a/system/i18n/translatorexception.class.php +++ b/system/i18n/translatorexception.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\I18N; use \System\Base\ExceptionBase; diff --git a/system/logger/dblogger.class.php b/system/logger/dblogger.class.php index ff55d49..5e6831d 100644 --- a/system/logger/dblogger.class.php +++ b/system/logger/dblogger.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Logger; @@ -75,7 +75,8 @@ public function log($message, $category) { \System\Base\ApplicationBase::getInstance()->dataAdapter->addTableSchema(new \System\DB\TableSchema( array( - 'name' => $this->table), + 'name' => $this->table, + 'primaryKey' => 'datetime'), array(), array(new \System\DB\ColumnSchema(array( 'name' => 'datetime', diff --git a/system/logger/filelogger.class.php b/system/logger/filelogger.class.php index 295a2ef..75da086 100644 --- a/system/logger/filelogger.class.php +++ b/system/logger/filelogger.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Logger; diff --git a/system/logger/loggerbase.class.php b/system/logger/loggerbase.class.php index 0a2980f..02b9450 100644 --- a/system/logger/loggerbase.class.php +++ b/system/logger/loggerbase.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Logger; diff --git a/system/logger/loggerexception.class.php b/system/logger/loggerexception.class.php index ff7744d..1d3fa7a 100644 --- a/system/logger/loggerexception.class.php +++ b/system/logger/loggerexception.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Logger; use \System\Base\ExceptionBase; diff --git a/system/make/make.class.php b/system/make/make.class.php index be635c1..9083333 100644 --- a/system/make/make.class.php +++ b/system/make/make.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Make; use System\Console\ConsoleApplicationBase; diff --git a/system/make/makebase.class.php b/system/make/makebase.class.php index 46cdc23..2d2165f 100644 --- a/system/make/makebase.class.php +++ b/system/make/makebase.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Make; diff --git a/system/make/scripts/controller.php b/system/make/scripts/controller.php index 16207e5..7b1e3d6 100644 --- a/system/make/scripts/controller.php +++ b/system/make/scripts/controller.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Make; diff --git a/system/make/scripts/formcontroller.php b/system/make/scripts/formcontroller.php index c3dffc6..8446d1a 100644 --- a/system/make/scripts/formcontroller.php +++ b/system/make/scripts/formcontroller.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Make; diff --git a/system/make/scripts/gridviewcontroller.php b/system/make/scripts/gridviewcontroller.php index 752e298..7abc005 100644 --- a/system/make/scripts/gridviewcontroller.php +++ b/system/make/scripts/gridviewcontroller.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Make; diff --git a/system/make/scripts/jsonwebservice.php b/system/make/scripts/jsonwebservice.php index ddbf5ce..2057738 100644 --- a/system/make/scripts/jsonwebservice.php +++ b/system/make/scripts/jsonwebservice.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Make; diff --git a/system/make/scripts/listcontroller.php b/system/make/scripts/listcontroller.php index b020483..5434bed 100644 --- a/system/make/scripts/listcontroller.php +++ b/system/make/scripts/listcontroller.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Make; diff --git a/system/make/scripts/model.php b/system/make/scripts/model.php index da20ad3..ccbd379 100644 --- a/system/make/scripts/model.php +++ b/system/make/scripts/model.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Make; diff --git a/system/make/scripts/pagecontroller.php b/system/make/scripts/pagecontroller.php index 65dead1..43a666d 100644 --- a/system/make/scripts/pagecontroller.php +++ b/system/make/scripts/pagecontroller.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Make; diff --git a/system/make/scripts/restwebservice.php b/system/make/scripts/restwebservice.php index 005e660..0210eb6 100644 --- a/system/make/scripts/restwebservice.php +++ b/system/make/scripts/restwebservice.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Make; diff --git a/system/make/scripts/soapwebservice.php b/system/make/scripts/soapwebservice.php index 6a388e7..b9cab39 100644 --- a/system/make/scripts/soapwebservice.php +++ b/system/make/scripts/soapwebservice.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Make; diff --git a/system/migrate/migrate.class.php b/system/migrate/migrate.class.php index 76653a2..44046cc 100644 --- a/system/migrate/migrate.class.php +++ b/system/migrate/migrate.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Migrate; use System\Console\ConsoleApplicationBase; diff --git a/system/migrate/migrationbase.class.php b/system/migrate/migrationbase.class.php index 68103eb..262d564 100644 --- a/system/migrate/migrationbase.class.php +++ b/system/migrate/migrationbase.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Migrate; diff --git a/system/migrate/migrationcompare.class.php b/system/migrate/migrationcompare.class.php index 216a544..c53c321 100644 --- a/system/migrate/migrationcompare.class.php +++ b/system/migrate/migrationcompare.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Migrate; diff --git a/system/migrate/migrations.class.php b/system/migrate/migrations.class.php index cf1bfd7..f56e2ab 100644 --- a/system/migrate/migrations.class.php +++ b/system/migrate/migrations.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Migrate; @@ -63,22 +63,37 @@ public function downgrade($toVersion=null) //$transaction = \System\Base\ApplicationBase::getInstance()->dataAdapter->beginTransaction(); - foreach(\array_reverse($this->getMigrations()) as $migration) + $next = false; + foreach(\array_reverse($this->getMigrations()) as $migration) { if( $migration->version <= $this->getCurrentVersion() && $migration->version > $toVersion) { echo "Downgrading from version {$migration->version}".PHP_EOL; - $migration->down(); + try + { + $migration->down(); + + $this->setVersion($migration->version); + $next = true; + continue; + } + catch(\Exception $e) + { + $this->setVersion($migration->version); + throw new \Exception($e->getMessage(), $e->getCode()); + } } - if( $migration->version <= $this->getCurrentVersion() && - $migration->version >= $toVersion) + + if($next) { + $next = false; $this->setVersion($migration->version); + break; } } - if($toVersion==0) + if($toVersion==0 || $next) { $this->setVersion(0); } diff --git a/system/rum.class.php b/system/rum.class.php index 6583250..ce67850 100644 --- a/system/rum.class.php +++ b/system/rum.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ @@ -236,22 +236,21 @@ static public function messages() { foreach(\System\Web\WebApplicationBase::getInstance()->messages as $message) { - $id = 'm' . uniqid(); if($message->type == \System\Base\AppMessageType::Fail()) { - $output .= "
  • "; + $output .= "
  • "; } elseif($message->type == \System\Base\AppMessageType::Warning()) { - $output .= "
  • "; + $output .= "
  • "; } elseif($message->type == \System\Base\AppMessageType::Success()) { - $output .= "
  • "; + $output .= "
  • "; } else { - $output .= "
  • "; + $output .= "
  • "; } $output .= \nl2br(\Rum::escape($message->message)) . '
  • '; diff --git a/system/security/authentication.class.php b/system/security/authentication.class.php index cb88117..b24d3d4 100644 --- a/system/security/authentication.class.php +++ b/system/security/authentication.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Security; diff --git a/system/security/authenticationloglevel.class.php b/system/security/authenticationloglevel.class.php index d3d87e1..2733fca 100644 --- a/system/security/authenticationloglevel.class.php +++ b/system/security/authenticationloglevel.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Security; diff --git a/system/security/authenticationstatus.class.php b/system/security/authenticationstatus.class.php index 1522716..6149013 100644 --- a/system/security/authenticationstatus.class.php +++ b/system/security/authenticationstatus.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Security; diff --git a/system/security/basicauthentication.class.php b/system/security/basicauthentication.class.php index 91c602d..56ce1ca 100644 --- a/system/security/basicauthentication.class.php +++ b/system/security/basicauthentication.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Security; diff --git a/system/security/credentialbase.class.php b/system/security/credentialbase.class.php index cb9acb0..1d750f4 100644 --- a/system/security/credentialbase.class.php +++ b/system/security/credentialbase.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Security; diff --git a/system/security/formsauthentication.class.php b/system/security/formsauthentication.class.php index 015b20e..6989703 100644 --- a/system/security/formsauthentication.class.php +++ b/system/security/formsauthentication.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Security; @@ -210,8 +210,8 @@ public static function signout() unset( \System\Web\WebApplicationBase::getInstance()->session[\System\Base\ApplicationBase::getInstance()->config->authenticationFormsCookieName.'_secret'] ); } - setcookie( \System\Web\WebApplicationBase::getInstance()->config->authenticationFormsCookieName, '', time()-31536000, \System\Base\ApplicationBase::getInstance()->config->uri ); - setcookie( \System\Web\WebApplicationBase::getInstance()->config->authenticationFormsCookieName.'_secret', '', time()-31536000, \System\Base\ApplicationBase::getInstance()->config->uri ); + \System\Web\HTTPResponse::setCookie(\Rum::config()->authenticationFormsCookieName, '', -1, \Rum::config()->uri, null, $ssl ); + \System\Web\HTTPResponse::setCookie(\Rum::config()->authenticationFormsCookieName.'_secret', '', -1, \Rum::config()->uri, null, $ssl ); \System\Web\WebApplicationBase::getInstance()->setForwardPage(); } diff --git a/system/security/roles.class.php b/system/security/roles.class.php index 6901387..cfebe45 100644 --- a/system/security/roles.class.php +++ b/system/security/roles.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Security; diff --git a/system/security/tablecredential.class.php b/system/security/tablecredential.class.php index 86ba5f7..c717798 100644 --- a/system/security/tablecredential.class.php +++ b/system/security/tablecredential.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Security; diff --git a/system/security/usercredential.class.php b/system/security/usercredential.class.php index 70d20a9..70198a6 100644 --- a/system/security/usercredential.class.php +++ b/system/security/usercredential.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Security; diff --git a/system/security/webserviceauthentication.class.php b/system/security/webserviceauthentication.class.php index 309093d..53b1539 100644 --- a/system/security/webserviceauthentication.class.php +++ b/system/security/webserviceauthentication.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Security; diff --git a/system/test/controllertestcasebase.class.php b/system/test/controllertestcasebase.class.php index 2f30fdc..6015d6a 100644 --- a/system/test/controllertestcasebase.class.php +++ b/system/test/controllertestcasebase.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Test; diff --git a/system/test/htmltestreporter.class.php b/system/test/htmltestreporter.class.php index 2502ee2..89139cc 100644 --- a/system/test/htmltestreporter.class.php +++ b/system/test/htmltestreporter.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Test; use \HtmlReporter; diff --git a/system/test/migrationstestcasebase.class.php b/system/test/migrationstestcasebase.class.php index db93a41..01542c5 100644 --- a/system/test/migrationstestcasebase.class.php +++ b/system/test/migrationstestcasebase.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Test; diff --git a/system/test/test.class.php b/system/test/test.class.php index fea18c4..fa397fe 100644 --- a/system/test/test.class.php +++ b/system/test/test.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace Rum\Migrate; use System\Console\ConsoleApplicationBase; diff --git a/system/test/testcasebase.class.php b/system/test/testcasebase.class.php index 9e173a9..a445f22 100644 --- a/system/test/testcasebase.class.php +++ b/system/test/testcasebase.class.php @@ -1,362 +1,362 @@ -loadFixtures( $this->fixtures ); - $this->prepare(); - } - - - /** - * clean test module - * - * @return void - * @ignore - */ - public function tearDown() { - parent::tearDown(); - - $this->cleanup(); - } - - - /** - * run report - * - * @param TestReporter $reporter TestReporter object - * - * @return void - */ - public function run( &$reporter ) { - $context = \SimpleTest::getContext(); - $context->setTest($this); - $context->setReporter($reporter); - $this->_reporter = &$reporter; - $reporter->paintCaseStart($this->getLabel()); - $this->skip(); - if (! $this->_should_skip) { - foreach ($this->getTests() as $method) { - if ($reporter->shouldInvoke($this->getLabel(), $method)) { - $invoker = &$this->_reporter->createInvoker($this->createInvoker()); - $invoker->before($method); - $invoker->invoke($method); - $invoker->after($method); - } - } - } - $reporter->setElapsedTime( \System\Base\ApplicationBase::getInstance()->timer->elapsed() ); - $reporter->paintCaseEnd($this->getLabel()); - unset($this->_reporter); - return $reporter->getStatus(); - } - - - /** - * returns an associative array of fixture variables - * used for dynamically inserting values inside fixtures - * - * @return array - */ - protected function getFixtureVariables() { - return array(); - } - - - /** - * called before evey test - * - * @return void - */ - protected function prepare() { - } - - - /** - * called after evey test - * - * @return void - */ - protected function cleanup() { - } - - - /** - * load fixtures - * - * @param array $fixtures array of fixtures - * @return void - */ - protected function loadFixtures( $fixtures ) - { - if($fixtures) - { - $tables = \System\Base\ApplicationBase::getInstance()->dataAdapter->buildSchema()->tableNames; - - while( count($tables) > 0 ) - { - for($i=0; $i__DB_SCHEMA_VERSION_TABLENAME__) - { - try - { - \System\Base\ApplicationBase::getInstance()->dataAdapter->queryBuilder()->delete()->from($table)->runQuery(); - unset($tables[$i]); - $tables = \array_values($tables); - } - catch(\System\DB\DatabaseException $e) {} - } - else - { - unset($tables[$i]); - $tables = \array_values($tables); - } - } - } - - if( strlen( $fixtures) > 0 ) - { - $fixtures = explode( ',', $fixtures ); - - foreach( $fixtures as $fixture ) - { - if( strpos( $fixture, '.xml' )) - { - $this->loadXMLFixture( trim( $fixture )); - } - elseif( strpos( $fixture, '.csv' )) - { - $this->loadCSVFixture( trim( $fixture )); - } - elseif( strpos( $fixture, '.sql' )) - { - $this->loadSQLFixture( trim( $fixture )); - } - else - { - throw new \System\Base\InvalidOperationException( "fixture must be one of type .xml, .csv, or .sql" ); - } - } - } - } - - \System\Base\ApplicationBase::getInstance()->dataAdapter->rebuildSchema(); - } - - - /** - * load xml fixture - * - * @param string $fixture name of fixture - * @return void - */ - final protected function loadXMLFixture( $fixture ) - { - if($fixture) - { - $tables = \System\Base\ApplicationBase::getInstance()->dataAdapter->buildSchema()->tableNames; - $xmlParser = new \System\XML\XMLParser(); - $fail = false; - - $e = null; - try - { - $xml = $xmlParser->parse( file_get_contents( \System\Base\ApplicationBase::getInstance()->config->fixtures . '/' . $fixture )); - - foreach( $xml->children as $record ) - { - $ds = \System\Base\ApplicationBase::getInstance()->dataAdapter->queryBuilder()->select()->from($this->_arrayLsearch($record->name,$tables))->openDataSet(); - - $fields = array_keys( $ds->row ); - $fieldnames = array(); - $fieldvalues = array(); - - foreach( $record->children as $column ) - { - $fieldnames[] = $this->_arrayLsearch( $column->name, $fields ); - - if( isset( $column["EVAL"] )) - { - if( strtolower( $column["EVAL"] ) === 'true' ) - { - eval('$column->value='.$column->value.';'); - } - } - - $fieldvalues[] = $column->value; - } - - try - { - \System\Base\ApplicationBase::getInstance()->dataAdapter->queryBuilder() - ->insertInto($this->_arrayLsearch( $record->name, $tables ), $fieldnames) - ->values($fieldvalues) - ->runQuery(); - } - catch(SQLException $e) - { - throw new \System\Base\InvalidOperationException( "could not execute XML fixture " . $e->getMessage() ); - } - } - } - catch(XMLException $e) - { - throw new \System\Base\XMLException( "could not parse XML fixture " . $e->getMessage() ); - } - } - } - - - /** - * load csv fixture - * - * @param string $fixture name of fixture - * @return bool - */ - final protected function loadCSVFixture( $fixture ) - { - if($fixture) - { - $table = str_replace('.csv', '', $fixture); - - $ds = \System\Base\ApplicationBase::getInstance()->dataAdapter->queryBuilder()->select()->from($table)->openDataSet(); - $fp = fopen( \System\Base\ApplicationBase::getInstance()->config->fixtures . '/' . $fixture, 'r' ); - $fields = fgetcsv($fp); - - while($row = fgetcsv($fp)) - { - for($i=0; $i < count($fields); $i++) - { - $ds->row[$fields[$i]] = $row[$i]; - } - $ds->insert(); - } - } - } - - - /** - * load sql fixture - * - * @param string $fixture name of fixture - * @return void - */ - final protected function loadSQLFixture( $fixture ) - { - if($fixture) - { - $sql = file_get_contents( \System\Base\ApplicationBase::getInstance()->config->fixtures . '/' . $fixture ); - $fail = false; - - foreach($this->getFixtureVariables() as $key=>$var) - { - $sql = str_replace("%{$key}%", $var, $sql); - } - - if( $sql ) - { - \System\Base\ApplicationBase::getInstance()->dataAdapter->executeBatch( $sql ); - } - else - { - throw new \System\Utils\FileLoadException( 'could not open fixture file ' . \System\Base\ApplicationBase::getInstance()->config->fixtures . '/' . $fixture ); - } - } - } - - - /** - * search for string in array - * - * @param string $str - * @param array $array - * @return int index of element - */ - private function _arrayLsearch( $str, $array ) { - foreach($array as $k=>$v){ - if(strtolower($v)===strtolower($str)){ - return $v; - } - } - - throw new \System\Base\InvalidOperationException("{$str} does not exist in array"); - } - } +loadFixtures( $this->fixtures ); + $this->prepare(); + } + + + /** + * clean test module + * + * @return void + * @ignore + */ + public function tearDown() { + parent::tearDown(); + + $this->cleanup(); + } + + + /** + * run report + * + * @param TestReporter $reporter TestReporter object + * + * @return void + */ + public function run( &$reporter ) { + $context = \SimpleTest::getContext(); + $context->setTest($this); + $context->setReporter($reporter); + $this->_reporter = &$reporter; + $reporter->paintCaseStart($this->getLabel()); + $this->skip(); + if (! $this->_should_skip) { + foreach ($this->getTests() as $method) { + if ($reporter->shouldInvoke($this->getLabel(), $method)) { + $invoker = &$this->_reporter->createInvoker($this->createInvoker()); + $invoker->before($method); + $invoker->invoke($method); + $invoker->after($method); + } + } + } + $reporter->setElapsedTime( \System\Base\ApplicationBase::getInstance()->timer->elapsed() ); + $reporter->paintCaseEnd($this->getLabel()); + unset($this->_reporter); + return $reporter->getStatus(); + } + + + /** + * returns an associative array of fixture variables + * used for dynamically inserting values inside fixtures + * + * @return array + */ + protected function getFixtureVariables() { + return array(); + } + + + /** + * called before evey test + * + * @return void + */ + protected function prepare() { + } + + + /** + * called after evey test + * + * @return void + */ + protected function cleanup() { + } + + + /** + * load fixtures + * + * @param array $fixtures array of fixtures + * @return void + */ + protected function loadFixtures( $fixtures ) + { + if($fixtures) + { + $tables = \System\Base\ApplicationBase::getInstance()->dataAdapter->buildSchema()->tableNames; + + while( count($tables) > 0 ) + { + for($i=0; $i__DB_SCHEMA_VERSION_TABLENAME__) + { + try + { + \System\Base\ApplicationBase::getInstance()->dataAdapter->queryBuilder()->delete()->from($table)->runQuery(); + unset($tables[$i]); + $tables = \array_values($tables); + } + catch(\System\DB\DatabaseException $e) {} + } + else + { + unset($tables[$i]); + $tables = \array_values($tables); + } + } + } + + if( strlen( $fixtures) > 0 ) + { + $fixtures = explode( ',', $fixtures ); + + foreach( $fixtures as $fixture ) + { + if( strpos( $fixture, '.xml' )) + { + $this->loadXMLFixture( trim( $fixture )); + } + elseif( strpos( $fixture, '.csv' )) + { + $this->loadCSVFixture( trim( $fixture )); + } + elseif( strpos( $fixture, '.sql' )) + { + $this->loadSQLFixture( trim( $fixture )); + } + else + { + throw new \System\Base\InvalidOperationException( "fixture must be one of type .xml, .csv, or .sql" ); + } + } + } + + \System\Base\ApplicationBase::getInstance()->dataAdapter->rebuildSchema(); + } + } + + + /** + * load xml fixture + * + * @param string $fixture name of fixture + * @return void + */ + final protected function loadXMLFixture( $fixture ) + { + if($fixture) + { + $tables = \System\Base\ApplicationBase::getInstance()->dataAdapter->buildSchema()->tableNames; + $xmlParser = new \System\XML\XMLParser(); + $fail = false; + + $e = null; + try + { + $xml = $xmlParser->parse( file_get_contents( \System\Base\ApplicationBase::getInstance()->config->fixtures . '/' . $fixture )); + + foreach( $xml->children as $record ) + { + $ds = \System\Base\ApplicationBase::getInstance()->dataAdapter->queryBuilder()->select()->from($this->_arrayLsearch($record->name,$tables))->openDataSet(); + + $fields = array_keys( $ds->row ); + $fieldnames = array(); + $fieldvalues = array(); + + foreach( $record->children as $column ) + { + $fieldnames[] = $this->_arrayLsearch( $column->name, $fields ); + + if( isset( $column["EVAL"] )) + { + if( strtolower( $column["EVAL"] ) === 'true' ) + { + eval('$column->value='.$column->value.';'); + } + } + + $fieldvalues[] = $column->value; + } + + try + { + \System\Base\ApplicationBase::getInstance()->dataAdapter->queryBuilder() + ->insertInto($this->_arrayLsearch( $record->name, $tables ), $fieldnames) + ->values($fieldvalues) + ->runQuery(); + } + catch(SQLException $e) + { + throw new \System\Base\InvalidOperationException( "could not execute XML fixture " . $e->getMessage() ); + } + } + } + catch(XMLException $e) + { + throw new \System\Base\XMLException( "could not parse XML fixture " . $e->getMessage() ); + } + } + } + + + /** + * load csv fixture + * + * @param string $fixture name of fixture + * @return bool + */ + final protected function loadCSVFixture( $fixture ) + { + if($fixture) + { + $table = str_replace('.csv', '', $fixture); + + $ds = \System\Base\ApplicationBase::getInstance()->dataAdapter->queryBuilder()->select()->from($table)->openDataSet(); + $fp = fopen( \System\Base\ApplicationBase::getInstance()->config->fixtures . '/' . $fixture, 'r' ); + $fields = fgetcsv($fp); + + while($row = fgetcsv($fp)) + { + for($i=0; $i < count($fields); $i++) + { + $ds->row[$fields[$i]] = $row[$i]; + } + $ds->insert(); + } + } + } + + + /** + * load sql fixture + * + * @param string $fixture name of fixture + * @return void + */ + final protected function loadSQLFixture( $fixture ) + { + if($fixture) + { + $sql = file_get_contents( \System\Base\ApplicationBase::getInstance()->config->fixtures . '/' . $fixture ); + $fail = false; + + foreach($this->getFixtureVariables() as $key=>$var) + { + $sql = str_replace("%{$key}%", $var, $sql); + } + + if( $sql ) + { + \System\Base\ApplicationBase::getInstance()->dataAdapter->executeBatch( $sql ); + } + else + { + throw new \System\Utils\FileLoadException( 'could not open fixture file ' . \System\Base\ApplicationBase::getInstance()->config->fixtures . '/' . $fixture ); + } + } + } + + + /** + * search for string in array + * + * @param string $str + * @param array $array + * @return int index of element + */ + private function _arrayLsearch( $str, $array ) { + foreach($array as $k=>$v){ + if(strtolower($v)===strtolower($str)){ + return $v; + } + } + + throw new \System\Base\InvalidOperationException("{$str} does not exist in array"); + } + } ?> \ No newline at end of file diff --git a/system/test/tester.class.php b/system/test/tester.class.php index a29895b..49b5fd5 100644 --- a/system/test/tester.class.php +++ b/system/test/tester.class.php @@ -1,223 +1,226 @@ -loadTestConfig(); - $this->getUnitTestCase( $testCase )->run( $reporter ); - } - - - /** - * run functional test case - * - * @param string $testCase name of module - * @param \SimpleReporter $reporter instance of a \SimpleReporter - * @return void - */ - public function runFunctionalTestCase( $testCase, \SimpleReporter $reporter ) { - $this->loadTestConfig(); - $this->getFunctionalTestCase( $testCase )->run( $reporter ); - } - - - /** - * run all test cases - * - * @param \SimpleReporter $reporter instance of a \SimpleReporter - * @return void - */ - public function runAllTestCases(\SimpleReporter $reporter) { - $this->loadTestConfig(); - - require_once __LIB_PATH__ . '/simpletest/test_case.php'; - - $tests = new \TestSuite( \System\Base\ApplicationBase::getInstance()->applicationId . '_TestSuite' ); - - foreach( $this->getAllUnitTestCases() as $testCase ) { - $tests->addTestCase( $this->getUnitTestCase( $testCase ) ); - } - - foreach( $this->getAllFunctionalTestCases() as $testCase ) { - $tests->addTestCase( $this->getFunctionalTestCase( $testCase ) ); - } - - $tests->run($reporter); - } - - - /** - * return unit test case - * - * @param string $testCase name of test - * @return UnitTestCaseBase - */ - public function getUnitTestCase( $testCase ) - { - $testPath = \System\Base\ApplicationBase::getInstance()->config->unittests . '/' . $testCase . strtolower( __TESTCASE_SUFFIX__ ) . __CLASS_EXTENSION__; - $testCaseClass = \System\Base\ApplicationBase::getInstance()->namespace . '\\'.__MODELS_NAMESPACE__.'\\' . ucwords( $testCase ) . __TESTCASE_SUFFIX__; - - if( include_once $testPath ) - { - if( class_exists( $testCaseClass )) - { - return new $testCaseClass( $testCase ); - } - else - { - throw new \System\Base\InvalidOperationException( "class `$testCaseClass` does not exist" ); - } - } - else - { - throw new \System\Utils\FileNotFoundException( "file `$testPath` does not exist" ); - } - } - - - /** - * return functional test case - * - * @param string $module name of module - * @return ControllerTestCaseBase - */ - public function getFunctionalTestCase( $module ) - { - $controller = str_replace( '-', '_', $module ); - $controllerIncludePath = \System\Base\ApplicationBase::getInstance()->config->controllers . '/' . strtolower( $controller ) . __CONTROLLER_EXTENSION__; - - $testPath = \System\Base\ApplicationBase::getInstance()->config->functionaltests . '/' . strtolower( $module ) . strtolower( __CONTROLLER_TESTCASE_SUFFIX__ ) . __CLASS_EXTENSION__; - $testCaseClass = \System\Base\ApplicationBase::getInstance()->namespace . "\\".__CONTROLLERS_NAMESPACE__."\\" . ucwords( str_replace('/', '\\', $module )) . __CONTROLLER_TESTCASE_SUFFIX__; - - if( !defined( \System\Base\INCLUDEPREFIX . $controllerIncludePath )) - { - define( \System\Base\INCLUDEPREFIX . $controllerIncludePath, true ); - - if( !include_once( $controllerIncludePath )) - { - throw new \System\Utils\FileNotFoundException( "file `$controllerIncludePath` does not exist" ); - } - } - - if( !defined( \System\Base\INCLUDEPREFIX . $testPath )) - { - define( \System\Base\INCLUDEPREFIX . $testPath, true ); - - if( !include_once( $testPath )) - { - throw new \System\Utils\FileNotFoundException( "file `$testPath` does not exist" ); - } - } - - if( class_exists( $testCaseClass )) - { - return new $testCaseClass( $controller ); - } - else - { - throw new \System\Base\InvalidOperationException( "class `$testCaseClass` does not exist, make sure you specify the correct namespace" ); - } - } - - - /** - * return all unit test cases - * - * @return array array of test modules - */ - public function getAllUnitTestCases() { - - $modules = array(); - $dir = dir( \System\Base\ApplicationBase::getInstance()->config->unittests ); - - while( false !== ( $file = $dir->read() )) { - if( stripos( $file, '.php' ) === strlen($file) - 4 ) { - $modules[] = preg_replace( '^' . strtolower( __TESTCASE_SUFFIX__ . __CLASS_EXTENSION__ ) . '$^', '\\1', $file ); - } - } - - $dir->close(); - return $modules; - } - - - /** - * return all functional test cases - * - * @param string $path initial path - * @return array array of test modules - */ - public function getAllFunctionalTestCases( $path = '' ) { - - if( !$path ) $path = \System\Base\ApplicationBase::getInstance()->config->functionaltests; - - $modules = array(); - $dir = dir( $path ); - - while( false !== ( $file = $dir->read() )) { - if( $file != '.' && $file != '..' ) { - if( is_dir( $path . '/' . $file )) { - $modules = array_merge( $modules, $this->getAllFunctionalTestCases( $path . '/' . $file )); - } - else { - if( stripos( $file, '.php' ) === strlen($file) - 4 ) { - $module = str_replace( \System\Base\ApplicationBase::getInstance()->config->functionaltests . '/', '', $path . '/' . $file ); - $module = preg_replace( '^' . '(.*)$^', '\\1', $module ); - $module = preg_replace( '^' . strtolower( __CONTROLLER_TESTCASE_SUFFIX__ . __CLASS_EXTENSION__ ) . '$^', '\\1', $module ); - $modules[] = $module; - } - } - } - } - - $dir->close(); - return $modules; - } - - - /** - * run all test cases - * - * @param \SimpleReporter $reporter instance of a \SimpleReporter - * @return void - */ - public function loadTestConfig() { - restore_error_handler(); - error_reporting( E_ALL & ~E_STRICT ); - - // load global app configuration - if(file_exists(__CONFIG_PATH__ . __APP_CONF_FILENAME__)) { - \System\Base\ApplicationBase::getInstance()->loadAppConfig( __CONFIG_PATH__ . __APP_CONF_FILENAME__ ); - } - - // load test env app configuration - if(file_exists(__ENV_PATH__ . '/' . __TEST_ENV__ . __APP_CONF_FILENAME__)) { - \System\Base\ApplicationBase::getInstance()->loadAppConfig( __ENV_PATH__ . '/' . __TEST_ENV__ . __APP_CONF_FILENAME__ ); - } - - \Rum::app()->dataAdapter = \System\DB\DataAdapter::create(\Rum::config()->dsn); - } - } +loadTestConfig(); + $this->getUnitTestCase( $testCase )->run( $reporter ); + } + + + /** + * run functional test case + * + * @param string $testCase name of module + * @param \SimpleReporter $reporter instance of a \SimpleReporter + * @return void + */ + public function runFunctionalTestCase( $testCase, \SimpleReporter $reporter ) { + $this->loadTestConfig(); + $this->getFunctionalTestCase( $testCase )->run( $reporter ); + } + + + /** + * run all test cases + * + * @param \SimpleReporter $reporter instance of a \SimpleReporter + * @return void + */ + public function runAllTestCases(\SimpleReporter $reporter) { + $this->loadTestConfig(); + + require_once __LIB_PATH__ . '/simpletest/test_case.php'; + + $tests = new \TestSuite( \System\Base\ApplicationBase::getInstance()->applicationId . '_TestSuite' ); + + foreach( $this->getAllUnitTestCases() as $testCase ) { + $tests->addTestCase( $this->getUnitTestCase( $testCase ) ); + } + + foreach( $this->getAllFunctionalTestCases() as $testCase ) { + $tests->addTestCase( $this->getFunctionalTestCase( $testCase ) ); + } + + $tests->run($reporter); + } + + + /** + * return unit test case + * + * @param string $testCase name of test + * @return UnitTestCaseBase + */ + public function getUnitTestCase( $testCase ) + { + $testPath = \System\Base\ApplicationBase::getInstance()->config->unittests . '/' . $testCase . strtolower( __TESTCASE_SUFFIX__ ) . __CLASS_EXTENSION__; + $testCaseClass = \System\Base\ApplicationBase::getInstance()->namespace . '\\'.__MODELS_NAMESPACE__.'\\' . ucwords( $testCase ) . __TESTCASE_SUFFIX__; + + if( include_once $testPath ) + { + if( class_exists( $testCaseClass )) + { + return new $testCaseClass( $testCase ); + } + else + { + throw new \System\Base\InvalidOperationException( "class `$testCaseClass` does not exist" ); + } + } + else + { + throw new \System\Utils\FileNotFoundException( "file `$testPath` does not exist" ); + } + } + + + /** + * return functional test case + * + * @param string $module name of module + * @return ControllerTestCaseBase + */ + public function getFunctionalTestCase( $module ) + { + $controller = str_replace( '-', '_', $module ); + $controllerIncludePath = \System\Base\ApplicationBase::getInstance()->config->controllers . '/' . strtolower( $controller ) . __CONTROLLER_EXTENSION__; + + $testPath = \System\Base\ApplicationBase::getInstance()->config->functionaltests . '/' . strtolower( $module ) . strtolower( __CONTROLLER_TESTCASE_SUFFIX__ ) . __CLASS_EXTENSION__; + $testCaseClass = \System\Base\ApplicationBase::getInstance()->namespace . "\\".__CONTROLLERS_NAMESPACE__."\\" . ucwords( str_replace('/', '\\', $module )) . __CONTROLLER_TESTCASE_SUFFIX__; + + if( !defined( \System\Base\INCLUDEPREFIX . $controllerIncludePath )) + { + define( \System\Base\INCLUDEPREFIX . $controllerIncludePath, true ); + + if( !include_once( $controllerIncludePath )) + { + throw new \System\Utils\FileNotFoundException( "file `$controllerIncludePath` does not exist" ); + } + } + + if( !defined( \System\Base\INCLUDEPREFIX . $testPath )) + { + define( \System\Base\INCLUDEPREFIX . $testPath, true ); + + if( !include_once( $testPath )) + { + throw new \System\Utils\FileNotFoundException( "file `$testPath` does not exist" ); + } + } + + if( class_exists( $testCaseClass )) + { + return new $testCaseClass( $controller ); + } + else + { + throw new \System\Base\InvalidOperationException( "class `$testCaseClass` does not exist, make sure you specify the correct namespace" ); + } + } + + + /** + * return all unit test cases + * + * @return array array of test modules + */ + public function getAllUnitTestCases() { + + $modules = array(); + $dir = dir( \System\Base\ApplicationBase::getInstance()->config->unittests ); + + while( false !== ( $file = $dir->read() )) { + if( stripos( $file, '.php' ) === strlen($file) - 4 ) { + $modules[] = preg_replace( '^' . strtolower( __TESTCASE_SUFFIX__ . __CLASS_EXTENSION__ ) . '$^', '\\1', $file ); + } + } + + $dir->close(); + return $modules; + } + + + /** + * return all functional test cases + * + * @param string $path initial path + * @return array array of test modules + */ + public function getAllFunctionalTestCases( $path = '' ) { + + if( !$path ) $path = \System\Base\ApplicationBase::getInstance()->config->functionaltests; + + $modules = array(); + $dir = dir( $path ); + + while( false !== ( $file = $dir->read() )) { + if( $file != '.' && $file != '..' ) { + if( is_dir( $path . '/' . $file )) { + $modules = array_merge( $modules, $this->getAllFunctionalTestCases( $path . '/' . $file )); + } + else { + if( stripos( $file, '.php' ) === strlen($file) - 4 ) { + $module = str_replace( \System\Base\ApplicationBase::getInstance()->config->functionaltests . '/', '', $path . '/' . $file ); + $module = preg_replace( '^' . '(.*)$^', '\\1', $module ); + $module = preg_replace( '^' . strtolower( __CONTROLLER_TESTCASE_SUFFIX__ . __CLASS_EXTENSION__ ) . '$^', '\\1', $module ); + $modules[] = $module; + } + } + } + } + + $dir->close(); + return $modules; + } + + + /** + * run all test cases + * + * @param \SimpleReporter $reporter instance of a \SimpleReporter + * @return void + */ + public function loadTestConfig() { + restore_error_handler(); + error_reporting( E_ALL & ~E_STRICT ); + + // load global app configuration + if(file_exists(__CONFIG_PATH__ . __APP_CONF_FILENAME__)) { + \System\Base\ApplicationBase::getInstance()->loadAppConfig( __CONFIG_PATH__ . __APP_CONF_FILENAME__ ); + } + + // load test env app configuration + if(file_exists(__ENV_PATH__ . '/' . __TEST_ENV__ . __APP_CONF_FILENAME__)) { + \System\Base\ApplicationBase::getInstance()->loadAppConfig( __ENV_PATH__ . '/' . __TEST_ENV__ . __APP_CONF_FILENAME__ ); + } + + if(\Rum::config()->dsn) + { + \Rum::app()->dataAdapter = \System\DB\DataAdapter::create(\Rum::config()->dsn); + } + } + } ?> \ No newline at end of file diff --git a/system/test/testreporter.class.php b/system/test/testreporter.class.php index a0a28a7..a96b548 100644 --- a/system/test/testreporter.class.php +++ b/system/test/testreporter.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Test; use \TextReporter; diff --git a/system/test/unittestcasebase.class.php b/system/test/unittestcasebase.class.php index 03a0454..51d4bff 100644 --- a/system/test/unittestcasebase.class.php +++ b/system/test/unittestcasebase.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Test; diff --git a/system/utils/directorynotfoundexception.class.php b/system/utils/directorynotfoundexception.class.php index 09fcb00..7414470 100644 --- a/system/utils/directorynotfoundexception.class.php +++ b/system/utils/directorynotfoundexception.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Utils; diff --git a/system/utils/directorynotwritableexception.class.php b/system/utils/directorynotwritableexception.class.php index fb3ca2f..87d8498 100644 --- a/system/utils/directorynotwritableexception.class.php +++ b/system/utils/directorynotwritableexception.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Utils; diff --git a/system/utils/file.class.php b/system/utils/file.class.php index e00acb3..d7255ac 100644 --- a/system/utils/file.class.php +++ b/system/utils/file.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Utils; diff --git a/system/utils/fileloadexception.class.php b/system/utils/fileloadexception.class.php index c125fd7..2206f6f 100644 --- a/system/utils/fileloadexception.class.php +++ b/system/utils/fileloadexception.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Utils; diff --git a/system/utils/filenotfoundexception.class.php b/system/utils/filenotfoundexception.class.php index 3094a2b..f33fbdb 100644 --- a/system/utils/filenotfoundexception.class.php +++ b/system/utils/filenotfoundexception.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Utils; diff --git a/system/utils/filenotwritableexception.class.php b/system/utils/filenotwritableexception.class.php index 87f51c1..017f4c8 100644 --- a/system/utils/filenotwritableexception.class.php +++ b/system/utils/filenotwritableexception.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Utils; diff --git a/system/utils/filestream.class.php b/system/utils/filestream.class.php index bf3b450..f73ffcd 100644 --- a/system/utils/filestream.class.php +++ b/system/utils/filestream.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Utils; diff --git a/system/utils/filesystem.class.php b/system/utils/filesystem.class.php index fb16341..239964e 100644 --- a/system/utils/filesystem.class.php +++ b/system/utils/filesystem.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Utils; diff --git a/system/utils/folder.class.php b/system/utils/folder.class.php index e8f34ef..8a6965e 100644 --- a/system/utils/folder.class.php +++ b/system/utils/folder.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Utils; diff --git a/system/utils/ioexception.class.php b/system/utils/ioexception.class.php index 139a48e..92e823e 100644 --- a/system/utils/ioexception.class.php +++ b/system/utils/ioexception.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Utils; use \System\Base\ExceptionBase; diff --git a/system/utils/socketstream.class.php b/system/utils/socketstream.class.php index 27f482f..532c684 100644 --- a/system/utils/socketstream.class.php +++ b/system/utils/socketstream.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Utils; diff --git a/system/utils/streambase.class.php b/system/utils/streambase.class.php index 4ffc4f9..3c97196 100644 --- a/system/utils/streambase.class.php +++ b/system/utils/streambase.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Utils; diff --git a/system/utils/timer.class.php b/system/utils/timer.class.php index f9368ca..2a86ce6 100644 --- a/system/utils/timer.class.php +++ b/system/utils/timer.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Utils; diff --git a/system/validators/booleanvalidator.class.php b/system/validators/booleanvalidator.class.php index 2520b24..6c2bfab 100644 --- a/system/validators/booleanvalidator.class.php +++ b/system/validators/booleanvalidator.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Validators; diff --git a/system/validators/daterangevalidator.class.php b/system/validators/daterangevalidator.class.php new file mode 100644 index 0000000..6f3da90 --- /dev/null +++ b/system/validators/daterangevalidator.class.php @@ -0,0 +1,89 @@ +minDate = $minDate; + $this->maxDate = $maxDate; + } + + + /** + * on load + * + * @return void + */ + protected function onLoad() + { + if($this->controlToValidate) + { + $this->errorMessage = $this->errorMessage?$this->errorMessage:"{$this->controlToValidate->label} " . + \str_replace('%x', ($this->minDate? "after ".$this->minDate : ""), + \str_replace('%y', ($this->maxDate? ($this->minDate? " and ":"")."before ".$this->maxDate : ""), + \System\Base\ApplicationBase::getInstance()->translator->get('date_must_be_within_the_range_of_x_and_y', 'must be %x%y'))); + } + } + + + /** + * sets the controlId and prepares the control attributes + * + * @return void + */ + public function validate() + { + if($this->controlToValidate) + { + $valid_date = strtotime($this->controlToValidate->value)!== false; + $min = $this->minDate? (strtotime($this->controlToValidate->value) >= strtotime($this->minDate)) : true; + $max = $this->maxDate? (strtotime($this->controlToValidate->value) <= strtotime($this->maxDate)) : true; + return !$this->controlToValidate->value || ( $valid_date && $min && $max ); + } + else + { + throw new \System\Base\InvalidOperationException("no control to validate"); + } + } + } +?> \ No newline at end of file diff --git a/system/validators/datetimevalidator.class.php b/system/validators/datetimevalidator.class.php index fc1b46e..9fdd966 100644 --- a/system/validators/datetimevalidator.class.php +++ b/system/validators/datetimevalidator.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Validators; diff --git a/system/validators/emailvalidator.class.php b/system/validators/emailvalidator.class.php index 9c68293..d60da3d 100644 --- a/system/validators/emailvalidator.class.php +++ b/system/validators/emailvalidator.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Validators; diff --git a/system/validators/enumvalidator.class.php b/system/validators/enumvalidator.class.php index e5117c2..434412f 100644 --- a/system/validators/enumvalidator.class.php +++ b/system/validators/enumvalidator.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Validators; diff --git a/system/validators/filesizevalidator.class.php b/system/validators/filesizevalidator.class.php index d18a5cd..b5edd1d 100644 --- a/system/validators/filesizevalidator.class.php +++ b/system/validators/filesizevalidator.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Validators; @@ -20,7 +20,13 @@ class FileSizeValidator extends ValidatorBase { /** - * maxSize + * minimum fileszie + * @var double + */ + private $minSize; + + /** + * maximum fileszie * @var double */ private $maxSize; @@ -29,15 +35,17 @@ class FileSizeValidator extends ValidatorBase /** * FileSizeValidator * - * @param double $maxSize max size + * @param double $maxSize maximum size in Bytes + * @param double $maxSize minimum size in Bytes, defaults to 0 * @param string $errorMessage error message * @return void */ - public function __construct( $maxSize, $errorMessage = '') + public function __construct( $maxSize, $minSize = 0, $errorMessage = '') { parent::__construct($errorMessage); $this->maxSize = (double) $maxSize; + $this->minSize = (double) $minSize; } @@ -66,13 +74,17 @@ public function validate() { if( isset( $_FILES[$this->controlToValidate->getHTMLControlId()] )) { - if( $_FILES[$this->controlToValidate->getHTMLControlId()]['size'] > 0 ) + if( $_FILES[$this->controlToValidate->getHTMLControlId()]['size'] > $this->minSize ) { - if(( ( (int) $this->maxSize * 1024 ) < (int) $_FILES[$this->controlToValidate->getHTMLControlId()]['size'] ) && (int) $this->maxSize > 0 ) + if(( ( (int) $this->maxSize ) < (int) $_FILES[$this->controlToValidate->getHTMLControlId()]['size'] ) && (int) $this->maxSize > 0 ) { return false; } + + return true; } + + return false; } return true; diff --git a/system/validators/filetypevalidator.class.php b/system/validators/filetypevalidator.class.php index 6b33425..992b3b6 100644 --- a/system/validators/filetypevalidator.class.php +++ b/system/validators/filetypevalidator.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Validators; diff --git a/system/validators/integervalidator.class.php b/system/validators/integervalidator.class.php index ab44d69..b6ca9e3 100644 --- a/system/validators/integervalidator.class.php +++ b/system/validators/integervalidator.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Validators; diff --git a/system/validators/lengthvalidator.class.php b/system/validators/lengthvalidator.class.php index 27da2b9..936a877 100644 --- a/system/validators/lengthvalidator.class.php +++ b/system/validators/lengthvalidator.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Validators; diff --git a/system/validators/matchvalidator.class.php b/system/validators/matchvalidator.class.php index 4773886..4b2565c 100644 --- a/system/validators/matchvalidator.class.php +++ b/system/validators/matchvalidator.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Validators; diff --git a/system/validators/numericvalidator.class.php b/system/validators/numericvalidator.class.php index 31b1f02..24bc69d 100644 --- a/system/validators/numericvalidator.class.php +++ b/system/validators/numericvalidator.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Validators; diff --git a/system/validators/patternvalidator.class.php b/system/validators/patternvalidator.class.php index 9a51a9a..95cef1b 100644 --- a/system/validators/patternvalidator.class.php +++ b/system/validators/patternvalidator.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Validators; diff --git a/system/validators/rangevalidator.class.php b/system/validators/rangevalidator.class.php index 5030726..77f64fd 100644 --- a/system/validators/rangevalidator.class.php +++ b/system/validators/rangevalidator.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Validators; diff --git a/system/validators/requiredvalidator.class.php b/system/validators/requiredvalidator.class.php index 7e4ccbf..1f27a80 100644 --- a/system/validators/requiredvalidator.class.php +++ b/system/validators/requiredvalidator.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Validators; diff --git a/system/validators/uniquevalidator.class.php b/system/validators/uniquevalidator.class.php index b814953..57012fa 100644 --- a/system/validators/uniquevalidator.class.php +++ b/system/validators/uniquevalidator.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Validators; diff --git a/system/validators/urlvalidator.class.php b/system/validators/urlvalidator.class.php index e2db551..8f63f8f 100644 --- a/system/validators/urlvalidator.class.php +++ b/system/validators/urlvalidator.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Validators; diff --git a/system/validators/validatorbase.class.php b/system/validators/validatorbase.class.php index db3fda4..a370faf 100644 --- a/system/validators/validatorbase.class.php +++ b/system/validators/validatorbase.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Validators; diff --git a/system/validators/validatorcollection.class.php b/system/validators/validatorcollection.class.php index 4336d71..6288575 100644 --- a/system/validators/validatorcollection.class.php +++ b/system/validators/validatorcollection.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Validators; use \System\Collections\CollectionBase; diff --git a/system/web/controllerbase.class.php b/system/web/controllerbase.class.php index 160af57..9bac381 100644 --- a/system/web/controllerbase.class.php +++ b/system/web/controllerbase.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web; diff --git a/system/web/events/formajaxpostevent.class.php b/system/web/events/formajaxpostevent.class.php index 8e13a14..69219e1 100644 --- a/system/web/events/formajaxpostevent.class.php +++ b/system/web/events/formajaxpostevent.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventBase; diff --git a/system/web/events/formajaxposteventhandler.class.php b/system/web/events/formajaxposteventhandler.class.php index 21ae3f3..7d89abe 100644 --- a/system/web/events/formajaxposteventhandler.class.php +++ b/system/web/events/formajaxposteventhandler.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventHandlerBase; diff --git a/system/web/events/formpostevent.class.php b/system/web/events/formpostevent.class.php index f13c799..a7a9638 100644 --- a/system/web/events/formpostevent.class.php +++ b/system/web/events/formpostevent.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventBase; diff --git a/system/web/events/formposteventhandler.class.php b/system/web/events/formposteventhandler.class.php index 6351d36..107db13 100644 --- a/system/web/events/formposteventhandler.class.php +++ b/system/web/events/formposteventhandler.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventHandlerBase; diff --git a/system/web/events/gridviewchangeorderevent.class.php b/system/web/events/gridviewchangeorderevent.class.php index 86fcf4a..3409cbe 100644 --- a/system/web/events/gridviewchangeorderevent.class.php +++ b/system/web/events/gridviewchangeorderevent.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventBase; diff --git a/system/web/events/gridviewchangeordereventhandler.class.php b/system/web/events/gridviewchangeordereventhandler.class.php index 995a2c8..1a099f2 100644 --- a/system/web/events/gridviewchangeordereventhandler.class.php +++ b/system/web/events/gridviewchangeordereventhandler.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventHandlerBase; diff --git a/system/web/events/gridviewcolumnajaxpostevent.class.php b/system/web/events/gridviewcolumnajaxpostevent.class.php index 9dca83d..d9acb2d 100644 --- a/system/web/events/gridviewcolumnajaxpostevent.class.php +++ b/system/web/events/gridviewcolumnajaxpostevent.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventBase; diff --git a/system/web/events/gridviewcolumnajaxposteventhandler.class.php b/system/web/events/gridviewcolumnajaxposteventhandler.class.php index 01c1459..eb24920 100644 --- a/system/web/events/gridviewcolumnajaxposteventhandler.class.php +++ b/system/web/events/gridviewcolumnajaxposteventhandler.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventHandlerBase; diff --git a/system/web/events/gridviewcolumnpostevent.class.php b/system/web/events/gridviewcolumnpostevent.class.php index d35322f..fd42663 100644 --- a/system/web/events/gridviewcolumnpostevent.class.php +++ b/system/web/events/gridviewcolumnpostevent.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventBase; diff --git a/system/web/events/gridviewcolumnposteventhandler.class.php b/system/web/events/gridviewcolumnposteventhandler.class.php index e6df312..50f6893 100644 --- a/system/web/events/gridviewcolumnposteventhandler.class.php +++ b/system/web/events/gridviewcolumnposteventhandler.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventHandlerBase; diff --git a/system/web/events/gridviewfilterevent.class.php b/system/web/events/gridviewfilterevent.class.php index 6cc1c40..abec019 100644 --- a/system/web/events/gridviewfilterevent.class.php +++ b/system/web/events/gridviewfilterevent.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventBase; diff --git a/system/web/events/gridviewfiltereventhandler.class.php b/system/web/events/gridviewfiltereventhandler.class.php index 9dcf44a..28b2ea9 100644 --- a/system/web/events/gridviewfiltereventhandler.class.php +++ b/system/web/events/gridviewfiltereventhandler.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventHandlerBase; diff --git a/system/web/events/gridviewsortevent.class.php b/system/web/events/gridviewsortevent.class.php index f4113c6..44853f0 100644 --- a/system/web/events/gridviewsortevent.class.php +++ b/system/web/events/gridviewsortevent.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventBase; diff --git a/system/web/events/gridviewsorteventhandler.class.php b/system/web/events/gridviewsorteventhandler.class.php index def4bc1..989b42b 100644 --- a/system/web/events/gridviewsorteventhandler.class.php +++ b/system/web/events/gridviewsorteventhandler.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventHandlerBase; diff --git a/system/web/events/inputajaxchangeevent.class.php b/system/web/events/inputajaxchangeevent.class.php index 7813441..353eb5d 100644 --- a/system/web/events/inputajaxchangeevent.class.php +++ b/system/web/events/inputajaxchangeevent.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventBase; diff --git a/system/web/events/inputajaxchangeeventhandler.class.php b/system/web/events/inputajaxchangeeventhandler.class.php index 8284e52..dc35068 100644 --- a/system/web/events/inputajaxchangeeventhandler.class.php +++ b/system/web/events/inputajaxchangeeventhandler.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventHandlerBase; diff --git a/system/web/events/inputajaxpostevent.class.php b/system/web/events/inputajaxpostevent.class.php index 640ae5d..0012d83 100644 --- a/system/web/events/inputajaxpostevent.class.php +++ b/system/web/events/inputajaxpostevent.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventBase; diff --git a/system/web/events/inputajaxposteventhandler.class.php b/system/web/events/inputajaxposteventhandler.class.php index d56e655..919d20b 100644 --- a/system/web/events/inputajaxposteventhandler.class.php +++ b/system/web/events/inputajaxposteventhandler.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventHandlerBase; diff --git a/system/web/events/inputchangeevent.class.php b/system/web/events/inputchangeevent.class.php index 6428d91..285e44c 100644 --- a/system/web/events/inputchangeevent.class.php +++ b/system/web/events/inputchangeevent.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventBase; diff --git a/system/web/events/inputchangeeventhandler.class.php b/system/web/events/inputchangeeventhandler.class.php index d1279c2..6e7d859 100644 --- a/system/web/events/inputchangeeventhandler.class.php +++ b/system/web/events/inputchangeeventhandler.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventHandlerBase; diff --git a/system/web/events/inputpostevent.class.php b/system/web/events/inputpostevent.class.php index 3accafb..ea84277 100644 --- a/system/web/events/inputpostevent.class.php +++ b/system/web/events/inputpostevent.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventBase; diff --git a/system/web/events/inputposteventhandler.class.php b/system/web/events/inputposteventhandler.class.php index 4b714e4..a03af70 100644 --- a/system/web/events/inputposteventhandler.class.php +++ b/system/web/events/inputposteventhandler.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventHandlerBase; diff --git a/system/web/events/loginformsubmitevent.class.php b/system/web/events/loginformsubmitevent.class.php index 6b96e38..9239a61 100644 --- a/system/web/events/loginformsubmitevent.class.php +++ b/system/web/events/loginformsubmitevent.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventBase; diff --git a/system/web/events/loginformsubmiteventhandler.class.php b/system/web/events/loginformsubmiteventhandler.class.php index ef341c5..ce244cf 100644 --- a/system/web/events/loginformsubmiteventhandler.class.php +++ b/system/web/events/loginformsubmiteventhandler.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventHandlerBase; diff --git a/system/web/events/masterviewinitevent.class.php b/system/web/events/masterviewinitevent.class.php index b3fe3d6..9db0a8a 100644 --- a/system/web/events/masterviewinitevent.class.php +++ b/system/web/events/masterviewinitevent.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventBase; diff --git a/system/web/events/masterviewiniteventhandler.class.php b/system/web/events/masterviewiniteventhandler.class.php index e8e3a55..79adc0e 100644 --- a/system/web/events/masterviewiniteventhandler.class.php +++ b/system/web/events/masterviewiniteventhandler.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventHandlerBase; diff --git a/system/web/events/masterviewloadevent.class.php b/system/web/events/masterviewloadevent.class.php index 08b3cd7..4ac4437 100644 --- a/system/web/events/masterviewloadevent.class.php +++ b/system/web/events/masterviewloadevent.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventBase; diff --git a/system/web/events/masterviewloadeventhandler.class.php b/system/web/events/masterviewloadeventhandler.class.php index 6da58a3..689a65d 100644 --- a/system/web/events/masterviewloadeventhandler.class.php +++ b/system/web/events/masterviewloadeventhandler.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventHandlerBase; diff --git a/system/web/events/pagecontrollercreatepageevent.class.php b/system/web/events/pagecontrollercreatepageevent.class.php index 1bf1092..f4cc772 100644 --- a/system/web/events/pagecontrollercreatepageevent.class.php +++ b/system/web/events/pagecontrollercreatepageevent.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventBase; diff --git a/system/web/events/pagecontrollercreatepageeventhandler.class.php b/system/web/events/pagecontrollercreatepageeventhandler.class.php index 178ec4d..ea82711 100644 --- a/system/web/events/pagecontrollercreatepageeventhandler.class.php +++ b/system/web/events/pagecontrollercreatepageeventhandler.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventHandlerBase; diff --git a/system/web/events/pagepostevent.class.php b/system/web/events/pagepostevent.class.php index 83fab59..27634dc 100644 --- a/system/web/events/pagepostevent.class.php +++ b/system/web/events/pagepostevent.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventBase; diff --git a/system/web/events/pageposteventhandler.class.php b/system/web/events/pageposteventhandler.class.php index 3e27277..5014c0f 100644 --- a/system/web/events/pageposteventhandler.class.php +++ b/system/web/events/pageposteventhandler.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventHandlerBase; diff --git a/system/web/events/pagerequestevent.class.php b/system/web/events/pagerequestevent.class.php index effd20c..de2261d 100644 --- a/system/web/events/pagerequestevent.class.php +++ b/system/web/events/pagerequestevent.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventBase; diff --git a/system/web/events/pagerequesteventhandler.class.php b/system/web/events/pagerequesteventhandler.class.php index dc48122..3e646e3 100644 --- a/system/web/events/pagerequesteventhandler.class.php +++ b/system/web/events/pagerequesteventhandler.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventHandlerBase; diff --git a/system/web/events/reportdetailsevent.class.php b/system/web/events/reportdetailsevent.class.php index 9ceeb3f..be8d239 100644 --- a/system/web/events/reportdetailsevent.class.php +++ b/system/web/events/reportdetailsevent.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventBase; diff --git a/system/web/events/reportdetailseventhandler.class.php b/system/web/events/reportdetailseventhandler.class.php index d711fc6..3ade76f 100644 --- a/system/web/events/reportdetailseventhandler.class.php +++ b/system/web/events/reportdetailseventhandler.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventHandlerBase; diff --git a/system/web/events/reportfooterevent.class.php b/system/web/events/reportfooterevent.class.php index 957b82f..b9c74d6 100644 --- a/system/web/events/reportfooterevent.class.php +++ b/system/web/events/reportfooterevent.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventBase; diff --git a/system/web/events/reportfootereventhandler.class.php b/system/web/events/reportfootereventhandler.class.php index 255c756..68eb7fa 100644 --- a/system/web/events/reportfootereventhandler.class.php +++ b/system/web/events/reportfootereventhandler.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventHandlerBase; diff --git a/system/web/events/reportgroupfooterevent.class.php b/system/web/events/reportgroupfooterevent.class.php index d6c3fd0..d81500e 100644 --- a/system/web/events/reportgroupfooterevent.class.php +++ b/system/web/events/reportgroupfooterevent.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventBase; diff --git a/system/web/events/reportgroupfootereventhandler.class.php b/system/web/events/reportgroupfootereventhandler.class.php index b8ebfbd..c408e16 100644 --- a/system/web/events/reportgroupfootereventhandler.class.php +++ b/system/web/events/reportgroupfootereventhandler.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventHandlerBase; diff --git a/system/web/events/reportgroupheaderevent.class.php b/system/web/events/reportgroupheaderevent.class.php index d531896..2868c87 100644 --- a/system/web/events/reportgroupheaderevent.class.php +++ b/system/web/events/reportgroupheaderevent.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventBase; diff --git a/system/web/events/reportgroupheadereventhandler.class.php b/system/web/events/reportgroupheadereventhandler.class.php index 3b2023b..e1a6cbd 100644 --- a/system/web/events/reportgroupheadereventhandler.class.php +++ b/system/web/events/reportgroupheadereventhandler.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventHandlerBase; diff --git a/system/web/events/reportheaderevent.class.php b/system/web/events/reportheaderevent.class.php index 655bb28..e2c9291 100644 --- a/system/web/events/reportheaderevent.class.php +++ b/system/web/events/reportheaderevent.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventBase; diff --git a/system/web/events/reportheadereventhandler.class.php b/system/web/events/reportheadereventhandler.class.php index a25cba8..375210b 100644 --- a/system/web/events/reportheadereventhandler.class.php +++ b/system/web/events/reportheadereventhandler.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventHandlerBase; diff --git a/system/web/events/webapplicationhandlerequestevent.class.php b/system/web/events/webapplicationhandlerequestevent.class.php index 7fcb27e..8a443a4 100644 --- a/system/web/events/webapplicationhandlerequestevent.class.php +++ b/system/web/events/webapplicationhandlerequestevent.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventBase; diff --git a/system/web/events/webapplicationhandlerequesteventhandler.class.php b/system/web/events/webapplicationhandlerequesteventhandler.class.php index 100134a..89d47c0 100644 --- a/system/web/events/webapplicationhandlerequesteventhandler.class.php +++ b/system/web/events/webapplicationhandlerequesteventhandler.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventHandlerBase; diff --git a/system/web/events/webapplicationloadstateevent.class.php b/system/web/events/webapplicationloadstateevent.class.php index 47064ec..558c1fd 100644 --- a/system/web/events/webapplicationloadstateevent.class.php +++ b/system/web/events/webapplicationloadstateevent.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventBase; diff --git a/system/web/events/webapplicationloadstateeventhandler.class.php b/system/web/events/webapplicationloadstateeventhandler.class.php index 0cbf91b..4622328 100644 --- a/system/web/events/webapplicationloadstateeventhandler.class.php +++ b/system/web/events/webapplicationloadstateeventhandler.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventHandlerBase; diff --git a/system/web/events/webapplicationsavestateevent.class.php b/system/web/events/webapplicationsavestateevent.class.php index 93703b8..d09af1a 100644 --- a/system/web/events/webapplicationsavestateevent.class.php +++ b/system/web/events/webapplicationsavestateevent.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventBase; diff --git a/system/web/events/webapplicationsavestateeventhandler.class.php b/system/web/events/webapplicationsavestateeventhandler.class.php index 7ce36df..aa51168 100644 --- a/system/web/events/webapplicationsavestateeventhandler.class.php +++ b/system/web/events/webapplicationsavestateeventhandler.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventHandlerBase; diff --git a/system/web/events/webcontrolcreateevent.class.php b/system/web/events/webcontrolcreateevent.class.php index 9613bb8..69141c3 100644 --- a/system/web/events/webcontrolcreateevent.class.php +++ b/system/web/events/webcontrolcreateevent.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventBase; diff --git a/system/web/events/webcontrolcreateeventhandler.class.php b/system/web/events/webcontrolcreateeventhandler.class.php index 2f40e5b..ac59754 100644 --- a/system/web/events/webcontrolcreateeventhandler.class.php +++ b/system/web/events/webcontrolcreateeventhandler.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventHandlerBase; diff --git a/system/web/events/webcontrolinitevent.class.php b/system/web/events/webcontrolinitevent.class.php index 18105fc..8337aa3 100644 --- a/system/web/events/webcontrolinitevent.class.php +++ b/system/web/events/webcontrolinitevent.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventBase; diff --git a/system/web/events/webcontroliniteventhandler.class.php b/system/web/events/webcontroliniteventhandler.class.php index 7aaee56..fcd49a4 100644 --- a/system/web/events/webcontroliniteventhandler.class.php +++ b/system/web/events/webcontroliniteventhandler.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventHandlerBase; diff --git a/system/web/events/webcontrolloadevent.class.php b/system/web/events/webcontrolloadevent.class.php index 68fdf3c..de44aa8 100644 --- a/system/web/events/webcontrolloadevent.class.php +++ b/system/web/events/webcontrolloadevent.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventBase; diff --git a/system/web/events/webcontrolloadeventhandler.class.php b/system/web/events/webcontrolloadeventhandler.class.php index 66d68e2..de4803c 100644 --- a/system/web/events/webcontrolloadeventhandler.class.php +++ b/system/web/events/webcontrolloadeventhandler.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventHandlerBase; diff --git a/system/web/events/webcontrolprerenderevent.class.php b/system/web/events/webcontrolprerenderevent.class.php index e370d7c..2a7401f 100644 --- a/system/web/events/webcontrolprerenderevent.class.php +++ b/system/web/events/webcontrolprerenderevent.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventBase; diff --git a/system/web/events/webcontrolprerendereventhandler.class.php b/system/web/events/webcontrolprerendereventhandler.class.php index 1922623..445e0c4 100644 --- a/system/web/events/webcontrolprerendereventhandler.class.php +++ b/system/web/events/webcontrolprerendereventhandler.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Events; use \System\Base\EventHandlerBase; diff --git a/system/web/formmodelbase.class.php b/system/web/formmodelbase.class.php index af8118b..ef62f23 100644 --- a/system/web/formmodelbase.class.php +++ b/system/web/formmodelbase.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web; use System\Base\ModelBase; diff --git a/system/web/forwardmethodtype.class.php b/system/web/forwardmethodtype.class.php index fadb5c8..c80a8d9 100644 --- a/system/web/forwardmethodtype.class.php +++ b/system/web/forwardmethodtype.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web; diff --git a/system/web/httprequest.class.php b/system/web/httprequest.class.php index 1a2049d..7c7749f 100644 --- a/system/web/httprequest.class.php +++ b/system/web/httprequest.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web; diff --git a/system/web/httpresponse.class.php b/system/web/httpresponse.class.php index 193ac67..1246cd1 100644 --- a/system/web/httpresponse.class.php +++ b/system/web/httpresponse.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web; diff --git a/system/web/pagecontrollerbase.class.php b/system/web/pagecontrollerbase.class.php index 27b2818..18c4fc4 100644 --- a/system/web/pagecontrollerbase.class.php +++ b/system/web/pagecontrollerbase.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web; @@ -178,12 +178,12 @@ public function getView( \System\Web\HTTPRequest &$request ) } // include all css files for theme - foreach( glob( \System\Web\WebApplicationBase::getInstance()->config->htdocs . substr( \System\Web\WebApplicationBase::getInstance()->config->themes, strlen( \System\Web\WebApplicationBase::getInstance()->config->uri )) . '/' . $this->theme . "/*.css" ) as $stylesheet ) + foreach( (array)glob( \System\Web\WebApplicationBase::getInstance()->config->htdocs . substr( \System\Web\WebApplicationBase::getInstance()->config->themes, strlen( \System\Web\WebApplicationBase::getInstance()->config->uri )) . '/' . $this->theme . "/*.css" ) as $stylesheet ) { $this->page->addLink( \System\Web\WebApplicationBase::getInstance()->config->themes . '/' . $this->theme . strrchr( $stylesheet, '/' )); } // include all js files for theme - foreach( glob( \System\Web\WebApplicationBase::getInstance()->config->htdocs . substr( \System\Web\WebApplicationBase::getInstance()->config->themes, strlen( \System\Web\WebApplicationBase::getInstance()->config->uri )) . '/' . $this->theme . "/scripts/*.js" ) as $script ) + foreach( (array)glob( \System\Web\WebApplicationBase::getInstance()->config->htdocs . substr( \System\Web\WebApplicationBase::getInstance()->config->themes, strlen( \System\Web\WebApplicationBase::getInstance()->config->uri )) . '/' . $this->theme . "/scripts/*.js" ) as $script ) { $this->page->addScript( \System\Web\WebApplicationBase::getInstance()->config->themes . '/' . $this->theme . '/scripts' . strrchr( $script, '/' )); } @@ -319,8 +319,7 @@ public function getView( \System\Web\HTTPRequest &$request ) $this->page->loadAjaxJScriptBuffer("li.setAttribute('onclick', 'PHPRum.fadeOut(this);this.onclick=null;');"); $this->page->loadAjaxJScriptBuffer("li.style.display='none';"); $this->page->loadAjaxJScriptBuffer("li.innerHTML = '".\str_replace("\n", '', \str_replace("\r", '', \nl2br(\addslashes($msg->message))))."';"); - $this->page->loadAjaxJScriptBuffer("if(ul) ul.appendChild(li);"); - $this->page->loadAjaxJScriptBuffer("PHPRum.fadeIn(document.getElementById('{$id}'));"); + $this->page->loadAjaxJScriptBuffer("if(ul){ul.appendChild(li);PHPRum.fadeIn(document.getElementById('{$id}'));}"); } \System\Web\WebApplicationBase::getInstance()->messages->removeAll(); diff --git a/system/web/services/restwebservicebase.class.php b/system/web/services/restwebservicebase.class.php index 724c8cb..f48fbd7 100644 --- a/system/web/services/restwebservicebase.class.php +++ b/system/web/services/restwebservicebase.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Services; diff --git a/system/web/services/soapwebservicebase.class.php b/system/web/services/soapwebservicebase.class.php index 736b3f3..ca1c715 100644 --- a/system/web/services/soapwebservicebase.class.php +++ b/system/web/services/soapwebservicebase.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Services; diff --git a/system/web/services/webservicebase.class.php b/system/web/services/webservicebase.class.php index ec00843..62407b4 100644 --- a/system/web/services/webservicebase.class.php +++ b/system/web/services/webservicebase.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Services; diff --git a/system/web/services/webservicemethod.class.php b/system/web/services/webservicemethod.class.php index 34686c4..3aa61b1 100644 --- a/system/web/services/webservicemethod.class.php +++ b/system/web/services/webservicemethod.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\Services; diff --git a/system/web/session.class.php b/system/web/session.class.php index c58b8b9..5eb5218 100644 --- a/system/web/session.class.php +++ b/system/web/session.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web; diff --git a/system/web/webapplicationbase.class.php b/system/web/webapplicationbase.class.php index b81ff9f..22ff8b0 100644 --- a/system/web/webapplicationbase.class.php +++ b/system/web/webapplicationbase.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web; use System\Base\ApplicationBase; @@ -721,7 +721,7 @@ protected function handleException(\Exception $e) } } - // bad form, not structured - but the only way to clear the output buffer + // KLUDGE: bad form, not structured @ob_clean(); $response = new \System\Web\HTTPResponse(); @@ -732,9 +732,9 @@ protected function handleException(\Exception $e) Unhandled Exception: ".htmlentities($e->getMessage())." -getPageURI(__MODULE_REQUEST_PARAMETER__, array('id'=>'core', 'type'=>'text/css')) . "&asset=web/exception.css\" rel=\"stylesheet\" type=\"text/css\" media=\"all\" /> -getPageURI(__MODULE_REQUEST_PARAMETER__, array('id'=>'core', 'type'=>'text/css')) . "&asset=web/debug.css\" rel=\"stylesheet\" type=\"text/css\" media=\"all\" /> - +getPageURI(__MODULE_REQUEST_PARAMETER__, array('id'=>'core', 'type'=>'text/css', 'asset'=>'web/exception.css'))) . "\" rel=\"stylesheet\" type=\"text/css\" media=\"all\" /> +getPageURI(__MODULE_REQUEST_PARAMETER__, array('id'=>'core', 'type'=>'text/css', 'asset'=>'web/debug.css'))) . "\" rel=\"stylesheet\" type=\"text/css\" media=\"all\" /> + @@ -765,7 +765,7 @@ protected function handleException(\Exception $e)
    "); - $this->dumpDebug(); + //$this->dumpDebug(); \System\Web\HTTPResponse::write( "
    @@ -787,10 +787,14 @@ protected function handleException(\Exception $e) if($this->requestHandler->isAjaxPostBack) { $content = \System\Web\HTTPResponse::getResponseContent(); + + $content = "Unhandled Exception in " . strrchr( $e->getFile(), '/' ) . "\\nRuntime Error: ".addslashes($e->getMessage())."\\n\\rDescription: An unhandled exception occurred during execution\\n\\rDetails: " . get_class($e) . ": ".addslashes($e->getMessage())."\\n\\rSource File: ".addslashes($filename)." on line: {$line}"; + \System\Web\HTTPResponse::clear(); \System\Web\HTTPResponse::write( " -ExceptionWindow=window.open('', 'Dialog', 'height=800,width=1024,toolbar=no,scrollbars=yes,menubar=no,directories=no,location=no,status=no'); -ExceptionWindow.document.write(\"".addslashes(str_replace(array("\r\n", "\r", "\n"), '', $content))."\")"); +//ExceptionWindow=window.open('', 'Dialog', 'height=800,width=1024,toolbar=no,scrollbars=yes,menubar=no,directories=no,location=no,status=no'); +console.log('".(str_replace("\n", '', str_replace("\r", '', $content)))."'); +"); } } } @@ -976,7 +980,7 @@ private function handleRequestParams( \System\Web\HTTPRequest &$request ) if($request->get["id"]=="build") { $title = "Rebuilding application source files: "; - \System\Base\Build::build(); + \System\Base\Build::rebuild(); } $build = ob_get_clean(); @@ -1128,7 +1132,7 @@ private function dumpDebug( $ttl=0 ) //\System\Web\HTTPResponse::write( "getPageURI('dev', array('id'=>'build','nostyle'=>'1'))."');\">Rebuild source | " ); //\System\Web\HTTPResponse::write( "getPageURI('dev', array('id'=>'run_all','nostyle'=>'1'))."');\">Run all tests | " ); \System\Web\HTTPResponse::write( "Tools | " ); - \System\Web\HTTPResponse::write( "Execution time: " . number_format($elapsed*100, 2) . "ms" ); + \System\Web\HTTPResponse::write( "Execution time: " . number_format($elapsed*1000, 2) . "ms" ); \System\Web\HTTPResponse::write( "" ); \System\Web\HTTPResponse::write( "Running in debug mode | " ); \System\Web\HTTPResponse::write( "Framework version: ".\System\Base\FRAMEWORK_VERSION_STRING . "" ); @@ -1300,7 +1304,12 @@ private function dumpDebug( $ttl=0 ) ob_start(); foreach($this->session->getSessionData() as $key=>$value) { - print("[{$key}] => {$value}\n"); + if(is_array($value)) { + print("[{$key}] => ". serialize($value)."\n"); + } + else { + print("[{$key}] => {$value}\n"); + } } $output = ob_get_clean(); \System\Web\HTTPResponse::write( \Rum::escape( $this->replaceNonPrinting( $output ))); diff --git a/system/web/webcontrols/checkbox.class.php b/system/web/webcontrols/checkbox.class.php index 2413614..e057028 100644 --- a/system/web/webcontrols/checkbox.class.php +++ b/system/web/webcontrols/checkbox.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\WebControls; diff --git a/system/web/webcontrols/checkboxlist.class.php b/system/web/webcontrols/checkboxlist.class.php index fc19caa..58d47eb 100644 --- a/system/web/webcontrols/checkboxlist.class.php +++ b/system/web/webcontrols/checkboxlist.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\WebControls; diff --git a/system/web/webcontrols/dateselector.class.php b/system/web/webcontrols/dateselector.class.php index 77657c1..b743477 100644 --- a/system/web/webcontrols/dateselector.class.php +++ b/system/web/webcontrols/dateselector.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\WebControls; @@ -224,25 +224,33 @@ public function getDomObject() $value=$this->value?strtotime($this->value)?$this->value:date('m/d/y', time()):date('m/d/y', time()); // auto set on date - $select_day->setAttribute( 'onchange', 'getElementById(\'' . $this->getHTMLControlId() . '__null\').checked = true;' ); - $select_month->setAttribute( 'onchange', 'getElementById(\'' . $this->getHTMLControlId() . '__null\').checked = true;' ); - $select_year->setAttribute( 'onchange', 'getElementById(\'' . $this->getHTMLControlId() . '__null\').checked = true;' ); + if($this->allowNull) + { + $select_day->setAttribute( 'onchange', 'getElementById(\'' . $this->getHTMLControlId() . '__null\').checked = true;' ); + $select_month->setAttribute( 'onchange', 'getElementById(\'' . $this->getHTMLControlId() . '__null\').checked = true;' ); + $select_year->setAttribute( 'onchange', 'getElementById(\'' . $this->getHTMLControlId() . '__null\').checked = true;' ); + } // set onchange attribute if( $this->autoPostBack ) { - $select_day->setAttribute( 'onchange', 'getElementById(\'' . $this->getHTMLControlId() . '__null\').checked = true; submit();' ); - $select_month->setAttribute( 'onchange', 'getElementById(\'' . $this->getHTMLControlId() . '__null\').checked = true; submit();' ); - $select_year->setAttribute( 'onchange', 'getElementById(\'' . $this->getHTMLControlId() . '__null\').checked = true; submit();' ); - $null->setAttribute( 'onchange', 'document.getElementById(\''.$this->getParentByType('\System\Web\WebControls\Form')->getHTMLControlId().'\').submit();' ); + $select_day->appendAttribute( 'onchange', 'submit();' ); + $select_month->appendAttribute( 'onchange', 'submit();' ); + $select_year->appendAttribute( 'onchange', 'submit();' ); + $null->setAttribute( 'onchange', 'Rum.id(\''.$this->getParentByType('\System\Web\WebControls\Form')->getHTMLControlId().'\').submit();' ); } - if( $this->ajaxPostBack ) + if( $this->ajaxPostBack || $this->ajaxValidation ) { - $select_day->appendAttribute( 'onchange', $this->ajaxHTTPRequest . ' = PHPRum.sendHttpRequest( \'' . $this->ajaxCallback . '\', \'' . $this->getHTMLControlId().'__post=1&'.$this->getHTMLControlId().'=\'+this.value+\'&'.$this->getRequestData().'\', \'POST\', ' . ( $this->ajaxEventHandler?'\'' . addslashes( (string) $this->ajaxEventHandler ) . '\'':'function() { PHPRum.evalHttpResponse(\''.\addslashes($this->ajaxHTTPRequest).'\') }' ) . ' );' ); - $select_month->appendAttribute( 'onchange', $this->ajaxHTTPRequest . ' = PHPRum.sendHttpRequest( \'' . $this->ajaxCallback . '\', \'' . $this->getHTMLControlId().'__post=1&'.$this->getHTMLControlId().'=\'+this.value+\'&'.$this->getRequestData().'\', \'POST\', ' . ( $this->ajaxEventHandler?'\'' . addslashes( (string) $this->ajaxEventHandler ) . '\'':'function() { PHPRum.evalHttpResponse(\''.\addslashes($this->ajaxHTTPRequest).'\') }' ) . ' );' ); - $select_year->appendAttribute( 'onchange', $this->ajaxHTTPRequest . ' = PHPRum.sendHttpRequest( \'' . $this->ajaxCallback . '\', \'' . $this->getHTMLControlId().'__post=1&'.$this->getHTMLControlId().'=\'+this.value+\'&'.$this->getRequestData().'\', \'POST\', ' . ( $this->ajaxEventHandler?'\'' . addslashes( (string) $this->ajaxEventHandler ) . '\'':'function() { PHPRum.evalHttpResponse(\''.\addslashes($this->ajaxHTTPRequest).'\') }' ) . ' );' ); - $null->appendAttribute( 'onchange', $this->ajaxHTTPRequest . ' = PHPRum.sendHttpRequest( \'' . $this->ajaxCallback . '\', \'' . $this->getHTMLControlId().'__post=1&'.$this->getHTMLControlId().'=\'+this.value+\'&'.$this->getRequestData().'\', \'POST\', ' . ( $this->ajaxEventHandler?'\'' . addslashes( (string) $this->ajaxEventHandler ) . '\'':'function() { PHPRum.evalHttpResponse(\''.\addslashes($this->ajaxHTTPRequest).'\') }' ) . ' );' ); + $js = '\'' . $this->getHTMLControlId() . '__day=\' + getElementById(\'' . $this->getHTMLControlId() . '__day\').value + '; + $js .= '\'&' . $this->getHTMLControlId() . '__month=\' + getElementById(\'' . $this->getHTMLControlId() . '__month\').value + '; + $js .= '\'&' . $this->getHTMLControlId() . '__year=\' + getElementById(\'' . $this->getHTMLControlId() . '__year\').value + '; + if($this->allowNull) $js .= '\'&' . $this->getHTMLControlId() . '__null=\' + getElementById(\'' . $this->getHTMLControlId() . '__null\').value + '; + $js .= '\''; + $select_day->appendAttribute( 'onchange', $this->ajaxHTTPRequest . ' = PHPRum.sendHttpRequest( \'' . $this->ajaxCallback . '\', \'' . $this->getHTMLControlId().'__post=1&\'+'.$js.'+\'&'.$this->getRequestData().'\', \'POST\', ' . ( $this->ajaxEventHandler?'\'' . addslashes( (string) $this->ajaxEventHandler ) . '\'':'function() { PHPRum.evalHttpResponse(\''.\addslashes($this->ajaxHTTPRequest).'\') }' ) . ' );' ); + $select_month->appendAttribute( 'onchange', $this->ajaxHTTPRequest . ' = PHPRum.sendHttpRequest( \'' . $this->ajaxCallback . '\', \'' . $this->getHTMLControlId().'__post=1&\'+'.$js.'+\'&'.$this->getRequestData().'\', \'POST\', ' . ( $this->ajaxEventHandler?'\'' . addslashes( (string) $this->ajaxEventHandler ) . '\'':'function() { PHPRum.evalHttpResponse(\''.\addslashes($this->ajaxHTTPRequest).'\') }' ) . ' );' ); + $select_year->appendAttribute( 'onchange', $this->ajaxHTTPRequest . ' = PHPRum.sendHttpRequest( \'' . $this->ajaxCallback . '\', \'' . $this->getHTMLControlId().'__post=1&\'+'.$js.'+\'&'.$this->getRequestData().'\', \'POST\', ' . ( $this->ajaxEventHandler?'\'' . addslashes( (string) $this->ajaxEventHandler ) . '\'':'function() { PHPRum.evalHttpResponse(\''.\addslashes($this->ajaxHTTPRequest).'\') }' ) . ' );' ); + $null->appendAttribute( 'onchange', $this->ajaxHTTPRequest . ' = PHPRum.sendHttpRequest( \'' . $this->ajaxCallback . '\', \'' . $this->getHTMLControlId().'__post=1&\'+'.$js.'+\'&'.$this->getRequestData().'\', \'POST\', ' . ( $this->ajaxEventHandler?'\'' . addslashes( (string) $this->ajaxEventHandler ) . '\'':'function() { PHPRum.evalHttpResponse(\''.\addslashes($this->ajaxHTTPRequest).'\') }' ) . ' );' ); } // set invalid class diff --git a/system/web/webcontrols/datetimeselector.class.php b/system/web/webcontrols/datetimeselector.class.php index a6d3f9a..76f56ae 100644 --- a/system/web/webcontrols/datetimeselector.class.php +++ b/system/web/webcontrols/datetimeselector.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\WebControls; @@ -253,34 +253,45 @@ public function getDomObject() $value=$this->value?strtotime($this->value)?$this->value:date('m/d/y g:ia', time()):date('m/d/y g:ia', time()); // auto set on date - $select_day->setAttribute( 'onchange', 'getElementById(\'' . $this->getHTMLControlId() . '__null\').checked = true;' ); - $select_month->setAttribute( 'onchange', 'getElementById(\'' . $this->getHTMLControlId() . '__null\').checked = true;' ); - $select_year->setAttribute( 'onchange', 'getElementById(\'' . $this->getHTMLControlId() . '__null\').checked = true;' ); - $select_hour->setAttribute( 'onchange', 'getElementById(\'' . $this->getHTMLControlId() . '__null\').checked = true;' ); - $select_minute->setAttribute( 'onchange', 'getElementById(\'' . $this->getHTMLControlId() . '__null\').checked = true;' ); - $select_meridiem->setAttribute( 'onchange', 'getElementById(\'' . $this->getHTMLControlId() . '__null\').checked = true;' ); + if( $this->allowNull ) + { + $select_day->setAttribute( 'onchange', 'getElementById(\'' . $this->getHTMLControlId() . '__null\').checked = true;' ); + $select_month->setAttribute( 'onchange', 'getElementById(\'' . $this->getHTMLControlId() . '__null\').checked = true;' ); + $select_year->setAttribute( 'onchange', 'getElementById(\'' . $this->getHTMLControlId() . '__null\').checked = true;' ); + $select_hour->setAttribute( 'onchange', 'getElementById(\'' . $this->getHTMLControlId() . '__null\').checked = true;' ); + $select_minute->setAttribute( 'onchange', 'getElementById(\'' . $this->getHTMLControlId() . '__null\').checked = true;' ); + $select_meridiem->setAttribute( 'onchange', 'getElementById(\'' . $this->getHTMLControlId() . '__null\').checked = true;' ); + } // set onchange attribute if( $this->autoPostBack ) { - $select_day->setAttribute( 'onchange', 'getElementById(\'' . $this->getHTMLControlId() . '__null\').checked = true; submit();' ); - $select_month->setAttribute( 'onchange', 'getElementById(\'' . $this->getHTMLControlId() . '__null\').checked = true; submit();' ); - $select_year->setAttribute( 'onchange', 'getElementById(\'' . $this->getHTMLControlId() . '__null\').checked = true; submit();' ); - $select_hour->setAttribute( 'onchange', 'getElementById(\'' . $this->getHTMLControlId() . '__null\').checked = true; submit();' ); - $select_minute->setAttribute( 'onchange', 'getElementById(\'' . $this->getHTMLControlId() . '__null\').checked = true; submit();' ); - $select_meridiem->setAttribute( 'onchange', 'getElementById(\'' . $this->getHTMLControlId() . '__null\').checked = true; submit();' ); - $null->setAttribute( 'onchange', 'document.getElementById(\''.$this->getParentByType('\System\Web\WebControls\Form')->getHTMLControlId().'\').submit();' ); + $select_day->appendAttribute( 'onchange', 'submit();' ); + $select_month->appendAttribute( 'onchange', 'submit();' ); + $select_year->appendAttribute( 'onchange', 'submit();' ); + $select_hour->appendAttribute( 'onchange', 'submit();' ); + $select_minute->appendAttribute( 'onchange', 'submit();' ); + $select_meridiem->appendAttribute( 'onchange', 'submit();' ); + $null->setAttribute( 'onchange', 'Rum.id(\''.$this->getParentByType('\System\Web\WebControls\Form')->getHTMLControlId().'\').submit();' ); } - if( $this->ajaxPostBack ) + if( $this->ajaxPostBack || $this->ajaxValidation ) { - $select_day->appendAttribute( 'onchange', $this->ajaxHTTPRequest . ' = PHPRum.sendHttpRequest( \'' . $this->ajaxCallback . '\', \'' . $this->getHTMLControlId().'__post=1&'.$this->getHTMLControlId().'=\'+this.value+\'&'.$this->getRequestData().'\', \'POST\', ' . ( $this->ajaxEventHandler?'\'' . addslashes( (string) $this->ajaxEventHandler ) . '\'':'function() { PHPRum.evalHttpResponse(\''.\addslashes($this->ajaxHTTPRequest).'\') }' ) . ' );' ); - $select_month->appendAttribute( 'onchange', $this->ajaxHTTPRequest . ' = PHPRum.sendHttpRequest( \'' . $this->ajaxCallback . '\', \'' . $this->getHTMLControlId().'__post=1&'.$this->getHTMLControlId().'=\'+this.value+\'&'.$this->getRequestData().'\', \'POST\', ' . ( $this->ajaxEventHandler?'\'' . addslashes( (string) $this->ajaxEventHandler ) . '\'':'function() { PHPRum.evalHttpResponse(\''.\addslashes($this->ajaxHTTPRequest).'\') }' ) . ' );' ); - $select_year->appendAttribute( 'onchange', $this->ajaxHTTPRequest . ' = PHPRum.sendHttpRequest( \'' . $this->ajaxCallback . '\', \'' . $this->getHTMLControlId().'__post=1&'.$this->getHTMLControlId().'=\'+this.value+\'&'.$this->getRequestData().'\', \'POST\', ' . ( $this->ajaxEventHandler?'\'' . addslashes( (string) $this->ajaxEventHandler ) . '\'':'function() { PHPRum.evalHttpResponse(\''.\addslashes($this->ajaxHTTPRequest).'\') }' ) . ' );' ); - $select_hour->appendAttribute( 'onchange', $this->ajaxHTTPRequest . ' = PHPRum.sendHttpRequest( \'' . $this->ajaxCallback . '\', \'' . $this->getHTMLControlId().'__post=1&'.$this->getHTMLControlId().'=\'+this.value+\'&'.$this->getRequestData().'\', \'POST\', ' . ( $this->ajaxEventHandler?'\'' . addslashes( (string) $this->ajaxEventHandler ) . '\'':'function() { PHPRum.evalHttpResponse(\''.\addslashes($this->ajaxHTTPRequest).'\') }' ) . ' );' ); - $select_minute->appendAttribute( 'onchange', $this->ajaxHTTPRequest . ' = PHPRum.sendHttpRequest( \'' . $this->ajaxCallback . '\', \'' . $this->getHTMLControlId().'__post=1&'.$this->getHTMLControlId().'=\'+this.value+\'&'.$this->getRequestData().'\', \'POST\', ' . ( $this->ajaxEventHandler?'\'' . addslashes( (string) $this->ajaxEventHandler ) . '\'':'function() { PHPRum.evalHttpResponse(\''.\addslashes($this->ajaxHTTPRequest).'\') }' ) . ' );' ); - $select_meridiem->appendAttribute( 'onchange', $this->ajaxHTTPRequest . ' = PHPRum.sendHttpRequest( \'' . $this->ajaxCallback . '\', \'' . $this->getHTMLControlId().'__post=1&'.$this->getHTMLControlId().'=\'+this.value+\'&'.$this->getRequestData().'\', \'POST\', ' . ( $this->ajaxEventHandler?'\'' . addslashes( (string) $this->ajaxEventHandler ) . '\'':'function() { PHPRum.evalHttpResponse(\''.\addslashes($this->ajaxHTTPRequest).'\') }' ) . ' );' ); - $null->appendAttribute( 'onchange', $this->ajaxHTTPRequest . ' = PHPRum.sendHttpRequest( \'' . $this->ajaxCallback . '\', \'' . $this->getHTMLControlId().'__post=1&'.$this->getHTMLControlId().'=\'+this.value+\'&'.$this->getRequestData().'\', \'POST\', ' . ( $this->ajaxEventHandler?'\'' . addslashes( (string) $this->ajaxEventHandler ) . '\'':'function() { PHPRum.evalHttpResponse(\''.\addslashes($this->ajaxHTTPRequest).'\') }' ) . ' );' ); + $js = '\'' . $this->getHTMLControlId() . '__day=\' + getElementById(\'' . $this->getHTMLControlId() . '__day\').value + '; + $js .= '\'&' . $this->getHTMLControlId() . '__month=\' + getElementById(\'' . $this->getHTMLControlId() . '__month\').value + '; + $js .= '\'&' . $this->getHTMLControlId() . '__year=\' + getElementById(\'' . $this->getHTMLControlId() . '__year\').value + '; + $js .= '\'&' . $this->getHTMLControlId() . '__hour=\' + getElementById(\'' . $this->getHTMLControlId() . '__hour\').value + '; + $js .= '\'&' . $this->getHTMLControlId() . '__minute=\' + getElementById(\'' . $this->getHTMLControlId() . '__minute\').value + '; + $js .= '\'&' . $this->getHTMLControlId() . '__meridiem=\' + getElementById(\'' . $this->getHTMLControlId() . '__meridiem\').value + '; + if($this->allowNull) $js .= '\'&' . $this->getHTMLControlId() . '__null=\' + getElementById(\'' . $this->getHTMLControlId() . '__null\').value + '; + $js .= '\''; + $select_day->appendAttribute( 'onchange', $this->ajaxHTTPRequest . ' = PHPRum.sendHttpRequest( \'' . $this->ajaxCallback . '\', \'' . $this->getHTMLControlId().'__post=1&\'+'.$js.'+\'&'.$this->getRequestData().'\', \'POST\', ' . ( $this->ajaxEventHandler?'\'' . addslashes( (string) $this->ajaxEventHandler ) . '\'':'function() { PHPRum.evalHttpResponse(\''.\addslashes($this->ajaxHTTPRequest).'\') }' ) . ' );' ); + $select_month->appendAttribute( 'onchange', $this->ajaxHTTPRequest . ' = PHPRum.sendHttpRequest( \'' . $this->ajaxCallback . '\', \'' . $this->getHTMLControlId().'__post=1&\'+'.$js.'+\'&'.$this->getRequestData().'\', \'POST\', ' . ( $this->ajaxEventHandler?'\'' . addslashes( (string) $this->ajaxEventHandler ) . '\'':'function() { PHPRum.evalHttpResponse(\''.\addslashes($this->ajaxHTTPRequest).'\') }' ) . ' );' ); + $select_year->appendAttribute( 'onchange', $this->ajaxHTTPRequest . ' = PHPRum.sendHttpRequest( \'' . $this->ajaxCallback . '\', \'' . $this->getHTMLControlId().'__post=1&\'+'.$js.'+\'&'.$this->getRequestData().'\', \'POST\', ' . ( $this->ajaxEventHandler?'\'' . addslashes( (string) $this->ajaxEventHandler ) . '\'':'function() { PHPRum.evalHttpResponse(\''.\addslashes($this->ajaxHTTPRequest).'\') }' ) . ' );' ); + $select_hour->appendAttribute( 'onchange', $this->ajaxHTTPRequest . ' = PHPRum.sendHttpRequest( \'' . $this->ajaxCallback . '\', \'' . $this->getHTMLControlId().'__post=1&\'+'.$js.'+\'&'.$this->getRequestData().'\', \'POST\', ' . ( $this->ajaxEventHandler?'\'' . addslashes( (string) $this->ajaxEventHandler ) . '\'':'function() { PHPRum.evalHttpResponse(\''.\addslashes($this->ajaxHTTPRequest).'\') }' ) . ' );' ); + $select_minute->appendAttribute( 'onchange', $this->ajaxHTTPRequest . ' = PHPRum.sendHttpRequest( \'' . $this->ajaxCallback . '\', \'' . $this->getHTMLControlId().'__post=1&\'+'.$js.'+\'&'.$this->getRequestData().'\', \'POST\', ' . ( $this->ajaxEventHandler?'\'' . addslashes( (string) $this->ajaxEventHandler ) . '\'':'function() { PHPRum.evalHttpResponse(\''.\addslashes($this->ajaxHTTPRequest).'\') }' ) . ' );' ); + $select_meridiem->appendAttribute( 'onchange', $this->ajaxHTTPRequest . ' = PHPRum.sendHttpRequest( \'' . $this->ajaxCallback . '\', \'' . $this->getHTMLControlId().'__post=1&\'+'.$js.'+\'&'.$this->getRequestData().'\', \'POST\', ' . ( $this->ajaxEventHandler?'\'' . addslashes( (string) $this->ajaxEventHandler ) . '\'':'function() { PHPRum.evalHttpResponse(\''.\addslashes($this->ajaxHTTPRequest).'\') }' ) . ' );' ); + $null->appendAttribute( 'onchange', $this->ajaxHTTPRequest . ' = PHPRum.sendHttpRequest( \'' . $this->ajaxCallback . '\', \'' . $this->getHTMLControlId().'__post=1&\'+'.$js.'+\'&'.$this->getRequestData().'\', \'POST\', ' . ( $this->ajaxEventHandler?'\'' . addslashes( (string) $this->ajaxEventHandler ) . '\'':'function() { PHPRum.evalHttpResponse(\''.\addslashes($this->ajaxHTTPRequest).'\') }' ) . ' );' ); } // set invalid class diff --git a/system/web/webcontrols/dropdownlist.class.php b/system/web/webcontrols/dropdownlist.class.php index 914e5ed..e819e65 100644 --- a/system/web/webcontrols/dropdownlist.class.php +++ b/system/web/webcontrols/dropdownlist.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\WebControls; diff --git a/system/web/webcontrols/filebrowser.class.php b/system/web/webcontrols/filebrowser.class.php index 97ff6f7..c72b708 100644 --- a/system/web/webcontrols/filebrowser.class.php +++ b/system/web/webcontrols/filebrowser.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\WebControls; @@ -26,8 +26,6 @@ class FileBrowser extends InputBase public function __construct( $controlId ) { parent::__construct( $controlId, '' ); - - $this->addValidator(new \System\Validators\FileSizeValidator(( (int) str_replace( 'M', '', ini_get( 'upload_max_filesize' ))) * 1024)); // 1024 = Kb } @@ -58,9 +56,9 @@ public function getFileRawData() { $info = $this->getFileInfo(); - if( $info['size'] > 0 ) + if( $info['error'] === UPLOAD_ERR_OK ) { - if( $info['error'] === UPLOAD_ERR_OK ) + if( $info['size'] > 0 ) { $fp = fopen( $info['tmp_name'], 'rb' ); if( $fp ) @@ -76,43 +74,43 @@ public function getFileRawData() } else { - if( $info['error'] === UPLOAD_ERR_INI_SIZE ) - { - throw new \System\Base\InvalidOperationException("the uploaded file exceeds the upload_max_filesize directive"); - } - elseif( $info['error'] === UPLOAD_ERR_FORM_SIZE ) - { - throw new \System\Base\InvalidOperationException("the uploaded file exceeds the MAX_FILE_SIZE directive"); - } - elseif( $info['error'] === UPLOAD_ERR_PARTIAL ) - { - throw new \System\Base\InvalidOperationException("the uploaded file was only partially uploaded"); - } - elseif( $info['error'] === UPLOAD_ERR_NO_FILE ) - { - throw new \System\Base\InvalidOperationException("no file was uploaded"); - } - elseif( $info['error'] === UPLOAD_ERR_NO_TMP_DIR ) - { - throw new \System\Base\FileLoadException("missing temporary folder"); - } - elseif( $info['error'] === UPLOAD_ERR_CANT_WRITE ) - { - throw new \System\Base\InvalidOperationException("failed to write file to disk"); - } - elseif( $info['error'] === UPLOAD_ERR_EXTENSION ) - { - throw new \System\Base\InvalidOperationException("file upload stopped by extension"); - } - else - { - throw new \System\Base\InvalidOperationException("unknown file upload failure"); - } + return ''; } } else { - return ''; + if( $info['error'] === UPLOAD_ERR_INI_SIZE ) + { + throw new \System\Base\InvalidOperationException("the uploaded file exceeds the upload_max_filesize directive"); + } + elseif( $info['error'] === UPLOAD_ERR_FORM_SIZE ) + { + throw new \System\Base\InvalidOperationException("the uploaded file exceeds the MAX_FILE_SIZE directive"); + } + elseif( $info['error'] === UPLOAD_ERR_PARTIAL ) + { + throw new \System\Base\InvalidOperationException("the uploaded file was only partially uploaded"); + } + elseif( $info['error'] === UPLOAD_ERR_NO_FILE ) + { + throw new \System\Base\InvalidOperationException("no file was uploaded"); + } + elseif( $info['error'] === UPLOAD_ERR_NO_TMP_DIR ) + { + throw new \System\Base\FileLoadException("missing temporary folder"); + } + elseif( $info['error'] === UPLOAD_ERR_CANT_WRITE ) + { + throw new \System\Base\InvalidOperationException("failed to write file to disk"); + } + elseif( $info['error'] === UPLOAD_ERR_EXTENSION ) + { + throw new \System\Base\InvalidOperationException("file upload stopped by extension"); + } + else + { + throw new \System\Base\InvalidOperationException("unknown file upload failure"); + } } } diff --git a/system/web/webcontrols/gridview.class.php b/system/web/webcontrols/gridview.class.php index 82badaa..9a12f41 100644 --- a/system/web/webcontrols/gridview.class.php +++ b/system/web/webcontrols/gridview.class.php @@ -582,12 +582,13 @@ public function getDomObject() else { // filter DataSet foreach( $this->filters as $column=>$value) { - if(!$value)$value='0'; - if(isset($this->filterValues[$column])) { - $this->_data->filter( $column, '=', $value, true ); - } - else { - $this->_data->filter( $column, 'contains', $value, true ); + if(strlen($value)>0) { + if(isset($this->filterValues[$column])) { + $this->_data->filter( $column, '=', $value, true ); + } + else { + $this->_data->filter( $column, 'contains', $value, true ); + } } } } @@ -1020,12 +1021,14 @@ protected function getRowHeader() // generate sort URL if(( $this->sortBy === $column['DataField'] ) && $this->sortOrder=='asc' ) { - $a->setAttribute( 'href', $this->getQueryString('?'.$this->getHTMLControlId().'__page='.$this->page.'&'.$this->getHTMLControlId().'__sort_by='.rawurlencode($column['DataField']).'&'.$this->getHTMLControlId().'__sort_order=desc' )); + $order = "desc"; } else { - $a->setAttribute( 'href', $this->getQueryString('?'.$this->getHTMLControlId().'__page='.$this->page.'&'.$this->getHTMLControlId().'__sort_by='.rawurlencode($column['DataField']).'&'.$this->getHTMLControlId().'__sort_order=asc' )); + $order = "asc"; } + $a->setAttribute( 'href', $this->getQueryString('?'.$this->getHTMLControlId().'__page='.$this->page.'&'.$this->getHTMLControlId().'__sort_by='.rawurlencode($column['DataField']).'&'.$this->getHTMLControlId().'__sort_order='.$order)); + // add link node to column $th->addChild( $a ); } diff --git a/system/web/webcontrols/gridviewbutton.class.php b/system/web/webcontrols/gridviewbutton.class.php index 64f8451..4a6236e 100644 --- a/system/web/webcontrols/gridviewbutton.class.php +++ b/system/web/webcontrols/gridviewbutton.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\WebControls; diff --git a/system/web/webcontrols/gridviewcheckbox.class.php b/system/web/webcontrols/gridviewcheckbox.class.php index 188245f..4db2a65 100644 --- a/system/web/webcontrols/gridviewcheckbox.class.php +++ b/system/web/webcontrols/gridviewcheckbox.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\WebControls; diff --git a/system/web/webcontrols/gridviewdropdownmenu.class.php b/system/web/webcontrols/gridviewdropdownmenu.class.php index 3c4dc93..7eb216d 100644 --- a/system/web/webcontrols/gridviewdropdownmenu.class.php +++ b/system/web/webcontrols/gridviewdropdownmenu.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\WebControls; diff --git a/system/web/webcontrols/gridviewimage.class.php b/system/web/webcontrols/gridviewimage.class.php index b083a7d..a95beba 100644 --- a/system/web/webcontrols/gridviewimage.class.php +++ b/system/web/webcontrols/gridviewimage.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\WebControls; diff --git a/system/web/webcontrols/gridviewlink.class.php b/system/web/webcontrols/gridviewlink.class.php index 06a94be..a6c99e2 100644 --- a/system/web/webcontrols/gridviewlink.class.php +++ b/system/web/webcontrols/gridviewlink.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\WebControls; diff --git a/system/web/webcontrols/gridviewtextbox.class.php b/system/web/webcontrols/gridviewtextbox.class.php index 512378b..1cce42a 100644 --- a/system/web/webcontrols/gridviewtextbox.class.php +++ b/system/web/webcontrols/gridviewtextbox.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\WebControls; diff --git a/system/web/webcontrols/inputbase.class.php b/system/web/webcontrols/inputbase.class.php index 4549023..17d6bdb 100644 --- a/system/web/webcontrols/inputbase.class.php +++ b/system/web/webcontrols/inputbase.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\WebControls; @@ -338,7 +338,8 @@ public function validate(&$errMsg = '', InputBase &$controlToFocus = null) $controlToFocus = $this; } $fail = true; - $errMsg .= $validator->errorMessage . \System\Base\CARAGERETURN; + if($errMsg) $errMsg .= ", "; + $errMsg .= $validator->errorMessage; } } } diff --git a/system/web/webcontrols/listbox.class.php b/system/web/webcontrols/listbox.class.php index 873f4d0..ebbaae1 100644 --- a/system/web/webcontrols/listbox.class.php +++ b/system/web/webcontrols/listbox.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\WebControls; @@ -166,6 +166,7 @@ protected function onUpdateAjax() { $this->getParentByType('\System\Web\WebControls\Page')->loadAjaxJScriptBuffer("document.getElementById('{$this->getHTMLControlId()}').options.add(new Option('{$key}', '{$value}'));"); } + $this->getParentByType('\System\Web\WebControls\Page')->loadAjaxJScriptBuffer("document.getElementById('{$this->getHTMLControlId()}').value='{$this->value}';"); } } ?> \ No newline at end of file diff --git a/system/web/webcontrols/listcontrolbase.class.php b/system/web/webcontrols/listcontrolbase.class.php index 026e41e..a6464a8 100644 --- a/system/web/webcontrols/listcontrolbase.class.php +++ b/system/web/webcontrols/listcontrolbase.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\WebControls; diff --git a/system/web/webcontrols/listitemcollection.class.php b/system/web/webcontrols/listitemcollection.class.php index b6be2a2..7dbceef 100644 --- a/system/web/webcontrols/listitemcollection.class.php +++ b/system/web/webcontrols/listitemcollection.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\WebControls; use \System\Collections\StringDictionary; diff --git a/system/web/webcontrols/loginform.class.php b/system/web/webcontrols/loginform.class.php index b1f64a2..fc5ddc5 100644 --- a/system/web/webcontrols/loginform.class.php +++ b/system/web/webcontrols/loginform.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\WebControls; @@ -389,7 +389,7 @@ protected function onRequest( array &$request ) $ds = $app->dataAdapter->openDataSet( $table['source'] ); } - if( $ds->seek( $table['emailaddress-field'], $this->email->value )) + if( $ds->seek( $table['emailaddress-field'], $this->email->value, 1 )) { $found = true; $url = __PROTOCOL__ . '://' . __HOST__ . $app->getPageURI( $app->config->authenticationFormsLoginPage, array($this->controlId.'_reset'=>$ds[$table['emailaddress-field']], 'e'=>md5($ds[$table['username-field']].$ds[$table['password-field']].time()), 't'=>time()) ); diff --git a/system/web/webcontrols/masterview.class.php b/system/web/webcontrols/masterview.class.php index 10a8053..03278d2 100644 --- a/system/web/webcontrols/masterview.class.php +++ b/system/web/webcontrols/masterview.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\WebControls; diff --git a/system/web/webcontrols/page.class.php b/system/web/webcontrols/page.class.php index 0d21dad..cae4f72 100644 --- a/system/web/webcontrols/page.class.php +++ b/system/web/webcontrols/page.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\WebControls; diff --git a/system/web/webcontrols/radiobutton.class.php b/system/web/webcontrols/radiobutton.class.php index 112ae65..50395a3 100644 --- a/system/web/webcontrols/radiobutton.class.php +++ b/system/web/webcontrols/radiobutton.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\WebControls; diff --git a/system/web/webcontrols/radiobuttonlist.class.php b/system/web/webcontrols/radiobuttonlist.class.php index 78ca287..fba6c56 100644 --- a/system/web/webcontrols/radiobuttonlist.class.php +++ b/system/web/webcontrols/radiobuttonlist.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\WebControls; diff --git a/system/web/webcontrols/radiogroup.class.php b/system/web/webcontrols/radiogroup.class.php index a4af742..d2d2f36 100644 --- a/system/web/webcontrols/radiogroup.class.php +++ b/system/web/webcontrols/radiogroup.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\WebControls; diff --git a/system/web/webcontrols/reportgroup.class.php b/system/web/webcontrols/reportgroup.class.php index 9911ee8..4e454e9 100644 --- a/system/web/webcontrols/reportgroup.class.php +++ b/system/web/webcontrols/reportgroup.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\WebControls; diff --git a/system/web/webcontrols/reportview.class.php b/system/web/webcontrols/reportview.class.php index 6c12c70..a779906 100644 --- a/system/web/webcontrols/reportview.class.php +++ b/system/web/webcontrols/reportview.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\WebControls; diff --git a/system/web/webcontrols/textarea.class.php b/system/web/webcontrols/textarea.class.php index 19193bf..bc104c5 100644 --- a/system/web/webcontrols/textarea.class.php +++ b/system/web/webcontrols/textarea.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\WebControls; diff --git a/system/web/webcontrols/textbox.class.php b/system/web/webcontrols/textbox.class.php index 9a2bbb4..260bf8d 100644 --- a/system/web/webcontrols/textbox.class.php +++ b/system/web/webcontrols/textbox.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\WebControls; diff --git a/system/web/webcontrols/timeselector.class.php b/system/web/webcontrols/timeselector.class.php index d21bbce..8247346 100644 --- a/system/web/webcontrols/timeselector.class.php +++ b/system/web/webcontrols/timeselector.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\WebControls; @@ -183,25 +183,33 @@ public function getDomObject() $value=$this->value?strtotime($this->value)?$this->value:date('g:ia', time()):date('g:ia', time()); // auto set on date - $select_hour->setAttribute( 'onchange', 'getElementById(\'' . $this->getHTMLControlId() . '__null\').checked = true;' ); - $select_minute->setAttribute( 'onchange', 'getElementById(\'' . $this->getHTMLControlId() . '__null\').checked = true;' ); - $select_meridiem->setAttribute( 'onchange', 'getElementById(\'' . $this->getHTMLControlId() . '__null\').checked = true;' ); + if( $this->allowNull ) + { + $select_hour->setAttribute( 'onchange', 'getElementById(\'' . $this->getHTMLControlId() . '__null\').checked = true;' ); + $select_minute->setAttribute( 'onchange', 'getElementById(\'' . $this->getHTMLControlId() . '__null\').checked = true;' ); + $select_meridiem->setAttribute( 'onchange', 'getElementById(\'' . $this->getHTMLControlId() . '__null\').checked = true;' ); + } // set onchange attribute if( $this->autoPostBack ) { - $select_hour->setAttribute( 'onchange', 'getElementById(\'' . $this->getHTMLControlId() . '__null\').checked = true; submit();' ); - $select_minute->setAttribute( 'onchange', 'getElementById(\'' . $this->getHTMLControlId() . '__null\').checked = true; submit();' ); - $select_meridiem->setAttribute( 'onchange', 'getElementById(\'' . $this->getHTMLControlId() . '__null\').checked = true; submit();' ); - $null->setAttribute( 'onchange', 'document.getElementById(\''.$this->getParentByType('\System\Web\WebControls\Form')->getHTMLControlId().'\').submit();' ); + $select_hour->appendAttribute( 'onchange', 'submit();' ); + $select_minute->appendAttribute( 'onchange', 'submit();' ); + $select_meridiem->appendAttribute( 'onchange', 'submit();' ); + $null->setAttribute( 'onchange', 'Rum.id(\''.$this->getParentByType('\System\Web\WebControls\Form')->getHTMLControlId().'\').submit();' ); } - if( $this->ajaxPostBack ) + if( $this->ajaxPostBack || $this->ajaxValidation ) { - $select_hour->appendAttribute( 'onchange', $this->ajaxHTTPRequest . ' = PHPRum.sendHttpRequest( \'' . $this->ajaxCallback . '\', \'' . $this->getHTMLControlId().'__post=1&'.$this->getHTMLControlId().'=\'+this.value+\'&'.$this->getRequestData().'\', \'POST\', ' . ( $this->ajaxEventHandler?'\'' . addslashes( (string) $this->ajaxEventHandler ) . '\'':'function() { PHPRum.evalHttpResponse(\''.\addslashes($this->ajaxHTTPRequest).'\') }' ) . ' );' ); - $select_minute->appendAttribute( 'onchange', $this->ajaxHTTPRequest . ' = PHPRum.sendHttpRequest( \'' . $this->ajaxCallback . '\', \'' . $this->getHTMLControlId().'__post=1&'.$this->getHTMLControlId().'=\'+this.value+\'&'.$this->getRequestData().'\', \'POST\', ' . ( $this->ajaxEventHandler?'\'' . addslashes( (string) $this->ajaxEventHandler ) . '\'':'function() { PHPRum.evalHttpResponse(\''.\addslashes($this->ajaxHTTPRequest).'\') }' ) . ' );' ); - $select_meridiem->appendAttribute( 'onchange', $this->ajaxHTTPRequest . ' = PHPRum.sendHttpRequest( \'' . $this->ajaxCallback . '\', \'' . $this->getHTMLControlId().'__post=1&'.$this->getHTMLControlId().'=\'+this.value+\'&'.$this->getRequestData().'\', \'POST\', ' . ( $this->ajaxEventHandler?'\'' . addslashes( (string) $this->ajaxEventHandler ) . '\'':'function() { PHPRum.evalHttpResponse(\''.\addslashes($this->ajaxHTTPRequest).'\') }' ) . ' );' ); - $null->appendAttribute( 'onchange', $this->ajaxHTTPRequest . ' = PHPRum.sendHttpRequest( \'' . $this->ajaxCallback . '\', \'' . $this->getHTMLControlId().'__post=1&'.$this->getHTMLControlId().'=\'+this.value+\'&'.$this->getRequestData().'\', \'POST\', ' . ( $this->ajaxEventHandler?'\'' . addslashes( (string) $this->ajaxEventHandler ) . '\'':'function() { PHPRum.evalHttpResponse(\''.\addslashes($this->ajaxHTTPRequest).'\') }' ) . ' );' ); + $js = '\'' . $this->getHTMLControlId() . '__hour=\' + getElementById(\'' . $this->getHTMLControlId() . '__hour\').value + '; + $js .= '\'&' . $this->getHTMLControlId() . '__minute=\' + getElementById(\'' . $this->getHTMLControlId() . '__minute\').value + '; + $js .= '\'&' . $this->getHTMLControlId() . '__meridiem=\' + getElementById(\'' . $this->getHTMLControlId() . '__meridiem\').value + '; + if($this->allowNull) $js .= '\'&' . $this->getHTMLControlId() . '__null=\' + getElementById(\'' . $this->getHTMLControlId() . '__null\').value + '; + $js .= '\''; + $select_hour->appendAttribute( 'onchange', $this->ajaxHTTPRequest . ' = PHPRum.sendHttpRequest( \'' . $this->ajaxCallback . '\', \'' . $this->getHTMLControlId().'__post=1&\'+'.$js.'+\'&'.$this->getRequestData().'\', \'POST\', ' . ( $this->ajaxEventHandler?'\'' . addslashes( (string) $this->ajaxEventHandler ) . '\'':'function() { PHPRum.evalHttpResponse(\''.\addslashes($this->ajaxHTTPRequest).'\') }' ) . ' );' ); + $select_minute->appendAttribute( 'onchange', $this->ajaxHTTPRequest . ' = PHPRum.sendHttpRequest( \'' . $this->ajaxCallback . '\', \'' . $this->getHTMLControlId().'__post=1&\'+'.$js.'+\'&'.$this->getRequestData().'\', \'POST\', ' . ( $this->ajaxEventHandler?'\'' . addslashes( (string) $this->ajaxEventHandler ) . '\'':'function() { PHPRum.evalHttpResponse(\''.\addslashes($this->ajaxHTTPRequest).'\') }' ) . ' );' ); + $select_meridiem->appendAttribute( 'onchange', $this->ajaxHTTPRequest . ' = PHPRum.sendHttpRequest( \'' . $this->ajaxCallback . '\', \'' . $this->getHTMLControlId().'__post=1&\'+'.$js.'+\'&'.$this->getRequestData().'\', \'POST\', ' . ( $this->ajaxEventHandler?'\'' . addslashes( (string) $this->ajaxEventHandler ) . '\'':'function() { PHPRum.evalHttpResponse(\''.\addslashes($this->ajaxHTTPRequest).'\') }' ) . ' );' ); + $null->appendAttribute( 'onchange', $this->ajaxHTTPRequest . ' = PHPRum.sendHttpRequest( \'' . $this->ajaxCallback . '\', \'' . $this->getHTMLControlId().'__post=1&\'+'.$js.'+\'&'.$this->getRequestData().'\', \'POST\', ' . ( $this->ajaxEventHandler?'\'' . addslashes( (string) $this->ajaxEventHandler ) . '\'':'function() { PHPRum.evalHttpResponse(\''.\addslashes($this->ajaxHTTPRequest).'\') }' ) . ' );' ); } // set invalid class diff --git a/system/web/webcontrols/treenode.class.php b/system/web/webcontrols/treenode.class.php index ac46603..b0125f1 100644 --- a/system/web/webcontrols/treenode.class.php +++ b/system/web/webcontrols/treenode.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\WebControls; diff --git a/system/web/webcontrols/treenodecollection.class.php b/system/web/webcontrols/treenodecollection.class.php index 3e2b223..5f49d85 100644 --- a/system/web/webcontrols/treenodecollection.class.php +++ b/system/web/webcontrols/treenodecollection.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\WebControls; use \System\Collections\CollectionBase; diff --git a/system/web/webcontrols/treeview.class.php b/system/web/webcontrols/treeview.class.php index a4493bc..2438912 100644 --- a/system/web/webcontrols/treeview.class.php +++ b/system/web/webcontrols/treeview.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\WebControls; diff --git a/system/web/webcontrols/view.class.php b/system/web/webcontrols/view.class.php index e92f07d..8003d5e 100644 --- a/system/web/webcontrols/view.class.php +++ b/system/web/webcontrols/view.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\WebControls; diff --git a/system/web/webcontrols/webcontrolattributecollection.class.php b/system/web/webcontrols/webcontrolattributecollection.class.php index d534ae5..a643dd0 100644 --- a/system/web/webcontrols/webcontrolattributecollection.class.php +++ b/system/web/webcontrols/webcontrolattributecollection.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\WebControls; use \System\Collections\StringDictionary; diff --git a/system/web/webcontrols/webcontrolbase.class.php b/system/web/webcontrols/webcontrolbase.class.php index 85623fc..81b430b 100644 --- a/system/web/webcontrols/webcontrolbase.class.php +++ b/system/web/webcontrols/webcontrolbase.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\WebControls; @@ -1025,7 +1025,7 @@ private function setEnableViewState($enableViewState = true) $this->enableViewState = (bool)$enableViewState; foreach( $this->controls as $childControl ) { - $childControl->enableViewState = (bool)$enableViewState; + $childControl->setEnableViewState((bool)$enableViewState); } } } diff --git a/system/web/webcontrols/webcontrolcollection.class.php b/system/web/webcontrols/webcontrolcollection.class.php index 46f5e26..0908aba 100644 --- a/system/web/webcontrols/webcontrolcollection.class.php +++ b/system/web/webcontrols/webcontrolcollection.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\Web\WebControls; use \System\Collections\CollectionBase; diff --git a/system/xml/domobject.class.php b/system/xml/domobject.class.php index 09d8e11..0b8237e 100644 --- a/system/xml/domobject.class.php +++ b/system/xml/domobject.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\XML; diff --git a/system/xml/textnode.class.php b/system/xml/textnode.class.php index dac5258..105c4d5 100644 --- a/system/xml/textnode.class.php +++ b/system/xml/textnode.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\XML; diff --git a/system/xml/xmlentity.class.php b/system/xml/xmlentity.class.php index ac15aa4..9c80aeb 100644 --- a/system/xml/xmlentity.class.php +++ b/system/xml/xmlentity.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\XML; use \ArrayAccess; diff --git a/system/xml/xmlentitycollection.class.php b/system/xml/xmlentitycollection.class.php index 9367025..ae5ff35 100644 --- a/system/xml/xmlentitycollection.class.php +++ b/system/xml/xmlentitycollection.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\XML; use \System\Collections\CollectionBase; diff --git a/system/xml/xmlexception.class.php b/system/xml/xmlexception.class.php index 202c1fb..320d48a 100644 --- a/system/xml/xmlexception.class.php +++ b/system/xml/xmlexception.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\XML; use \System\Base\ExceptionBase; diff --git a/system/xml/xmlparser.class.php b/system/xml/xmlparser.class.php index 15295b3..79acb34 100644 --- a/system/xml/xmlparser.class.php +++ b/system/xml/xmlparser.class.php @@ -3,7 +3,7 @@ * @license see /docs/license.txt * @package PHPRum * @author Darnell Shinbine - * @copyright Copyright (c) 2011 + * @copyright Copyright (c) 2015 */ namespace System\XML;