本文整理汇总了PHP中Zend\Log\Logger::setWriters方法的典型用法代码示例。如果您正苦于以下问题:PHP Logger::setWriters方法的具体用法?PHP Logger::setWriters怎么用?PHP Logger::setWriters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend\Log\Logger
的用法示例。
在下文中一共展示了Logger::setWriters方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SplPriorityQueue
//
// o PROCESSOR_GHOSTSCRIPT
// - Slower
// - Requires lots of memory (RAM)
// - Reduction in file size
//
// If you have both installed on your system, PROCESSOR_PDFTK is recommended.
$processor = PROCESSOR_PDFTK;
// Number of documents (populated with random strings) to concatenate.
$iterations = 3;
// -----------------------------------------------------------------------------
// Logger to output status messages
$writerQueue = new SplPriorityQueue();
$writerQueue->insert(new Writer('php://stdout'), 1);
$logger = new Logger();
$logger->setWriters($writerQueue);
// -----------------------------------------------------------------------------
// Create temporary directory
$tempDirectory = sys_get_temp_dir() . DIRECTORY_SEPARATOR . md5(rand(1, 10000) . __FILE__);
if (is_dir($tempDirectory)) {
recursiveRemoveDirectory($tempDirectory);
}
$logger->log(Logger::INFO, sprintf('Making temporary directory %s.', $tempDirectory));
mkdir($tempDirectory);
// -----------------------------------------------------------------------------
// Generate temporary documents
$tempFilenames = array();
$mailMerge = new MailMerge();
$mailMerge->setUsername(DEMOS_ZENDSERVICE_LIVEDOCX_FREE_USERNAME)->setPassword(DEMOS_ZENDSERVICE_LIVEDOCX_FREE_PASSWORD)->setService(MailMerge::SERVICE_FREE);
// for LiveDocx Premium, use MailMerge::SERVICE_PREMIUM;
$mailMerge->setLocalTemplate('template.docx');