當前位置: 首頁>>代碼示例>>PHP>>正文


PHP System::shutdown方法代碼示例

本文整理匯總了PHP中System::shutdown方法的典型用法代碼示例。如果您正苦於以下問題:PHP System::shutdown方法的具體用法?PHP System::shutdown怎麽用?PHP System::shutdown使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System的用法示例。


在下文中一共展示了System::shutdown方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: sessionExpired

 /**
  * Event: 'frontcontroller.predispatch'.
  *
  * @param GenericEvent $event
  *
  * @return void
  */
 public function sessionExpired(GenericEvent $event)
 {
     if (\SessionUtil::hasExpired()) {
         // Session has expired, display warning
         header('HTTP/1.0 403 Access Denied');
         $return = \ModUtil::apiFunc('UsersModule', 'user', 'expiredsession');
         \System::shutdown();
     }
 }
開發者ID:planetenkiller,項目名稱:core,代碼行數:16,代碼來源:SystemListener.php

示例2: formDie

 /**
  * Form Die.
  *
  * @param string $msg Message to echo.
  *
  * @return void
  */
 public function formDie($msg)
 {
     echo $msg;
     System::shutdown(0);
 }
開發者ID:Silwereth,項目名稱:core,代碼行數:12,代碼來源:View.php

示例3: requireSession

 /**
  * If enabled and logged in, save login name of user in Apache session variable for Apache logs.
  *
  * Implements 'session.require'.
  *
  * @param Zikula_Event $event The event handler.
  *
  * @return void
  */
 public function requireSession(Zikula_Event $event)
 {
     $session = $this->serviceManager->get('session');
     try {
         $request = ServiceUtil::get('request');
         $request->setSession($session);
     } catch (Exception $e) {
         // ignore silently (for CLI)
     }
     try {
         if (!$session->start()) {
             throw new RuntimeException('Failed to start session');
         }
     } catch (Exception $e) {
         // session initialization failed so display templated error
         header('HTTP/1.1 503 Service Unavailable');
         require_once System::getSystemErrorTemplate('sessionfailed.tpl');
         System::shutdown();
     }
 }
開發者ID:Silwereth,項目名稱:core,代碼行數:29,代碼來源:SystemListeners.php

示例4: _upg_sanity_check

/**
 * Generate the sanity check page.
 *
 * This function do and generate the stanity check page.
 *
 * @param string $username Username of the admin user.
 * @param string $password Password of the admin user.
 *
 * @return void
 */
