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


PHP Log::create方法代码示例

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


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

示例1: run

 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 10) as $index) {
         Log::create([]);
     }
 }
开发者ID:inseo201,项目名称:atletik4,代码行数:7,代码来源:LogsTableSeeder.php

示例2: setLog

 /**
  * Add a log handler.
  * Works as a fluent interface.
  * 
  * @param mixed         $type  Error number (int) or Exception class name.
  * @param Q\Logger $log   May also be a DSN string.
  * @param More logs can be specified as additional arguments.
  * @return ErrorHandler_Log
  */
 public function setLog($type, $log)
 {
     if (is_string($type)) {
         $type = self::errnoForType($type);
     }
     $logs = array();
     $logs_dsn = func_get_args();
     array_shift($logs_dsn);
     foreach ($logs_dsn as $log_dsn) {
         try {
             $logs[] = Log::create($log_dsn);
         } catch (Exception $e) {
             trigger_error("Failed to create Log '{$log_dsn}'.\n" . (string) $e, E_USER_WARNING);
         }
     }
     // Set logs for specific error code(s) or exception
     if (is_int($type)) {
         for ($i = 1; $i <= 4096; $i = $i << 1) {
             if ($i & $type) {
                 $this->addLogForType($type, $log);
             }
         }
     } else {
         $this->addLogForType($type, $log);
     }
     return $this;
 }
开发者ID:jasny,项目名称:Q,代码行数:36,代码来源:Logs.php

示例3: add

 public static function add($uid, $oid, $info)
 {
     $Log = new Log();
     $Log->uid = $uid;
     $Log->oid = $oid;
     $Log->info = $info;
     $Log->addtime = time();
     if ($Log->create()) {
         return true;
     }
     $Log->outputErrors($Log);
     return false;
 }
开发者ID:Crocodile26,项目名称:php-1,代码行数:13,代码来源:Log.php

示例4: Log

<?php

require_once "../initialize.php";
$id = $_GET['id'];
$object = Group::get_by_id($id);
GroupUser::delete_all_by_sectionid($object->id);
$object->delete();
$log = new Log($session->user_id, $clientip, "WEB", "DELETED CLUB: " . $object->id);
$log->create();
echo "success";
开发者ID:NemOry,项目名称:Skoolyf,代码行数:10,代码来源:deletegroup.php

示例5: _save_log

 /**
  * @param $data
  *
  * @throws Exception
  */
 protected static function _save_log($data)
 {
     $log = new Log();
     $log->create($data);
     $log->save();
     $log->clear();
 }
开发者ID:andtxr,项目名称:cakephp-log,代码行数:12,代码来源:LogBehavior.php

示例6: create

 /**
  * Creates instance of App class and initialize the application
  *
  * @param array $params initialization parameters
  * @return void
  * @static
  */
 public static function create(array $params = null)
 {
     self::$app_mode = self::MODE_DEVELOPMENT;
     if (is_null(self::$instance)) {
         self::$instance = new self();
     }
     // setting up autoloader
     spl_autoload_register(array('App', 'autoload'));
     try {
         // setup config
         Config::create(isset($params['config']) ? $params['config'] : null);
         Config::setVar($params);
         // application mode
         self::setMode(Config::getVar('mode', self::MODE_DEVELOPMENT));
         // our error handler
         if (!self::isDevMode()) {
             set_error_handler(array('App', 'handleErrors'));
         }
         // language specific params
         if (function_exists('mb_internal_encoding')) {
             mb_internal_encoding(Config::getVar('app_encoding', 'UTF-8'));
         }
         if (function_exists('date_default_timezone_set')) {
             date_default_timezone_set(Config::getVar('app_timezone', 'UTC'));
         }
         setlocale(LC_CTYPE, Config::getVar('app_locale', 'en_US.UTF-8'));
         // creating base objects
         Log::create();
         Request::create();
         // saving application params
         self::$params = $params;
         // unregister globals
         if (ini_get('register_globals')) {
             self::unregisterGlobals(array('_POST', '_GET', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES'));
             ini_set('register_globals', false);
         }
     } catch (Exception $e) {
         self::$instance->handleDefaultException($e);
     }
 }
开发者ID:nicksp,项目名称:BakedCarrot,代码行数:47,代码来源:App.php

示例7: getRegistrationResult

 public static function getRegistrationResult($idRegistration)
 {
     $app = \Slim\Slim::getInstance();
     try {
         $scormcloudorigin = ScormEngineUtilities::getCanonicalOriginString("IgnitorLabs", "Ignitor Portal", "Version 2.0");
         $ScormService = new ScormEngineService(ScormCloudAPIController::$scromCloudUrl, ScormCloudAPIController::$scromCloudAppId, ScormCloudAPIController::$scormCloudSecretKey, ScormCloudAPIController::$scormcloudorigin, null, ScormCloudAPIController::$scromCloudMgmtAppId, ScormCloudAPIController::$scormCloudMgmtSecretKey);
         $registrationService = $ScormService->getRegistrationService();
         if ($registrationService->Exists($idRegistration)) {
             $regResult = $registrationService->GetRegistrationResult($idRegistration, 2, 1);
             $json_result = json_encode(simplexml_load_string($regResult), JSON_PRETTY_PRINT);
             $data = array("action" => "get", "type" => "scorm-cloud", "source" => "api", "source_version" => "1.0", "description" => $json_result, "ip" => $_SERVER['REMOTE_ADDR'], "browser_type" => $_SERVER['HTTP_USER_AGENT'], "referral" => $_SERVER['HTTP_REFERER'], "auth_token" => $app->request->headers->get('X_Authorization'));
             $log = Log::create($data);
             $log->save();
             $app->redirect(ScormCloudAPIController::$websiteLink . "/library");
             // return "<html><head><script type=\"text/javascript\">window.location=\"" . ScormCloudAPIController::$websiteLink . "/library\"</script></head><body></body></html>";
         } else {
             return json_encode("failure");
         }
     } catch (Exception $e) {
         $app->halt("400", json_encode($e->getMessage()));
         return json_encode("failure");
     }
 }
开发者ID:aanyun,项目名称:PHP-Sample-Code,代码行数:23,代码来源:ScormCloudAPIController.php

示例8: add

 /**
  * Add any number of log handlers.
  * (fluent interface)
  *
  * @param mixed $log  Logger, dsn (string) or a set of log handlers as array  
  * @param More log handlers may be specified as additional arguments
  * @return Log_Container
  */
 public function add($log)
 {
     if (func_num_args() > 1) {
         $log = func_get_args();
     }
     if (is_string($log)) {
         try {
             $log = Log::create($log);
         } catch (\Exception $e) {
             trigger_error("Creation of log handler failed. " . $e->getMessage(), E_USER_WARNING);
             return $this;
         }
     }
     if (is_array($log)) {
         foreach ($log as $curlog) {
             $this->add($curlog);
         }
         return $this;
     }
     if (!$log instanceof Logger) {
         trigger_error("Can't add log handler: value is not a " . __NAMESPACE__ . "::Logger, DSN string or array.", E_USER_WARNING);
         return $this;
     }
     $this->logs[] = $log;
     return $this;
 }
开发者ID:jasny,项目名称:Q,代码行数:34,代码来源:Container.php

示例9: formObject

 public function formObject()
 {
     $this->data->Log = Log::create($this->data->id)->getData();
     $this->render();
 }
开发者ID:elymatos,项目名称:expressive_fnbr,代码行数:5,代码来源:LogController.php


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