本文整理汇总了PHP中ModuleManager::load_modules方法的典型用法代码示例。如果您正苦于以下问题:PHP ModuleManager::load_modules方法的具体用法?PHP ModuleManager::load_modules怎么用?PHP ModuleManager::load_modules使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModuleManager
的用法示例。
在下文中一共展示了ModuleManager::load_modules方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: load_epesi
protected function load_epesi()
{
if (self::$epesi_loaded) {
return;
}
define('CID', false);
define('READ_ONLY_SESSION', true);
require_once '../../../include.php';
ModuleManager::load_modules();
self::$epesi_loaded = true;
if (!Base_AclCommon::is_user()) {
throw new ErrorException('Not logged in');
}
}
示例2: init
public function init()
{
$d = getcwd();
chdir('../../../../');
require_once 'include/epesi.php';
require_once 'include/cache.php';
require_once 'include/variables.php';
require_once 'include/misc.php';
require_once 'include/module_primitive.php';
require_once 'include/module_install.php';
require_once 'include/module_common.php';
require_once 'include/module.php';
require_once 'include/module_manager.php';
require_once 'include/autoloader.php';
ModuleManager::load_modules();
chdir($d);
global $E_SESSION;
$_SESSION['user'] = $E_SESSION['user'];
if (Base_RegionalSettingsCommon::time_12h()) {
$time = 'h:i a';
} else {
$time = 'H:i';
}
$date = Base_RegionalSettingsCommon::date_format();
switch ($date) {
case '%Y-%m-%d':
$date = 'Y-m-d';
break;
case '%m/%d/%Y':
$date = 'm/d/Y';
break;
case '%d %B %Y':
$date = 'd F Y';
break;
case '%d %b %Y':
$date = 'd M Y';
break;
case '%b %d, %Y':
$date = 'M d, Y';
break;
}
rcmail::get_instance()->config->set('date_short', 'D ' . $time);
rcmail::get_instance()->config->set('date_long', $date . ' ' . $time);
rcmail::get_instance()->config->set('date_today', $time);
$this->add_hook('message_outgoing_body', array($this, 'add_signature'));
$this->add_hook('user_create', array($this, 'lookup_user_name'));
}
示例3: ob_start
<?php
/**
*
* @author Georgi Hristov <ghristov@gmx.de>
* @copyright Copyright © 2014, Xoff Software GmbH
* @license MIT
* @version 1.0
* @package epesi-notify
*
*/
ob_start();
define('CID', $_REQUEST['cid']);
require_once '../../../include.php';
ModuleManager::load_modules();
if (!Base_AclCommon::is_user()) {
exit;
}
$general_setting = Base_NotifyCommon::get_general_setting();
if ($general_setting == -1) {
echo json_encode(array('disable' => 1));
exit;
}
$ret = null;
$notify_count = 0;
$group_similar = Base_NotifyCommon::group_similar();
$notifications = Base_NotifyCommon::get_notifications();
foreach ($notifications as $module => $notify) {
if (!isset($notify['tray'])) {
continue;
}
示例4: load_epesi
protected function load_epesi()
{
$this->CLI = (php_sapi_name() == 'cli');
if ($this->CLI) {
// allow to define DATA directory for CLI in argument
if(isset($argv)) {
define('EPESI_DIR','/');
if (isset($argv[1])) {
define('DATA_DIR', $argv[1]);
}
}
}
define('CID', false);
require_once('include.php');
ModuleManager::load_modules();
Base_LangCommon::load();
$this->system_version = Variable::get('version');
$this->current_version = EPESI_VERSION;
}
示例5: load_epesi
protected function load_epesi()
{
$this->CLI = php_sapi_name() == 'cli';
if ($this->CLI) {
global $argv;
// allow to define DATA directory for CLI in argument
if (isset($argv)) {
define('EPESI_DIR', '/');
foreach (array_slice($argv, 1) as $x) {
if ($x == '-f') {
$this->cli_force_update = true;
} elseif ($x == '-b') {
$this->cli_create_backup = true;
} else {
define('DATA_DIR', $x);
}
}
}
}
define('CID', false);
require_once 'include.php';
require_once 'include/backups.php';
ModuleManager::load_modules();
Base_LangCommon::load();
$this->system_version = Variable::get('version');
$this->current_version = EPESI_VERSION;
$this->current_revision = EPESI_REVISION;
}
示例6: process
public static function process($url, $history_call = false, $refresh = false)
{
if (MODULE_TIMES) {
$time = microtime(true);
}
$url = str_replace('&', '&', $url);
//do we need this if we set arg_separator.output to &?
if ($url) {
$_POST = array();
parse_str($url, $_POST);
if (get_magic_quotes_gpc()) {
$_POST = undoMagicQuotes($_POST);
}
$_GET = $_REQUEST =& $_POST;
}
ModuleManager::load_modules();
self::check_firstrun();
if ($history_call === '0') {
History::clear();
} elseif ($history_call) {
History::set_id($history_call);
}
//on init call methods...
$ret = on_init(null, null, null, true);
foreach ($ret as $k) {
call_user_func_array($k['func'], $k['args']);
}
$root =& ModuleManager::create_root();
self::go($root);
//go somewhere else?
$loc = location(null, true);
//on exit call methods...
$ret = on_exit(null, null, null, true, $loc === false);
foreach ($ret as $k) {
call_user_func_array($k['func'], $k['args']);
}
if ($loc !== false) {
if (isset($_REQUEST['__action_module__'])) {
$loc['__action_module__'] = $_REQUEST['__action_module__'];
}
//clean up
foreach (self::$content as $k => $v) {
unset(self::$content[$k]);
}
foreach (self::$jses as $k => $v) {
if ($v[1]) {
unset(self::$jses[$k]);
}
}
//go
$loc['__location'] = microtime(true);
return self::process(http_build_query($loc), false, true);
}
$debug = '';
if (DEBUG && ($debug_diff = @(include_once 'tools/Diff.php'))) {
require_once 'tools/Text/Diff/Renderer/inline.php';
$diff_renderer = new Text_Diff_Renderer_inline();
}
//clean up old modules
if (isset($_SESSION['client']['__module_content__'])) {
$to_cleanup = array_keys($_SESSION['client']['__module_content__']);
foreach ($to_cleanup as $k) {
$mod = ModuleManager::get_instance($k);
if ($mod === null) {
$xx = explode('/', $k);
$yy = explode('|', $xx[count($xx) - 1]);
$mod = $yy[0];
if (is_callable(array($mod . 'Common', 'destroy'))) {
call_user_func(array($mod . 'Common', 'destroy'), $k, isset($_SESSION['client']['__module_vars__'][$k]) ? $_SESSION['client']['__module_vars__'][$k] : null);
}
if (DEBUG) {
$debug .= 'Clearing mod vars & module content ' . $k . '<br>';
}
unset($_SESSION['client']['__module_vars__'][$k]);
unset($_SESSION['client']['__module_content__'][$k]);
}
}
}
$reloaded = array();
foreach (self::$content as $k => $v) {
$reload = $v['module']->get_reload();
$parent = $v['module']->get_parent_path();
if (DEBUG && REDUCING_TRANSFER) {
$debug .= '<hr style="height: 3px; background-color:black">';
$debug .= '<b> Checking ' . $k . ', parent=' . $v['module']->get_parent_path() . '</b><ul>' . '<li>Force - ' . (isset($reload) ? print_r($reload, true) : 'not set') . '</li>' . '<li>First display - ' . (isset($_SESSION['client']['__module_content__'][$k]) ? 'no</li>' . '<li>Content changed - ' . ($_SESSION['client']['__module_content__'][$k]['value'] !== $v['value'] ? 'yes' : 'no') . '</li>' . '<li>JS changed - ' . ($_SESSION['client']['__module_content__'][$k]['js'] !== $v['js'] ? 'yes' : 'no') : 'yes') . '</li>' . '<li>Parent reloaded - ' . (isset($reloaded[$parent]) ? 'yes' : 'no') . '</li>' . '<li>History call - ' . ($history_call ? 'yes' : 'no') . '</li>' . '</ul>';
}
if (!REDUCING_TRANSFER || (!isset($reload) && (!isset($_SESSION['client']['__module_content__'][$k]) || $_SESSION['client']['__module_content__'][$k]['value'] !== $v['value'] || $_SESSION['client']['__module_content__'][$k]['js'] !== $v['js']) || $history_call || $reload == true || isset($reloaded[$parent]))) {
//force reload or parent reloaded
if (DEBUG && isset($_SESSION['client']['__module_content__'])) {
$debug .= '<b>Reloading: ' . (isset($v['span']) ? '; span=' . $v['span'] . ',' : '') . ' triggered=' . ($reload == true ? 'force' : 'auto') . ', </b><hr><b>New value:</b><br><pre>' . htmlspecialchars($v['value']) . '</pre>' . (isset($_SESSION['client']['__module_content__'][$k]['value']) ? '<hr><b>Old value:</b><br><pre>' . htmlspecialchars($_SESSION['client']['__module_content__'][$k]['value']) . '</pre>' : '');
if ($debug_diff && isset($_SESSION['client']['__module_content__'][$k]['value'])) {
$xxx = new Text_Diff(explode("\n", $_SESSION['client']['__module_content__'][$k]['value']), explode("\n", $v['value']));
$debug .= '<hr><b>Diff:</b><br><pre>' . $diff_renderer->render($xxx) . '</pre>';
}
$debug .= '<hr style="height: 5px; background-color:black">';
}
if (isset($v['span'])) {
self::text($v['value'], $v['span']);
}
if ($v['js']) {
//.........这里部分代码省略.........