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


PHP log::doLog方法代码示例

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


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

示例1: doAction

 public function doAction()
 {
     //check if id file and job is a number
     //if (is_numeric($this->id_file) && is_numeric($this->id_job))
     //convert id_file and id_job into a numbers
     $id_file = (int) $this->id_file;
     $id_job = (int) $this->id_job;
     ini_set('max_execution_time', 6000);
     $ret = -1;
     if (substr(php_uname(), 0, 7) == "Windows") {
         log::doLog("windows");
         $ret = pclose(popen("start C:\\wamp\\bin\\php\\php5.4.3\\php " . INIT::$MODEL_ROOT . "/exportLog.php " . $id_file . " " . $id_job . " 1", "r"));
     } else {
         $ret = pclose(popen("nohup php " . INIT::$MODEL_ROOT . "/exportLog.php " . $id_file . " " . $id_job . " 1 &", "r"));
     }
     log::doLog("CASMACAT: return exportLog: " . $ret);
     ini_set('max_execution_time', 30);
     //        $this->filename ="log_id".$this->id_file."_".$this->file_name.".xml";
     //        header('Content-Type: text/xml; charset=UTF-8');
     //        header('Content-Disposition: attachment; filename="' . $this->file_name . '.xml"');
     //
     //        //log::doLog("CASMACAT: file: ".INIT::$LOG_DOWNLOAD . "/" .$this->filename);
     //
     //        $this->content = file_get_contents(INIT::$LOG_DOWNLOAD . "/" . $this->filename);
     if ($ret == "END") {
         $this->result['code'] = 0;
         $this->result['data'] = "OK";
     } else {
         $this->result['errors'] = "It is not possible to get the log file";
         $this->result['code'] = -1;
     }
 }
开发者ID:Tucev,项目名称:casmacat-frontend,代码行数:32,代码来源:createLogDownloadController.php

示例2: doAction

 public function doAction()
 {
     if (empty($this->source)) {
         $this->result['error'][] = array("code" => -1, "message" => "missing source segment");
     }
     if (empty($this->target)) {
         $this->result['error'][] = array("code" => -2, "message" => "missing target segment");
     }
     if (empty($this->source_lang)) {
         $this->result['error'][] = array("code" => -3, "message" => "missing source lang");
     }
     if (empty($this->target_lang)) {
         $this->result['error'][] = array("code" => -2, "message" => "missing target lang");
     }
     if (!empty($this->result['error'])) {
         return -1;
     }
     if (!empty($this->id_translator)) {
         $this->key = $this->calculateMyMemoryKey($this->id_translator);
         log::doLog("key is {$this->key}");
     }
     $set_results = addToMM($this->source, $this->target, $this->source_lang, $this->target_lang, $this->id_translator, $this->key);
     $this->result['code'] = 1;
     $this->result['data'] = "OK";
 }
开发者ID:Tucev,项目名称:casmacat-frontend,代码行数:25,代码来源:setContributionController.php

示例3: doAction

 public function doAction()
 {
     try {
         log::doLog("CASMACAT: loadLogChunkController->doAction(): Loading logListChunk...");
         $logListChunk = fetchLogChunk($this->jobId, $this->fileId, $this->startOffset, $this->endOffset);
         if ($logListChunk < 0) {
             $this->result["code"] = -1;
             $this->result["errors"][] = array("code" => -1, "message" => "Error loading logListChunk");
         } else {
             if (!$logListChunk) {
                 $this->result["code"] = 1;
                 $this->result["data"] = "No more data";
             } else {
                 $this->result["code"] = 0;
                 //            $this->result["data"]["logListChunk"] = json_encode($logListChunk);
                 $this->result["data"]["logListChunk"] = $logListChunk;
             }
         }
         log::doLog("CASMACAT: loadLogChunkController->doAction(): Loading of logListChunk finished, " . count($logListChunk) . " events loaded.");
     } catch (Exception $e) {
         $this->result["code"] = -1;
         $this->result["errors"][] = array("code" => -1, "message" => "Unexcpected error: '" . $e->GetMessage() . "'");
         log::doLog("CASMACAT: loadLogChunkController->doAction(): Unexcpected error: '" . $e->GetMessage() . "'");
     }
 }
