本文整理汇总了PHP中PhpFox::getVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP PhpFox::getVersion方法的具体用法?PHP PhpFox::getVersion怎么用?PHP PhpFox::getVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhpFox
的用法示例。
在下文中一共展示了PhpFox::getVersion方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get
public function get()
{
$oFile = Phpfox::getLib('file');
$bSlaveEnabled = Phpfox::getParam(array('db', 'slave'));
$sDriver = Phpfox::getParam(array('db', 'driver'));
$aStats = array
(
Phpfox::getPhrase('admincp.phpfox_version') => PhpFox::getVersion() . '<i>(build ' . Phpfox::getBuild() . ')</i>',
Phpfox::getPhrase('admincp.php_version') => '<a href="' . Phpfox::getLib('url')->makeUrl('admincp.core.phpinfo') . '">' . PHP_VERSION . '</a>',
Phpfox::getPhrase('admincp.php_sapi') => php_sapi_name(),
Phpfox::getPhrase('admincp.php_safe_mode') => (PHPFOX_SAFE_MODE ? Phpfox::getPhrase('admincp.true') : Phpfox::getPhrase('admincp.false')),
Phpfox::getPhrase('admincp.php_open_basedir') => (PHPFOX_OPEN_BASE_DIR ? Phpfox::getPhrase('admincp.true') : Phpfox::getPhrase('admincp.false')),
Phpfox::getPhrase('admincp.php_disabled_functions') => (@ini_get('disable_functions') ? str_replace( ",", ", ", @ini_get('disable_functions') ) : Phpfox::getPhrase('admincp.none')),
Phpfox::getPhrase('admincp.php_loaded_extensions') => implode(' ', get_loaded_extensions()),
Phpfox::getPhrase('admincp.operating_system') => PHP_OS,
Phpfox::getPhrase('admincp.server_time_stamp') => date('F j, Y, g:i a', PHPFOX_TIME) . ' (GMT)',
Phpfox::getPhrase('admincp.gzip') => (Phpfox::getParam('core.use_gzip') ? Phpfox::getPhrase('admincp.enabled') : Phpfox::getPhrase('admincp.disabled')),
Phpfox::getPhrase('admincp.sql_driver_version') => ($sDriver == 'DATABASE_DRIVER' ? Phpfox::getPhrase('admincp.n_a') : Phpfox::getLib('database')->getServerInfo()),
Phpfox::getPhrase('admincp.sql_slave_enabled') => ($bSlaveEnabled ? Phpfox::getPhrase('admincp.yes') : Phpfox::getPhrase('admincp.no')),
Phpfox::getPhrase('admincp.sql_total_slaves') => ($bSlaveEnabled ? count(Phpfox::getParam(array('db', 'slave_servers'))) : Phpfox::getPhrase('admincp.n_a')),
Phpfox::getPhrase('admincp.sql_slave_server') => ($bSlaveEnabled ? Phpfox::getLib('database')->sSlaveServer : Phpfox::getPhrase('admincp.n_a')),
Phpfox::getPhrase('admincp.memory_limit') => $oFile->filesize($this->_getUsableMemory()) . ' (' . @ini_get('memory_limit') . ')',
Phpfox::getPhrase('admincp.load_balancing_enabled') => (Phpfox::getParam(array('balancer', 'enabled')) ? Phpfox::getPhrase('admincp.yes') : Phpfox::getPhrase('admincp.no'))
);
if(strpos(strtolower(PHP_OS), 'win') === 0 || PHPFOX_SAFE_MODE || PHPFOX_OPEN_BASE_DIR)
{
}
else
{
$sMemory = @shell_exec("free -m");
$aMemory = explode("\n", str_replace( "\r", "", $sMemory));
if (is_array($aMemory))
{
$aMemory = array_slice($aMemory, 1, 1);
if (isset($aMemory[0]))
{
$aMemory = preg_split("#\s+#", $aMemory[0]);
$aStats[Phpfox::getPhrase('admincp.total_server_memory')] = (isset($aMemory[1]) ? $aMemory[1] . ' MB' : '--');
$aStats[Phpfox::getPhrase('admincp.available_server_memory')] = (isset($aMemory[3]) ? $aMemory[3] . ' MB' : '--');
}
}
}
if (!PHPFOX_OPEN_BASE_DIR && ($sLoad = Phpfox::getService('core.load')->get()) !== null)
{
$aStats[Phpfox::getPhrase('admincp.current_server_load')] = $sLoad;
}
return $aStats;
}
示例2: displayCaptcha
public function displayCaptcha($sText)
{
Phpfox::getParam('captcha.captcha_use_font') && function_exists('imagettftext') ? $this->_writeFromFont($sText) : $this->_writeFromString($sText);
ob_clean();
header("X-Content-Encoded-By: phpFox " . PhpFox::getVersion());
header("Pragma: no-cache");
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Content-Type: image/jpeg');
imagejpeg($this->_hImg);
imagedestroy($this->_hImg);
}
示例3: process
//.........这里部分代码省略.........
$this->template()->setHeader('<script>var admincpSettings = ' . json_encode($searchSettings) . ';</script>');
if ($is_settings && in_array($app, $aSkipModules) && $app != 'user' && $app != 'feed') {
$this->url()->send('admincp');
}
if ($app && Phpfox::isModule($app) && !in_array($app, $aSkipModules)) {
$app = Phpfox_Module::instance()->get($app);
$name = Phpfox_Locale::instance()->translate($app['module_id'], 'module');
$sSectionTitle = $name;
$menu = unserialize($app['menu']);
$menus = [];
$current = $this->url()->getUrl();
$infoActive = false;
if ($this->request()->get('req2') == 'app') {
$infoActive = true;
}
if (Admincp_Service_Setting_Setting::instance()->moduleHasSettings($app['module_id'])) {
$menus['Settings'] = ['is_active' => $is_settings, 'url' => $this->url()->makeUrl('admincp.setting.edit', ['module-id' => $app['module_id']])];
}
if (is_array($menu) && count($menu)) {
foreach ($menu as $key => $value) {
$is_active = false;
$url = 'admincp.' . implode('.', $value['url']);
if ($current == str_replace('.', '/', $url)) {
$is_active = true;
if ($infoActive) {
$menus['Info']['is_active'] = false;
}
}
$menus[Phpfox::getPhrase($key)] = ['url' => $url, 'is_active' => $is_active];
}
}
$this->template()->assign(['aSectionAppMenus' => $menus, 'ActiveApp' => (new Core\App())->get('__module_' . $app['module_id'])]);
}
$this->template()->assign(array('sSectionTitle' => $sSectionTitle, 'aModulesMenu' => $aModules, 'aAdminMenus' => $aMenus, 'aUserDetails' => $aUser, 'sPhpfoxVersion' => PhpFox::getVersion(), 'sSiteTitle' => Phpfox::getParam('core.site_title')))->setHeader(array('menu.css' => 'style_css', 'menu.js' => 'style_script', 'admin.js' => 'static_script', 'jquery/plugin/jquery.mosaicflow.min.js' => 'static_script'))->setTitle(Phpfox::getPhrase('admincp.admin_cp'));
if (in_array($app, ['plugin', 'module', 'component'])) {
$this->template()->setSectionTitle('Techie: ' . ucwords($app));
$this->template()->setActionMenu(['New ' . ucwords($app) => ['url' => $this->url()->makeUrl('admincp.' . $app . '.add'), 'class' => 'popup']]);
}
if ($bPass) {
Phpfox_Module::instance()->setController($this->_sModule . '.' . $this->_sController);
$sMenuController = str_replace(array('.index', '.phrase'), '', 'admincp.' . ($this->_sModule != 'admincp' ? $this->_sModule . '.' . str_replace('admincp.', '', $this->_sController) : $this->_sController));
$aCachedSubMenus = array();
$sActiveSideBar = '';
if ($sMenuController == 'admincp.setting.edit') {
$sMenuController = 'admincp.setting';
}
if ($this->_getMenuName() !== null) {
$sMenuController = $this->_getMenuName();
}
/*
foreach ($aMenus as $sKey => $aSubMenus)
{
if (is_array($aSubMenus))
{
foreach ($aSubMenus as $sSubkey => $mSubMenus)
{
if (is_array($mSubMenus))
{
foreach ($mSubMenus as $sSubkey2 => $mSubMenus2)
{
if ($sMenuController == $mSubMenus2)
{
$sActiveSideBar = $sSubkey;
foreach ($aSubMenus as $sSubkey3 => $mSubMenus3)
{
示例4: link
/**
* Provide "powered by" link.
*
* @param bool $bLink TRUE to include a link to phpFox.
* @param bool $bVersion TRUE to include the version being used.
* @return string Powered by phpFox string returned.
*/
public static function link($bLink = true, $bVersion = true)
{
if (Phpfox::getParam('core.branding')) {
return '';
}
return '' . ($bLink ? '<a href="http://www.phpfox.com/">' : '') . 'Powered By PHPFox' . ($bVersion ? ' Version ' . PhpFox::getVersion() : '') . ($bLink ? '</a>' : '');
}
示例5: process
//.........这里部分代码省略.........
$aMenus['admincp.extensions']['attachment.admincp_attachment_menu'] = array(
'attachment.admincp_menu_attachment_types' => 'admincp.attachment',
'attachment.admincp_menu_attachment_add' => 'admincp.attachment.add'
);
}
if (!Phpfox::getParam('core.branding'))
{
$aMenus['admincp.settings']['core.phpfox_branding_removal'] = 'admincp.core.branding';
}
if (Phpfox::getParam('core.phpfox_is_hosted'))
{
unset($aMenus['admincp.extensions']['admincp.module']);
unset($aMenus['admincp.extensions']['admincp.products']['admincp.create_new_product']);
unset($aMenus['admincp.extensions']['admincp.products']['admincp.import_export']);
unset($aMenus['admincp.extensions']['admincp.plugin']);
unset($aMenus['admincp.extensions']['admincp.language']['language.import_language_pack']);
unset($aMenus['admincp.extensions']['admincp.theme']['theme.create_a_new_template']);
unset($aMenus['admincp.extensions']['admincp.theme']['theme.admincp_create_css_file']);
unset($aMenus['admincp.extensions']['admincp.theme']['theme.admincp_menu_import_themes']);
unset($aMenus['admincp.extensions']['admincp.theme']['theme.admincp_menu_import_styles']);
unset($aMenus['admincp.extensions']['emoticon.emoticons']['emoticon.import_export_emoticon']);
unset($aMenus['admincp.settings']['admincp.system_settings_menu']['admincp.add_new_setting']);
unset($aMenus['admincp.settings']['admincp.system_settings_menu']['admincp.add_new_setting_group']);
}
(($sPlugin = Phpfox_Plugin::get('admincp.component_controller_index_process_menu')) ? eval($sPlugin) : false);
$this->template()->assign(array(
'aModulesMenu' => $aModules,
'aAdminMenus' => $aMenus,
'aUserDetails' => Phpfox::getUserBy(),
'sPhpfoxVersion' => PhpFox::getVersion(),
'sSiteTitle' => Phpfox::getParam('core.site_title')
)
)->setHeader(array(
'menu.css' => 'style_css',
"<!--[if IE]\n\t\t\t<link rel=\"stylesheet\" href=\"" . $this->template()->getStyle('css') . "ie.css\">\n\t\t\t<script type=\"text/javascript\">\n\t\t\t\t window.mlrunShim = true;\n\t\t\t</script>\n\t\t<![endif]-->",
'menu.js' => 'style_script',
"<!--[if lt IE 7]>\n\t\t\t<link rel=\"stylesheet\" href=\"" . $this->template()->getStyle('css') . "ie6.css\">\n\t\t<![endif]-->",
"<!--[if IE 6]>\n\t\t\t<script type=\"text/javascript\" src=\"" . Phpfox::getParam('core.url_static_script') . "admin_ie6.js\"></script>\n\t\t<![endif]-->",
'admin.js' => 'static_script'
)
)->setTitle(Phpfox::getPhrase('admincp.admin_cp'));
if ($bPass)
{
Phpfox::getLib('module')->setController($this->_sModule . '.' . $this->_sController);
$sMenuController = str_replace(array('.index', '.phrase'), '', 'admincp.' . ($this->_sModule != 'admincp' ? $this->_sModule . '.' . str_replace('admincp.', '', $this->_sController) : $this->_sController));
$aCachedSubMenus = array();
$sActiveSideBar = '';
if ($sMenuController == 'admincp.setting.edit')
{
$sMenuController = 'admincp.setting';
}
if ($this->_getMenuName() !== null)
{
$sMenuController = $this->_getMenuName();
}
foreach ($aMenus as $sKey => $aSubMenus)
{
示例6: link
/**
* Provide "powered by" link.
*
* @param bool $bLink TRUE to include a link to phpFox.
* @param bool $bVersion TRUE to include the version being used.
* @return string Powered by phpFox string returned.
*/
public static function link($bLink = true, $bVersion = true)
{
if (Phpfox::getParam('core.branding')) {
return '';
}
return 'Powered By PHPFox' . ($bVersion ? ' Version ' . PhpFox::getVersion() : '');
}
示例7: send
/**
* Send a request to another server. Usually using CURL.
*
* @param string $sUrl URL of the server.
* @param array $aPost $_POST data to send.
* @param string $sMethod Method of request (GET or POST).
* @param string $sUserAgent Useragent to send.
* @param string $aCookies ARRAY of any cookies to pass.
* @return mixed FALSE if failed to connect, STRING if anything was returned from the server.
*/
public function send($sUrl, $aPost = array(), $sMethod = 'POST', $sUserAgent = null, $aCookies = null, $bFollow = false)
{
$aHost = parse_url($sUrl);
$sPost = '';
foreach ($aPost as $sKey => $sValue) {
$sPost .= '&' . $sKey . '=' . $sValue;
}
// Curl
if (extension_loaded('curl') && function_exists('curl_init')) {
$hCurl = curl_init();
curl_setopt($hCurl, CURLOPT_URL, $sMethod == 'GET' && !empty($sPost) ? $sUrl . '?' . ltrim($sPost, '&') : $sUrl);
curl_setopt($hCurl, CURLOPT_HEADER, false);
curl_setopt($hCurl, CURLOPT_FOLLOWLOCATION, $bFollow);
curl_setopt($hCurl, CURLOPT_RETURNTRANSFER, true);
// Testing this out at the moment...
curl_setopt($hCurl, CURLOPT_SSL_VERIFYPEER, false);
// Run if this is a POST request method
if ($sMethod != 'GET') {
curl_setopt($hCurl, CURLOPT_POST, true);
curl_setopt($hCurl, CURLOPT_POSTFIELDS, $sPost);
}
// Add the browser agent
curl_setopt($hCurl, CURLOPT_USERAGENT, $sUserAgent === null ? "" . PHPFOX::BROWSER_AGENT . " (" . PhpFox::getVersion() . ")" : $sUserAgent);
// Check if we need to set some cookies
if ($aCookies !== null) {
$sLine = "\n";
// Loop thru all the cookies we currently have set
foreach ($aCookies as $sKey => $sValue) {
// Make sure we don't see the session ID or the browser will crash
if ($sKey == 'PHPSESSID') {
continue;
}
// Add the cookies
$sLine .= '' . $sKey . '=' . $sValue . '; ';
}
// Trim the cookie
$sLine = trim(rtrim($sLine, ';'));
// Set the cookie
curl_setopt($hCurl, CURLOPT_COOKIE, $sLine);
}
// Run the exec
$sData = curl_exec($hCurl);
// Close the curl connection
curl_close($hCurl);
// Return whatever we can from the curl request
return trim($sData);
}
// file_get_contents()
if ($sMethod == 'GET' && ini_get('allow_url_fopen') && function_exists('file_get_contents')) {
$sData = file_get_contents($sUrl . "?" . ltrim($sPost, '&'));
return trim($sData);
}
// fsockopen
if (!isset($sData)) {
$hConnection = fsockopen($aHost['host'], 80, $errno, $errstr, 30);
if (!$hConnection) {
return false;
} else {
if ($sMethod == 'GET') {
$sUrl = $sUrl . '?' . ltrim($sPost, '&');
}
$sSend = "{$sMethod} {$sUrl} HTTP/1.1\r\n";
$sSend .= "Host: {$aHost['host']}\r\n";
$sSend .= "User-Agent: " . PHPFOX::BROWSER_AGENT . " (" . PhpFox::getVersion() . ")\r\n";
$sSend .= "Content-Type: application/x-www-form-urlencoded\r\n";
$sSend .= "Content-Length: " . strlen($sPost) . "\r\n";
$sSend .= "Connection: close\r\n\r\n";
$sSend .= $sPost;
fwrite($hConnection, $sSend);
$sData = '';
while (!feof($hConnection)) {
$sData .= fgets($hConnection, 128);
}
$aResponse = preg_split("/\r\n\r\n/", $sData);
$sHeader = $aResponse[0];
$sData = $aResponse[1];
if (!(strpos($sHeader, "Transfer-Encoding: chunked") === false)) {
$aAux = split("\r\n", $sData);
for ($i = 0; $i < count($aAux); $i++) {
if ($i == 0 || $i % 2 == 0) {
$aAux[$i] = '';
}
$sData = implode("", $aAux);
}
}
return chop($sData);
}
}
return false;
}
示例8: getDetails
/**
* Debug output found at the bottom of the site when debug mode is enabled.
*
* @static
* @return mixed Only returns something if the installer is being used and in that case it returns FALSE
*/
public static function getDetails()
{
if (defined('PHPFOX_INSTALLER')) {
return false;
}
// SQL
$iSqlCount = 0;
$fSum = 0.0;
$fLimit = 0.05 * 128;
$iSqlMemory = 0;
$aKeywords = array('SELECT', 'SELECT ', 'FROM', 'FROM ', 'WHERE ', 'UPDATE ', 'OFFSET', ' AS ', 'UNION ALL', 'INNER JOIN ', 'LEFT JOIN ', 'INSERT INTO ', 'SHOW COLUMNS ', 'ON', 'SET', 'USING', 'USE INDEX', 'JOIN ', 'ORDER BY', 'DESC', 'LIMIT', 'DELETE');
$oRequest = Phpfox_Request::instance();
$oFile = Phpfox_File::instance();
$aReplaces = array_map(array('self', '_addKeywordSyntax'), $aKeywords);
$sDriver = Phpfox::getParam(array('db', 'driver'));
$sSql = '';
$bIsCmd = PHP_SAPI == 'cli' || defined('PHPFOX_IS_AJAX') && PHPFOX_IS_AJAX;
if (!isset(self::$_aDebugHistory['sql'])) {
self::$_aDebugHistory['sql'] = array();
}
// Fresh install, no need to display sql debug
if ($sDriver == 'DATABASE_DRIVER') {
self::$_aDebugHistory['sql'] = array();
}
foreach (self::$_aDebugHistory['sql'] as $aLine) {
if (!isset($aLine['sql'])) {
continue;
}
$iSqlCount++;
$sExtra = Phpfox_Database::instance()->sqlReport($aLine['sql']);
if ($bIsCmd) {
$sSql .= "\n ----------------- \n Rows: " . $aLine['rows'] . " Slave: " . ($aLine['slave'] ? 'Yes' : 'No') . " \n " . $aLine['sql'] . " \n\n";
} else {
if ($aLine['time'] == '0.0000000') {
$aLine['time'] = '0.0000001';
}
$sColor = sprintf('%02X', min(255, $fLimit / $aLine['time']));
$aLine['sql'] = str_replace($aKeywords, $aReplaces, htmlspecialchars($aLine['sql']));
$sSql .= '<div class="nDebugInfo">
<span style="background-color: #FF' . $sColor . $sColor . '; color:#000; padding:2px;">' . $aLine['time'] . '</span>
| <b>Memory Before:</b> ' . $oFile->filesize($aLine['memory_before']) . '
| <b>Memory After:</b> ' . $oFile->filesize($aLine['memory_after']) . '
| <b>Memory Used:</b> ' . $oFile->filesize($aLine['memory_after'] - $aLine['memory_before']) . '
| <b>Rows:</b> ' . $aLine['rows'] . '
| <b>Slave:</b> ' . ($aLine['slave'] ? 'Yes' : 'No') . '
</div>';
$sSql .= '<div class="nDebugItems">' . self::_parseSQL($aLine['sql']) . '' . $sExtra . '</div>';
}
$fSum += $aLine['time'];
$iSqlMemory += $aLine['memory_after'] - $aLine['memory_before'];
}
// General Stats
$iTotalTime = sprintf('%0.7f', array_sum(explode(' ', microtime())) - PHPFOX_TIME_START);
$iTotalSqlTime = sprintf('%0.7f', $fSum);
$sDebugReturn = '<div id="js_main_debug_holder">';
if (!defined('PHPFOX_MEM_END')) {
define('PHPFOX_MEM_END', memory_get_usage());
}
if (PHPFOX_DEBUG_LEVEL === 1) {
$sDebugReturn .= '<div style="font-size:9pt; text-align:center; padding-bottom:50px;">Page generated in ' . round($iTotalTime, 4) . ' seconds with ' . $iSqlCount . ' queries and GZIP ' . (Phpfox::getParam('core.use_gzip') ? 'enabled' : 'disabled') . ' on ' . $_SERVER['SERVER_ADDR'] . '.</div>';
} elseif (PHPFOX_DEBUG_LEVEL === 2 || PHPFOX_DEBUG_LEVEL === 3) {
$bSlaveEnabled = Phpfox::getParam(array('db', 'slave'));
$aStats = array('Version' => PhpFox::getVersion(), 'Product Code Name' => PhpFox::getCodeName(), '1' => '', 'Total Time' => $iTotalTime, 'PHP General Time' => $iTotalTime - $iTotalSqlTime, 'GZIP' => Phpfox::getParam('core.use_gzip') ? 'enabled' : 'disabled', '2' => '', 'Driver Version' => $sDriver == 'DATABASE_DRIVER' ? 'N/A' : Phpfox_Database::instance()->getServerInfo(), 'SQL Time' => $iTotalSqlTime, 'SQL Queries' => $iSqlCount, 'SQL Memory Usage' => $oFile->filesize($iSqlMemory), 'SQL Slave Enabled' => $bSlaveEnabled ? 'Yes' : 'No', 'SQL Total Slaves' => $bSlaveEnabled ? count(Phpfox::getParam(array('db', 'slave_servers'))) : 'N/A', 'SQL Slave Server' => $bSlaveEnabled ? Phpfox_Database::instance()->sSlaveServer : 'N/A', '3' => '', 'Total Memory Usage' => $oFile->filesize(PHPFOX_MEM_END), 'Total Memory Usage (Including Debug)' => $oFile->filesize(memory_get_usage()), 'Memory Limit' => $oFile->filesize(self::_getUsableMemory()) . ' (' . @ini_get('memory_limit') . ')', '4' => '', 'Load Balancing Enabled' => Phpfox::getParam(array('balancer', 'enabled')) ? 'Yes' : 'No', 'Requests From' => $oRequest->getServer('SERVER_ADDR'), 'Server ID#' => $oRequest->getServer('PHPFOX_SERVER_ID'), '5' => '', 'Server Time Stamp' => date('F j, Y, g:i a', PHPFOX_TIME), 'PHP Version' => PHP_VERSION, 'PHP Sapi' => php_sapi_name(), 'PHP safe_mode' => PHPFOX_SAFE_MODE ? 'true' : 'false', 'PHP open_basedir' => PHPFOX_OPEN_BASE_DIR ? 'true' : 'false', 'Operating System' => PHP_OS, '6' => '', 'Cache' => Phpfox::getParam('core.cache_storage'));
if (extension_loaded('xdebug')) {
$aXdebug = array('4' => '', 'xDebug File Name' => xdebug_get_profiler_filename(), 'xDebug Total Time' => xdebug_time_index());
$aStats = array_merge($aStats, $aXdebug);
}
$sDebugStats = '';
foreach ($aStats as $sStatTitle => $mStatValue) {
if (!$mStatValue) {
$sDebugStats .= $bIsCmd ? "\n" : "<br />";
} else {
$sDebugStats .= $bIsCmd ? "" . $sStatTitle . ": " . $mStatValue . "\n" : "<div class=\"nDebugLeft\">" . $sStatTitle . ":</div><div>" . $mStatValue . "</div>\n<div class=\"nClear\"></div>\n";
}
}
$aCookies = array();
$sCookiePrefix = Phpfox::getParam('core.session_prefix');
$iPrefixLength = strlen($sCookiePrefix);
foreach ($_COOKIE as $sKey => $sValue) {
if (substr($sKey, 0, $iPrefixLength) != $sCookiePrefix) {
continue;
}
$aCookies[$sKey] = $sValue;
}
if ($bIsCmd) {
$sDebugReturn .= $sDebugStats;
$sDebugReturn .= "##############################################";
} else {
$sDebugReturn .= '
<div id="n_debug">
<div id="n_debug_header">
phpFox Developers Debug
<a href="#" onclick="if (getCookie(\'js_console\')) { deleteCookie(\'js_console\'); $(\'#firebug_no_console\').remove(); } else { setCookie(\'js_console\', \'1\', 365); p(\'Enabled JavaScript Console\'); } return false;">Toggle JavaScript Console</a>
</div>
//.........这里部分代码省略.........
示例9: link
/**
* Provide "powered by" link.
*
* @param bool $bLink TRUE to include a link to phpFox.
* @param bool $bVersion TRUE to include the version being used.
* @return string Powered by phpFox string returned.
*/
public static function link($bLink = true, $bVersion = true)
{
return 'Powered By ' . ($bLink ? '' : '') . 'phpFox' . ($bLink ? '' : '') . ($bVersion ? ' Version ' . PhpFox::getVersion() : '');
}
示例10: run
public function run()
{
if (defined('PHPFOX_IS_HOSTED_SCRIPT')) {
$this->_update();
exit;
}
if ($this->_bUpgrade && (int) substr($this->_getCurrentVersion(), 0, 1) < 2 && file_exists(PHPFOX_DIR . '.htaccess')) {
$sHtaccessContent = file_get_contents(PHPFOX_DIR . '.htaccess');
if (preg_match('/RewriteEngine/i', $sHtaccessContent)) {
exit('In order for us to continue with the upgrade you will need to rename or remove the file ".htaccess".');
}
}
$sStep = $this->_oReq->get('req2') ? strtolower($this->_oReq->get('req2')) : 'key';
$this->_oTpl->setTitle(self::getPhrase('phpfox_installer'))->setBreadcrumb(self::getPhrase('phpfox_installer'));
$bPass = false;
if (!in_array($sStep, $this->_aSteps)) {
if (in_array($sStep, $this->_aModuleInstalls)) {
$bPass = true;
} else {
exit('Invalid step.');
}
}
$sMethod = '_' . $sStep;
$iStep = 0;
foreach ($this->_aSteps as $iKey => $sMyStep) {
if ($sMyStep === $sStep) {
$iStep = $iKey - 1;
break;
}
}
if ($bPass === false && isset($this->_aSteps[$iStep]) && !$this->_isPassed($this->_aSteps[$iStep])) {
$this->_oUrl->forward($this->_step($this->_aSteps[$iStep]));
}
$this->_sStep = $sStep;
if (method_exists($this, $sMethod)) {
call_user_func(array(&$this, $sMethod));
} else {
$sStep = 'key';
}
if (PHPFOX_DEBUG) {
$this->_oTpl->setHeader(array('debug.css' => 'style_css'));
}
if (!file_exists($this->_oTpl->getLayoutFile($sStep))) {
$sStep = 'default';
}
list($aBreadCrumbs, $aBreadCrumbTitle) = $this->_oTpl->getBreadCrumb();
$this->_oTpl->setImage(array('ajax_small' => 'ajax/small.gif', 'ajax_large' => 'ajax/large.gif', 'loading_animation' => 'misc/loading_animation.gif', 'close' => 'misc/close.gif'));
$this->_oTpl->setHeader(array('<link rel="shortcut icon" type="image/x-icon" href="' . Phpfox_Installer::getHostPath() . 'favicon.ico?v=' . $this->_oTpl->getStaticVersion() . '" />', 'layout.css' => 'style_css', 'thickbox.css' => 'style_css', 'jquery/jquery.js' => 'static_script', 'common.js' => 'static_script', 'main.js' => 'static_script', 'thickbox/thickbox.js' => 'static_script'))->assign(array('sTemplate' => $sStep, 'sLocaleDirection' => 'ltr', 'sLocaleCode' => 'en', 'sUrl' => $this->_sUrl, 'aErrors' => Phpfox_Error::get(), 'sPublicMessage' => Phpfox::getMessage(), 'aBreadCrumbs' => $aBreadCrumbs, 'aBreadCrumbTitle' => $aBreadCrumbTitle, 'aSteps' => $this->_getSteps()));
if ($this->_bUpgrade) {
$this->_oTpl->setTitle('Upgrading from: ' . $this->_getCurrentVersion());
}
header("X-Content-Encoded-By: phpFox " . PhpFox::getVersion());
$this->_oTpl->getLayout('template');
Phpfox::clearMessage();
}