예제 #1
0
            }
            $vbulletin->datastore =& new $datastore_class($vbulletin, $db);
        }
    }
    // ## Load latest bitfields, overwrite datastore versions (if they exist)
    // ## (so latest upgrade script can access any new permissions)
    require_once DIR . '/includes/class_bitfield_builder.php';
    if (vB_Bitfield_Builder::build_datastore() !== false) {
        $myobj =& vB_Bitfield_Builder::init();
        require_once DIR . '/includes/functions.php';
        require_once DIR . '/includes/functions_misc.php';
        foreach (array_keys($myobj->datastore) as $group) {
            $vbulletin->{'bf_' . $group} =& $myobj->datastore["{$group}"];
            foreach (array_keys($myobj->datastore["{$group}"]) as $subgroup) {
                $vbulletin->{'bf_' . $group . '_' . $subgroup} =& $myobj->datastore["{$group}"]["{$subgroup}"];
            }
        }
    } else {
        trigger_error('Error Building Bitfields', E_USER_ERROR);
    }
}
// setup an empty hook class in case we run some of the main vB code
require_once DIR . '/includes/class_hook.php';
$hookobj =& vBulletinHook::init();
$vbulletin->pluginlist = '';
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 12:39, Wed May 30th 2012
|| # CVS: $RCSfile$ - $Revision: 39862 $
|| ####################################################################
\*======================================================================*/
예제 #2
0
 /**
  * Fetches the array of hooks that have been used.
  */
 function fetch_hookusage()
 {
     $obj =& vBulletinHook::init();
     return $obj->hookusage;
 }
 /**
  * Handles importing of plugins into memory for a given project.
  * @param   VDE_Project
  */
 protected function _handlePlugins($project)
 {
     $hookObj = vBulletinHook::init();
     foreach ($project->getPlugins() as $hook => $code) {
         if ($hook == 'init_startup') {
             $this->_initCode .= "\n{$code}\n";
         } else {
             $hookObj->pluginlist[$hook] .= "\n" . $code . "\n";
         }
     }
 }
예제 #4
0
 /**
  * Adds phpcode to a given hook as if a plugin containing that code was
  * defined for that hook.
  *
  * @param string $hook
  * @param string $phpcode
  */
 private function registerHook($hook, $phpcode)
 {
     $list =& vBulletinHook::init()->pluginlist;
     // Make sure the key exists, even if as an empty string
     if (empty($list[$hook])) {
         $list[$hook] = '';
     }
     // Append new code
     $list[$hook] .= "\n{$phpcode}";
 }
예제 #5
0
/**
 * Injects plugin code at run-time.
 * 
 * @param	string		Hook name
 * @param	string		Code to inject
 */
function goldbrick_inject_plugin($hook, $code)
{
    $hook_obj =& vBulletinHook::init();
    if (!isset($hook_obj->pluginlist[$hook])) {
        $hook_obj->pluginlist[$hook] = $code;
    } else {
        $hook_obj->pluginlist[$hook] .= "\n{$code}\n";
    }
}