本文整理匯總了PHP中CAppUI::getLoadableModuleList方法的典型用法代碼示例。如果您正苦於以下問題:PHP CAppUI::getLoadableModuleList方法的具體用法?PHP CAppUI::getLoadableModuleList怎麽用?PHP CAppUI::getLoadableModuleList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CAppUI
的用法示例。
在下文中一共展示了CAppUI::getLoadableModuleList方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: CAppUI
<?php
// Function to scan the event queue and execute any functions required.
require_once 'base.php';
require_once W2P_BASE_DIR . '/includes/config.php';
require_once W2P_BASE_DIR . '/includes/main_functions.php';
require_once W2P_BASE_DIR . '/includes/db_adodb.php';
require_once W2P_BASE_DIR . '/classes/ui.class.php';
require_once W2P_BASE_DIR . '/classes/event_queue.class.php';
require_once W2P_BASE_DIR . '/classes/query.class.php';
$AppUI = new CAppUI();
$AppUI->setUserLocale();
$queue = new EventQueue();
$queue->scan();
/*
This is the first piece of a simple hook system to allow for regularly
scheduled maintenance tasks to occur. This could be data validation and
cleanup, sending email notifications, or workflow related tasks.
The model for this functionality was based on Drupal's methods for laying
out and interacting with hooks. It should not be considered complete at
this time.
*/
$moduleList = $AppUI->getLoadableModuleList();
foreach ($moduleList as $module) {
$object = new $module['mod_main_class']();
if (is_callable(array($object, 'hook_cron'))) {
$object->hook_cron();
}
}
示例2: hook_cron
public function hook_cron()
{
global $w2Pconfig;
if (w2PgetConfig('system_update_check', true)) {
$lastCheck = w2PgetConfig('system_update_last_check', '');
$nowDate = new DateTime("now");
if ('' == $lastCheck) {
$checkForUpdates = true;
} else {
$systemDate = new DateTime($lastCheck);
$difference = 0;
//$nowDate->diff($systemDate)->format('%d');
$checkForUpdates = $difference >= 7 ? true : false;
}
if ($checkForUpdates) {
$AppUI = new CAppUI();
$configList = array();
$moduleList = $AppUI->getLoadableModuleList();
foreach ($moduleList as $module) {
$configList[$module['mod_directory']] = $module['mod_version'];
}
$configList['w2p_ver'] = $AppUI->getVersion();
$configList['php_ver'] = PHP_VERSION;
$configList['database'] = $w2Pconfig['dbtype'];
$configList['server'] = $_SERVER['SERVER_SOFTWARE'];
$configList['connector'] = php_sapi_name();
$configList['database_ver'] = mysql_get_client_info();
$libraries = array('tidy', 'json', 'libxml', 'mysql');
foreach ($libraries as $library) {
$configList[$library . '_extver'] = phpversion($library);
}
if (function_exists('gd_info')) {
$lib_version = gd_info();
$configList['gd_extver'] = $lib_version['GD Version'];
}
if (function_exists('curl_version')) {
$lib_version = curl_version();
$configList['curl_extver'] = $lib_version['version'];
}
$request = new w2p_Utilities_HTTPRequest('http://stats.web2project.net');
$request->addParameters($configList);
$result = $request->processRequest();
$data = json_decode($result);
$q = new w2p_Database_Query();
$q->addTable('config');
if ('' == w2PgetConfig('available_version', '')) {
$q->addInsert('config_name', 'available_version');
$q->addInsert('config_value', $data->w2p_ver);
$q->addInsert('config_group', 'admin_system');
$q->addInsert('config_type', 'text');
} else {
$q->addUpdate('config_value', $data->w2p_ver);
$q->addWhere("config_name = 'available_version'");
}
$q->exec();
$q->clear();
$q->addTable('config');
$q->addUpdate('config_value', date('Y-m-d H:i:s'));
$q->addWhere("config_name = 'system_update_last_check'");
$q->exec();
}
}
}