示例#1
0
function echo_errorlog()
{
    $_errorLogPath = M3_Util_Settings::getPhpErrorLogPathName();
    if ($_errorLogPath) {
        if (get_request_param("clearerrorlog")) {
            if (!M3_Util_File::truncateFile($_errorLogPath)) {
                echo "<i>Count not truncate error log [{$_errorLogPath}]</i>";
            }
        }
        echo <<<EOL1
        <h2 align="center">{$_errorLogPath}</h2>
        <table align="center"><tr><td>
        <form action="index.php">
           <input type="hidden" name="show" value="errorlog"/>
           <input type="hidden" name="clearerrorlog" value="true"/>
           <input type="submit" value="Clear"/>
        </form>
        </td></tr></table>
EOL1;
        echo "<pre>";
        echo htmlentities(file_get_contents($_errorLogPath));
        echo "</pre>";
    } else {
        echo "Cannot determine where the error log is";
    }
}
示例#2
0
 public function testGetErrorLogs()
 {
     $_phpErrorLog = M3_Util_Settings::getPhpErrorLogPathName();
     $_webInstallDir = M3_Util_Settings::getWebServerInstallationDirectory();
     $_webErrorLog = M3_Util_Settings::getWebServerErrorLogPathName();
 }