开发者ID:Tucev,项目名称:casmacat-frontend,代码行数:25,代码来源:loadLogChunkController.php

示例4: doAction

 public function doAction()
 {
     $gold_offset = (int) $this->gold_offset;
     $id = (int) $this->id;
     log::doLog("CASMACAT: gold offset: " . $gold_offset . " id: " . $id);
     $db = Database::obtain();
     try {
         $db->query("UPDATE fixation_event SET gold_offset='{$gold_offset}' WHERE header_id = '{$id}'");
     } catch (Exception $e) {
         log::doLog("CASMACAT: expection " . $e);
     }
 }
开发者ID:Tucev,项目名称:casmacat-frontend,代码行数:12,代码来源:saveGoldOffsetController.php

示例5: __construct

 private function __construct()
 {
     //get languages file
     //
     // SDL supported language codes
     // http://kb.sdl.com/kb/?ArticleId=2993&source=Article&c=12&cid=23#tab:homeTab:crumb:7:artId:4878
     $file = INIT::$UTILS_ROOT . '/Langs/supported_langs.json';
     if (!file_exists($file)) {
         log::doLog("no language defs found in {$file}");
         exit;
     }
     $string = file_get_contents($file);
     //parse to associative array
     $langs = json_decode($string, true);
     $langs = $langs['langs'];
     //build internal maps
     //for each lang
     foreach ($langs as $k1 => $lang) {
         //for each localization of that lang
         foreach ($lang['localized'] as $k2 => $localizedTagPair) {
             foreach ($localizedTagPair as $isocode => $localizedTag) {
                 //build mapping of localized string -> rfc code
                 self::$map_string2rfc[$localizedTag] = $lang['rfc3066code'];
                 //add associative reference
                 $langs[$k1]['localized'][$isocode] = $localizedTag;
             }
             //remove positional reference
             unset($langs[$k1]['localized'][$k2]);
         }
     }
     //create internal support objects representation
     foreach ($langs as $lang) {
         //add code -> rfc mapping
         if (isset($lang['languageRegionCode'])) {
             self::$map_string2rfc[$lang['languageRegionCode']] = $lang['rfc3066code'];
         }
         //add rfc fallback
         self::$map_string2rfc[$lang['rfc3066code']] = $lang['rfc3066code'];
         //primary pointers are RFC
         self::$map_rfc2obj[$lang['rfc3066code']] = $lang;
         //set support for ISO by indirect reference through RFC pointers
         self::$map_iso2rfc[$lang['isocode']] = $lang['rfc3066code'];
         //manage ambiguities
         self::$map_iso2rfc['en'] = 'en-US';
         self::$map_iso2rfc['pt'] = 'pt-BR';
     }
 }
开发者ID:indynagpal,项目名称:MateCat,代码行数:47,代码来源:Languages.php

示例6: __construct

 private function __construct()
 {
     //get languages file
     //
     // SDL supported language codes
     // http://kb.sdl.com/kb/?ArticleId=2993&source=Article&c=12&cid=23#tab:homeTab:crumb:7:artId:4878
     $file = INIT::$UTILS_ROOT . '/Langs/languageDomains.json';
     if (!file_exists($file)) {
         log::doLog("no subject defs found in {$file}");
         exit;
     }
     $string = file_get_contents($file);
     //parse to associative array
     $subjects = json_decode($string, true);
     Utils::raiseJsonExceptionError();
     self::$subjectMap = $subjects;
 }
开发者ID:bcrazvan,项目名称:MateCat,代码行数:17,代码来源:LanguageDomains.php

示例7: addToMM

