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


PHP Misc::isCommandLine方法代码示例

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


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

示例1: register

 public function register()
 {
     if (function_exists('ini_set')) {
         ini_set('display_errors', 0);
     }
     $run = new Run();
     $handler = new ErrorHandler();
     $run->pushHandler($handler);
     $json_handler = new JsonErrorHandler();
     $run->pushHandler($json_handler);
     if (Misc::isCommandLine()) {
         $cli_handler = new PlainTextHandler();
         $cli_handler->addTraceFunctionArgsToOutput(true);
         $cli_handler->addTraceToOutput(true);
         $run->pushHandler($cli_handler);
     }
     $run->register();
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:18,代码来源:WhoopsServiceProvider.php

示例2: init

 public static function init()
 {
     error_reporting(E_ALL);
     if (Config\Config::get('WHOOPS_ERROR', FALSE) || Config\Config::get('DEBUG', FALSE)) {
         $whoops = new \Whoops\Run();
         $request = \Biome\Biome::getService('request');
         if ($request->acceptHtml()) {
             $whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler());
         } else {
             if (\Whoops\Util\Misc::isCommandLine()) {
                 $whoops->pushHandler(new \Whoops\Handler\PlainTextHandler());
             } else {
                 $whoops->pushHandler(new \Whoops\Handler\JsonResponseHandler());
             }
         }
         $whoops->register();
     }
 }
开发者ID:mermetbt,项目名称:biome,代码行数:18,代码来源:Error.php

示例3: WhoopsRun

 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ============================================================================ */
use Opis\Colibri\Application;
use Whoops\Run as WhoopsRun;
use Whoops\Handler\JsonResponseHandler;
use Whoops\Handler\PrettyPageHandler;
use Whoops\Handler\PlainTextHandler;
use Whoops\Util\Misc;
error_reporting(-1);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
ini_set('opcache.enable', 0);
$loader = (require_once 'vendor/autoload.php');
if (getenv('APP_PRODUCTION') === false) {
    $whoops = new WhoopsRun();
    if (Misc::isCommandLine()) {
        $whoops->pushHandler(new PlainTextHandler());
    } elseif (Misc::isAjaxRequest()) {
        $whoops->pushHandler(new JsonResponseHandler());
    } else {
        $whoops->pushHandler(new PrettyPageHandler());
    }
    $whoops->register();
}
$app = new Application(__DIR__, $loader);
return $app->bootstrap();
开发者ID:opis-colibri,项目名称:app,代码行数:31,代码来源:bootstrap.php


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