Esempio n. 1
0
 /**
  * Load the hooks
  * Using something very similar to the phpBB hook system
  */
 public static function load_hooks()
 {
     if (self::$hook) {
         return;
     }
     // Add own hook handler
     self::$hook = new titania_hook();
     // Now search for hooks...
     $dh = @opendir(self::$root_path . 'includes/hooks/');
     if ($dh) {
         while (($file = readdir($dh)) !== false) {
             if (strpos($file, 'hook_') === 0 && substr($file, -(strlen(self::$php_ext) + 1)) === '.' . self::$php_ext) {
                 include self::$root_path . 'includes/hooks/' . $file;
             }
         }
         closedir($dh);
     }
 }