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


PHP backup_helper::log方法代碼示例

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


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

示例1: log

 public function log($message, $level, $a = null, $depth = null, $display = false)
 {
     if (is_null($this->task)) {
         throw new base_step_exception('not_specified_base_task');
     }
     backup_helper::log($message, $level, $a, $depth, $display, $this->get_logger());
 }
開發者ID:evltuma,項目名稱:moodle,代碼行數:7,代碼來源:base_step.class.php

示例2: to_moodle2_format

 /**
  * Converts the given directory with the backup into moodle2 format
  *
  * @param string $tempdir The directory to convert
  * @param string $format The current format, if already detected
  * @param base_logger|null if the conversion should be logged, use this logger
  * @throws convert_helper_exception
  * @return bool false if unable to find the conversion path, true otherwise
  */
 public static function to_moodle2_format($tempdir, $format = null, $logger = null)
 {
     if (is_null($format)) {
         $format = backup_general_helper::detect_backup_format($tempdir);
     }
     // get the supported conversion paths from all available converters
     $converters = self::available_converters();
     $descriptions = array();
     foreach ($converters as $name) {
         $classname = "{$name}_converter";
         if (!class_exists($classname)) {
             throw new convert_helper_exception('class_not_loaded', $classname);
         }
         if ($logger instanceof base_logger) {
             backup_helper::log('available converter', backup::LOG_DEBUG, $classname, 1, false, $logger);
         }
         $descriptions[$name] = call_user_func($classname . '::description');
     }
     // choose the best conversion path for the given format
     $path = self::choose_conversion_path($format, $descriptions);
     if (empty($path)) {
         if ($logger instanceof base_logger) {
             backup_helper::log('unable to find the conversion path', backup::LOG_ERROR, null, 0, false, $logger);
         }
         return false;
     }
     if ($logger instanceof base_logger) {
         backup_helper::log('conversion path established', backup::LOG_INFO, implode(' => ', array_merge($path, array('moodle2'))), 0, false, $logger);
     }
     foreach ($path as $name) {
         if ($logger instanceof base_logger) {
             backup_helper::log('running converter', backup::LOG_INFO, $name, 0, false, $logger);
         }
         $converter = convert_factory::get_converter($name, $tempdir, $logger);
         $converter->convert();
     }
     // make sure we ended with moodle2 format
     if (!self::detect_moodle2_format($tempdir)) {
         throw new convert_helper_exception('conversion_failed');
     }
     return true;
 }
開發者ID:sebastiansanio,項目名稱:tallerdeprogramacion2fiuba,代碼行數:51,代碼來源:convert_helper.class.php

示例3: log

 public function log($message, $level, $a = null, $depth = null, $display = false)
 {
     backup_helper::log($message, $level, $a, $depth, $display, $this->get_logger());
 }
開發者ID:JP-Git,項目名稱:moodle,代碼行數:4,代碼來源:restore_plan.class.php

示例4: log

 /**
  * If the logger was set for the converter, log the message
  *
  * If the $display is enabled, the spaces in the $message text are removed
  * and the text is used as a string identifier in the core_backup language file.
  *
  * @see backup_helper::log()
  * @param string $message message text
  * @param int $level message level {@example backup::LOG_WARNING}
  * @param null|mixed $a additional information
  * @param null|int $depth the message depth
  * @param bool $display whether the message should be sent to the output, too
  */
 public function log($message, $level, $a = null, $depth = null, $display = false)
 {
     if ($this->logger instanceof base_logger) {
         backup_helper::log($message, $level, $a, $depth, $display, $this->logger);
     }
 }
開發者ID:evltuma,項目名稱:moodle,代碼行數:19,代碼來源:convertlib.php


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