aboutsummaryrefslogtreecommitdiffstats
path: root/code_sniffer
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2012-03-06 19:42:33 -0500
committerOleg Pudeyev <oleg@bsdpower.com>2012-03-06 19:42:33 -0500
commit6e207e3f691d309bf00deb0c44818fb9072b4a13 (patch)
treeec84227987ee986e5fc5494ab3b38a0342b5cf61 /code_sniffer
parentd035dc3eef617adbd9dc7ba09e088f5dcc3cb905 (diff)
downloadforums-6e207e3f691d309bf00deb0c44818fb9072b4a13.tar
forums-6e207e3f691d309bf00deb0c44818fb9072b4a13.tar.gz
forums-6e207e3f691d309bf00deb0c44818fb9072b4a13.tar.bz2
forums-6e207e3f691d309bf00deb0c44818fb9072b4a13.tar.xz
forums-6e207e3f691d309bf00deb0c44818fb9072b4a13.zip
[ticket/10618] Change phpBB 3 to phpBB 3.1.
PHPBB3-10618
Diffstat (limited to 'code_sniffer')
0 files changed, 0 insertions, 0 deletions
/** * * @package VC * @version $Id$ * @copyright (c) 2008 phpBB Group * @license http://opensource.org/licenses/gpl-license.php GNU Public License * */ /** * @ignore */ if (!defined('IN_PHPBB')) { exit; } /** * A small class for 3.0.x (no autoloader in 3.0.x) * * @package VC */ class phpbb_captcha_factory { /** * return an instance of class $name in file $name_plugin.php */ function &get_instance($name) { global $phpbb_root_path, $phpEx; $name = basename($name); if (!class_exists($name)) { include($phpbb_root_path . "includes/captcha/plugins/{$name}_plugin." . $phpEx); } $instance =& call_user_func(array($name, 'get_instance')); return $instance; } /** * Call the garbage collector */ function garbage_collect($name) { global $phpbb_root_path, $phpEx; $name = basename($name); if (!class_exists($name)) { include($phpbb_root_path . "includes/captcha/plugins/{$name}_plugin." . $phpEx); } call_user_func(array($name, 'garbage_collect'), 0); } /** * return a list of all discovered CAPTCHA plugins */ function get_captcha_types() { global $phpbb_root_path, $phpEx; $captchas = array( 'available' => array(), 'unavailable' => array(), ); $dp = @opendir($phpbb_root_path . 'includes/captcha/plugins'); if ($dp) { while (($file = readdir($dp)) !== false) { if ((preg_match('#_plugin\.' . $phpEx . '$#', $file))) { $name = preg_replace('#^(.*?)_plugin\.' . $phpEx . '$#', '\1', $file); if (!class_exists($name)) { include($phpbb_root_path . "includes/captcha/plugins/$file"); } if (call_user_func(array($name, 'is_available'))) { $captchas['available'][$name] = call_user_func(array($name, 'get_name')); } else { $captchas['unavailable'][$name] = call_user_func(array($name, 'get_name')); } } } closedir($dp); } return $captchas; } } ?>