本文整理汇总了PHP中Logger::close方法的典型用法代码示例。如果您正苦于以下问题:PHP Logger::close方法的具体用法?PHP Logger::close怎么用?PHP Logger::close使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Logger
的用法示例。
在下文中一共展示了Logger::close方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tearDown
public function tearDown()
{
$this->builders = null;
parent::tearDown();
$this->logger->close();
$this->DAO = null;
}
示例2: tearDown
public function tearDown()
{
$this->builders = null;
$this->logger->close();
$this->instance = null;
$this->api = null;
parent::tearDown();
}
示例3: flickrthumbnails_crawl
function flickrthumbnails_crawl()
{
global $THINKTANK_CFG;
global $db;
global $conn;
if (isset($THINKTANK_CFG['flickr_api_key']) && $THINKTANK_CFG['flickr_api_key'] != '') {
$logger = new Logger($THINKTANK_CFG['log_location']);
$fa = new FlickrAPIAccessor($THINKTANK_CFG['flickr_api_key'], $logger);
$ldao = new LinkDAO($db, $logger);
$flickrlinkstoexpand = $ldao->getLinksToExpandByURL('http://flic.kr/');
if (count($flickrlinkstoexpand > 0)) {
$logger->logStatus(count($flickrlinkstoexpand) . " Flickr links to expand", "Flickr Plugin");
} else {
$logger->logStatus("No Flickr links to expand", "Flickr Plugin");
}
foreach ($flickrlinkstoexpand as $fl) {
$eurl = $fa->getFlickrPhotoSource($fl);
if ($eurl["expanded_url"] != '') {
$ldao->saveExpandedUrl($fl, $eurl["expanded_url"], '', 1);
} elseif ($eurl["error"] != '') {
$ldao->saveExpansionError($fl, $eurl["error"]);
}
}
$logger->close();
# Close logging
}
}
示例4: testGetFlickrPhotoSourceSuccess
function testGetFlickrPhotoSourceSuccess()
{
global $THINKUP_CFG;
$logger = new Logger($THINKUP_CFG['log_location']);
$fa = new FlickrAPIAccessor('dummykey', $logger);
$this->assertTrue(isset($fa));
$eurl = $fa->getFlickrPhotoSource('http://flic.kr/p/7QAWC7');
$this->assertEqual($eurl["expanded_url"], 'http://farm3.static.flickr.com/2755/4488149974_04d9558212_m.jpg');
$logger->close();
}
示例5: testCreatingNewLogger
function testCreatingNewLogger()
{
global $THINKTANK_CFG;
$logger = new Logger($THINKTANK_CFG['log_location']);
$logger->logStatus('Should write this to the log', get_class($this));
$this->assertTrue(file_exists($THINKTANK_CFG['log_location']), 'File created');
$messages = file($THINKTANK_CFG['log_location']);
$this->assertWantedPattern('/Should write this to the log/', $messages[sizeof($messages) - 1]);
$logger->setUsername('ginatrapani');
$logger->logStatus('Should write this to the log with a username', get_class($this));
$this->assertWantedPattern('/ginatrapani | TestOfLogging:Should write this to the log/', $messages[sizeof($messages) - 1]);
$logger->close();
}
示例6: testGetFlickrPhotoSource
function testGetFlickrPhotoSource()
{
global $THINKTANK_CFG;
$logger = new Logger($THINKTANK_CFG['log_location']);
$fa = new FlickrAPIAccessor($THINKTANK_CFG['flickr_api_key'], $logger);
$this->assertTrue(isset($fa));
$eurl = $fa->getFlickrPhotoSource('http://flic.kr/p/7QAWC7');
$this->assertEqual($eurl["expanded_url"], 'http://farm3.static.flickr.com/2755/4488149974_04d9558212_m.jpg');
$eurl = $fa->getFlickrPhotoSource('http://flic.kr/p/6YS7AE');
$this->assertEqual($eurl["expanded_url"], '');
$this->assertEqual($eurl["error"], 'Photo not found');
$logger->close();
}
示例7: testSetLogFile
function testSetLogFile()
{
$l = new Logger();
$file = '/tmp/' . rand() . '.log';
if (file_exists($file)) {
unlink($file);
}
$l->setLogFile($file);
$l->log('test');
$l->close();
$this->assertEquals($file, $l->getLogFile());
$this->assert(!file_exists($file), "File was created");
if (file_exists($file)) {
unlink($file);
}
}
示例8: tearDown
public function tearDown() {
$this->logger->close();
parent::tearDown();
}
示例9: Config
$data->setBranch($_GET['ref']);
}
if (isset($_GET['repo'])) {
$data->setRepoName($_GET['repo']);
}
$config = new Config($conf);
$config->setBranch($data->getBranch())->setName($data->getRepoName());
$log->append('origin user: ' . $data->getUsername());
$log->append('repo: ' . $data->getRepoName());
$log->append('branch: ' . $data->getBranch());
$total_added = 0;
if (!($jobs = $conf['jobber']->getJobsFileHandle('a'))) {
$log->append('Invalid log configuration.');
} elseif ($jobs && ($commands = $config->getJobs())) {
foreach ($commands as $cmd) {
fwrite($jobs, $cmd . PHP_EOL);
$log->header();
++$total_added;
}
}
fclose($jobs);
if ($total_added) {
$log->append('jobs added: ' . $total_added);
}
} else {
header("HTTP/1.0 401 Access Denied");
$log->append('401: Access Denied');
}
$log->close();
header("Content Type: text/html");
print '<p>' . $log->view("</p>\n</p>") . '</p>' . PHP_EOL;
示例10: Exception
throw new Exception(__METHOD__ . " - cPanel installation failed: {$message}");
}
$logger->progress($message);
array_push($responseArray['content'], $message);
$responseArray['status'] = 1;
return $responseArray;
} else {
$instructions = "You have disabled the function \"{$func}\" in your PHP configuration.\n\n\t\tTherefore, the installation cannot be finished.\n\n\t\tTake the following steps to complete the cPanel installation:\n\n\t\t\t1.) Run \"\$ /usr/local/nimbusec/nimbusec/hooks/install.sh\" to ensure that necessary internal script hooks are being included by WHM.\n\n\t\t\t2.) Run \"\$ /usr/local/nimbusec/nimbusec/cpanel_plugin/install.sh\" to install the Nimbusec plugin on cPanel side.\n\n\t\t\t3.) Only when the script were executed successfully, add the following line to /var/cpanel/whm/nvdata/root.yaml which contains all environmental variables\n\n\t\t\t- \"NIMBUSEC_INSTALLED: 1\" - or change the value to 1 if the field already exists.\n\t\t\t4.) Afterwards, refresh the WHM plugin page to continue.\n\t\tAlternatively, you may want to re-enable the affected function in your configuration and try it again.";
$logger->error($instructions);
array_push($responseArray['content'], "Nimbusec installation aborted...");
return $responseArray;
}
} catch (CUrlException $exp) {
$logger->error("[CURL SPECIFIC ERROR] in {$exp->getFile()}: {$exp->getMessage()} at line {$exp->getLine()}");
$logger->info("Nimbusec installation aborted...");
$logger->close();
array_push($responseArray['content'], "Nimbusec installation aborted...");
return $responseArray;
} catch (NimbusecException $exp) {
$logger->error("[Nimbusec SPECIFIC ERROR] in {$exp->getFile()}: {$exp->getMessage()} at line {$exp->getLine()}");
$logger->info("Nimbusec installation aborted...");
$logger->close();
array_push($responseArray['content'], "Nimbusec installation aborted...");
return $responseArray;
} catch (WHMException $exp) {
$logger->error("[WHM SPECIFIC ERROR] in {$exp->getFile()}: {$exp->getMessage()} at line {$exp->getLine()}");
$logger->info("Nimbusec installation aborted...");
$logger->close();
array_push($responseArray['content'], "Nimbusec installation aborted...");
return $responseArray;
} catch (Exception $exp) {