function addToMM($seg, $tra, $source_lang, $target_lang, $id_translator, $key)
{
    $seg = urlencode($seg);
    $tra = urlencode($tra);
    $private_query = "";
    if (!empty($id_translator) and !empty($key)) {
        $id_translator = rawurldecode($id_translator);
        $key = rawurlencode($key);
        $private_query = "user={$id_translator}&key={$key}";
    }
    $url = "http://mymemory.translated.net/api/set?seg={$seg}&tra={$tra}&langpair={$source_lang}|{$target_lang}&de=matecatdeveloper@matecat.com&{$private_query}";
    log::doLog("set url : {$url}");
    $res = file_get_contents($url);
    log::doLog("res encoded .{$res}");
    $res = json_decode($res, true);
    log::doLog($res);
    // print_r($res);
    return $res;
}
开发者ID:Tucev,项目名称:casmacat-frontend,代码行数:19,代码来源:mymemory_queries_temp.php

示例8: __construct

 public function __construct()
 {
     parent::__construct();
     $this->jid = $this->get_from_get_post("jid");
     $this->password = $this->get_from_get_post("password");
     $this->step = $this->get_from_get_post("step");
     $this->ref_segment = $this->get_from_get_post("segment");
     $this->where = $this->get_from_get_post("where");
     //		    	log::doLog('LAST LOADED ID - MODIFIED: '.$this->last_loaded_id);
     //		if($this->central_segment) log::doLog('CENTRAL SEGMENT: '.$this->central_segment);
     // CASMACAT extension start
     if ($this->get_from_get_post("replay") == "true") {
         // replay mode
         log::doLog("CASMACAT: Running in replay mode.");
         $this->casIsReplaying = true;
         include_once INIT::$MODEL_ROOT . "/casQueries.php";
     }
     // CASMACAT extension end
 }
开发者ID:Tucev,项目名称:casmacat-frontend,代码行数:19,代码来源:getSegmentsController.php

示例9: doAction

 public function doAction()
 {
     try {
         log::doLog("CASMACAT: resetDocumentController->doAction(): Resetting document...");
         if (!resetDocument($this->jobId, $this->fileId)) {
             $this->result["code"] = -1;
             $this->result["errors"][] = array("code" => -1, "message" => "Error resetting document");
         } else {
             $this->result["code"] = 0;
             //            $this->result["data"]["logListChunk"] = json_encode($logListChunk);
             $this->result["data"] = "OK";
         }
         log::doLog("CASMACAT: resetDocumentController->doAction(): Document reset.");
     } catch (Exception $e) {
         $this->result["code"] = -1;
         $this->result["errors"][] = array("code" => -1, "message" => "Unexcpected error: '" . $e->GetMessage() . "'");
         log::doLog("CASMACAT: resetDocumentController->doAction(): Unexcpected error: '" . $e->GetMessage() . "'");
     }
 }
开发者ID:Tucev,项目名称:casmacat-frontend,代码行数:19,代码来源:resetDocumentController.php

示例10: doAction

 public function doAction()
 {
     if (empty($this->id_segment)) {
         $this->result['error'][] = array("code" => -1, "message" => "missing id_segment");
     }
     if (empty($this->id_job)) {
         $this->result['error'][] = array("code" => -2, "message" => "missing id_job");
     }
     if (empty($this->id_first_file)) {
         $this->result['error'][] = array("code" => -2, "message" => "missing id_job");
     }
     if (empty($this->time_to_edit)) {
         $this->time_to_edit = 0;
     }
     if (empty($this->status)) {
         $this->status = 'DRAFT';
     }
     if (empty($this->translation)) {
         log::doLog("empty");
         return 0;
         // won's save empty translation but there is no need to return an error
     }
     //ONE OR MORE ERRORS OCCURRED : EXITING
     if (!empty($this->result['error'])) {
         log::doLog("Generic Error in SetTranslationController");
         return -1;
     }
     $this->translation = CatUtils::view2rawxliff($this->translation);
     $res = CatUtils::addSegmentTranslation($this->id_segment, $this->id_job, $this->status, $this->time_to_edit, $this->translation);
     if (!empty($res['error'])) {
         $this->result['error'] = $res['error'];
         return -1;
     }
     $job_stats = CatUtils::getStatsForJob($this->id_job);
     $file_stats = CatUtils::getStatsForFile($this->id_first_file);
     $this->result['stats'] = $job_stats;
     $this->result['file_stats'] = $file_stats;
     $this->result['code'] = 1;
     $this->result['data'] = "OK";
 }