function _upg_sanity_check($username, $password)
{
    _upg_header();
    $validupgrade = true;
    if (version_compare(_ZINSTALLEDVERSION, _ZINSTALLVER, '=')) {
        // Already installed the correct version
        $validupgrade = false;
        echo '<h2>' . __('Already up to date') . "</h2>\n";
        echo '<p class="z-errormsg">' . __f("It seems that you have already installed version %s. Please remove this upgrade script, you do not need it anymore.", _ZINSTALLEDVERSION) . "</p>\n";
    } elseif (version_compare(_ZINSTALLEDVERSION, _Z_MINUPGVER, '<')) {
        // Not on version _Z_MINUPGVER yet
        $validupgrade = false;
        echo '<h2>' . __('Possible incompatible version found.') . "</h2>\n";
        echo '<p class="z-warningmsg">' . __f('The current installed version of Zikula is reporting (%1$s). You must upgrade to version (%2$s) before you can use this upgrade.', array(_ZINSTALLEDVERSION, _Z_MINUPGVER)) . "</p>\n";
    } elseif (version_compare(PHP_VERSION, '5.3.0', '>=')) {
        if (ini_get('date.timezone') == '') {
            echo '<p class="z-errormsg"><strong>' . __('date.timezone is currently not set. Since PHP 5.3.0, it needs to be set to a valid timezone in your php.ini such as timezone like UTC, GMT+5, Europe/Berlin.') . "</strong></p>\n";
            echo _upg_continue('sanitycheck', __('Check again'), $username, $password);
            $validupgrade = false;
        }
    }
    if ($validupgrade) {
        $pcreUnicodePropertiesEnabled = @preg_match('/^\\p{L}+$/u', 'TheseAreLetters');
        if (!isset($pcreUnicodePropertiesEnabled) || !$pcreUnicodePropertiesEnabled) {
            // PCRE Unicode property support is not enabled.
            $validupgrade = false;
            echo '<h2>' . __('PCRE Unicode Property Support Needed.') . "</h2>\n";
            echo '<p class="z-errormsg">' . __('The PCRE (Perl Compatible Regular Expression) library being used with your PHP installation does not support Unicode properties. This is required to handle multi-byte character sets in regular expressions. The PCRE library used must be compiled with the \'--enable-unicode-properties\' option.') . "</p>\n";
        }
    }
    if ($validupgrade) {
        $defaultTheme = System::getVar('Default_Theme');
        if ($defaultTheme == 'andreas08') {
            System::setVar('Default_Theme', 'Andreas08');
            $defaultTheme = System::getVar('Default_Theme');
        }
        $dir = is_dir("themes/{$defaultTheme}");
        $casing = preg_match('/\\p{Lu}/u', substr($defaultTheme, 0, 1));
        // first letter is uppercase.
        $underscore = preg_match('/_/', $defaultTheme);
        // has underscore
        if (!$dir || !$casing || $underscore) {
            // The default theme must be installed!
            $validupgrade = false;
            echo '<h2>' . __f("Theme Check Failed", $defaultTheme) . "</h2>\n";
            if (!$dir) {
                echo '<p class="z-errormsg">' . __f("Your configuration specifies a theme called '%s' that doesn't exist.  Please ensure that theme exists in themes/%s", array($defaultTheme, $defaultTheme)) . "</p>\n";
            }
            if (!$casing) {
                echo '<p class="z-errormsg">' . __f("Your configuration specifies a theme called '%s' which begins with a lower case letter.  You must first upgrade the theme's name to start with a capital letter.  This should be done in your 1.2.x installation before attempting this upgrade again.", array($defaultTheme, $defaultTheme)) . "</p>\n";
            }
            if ($underscore) {
                echo '<p class="z-errormsg">' . __f("Your theme called '%s' contains an underscore, this is now deprecated.  You must first upgrade the theme's name so it does not contain any underscore character.  This should be done in your 1.2.x installation before attempting this upgrade again.", array($defaultTheme, $defaultTheme)) . "</p>\n";
            }
        }
    }
    if (!$validupgrade) {
        _upg_footer();
        System::shutdown();
    }
    _upg_continue('upgrademodules', __('Proceed to upgrade (click once and wait)'), $username, $password);
    _upg_footer();
}
開發者ID:Git-Host,項目名稱:AMPPS,代碼行數:73,代碼來源:orig_upgrade.php

