|
From: <red...@us...> - 2013-08-25 20:44:30
|
Revision: 11978
http://sourceforge.net/p/xoops/svn/11978
Author: redheadedrod
Date: 2013-08-25 20:44:25 +0000 (Sun, 25 Aug 2013)
Log Message:
-----------
Changes to files in directory to bring to PSR2 minus namespace.
@package and @category reflect the name of the file minus the extension and capitalized as the class is.
xoopsload.php - added legacy classes to loader list
Xoops/Auth/Xoops.php - changed parameter back to xoopsdatabase.
mysqldatabaseproxy.php & mysqldatabasesafe.php new class files for PSR2.
database/databasefactory.php - fixed bug in connection configuration.
rest were solely PSR2 changes and moving to "official" header.
Modified Paths:
--------------
XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/connection.php
XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/database.php
XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/databasefactory.php
XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/manager.php
XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/mysqldatabase.php
XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/querybuilder.php
XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/sqlutility.php
XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/xoopsload.php
XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/xoops_lib/Xoops/Auth/Xoops.php
Added Paths:
-----------
XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/mysqldatabaseproxy.php
XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/mysqldatabasesafe.php
Modified: XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/connection.php
===================================================================
--- XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/connection.php 2013-08-25 20:43:23 UTC (rev 11977)
+++ XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/connection.php 2013-08-25 20:44:25 UTC (rev 11978)
@@ -1,68 +1,61 @@
<?php
/**
- * Connection wrapper for Doctrine DBAL Connection
- *
- * You may not change or alter any portion of this comment or credits
- * of supporting developers from this source code or any supporting source code
- * which is considered copyrighted (c) material of the original
- * comment or credit authors.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * @category Xoops\Class\Database\XoopsConnection
- * @package Class
- * @subpackage Database
- * @author readheadedrod <red...@ho...>
- * @author Richard Griffith <ri...@ge...>
- * @copyright 2013 The XOOPS Project http://sourceforge.net/projects/xoops/
- * @license http://www.fsf.org/copyleft/gpl.html GNU public license
- * @version $Id: connection.php 10328 2012-12-07 00:56:07Z trabis $
- * @link http://xoops.org
- * @since 1.0
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
-defined('XOOPS_ROOT_PATH') or die('Restricted access');
-
/**
* Connection wrapper for Doctrine DBAL Connection
*
- * @category Xoops\Database\XoopsConnection
- * @package Xoops
+ * PHP version 5.3
+ *
+ * @category Xoops\Database\Connection
+ * @package Connection
* @author readheadedrod <red...@ho...>
* @author Richard Griffith <ri...@ge...>
* @copyright 2013 The XOOPS Project http://sourceforge.net/projects/xoops/
- * @license http://www.fsf.org/copyleft/gpl.html GNU public license
- * @version Release: 1.0
+ * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
+ * @version Release: 2.6
* @link http://xoops.org
- * @since 1.0
+ * @since 2.6.0
*/
class XoopsConnection extends \Doctrine\DBAL\Connection
{
- private $_safe = true;
+ /**
+ * @var bool $safe true means it is safe to update pages or write to database
+ * removed allowedWebChanges as unnecessary. Using this instead.
+ */
+ private $safe = true;
- private $_allowedWebChanges = true;
+ /**
+ * @var bool $force true means force SQL even if safe is not true.
+ */
+ private $force = false;
+
/**
* Initializes a new instance of the Connection class.
*
- * This sets up necissary variables before calling parent constructor
+ * This sets up necessary variables before calling parent constructor
*
* @param array $params Parameters for the driver
* @param Driver $driver The driver to use
* @param Configuration $config The connection configuration
* @param EventManager $eventManager Event manager to use
*/
- public function __construct(array $params,
+ public function __construct(
+ array $params,
\Doctrine\DBAL\Driver\PDOMySql\Driver $driver,
\Doctrine\DBAL\Configuration $config = null,
\Doctrine\Common\EventManager $eventManager = null
) {
- // Not sure if this next line does anything
- $this->allowWebChanges = ($_SERVER['REQUEST_METHOD'] != 'GET');
- if (!defined('XOOPS_DB_PROXY')) {
+ if (!defined('XOOPS_DB_PROXY') || ($_SERVER['REQUEST_METHOD'] != 'GET')) {
$this->safe = true;
} else {
$this->safe = false;
@@ -120,11 +113,8 @@
*
* @return integer The number of affected rows.
*/
- public function updatePrefix($tableName,
- array $data,
- array $identifier,
- array $types = array()
- ) {
+ public function updatePrefix($tableName, array $data, array $identifier, array $types = array())
+ {
$tableName = $this->prefix($tableName);
return $this->update($tableName, $data, $identifier, $types);
}
@@ -162,12 +152,8 @@
$xoopsPreload = XoopsPreload::getInstance();
$xoopsPreload->triggerEvent('core.database.query.start');
try {
- $result = call_user_func_array(
- array('parent', 'query'),
- func_get_args()
- );
- }
- catch (Exception $e) {
+ $result = call_user_func_array(array('parent', 'query'), func_get_args());
+ } catch (Exception $e) {
$result=false;
}
/* if(is_object($result)) {
@@ -176,16 +162,10 @@
$xoopsPreload->triggerEvent('core.database.query.end');
if ($result) {
- $xoopsPreload->triggerEvent(
- 'core.database.query.success',
- (array($sql))
- );
+ $xoopsPreload->triggerEvent('core.database.query.success', (array($sql)));
return $result;
} else {
- $xoopsPreload->triggerEvent(
- 'core.database.query.failure',
- (array($sql, $this))
- );
+ $xoopsPreload->triggerEvent('core.database.query.failure', (array($sql, $this)));
return false;
}
}
@@ -202,9 +182,7 @@
return call_user_func_array(array($this, "queryForce"), func_get_args());
} else {
$sql = ltrim(func_get_arg(0));
- if (!$this->allowedWebChanges
- && strtolower(substr($sql, 0, 6))!= 'select'
- ) {
+ if (!$this->safe && strtolower(substr($sql, 0, 6))!= 'select') {
//trigger_error('Database updates are not allowed
//during processing of a GET request', E_USER_WARNING);
//needs to be replaced with standard error
@@ -252,5 +230,4 @@
{
return new XoopsQueryBuilder($this);
}
-
-}
\ No newline at end of file
+}
Modified: XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/database.php
===================================================================
--- XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/database.php 2013-08-25 20:43:23 UTC (rev 11977)
+++ XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/database.php 2013-08-25 20:44:25 UTC (rev 11978)
@@ -1,44 +1,31 @@
<?php
/**
- * Abstract base class for XOOPS Database access classes
- *
- * You may not change or alter any portion of this comment or credits
- * of supporting developers from this source code or any supporting source code
- * which is considered copyrighted (c) material
- * of the original comment or credit authors.
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * @category Xoops\Class\Database\Database
- * @package Class
- * @subpackage Database
- * @author Kazumi Ono <on...@xo...>
- * @copyright 2013 The XOOPS project http://sourceforge.net/projects/xoops/
- * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
- * @version $Id$
- * @link http://xoops.org
- * @since 1.0.0
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
-defined('XOOPS_ROOT_PATH') or die('Restricted access');
-
/**
* Abstract base class for Database access classes
*
-
+ * PHP version 5.3
+ *
* @category Xoops\Class\Database\Database
- * @package Class
- * @subpackage Database
+ * @package Database
* @author Kazumi Ono <on...@xo...>
* @copyright 2013 The XOOPS project http://sourceforge.net/projects/xoops/
- * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
+ * @version Release:2.6
* @link http://xoops.org
- * @since 1.0.0
+ * @since 2.6.0
* @abstract
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
*/
-abstract class XoopsDatabase // Depreciated with 2.6
+abstract class XoopsDatabase
{
/**
* Database connection
@@ -68,6 +55,7 @@
* @param string $value table prefix
*
* @return this does not return a value
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
*/
public function setPrefix($value)
{
@@ -75,12 +63,15 @@
}
/**
+ * public function prefix($tablename = '')
+ *
* attach the prefix.'_' to a given tablename
* if tablename is empty, only prefix will be returned
*
* @param string $tablename tablename
*
* @return string prefixed tablename, just prefix if tablename is empty
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
*/
public function prefix($tablename = '')
{
@@ -98,10 +89,11 @@
* @param bool $selectdb select the database now?
*
* @return bool successful?
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
* @abstract
+ *
*/
- abstract function connect($selectdb = true);
+ abstract public function connect($selectdb = true);
/**
* generate an ID for a new row
@@ -112,10 +104,10 @@
* @param string $sequence name of the sequence from which to get the next ID
*
* @return int always 0, because mysql has support for autoincrement
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
* @abstract
*/
- abstract function genId($sequence);
+ abstract public function genId($sequence);
/**
* Get a result row as an enumerated array
@@ -123,10 +115,10 @@
* @param resource $result resource to get result from
*
* @return array
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
* @abstract
*/
- abstract function fetchRow($result);
+ abstract public function fetchRow($result);
/**
* Fetch a result row as an associative array
@@ -134,10 +126,10 @@
* @param resource $result resource to get result from
*
* @return array
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
* @abstract
*/
- abstract function fetchArray($result);
+ abstract public function fetchArray($result);
/**
* Fetch a result row as an associative array
@@ -145,9 +137,10 @@
* @param resource $result resource to get result from
*
* @return array
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
+ * @abstract
*/
- abstract function fetchBoth($result);
+ abstract public function fetchBoth($result);
/**
* Fetch a result row as an object
@@ -155,19 +148,19 @@
* @param resource $result resource to get result from
*
* @return object|stdClass
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
* @abstract
*/
- abstract function fetchObject($result);
+ abstract public function fetchObject($result);
/**
* Get the ID generated from the previous INSERT operation
*
* @return int
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
* @abstract
*/
- abstract function getInsertId();
+ abstract public function getInsertId();
/**
* Get number of rows in result
@@ -175,28 +168,28 @@
* @param resource $result the resource containing the number of rows
*
* @return int the number of rows to return
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
* @abstract
*/
- abstract function getRowsNum($result);
+ abstract public function getRowsNum($result);
/**
* Get number of affected rows
*
* @return int
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
* @abstract
*/
- abstract function getAffectedRows();
+ abstract public function getAffectedRows();
/**
* Close MySQL connection
*
* @return void
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
* @abstract
*/
- abstract function close();
+ abstract public function close();
/**
* Free all memory associated with the result identifier result.
@@ -204,20 +197,20 @@
* @param resource $result query result
*
* @return bool TRUE on success or FALSE on failure.
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
* @abstract
*/
- abstract function freeRecordSet($result);
+ abstract public function freeRecordSet($result);
/**
* Returns the text of the error message from previous MySQL operation
*
* @return bool Returns the error text from the last MySQL function,
* or '' (the empty string) if no error occurred.
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
* @abstract
*/
- abstract function error();
+ abstract public function error();
/**
* Returns the numerical value of the error message from previous
@@ -225,10 +218,10 @@
*
* @return int Returns the error number from the last MySQL function
* , or 0 (zero) if no error occurred.
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
* @abstract
*/
- abstract function errno();
+ abstract public function errno();
/**
* Returns escaped string text with single
@@ -237,10 +230,10 @@
* @param string $str unescaped string text
*
* @return string escaped string text with single quotes around
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
* @abstract
*/
- abstract function quoteString($str);
+ abstract public function quoteString($str);
/**
* Quotes a string for use in a query.
@@ -248,10 +241,10 @@
* @param string $string string to quote
*
* @return string
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
* @abstract
*/
- abstract function quote($string);
+ abstract public function quote($string);
/**
* perform a query on the database
@@ -262,10 +255,10 @@
*
* @return bool|resource query result or FALSE if successful
* or TRUE if successful and no result
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
* @abstract
*/
- abstract function queryF($sql, $limit = 0, $start = 0);
+ abstract public function queryF($sql, $limit = 0, $start = 0);
/**
* perform a query
@@ -278,10 +271,10 @@
* @param int $start offset of first record to return
*
* @return this returns nothing
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
* @abstract
*/
- abstract function query($sql, $limit = 0, $start = 0);
+ abstract public function query($sql, $limit = 0, $start = 0);
/**
* perform queries from SQL dump file in a batch
@@ -293,7 +286,7 @@
* @deprecated since version 2.6.0 - alpha 3
* @abstract
*/
- abstract function queryFromFile($file);
+ abstract public function queryFromFile($file);
/**
* Get field name
@@ -302,10 +295,10 @@
* @param int $offset numerical field index
*
* @return string
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
* @abstract
*/
- abstract function getFieldName($result, $offset);
+ abstract public function getFieldName($result, $offset);
/**
* Get field type
@@ -314,10 +307,10 @@
* @param int $offset numerical field index
*
* @return string
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
* @abstract
*/
- abstract function getFieldType($result, $offset);
+ abstract public function getFieldType($result, $offset);
/**
* Get number of fields in result
@@ -325,8 +318,8 @@
* @param resource $result query result
*
* @return int
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
* @abstract
*/
- abstract function getFieldsNum($result);
+ abstract public function getFieldsNum($result);
}
Modified: XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/databasefactory.php
===================================================================
--- XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/databasefactory.php 2013-08-25 20:43:23 UTC (rev 11977)
+++ XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/databasefactory.php 2013-08-25 20:44:25 UTC (rev 11978)
@@ -1,39 +1,28 @@
<?php
/**
- * Factory Class for XOOPS Database
- *
- * You may not change or alter any portion of this comment or credits
- * of supporting developers from this source code or any supporting source code
- * which is considered copyrighted (c) material
- * of the original comment or credit authors.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * @category Xoops\Class\Database\Xoopsdatabasefactory
- * @package Class
- * @subpackage Database
- * @author Kazumi Ono <on...@xo...>
- * @copyright 2013 The XOOPS Project http://sourceforge.net/projects/xoops/
- * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
- * @version $Id$
- * @link http://xoops.org
- * @since 1.0
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
-defined('XOOPS_ROOT_PATH') or die('Restricted access');
-
/**
- * XoopsDatabaseFactory
+ * XoopsDatabaseFactory class
*
- * @category Xoops\Class\Database\Xoopsdatabasefactory
- * @package Kernel
- * @author Kazumi Ono <on...@xo...>
- * @access public
- * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
- * @link http://xoops.org
- * @since 1.0
+ * PHP version 5.3
+ *
+ * @category Xoops\Class\Database\Databasefactory
+ * @package DatabaseFactory
+ * @author Kazumi Ono <on...@xo...>
+ * @author readheadedrod <red...@ho...>
+ * @copyright 2013 The XOOPS project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
+ * @version Release:2.6
+ * @link http://xoops.org
+ * @since 2.6.0
*/
class XoopsDatabaseFactory
@@ -53,7 +42,7 @@
*
* @return XoopsDatabase Reference to the only instance of database class
*/
- static function getDatabaseConnection()
+ public static function getDatabaseConnection()
{
global $xoopsDB;
static $instance;
@@ -70,7 +59,7 @@
'charset' => XOOPS_DB_CHARSET,
'driver' => 'pdo_mysql',
'wrapperClass' => 'XoopsConnection',
- 'driverOptions' => ''
+ 'driverOptions' => array('')
);
$instance
= \Doctrine\DBAL\DriverManager::getConnection(
@@ -108,9 +97,11 @@
*
* @static
* @staticvar XoopsDatabase The only instance of database class
+ *
* @return XoopsDatabase Reference to the only instance of database class
+ * @depreciated do not use for anything. Will be removed when dependencies are removed from installer.
*/
- static function getDatabase()
+ public static function getDatabase()
{
static $database;
if (!isset($database)) {
@@ -127,11 +118,7 @@
unset($database);
$database = new $class();
} else {
- trigger_error(
- 'notrace:Failed to load database of type: ' . XOOPS_DB_TYPE
- . ' in file: ' . __FILE__ . ' at line '
- . __LINE__, E_USER_WARNING
- );
+ trigger_error('notrace:Database Failed in file: ' . __FILE__ . ' at line ' . __LINE__, E_USER_WARNING);
}
}
return $database;
Modified: XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/manager.php
===================================================================
--- XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/manager.php 2013-08-25 20:43:23 UTC (rev 11977)
+++ XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/manager.php 2013-08-25 20:44:25 UTC (rev 11978)
@@ -1,41 +1,27 @@
<?php
/**
- * Database manager for XOOPS
- *
- * You may not change or alter any portion of this comment or credits
- * of supporting developers from this source code or any supporting source code
- * which is considered copyrighted (c) material
- * of the original comment or credit authors.
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * @category Xoops\Class\Database\Manager
- * @package Class
- * @subpackage Database
- * @author Haruki Setoyama <ha...@pl...>
- * @copyright 2013 The XOOPS project http://sourceforge.net/projects/xoops/
- * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
- * @version $Id$
- * @link http://xoops.org
- * @since 1.0.0
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
-defined('XOOPS_ROOT_PATH') or die('Restricted access');
-
/**
* Database manager for XOOPS
*
- * @category Xoops\Class\Database\Manager
- * @package Class
- * @subpackage Database
- * @author Haruki Setoyama <ha...@pl...>
- * @copyright 2013 The XOOPS project http://sourceforge.net/projects/xoops/
- * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
- * @link http://xoops.org
- * @since 1.0.0
- * @abstract
+ * PHP version 5.3
+ *
+ * @category Xoops\Class\Database\Manager
+ * @package Manager
+ * @author Haruki Setoyama <ha...@pl...>
+ * @copyright 2013 The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
+ * @version Release: 2.6
+ * @link http://xoops.org
+ * @since 2.6.0
*/
class XoopsDatabaseManager
@@ -43,12 +29,12 @@
/**
* @var array
*/
- private $_s_tables = array();
+ private $s_tables = array();
/**
* @var array
*/
- private $_f_tables = array();
+ private $f_tables = array();
/**
* @var XoopsDatabase
@@ -392,4 +378,4 @@
}
}
}
-}
\ No newline at end of file
+}
Modified: XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/mysqldatabase.php
===================================================================
--- XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/mysqldatabase.php 2013-08-25 20:43:23 UTC (rev 11977)
+++ XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/mysqldatabase.php 2013-08-25 20:44:25 UTC (rev 11978)
@@ -1,42 +1,32 @@
<?php
/**
- * MySQL access
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+/**
+ * connection to a mysql database - legacy support only
*
- * You may not change or alter any portion of this comment or credits
- * of supporting developers from this source code or any supporting source code
- * which is considered copyrighted (c) material
- * of the original comment or credit authors.
- * This program is distributed in the hope that it will be useful
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * PHP version 5.3
*
- * @category Xoops\Class\Database\XoopsMySQLDatabase
- * @package Class
- * @subpackage Database
+ * @category Xoops\Class\Database\MySQLDatabase
+ * @package MySQLDatabase
* @author Kazumi Ono <on...@xo...>
- * @copyright 2013 The XOOPS project http://sourceforge.net/projects/xoops/
- * @license http://www.fsf.org/copyleft/gpl.html GNU public license
- * @version $Id$
+ * @author readheadedrod <red...@ho...>
+ * @author Richard Griffith <ri...@ge...>
+ * @copyright 2013 The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
+ * @version Release: 2.6
* @link http://xoops.org
- * @since 1.0
+ * @since 2.6.0
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
*
*/
-
-defined('XOOPS_ROOT_PATH') or die('Restricted access');
-
-/**
- * connection to a mysql database
- *
- * @category Xoops\Class\Database\MySQLDatabase
- * @package Xoops
- * @author readheadedrod <red...@ho...>
- * @author Richard Griffith <ri...@ge...>
- * @copyright 2013 The XOOPS Project http://sourceforge.net/projects/xoops/
- * @license http://www.fsf.org/copyleft/gpl.html GNU public license
- * @version Release: 1.0
- * @link http://xoops.org
- * @since 1.0
- */
class XoopsMySQLDatabase extends XoopsDatabase
{
@@ -52,21 +42,21 @@
*
* @var resource
*/
- private $_lastResult;
+ private $lastResult;
/**
* Database connection
*
* @var resource
*/
- private $_connect = false;
+ private $connect = false;
/**
* Database connection
*
* @var resource
*/
- private $_selectdb;
+ private $selectdb;
@@ -77,14 +67,14 @@
* @param bool $selectdb select the database now?
*
* @return bool successful?
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
*/
public function connect($selectdb = true)
{
$this->_connect = (is_object($this->conn));
$this->_selectdb = $selectdb;
$this->allowWebChanges = ($_SERVER['REQUEST_METHOD'] != 'GET');
- return $this->_connect;
+ return $this->connect;
}
@@ -97,7 +87,7 @@
* @param string $sequence name of the sequence from which to get the next ID
*
* @return int always 0, because mysql has support for autoincrement
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
*/
public function genId($sequence)
{
@@ -110,7 +100,7 @@
* @param resource $result resource to get result from
*
* @return array
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
*/
public function fetchRow($result)
{
@@ -126,7 +116,7 @@
* @param resource $result resource to get result from
*
* @return array
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
*/
public function fetchArray($result)
{
@@ -142,7 +132,7 @@
* @param resource $result resource to get result from
*
* @return array
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
*/
public function fetchBoth($result)
{
@@ -158,7 +148,7 @@
* @param resource $result resource to get result from
*
* @return object|stdClass
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
*/
public function fetchObject($result)
{
@@ -172,7 +162,7 @@
* Get the ID generated from the previous INSERT operation
*
* @return int
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
*/
public function getInsertId()
{
@@ -185,7 +175,7 @@
* @param resource $result the resource containing the number of rows
*
* @return int the number of rows to return
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
*/
public function getRowsNum($result)
{
@@ -196,21 +186,21 @@
* Get number of affected rows
*
* @return int
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
*/
public function getAffectedRows()
{
- if (!is_object($this->_lastResult)) {
+ if (!is_object($this->lastResult)) {
return null;
}
- return $this->_lastResult->rowCount();
+ return $this->lastResult->rowCount();
}
/**
* Close MySQL connection
*
* @return void
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
*/
public function close()
{
@@ -223,7 +213,7 @@
* @param resource $result query result
*
* @return bool TRUE on success or FALSE on failure.
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
*/
public function freeRecordSet($result)
{
@@ -235,7 +225,7 @@
*
* @return bool Returns the error text from the last MySQL function,
* or '' (the empty string) if no error occurred.
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
*/
public function error()
{
@@ -248,7 +238,7 @@
*
* @return int Returns the error number from the last MySQL function
* , or 0 (zero) if no error occurred.
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
*/
public function errno()
{
@@ -262,7 +252,7 @@
* @param string $str unescaped string text
*
* @return string escaped string text with single quotes around
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
*/
public function quoteString($str)
{
@@ -275,19 +265,11 @@
* @param string $string string to quote
*
* @return string
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
*/
public function quote($string)
{
- //return $this->conn->quote($string);
- //There was a reason for this longer command but can't recall what it was...
- return str_replace(
- "\\\"", '"', str_replace(
- "\\"",
- '"',
- $this->conn->quote($string)
- )
- );
+ return str_replace("\\\"", '"', str_replace("\\"", '"', $this->conn->quote($string)));
}
/**
@@ -299,7 +281,7 @@
*
* @return bool|resource query result or FALSE if successful
* or TRUE if successful and no result
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
*/
public function queryF($sql, $limit = 0, $start = 0)
{
@@ -313,25 +295,19 @@
$xoopsPreload->triggerEvent('core.database.query.start');
try {
$result = $this->conn->query($sql);
- }
- catch (Exception $e) {
+ } catch (Exception $e) {
$result=false;
}
if (is_object($result)) {
- // Has to be clone or it is reference.
- $this->_lastResult = clone $result;
+ $this->lastResult = clone $result;
}
$xoopsPreload->triggerEvent('core.database.query.end');
if ($result) {
- $xoopsPreload->triggerEvent(
- 'core.database.query.success', (array($sql))
- );
+ $xoopsPreload->triggerEvent('core.database.query.success', (array($sql)));
return $result;
} else {
- $xoopsPreload->triggerEvent(
- 'core.database.query.failure', (array($sql, $this))
- );
+ $xoopsPreload->triggerEvent('core.database.query.failure', (array($sql, $this)));
return false;
}
}
@@ -347,7 +323,7 @@
* @param int $start offset of first record to return
*
* @return this returns nothing
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
*/
public function query($sql, $limit = 0, $start = 0)
{
@@ -360,7 +336,7 @@
*
* @return bool FALSE if failed reading SQL file or TRUE
* if the file has been read and queries executed
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
*/
public function queryFromFile($file)
{
@@ -388,17 +364,14 @@
* @param int $offset numerical field index
*
* @return string
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
*/
public function getFieldName($result, $offset)
{
- try
- {
+ try {
$temp = $result->getColumnMeta($offset);
return $temp['name'];
- }
- catch (PDOException $e)
- {
+ } catch (PDOException $e) {
return null;
}
@@ -411,38 +384,18 @@
* @param int $offset numerical field index
*
* @return string
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
*/
public function getFieldType($result, $offset)
{
- try
- {
+ try {
$temp = ($result->getColumnMeta($offset));
$t = $temp['native_type'];
$temp = (string)(
((($t == 'STRING') || ($t == 'VAR_STRING') ) ? 'string' : '' ) .
- ( (
- in_array(
- $t, array(
- 'TINY',
- 'SHORT',
- 'LONG',
- 'LONGLONG',
- 'INT24')
- )
- )
- ? 'int' : '' ) .
- ( (
- in_array(
- $t, array(
- 'FLOAT',
- 'DOUBLE',
- 'DECIMAL',
- 'NEWDECIMAL')
- )
- )
- ? 'real' : '' ) .
+ ( (in_array($t, array('TINY', 'SHORT', 'LONG', 'LONGLONG', 'INT24'))) ? 'int' : '' ) .
+ ( (in_array($t, array('FLOAT', 'DOUBLE', 'DECIMAL', 'NEWDECIMAL'))) ? 'real' : '' ) .
( ($t == 'TIMESTAMP') ? 'timestamp' : '' ) .
( ($t == 'YEAR') ? 'year' : '') .
( (($t == 'DATE') || ($t == 'NEWDATE') ) ? 'date' : '' ) .
@@ -451,22 +404,11 @@
( ($t == 'ENUM') ? 'enum' : '' ) .
( ($t == 'GEOMETRY') ? 'geometry' : '' ) .
( ($t == 'DATETIME') ? 'datetime' : '' ) .
- ( (
- in_array(
- $t, array(
- 'TINY_BLOB',
- 'BLOB',
- 'MEDIUM_BLOB',
- 'LONG_BLOB' )
- )
- )
- ? 'blob' : '' ) .
+ ( (in_array($t, array('TINY_BLOB', 'BLOB', 'MEDIUM_BLOB', 'LONG_BLOB' ))) ? 'blob' : '' ) .
( ($t == 'NULL') ? 'null' : '' )
);
return $temp;
- }
- catch (PDOException $e)
- {
+ } catch (PDOException $e) {
return null;
}
}
@@ -477,87 +419,10 @@
* @param resource $result query result
*
* @return int
- * @deprecated since version 2.6.0 - alpha 3
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
*/
public function getFieldsNum($result)
{
return $result->columnCount();
}
}
-
-/**
- * Safe Connection to a MySQL database.
- *
- * @category Xoops\Class\Database\XoopsMySQLDatabaseSafe
- * @package Class
- * @subpackage Database
- * @author Kazumi Ono <on...@xo...>
- * @copyright 2013 The XOOPS Project http://sourceforge.net/projects/xoops/
- * @license http://www.fsf.org/copyleft/gpl.html GNU public license
- * @link http://xoops.org
- * @since 1.0
- * @deprecated since version 2.6.0 - alpha 3
- */
-class XoopsMySQLDatabaseSafe extends XoopsMySQLDatabase
-{
- /**
- * perform a query on the database
- *
- * @param string $sql a valid MySQL query
- * @param int $limit number of records to return
- * @param int $start offset of first record to return
- *
- * @return resource query result or FALSE if successful
- * or TRUE if successful and no result
- * @deprecated since version 2.6.0 - alpha 3
- */
- public function query($sql, $limit = 0, $start = 0)
- {
- return $this->queryF($sql, $limit, $start);
- }
-}
-
-/**
- * Read-Only connection to a MySQL database.
- *
- * This class allows only SELECT queries to be performed through its
- * query() method for security reasons.
- *
- * @category Xoops\Class\Database\XoopsMySQLDatabaseProxy
- * @package Class
- * @subpackage Database
- * @author Kazumi Ono <on...@xo...>
- * @copyright 2013 The XOOPS Project http://sourceforge.net/projects/xoops/
- * @license http://www.fsf.org/copyleft/gpl.html GNU public license
- * @link http://xoops.org
- * @since 1.0
- * @deprecated since version 2.6.0 - alpha 3
- */
-class XoopsMySQLDatabaseProxy extends XoopsMySQLDatabase
-{
- /**
- * perform a query on the database
- *
- * this method allows only SELECT queries for safety.
- *
- * @param string $sql a valid MySQL query
- * @param int $limit number of records to return
- * @param int $start offset of first record to return
- *
- * @return resource query result or FALSE if unsuccessful
- * @deprecated since version 2.6.0 - alpha 3
- */
- public function query($sql, $limit = 0, $start = 0)
- {
- $sql = ltrim($sql);
- if (!$this->allowWebChanges && strtolower(substr($sql, 0, 6)) != 'select') {
- trigger_error(
- 'Database updates are not allowed'
- .'during processing of a GET request',
- E_USER_WARNING
- );
- return false;
- }
- return $this->queryF($sql, $limit, $start);
- }
-}
Added: XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/mysqldatabaseproxy.php
===================================================================
--- XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/mysqldatabaseproxy.php (rev 0)
+++ XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/mysqldatabaseproxy.php 2013-08-25 20:44:25 UTC (rev 11978)
@@ -0,0 +1,60 @@
+<?php
+/**
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+/**
+ * Read-Only connection to a MySQL database.
+ *
+ * This class allows only SELECT queries to be performed through its
+ * query() method for security reasons.
+ *
+ * PHP version 5.3
+ *
+ * @category Xoops\Class\Database\MySQLDatabaseProxy
+ * @package MySQLDatabaseProxy
+ * @author Kazumi Ono <on...@xo...>
+ * @author readheadedrod <red...@ho...>
+ * @author Richard Griffith <ri...@ge...>
+ * @copyright 2013 The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
+ * @version Release: 2.6
+ * @link http://xoops.org
+ * @since 2.6.0
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
+ */
+
+class XoopsMySQLDatabaseProxy extends XoopsMySQLDatabase
+{
+ /**
+ * perform a query on the database
+ *
+ * this method allows only SELECT queries for safety.
+ *
+ * @param string $sql a valid MySQL query
+ * @param int $limit number of records to return
+ * @param int $start offset of first record to return
+ *
+ * @return resource query result or FALSE if unsuccessful
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
+ */
+ public function query($sql, $limit = 0, $start = 0)
+ {
+ $sql = ltrim($sql);
+ if (!$this->allowWebChanges && strtolower(substr($sql, 0, 6)) != 'select') {
+ trigger_error(
+ 'Database updates are not allowed'
+ .'during processing of a GET request',
+ E_USER_WARNING
+ );
+ return false;
+ }
+ return $this->queryF($sql, $limit, $start);
+ }
+}
Added: XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/mysqldatabasesafe.php
===================================================================
--- XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/mysqldatabasesafe.php (rev 0)
+++ XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/mysqldatabasesafe.php 2013-08-25 20:44:25 UTC (rev 11978)
@@ -0,0 +1,47 @@
+<?php
+/**
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+
+/**
+ * Safe Connection to a MySQL database.
+ *
+ * PHP version 5.3
+ *
+ * @category Xoops\Class\Database\MySQLDatabaseSafe
+ * @package MySQLDatabaseProxy
+ * @author Kazumi Ono <on...@xo...>
+ * @author readheadedrod <red...@ho...>
+ * @author Richard Griffith <ri...@ge...>
+ * @copyright 2013 The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
+ * @version Release: 2.6
+ * @link http://xoops.org
+ * @since 2.6.0
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
+ */
+class XoopsMySQLDatabaseSafe extends XoopsMySQLDatabase
+{
+ /**
+ * perform a query on the database
+ *
+ * @param string $sql a valid MySQL query
+ * @param int $limit number of records to return
+ * @param int $start offset of first record to return
+ *
+ * @return resource query result or FALSE if successful
+ * or TRUE if successful and no result
+ * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
+ */
+ public function query($sql, $limit = 0, $start = 0)
+ {
+ return $this->queryF($sql, $limit, $start);
+ }
+}
Modified: XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/querybuilder.php
===================================================================
--- XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/querybuilder.php 2013-08-25 20:43:23 UTC (rev 11977)
+++ XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/querybuilder.php 2013-08-25 20:44:25 UTC (rev 11978)
@@ -1,41 +1,28 @@
<?php
/**
- * Connection wrapper for Doctrine DBAL Connection
- *
- * You may not change or alter any portion of this comment or credits
- * of supporting developers from this source code or any supporting source code
- * which is considered copyrighted (c) material
- * of the original comment or credit authors.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * @category Xoops\Class\Database\XoopsQueryBuilder
- * @package Xoops
- * @author readheadedrod <red...@ho...>
- * @author Richard Griffith <ri...@ge...>
- * @copyright 2013 The XOOPS Project http://sourceforge.net/projects/xoops/
- * @license http://www.fsf.org/copyleft/gpl.html GNU public license
- * @version Release: 1.0
- * @link http://xoops.org
- * @since 1.0
-*/
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
-defined('XOOPS_ROOT_PATH') or die('Restricted access');
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
/**
* Connection wrapper for Doctrine DBAL Connection
*
- * @category Xoops\Class\Database\XoopsQueryBuilder
- * @package Xoops
+ * PHP version 5.3
+ *
+ * @category Xoops\Class\Database\QueryBuilder
+ * @package QueryBuilder
* @author readheadedrod <red...@ho...>
* @author Richard Griffith <ri...@ge...>
* @copyright 2013 The XOOPS Project http://sourceforge.net/projects/xoops/
* @license http://www.fsf.org/copyleft/gpl.html GNU public license
- * @version Release: 1.0
+ * @version Release: 2.6.0
* @link http://xoops.org
- * @since 1.0
+ * @since 2.6.0
*/
class XoopsQueryBuilder extends \Doctrine\DBAL\Query\QueryBuilder
{
Modified: XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/sqlutility.php
===================================================================
--- XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/sqlutility.php 2013-08-25 20:43:23 UTC (rev 11977)
+++ XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/sqlutility.php 2013-08-25 20:44:25 UTC (rev 11978)
@@ -1,41 +1,30 @@
<?php
+
/**
- * Abstract base class for XOOPS Database access classes
- *
- * You may not change or alter any portion of this comment or credits
- * of supporting developers from this source code or any supporting source code
- * which is considered copyrighted (c) material
- * of the original comment or credit authors.
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * @category Xoops\Class\Database\Sqluntility
- * @package Class
- * @subpackage Database
- * @author Kazumi Ono <on...@xo...>
- * @copyright 2013 The XOOPS project http://sourceforge.net/projects/xoops/
- * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
- * @version $Id$
- * @link http://xoops.org
- * @since 1.0.0
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
-defined('XOOPS_ROOT_PATH') or die('Restricted access');
-
/**
* provide some utility methods for databases
*
- * @category Xoops\Class\Database\Sqluntility
- * @package Class
- * @subpackage Database
- * @author Kazumi Ono <on...@xo...>
- * @copyright 2013 The XOOPS project http://sourceforge.net/projects/xoops/
- * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
- * @link http://xoops.org
- * @since 1.0.0
+ * PHP version 5.3
+ *
+ * @category Xoops\Class\Database\SqlUtility
+ * @package SqlUtility
+ * @author Kazumi Ono <on...@xo...>
+ * @copyright 2013 The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license http://www.fsf.org/copyleft/gpl.html GNU public license
+ * @version Release: 2.6.0
+ * @link http://xoops.org
+ * @since 2.6.0
*/
+
class SqlUtility
{
/**
@@ -51,7 +40,7 @@
* @return bool always true
* @access public
*/
- static function splitMySqlFile(&$ret, $sql)
+ public static function splitMySqlFile(&$ret, $sql)
{
$sql = trim($sql);
$sql_len = strlen($sql);
@@ -134,7 +123,7 @@
*
* @return mixed FALSE on failure
*/
- static function prefixQuery($query, $prefix)
+ public static function prefixQuery($query, $prefix)
{
$pattern = "/^(INSERT[\s]+INTO|CREATE[\s]+TABLE|ALTER[\s]+TABLE|UPDATE)(\s)+([`]?)([^`\s]+)\\3(\s)+/siU";
$pattern2 = "/^(DROP TABLE)(\s)+([`]?)([^`\s]+)\\3(\s)?$/siU";
Modified: XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/xoopsload.php
===================================================================
--- XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/xoopsload.php 2013-08-25 20:43:23 UTC (rev 11977)
+++ XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/xoopsload.php 2013-08-25 20:44:25 UTC (rev 11978)
@@ -267,6 +267,9 @@
'xoopsdatabasefactory' => XOOPS_ROOT_PATH . '/class/database/databasefactory.php',
'xoopsdatabasemanager' => XOOPS_ROOT_PATH . '/class/database/manager.php',
'xoopsdownloader' => XOOPS_ROOT_PATH . '/class/downloader.php',
+ 'xoopsmysqldatabase' => XOOPS_ROOT_PATH . '/class/database/mysqldatabase.php',
+ 'xoopsmysqldatabaseproxy' => XOOPS_ROOT_PATH . '/class/database/mysqldatabaseproxy.php',
+ 'xoopsmysqldatabasesafe' => XOOPS_ROOT_PATH . '/class/database/mysqldatabasesafe.php',
'xoopsgroup' => XOOPS_ROOT_PATH . '/kernel/group.php',
'xoopsgrouphandler' => XOOPS_ROOT_PATH . '/kernel/group.php',
'xoopsgroupperm' => XOOPS_ROOT_PATH . '/kernel/groupperm.php',
Modified: XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/xoops_lib/Xoops/Auth/Xoops.php
===================================================================
--- XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/xoops_lib/Xoops/Auth/Xoops.php 2013-08-25 20:43:23 UTC (rev 11977)
+++ XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/xoops_lib/Xoops/Auth/Xoops.php 2013-08-25 20:44:25 UTC (rev 11978)
@@ -36,9 +36,9 @@
/**
* Authentication Service constructor
*
- * @param object|null $dao currently unused in this class
+ * @param XoopsConnection|null $dao
*/
- public function __construct($dao = null)
+ public function __construct(XoopsDatabase $dao = null)
{
$this->_dao = $dao;
$this->auth_method = 'xoops';
@@ -47,9 +47,8 @@
/**
* Authenticate user
*
- * @param string $uname user name
- * @param string $pwd password
- *
+ * @param string $uname
+ * @param string $pwd
* @return bool
*/
public function authenticate($uname, $pwd = null)
|