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


PHP LoggerManager::info方法代码示例

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


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

示例1: parseSQL

 /**
  * Parse SQL with types from sql in the form of "INSERT INTO testPreparedStatement(id, name) VALUES(?int, ?varchar)"
  * @param string $sql
  * @param array $lobs names of clob and blob fields from query
  * @return boolean
  */
 protected function parseSQL($sql, array $lobs = array())
 {
     if (empty($this->DBM)) {
         $this->log->error("Prepare failed: Database object missing");
         return false;
     }
     if (empty($sql)) {
         $this->log->error("Prepare failed: empty SQL statement");
         return false;
     }
     $this->sqlText = $sql;
     $this->log->info("Parse Query: {$sql}");
     // Build fieldDefs array and replace ?SugarDataType placeholders with a single ?placeholder
     $cleanedSql = "";
     $nextParam = strpos($sql, "?");
     if ($nextParam == 0) {
         $cleanedSql = $sql;
     } else {
         // parse the sql string looking for params
         $row = 0;
         while ($nextParam > 0) {
             $cleanedSql .= substr($sql, 0, $nextParam + 1);
             // we want the ?
             $sql = substr($sql, $nextParam + 1);
             // strip leading chars
             // scan for termination of SugarDataType
             $sugarDataType = "";
             for ($i = 0; $i < strlen($sql) and strpos(",) ", substr($sql, $i, 1)) === false; $i++) {
                 if (strpos(",) ", substr($sql, $i, 1)) == false) {
                     $sugarDataType .= substr($sql, $i, 1);
                 }
             }
             if ($sugarDataType === "") {
                 // no type, default to varchar
                 $sugarDataType = 'varchar';
             }
             // insert the fieldDef
             $this->fieldDefs[$row]['type'] = $sugarDataType;
             if ($this->DBM->isTextType($sugarDataType)) {
                 if (empty($lobs)) {
                     $this->log->fatal('Name of lob field is not specified: ' . $this->sqlText);
                     return false;
                 }
                 $this->lobFields[$row] = array_shift($lobs);
             }
             $sql = substr($sql, $i);
             // strip off the SugarDataType
             $nextParam = strpos($sql, "?");
             // look for another param
             $row++;
         }
         // add the remaining sql
         $cleanedSql .= $sql;
     }
     $this->parsedSQL = $cleanedSql;
     return true;
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:63,代码来源:PreparedStatement.php

示例2: addRecordsToQueue

 /**
  * This function adds records to FTS queue.
  *
  * @param $records array of records
  */
 protected function addRecordsToQueue($records)
 {
     $this->logger->info('addRecordsToQueue');
     $db = DBManagerFactory::getInstance('fts');
     $db->resetQueryCount();
     foreach ($records as $rec) {
         if (!is_array($rec) || empty($rec['bean_id']) || empty($rec['bean_module'])) {
             $this->logger->error('Error populating fts_queue. Empty bean_id or bean_module.');
             continue;
         }
         // support multiple values for 'processed'
         $rec['processed'] = empty($rec['processed']) ? 0 : $rec['processed'];
         $query = sprintf("SELECT id, processed FROM fts_queue WHERE bean_id = %s AND bean_module = %s", $db->quoted($rec['bean_id']), $db->quoted(BeanFactory::getBeanName($rec['bean_module'])));
         $res = $db->query($query, true, "Error get records from queue for fts");
         if ($item = $db->fetchRow($res)) {
             if ($item['processed'] != $rec['processed'] && $item['processed'] != 0) {
                 $query = sprintf("UPDATE fts_queue SET processed = %s, date_modified = current_timestamp WHERE id = %s", $db->quoted($rec['processed']), $db->quoted($item['id']));
                 $db->query($query, true, "Error update record in queue for fts");
             }
         } else {
             $beanName = BeanFactory::getBeanName($rec['bean_module']);
             if (empty($beanName)) {
                 $GLOBALS['log']->error("Full indexer: Failed to get bean name for module: {$rec['bean_module']}");
                 continue;
             }
             $query = sprintf("INSERT INTO fts_queue (id, bean_id, bean_module, processed, date_created)\n                        values (%s, %s, %s, %s, %s)", $db->quoted(create_guid()), $db->quoted($rec['bean_id']), $db->quoted($beanName), $db->quoted($rec['processed']), $db->now());
             $db->query($query, true, "Error populating index queue for fts");
         }
     }
     /*
      * The full indexer jobs should already be present when a full reindex
      * has been scheduled earler on. Those are presistent jobs and will
      * remain in the job queue to process new reocrds from the fts_queue.
      *
      * If a full indexer job is manually removed, scheduling again a full
      * reindex will trigger restoration of the full indexer jobs where needed.
      */
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:43,代码来源:SugarSearchEngineAbstractBase.php


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