示例5: __construct

 /**
  * Constructor.
  *
  * @param Zikula_ServiceManager $serviceManager ServiceManager.
  * @param string                $themeName      Theme name.
  */
 public function __construct(Zikula_ServiceManager $serviceManager, $themeName)
 {
     // store our theme information
     $this->themeinfo = ThemeUtil::getInfo(ThemeUtil::getIDFromName($themeName));
     // prevents any case mismatch
     $themeName = $this->themeinfo['name'];
     foreach (array('name', 'directory', 'version', 'state', 'xhtml') as $key) {
         $this->{$key} = $this->themeinfo[$key];
     }
     parent::__construct($serviceManager);
     if ($this->themeinfo['i18n']) {
         ZLanguage::bindThemeDomain($this->name);
         // property for {gt} template plugin to detect language domain
         $this->domain = ZLanguage::getThemeDomain($this->name);
     } else {
         $this->domain = null;
     }
     EventUtil::attachCustomHandlers("themes/{$themeName}/EventHandlers");
     EventUtil::attachCustomHandlers("themes/{$themeName}/lib/{$themeName}/EventHandlers");
     $event = new \Zikula\Core\Event\GenericEvent($this);
     $this->eventManager->dispatch('theme.preinit', $event);
     // change some base settings from our parent class
     // template compilation
     $this->compile_dir = CacheUtil::getLocalDir('Theme_compiled');
     $this->compile_check = ModUtil::getVar('ZikulaThemeModule', 'compile_check');
     $this->force_compile = ModUtil::getVar('ZikulaThemeModule', 'force_compile');
     // template caching
     $this->cache_dir = CacheUtil::getLocalDir('Theme_cache');
     $this->caching = (int) ModUtil::getVar('ZikulaThemeModule', 'enablecache');
     //if ($this->caching) {
     //    $this->cache_modified_check = true;
     //}
     // if caching and is not an admin controller
     if ($this->caching && strpos($this->type, 'admin') !== 0) {
         $modulesnocache = array_filter(explode(',', ModUtil::getVar('ZikulaThemeModule', 'modulesnocache')));
         if (in_array($this->toplevelmodule, $modulesnocache)) {
             $this->caching = Zikula_View::CACHE_DISABLED;
         }
     } else {
         $this->caching = Zikula_View::CACHE_DISABLED;
     }
     // halt caching for write operations to prevent strange things happening
     if (isset($_POST) && count($_POST) != 0) {
         $this->caching = Zikula_View::CACHE_DISABLED;
     }
     // and also for GET operations with csrftoken/authkey
     if (isset($_GET['csrftoken']) || isset($_GET['authkey'])) {
         $this->caching = Zikula_View::CACHE_DISABLED;
     }
     $this->cache_lifetime = ModUtil::getVar('ZikulaThemeModule', 'cache_lifetime');
     if (!$this->homepage) {
         $this->cache_lifetime = ModUtil::getVar('ZikulaThemeModule', 'cache_lifetime_mods');
     }
     // assign all our base template variables
     $this->_base_vars();
     // define the plugin directories
     $this->_plugin_dirs();
     // load the theme configuration
     $this->load_config();
     // check for cached output
     // turn on caching, check for cached output and then disable caching
     // to prevent blocks from being cached
     if ($this->caching && $this->is_cached($this->themeconfig['page'], $this->cache_id)) {
         $this->display($this->themeconfig['page'], $this->cache_id);
         System::shutdown();
     }
     // register page vars output filter
     $this->load_filter('output', 'pagevars');
     // register short urls output filter
     if (System::getVar('shorturls')) {
         $this->load_filter('output', 'shorturls');
     }
     // register trim whitespace output filter if requried
     if (ModUtil::getVar('ZikulaThemeModule', 'trimwhitespace')) {
         $this->load_filter('output', 'trimwhitespace');
     }
     $this->load_filter('output', 'asseturls');
     $event = new \Zikula\Core\Event\GenericEvent($this);
     $this->eventManager->dispatch('theme.init', $event);
     $this->startOutputBuffering();
 }
開發者ID:rmaiwald,項目名稱:core,代碼行數:87,代碼來源:Theme.php

示例6: cronShutdown

function cronShutdown() {
    Zikula_View_Theme::getInstance()->clear_all_cache();
    Zikula_View_Theme::getInstance()->clear_compiled();
    Zikula_View_Theme::getInstance()->clear_cssjscombinecache();
    Zikula_View::getInstance()->clear_all_cache();
    Zikula_View::getInstance()->clear_compiled();

    System::shutdown();

}
開發者ID:projectesIF,項目名稱:Sirius,代碼行數:10,代碼來源:iwcron.php

示例7: catch

} catch (Zikula_Exception_Fatal $e) {
    $response = new Zikula_Response_Ajax_Fatal($e->getMessage());
} catch (PDOException $e) {
    $response = new Zikula_Response_Ajax_Fatal($e->getMessage());
} catch (Exception $e) {
    $response = new Zikula_Response_Ajax_Fatal($e->getMessage());
}
// Handle database transactions
if (System::getVar('Z_CONFIG_USE_TRANSACTIONS')) {
    if (isset($e) && $e instanceof Exception) {
        $dbConn->rollback();
    } else {
        $dbConn->commit();
    }
}
// Process final response.
// If response is not instanceof Zikula_Response_Ajax_AbstractBase provide compat solution
if (!$response instanceof Zikula_Response_Ajax_AbstractBase) {
    $response = !is_array($response) ? array('data' => $response) : $response;
    $response['statusmsg'] = LogUtil::getStatusMessages();
    if (System::isLegacyMode()) {
        $response['authid'] = SecurityUtil::generateAuthKey(ModUtil::getName());
    }
    $response = json_encode($response);
    header("HTTP/1.1 200 OK");
    header('Content-type: application/json');
}
// Issue response.
echo $response;
System::shutdown();
開發者ID:projectesIF,項目名稱:Sirius,代碼行數:30,代碼來源:ajax.php

