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


PHP AJXP_Logger::getInstance方法代码示例

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


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

示例1: log

 /**
  * Log a message if the logQueries property is true.
  *
  * @param $textMessage String text of the message to log
  * @param $severityLevel Integer constant of the logging severity
  * @return null
  */
 public function log($textMessage, $severityLevel = LOG_LEVEL_DEBUG)
 {
     if ($this->debugEnabled) {
         $logger = AJXP_Logger::getInstance();
         $logger->write($textMessage, $severityLevel);
     }
 }
开发者ID:floffel03,项目名称:pydio-core,代码行数:14,代码来源:class.AJXP_SqlUser.php

示例2: listLogFiles

    function listLogFiles($dir)
    {
        $logger = AJXP_Logger::getInstance();
        $parts = explode("/", $dir);
        if (count($parts) > 4) {
            print '<columns switchDisplayMode="list" switchGridMode="grid">
				<column messageString="Date" attributeName="date" sortType="Date" width="10%"/>
				<column messageString="I.P." attributeName="ip" sortType="String"/>
				<column messageString="Level" attributeName="level" sortType="String"/>
				<column messageString="User" attributeName="user" sortType="String"/>
				<column messageString="Action" attributeName="action" sortType="String"/>
				<column messageString="Params" attributeName="params" sortType="String"/>
			</columns>';
            $date = $parts[count($parts) - 1];
            $logger->xmlLogs($date, "tree");
        } else {
            print '<columns switchGridMode="filelist"><column messageString="File Date" attributeName="ajxp_label" sortType="String"/></columns>';
            $logger->xmlListLogFiles("tree", count($parts) > 2 ? $parts[2] : null, count($parts) > 3 ? $parts[3] : null);
        }
    }
开发者ID:skdong,项目名称:nfs-ovd,代码行数:20,代码来源:class.ajxp_confAccessDriver.php

示例3: upgradeDB

 public function upgradeDB()
 {
     $confDriver = ConfService::getConfStorageImpl();
     $authDriver = ConfService::getAuthDriverImpl();
     $logger = AJXP_Logger::getInstance();
     if (is_a($confDriver, "sqlConfDriver")) {
         $conf = AJXP_Utils::cleanDibiDriverParameters($confDriver->getOption("SQL_DRIVER"));
         if (!is_array($conf) || !isset($conf["driver"])) {
             return "Nothing to do";
         }
         switch ($conf["driver"]) {
             case "sqlite":
             case "sqlite3":
                 $ext = ".sqlite";
                 break;
             case "postgre":
                 $ext = ".pgsql";
                 break;
             case "mysql":
                 $ext = is_file($this->workingFolder . "/" . $this->dbUpgrade . ".mysql") ? ".mysql" : ".sql";
                 break;
             default:
                 return "ERROR!, DB driver " . $conf["driver"] . " not supported yet in __FUNCTION__";
         }
         $file = $this->dbUpgrade . $ext;
         if (!is_file($this->workingFolder . "/" . $file)) {
             return "Nothing to do.";
         }
         $sqlInstructions = file_get_contents($this->workingFolder . "/" . $file);
         $parts = array_map("trim", explode("/* SEPARATOR */", $sqlInstructions));
         $results = array();
         $errors = array();
         dibi::connect($conf);
         dibi::begin();
         foreach ($parts as $sqlPart) {
             if (empty($sqlPart)) {
                 continue;
             }
             try {
                 dibi::nativeQuery($sqlPart);
                 $results[] = $sqlPart;
             } catch (DibiException $e) {
                 $errors[] = $sqlPart . " (" . $e->getMessage() . ")";
             }
         }
         dibi::commit();
         dibi::disconnect();
         if (!count($errors)) {
             return "Database successfully upgraded";
         } else {
             return "Database upgrade failed. <br>The following statements were executed : <br>" . implode("<br>", $results) . ",<br><br> The following statements failed : <br>" . implode("<br>", $errors) . "<br><br> You should manually upgrade your DB.";
         }
     }
 }
开发者ID:Nanomani,项目名称:pydio-core,代码行数:54,代码来源:class.AjaXplorerUpgrader.php

