1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-11 19:24:01 +02:00

make sure custom profile fields are created correctly on registration (#2225)

git-svn-id: file:///svn/phpbb/trunk@6058 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen
2006-06-13 21:06:29 +00:00
parent b0b7963817
commit 1aac08acc0
52 changed files with 382 additions and 254 deletions

View File

@@ -9,8 +9,8 @@
*/
/**
* @package acm
* ACM File Based Caching
* @package acm
*/
class acm
{
@@ -20,12 +20,18 @@ class acm
var $sql_rowset = array();
/**
* Set cache path
*/
function acm()
{
global $phpbb_root_path;
$this->cache_dir = $phpbb_root_path . 'cache/';
}
/**
* Load global cache
*/
function load()
{
global $phpEx;
@@ -41,6 +47,9 @@ class acm
return true;
}
/**
* Unload cache object
*/
function unload()
{
$this->save();
@@ -49,6 +58,9 @@ class acm
unset($this->sql_rowset);
}
/**
* Save modified objects
*/
function save()
{
if (!$this->is_modified)
@@ -70,6 +82,9 @@ class acm
$this->is_modified = false;
}
/**
* Tidy cache
*/
function tidy()
{
global $phpEx;
@@ -110,6 +125,9 @@ class acm
set_config('cache_last_gc', time(), true);
}
/**
* Get saved cache object
*/
function get($var_name)
{
if ($var_name{0} == '_')
@@ -130,6 +148,9 @@ class acm
}
}
/**
* Put data into cache
*/
function put($var_name, $var, $ttl = 31536000)
{
if ($var_name{0} == '_')
@@ -152,6 +173,9 @@ class acm
}
}
/**
* Destroy cache data
*/
function destroy($var_name, $table = '')
{
global $phpEx;
@@ -202,6 +226,9 @@ class acm
}
}
/**
* Check if a given cache entry exist
*/
function _exists($var_name)
{
if ($var_name{0} == '_')
@@ -225,6 +252,9 @@ class acm
}
}
/**
* Format an array to be stored on filesystem
*/
function format_array($array)
{
$lines = array();
@@ -232,24 +262,28 @@ class acm
{
if (is_array($v))
{
$lines[] = "'$k'=>" . $this->format_array($v);
$lines[] = "\n'$k' => " . $this->format_array($v);
}
else if (is_int($v))
{
$lines[] = "'$k'=>$v";
$lines[] = "\n'$k' => $v";
}
else if (is_bool($v))
{
$lines[] = "'$k'=>" . (($v) ? 'true' : 'false');
$lines[] = "\n'$k' => " . (($v) ? 'true' : 'false');
}
else
{
$lines[] = "'$k'=>'" . str_replace("'", "\\'", str_replace('\\', '\\\\', $v)) . "'";
$lines[] = "\n'$k' => '" . str_replace("'", "\\'", str_replace('\\', '\\\\', $v)) . "'";
}
}
return 'array(' . implode(',', $lines) . ')';
}
/**
* Load cached sql query
*/
function sql_load($query)
{
global $phpEx;
@@ -278,6 +312,9 @@ class acm
return $query_id;
}
/**
* Save sql query
*/
function sql_save($query, &$query_result, $ttl)
{
global $db, $phpEx;
@@ -309,11 +346,17 @@ class acm
}
}
/**
* Ceck if a given sql query exist in cache
*/
function sql_exists($query_id)
{
return isset($this->sql_rowset[$query_id]);
}
/**
* Fetch row from cache (database)
*/
function sql_fetchrow($query_id)
{
return array_shift($this->sql_rowset[$query_id]);

View File

@@ -16,8 +16,8 @@ if (!defined('IN_PHPBB'))
}
/**
* @package acm
* Class for grabbing/handling cached entries, extends acm_file or acm_db depending on the setup
* @package acm
*/
class cache extends acm
{
@@ -238,7 +238,7 @@ class cache extends acm
{
$allowed = ($forum_id === 0) ? false : true;
}
if ($allowed)
{
$return['_allowed_'][$extension] = 0;
@@ -282,7 +282,7 @@ class cache extends acm
WHERE bot_active = 1
ORDER BY STRLEN(bot_agent) DESC';
break;
// LENGTH supported by MySQL, IBM DB2 and Oracle for sure...
default:
$sql = 'SELECT user_id, bot_agent, bot_ip
@@ -292,7 +292,7 @@ class cache extends acm
break;
}
$result = $db->sql_query($sql);
$bots = array();
while ($row = $db->sql_fetchrow($result))
{
@@ -330,7 +330,7 @@ class cache extends acm
$reparse = false;
$filename = $phpbb_root_path . 'styles/' . $theme[$key . '_path'] . '/' . $key . '/' . $key . '.cfg';
if (!file_exists($filename))
{
continue;
@@ -340,7 +340,7 @@ class cache extends acm
{
$reparse = true;
}
// Re-parse cfg file
if ($reparse)
{