示例8: loadsmilies

 /**
  * loadsmilies
  * returns a html snippet for selecting autosmilies
  *
  */
 public function loadsmilies()
 {
     echo $this->view->fetch('ajax/bbsmiles.tpl');
     System::shutdown();
 }
開發者ID:rmaiwald,項目名稱:BBSmile,代碼行數:10,代碼來源:Ajax.php

示例9: shutDown

 function shutDown()
 {
     System::shutdown();
 }
開發者ID:nahidacm,項目名稱:designpatterns,代碼行數:4,代碼來源:os.php

示例10: message_die


//.........這裏部分代碼省略.........
        }
        // End PNphpBB2 Module
        //
        // Load the Page Header
        //
        if (!defined('IN_ADMIN')) {
            include $phpbb_root_path . 'includes/page_header.' . $phpEx;
        } else {
            include $phpbb_root_path . 'admin/page_header_admin.' . $phpEx;
        }
    }
    switch ($msg_code) {
        case GENERAL_MESSAGE:
            if ($msg_title == '') {
                $msg_title = $lang['Information'];
            }
            break;
        case CRITICAL_MESSAGE:
            if ($msg_title == '') {
                $msg_title = $lang['Critical_Information'];
            }
            break;
        case GENERAL_ERROR:
            if ($msg_text == '') {
                $msg_text = $lang['An_error_occured'];
            }
            if ($msg_title == '') {
                $msg_title = $lang['General_Error'];
            }
            break;
        case CRITICAL_ERROR:
            //
            // Critical errors mean we cannot rely on _ANY_ DB information being
            // available so we're going to dump out a simple echo'd statement
            //
            include $phpbb_root_path . 'language/lang_english/lang_main.' . $phpEx;
            if ($msg_text == '') {
                $msg_text = $lang['A_critical_error'];
            }
            if ($msg_title == '') {
                // Begin PNphpBB2 Module
                //				$msg_title = 'phpBB : <b>' . $lang['Critical_Error'] . '</b>';
                $msg_title = 'ZphpBB2 : <b>' . $lang['Critical_Error'] . '</b>';
                // End PNphpBB2 Module
            }
            break;
    }
    //
    // Add on DEBUG info if we've enabled debug mode and this is an error. This
    // prevents debug info being output for general messages should DEBUG be
    // set TRUE by accident (preventing confusion for the end user!)
    //
    if (DEBUG && ($msg_code == GENERAL_ERROR || $msg_code == CRITICAL_ERROR)) {
        if ($debug_text != '') {
            $msg_text = $msg_text . '<br /><br /><b><u>DEBUG MODE</u></b>' . $debug_text;
        }
    }
    if ($msg_code != CRITICAL_ERROR) {
        if (!empty($lang[$msg_text])) {
            $msg_text = $lang[$msg_text];
        }
        if (!defined('IN_ADMIN')) {
            $template->set_filenames(array('message_body' => 'message_body.tpl'));
        } else {
            $template->set_filenames(array('message_body' => 'admin/admin_message_body.tpl'));
        }
        $template->assign_vars(array('MESSAGE_TITLE' => $msg_title, 'MESSAGE_TEXT' => $msg_text));
        ob_start();
        // ZphpBB2
        $template->pparse('message_body');
        $content = ob_get_contents();
        // ZphpBB2
        ob_end_clean();
        // ZphpBB2
        if (!defined('IN_ADMIN')) {
            include $phpbb_root_path . 'includes/page_tail.' . $phpEx;
        } else {
            echo $content;
            // ZphpBB2
            include $phpbb_root_path . 'admin/page_footer_admin.' . $phpEx;
        }
    } else {
        echo "<html>\n<body>\n" . $msg_title . "\n<br /><br />\n" . $msg_text . "</body>\n</html>";
    }
    // ZphpBB2 =>
    if (defined('IN_ADMIN')) {
        exit;
    } else {
        if (Zikula_Core::VERSION_NUM >= '1.4.0') {
            LogUtil::registerStatus($content);
            System::redirect(ModUtil::url('ZphpBB2', 'user', 'message'));
        } else {
            echo $content;
            Zikula_View_Theme::getInstance()->themefooter();
            System::shutdown();
        }
    }
    //exit;
    // <= ZphpBB2
}
開發者ID:nmpetkov,項目名稱:ZphpBB2,代碼行數:101,代碼來源:functions.php


注:本文中的System::shutdown方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。