本文整理汇总了PHP中ipsRegistry::version方法的典型用法代码示例。如果您正苦于以下问题:PHP ipsRegistry::version方法的具体用法?PHP ipsRegistry::version怎么用?PHP ipsRegistry::version使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ipsRegistry
的用法示例。
在下文中一共展示了ipsRegistry::version方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _checkIPSReport
/**
* Check for IPS Report. Prints XML file if called properly. No longer used, really.
*
* @access protected
* @return void
* @since 2.0
* @deprecated Consider removing this. We no longer use this.
*/
protected function _checkIPSReport()
{
//-----------------------------------------
// Note, this is designed to allow IPS validate boards
// who've purchased copyright removal / registration.
// The order number is the only thing shown and the
// order number is unique to the person who paid and
// is no good to anyone else.
// Showing the order number poses no risk at all -
// the information is useless to anyone outside of IPS.
//-----------------------------------------
$pass = 0;
$key = isset($this->request['key']) ? trim($this->request['key']) : '';
$cust_number = 0;
$acc_number = 0;
$cust_number_tmp = '0,0';
if (isset($this->request['ipsreport']) and $this->request['ipsreport'] or isset($this->request['ipscheck']) and $this->request['ipscheck']) {
if ($this->settings['ipb_copy_number']) {
$cust_number_tmp = preg_replace("/^(\\d+?)-(\\d+?)-(\\d+?)-(\\S+?)\$/", "\\2,\\3", $this->settings['ipb_copy_number']);
} else {
if ($this->settings['ipb_reg_number']) {
$cust_number_tmp = preg_replace("/^(\\d+?)-(\\d+?)-(\\d+?)-(\\d+?)-(\\S+?)\$/", "\\2,\\4", $this->settings['ipb_reg_number']);
}
}
if (md5($key) == '23f2554a507f6d52b8f27934d3d2a88d') {
$latest_version = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'upgrade_history', 'order' => 'upgrade_version_id DESC', 'limit' => array(0, 1)));
if (ipsRegistry::$version == 'v<{%dyn.down.var.human.version%}>') {
ipsRegistry::$version = 'v' . $latest_version['upgrade_version_human'];
}
if (ipsRegistry::$acpversion == '<{%dyn.down.var.long_version_id%}>') {
ipsRegistry::$acpversion = $latest_version['upgrade_version_id'];
}
list($cust_number, $acc_number) = explode(',', $cust_number_tmp);
@header("Content-type: text/xml");
$out = '<?xml version="1.0" encoding="ISO-8859-1"?' . '>';
$out .= "\n<ipscheck>\n\t<result>1</result>\n\t<customer_id>{$cust_number}</customer_id>\n\t<account_id>{$acc_number}</account_id>\n\t" . "<version_id>{ipsRegistry::{$acpversion}}</version_id>\n\t<version_string>{ipsRegistry::{$version}}</version_string>\n\t<release_hash><![CDATA[<{%dyn.down.var.md5%}]]>></release_hash>" . "\n</ipscheck>";
print $out;
exit;
} else {
if (md5($key) == 'd66ab5043c553f1f1fd5fad3ece252e3') {
$latest_version = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'upgrade_history', 'order' => 'upgrade_version_id DESC', 'limit' => array(0, 1)));
if (ipsRegistry::$version == 'v<{%dyn.down.var.human.version%}>') {
ipsRegistry::$version = 'v' . $latest_version['upgrade_version_human'];
}
if (ipsRegistry::$acpversion == '<{%dyn.down.var.long_version_id%}>') {
ipsRegistry::$acpversion = $latest_version['upgrade_version_id'];
}
@header("Content-type: text/plain");
print ipsRegistry::$version . ' (ID:' . ipsRegistry::$acpversion . ')';
exit;
} else {
@header("Content-type: text/plain");
print "<result>0</result>\nYou do not have permission to view this page.";
exit;
}
}
}
}
示例2: doExecute
/**
* Main class entry point
*
* @access public
* @param object ipsRegistry reference
* @return void [Outputs to screen]
*/
public function doExecute(ipsRegistry $registry)
{
//-----------------------------------------
// Load skin
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate('cp_skin_mycp');
//-----------------------------------------
// Load language
//-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile(array('admin_mycp'));
//-----------------------------------------
// Set up stuff
//-----------------------------------------
$this->form_code = $this->html->form_code = 'module=mycp&section=dashboard';
$this->form_code_js = $this->html->form_code_js = 'module=mycp§ion=dashboard';
//-----------------------------------------
// INIT
//-----------------------------------------
define('IPS_NEWS_URL', 'http://external./globalfeeds/news/');
define('IPS_BULLETINS_URL', 'http://external./ipbfeeds/300/staffbulletin/');
define('IPS_VERSION_CHECK_URL', 'http://www./latestversioncheck/ipb30x.php');
$content = array();
$thiscontent = "";
$latest_version = array();
$reg_end = "";
$sm_install = 0;
$lock_file = 0;
$converter = 0;
$fulltext_a = 0;
$unfinished_upgrade = 0;
$urls = array('news' => IPS_NEWS_URL, 'keiths_bits' => IPS_BULLETINS_URL, 'version_check' => IPS_VERSION_CHECK_URL, 'blogs' => 'http://external./globalfeeds/blog/');
if (@file_exists(IPS_ROOT_PATH . 'install/index.php')) {
$sm_install = 1;
}
if (@file_exists(DOC_IPS_ROOT_PATH . 'cache/installer_lock.php')) {
$lock_file = 1;
}
if (@is_dir(IPS_ROOT_PATH . 'applications_addon/ips/convert/')) {
$converter = 1;
if (!@file_exists(DOC_IPS_ROOT_PATH . 'cache/converter_lock.php')) {
$converter = 2;
}
}
if ($this->DB->checkFulltextSupport()) {
if (!$this->DB->getFulltextStatus('posts')) {
$fulltext_a = 1;
}
}
require_once IPS_ROOT_PATH . '/setup/sources/base/setup.php';
$versions = IPSSetUp::fetchAppVersionNumbers('core');
if ($versions['current'][0] != $versions['latest'][0]) {
$unfinished_upgrade = 1;
}
//-----------------------------------------
// Get MySQL & PHP Version
//-----------------------------------------
$this->DB->getSqlVersion();
//-----------------------------------------
// Upgrade history?
//-----------------------------------------
$latest_version = array('upgrade_version_id' => NULL);
$this->DB->build(array('select' => '*', 'from' => 'upgrade_history', 'order' => 'upgrade_version_id DESC', 'limit' => array(1)));
$this->DB->execute();
while ($r = $this->DB->fetch()) {
$latest_version = $r;
}
//-----------------------------------------
// Resetting security image?
//-----------------------------------------
if ($this->request['reset_security_flag'] and $this->request['reset_security_flag'] == 1 and $this->request['new_build']) {
$_latest = IPSLib::fetchVersionNumber('core');
$new_build = intval($this->request['new_build']);
$new_reason = trim(substr($this->request['new_reason'], 0, 1));
$new_version = $_latest['long'] . '.' . $new_build . '.' . $new_reason;
$this->DB->update('upgrade_history', array('upgrade_notes' => $new_version), 'upgrade_version_id=' . $latest_version['upgrade_version_id']);
$latest_version['upgrade_notes'] = $new_version;
}
//-----------------------------------------
// Got real version number?
//-----------------------------------------
ipsRegistry::$version = 'v' . $latest_version['upgrade_version_human'];
ipsRegistry::$vn_full = (isset($latest_version['upgrade_notes']) and $latest_version['upgrade_notes']) ? $latest_version['upgrade_notes'] : ipsRegistry::$vn_full;
//-----------------------------------------
// Licensed?
//-----------------------------------------
$urls['keiths_bits'] = IPS_BULLETINS_URL . '?v=' . ipsRegistry::$vn_full;
//-----------------------------------------
// Notepad
//-----------------------------------------
if ($this->request['save'] and $this->request['save'] == 1) {
$_POST['notes'] = $_POST['notes'] ? $_POST['notes'] : $this->lang->words['cp_acpnotes'];
$this->cache->setCache('adminnotes', IPSText::stripslashes($_POST['notes']), array('donow' => 1, 'deletefirst' => 0, 'array' => 0));
}
//.........这里部分代码省略.........
示例3: doExecute
/**
* Main function executed automatically by the controller
*
* @param object $registry Registry object
* @return @e void
*/
public function doExecute(ipsRegistry $registry)
{
//-----------------------------------------
// Load skin
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate('cp_skin_mycp');
//-----------------------------------------
// Load language
//-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile(array('admin_mycp'));
/* This is a little hacky, but we have to allow access to the whole module to get access to
'change my details'. This check just makes sure that we don't also get access to the Dashboard
if the permission system automatically added permission for 'change my details' */
if ($this->registry->getClass('class_permissions')->editDetailsOnly) {
/* If they just don't have access to the dashboard, let's show them something we do have access to */
if (!$this->request['app']) {
foreach (ipsRegistry::$applications as $k => $data) {
if ($this->registry->getClass('class_permissions')->checkForAppAccess($k) and ($k != 'core' or !$this->registry->getClass('class_permissions')->editDetailsOnly)) {
foreach (ipsRegistry::$modules[$k] as $module) {
if ($this->registry->getClass('class_permissions')->checkForModuleAccess($k, $module['sys_module_key'])) {
$filepath = IPSLib::getAppDir($k) . '/modules_admin/' . $module['sys_module_key'] . '/defaultSection.php';
if (is_file($filepath)) {
$DEFAULT_SECTION = '';
include $filepath;
/*noLibHook*/
if ($this->registry->getClass('class_permissions')->checkForSectionAccess($k, $module['sys_module_key'], $DEFAULT_SECTION)) {
$this->registry->output->silentRedirectWithMessage($this->settings['base_url'] . "app={$k}&module={$module['sys_module_key']}&section={$DEFAULT_SECTION}");
}
}
}
}
}
}
}
/* If all else fails, take them to the change details page */
$this->registry->output->silentRedirectWithMessage($this->settings['base_url'] . "core&module=mycp&section=details");
} else {
if (!$this->registry->getClass('class_permissions')->checkPermission('dashboard', 'core', 'mycp')) {
$this->registry->output->silentRedirectWithMessage($this->settings['base_url'] . "core&module=mycp&section=details");
}
}
//-----------------------------------------
// Set up stuff
//-----------------------------------------
$this->form_code = $this->html->form_code = 'module=mycp&section=dashboard';
$this->form_code_js = $this->html->form_code_js = 'module=mycp§ion=dashboard';
//-----------------------------------------
// Hang on, do we need the upgrader?
// The only reason this is still here, since we check on the login form, is because Rhett Buck AKA BHP wants to
// login to the ACP, then upload files, then click the System tab and be automatically redirected to the upgrader.
// Seriously though? Who does that? The login form redirects you, so if you happen to upload files and click on
// the ACP link you're already covered. Only Mr. RB, that's who.
//-----------------------------------------
if (!IN_DEV and (!defined('SKIP_UPGRADE_CHECK') or !SKIP_UPGRADE_CHECK)) {
require_once IPS_ROOT_PATH . 'setup/sources/base/setup.php';
/*noLibHook*/
foreach (ipsRegistry::$applications as $app_dir => $app) {
$_a = ($app_dir == 'forums' or $app_dir == 'members') ? 'core' : $app_dir;
$numbers = IPSSetUp::fetchAppVersionNumbers($_a);
if ($numbers['latest'][0] and $numbers['latest'][0] > $numbers['current'][0]) {
$this->registry->output->silentRedirect($this->settings['base_acp_url'] . '/upgrade/index.php?_acpRedirect=1');
return;
}
}
}
//-----------------------------------------
// Get external data
//-----------------------------------------
$content = array();
$thiscontent = "";
$latest_version = array();
$reg_end = "";
$unfinished_upgrade = 0;
$ipsNewsData = $this->cache->getCache('ipsNewsData');
if (!isset($ipsNewsData['time']) or $ipsNewsData['time'] < time() - 43200) {
$classToLoad = IPSLib::loadLibrary(IPS_KERNEL_PATH . 'classFileManagement.php', 'classFileManagement');
$classFileManagement = new $classToLoad();
if (strpos($this->settings['base_url'], 'https://') !== false) {
$ipsNewsData['news'] = $classFileManagement->getFileContents('https://external.ipslink.com/ipboard33/dashboard/index.php?v=' . ipsRegistry::$vn_full);
$ipsNewsData['vcheck'] = $classFileManagement->getFileContents('https://external.ipslink.com/latestversioncheck/ipb30x.php?' . base64_encode(ipsRegistry::$vn_full . '|^|' . $this->settings['board_url']));
} else {
$ipsNewsData['news'] = $classFileManagement->getFileContents('http://external.ipslink.com/ipboard33/dashboard/index.php?v=' . ipsRegistry::$vn_full);
$ipsNewsData['vcheck'] = $classFileManagement->getFileContents('http://external.ipslink.com/latestversioncheck/ipb30x.php?' . base64_encode(ipsRegistry::$vn_full . '|^|' . $this->settings['board_url']));
}
$ipsNewsData['time'] = time();
$this->cache->setCache('ipsNewsData', $ipsNewsData, array('array' => 1));
}
//-----------------------------------------
// Get MySQL & PHP Version
//-----------------------------------------
$this->DB->getSqlVersion();
//-----------------------------------------
// Upgrade history?
//-----------------------------------------
//.........这里部分代码省略.........
示例4: checkCaches
/**
* Check caches
*
* @return @e void
* @author MattMecham
*/
protected function checkCaches()
{
//-----------------------------------------
// Check app cache data
//-----------------------------------------
# Apps
$app_cache = self::$handles['caches']->getCache('app_cache');
# Modules...
self::$modules = self::$handles['caches']->getCache('module_cache');
if (!count($app_cache) or !count(self::$modules)) {
self::$handles['caches']->rebuildCache('app_cache', 'global');
self::$handles['caches']->rebuildCache('module_cache', 'global');
$app_cache = self::$handles['caches']->getCache('app_cache');
self::$modules = self::$handles['caches']->getCache('module_cache');
}
//-----------------------------------------
// Build app data and APP specific load requests
//-----------------------------------------
foreach ($app_cache as $_app_dir => $_app_data) {
if (!IPS_IS_TASK and IPS_AREA == 'public' && !$_app_data['app_public_title']) {
continue;
}
$_app_data['app_public_title'] = $_app_data['app_public_title'] ? $_app_data['app_public_title'] : $_app_data['app_title'];
self::$applications[$_app_dir] = $_app_data;
}
/* Sort by position */
uasort(self::$applications, 'ipsRegistry::_appPositionSort');
# Modules by section...
foreach (self::$modules as $_app_dir => $_modules) {
foreach ($_modules as $_data) {
self::$modules_by_section[$_app_dir][$_data['sys_module_key']] = $_data;
}
}
//-----------------------------------------
// System vars and group
//-----------------------------------------
$systemvars_cache = self::$handles['caches']->getCache('systemvars');
if (!isset($systemvars_cache) or !isset($systemvars_cache['task_next_run'])) {
$update = array('task_next_run' => time());
$update['loadlimit'] = $systemvars_cache['loadlimit'] ? $systemvars_cache['loadlimit'] : 0;
$update['mail_queue'] = $systemvars_cache['mail_queue'] ? $systemvars_cache['mail_queue'] : 0;
$update['last_virus_check'] = $systemvars_cache['last_virus_check'] ? $systemvars_cache['last_virus_check'] : 0;
$update['last_deepscan_check'] = $systemvars_cache['last_deepscan_check'] ? $systemvars_cache['last_deepscan_check'] : 0;
self::$handles['caches']->setCache('systemvars', $update, array('donow' => 1, 'array' => 1));
}
$group_cache = self::$handles['caches']->getCache('group_cache');
if (!is_array($group_cache) or !count($group_cache)) {
$this->cache()->rebuildCache('group_cache', 'global');
}
//-----------------------------------------
// User agent caches
//-----------------------------------------
$useragent_cache = $this->cache()->getCache('useragents');
if (!is_array($useragent_cache) or !count($useragent_cache)) {
$this->cache()->rebuildCache('useragents', 'global');
}
//-----------------------------------------
// Output formats
//-----------------------------------------
$outputformats_cache = $this->cache()->getCache('outputformats');
if (!is_array($outputformats_cache) or !count($outputformats_cache)) {
$this->cache()->rebuildCache('outputformats', 'global');
}
//-----------------------------------------
// Hooks cache
//-----------------------------------------
if ($this->cache()->exists('hooks') !== TRUE) {
$this->cache()->rebuildCache('hooks', 'global');
}
//-----------------------------------------
// Version numbers
//-----------------------------------------
$version_numbers = $this->cache()->getCache('vnums');
if (!is_array($version_numbers) or !count($version_numbers)) {
$this->cache()->rebuildCache('vnums', 'global');
$version_numbers = $this->cache()->getCache('vnums');
}
/* Set them */
if (!defined('IPB_VERSION')) {
define('IPB_VERSION', $version_numbers['human']);
ipsRegistry::$version = IPB_VERSION;
}
if (!defined('IPB_LONG_VERSION')) {
define('IPB_LONG_VERSION', $version_numbers['long']);
ipsRegistry::$acpversion = IPB_LONG_VERSION;
ipsRegistry::$vn_full = IPB_LONG_VERSION;
}
//-----------------------------------------
// Any to rebuild?
//-----------------------------------------
if (count($this->cache()->fetchRebuildList())) {
foreach ($this->cache()->fetchRebuildList() as $_toRebuild) {
$this->cache()->rebuildCache($_toRebuild);
}
//.........这里部分代码省略.........