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


PHP Flash::init方法代碼示例

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


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

示例1: use_helper

$__FROG_CONN__ = $__CMS_CONN__;
Record::connection($__CMS_CONN__);
Record::getConnection()->exec("set names 'utf8'");
Setting::init();
use_helper('I18n');
AuthUser::load();
if (AuthUser::isLoggedIn()) {
    I18n::setLocale(AuthUser::getRecord()->language);
} else {
    I18n::setLocale(Setting::get('language'));
}
// Only add the cron web bug when necessary
if (defined('USE_POORMANSCRON') && USE_POORMANSCRON && defined('POORMANSCRON_INTERVAL')) {
    Observer::observe('page_before_execute_layout', 'run_cron');
    function run_cron()
    {
        $cron = Cron::findByIdFrom('Cron', '1');
        $now = time();
        $last = $cron->getLastRunTime();
        if ($now - $last > POORMANSCRON_INTERVAL) {
            echo $cron->generateWebBug();
        }
    }
}
Plugin::init();
Flash::init();
// Setup admin routes
$admin_routes = array('/' . ADMIN_DIR => Setting::get('default_tab'), '/' . ADMIN_DIR . '/' => Setting::get('default_tab'), '/' . ADMIN_DIR . '/:all' => '$1');
Dispatcher::addRoute($admin_routes);
// run everything!
require APP_PATH . DS . 'main.php';
開發者ID:ariksavage,項目名稱:idsog.org,代碼行數:31,代碼來源:index.php

示例2: dispatch

 public static function dispatch($requested_url = null, $default = null)
 {
     Flash::init();
     // If no url passed, we will get the first key from the _GET array
     // that way, index.php?/controller/action/var1&email=example@example.com
     // requested_url will be equal to: /controller/action/var1
     if ($requested_url === null) {
         $pos = strpos($_SERVER['QUERY_STRING'], '&');
         if ($pos !== false) {
             $requested_url = substr($_SERVER['QUERY_STRING'], 0, $pos);
         } else {
             $requested_url = $_SERVER['QUERY_STRING'];
         }
     }
     // If no URL is requested (due to someone accessing admin section for the first time)
     // AND $default is setAllow for a default tab
     if ($requested_url == null && $default != null) {
         $requested_url = $default;
     }
     // Requested url MUST start with a slash (for route convention)
     if (strpos($requested_url, '/') !== 0) {
         $requested_url = '/' . $requested_url;
     }
     self::$requested_url = $requested_url;
     // This is only trace for debugging
     self::$status['requested_url'] = $requested_url;
     // Make the first split of the current requested_url
     self::$params = self::splitUrl($requested_url);
     // Do we even have any custom routing to deal with?
     if (count(self::$routes) === 0) {
         return self::executeAction(self::getController(), self::getAction(), self::getParams());
     }
     // Is there a literal match? If so we're done
     if (isset(self::$routes[$requested_url])) {
         self::$params = self::splitUrl(self::$routes[$requested_url]);
         return self::executeAction(self::getController(), self::getAction(), self::getParams());
     }
     // Loop through the route array looking for wildcards
     foreach (self::$routes as $route => $uri) {
         // Convert wildcards to regex
         if (strpos($route, ':') !== false) {
             $route = str_replace(':any', '(.+)', str_replace(':num', '([0-9]+)', $route));
         }
         // Does the regex match?
         if (preg_match('#^' . $route . '$#', $requested_url)) {
             // Do we have a back-reference?
             if (strpos($uri, '$') !== false && strpos($route, '(') !== false) {
                 $uri = preg_replace('#^' . $route . '$#', $uri, $requested_url);
             }
             self::$params = self::splitUrl($uri);
             // We found it, so we can break the loop now!
             break;
         }
     }
     return self::executeAction(self::getController(), self::getAction(), self::getParams());
 }
開發者ID:chaobj001,項目名稱:tt,代碼行數:56,代碼來源:Framework.php

示例3: initialize_resources

 /**
  * Initialize application resources
  *
  * @param void
  * @return null
  */
 function initialize_resources()
 {
     if (defined('USE_COOKIES') && USE_COOKIES) {
         Cookies::init(COOKIE_PREFIX, COOKIE_PATH, COOKIE_DOMAIN, COOKIE_SECURE);
     }
     // if
     if (defined('USE_FLASH') && USE_FLASH) {
         Flash::init();
     }
     // if
     if (defined('USE_CACHE') && USE_CACHE) {
         cache_use_backend(CACHE_BACKEND, array('lifetime' => CACHE_LIFETIME));
     }
     // if
 }
開發者ID:NaszvadiG,項目名稱:activecollab_loc,代碼行數:21,代碼來源:AngieApplication.class.php

示例4: assets_check_gd_support

function assets_check_gd_support()
{
    $needed = array('GIF Read Support', 'JPEG Support', 'PNG Support');
    $provided = gd_info();
    foreach ($needed as $item) {
        if (!$provided[$item]) {
            Flash::set('error', __('Your system does not have :item. Assets manager will not work properly.', array(':item' => $item)));
            Flash::init();
        }
    }
}
開發者ID:julpi,項目名稱:freshcms_assets,代碼行數:11,代碼來源:AssetsController.php

示例5: check_constraints

 /**
  * Simple function that checks if the posted data is valid.
  * As side effet, the 'flash' values are set.
  *
  * @param data the post data from the user
  * @return data is valid
  */
 private function check_constraints($data)
 {
     if (!isset($data["name"]) || empty($data["name"])) {
         Flash::set('error', __('You have to specify a name!'));
         Flash::init();
         // XXX: force flash values availability
         return false;
     }
     return true;
 }
開發者ID:billzeller,項目名稱:frog_page_part_forms,代碼行數:17,代碼來源:PagePartFormsController.php


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