当前位置: 首页>>代码示例>>PHP>>正文


PHP Env::isDebugging方法代码示例

本文整理汇总了PHP中Env::isDebugging方法的典型用法代码示例。如果您正苦于以下问题:PHP Env::isDebugging方法的具体用法?PHP Env::isDebugging怎么用?PHP Env::isDebugging使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Env的用法示例。


在下文中一共展示了Env::isDebugging方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: langA

function langA($name, $args)
{
    static $base = null;
    $value = Localization::instance()->lang($name);
    if (is_null($value)) {
        if (!Env::isDebugging()) {
            if (!$base instanceof Localization) {
                $base = new Localization();
                $base->loadSettings("en_us", ROOT . "/language");
            }
            $value = $base->lang($name);
        }
        if (is_null($value)) {
            $value = Localization::instance()->lang(str_replace(" ", "_", $name));
            if (is_null($value)) {
                $value = Localization::instance()->lang(str_replace("_", " ", $name));
                if (is_null($value)) {
                    return "Missing lang: {$name}";
                }
            }
        }
    }
    // We have args? Replace all {x} with arguments
    if (is_array($args) && count($args)) {
        $i = 0;
        foreach ($args as $arg) {
            $value = str_replace('{' . $i . '}', $arg, $value);
            $i++;
        }
        // foreach
    }
    // if
    // Done here...
    return $value;
}
开发者ID:abhinay100,项目名称:fengoffice_app,代码行数:35,代码来源:localization.php

示例2: session_regenerate_id

if (!ini_get('session.auto_start') || strtolower(ini_get('session.auto_start')) == 'off') {
    if (!session_id()) {
        session_regenerate_id();
    }
    session_start();
    // Start the session
}
include_once ENVIRONMENT_PATH . '/classes/Env.class.php';
include_once ENVIRONMENT_PATH . '/constants.php';
include_once ENVIRONMENT_PATH . '/functions/utf.php';
include_once ENVIRONMENT_PATH . '/functions/general.php';
include_once ENVIRONMENT_PATH . '/functions/files.php';
// Remove slashes is magic quotes gpc is on from $_GET, $_POST and $_COOKIE
fix_input_quotes();
// Debug
if (Env::isDebugging()) {
    include_once ENVIRONMENT_PATH . '/classes/debug/BenchmarkTimer.class.php';
    benchmark_timer_start();
    benchmark_timer_set_marker('Init environment');
}
// if
// Include autoloader...
include ENVIRONMENT_PATH . '/classes/AutoLoader.class.php';
include ENVIRONMENT_PATH . '/classes/template/template.php';
include ENVIRONMENT_PATH . '/classes/flash/flash.php';
include ENVIRONMENT_PATH . '/classes/localization/localization.php';
include ENVIRONMENT_PATH . '/classes/logger/Logger_Entry.class.php';
include ENVIRONMENT_PATH . '/classes/logger/Logger_Session.class.php';
include ENVIRONMENT_PATH . '/classes/logger/Logger_Backend.class.php';
include ENVIRONMENT_PATH . '/classes/logger/Logger.class.php';
include ENVIRONMENT_PATH . '/classes/logger/backend/Logger_Backend_File.class.php';
开发者ID:bklein01,项目名称:Project-Pier,代码行数:31,代码来源:environment.php

示例3: product_signature

 /**
 * Returns product signature (name and version). If user is not logged in and
 * is not member of owner company he will see only product name
 *
 * @param void
 * @return string
 */
 function product_signature() {
   if (function_exists('logged_user') && (logged_user() instanceof User) && logged_user()->isMemberOfOwnerCompany()) {
     $result = lang('footer powered', 'http://www.projectpier.org/', clean(product_name()) . ' ' . product_version());
     if (Env::isDebugging()) {
       ob_start();
       benchmark_timer_display(false);
       $result .= '. ' . ob_get_clean();
       if (function_exists('memory_get_usage')) {
         $result .= '. ' . format_filesize(memory_get_usage());
       } // if
     } // if
     return $result;
   } else {
     return lang('footer powered', 'http://www.ProjectPier.org/', clean(product_name()));
   } // if
 } // product_signature
开发者ID:rjv,项目名称:Project-Pier,代码行数:23,代码来源:functions.php

示例4: product_signature

/**
 * Returns product signature (name and version). If user is not logged in and
 * is not member of owner company he will see only product name
 *
 * @param void
 * @return string
 */
function product_signature()
{
    if (function_exists('logged_user') && logged_user() instanceof Contact) {
        $result = lang('footer powered', clean(PRODUCT_URL), clean(product_name()) . ' ' . product_version());
        if (Env::isDebugging()) {
            ob_start();
            benchmark_timer_display(false);
            $result .= '. ' . ob_get_clean();
            if (function_exists('memory_get_usage')) {
                $result .= '. ' . format_filesize(memory_get_usage());
            }
            // if
        }
        // if
        return $result;
    } else {
        return lang('footer powered', clean(PRODUCT_URL), clean(product_name()));
    }
    // if
}
开发者ID:abhinay100,项目名称:feng_app,代码行数:27,代码来源:functions.php


注:本文中的Env::isDebugging方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。