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


PHP logMsg函数代码示例

本文整理汇总了PHP中logMsg函数的典型用法代码示例。如果您正苦于以下问题:PHP logMsg函数的具体用法?PHP logMsg怎么用?PHP logMsg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: Error

 function Error($msg)
 {
     //erreur sur la classe FDPF, on la log avant d'arreter la génération...
     logMsg($msg);
     //Fatal error
     parent::Error($msg);
 }
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:7,代码来源:convert.class.php

示例2: closed

 protected function closed($user)
 {
     logMsg("user with id: " . $user->{"id"} . " disconnected from the server.", "userDisconnected");
     // Do nothing: This is where cleanup would go, in case the user had any sort of
     // open files or other objects associated with them.  This runs after the socket
     // has been closed, so there is no need to clean up the socket itself here.
 }
开发者ID:AxelTLarsson,项目名称:shoppinglist,代码行数:7,代码来源:shoppinglistSocketServer.php

示例3: loadClass

 function loadClass($class, $param = NULL)
 {
     if (!is_string($class)) {
         logMsg(SL_ERROR, "参数错误!");
         exit(-3);
     }
     static $commonClasses = array();
     if (isset($commonClasses[$class]) && $commonClasses[$class] instanceof $class) {
         return $commonClasses[$class];
     }
     $filePath = '';
     foreach (array(INCLUDE_DIR, SRC_DIR) as $path) {
         if (file_exists($path . '/' . $class . '.php')) {
             $filePath = $path;
             break;
         }
     }
     if (!empty($filePath) && !isLoadFile($class) && class_exists($class, false) === FALSE) {
         require_once $filePath . '/' . $class . '.php';
     }
     if (INCLUDE_DIR === $filePath) {
         $commonClasses[$class] = isset($param) ? new $class($param) : new $class();
         return $commonClasses[$class];
     } else {
         if (SRC_DIR == $filePath) {
             return isset($param) ? new $class($param) : new $class();
         }
     }
     return FALSE;
 }
开发者ID:ethanshancn,项目名称:zhSpider,代码行数:30,代码来源:common.php

示例4: parseFeeds

 /**
  * Parses RSS feeds for new content
  */
 private function parseFeeds()
 {
     foreach ($this->rssConfig as $feed) {
         if (!isset($this->lastCheck[$feed['url']]) || $this->lastCheck[$feed['url']] + $feed['pollInterval'] * 60 < time()) {
             $this->lastCheck[$feed['url']] = time();
             logMsg("rssPlugin: Checking RSS: {$feed['url']}");
             try {
                 $content = file_get_contents($feed['url']);
                 $x = new SimpleXmlElement($content);
                 //RSS feed format
                 if (isset($x->channel)) {
                     foreach ($x->channel->item as $entry) {
                         $this->saveEntry($feed['title'], $feed['channel'], $entry->title, $entry->link);
                     }
                 } else {
                     //Atom feed format
                     if (isset($x->entry)) {
                         foreach ($x->entry as $entry) {
                             $this->saveEntry($feed['title'], $feed['channel'], $entry->title, $entry->link->attributes()->href);
                         }
                     }
                 }
                 $content = null;
                 $x = null;
             } catch (Exception $e) {
                 logMsg($e->getMessage());
             }
         }
     }
 }
开发者ID:nask0,项目名称:VikingBot,代码行数:33,代码来源:rssPlugin.php

示例5: getPlugins

 /**
  * Reads all plugins in the plugins directory of the server root.
  * @return array
  */
 public static function getPlugins($db = null)
 {
     if (!$db) {
         $db = Config::main()->getDBO();
     }
     $result = array();
     $path = DIAMONDMVC_ROOT . '/plugins';
     $dir = opendir($path);
     while ($curr = readdir($dir)) {
         if ($curr === '.' or $curr === '..') {
             continue;
         }
         if (!is_dir("{$path}/{$curr}")) {
             logMsg('Plugin ist kein Ordner: $path/$curr', 5);
             continue;
         }
         if (!file_exists("{$path}/{$curr}/{$curr}.php")) {
             logMsg("Plugin-Hauptskript nicht gefunden: {$path}/{$curr}/{$curr}.php");
             continue;
         }
         include_once "{$path}/{$curr}/{$curr}.php";
         if (!class_exists("Plugin{$curr}")) {
             logMsg("Plugin-Hauptklasse nicht gefunden: {$curr}");
             continue;
         }
         $className = "plugin{$curr}";
         $result[] = new $className($db);
     }
     return $result;
 }
开发者ID:Zyr93,项目名称:DiamondMVC,代码行数:34,代码来源:class_plugin.php

示例6: unregisterField

 /**
  * Removes a mapping.
  * @param integer $type Unique field type to remove.
  */
 public static function unregisterField($type)
 {
     if (isset(self::$fieldmap[$type])) {
         logMsg("FormBuilder: Removing field mapping {$type} -> " . self::$fieldmap[$type], 4);
         unset(self::$fieldmap[$type]);
     } else {
         logMsg("FormBuilder: Nothing to do. Field mapping {$type} not found.", 4);
     }
 }
开发者ID:Zyr93,项目名称:DiamondMVC,代码行数:13,代码来源:class_formbuilder.php

