Author: acydburn
Date: Thu Dec 11 17:40:32 2008
New Revision: 9186
Log:
with these commits at least the index page should fully load without errors (only mysqli supported)
Modified:
branches/acydburn/phpBB/common.php
branches/acydburn/phpBB/download/file.php
branches/acydburn/phpBB/includes/acm/acm_file.php
branches/acydburn/phpBB/includes/acm/acm_xcache.php
branches/acydburn/phpBB/includes/acp/acp_styles.php
branches/acydburn/phpBB/includes/auth/auth_apache.php
branches/acydburn/phpBB/includes/classes/cache.php
branches/acydburn/phpBB/includes/classes/template.php
branches/acydburn/phpBB/includes/classes/template_compile.php
branches/acydburn/phpBB/includes/core/core_request.php
branches/acydburn/phpBB/includes/core/index.php
branches/acydburn/phpBB/includes/core/init.php
branches/acydburn/phpBB/includes/db/mysqli.php
branches/acydburn/phpBB/includes/functions.php
branches/acydburn/phpBB/includes/functions_content.php
branches/acydburn/phpBB/includes/functions_display.php
branches/acydburn/phpBB/includes/functions_posting.php
branches/acydburn/phpBB/includes/functions_user.php
branches/acydburn/phpBB/includes/mcp/mcp_forum.php
branches/acydburn/phpBB/includes/mcp/mcp_post.php
branches/acydburn/phpBB/includes/mcp/mcp_queue.php
branches/acydburn/phpBB/includes/mcp/mcp_reports.php
branches/acydburn/phpBB/includes/mcp/mcp_topic.php
branches/acydburn/phpBB/index.php
branches/acydburn/phpBB/install/install_update.php
branches/acydburn/phpBB/language/en/common.php
branches/acydburn/phpBB/memberlist.php
branches/acydburn/phpBB/plugins/ucp/ucp_pm_viewfolder.php
branches/acydburn/phpBB/plugins/ucp/ucp_pm_viewmessage.php
branches/acydburn/phpBB/search.php
branches/acydburn/phpBB/style.php
branches/acydburn/phpBB/viewforum.php
branches/acydburn/phpBB/viewtopic.php
Modified: branches/acydburn/phpBB/common.php
==============================================================================
*** branches/acydburn/phpBB/common.php (original)
--- branches/acydburn/phpBB/common.php Thu Dec 11 17:40:32 2008
***************
*** 86,94 ****
// Register Cache Manager (SPL autoload test) - we define no classes
phpbb::register('acm');
// For example, data handling with xcache and sql handling within the cache-directory
phpbb::$acm->register('sql');
! phpbb::$acm->register('data', false, 'xcache');
// Grab global variables
phpbb_cache::obtain_config();
--- 86,98 ----
// Register Cache Manager (SPL autoload test) - we define no classes
phpbb::register('acm');
+ // Grab global variables
+ phpbb_cache::obtain_config();
+
+ /*
// For example, data handling with xcache and sql handling within the cache-directory
phpbb::$acm->register('sql');
! //phpbb::$acm->register('data', false, 'xcache');
// Grab global variables
phpbb_cache::obtain_config();
***************
*** 118,138 ****
echo ";".phpbb::call('target_db')->sql_layer.";";
exit;
// Register Template
phpbb::register('template');
! /*
// Register permission class
phpbb::register('acl');
// Register user object
phpbb::register('user');
// Instantiate bare-bone user object
! // Start session management
! phpbb::$user->init();
// Within the user-facing files we call:
//phpbb::$user->start();
! */
?>
\ No newline at end of file
--- 122,155 ----
echo ";".phpbb::call('target_db')->sql_layer.";";
exit;
+ */
// Register Template
phpbb::register('template');
!
// Register permission class
phpbb::register('acl');
// Register user object
phpbb::register('user');
+ /* Add own hook handler, if present. :o
+ phpbb::register('hooks');
+
+ foreach (phpbb_cache::obtain_hooks() as $hook)
+ {
+ @include(PHPBB_ROOT_PATH . 'includes/hooks/' . $hook . '.' . PHP_EXT);
+ }*/
+
// Instantiate bare-bone user object
! // Start session management, inits ACL class too
! // User->init is a collection of phpbb::$user->session_begin() and phpbb::$auth->acl()
! if (PHPBB_FRAMEWORK_FULL)
! {
! phpbb::$user->init();
! }
// Within the user-facing files we call:
//phpbb::$user->start();
!
?>
\ No newline at end of file
Modified: branches/acydburn/phpBB/download/file.php
==============================================================================
*** branches/acydburn/phpBB/download/file.php (original)
--- branches/acydburn/phpBB/download/file.php Thu Dec 11 17:40:32 2008
***************
*** 17,23 ****
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
! // Thank you sun.
if (isset($_SERVER['CONTENT_TYPE']))
{
if ($_SERVER['CONTENT_TYPE'] === 'application/x-java-archive')
--- 17,23 ----
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
! // Thank you sun.
if (isset($_SERVER['CONTENT_TYPE']))
{
if ($_SERVER['CONTENT_TYPE'] === 'application/x-java-archive')
***************
*** 35,45 ****
// worst-case default
$browser = (!empty($_SERVER['HTTP_USER_AGENT'])) ? htmlspecialchars((string) $_SERVER['HTTP_USER_AGENT']) : 'msie 6.0';
! $config = cache::obtain_config();
$filename = request::variable('avatar', '', false, request::GET);
$avatar_group = false;
$exit = false;
!
if ($filename[0] === 'g')
{
$avatar_group = true;
--- 35,45 ----
// worst-case default
$browser = (!empty($_SERVER['HTTP_USER_AGENT'])) ? htmlspecialchars((string) $_SERVER['HTTP_USER_AGENT']) : 'msie 6.0';
! $config = phpbb_cache::obtain_config();
$filename = request::variable('avatar', '', false, request::GET);
$avatar_group = false;
$exit = false;
!
if ($filename[0] === 'g')
{
$avatar_group = true;
***************
*** 66,73 ****
header("HTTP/1.0 403 Forbidden");
$exit = true;
}
!
!
if (!$exit)
{
if (!$filename)
--- 66,73 ----
header("HTTP/1.0 403 Forbidden");
$exit = true;
}
!
!
if (!$exit)
{
if (!$filename)
***************
*** 133,139 ****
}
// Obtain all extensions...
! $extensions = cache::obtain_attach_extensions(true);
}
else
{
--- 133,139 ----
}
// Obtain all extensions...
! $extensions = phpbb_cache::obtain_attach_extensions(true);
}
else
{
Modified: branches/acydburn/phpBB/includes/acm/acm_file.php
==============================================================================
*** branches/acydburn/phpBB/includes/acm/acm_file.php (original)
--- branches/acydburn/phpBB/includes/acm/acm_file.php Thu Dec 11 17:40:32 2008
***************
*** 248,270 ****
}
closedir($dir);
}
- }
-
- /**
- * ACM File Based Caching
- * @package acm
- */
- class acm
- {
-
- public $sql_rowset = array();
/**
! * Purge cache data
*/
! public function purge()
{
- // Purge all phpbb cache files
$dir = @opendir($this->cache_dir);
if (!$dir)
--- 248,259 ----
}
closedir($dir);
}
/**
! * Purge cache
*/
! protected function _purge()
{
$dir = @opendir($this->cache_dir);
if (!$dir)
***************
*** 274,280 ****
while (($entry = readdir($dir)) !== false)
{
! if (strpos($entry, 'sql_') !== 0 && strpos($entry, 'data_') !== 0 && strpos($entry, 'ctpl_') !== 0 && strpos($entry, 'tpl_') !== 0)
{
continue;
}
--- 263,269 ----
while (($entry = readdir($dir)) !== false)
{
! if (strpos($entry, $this->cache_prefix . '_') !== 0 || strpos($entry, $this->cache_prefix . '_global') === 0)
{
continue;
}
***************
*** 282,300 ****
$this->remove_file($this->cache_dir . $entry);
}
closedir($dir);
-
- unset($this->vars);
- unset($this->var_expires);
- unset($this->sql_rowset);
-
- $this->vars = array();
- $this->var_expires = array();
- $this->sql_rowset = array();
-
- $this->is_modified = false;
}
-
-
}
?>
\ No newline at end of file
--- 271,277 ----
Modified: branches/acydburn/phpBB/includes/acm/acm_xcache.php
==============================================================================
*** branches/acydburn/phpBB/includes/acm/acm_xcache.php (original)
--- branches/acydburn/phpBB/includes/acm/acm_xcache.php Thu Dec 11 17:40:32 2008
***************
*** 182,392 ****
xcache_unset($this->cache_prefix . '_' . $var_name);
}
- }
-
- class acm_xcache {
-
/**
! /**
! * Purge cache data
*/
! public function purge()
{
! // Purge all phpbb cache files
! $dir = @opendir($this->cache_dir);
! if (!$dir)
{
return;
}
! while (($entry = readdir($dir)) !== false)
! {
! if (strpos($entry, 'sql_') !== 0 && strpos($entry, 'data_') !== 0 && strpos($entry, 'ctpl_') !== 0 && strpos($entry, 'tpl_') !== 0)
! {
! continue;
! }
!
! @unlink($this->cache_dir . $entry);
! }
! closedir($dir);
!
! $n = xcache_count(XC_TYPE_VAR);
! for ($i = 0; $i < $n; $i++)
{
! xcache_clear_cache(XC_TYPE_VAR, $i);
! }
!
! unset($this->vars);
! unset($this->sql_rowset);
!
! $this->vars = array();
! $this->var_expires = array();
! $this->sql_rowset = array();
!
! $this->is_modified = false;
! }
! /**
! * Destroy cache data
! */
! public function destroy($var_name, $table = '')
! {
! if ($var_name === 'sql' && !empty($table))
! {
! if (!is_array($table))
{
! $table = array($table);
}
! foreach ($table as $table_name)
{
! // gives us the md5s that we want
! if (!xcache_isset('sql_' . $table_name))
{
continue;
}
- $temp = xcache_get('sql_' . $table_name);
! // delete each query ref
! foreach ($temp as $md5_id => $void)
! {
! xcache_unset('sql_' . $md5_id);
! }
!
! // delete the table ref
! xcache_unset('sql_' . $table_name);
! }
!
! return;
! }
!
! if ($var_name[0] === '_')
! {
! xcache_unset($var_name);
! }
! else if (isset($this->vars[$var_name]))
! {
! $this->is_modified = true;
! unset($this->vars[$var_name]);
!
! // We save here to let the following cache hits succeed
! $this->save();
! }
! }
!
! /**
! * Load cached sql query
! */
! public function sql_load($query)
! {
! // Remove extra spaces and tabs
! $query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
! $query_id = sizeof($this->sql_rowset);
!
! $query_hash = md5($query);
!
! if (!xcache_isset('sql_' . $query_hash))
! {
! return false;
! }
!
! $this->sql_rowset[$query_id] = xcache_get('sql_' . $query_hash);
!
!
! return $query_id;
! }
!
! /**
! * Save sql query
! */
! public function sql_save($query, &$query_result, $ttl)
! {
! global $db;
!
! // Remove extra spaces and tabs
! $query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
!
! // determine which tables this query belongs to:
!
! // grab all the FROM tables, avoid getting a LEFT JOIN
! preg_match('/FROM \(?(\w+(?: (?!LEFT JOIN)\w+)?(?:, ?\w+(?: (?!LEFT JOIN)\w+)?)*)\)?/', $query, $regs);
! $tables = array_map('trim', explode(',', $regs[1]));
!
! // now get the LEFT JOIN
! preg_match_all('/LEFT JOIN\s+(\w+)(?: \w+)?/', $query, $result, PREG_PATTERN_ORDER);
! $tables = array_merge($tables, $result[1]);
!
! $query_hash = md5($query);
!
! foreach ($tables as $table_name)
! {
! if (($pos = strpos($table_name, ' ')) !== false)
! {
! $table_name = substr($table_name, 0, $pos);
}
! if (xcache_isset('sql_' . $table_name))
! {
! $temp = xcache_get('sql_' . $table_name);
! }
! else
{
! $temp = array();
}
- $temp[$query_hash] = true;
- xcache_set('sql_' . $table_name, $temp, $ttl);
}
! // store them in the right place
! $query_id = sizeof($this->sql_rowset);
! $this->sql_rowset[$query_id] = array();
!
! while ($row = $db->sql_fetchrow($query_result))
! {
! $this->sql_rowset[$query_id][] = $row;
! }
! $db->sql_freeresult($query_result);
!
! xcache_set('sql_' . $query_hash, $this->sql_rowset[$query_id], $ttl);
!
! $query_result = $query_id;
! }
!
! /**
! * Fetch row from cache (database)
! */
! public function sql_fetchrow($query_id)
! {
! list(, $row) = each($this->sql_rowset[$query_id]);
!
! return ($row !== NULL) ? $row : false;
! }
!
! /**
! * Fetch a field from the current row of a cached database result (database)
! */
! public function sql_fetchfield($query_id, $field)
! {
! $row = current($this->sql_rowset[$query_id]);
!
! return ($row !== false && isset($row[$field])) ? $row[$field] : false;
! }
!
! /**
! * Free memory used for a cached database result (database)
! */
! public function sql_freeresult($query_id)
! {
! if (!isset($this->sql_rowset[$query_id]))
! {
! return false;
! }
!
! unset($this->sql_rowset[$query_id]);
!
! return true;
}
}
--- 182,227 ----
xcache_unset($this->cache_prefix . '_' . $var_name);
}
/**
! * Purge cache
*/
! protected function _purge()
{
! $num_entries = xcache_count(XC_TYPE_VAR);
! if (!$num_entries)
{
return;
}
! for ($i = 0; $i < $num_entries; $i++)
{
! $data = xcache_list(XC_TYPE_VAR, $i);
! if (empty($data['cache_list']))
{
! continue;
}
! $found = false;
! foreach ($data['cache_list'] as $list)
{
! if (strpos($list['name'], $this->cache_prefix . '_') === 0)
{
continue;
}
! $found = true;
}
! if ($found)
{
! xcache_clear_cache(XC_TYPE_VAR, $i);
}
}
! return;
}
}
Modified: branches/acydburn/phpBB/includes/acp/acp_styles.php
==============================================================================
*** branches/acydburn/phpBB/includes/acp/acp_styles.php (original)
--- branches/acydburn/phpBB/includes/acp/acp_styles.php Thu Dec 11 17:40:32 2008
***************
*** 1660,1666 ****
$theme_cfg = str_replace(array('{MODE}', '{NAME}', '{COPYRIGHT}', '{VERSION}'), array($mode, $style_row['theme_name'], $style_row['theme_copyright'], $config['version']), $this->theme_cfg);
// Read old cfg file
! $items = cache::obtain_cfg_item($style_row, 'theme');
if (!isset($items['parse_css_file']))
{
--- 1660,1666 ----
$theme_cfg = str_replace(array('{MODE}', '{NAME}', '{COPYRIGHT}', '{VERSION}'), array($mode, $style_row['theme_name'], $style_row['theme_copyright'], $config['version']), $this->theme_cfg);
// Read old cfg file
! $items = phpbb_cache::obtain_cfg_item($style_row, 'theme');
if (!isset($items['parse_css_file']))
{
Modified: branches/acydburn/phpBB/includes/auth/auth_apache.php
==============================================================================
*** branches/acydburn/phpBB/includes/auth/auth_apache.php (original)
--- branches/acydburn/phpBB/includes/auth/auth_apache.php Thu Dec 11 17:40:32 2008
***************
*** 104,110 ****
'user_row' => $row,
);
}
!
// Successful login...
return array(
'status' => LOGIN_SUCCESS,
--- 104,110 ----
'user_row' => $row,
);
}
!
// Successful login...
return array(
'status' => LOGIN_SUCCESS,
***************
*** 148,155 ****
if (!empty($php_auth_user) && !empty($php_auth_pw))
{
! set_var($php_auth_user, $php_auth_user, 'string', true);
! set_var($php_auth_pw, $php_auth_pw, 'string', true);
$sql = 'SELECT *
FROM ' . USERS_TABLE . "
--- 148,155 ----
if (!empty($php_auth_user) && !empty($php_auth_pw))
{
! request::set_var($php_auth_user, $php_auth_user, 'string', true);
! request::set_var($php_auth_pw, $php_auth_pw, 'string', true);
$sql = 'SELECT *
FROM ' . USERS_TABLE . "
***************
*** 231,237 ****
}
$php_auth_user = '';
! set_var($php_auth_user, $_SERVER['PHP_AUTH_USER'], 'string', true);
return ($php_auth_user === $user['username']) ? true : false;
}
--- 231,237 ----
}
$php_auth_user = '';
! request::set_var($php_auth_user, $_SERVER['PHP_AUTH_USER'], 'string', true);
return ($php_auth_user === $user['username']) ? true : false;
}
Modified: branches/acydburn/phpBB/includes/classes/cache.php
==============================================================================
*** branches/acydburn/phpBB/includes/classes/cache.php (original)
--- branches/acydburn/phpBB/includes/classes/cache.php Thu Dec 11 17:40:32 2008
***************
*** 280,289 ****
{
if (($bots = phpbb::$acm->get('bots')) === false)
{
$sql = 'SELECT user_id, bot_agent, bot_ip
FROM ' . BOTS_TABLE . '
WHERE bot_active = 1
! ORDER BY ' . phpbb::$db->sql_function('length_varchar', 'bot_agent') . 'DESC';
$result = phpbb::$db->sql_query($sql);
$bots = array();
--- 280,290 ----
{
if (($bots = phpbb::$acm->get('bots')) === false)
{
+ // @todo We order by last visit date. This way we are able to safe some cycles by checking the most active ones first.
$sql = 'SELECT user_id, bot_agent, bot_ip
FROM ' . BOTS_TABLE . '
WHERE bot_active = 1
! ORDER BY ' . phpbb::$db->sql_function('length_varchar', 'bot_agent') . 'DESC';
$result = phpbb::$db->sql_query($sql);
$bots = array();
Modified: branches/acydburn/phpBB/includes/classes/template.php
==============================================================================
*** branches/acydburn/phpBB/includes/classes/template.php (original)
--- branches/acydburn/phpBB/includes/classes/template.php Thu Dec 11 17:40:32 2008
***************
*** 22,40 ****
*/
class phpbb_template
{
! /** variable that holds all the data we'll be substituting into
* the compiled templates. Takes form:
* --> $this->_tpldata[block][iteration#][child][iteration#][child2][iteration#][variablename] == value
* if it's a root-level variable, it'll be like this:
* --> $this->_tpldata[.][0][varname] == value
*/
private $_tpldata = array('.' => array(0 => array()));
private $_rootref;
! // Root dir and hash of filenames for each template handle.
private $root = '';
public $cachepath = '';
public $files = array();
public $filename = array();
/**
--- 22,60 ----
*/
class phpbb_template
{
! /**
! * variable that holds all the data we'll be substituting into
* the compiled templates. Takes form:
* --> $this->_tpldata[block][iteration#][child][iteration#][child2][iteration#][variablename] == value
* if it's a root-level variable, it'll be like this:
* --> $this->_tpldata[.][0][varname] == value
+ * @var array
*/
private $_tpldata = array('.' => array(0 => array()));
+
+ /**
+ * @var array Reference to template->_tpldata['.'][0]
+ */
private $_rootref;
! /**
! * @var string Root dir for template.
! */
private $root = '';
+
+ /**
+ * @var string Path of the cache directory for the template
+ */
public $cachepath = '';
+
+ /**
+ * @var array Hash of handle => file path pairs
+ */
public $files = array();
+
+ /**
+ * @var array Hash of handle => filename pairs
+ */
public $filename = array();
/**
***************
*** 43,81 ****
*/
public function set_template()
{
! global $user;
!
! if (file_exists(PHPBB_ROOT_PATH . 'styles/' . $user->theme['template_path'] . '/template'))
{
! $this->root = PHPBB_ROOT_PATH . 'styles/' . $user->theme['template_path'] . '/template';
! $this->cachepath = PHPBB_ROOT_PATH . 'cache/tpl_' . $user->theme['template_path'] . '_';
}
else
{
! trigger_error('Template path could not be found: styles/' . $user->theme['template_path'] . '/template', E_USER_ERROR);
}
$this->_rootref = &$this->_tpldata['.'][0];
-
- return true;
}
/**
* Set custom template location (able to use directory outside of phpBB)
* @access public
*/
public function set_custom_template($template_path, $template_name)
{
$this->root = $template_path;
$this->cachepath = PHPBB_ROOT_PATH . 'cache/ctpl_' . str_replace('_', '-', $template_name) . '_';
-
- return true;
}
/**
* Sets the template filenames for handles. $filename_array
- * should be a hash of handle => filename pairs.
* @access public
*/
public function set_filenames(array $filename_array)
{
--- 63,97 ----
*/
public function set_template()
{
! if (file_exists(PHPBB_ROOT_PATH . 'styles/' . phpbb::$user->theme['template_path'] . '/template'))
{
! $this->root = PHPBB_ROOT_PATH . 'styles/' . phpbb::$user->theme['template_path'] . '/template';
! $this->cachepath = PHPBB_ROOT_PATH . 'cache/tpl_' . phpbb::$user->theme['template_path'] . '_';
}
else
{
! trigger_error('Template path could not be found: styles/' . phpbb::$user->theme['template_path'] . '/template', E_USER_ERROR);
}
$this->_rootref = &$this->_tpldata['.'][0];
}
/**
* Set custom template location (able to use directory outside of phpBB)
* @access public
+ * @param string $template_path Path to template directory
+ * @param string $template_name Name of template
*/
public function set_custom_template($template_path, $template_name)
{
$this->root = $template_path;
$this->cachepath = PHPBB_ROOT_PATH . 'cache/ctpl_' . str_replace('_', '-', $template_name) . '_';
}
/**
* Sets the template filenames for handles. $filename_array
* @access public
+ * @param array $filname_array Should be a hash of handle => filename pairs.
*/
public function set_filenames(array $filename_array)
{
***************
*** 97,103 ****
* Destroy template data set
* @access public
*/
! function __destruct()
{
$this->_tpldata = array('.' => array(0 => array()));
}
--- 113,119 ----
* Destroy template data set
* @access public
*/
! public function __destruct()
{
$this->_tpldata = array('.' => array(0 => array()));
}
***************
*** 105,110 ****
--- 121,127 ----
/**
* Reset/empty complete block
* @access public
+ * @param string $blockname Name of block to destroy
*/
public function destroy_block_vars($blockname)
{
***************
*** 128,145 ****
// Top-level block.
unset($this->_tpldata[$blockname]);
}
-
- return true;
}
/**
* Display handle
* @access public
*/
public function display($handle, $include_once = true)
{
! global $user, $phpbb_hook;
!
if (!empty($phpbb_hook) && $phpbb_hook->call_hook(array(__CLASS__, __FUNCTION__), $handle, $include_once))
{
if ($phpbb_hook->hook_return(array(__CLASS__, __FUNCTION__)))
--- 145,162 ----
// Top-level block.
unset($this->_tpldata[$blockname]);
}
}
/**
* Display handle
* @access public
+ * @param string $handle Handle to display
+ * @param bool $include_once Allow multiple inclusions
+ * @return bool True on success, false on failure
*/
public function display($handle, $include_once = true)
{
! /*
if (!empty($phpbb_hook) && $phpbb_hook->call_hook(array(__CLASS__, __FUNCTION__), $handle, $include_once))
{
if ($phpbb_hook->hook_return(array(__CLASS__, __FUNCTION__)))
***************
*** 147,153 ****
return $phpbb_hook->hook_return_result(array(__CLASS__, __FUNCTION__));
}
}
!
/* if (defined('IN_ERROR_HANDLER'))
{
if ((E_NOTICE & error_reporting()) == E_NOTICE)
--- 164,170 ----
return $phpbb_hook->hook_return_result(array(__CLASS__, __FUNCTION__));
}
}
! */
/* if (defined('IN_ERROR_HANDLER'))
{
if ((E_NOTICE & error_reporting()) == E_NOTICE)
***************
*** 158,164 ****
$_tpldata = &$this->_tpldata;
$_rootref = &$this->_rootref;
! $_lang = &$user->lang;
// These _are_ used the included files.
$_tpldata; $_rootref; $_lang;
--- 175,181 ----
$_tpldata = &$this->_tpldata;
$_rootref = &$this->_rootref;
! $_lang = &phpbb::$user->lang;
// These _are_ used the included files.
$_tpldata; $_rootref; $_lang;
***************
*** 184,189 ****
--- 201,211 ----
/**
* Display the handle and assign the output to a template variable or return the compiled result.
* @access public
+ * @param string $handle Handle to operate on
+ * @param string $template_var Template variable to assign compiled handle to
+ * @param bool $return_content If true return compiled handle, otherwise assign to $template_var
+ * @param bool $include_once Allow multiple inclusions of the file
+ * @return bool|string If $return_content is true return string of the compiled handle, otherwise return true
*/
public function assign_display($handle, $template_var = '', $return_content = true, $include_once = false)
{
***************
*** 204,217 ****
/**
* Load a compiled template if possible, if not, recompile it
* @access private
*/
! private function _tpl_load(&$handle)
{
- global $config;
-
$filename = $this->cachepath . str_replace('/', '.', $this->filename[$handle]) . '.' . PHP_EXT;
! $recompile = (!file_exists($filename) || @filesize($filename) === 0 || ($config['load_tplcompile'] && @filemtime($filename) < filemtime($this->files[$handle]))) ? true : false;
// Recompile page if the original template is newer, otherwise load the compiled version
if ($recompile)
--- 226,245 ----
/**
* Load a compiled template if possible, if not, recompile it
* @access private
+ * @param string $handle Handle of the template to load
+ * @return string|bool Return filename on success otherwise false
+ * @uses template_compile is used to compile uncached templates
*/
! private function _tpl_load($handle)
{
$filename = $this->cachepath . str_replace('/', '.', $this->filename[$handle]) . '.' . PHP_EXT;
! $recompile = (!file_exists($filename) || @filesize($filename) === 0 || (phpbb::$config['load_tplcompile'] && @filemtime($filename) < filemtime($this->files[$handle]))) ? true : false;
!
! if (defined('DEBUG_EXTRA'))
! {
! $recompile = true;
! }
// Recompile page if the original template is newer, otherwise load the compiled version
if ($recompile)
***************
*** 236,246 ****
/**
* This code should only run when some high level error prevents us from writing to the cache.
* @access private
*/
! private function _tpl_eval(&$handle)
{
- // global $user, $config;
-
$compile = new phpbb_template_compile($this);
// If we don't have a file assigned to this handle, die.
--- 264,275 ----
/**
* This code should only run when some high level error prevents us from writing to the cache.
* @access private
+ * @param string $handle Template handle to compile
+ * @return string|bool Return compiled code on success otherwise false
+ * @uses template_compile is used to compile template
*/
! private function _tpl_eval($handle)
{
$compile = new phpbb_template_compile($this);
// If we don't have a file assigned to this handle, die.
***************
*** 260,265 ****
--- 289,295 ----
/**
* Assign key variable pairs from an array
* @access public
+ * @param array $vararray A hash of variable name => value pairs
*/
public function assign_vars(array $vararray)
{
***************
*** 267,290 ****
{
$this->_rootref[$key] = $val;
}
-
- return true;
}
/**
* Assign a single variable to a single key
* @access public
*/
public function assign_var($varname, $varval)
{
$this->_rootref[$varname] = $varval;
-
- return true;
}
/**
* Assign key variable pairs from an array to a specified block
* @access public
*/
public function assign_block_vars($blockname, array $vararray)
{
--- 297,320 ----
{
$this->_rootref[$key] = $val;
}
}
/**
* Assign a single variable to a single key
* @access public
+ * @param string $varname Variable name
+ * @param string $varval Value to assign to variable
*/
public function assign_var($varname, $varval)
{
$this->_rootref[$varname] = $varval;
}
/**
* Assign key variable pairs from an array to a specified block
* @access public
+ * @param string $blockname Name of block to assign $vararray to
+ * @param array $vararray A hash of variable name => value pairs
*/
public function assign_block_vars($blockname, array $vararray)
{
***************
*** 313,327 ****
// Add a new iteration to this block with the variable assignments we were given.
$this->_tpldata[$blockname][] = $vararray;
}
-
- return true;
}
/**
* Change already assigned key variable pair (one-dimensional - single loop entry)
*
* An example of how to use this function:
- * {@example alter_block_array.php}
*
* @param string $blockname the blockname, for example 'loop'
* @param array $vararray the var array to insert/add or merge
--- 343,354 ----
***************
*** 349,362 ****
{
if (strpos($blockname, '.') !== false)
{
! // Nested blocks are not supported
! return false;
}
// Change key to zero (change first position) if false and to last position if true
if ($key === false || $key === true)
{
! $key = ($key === false) ? 0 : sizeof($this->_tpldata[$blockname]);
}
// Get correct position if array given
--- 376,422 ----
{
if (strpos($blockname, '.') !== false)
{
! // Nested block.
! $blocks = explode('.', $blockname);
! $blockcount = sizeof($blocks) - 1;
!
! $block = &$this->_tpldata;
! for ($i = 0; $i < $blockcount; $i++)
! {
! if (($pos = strpos($blocks[$i], '[')) !== false)
! {
! $name = substr($blocks[$i], 0, $pos);
!
! if (strpos($blocks[$i], '[]') === $pos)
! {
! $index = sizeof($block[$name]) - 1;
! }
! else
! {
! $index = min((int) substr($blocks[$i], $pos + 1, -1), sizeof($block[$name]) - 1);
! }
! }
! else
! {
! $name = $blocks[$i];
! $index = sizeof($block[$name]) - 1;
! }
! $block = &$block[$name];
! $block = &$block[$index];
! }
!
! $block = &$block[$blocks[$i]]; // Traverse the last block
! }
! else
! {
! // Top-level block.
! $block = &$this->_tpldata[$blockname];
}
// Change key to zero (change first position) if false and to last position if true
if ($key === false || $key === true)
{
! $key = ($key === false) ? 0 : sizeof($block);
}
// Get correct position if array given
***************
*** 366,372 ****
list($search_key, $search_value) = @each($key);
$key = NULL;
! foreach ($this->_tpldata[$blockname] as $i => $val_ary)
{
if ($val_ary[$search_key] === $search_value)
{
--- 426,432 ----
list($search_key, $search_value) = @each($key);
$key = NULL;
! foreach ($block as $i => $val_ary)
{
if ($val_ary[$search_key] === $search_value)
{
***************
*** 386,398 ****
if ($mode == 'insert')
{
// Re-position template blocks
! for ($i = sizeof($this->_tpldata[$blockname]); $i > $key; $i--)
{
! $this->_tpldata[$blockname][$i] = $this->_tpldata[$blockname][$i-1];
}
// Insert vararray at given position
! $this->_tpldata[$blockname][$key] = $vararray;
return true;
}
--- 446,458 ----
if ($mode == 'insert')
{
// Re-position template blocks
! for ($i = sizeof($block); $i > $key; $i--)
{
! $block[$i] = $block[$i-1];
}
// Insert vararray at given position
! $block[$key] = $vararray;
return true;
}
***************
*** 400,411 ****
// Which block to change?
if ($mode == 'change')
{
! if ($key == sizeof($this->_tpldata[$blockname]))
{
$key--;
}
! $this->_tpldata[$blockname][$key] = array_merge($this->_tpldata[$blockname][$key], $vararray);
return true;
}
--- 460,472 ----
// Which block to change?
if ($mode == 'change')
{
! if ($key == sizeof($block))
{
$key--;
}
! $block[$key] = array_merge($block[$key], $vararray);
!
return true;
}
***************
*** 415,438 ****
/**
* Include a separate template
* @access private
*/
! public function _tpl_include($filename, $include = true)
{
$handle = $filename;
$this->filename[$handle] = $filename;
$this->files[$handle] = $this->root . '/' . $filename;
! $filename = $this->_tpl_load($handle);
if ($include)
{
- $code = $this->_tpl_load_code($handle);
-
- /* global $user;
-
$_tpldata = &$this->_tpldata;
$_rootref = &$this->_rootref;
! $_lang = &$user->lang;
// These _are_ used the included files.
$_tpldata; $_rootref; $_lang;
--- 476,498 ----
/**
* Include a separate template
* @access private
+ * @param string $filename Template filename to include
+ * @param bool $include True to include the file, false to just load it
+ * @uses template_compile is used to compile uncached templates
*/
! private function _tpl_include($filename, $include = true)
{
$handle = $filename;
$this->filename[$handle] = $filename;
$this->files[$handle] = $this->root . '/' . $filename;
! $filename = $this->_tpl_load($handle);
if ($include)
{
$_tpldata = &$this->_tpldata;
$_rootref = &$this->_rootref;
! $_lang = &phpbb::$user->lang;
// These _are_ used the included files.
$_tpldata; $_rootref; $_lang;
***************
*** 444,462 ****
}
else
{
! if (!class_exists('template_compile'))
! {
! include(PHPBB_ROOT_PATH . 'includes/functions_template.' . PHP_EXT);
! }
!
! $compile = new template_compile($this);
if (($code = $compile->_tpl_gen_src($handle)) !== false)
{
$code = ' ?> ' . $code . ' <?php ';
eval($code);
}
! }*/
}
}
}
--- 504,517 ----
}
else
{
! $compile = new phpbb_template_compile($this);
if (($code = $compile->_tpl_gen_src($handle)) !== false)
{
$code = ' ?> ' . $code . ' <?php ';
eval($code);
}
! }
}
}
}
Modified: branches/acydburn/phpBB/includes/classes/template_compile.php
==============================================================================
*** branches/acydburn/phpBB/includes/classes/template_compile.php (original)
--- branches/acydburn/phpBB/includes/classes/template_compile.php Thu Dec 11 17:40:32 2008
***************
*** 19,37 ****
/**
* The template filter that does the actual compilation
* @see template_compile
*
*/
class phpbb_template_filter extends php_user_filter
{
private $regex = '~<!-- ([A-Z][A-Z_0-9]+)(?: (.*?) ?)?-->|{((?:[a-z][a-z_0-9]+\.)*\\$?[A-Z][A-Z_0-9]+)}~';
- private $blocks = array();
private $block_names = array();
private $block_else_level = array();
private $chunk;
! function filter($in, $out, &$consumed, $closing)
{
$written = false;
--- 19,50 ----
/**
* The template filter that does the actual compilation
* @see template_compile
+ * @package phpBB3
*
*/
class phpbb_template_filter extends php_user_filter
{
+ /**
+ * @var string Replaceable tokens regex
+ */
private $regex = '~<!-- ([A-Z][A-Z_0-9]+)(?: (.*?) ?)?-->|{((?:[a-z][a-z_0-9]+\.)*\\$?[A-Z][A-Z_0-9]+)}~';
+ /**
+ * @var array
+ */
private $block_names = array();
+
+ /**
+ * @var array
+ */
private $block_else_level = array();
+ /**
+ * @var string
+ */
private $chunk;
! public function filter($in, $out, &$consumed, $closing)
{
$written = false;
***************
*** 203,208 ****
--- 216,227 ----
$no_nesting = false;
// Is the designer wanting to call another loop in a loop?
+ // <!-- BEGIN loop -->
+ // <!-- BEGIN !loop2 -->
+ // <!-- END !loop2 -->
+ // <!-- END loop -->
+ // 'loop2' is actually on the same nesting level as 'loop' you assign
+ // variables to it with template->assign_block_vars('loop2', array(...))
if (strpos($tag_args, '!') === 0)
{
// Count the number if ! occurrences (not allowed in vars)
***************
*** 439,444 ****
--- 458,467 ----
$token = "(\$_${namespace}_i == \$_${namespace}_count - 1)";
break;
+ case 'S_BLOCK_NAME':
+ $token = "'$namespace'";
+ break;
+
default:
$token = $this->generate_block_data_ref(substr($varrefs[1], 0, -1), true, $varrefs[2]) . '[\'' . $varrefs[3] . '\']';
break;
***************
*** 605,618 ****
* block namespace. This is a string of the form:
* ' . $_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['varname'] . '
* It's ready to be inserted into an "echo" line in one of the templates.
! * NOTE: expects a trailing "." on the namespace.
* @access private
*/
! function generate_block_varref($namespace, $varname, $echo = true, $defop = false)
{
// Strip the trailing period.
$namespace = substr($namespace, 0, -1);
// S_ROW_COUNT is deceptive, it returns the current row number now the number of rows
// hence S_ROW_COUNT is deprecated in favour of S_ROW_NUM
switch ($varname)
--- 628,648 ----
* block namespace. This is a string of the form:
* ' . $_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['varname'] . '
* It's ready to be inserted into an "echo" line in one of the templates.
! *
* @access private
+ * @param string $namespace Namespace to access (expects a trailing "." on the namespace)
+ * @param string $varname Variable name to use
+ * @param bool $echo If true return an echo statement, otherwise a reference to the internal variable
+ * @param bool $defop If true this is a variable created with the DEFINE construct, otherwise template variable
+ * @return string Code to access variable or echo it if $echo is true
*/
! private function generate_block_varref($namespace, $varname, $echo = true, $defop = false)
{
// Strip the trailing period.
$namespace = substr($namespace, 0, -1);
+ $expr = true;
+
// S_ROW_COUNT is deceptive, it returns the current row number now the number of rows
// hence S_ROW_COUNT is deprecated in favour of S_ROW_NUM
switch ($varname)
***************
*** 634,639 ****
--- 664,673 ----
$varref = "(\$_${namespace}_i == \$_${namespace}_count - 1)";
break;
+ case 'S_BLOCK_NAME':
+ $varref = "'$namespace'";
+ break;
+
default:
// Get a reference to the data block for this namespace.
$varref = $this->generate_block_data_ref($namespace, true, $defop);
***************
*** 641,649 ****
// Append the variable reference.
$varref .= "['$varname']";
break;
}
! $varref = ($echo) ? "<?php echo $varref; ?>" : ((isset($varref)) ? $varref : '');
return $varref;
}
--- 675,686 ----
// Append the variable reference.
$varref .= "['$varname']";
+
+ $expr = false;
break;
}
! // @todo Test the !$expr more
! $varref = ($echo) ? "<?php echo $varref; ?>" : (($expr || isset($varref)) ? $varref : '');
return $varref;
}
***************
*** 653,663 ****
* (possibly nested) block namespace. This is a string of the form:
* $_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['$childN']
*
- * If $include_last_iterator is true, then [$_childN_i] will be appended to the form shown above.
- * NOTE: does not expect a trailing "." on the blockname.
* @access private
*/
! function generate_block_data_ref($blockname, $include_last_iterator, $defop = false)
{
// Get an array of the blocks involved.
$blocks = explode('.', $blockname);
--- 690,702 ----
* (possibly nested) block namespace. This is a string of the form:
* $_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['$childN']
*
* @access private
+ * @param string $blockname Block to access (does not expect a trailing "." on the blockname)
+ * @param bool $include_last_iterator If $include_last_iterator is true, then [$_childN_i] will be appended to the form shown above.
+ * @param bool $defop If true this is a variable created with the DEFINE construct, otherwise template variable
+ * @return string Code to access variable
*/
! private function generate_block_data_ref($blockname, $include_last_iterator, $defop = false)
{
// Get an array of the blocks involved.
$blocks = explode('.', $blockname);
***************
*** 712,727 ****
* DEFINE directive inspired by a request by Cyberalien
*
* @package phpBB3
*/
class phpbb_template_compile
{
!
private $template;
/**
* Constructor
*/
! function __construct(template $template)
{
$this->template = $template;
}
--- 751,770 ----
* DEFINE directive inspired by a request by Cyberalien
*
* @package phpBB3
+ * @uses template_filter As a PHP stream filter to perform compilation of templates
*/
class phpbb_template_compile
{
! /**
! * @var template Reference to the {@link template template} object performing compilation
! */
private $template;
/**
* Constructor
+ * @param template $template {@link template Template} object performing compilation
*/
! function __construct(phpbb_template $template)
{
$this->template = $template;
}
***************
*** 729,736 ****
/**
* Load template source from file
* @access public
*/
! public function _tpl_load_file($handle/*, $store_in_db = false*/)
{
// Try and open template for read
if (!file_exists($this->template->files[$handle]))
--- 772,781 ----
/**
* Load template source from file
* @access public
+ * @param string $handle Template handle we wish to load
+ * @return bool Return true on success otherwise false
*/
! public function _tpl_load_file($handle)
{
// Try and open template for read
if (!file_exists($this->template->files[$handle]))
***************
*** 740,748 ****
// Actually compile the code now.
return $this->compile_write($handle, $this->template->files[$handle]);
-
}
public function _tpl_gen_src($handle)
{
// Try and open template for read
--- 785,798 ----
// Actually compile the code now.
return $this->compile_write($handle, $this->template->files[$handle]);
}
+ /**
+ * Load template source from file
+ * @access public
+ * @param string $handle Template handle we wish to compile
+ * @return string|bool Return compiled code on successful compilation otherwise false
+ */
public function _tpl_gen_src($handle)
{
// Try and open template for read
***************
*** 752,763 ****
}
// Actually compile the code now.
! return $this->compile_gen(/*$handle, */$this->template->files[$handle]);
}
/**
* Write compiled file to cache directory
* @access private
*/
private function compile_write($handle, $source_file)
{
--- 802,816 ----
}
// Actually compile the code now.
! return $this->compile_gen($this->template->files[$handle]);
}
/**
* Write compiled file to cache directory
* @access private
+ * @param string $handle Template handle to compile
+ * @param string $source_file Source template file
+ * @return bool Return true on success otherwise false
*/
private function compile_write($handle, $source_file)
{
***************
*** 773,779 ****
@flock($destination_handle, LOCK_EX);
! stream_filter_append($source_handle, 'template');
stream_copy_to_stream($source_handle, $destination_handle);
@fclose($source_handle);
--- 826,832 ----
@flock($destination_handle, LOCK_EX);
! stream_filter_append($source_handle, 'phpbb_template');
stream_copy_to_stream($source_handle, $destination_handle);
@fclose($source_handle);
***************
*** 782,795 ****
phpbb_chmod($filename, CHMOD_WRITE);
return true;
}
/**
* Generate source for eval()
* @access private
*/
! private function compile_gen(/*$handle, */$source_file)
{
$source_handle = @fopen($source_file, 'rb');
$destination_handle = @fopen('php://temp' ,'r+b');
--- 835,852 ----
phpbb_chmod($filename, CHMOD_WRITE);
+ clearstatcache();
+
return true;
}
/**
* Generate source for eval()
* @access private
+ * @param string $source_file Source template file
+ * @return string|bool Return compiled code on successful compilation otherwise false
*/
! private function compile_gen($source_file)
{
$source_handle = @fopen($source_file, 'rb');
$destination_handle = @fopen('php://temp' ,'r+b');
***************
*** 799,805 ****
return false;
}
! stream_filter_append($source_handle, 'template');
stream_copy_to_stream($source_handle, $destination_handle);
@fclose($source_handle);
--- 856,862 ----
return false;
}
! stream_filter_append($source_handle, 'phpbb_template');
stream_copy_to_stream($source_handle, $destination_handle);
@fclose($source_handle);
Modified: branches/acydburn/phpBB/includes/core/core_request.php
==============================================================================
*** branches/acydburn/phpBB/includes/core/core_request.php (original)
--- branches/acydburn/phpBB/includes/core/core_request.php Thu Dec 11 17:40:32 2008
***************
*** 301,306 ****
--- 301,341 ----
}
/**
+ * set_var
+ *
+ * Set variable, used by {@link request_var the request_var function}
+ */
+ public static function set_var(&$result, $var, $type, $multibyte = false)
+ {
+ settype($var, $type);
+ $result = $var;
+
+ if ($type == 'string')
+ {
+ $result = trim(utf8_htmlspecialchars(str_replace(array("\r\n", "\r", "\0"), array("\n", "\n", ''), $result)));
+
+ if (!empty($result))
+ {
+ // Make sure multibyte characters are wellformed
+ if ($multibyte)
+ {
+ if (!preg_match('/^./u', $result))
+ {
+ $result = '';
+ }
+ }
+ else
+ {
+ // no multibyte, allow only ASCII (0-127)
+ $result = preg_replace('/[\x80-\xFF]/', '?', $result);
+ }
+ }
+
+ $result = (STRIP) ? stripslashes($result) : $result;
+ }
+ }
+
+ /**
* Recursively sets a variable to a given type using {@link set_var set_var}
* This function is only used from within {@link request::variable request::variable}.
*
***************
*** 328,334 ****
if (!is_array($default))
{
$type = gettype($default);
! set_var($var, $var, $type, $multibyte);
}
else
{
--- 363,369 ----
if (!is_array($default))
{
$type = gettype($default);
! self::set_var($var, $var, $type, $multibyte);
}
else
{
***************
*** 349,358 ****
foreach ($_var as $k => $v)
{
! set_var($k, $k, $key_type, $multibyte);
self::recursive_set_var($v, $default_value, $multibyte);
! set_var($var[$k], $v, $value_type, $multibyte);
}
}
}
--- 384,393 ----
foreach ($_var as $k => $v)
{
! self::set_var($k, $k, $key_type, $multibyte);
self::recursive_set_var($v, $default_value, $multibyte);
! self::set_var($var[$k], $v, $value_type, $multibyte);
}
}
}
Modified: branches/acydburn/phpBB/includes/core/index.php
==============================================================================
*** branches/acydburn/phpBB/includes/core/index.php (original)
--- branches/acydburn/phpBB/includes/core/index.php Thu Dec 11 17:40:32 2008
***************
*** 138,144 ****
}
else
{
! // Now search for hooks...
$dh = @opendir(PHPBB_ROOT_PATH . 'includes/core/');
if ($dh)
--- 138,144 ----
}
else
{
! // Now search for required core files...
$dh = @opendir(PHPBB_ROOT_PATH . 'includes/core/');
if ($dh)
***************
*** 154,162 ****
}
}
! /* Some more required classes
! require_once(PHPBB_ROOT_PATH . 'includes/session.' . PHP_EXT);
! require_once(PHPBB_ROOT_PATH . 'includes/auth.' . PHP_EXT);
require_once(PHPBB_ROOT_PATH . 'includes/utf/utf_tools.' . PHP_EXT);
! */
?>
\ No newline at end of file
--- 154,164 ----
}
}
! // Register core classes
! phpbb::register('url');
! phpbb::register('security');
!
! // Some more required classes
require_once(PHPBB_ROOT_PATH . 'includes/utf/utf_tools.' . PHP_EXT);
!
?>
\ No newline at end of file
Modified: branches/acydburn/phpBB/includes/core/init.php
==============================================================================
*** branches/acydburn/phpBB/includes/core/init.php (original)
--- branches/acydburn/phpBB/includes/core/init.php Thu Dec 11 17:40:32 2008
***************
*** 23,31 ****
/**#@+
* Our own static variables
*/
public static $db = NULL;
public static $acm = NULL;
! public static $template = NULL;
public static $config = array();
/**#@-*/
--- 23,37 ----
/**#@+
* Our own static variables
*/
+ public static $template = NULL;
+ public static $user = NULL;
public static $db = NULL;
public static $acm = NULL;
! public static $acl = NULL;
!
! public static $url = NULL;
! public static $security = NULL;
!
public static $config = array();
/**#@-*/
***************
*** 192,197 ****
--- 198,213 ----
'includes/' . $class_name,
);
+ if (strpos($class_name, '_') !== false)
+ {
+ $class_name = str_replace('_', '/', $class_name);
+
+ $filenames = array_merge($filenames, array(
+ 'includes/' . $class_name,
+ 'includes/classes/' . $class_name,
+ ));
+ }
+
foreach ($filenames as $filename)
{
if (file_exists(PHPBB_ROOT_PATH . $filename . '.' . PHP_EXT))
Modified: branches/acydburn/phpBB/includes/db/mysqli.php
==============================================================================
*** branches/acydburn/phpBB/includes/db/mysqli.php (original)
--- branches/acydburn/phpBB/includes/db/mysqli.php Thu Dec 11 17:40:32 2008
***************
*** 111,117 ****
* SQL Transaction
* @access private
*/
! public function _sql_transaction($status = 'begin')
{
switch ($status)
{
--- 111,117 ----
* SQL Transaction
* @access private
*/
! protected function _sql_transaction($status = 'begin')
{
switch ($status)
{
***************
*** 196,202 ****
/**
* Build LIMIT query
*/
! private function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
{
$this->query_result = false;
--- 196,202 ----
/**
* Build LIMIT query
*/
! protected function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
{
$this->query_result = false;
***************
*** 332,338 ****
* Build LIKE expression
* @access private
*/
! private function _sql_like_expression($expression)
{
return $expression;
}
--- 332,338 ----
* Build LIKE expression
* @access private
*/
! protected function _sql_like_expression($expression)
{
return $expression;
}
***************
*** 341,347 ****
* Build db-specific query data
* @access private
*/
! private function _sql_custom_build($stage, $data)
{
switch ($stage)
{
--- 341,347 ----
* Build db-specific query data
* @access private
*/
! protected function _sql_custom_build($stage, $data)
{
switch ($stage)
{
***************
*** 357,363 ****
* return sql error array
* @access private
*/
! private function _sql_error()
{
if (!$this->db_connect_id)
{
--- 357,363 ----
* return sql error array
* @access private
*/
! protected function _sql_error()
{
if (!$this->db_connect_id)
{
***************
*** 377,383 ****
* Close sql connection
* @access private
*/
! private function _sql_close()
{
return @mysqli_close($this->db_connect_id);
}
--- 377,383 ----
* Close sql connection
* @access private
*/
! protected function _sql_close()
{
return @mysqli_close($this->db_connect_id);
}
***************
*** 386,392 ****
* Build db-specific report
* @access private
*/
! private function _sql_report($mode, $query = '')
{
static $test_prof;
--- 386,392 ----
* Build db-specific report
* @access private
*/
! protected function _sql_report($mode, $query = '')
{
static $test_prof;
|