开发者ID:Tucev,项目名称:casmacat-frontend,代码行数:40,代码来源:setTranslationController.php

示例11: __construct

 public function __construct($ext)
 {
     if (empty($ext)) {
         throw new Exception("No extension specified");
     }
     $this->extension = strtolower($ext);
     switch ($this->extension) {
         case 'doc':
             $this->type = 'MSWORD_DOC';
             break;
         case 'docx':
             $this->type = 'MSWORD_DOCX';
             break;
         case 'txt':
             $this->type = 'PLAINTEXT';
             break;
         case 'xlf':
             // Just until we support tag management
         // Just until we support tag management
         case 'xliff':
             // Just until we support tag management
         // Just until we support tag management
         case 'sdlxliff':
             // Just until we support tag management
             $this->type = 'SDLXLIFF';
             break;
         case 'html':
         case 'htm':
         case 'php':
             $this->type = 'HTML';
             break;
         default:
             log::doLog("Unrecognized extension {$this->extension} : assign default  PLAINTEXT");
             $this->type = 'PLAINTEXT';
     }
 }
开发者ID:Tucev,项目名称:casmacat-frontend,代码行数:36,代码来源:filetype.class.php

示例12: setSuggestionReport

 private function setSuggestionReport($matches)
 {
     if (count($matches) > 0) {
         foreach ($matches as $k => $m) {
             $matches[$k]['raw_translation'] = CatUtils::view2rawxliff($matches[$k]['raw_translation']);
             if ($matches[$k]['created_by'] == 'MT!') {
                 $matches[$k]['created_by'] = 'MT';
                 //MyMemory returns MT!
             } else {
                 $matches[$k]['created_by'] = $this->__changeSuggestionSource($m);
             }
         }
         $suggestions_json_array = json_encode($matches);
         $match = $matches[0];
         !empty($match['sentence_confidence']) ? $mt_qe = floatval($match['sentence_confidence']) : ($mt_qe = null);
         $data = array();
         $data['suggestions_array'] = $suggestions_json_array;
         $data['suggestion'] = $match['raw_translation'];
         $data['mt_qe'] = $mt_qe;
         $data['suggestion_match'] = str_replace('%', '', $match['match']);
         $where = " id_segment= " . (int) $this->id_segment . " and id_job = " . (int) $this->id_job . " and status = 'NEW' ";
         $db = Database::obtain();
         try {
             $affectedRows = $db->update('segment_translations', $data, $where);
         } catch (PDOException $e) {
             log::doLog($e->getMessage());
             return $e->getCode() * -1;
         }
         return $affectedRows;
     }
     return 0;
 }
开发者ID:indynagpal,项目名称:MateCat,代码行数:32,代码来源:getContributionController.php

示例13: insertEpenEvent

function insertEpenEvent($event)
{
    $headerId = insertLogEventHeader($event);
    $data = array();
    $data["id"] = "NULL";
    $data["header_id"] = $headerId;
    $data["info"] = json_encode($event->info);
    $db = Database::obtain();
    $db->insert("epen_event", $data);
    $err = $db->get_error();
    $errno = $err["error_code"];
    if ($errno != 0) {
        log::doLog("CASMACAT: insertEpenEvent(): " . print_r($err, true));
        throw new Exception("CASMACAT: insertEpenEvent(): " . print_r($err, true));
        //        return $errno * -1;
    }
}
开发者ID:Tucev,项目名称:casmacat-frontend,代码行数:17,代码来源:casQueries.php

