| Current Path : /home/w/u/e/wuectly/www/03cbe/ |
| Current File : /home/w/u/e/wuectly/www/03cbe/database.php.tar |
home/wuectly/www/libraries/joomla/database/database.php 0000604 00000011764 15245570454 0017312 0 ustar 00 <?php
/**
* @package Joomla.Platform
* @subpackage Database
*
* @copyright (C) 2005 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE
*/
defined('JPATH_PLATFORM') or die;
/**
* Database connector class.
*
* @since 1.7.0
* @deprecated 4.0
*/
abstract class JDatabase
{
/**
* Execute the SQL statement.
*
* @return mixed A database cursor resource on success, boolean false on failure.
*
* @since 1.7.0
* @throws RuntimeException
* @deprecated 4.0
*/
public function query()
{
JLog::add('JDatabase::query() is deprecated, use JDatabaseDriver::execute() instead.', JLog::WARNING, 'deprecated');
return $this->execute();
}
/**
* Get a list of available database connectors. The list will only be populated with connectors that both
* the class exists and the static test method returns true. This gives us the ability to have a multitude
* of connector classes that are self-aware as to whether or not they are able to be used on a given system.
*
* @return array An array of available database connectors.
*
* @since 1.7.0
* @deprecated 4.0
*/
public static function getConnectors()
{
JLog::add('JDatabase::getConnectors() is deprecated, use JDatabaseDriver::getConnectors() instead.', JLog::WARNING, 'deprecated');
return JDatabaseDriver::getConnectors();
}
/**
* Gets the error message from the database connection.
*
* @param boolean $escaped True to escape the message string for use in JavaScript.
*
* @return string The error message for the most recent query.
*
* @deprecated 4.0
* @since 1.7.0
*/
public function getErrorMsg($escaped = false)
{
JLog::add('JDatabase::getErrorMsg() is deprecated, use exception handling instead.', JLog::WARNING, 'deprecated');
if ($escaped)
{
return addslashes($this->errorMsg);
}
else
{
return $this->errorMsg;
}
}
/**
* Gets the error number from the database connection.
*
* @return integer The error number for the most recent query.
*
* @since 1.7.0
* @deprecated 4.0
*/
public function getErrorNum()
{
JLog::add('JDatabase::getErrorNum() is deprecated, use exception handling instead.', JLog::WARNING, 'deprecated');
return $this->errorNum;
}
/**
* Method to return a JDatabaseDriver instance based on the given options. There are three global options and then
* the rest are specific to the database driver. The 'driver' option defines which JDatabaseDriver class is
* used for the connection -- the default is 'mysqli'. The 'database' option determines which database is to
* be used for the connection. The 'select' option determines whether the connector should automatically select
* the chosen database.
*
* Instances are unique to the given options and new objects are only created when a unique options array is
* passed into the method. This ensures that we don't end up with unnecessary database connection resources.
*
* @param array $options Parameters to be passed to the database driver.
*
* @return JDatabaseDriver A database object.
*
* @since 1.7.0
* @deprecated 4.0
*/
public static function getInstance($options = array())
{
JLog::add('JDatabase::getInstance() is deprecated, use JDatabaseDriver::getInstance() instead.', JLog::WARNING, 'deprecated');
return JDatabaseDriver::getInstance($options);
}
/**
* Splits a string of multiple queries into an array of individual queries.
*
* @param string $query Input SQL string with which to split into individual queries.
*
* @return array The queries from the input string separated into an array.
*
* @since 1.7.0
* @deprecated 4.0
*/
public static function splitSql($query)
{
JLog::add('JDatabase::splitSql() is deprecated, use JDatabaseDriver::splitSql() instead.', JLog::WARNING, 'deprecated');
return JDatabaseDriver::splitSql($query);
}
/**
* Return the most recent error message for the database connector.
*
* @param boolean $showSQL True to display the SQL statement sent to the database as well as the error.
*
* @return string The error message for the most recent query.
*
* @since 1.7.0
* @deprecated 4.0
*/
public function stderr($showSQL = false)
{
JLog::add('JDatabase::stderr() is deprecated.', JLog::WARNING, 'deprecated');
if ($this->errorNum != 0)
{
return JText::sprintf('JLIB_DATABASE_ERROR_FUNCTION_FAILED', $this->errorNum, $this->errorMsg)
. ($showSQL ? "<br />SQL = <pre>$this->sql</pre>" : '');
}
else
{
return JText::_('JLIB_DATABASE_FUNCTION_NOERROR');
}
}
/**
* Test to see if the connector is available.
*
* @return boolean True on success, false otherwise.
*
* @since 1.7.0
* @deprecated 4.0 - Use JDatabaseDriver::isSupported() instead.
*/
public static function test()
{
JLog::add('JDatabase::test() is deprecated. Use JDatabaseDriver::isSupported() instead.', JLog::WARNING, 'deprecated');
return static::isSupported();
}
}
home/wuectly/www/libraries/f0f/database/database.php 0000604 00000013364 15245603161 0016472 0 ustar 00 <?php
/**
* @package FrameworkOnFramework
* @subpackage database
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*
* This file is adapted from the Joomla! Platform. It is used to iterate a database cursor returning F0FTable objects
* instead of plain stdClass objects
*/
// Protect from unauthorized access
defined('F0F_INCLUDED') or die;
/**
* Database connector class.
*
* @since 11.1
* @deprecated 13.3 (Platform) & 4.0 (CMS)
*/
abstract class F0FDatabase
{
/**
* Execute the SQL statement.
*
* @return mixed A database cursor resource on success, boolean false on failure.
*
* @since 11.1
* @throws RuntimeException
* @deprecated 13.1 (Platform) & 4.0 (CMS)
*/
public function query()
{
if (class_exists('JLog'))
{
JLog::add('F0FDatabase::query() is deprecated, use F0FDatabaseDriver::execute() instead.', JLog::WARNING, 'deprecated');
}
return $this->execute();
}
/**
* Get a list of available database connectors. The list will only be populated with connectors that both
* the class exists and the static test method returns true. This gives us the ability to have a multitude
* of connector classes that are self-aware as to whether or not they are able to be used on a given system.
*
* @return array An array of available database connectors.
*
* @since 11.1
* @deprecated 13.1 (Platform) & 4.0 (CMS)
*/
public static function getConnectors()
{
if (class_exists('JLog'))
{
JLog::add('F0FDatabase::getConnectors() is deprecated, use F0FDatabaseDriver::getConnectors() instead.', JLog::WARNING, 'deprecated');
}
return F0FDatabaseDriver::getConnectors();
}
/**
* Gets the error message from the database connection.
*
* @param boolean $escaped True to escape the message string for use in JavaScript.
*
* @return string The error message for the most recent query.
*
* @deprecated 13.3 (Platform) & 4.0 (CMS)
* @since 11.1
*/
public function getErrorMsg($escaped = false)
{
if (class_exists('JLog'))
{
JLog::add('F0FDatabase::getErrorMsg() is deprecated, use exception handling instead.', JLog::WARNING, 'deprecated');
}
if ($escaped)
{
return addslashes($this->errorMsg);
}
else
{
return $this->errorMsg;
}
}
/**
* Gets the error number from the database connection.
*
* @return integer The error number for the most recent query.
*
* @since 11.1
* @deprecated 13.3 (Platform) & 4.0 (CMS)
*/
public function getErrorNum()
{
if (class_exists('JLog'))
{
JLog::add('F0FDatabase::getErrorNum() is deprecated, use exception handling instead.', JLog::WARNING, 'deprecated');
}
return $this->errorNum;
}
/**
* Method to return a F0FDatabaseDriver instance based on the given options. There are three global options and then
* the rest are specific to the database driver. The 'driver' option defines which F0FDatabaseDriver class is
* used for the connection -- the default is 'mysqli'. The 'database' option determines which database is to
* be used for the connection. The 'select' option determines whether the connector should automatically select
* the chosen database.
*
* Instances are unique to the given options and new objects are only created when a unique options array is
* passed into the method. This ensures that we don't end up with unnecessary database connection resources.
*
* @param array $options Parameters to be passed to the database driver.
*
* @return F0FDatabaseDriver A database object.
*
* @since 11.1
* @deprecated 13.1 (Platform) & 4.0 (CMS)
*/
public static function getInstance($options = array())
{
if (class_exists('JLog'))
{
JLog::add('F0FDatabase::getInstance() is deprecated, use F0FDatabaseDriver::getInstance() instead.', JLog::WARNING, 'deprecated');
}
return F0FDatabaseDriver::getInstance($options);
}
/**
* Splits a string of multiple queries into an array of individual queries.
*
* @param string $query Input SQL string with which to split into individual queries.
*
* @return array The queries from the input string separated into an array.
*
* @since 11.1
* @deprecated 13.1 (Platform) & 4.0 (CMS)
*/
public static function splitSql($query)
{
if (class_exists('JLog'))
{
JLog::add('F0FDatabase::splitSql() is deprecated, use F0FDatabaseDriver::splitSql() instead.', JLog::WARNING, 'deprecated');
}
return F0FDatabaseDriver::splitSql($query);
}
/**
* Return the most recent error message for the database connector.
*
* @param boolean $showSQL True to display the SQL statement sent to the database as well as the error.
*
* @return string The error message for the most recent query.
*
* @since 11.1
* @deprecated 13.3 (Platform) & 4.0 (CMS)
*/
public function stderr($showSQL = false)
{
if (class_exists('JLog'))
{
JLog::add('F0FDatabase::stderr() is deprecated.', JLog::WARNING, 'deprecated');
}
if ($this->errorNum != 0)
{
return JText::sprintf('JLIB_DATABASE_ERROR_FUNCTION_FAILED', $this->errorNum, $this->errorMsg)
. ($showSQL ? "<br />SQL = <pre>$this->sql</pre>" : '');
}
else
{
return JText::_('JLIB_DATABASE_FUNCTION_NOERROR');
}
}
/**
* Test to see if the connector is available.
*
* @return boolean True on success, false otherwise.
*
* @since 11.1
* @deprecated 12.3 (Platform) & 4.0 (CMS) - Use F0FDatabaseDriver::isSupported() instead.
*/
public static function test()
{
if (class_exists('JLog'))
{
JLog::add('F0FDatabase::test() is deprecated. Use F0FDatabaseDriver::isSupported() instead.', JLog::WARNING, 'deprecated');
}
return static::isSupported();
}
}
home/wuectly/www/libraries/fof/database/database.php 0000604 00000013364 15245653056 0016601 0 ustar 00 <?php
/**
* @package FrameworkOnFramework
* @subpackage database
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*
* This file is adapted from the Joomla! Platform. It is used to iterate a database cursor returning FOFTable objects
* instead of plain stdClass objects
*/
// Protect from unauthorized access
defined('FOF_INCLUDED') or die;
/**
* Database connector class.
*
* @since 11.1
* @deprecated 13.3 (Platform) & 4.0 (CMS)
*/
abstract class FOFDatabase
{
/**
* Execute the SQL statement.
*
* @return mixed A database cursor resource on success, boolean false on failure.
*
* @since 11.1
* @throws RuntimeException
* @deprecated 13.1 (Platform) & 4.0 (CMS)
*/
public function query()
{
if (class_exists('JLog'))
{
JLog::add('FOFDatabase::query() is deprecated, use FOFDatabaseDriver::execute() instead.', JLog::WARNING, 'deprecated');
}
return $this->execute();
}
/**
* Get a list of available database connectors. The list will only be populated with connectors that both
* the class exists and the static test method returns true. This gives us the ability to have a multitude
* of connector classes that are self-aware as to whether or not they are able to be used on a given system.
*
* @return array An array of available database connectors.
*
* @since 11.1
* @deprecated 13.1 (Platform) & 4.0 (CMS)
*/
public static function getConnectors()
{
if (class_exists('JLog'))
{
JLog::add('FOFDatabase::getConnectors() is deprecated, use FOFDatabaseDriver::getConnectors() instead.', JLog::WARNING, 'deprecated');
}
return FOFDatabaseDriver::getConnectors();
}
/**
* Gets the error message from the database connection.
*
* @param boolean $escaped True to escape the message string for use in JavaScript.
*
* @return string The error message for the most recent query.
*
* @deprecated 13.3 (Platform) & 4.0 (CMS)
* @since 11.1
*/
public function getErrorMsg($escaped = false)
{
if (class_exists('JLog'))
{
JLog::add('FOFDatabase::getErrorMsg() is deprecated, use exception handling instead.', JLog::WARNING, 'deprecated');
}
if ($escaped)
{
return addslashes($this->errorMsg);
}
else
{
return $this->errorMsg;
}
}
/**
* Gets the error number from the database connection.
*
* @return integer The error number for the most recent query.
*
* @since 11.1
* @deprecated 13.3 (Platform) & 4.0 (CMS)
*/
public function getErrorNum()
{
if (class_exists('JLog'))
{
JLog::add('FOFDatabase::getErrorNum() is deprecated, use exception handling instead.', JLog::WARNING, 'deprecated');
}
return $this->errorNum;
}
/**
* Method to return a FOFDatabaseDriver instance based on the given options. There are three global options and then
* the rest are specific to the database driver. The 'driver' option defines which FOFDatabaseDriver class is
* used for the connection -- the default is 'mysqli'. The 'database' option determines which database is to
* be used for the connection. The 'select' option determines whether the connector should automatically select
* the chosen database.
*
* Instances are unique to the given options and new objects are only created when a unique options array is
* passed into the method. This ensures that we don't end up with unnecessary database connection resources.
*
* @param array $options Parameters to be passed to the database driver.
*
* @return FOFDatabaseDriver A database object.
*
* @since 11.1
* @deprecated 13.1 (Platform) & 4.0 (CMS)
*/
public static function getInstance($options = array())
{
if (class_exists('JLog'))
{
JLog::add('FOFDatabase::getInstance() is deprecated, use FOFDatabaseDriver::getInstance() instead.', JLog::WARNING, 'deprecated');
}
return FOFDatabaseDriver::getInstance($options);
}
/**
* Splits a string of multiple queries into an array of individual queries.
*
* @param string $query Input SQL string with which to split into individual queries.
*
* @return array The queries from the input string separated into an array.
*
* @since 11.1
* @deprecated 13.1 (Platform) & 4.0 (CMS)
*/
public static function splitSql($query)
{
if (class_exists('JLog'))
{
JLog::add('FOFDatabase::splitSql() is deprecated, use FOFDatabaseDriver::splitSql() instead.', JLog::WARNING, 'deprecated');
}
return FOFDatabaseDriver::splitSql($query);
}
/**
* Return the most recent error message for the database connector.
*
* @param boolean $showSQL True to display the SQL statement sent to the database as well as the error.
*
* @return string The error message for the most recent query.
*
* @since 11.1
* @deprecated 13.3 (Platform) & 4.0 (CMS)
*/
public function stderr($showSQL = false)
{
if (class_exists('JLog'))
{
JLog::add('FOFDatabase::stderr() is deprecated.', JLog::WARNING, 'deprecated');
}
if ($this->errorNum != 0)
{
return JText::sprintf('JLIB_DATABASE_ERROR_FUNCTION_FAILED', $this->errorNum, $this->errorMsg)
. ($showSQL ? "<br />SQL = <pre>$this->sql</pre>" : '');
}
else
{
return JText::_('JLIB_DATABASE_FUNCTION_NOERROR');
}
}
/**
* Test to see if the connector is available.
*
* @return boolean True on success, false otherwise.
*
* @since 11.1
* @deprecated 12.3 (Platform) & 4.0 (CMS) - Use FOFDatabaseDriver::isSupported() instead.
*/
public static function test()
{
if (class_exists('JLog'))
{
JLog::add('FOFDatabase::test() is deprecated. Use FOFDatabaseDriver::isSupported() instead.', JLog::WARNING, 'deprecated');
}
return static::isSupported();
}
}
home/wuectly/www/libraries/joomla/session/storage/database.php 0000604 00000007563 15245663616 0020702 0 ustar 00 <?php
/**
* @package Joomla.Platform
* @subpackage Session
*
* @copyright (C) 2007 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE
*/
defined('JPATH_PLATFORM') or die;
/**
* Database session storage handler for PHP
*
* @link https://www.php.net/manual/en/function.session-set-save-handler.php
* @since 1.7.0
* @deprecated 4.0 The CMS' Session classes will be replaced with the `joomla/session` package
*/
class JSessionStorageDatabase extends JSessionStorage
{
/**
* Read the data for a particular session identifier from the SessionHandler backend.
*
* @param string $id The session identifier.
*
* @return string The session data.
*
* @since 1.7.0
*/
public function read($id)
{
// Get the database connection object and verify its connected.
$db = JFactory::getDbo();
try
{
// Get the session data from the database table.
$query = $db->getQuery(true)
->select($db->quoteName('data'))
->from($db->quoteName('#__session'))
->where($db->quoteName('session_id') . ' = ' . $db->quoteBinary($id));
$db->setQuery($query);
$result = (string) $db->loadResult();
$result = str_replace('\0\0\0', chr(0) . '*' . chr(0), $result);
return $result;
}
catch (RuntimeException $e)
{
return false;
}
}
/**
* Write session data to the SessionHandler backend.
*
* @param string $id The session identifier.
* @param string $data The session data.
*
* @return boolean True on success, false otherwise.
*
* @since 1.7.0
*/
public function write($id, $data)
{
// Get the database connection object and verify its connected.
$db = JFactory::getDbo();
$data = str_replace(chr(0) . '*' . chr(0), '\0\0\0', $data);
try
{
$query = $db->getQuery(true)
->update($db->quoteName('#__session'))
->set($db->quoteName('data') . ' = ' . $db->quote($data))
->set($db->quoteName('time') . ' = ' . time())
->where($db->quoteName('session_id') . ' = ' . $db->quoteBinary($id));
// Try to update the session data in the database table.
$db->setQuery($query);
$db->execute();
/*
* Since $db->execute did not throw an exception, so the query was successful.
* Either the data changed, or the data was identical.
* In either case we are done.
*/
return true;
}
catch (RuntimeException $e)
{
return false;
}
}
/**
* Destroy the data for a particular session identifier in the SessionHandler backend.
*
* @param string $id The session identifier.
*
* @return boolean True on success, false otherwise.
*
* @since 1.7.0
*/
public function destroy($id)
{
// Get the database connection object and verify its connected.
$db = JFactory::getDbo();
try
{
$query = $db->getQuery(true)
->delete($db->quoteName('#__session'))
->where($db->quoteName('session_id') . ' = ' . $db->quoteBinary($id));
// Remove a session from the database.
$db->setQuery($query);
return (boolean) $db->execute();
}
catch (RuntimeException $e)
{
return false;
}
}
/**
* Garbage collect stale sessions from the SessionHandler backend.
*
* @param integer $lifetime The maximum age of a session.
*
* @return boolean True on success, false otherwise.
*
* @since 1.7.0
*/
public function gc($lifetime = 1440)
{
// Get the database connection object and verify its connected.
$db = JFactory::getDbo();
// Determine the timestamp threshold with which to purge old sessions.
$past = time() - $lifetime;
try
{
$query = $db->getQuery(true)
->delete($db->quoteName('#__session'))
->where($db->quoteName('time') . ' < ' . (int) $past);
// Remove expired sessions from the database.
$db->setQuery($query);
return (boolean) $db->execute();
}
catch (RuntimeException $e)
{
return false;
}
}
}
home/wuectly/www/libraries/joomla/model/database.php 0000604 00000002735 15245667577 0016661 0 ustar 00 <?php
/**
* @package Joomla.Platform
* @subpackage Model
*
* @copyright (C) 2012 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE
*/
defined('JPATH_PLATFORM') or die;
use Joomla\Registry\Registry;
/**
* Joomla Platform Database Model Class
*
* @since 3.0.0
* @deprecated 4.0 Use the default MVC library
*/
abstract class JModelDatabase extends JModelBase
{
/**
* The database driver.
*
* @var JDatabaseDriver
* @since 3.0.0
*/
protected $db;
/**
* Instantiate the model.
*
* @param Registry $state The model state.
* @param JDatabaseDriver $db The database adapter.
*
* @since 3.0.0
*/
public function __construct(Registry $state = null, JDatabaseDriver $db = null)
{
parent::__construct($state);
// Setup the model.
$this->db = isset($db) ? $db : $this->loadDb();
}
/**
* Get the database driver.
*
* @return JDatabaseDriver The database driver.
*
* @since 3.0.0
*/
public function getDb()
{
return $this->db;
}
/**
* Set the database driver.
*
* @param JDatabaseDriver $db The database driver.
*
* @return void
*
* @since 3.0.0
*/
public function setDb(JDatabaseDriver $db)
{
$this->db = $db;
}
/**
* Load the database driver.
*
* @return JDatabaseDriver The database driver.
*
* @since 3.0.0
*/
protected function loadDb()
{
return JFactory::getDbo();
}
}