/////////////////////////////////////////////////
// PukiWiki - Yet another WikiWikiWeb clone.
//
-// $Id: plugin.php,v 1.4 2004/10/31 03:45:52 henoheno Exp $
+// $Id: plugin.php,v 1.5 2004/11/04 12:11:18 henoheno Exp $
//
// ¥×¥é¥°¥¤¥óÍѤË̤ÄêµÁ¤Î¥°¥í¡¼¥Ð¥ëÊÑ¿ô¤òÀßÄê
//¥×¥é¥°¥¤¥ó¤¬Â¸ºß¤¹¤ë¤«
function exist_plugin($name)
{
+ static $exists = array();
+
$name = strtolower($name); // Âçʸ»ú¤È¾®Ê¸»ú¤ò¶èÊ̤·¤Ê¤¤¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àÂкö
+ if(isset($exists[$name])) return $exists[$name];
+
if (preg_match('/^\w{1,64}$/', $name) &&
file_exists(PLUGIN_DIR . $name . '.inc.php')) {
+ $exists[$name] = TRUE;
require_once(PLUGIN_DIR . $name . '.inc.php');
return TRUE;
} else {
+ $exists[$name] = FALSE;
return FALSE;
}
}