示例4: listLogFiles

 public function listLogFiles($dir, $root = NULL, $hash = null, $returnNodes = false)
 {
     $dir = "/{$dir}";
     $allNodes = array();
     $logger = AJXP_Logger::getInstance();
     $parts = explode("/", $dir);
     if (count($parts) > 4) {
         $config = '<columns switchDisplayMode="list" switchGridMode="list" template_name="ajxp_conf.logs">
             <column messageId="ajxp_conf.17" attributeName="date" sortType="MyDate" defaultWidth="18%"/>
             <column messageId="ajxp_conf.18" attributeName="ip" sortType="String" defaultWidth="5%"/>
             <column messageId="ajxp_conf.19" attributeName="level" sortType="String" defaultWidth="10%"/>
             <column messageId="ajxp_conf.20" attributeName="user" sortType="String" defaultWidth="5%"/>
             <column messageId="ajxp_conf.124" attributeName="source" sortType="String" defaultWidth="5%"/>
             <column messageId="ajxp_conf.21" attributeName="action" sortType="String" defaultWidth="7%"/>
             <column messageId="ajxp_conf.22" attributeName="params" sortType="String" defaultWidth="50%"/>
         </columns>';
         if (!$returnNodes) {
             AJXP_XMLWriter::sendFilesListComponentConfig($config);
         }
         $date = $parts[count($parts) - 1];
         $logger->xmlLogs($dir, $date, "tree", "/" . $root . "/logs");
     } else {
         if (!$returnNodes) {
             AJXP_XMLWriter::sendFilesListComponentConfig('<columns switchGridMode="filelist"><column messageId="ajxp_conf.16" attributeName="ajxp_label" sortType="String"/></columns>');
         }
         $nodes = $logger->xmlListLogFiles("tree", count($parts) > 2 ? $parts[2] : null, count($parts) > 3 ? $parts[3] : null, "/" . $root . "/logs", false);
         foreach ($nodes as $last => $nodeXML) {
             if (is_numeric($last) && $last < 10) {
                 $last = "0" . $last;
             }
             $key = "/{$root}{$dir}/{$last}";
             if (in_array($key, $this->currentBookmarks)) {
                 $nodeXML = str_replace("/>", ' ajxp_bookmarked="true" overlay_icon="bookmark.png"/>', $nodeXML);
             }
             $allNodes[$key] = $nodeXML;
             if (!$returnNodes) {
                 print $nodeXML;
             }
         }
     }
     return $allNodes;
 }
开发者ID:rcmarotz,项目名称:pydio-core,代码行数:42,代码来源:class.ajxp_confAccessDriver.php

示例5: realpath

$use_https = false;
/**************************************************/
/* MAX NUMBER CHARS FOR FILE AND DIRECTORY NAMES
/**************************************************/
$max_caracteres = 50;
/*************************************************/
/* WHEN SET, USE SYSTEM CODE TO GET FILESIZE. 
/* Enable this on 32bits machine, to overcome PHP 
/* 4GB limit on file size. This requires shell_exec 
/* permission on linux, and fork permission on 
/* windows. Under Windows, it's faster to install 
/* COM PHP Extension.
/*************************************************/
$allowRealSizeProbing = true;
/**************************************************/
/*	ADVANCED : DO NOT CHANGE THESE VARIABLES BELOW
/**************************************************/
$installPath = realpath(dirname(__FILE__) . "/../..");
define("INSTALL_PATH", $installPath);
define("USERS_DIR", $installPath . "/server/users");
define("SERVER_ACCESS", "content.php");
define("ADMIN_ACCESS", "admin.php");
define("IMAGES_FOLDER", "client/images");
define("CLIENT_RESOURCES_FOLDER", "client");
define("SERVER_RESOURCES_FOLDER", "server/classes");
define("DOCS_FOLDER", "client/doc");
define("TESTS_RESULT_FILE", $installPath . "/server/conf/diag_result.php");
define("OLD_USERS_DIR", $installPath . "/bookmarks");
define("INITIAL_ADMIN_PASSWORD", "admin");
$logger = AJXP_Logger::getInstance();
$logger->initStorage(INSTALL_PATH . "/server/logs/");
开发者ID:skdong,项目名称:nfs-ovd,代码行数:31,代码来源:conf.php

示例6: listLogFiles

    function listLogFiles($dir, $root = NULL)
    {
        $dir = "/{$dir}";
        $logger = AJXP_Logger::getInstance();
        $parts = explode("/", $dir);
        if (count($parts) > 4) {
            $config = '<columns switchDisplayMode="list" switchGridMode="grid" template_name="ajxp_conf.logs">
				<column messageId="ajxp_conf.17" attributeName="date" sortType="MyDate" defaultWidth="10%"/>
				<column messageId="ajxp_conf.18" attributeName="ip" sortType="String" defaultWidth="10%"/>
				<column messageId="ajxp_conf.19" attributeName="level" sortType="String" defaultWidth="10%"/>
				<column messageId="ajxp_conf.20" attributeName="user" sortType="String" defaultWidth="10%"/>
				<column messageId="ajxp_conf.21" attributeName="action" sortType="String" defaultWidth="10%"/>
				<column messageId="ajxp_conf.22" attributeName="params" sortType="String" defaultWidth="50%"/>
			</columns>';
            AJXP_XMLWriter::sendFilesListComponentConfig($config);
            $date = $parts[count($parts) - 1];
            $logger->xmlLogs($dir, $date, "tree", $root . "/logs");
        } else {
            AJXP_XMLWriter::sendFilesListComponentConfig('<columns switchGridMode="filelist"><column messageId="ajxp_conf.16" attributeName="ajxp_label" sortType="String"/></columns>');
            $logger->xmlListLogFiles("tree", count($parts) > 2 ? $parts[2] : null, count($parts) > 3 ? $parts[3] : null, $root . "/logs");
        }
    }
开发者ID:crodriguezn,项目名称:administrator-files,代码行数:22,代码来源:class.ajxp_confAccessDriver.php

示例7: logAction

 function logAction($action, $params = array())
 {
     $logger = AJXP_Logger::getInstance();
     $message = "{$action}\t";
     if (count($params)) {
         $message .= $logger->arrayToString($params);
     }
     $logger->write($message, LOG_LEVEL_INFO);
 }
开发者ID:bloveing,项目名称:openulteo,代码行数:9,代码来源:class.AJXP_Logger.php


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