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


PHP Logger::close方法代码示例

本文整理汇总了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;
 }
开发者ID:ngugijames,项目名称:ThinkUp,代码行数:7,代码来源:TestOfGroupMySQLDAO.php

示例2: tearDown

 public function tearDown()
 {
     $this->builders = null;
     $this->logger->close();
     $this->instance = null;
     $this->api = null;
     parent::tearDown();
 }
开发者ID:pepeleproso,项目名称:ThinkUp,代码行数:8,代码来源:TestOfTwitterCrawler.php

示例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
    }
}
开发者ID:ukd1,项目名称:thinktank,代码行数:27,代码来源:flickrthumbnails.php

示例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();
 }
开发者ID:rayyan,项目名称:ThinkUp,代码行数:10,代码来源:TestOfFlickrAPIAccessor.php

示例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();
 }
开发者ID:BenBtg,项目名称:thinktank,代码行数:13,代码来源:log_test.php

示例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();
 }
开发者ID:ukd1,项目名称:thinktank,代码行数:13,代码来源:flickrapi_test.php

示例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);
     }
 }
开发者ID:BackupTheBerlios,项目名称:sourceagency,代码行数:16,代码来源:TestLogger.php

示例8: tearDown

 public function tearDown() {
     $this->logger->close();
     parent::tearDown();
 }
开发者ID:rgoncalves,项目名称:ThinkUp,代码行数:4,代码来源:TestOfURLProcessor.php

示例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;
开发者ID:aklump,项目名称:post_commit,代码行数:31,代码来源:scheduler.php

示例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) {
开发者ID:highacid,项目名称:nimbusec-cPanel,代码行数:31,代码来源:install.php


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