示例14: insertEpenEvent

                $logEvent->epenData($value);
                insertEpenEvent($logEvent);
                break;
            case LogEvent::HTR_ADD_STROKE:
                $logEvent->epenData($value);
                insertEpenEvent($logEvent);
                break;
            case LogEvent::HTR_END:
                $logEvent->epenData($value);
                insertEpenEvent($logEvent);
                break;
            case LogEvent::HTR_GESTURE:
                $logEvent->epenData($value);
                insertEpenEvent($logEvent);
                break;
                // merc - blur/focus
            // merc - blur/focus
            case LogEvent::BLUR:
                insertLogEventHeader($logEvent);
                break;
            case LogEvent::FOCUS:
                insertLogEventHeader($logEvent);
                break;
            default:
                log::doLog("CASMACAT: uploadXML: '{$logEvent->type}' at index: '{$key}'");
        }
    }
}
?>

开发者ID:Tucev,项目名称:casmacat-frontend,代码行数:29,代码来源:uploadXML.php

示例15: convertToOriginal

 public function convertToOriginal($xliffVector, $chosen_by_user_machine = false)
 {
     $xliffContent = $xliffVector['content'];
     $xliffName = $xliffVector['out_xliff_name'];
     //        Log::dolog( $xliffName );
     //assign converter
     if (!$chosen_by_user_machine) {
         $this->ip = $this->pickRandConverter();
         $storage = $this->getValidStorage();
         //add replace/regexp pattern because we have more than 1 replacement
         //http://stackoverflow.com/questions/2222643/php-preg-replace
         $xliffContent = self::replacedAddress($storage, $xliffContent);
     } else {
         $this->ip = $chosen_by_user_machine;
     }
     $url = "{$this->ip}:{$this->port}/{$this->fromXliffFunction}";
     $uid_ext = $this->extractUidandExt($xliffContent);
     $data['uid'] = $uid_ext[0];
     //get random name for temporary location
     $tmp_name = tempnam("/tmp", "MAT_BW");
     //write encoded file to temporary location
     $fileSize = file_put_contents($tmp_name, $xliffContent);
     //$data['xliffContent'] = $xliffContent;
     $data['xliffContent'] = "@{$tmp_name}";
     log::doLog($this->ip . " start conversion back to original");
     $start_time = microtime(true);
     //TODO: this helper doesn't help!
     //How TODO: create a resource handler e return it, so it can be added to a MultiCurl Handler instance
     $curl_result = $this->curl_post($url, $data, $this->opt);
     $end_time = microtime(true);
     $time_diff = $end_time - $start_time;
     log::doLog($this->ip . " took {$time_diff} secs");
     $this->conversionObject->ip_machine = $this->ip;
     $this->conversionObject->ip_client = Utils::getRealIpAddr();
     $this->conversionObject->path_name = $xliffVector['out_xliff_name'];
     $this->conversionObject->file_name = pathinfo($xliffVector['out_xliff_name'], PATHINFO_BASENAME);
     $this->conversionObject->direction = 'bw';
     $this->conversionObject->src_lang = $this->lang_handler->getLangRegionCode($xliffVector['source']);
     $this->conversionObject->trg_lang = $this->lang_handler->getLangRegionCode($xliffVector['target']);
     $this->conversionObject->file_size = $fileSize;
     $this->conversionObject->conversion_time = $time_diff;
     $decode = json_decode($curl_result, true);
     unset($curl_result);
     $res = $this->__parseOutput($decode);
     unset($decode);
     //remove temporary file
     unlink($tmp_name);
     return $res;
 }
开发者ID:kevinvnloctra,项目名称:MateCat,代码行数:49,代码来源:FileFormatConverter.php


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