本文整理汇总了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);
}
示例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.
}
示例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;
}
示例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());
}
}
}
}
示例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;
}
示例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);
}
}
示例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);
}
示例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);
}
}
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}