示例7: addLog

 public function addLog($iLevel, $sInfo, $sPath)
 {
     if (!$sInfo || !$sPath) {
         logMsg(SL_ERROR, 'Log param Error, now the sInfo is ' . $sInfo . ' sPath is ' . $sPath);
         return FALSE;
     }
     $strSql = "INSERT INTO {$this->dbName} (`sTime`,`iLevel`,`sInfo`,`sPath`) VALUES (NOW(),'{$iLevel}','{$sInfo}','{$sPath}')";
     return $this->dbConnect->exec($strSql);
 }
开发者ID:ethanshancn,项目名称:zhSpider,代码行数:9,代码来源:log.php

示例8: invokeRegisteredAutoloaders

 /**
  * If the fallback method is used, this method invokes all registered autoloaders.
  */
 public function invokeRegisteredAutoloaders($class)
 {
     foreach ($this->loaders as $loader) {
         try {
             call_user_func($loader, $class);
         } catch (Exception $ex) {
             logMsg('[CORE] Autoloader ' . (is_array($loader) ? $loader[1] : $loader) . ' threw an exception while loading class ' . $class);
         }
     }
 }
开发者ID:Zyr93,项目名称:DiamondMVC,代码行数:13,代码来源:autoload.php

示例9: dbConnect

function dbConnect()
{
    global $db, $dbFilename;
    $up = dirname(__FILE__) . '/../';
    if ($db = new PDO('sqlite:' . $up . $dbFilename)) {
        logMsg('DB', 'Db opened ok');
    } else {
        logMsg('ERROR', 'Db cannot be opened');
        die;
    }
}
开发者ID:bffmm1,项目名称:gmailcommunity,代码行数:11,代码来源:db.php

示例10: exec

 public function exec($strSql)
 {
     try {
         $iResult = $this->dbConnect->exec($strSql);
     } catch (PDOException $e) {
         logMsg(SL_ERROR, "SQL failed : " . $e->getMessage());
         echo $e->getMessage() . "\n";
         exit(-3);
     }
     return $iResult;
 }
开发者ID:ethanshancn,项目名称:zhSpider,代码行数:11,代码来源:DB.php

示例11: setConfig

 public function setConfig($key, $val)
 {
     if (!is_string($key) || !is_string($val)) {
         //记录日志
         logMsg(SL_ERROR, "参数错误!");
         return FALSE;
     }
     $this->arrConfig[$key] = $val;
     $content = json_encode($this->arrConfig);
     writeToFile(CONFIG_FILE, $content);
     return TRUE;
 }
开发者ID:ethanshancn,项目名称:zhSpider,代码行数:12,代码来源:config.php

示例12: read

 /**
  * Reads the INI from the given path.
  * @param  string       $file Path to the INI file to read in.
  * @return IniGenerator       This instance to enable method chaining.
  */
 public function read($file)
 {
     if (!file_exists($file)) {
         logMsg('Failed to read ini file "' . $file . '": not found', 9, 5);
     } else {
         ob_start();
         include $file;
         $contents = ob_get_contents();
         ob_end_clean();
         $this->data = parse_ini_string($contents, true);
     }
     return $this;
 }
开发者ID:Zyr93,项目名称:DiamondMVC,代码行数:18,代码来源:class_ini.php

示例13: execute

 public function execute()
 {
     // Försök rensa databasen
     if ($this->db->clear()) {
         // success
         $response = array("type" => "clearedList");
         logMsg("Cleared the list.", "clearedList");
     } else {
         // fail
         $resonse = array("type" => "error", "data" => "Det gick inte att rensa listan.");
     }
     return $response;
 }
开发者ID:AxelTLarsson,项目名称:shoppinglist,代码行数:13,代码来源:clearListCommand.php

示例14: execute

 /**
  *	Lägger till den nya posten i databasen
  * 	@return $response En array som berättar om vad som skedde (eller inte skedde)
  */
 public function execute()
 {
     // Försöka lägga till ny post
     if ($this->db->addItem($this->item)) {
         // success
         $response = array("type" => "addedItem", "data" => $this->item->getData(), "id" => $this->item->getId());
         logMsg("Added new item: " . $response["data"] . " (" . $response["id"] . ")", "addedItem");
     } else {
         // fail
         $response = array("type" => "error", "data" => "Det gick inte att lägga till: " . $this->item->getData() . " med id: " . $this->item->getId());
     }
     return $response;
 }
开发者ID:AxelTLarsson,项目名称:shoppinglist,代码行数:17,代码来源:addItemCommand.php

示例15: execute

 public function execute()
 {
     // Försöka uppdatera post
     if ($this->db->updateItem($this->item)) {
         // success
         $response = array("type" => "updatedItem", "data" => $this->item->getData(), "id" => $this->item->getId(), "isMarked" => $this->item->isMarked());
         logMsg("Updated item: (" . $response["id"] . ")" . " --> " . $response["data"], "updatedItem");
     } else {
         // fail
         $response = array("type" => "warn", "data" => "Det gick inte att uppdatera post: " . $this->item->getId());
     }
     return $response;
 }
开发者ID:AxelTLarsson,项目名称:shoppinglist,代码行数:13,代码来源:updateItemCommand.php


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