aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/cache.php
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2010-03-02 01:05:37 +0100
committerNils Adermann <naderman@naderman.de>2010-03-02 01:05:37 +0100
commit54f94e0d428c5963ecca86a40247105e51288432 (patch)
tree275c5ec85c31595d0341d6ad630565b7a6a4cdcc /phpBB/includes/cache.php
parent1a09d0e238666a386a76878d6395986947b11c1e (diff)
parentb5535db081dca0187caae84cf7ffd8d6045dccba (diff)
downloadforums-54f94e0d428c5963ecca86a40247105e51288432.tar
forums-54f94e0d428c5963ecca86a40247105e51288432.tar.gz
forums-54f94e0d428c5963ecca86a40247105e51288432.tar.bz2
forums-54f94e0d428c5963ecca86a40247105e51288432.tar.xz
forums-54f94e0d428c5963ecca86a40247105e51288432.zip
Merge commit 'release-3.0-RC6'
Diffstat (limited to 'phpBB/includes/cache.php')
-rw-r--r--phpBB/includes/cache.php39
1 files changed, 36 insertions, 3 deletions
diff --git a/phpBB/includes/cache.php b/phpBB/includes/cache.php
index 97b98e1227..5198abdc3c 100644
--- a/phpBB/includes/cache.php
+++ b/phpBB/includes/cache.php
@@ -9,6 +9,7 @@
*/
/**
+* @ignore
*/
if (!defined('IN_PHPBB'))
{
@@ -293,14 +294,14 @@ class cache extends acm
{
case 'mssql':
case 'mssql_odbc':
- $sql = 'SELECT user_id, bot_agent, bot_ip
+ $sql = 'SELECT user_id, bot_agent, bot_ip
FROM ' . BOTS_TABLE . '
WHERE bot_active = 1
ORDER BY LEN(bot_agent) DESC';
break;
case 'firebird':
- $sql = 'SELECT user_id, bot_agent, bot_ip
+ $sql = 'SELECT user_id, bot_agent, bot_ip
FROM ' . BOTS_TABLE . '
WHERE bot_active = 1
ORDER BY CHAR_LENGTH(bot_agent) DESC';
@@ -308,7 +309,7 @@ class cache extends acm
// LENGTH supported by MySQL, IBM DB2 and Oracle for sure...
default:
- $sql = 'SELECT user_id, bot_agent, bot_ip
+ $sql = 'SELECT user_id, bot_agent, bot_ip
FROM ' . BOTS_TABLE . '
WHERE bot_active = 1
ORDER BY LENGTH(bot_agent) DESC';
@@ -403,6 +404,38 @@ class cache extends acm
return $usernames;
}
+
+ /**
+ * Obtain hooks...
+ */
+ function obtain_hooks()
+ {
+ global $phpbb_root_path, $phpEx;
+
+ if (($hook_files = $this->get('_hooks')) === false)
+ {
+ $hook_files = array();
+
+ // Now search for hooks...
+ $dh = @opendir($phpbb_root_path . 'includes/hooks/');
+
+ if ($dh)
+ {
+ while (($file = readdir($dh)) !== false)
+ {
+ if (strpos($file, 'hook_') === 0 && substr($file, -(strlen($phpEx) + 1)) === '.' . $phpEx)
+ {
+ $hook_files[] = substr($file, 0, -(strlen($phpEx) + 1));
+ }
+ }
+ closedir($dh);
+ }
+
+ $this->put('_hooks', $hook_files);
+ }
+
+ return $hook_files;
+ }
}
?> \ No newline at end of file