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


PHP MainLogger::critical方法代碼示例

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


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

示例1: foreach

             foreach ($args as $name => $value) {
                 $params .= (\is_object($value) ? \get_class($value) . " " . (\method_exists($value, "__toString") ? $value->__toString() : "object") : \gettype($value) . " " . (\is_array($value) ? "Array()" : Utils::printable(@\strval($value)))) . ", ";
             }
         }
         $messages[] = "#{$j} " . (isset($trace[$i]["file"]) ? cleanPath($trace[$i]["file"]) : "") . "(" . (isset($trace[$i]["line"]) ? $trace[$i]["line"] : "") . "): " . (isset($trace[$i]["class"]) ? $trace[$i]["class"] . (($trace[$i]["type"] === "dynamic" or $trace[$i]["type"] === "->") ? "->" : "::") : "") . $trace[$i]["function"] . "(" . Utils::printable(\substr($params, 0, -2)) . ")";
     }
     return $messages;
 }
 function cleanPath($path)
 {
     return \rtrim(\str_replace(["\\", ".php", "phar://", \rtrim(\str_replace(["\\", "phar://"], ["/", ""], \pocketmine\PATH), "/"), \rtrim(\str_replace(["\\", "phar://"], ["/", ""], \pocketmine\PLUGIN_PATH), "/")], ["/", "", "", "", ""], $path), "/");
 }
 \set_error_handler([\ExceptionHandler::class, "handler"], -1);
 $errors = 0;
 if (\version_compare("5.6.0", PHP_VERSION) > 0) {
     $logger->critical("You must use PHP >= 5.6");
     ++$errors;
 }
 if (\php_sapi_name() !== "cli") {
     $logger->critical("You must run PocketMine-MP using the CLI.");
     ++$errors;
 }
 if (!\extension_loaded("sockets")) {
     $logger->critical("Unable to find the Socket extension.");
     ++$errors;
 }
 $pthreads_version = \phpversion("pthreads");
 if (\substr_count($pthreads_version, ".") < 2) {
     $pthreads_version = "0.{$pthreads_version}";
 }
 if (\version_compare($pthreads_version, "2.0.9") < 0) {
開發者ID:VonHirsch,項目名稱:PocketMine-0.13.0,代碼行數:31,代碼來源:PocketMine.php

示例2: foreach

             }
             foreach ($args as $name => $value) {
                 $params .= (is_object($value) ? get_class($value) . " " . (method_exists($value, "__toString") ? $value->__toString() : "object") : gettype($value) . " " . (is_array($value) ? "Array()" : Utils::printable(@strval($value)))) . ", ";
             }
         }
         $messages[] = "#{$j} " . (isset($trace[$i]["file"]) ? cleanPath($trace[$i]["file"]) : "") . "(" . (isset($trace[$i]["line"]) ? $trace[$i]["line"] : "") . "): " . (isset($trace[$i]["class"]) ? $trace[$i]["class"] . (($trace[$i]["type"] === "dynamic" or $trace[$i]["type"] === "->") ? "->" : "::") : "") . $trace[$i]["function"] . "(" . Utils::printable(substr($params, 0, -2)) . ")";
     }
     return $messages;
 }
 function cleanPath($path)
 {
     return rtrim(str_replace(["\\", ".php", "phar://", rtrim(str_replace(["\\", "phar://"], ["/", ""], \pocketmine\PATH), "/"), rtrim(str_replace(["\\", "phar://"], ["/", ""], \pocketmine\PLUGIN_PATH), "/")], ["/", "", "", "", ""], $path), "/");
 }
 $errors = 0;
 if (php_sapi_name() !== "cli") {
     $logger->critical("You must run ImagicalMine using the CLI.");
     ++$errors;
 }
 if (!extension_loaded("sockets")) {
     $logger->critical("Unable to find the Socket extension.");
     ++$errors;
 }
 $pthreads_version = phpversion("pthreads");
 if (substr_count($pthreads_version, ".") < 2) {
     $pthreads_version = "0.{$pthreads_version}";
 }
 if (version_compare($pthreads_version, "3.1.5") < 0) {
     $logger->critical("pthreads >= 3.1.5 is required, while you have {$pthreads_version}.");
     ++$errors;
 }
 if (!extension_loaded("uopz")) {
開發者ID:Cecil107,項目名稱:PocketMine-0.13.0,代碼行數:31,代碼來源:PocketMine.php


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