本文整理汇总了PHP中Output::write方法的典型用法代码示例。如果您正苦于以下问题:PHP Output::write方法的具体用法?PHP Output::write怎么用?PHP Output::write使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Output
的用法示例。
在下文中一共展示了Output::write方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: write
/**
* @param $string
* @return mixed
*/
public function write($string)
{
$time = microtime(true);
if ($time - $this->lastWriteTime > $this->threshold) {
$this->writer->write($string);
$this->lastWriteTime = $time;
}
}
示例2: fn_logs
/**
* Display the log file contents for today
*
* @param string $q
* @param array $matches
* @param array $params
*/
function fn_logs($q, $matches, $params)
{
$log_file = TITANIUM_ROOT . 'logs/' . date('Y-m-d') . '.txt';
Logger::write("Reading log file: {$log_file}");
if (file_exists($log_file)) {
Output::write(file_get_contents($log_file), false, true);
} else {
Output::write("{$log_file} does not exist.", 'red', true);
}
}
示例3: run_before_loop_exec
protected function run_before_loop_exec() {
$exec = \AIP\lib\Config::get(\AIP\lib\Config::OPTION_BEFORE_LOOP_EXEC);
ob_start();
foreach($exec as $line)
$this->tick($line);
$output = ob_get_clean();
if(\AIP\lib\Config::get(\AIP\lib\Config::OPTION_VERBOSITY) > 0) {
Output::write(\AIP\lib\srvr\evlr\Result::message("Start of 'before_loop_exec'"));
Output::raw_write($output);
Output::write(\AIP\lib\srvr\evlr\Result::message("End of 'before_loop_exec'"));
}
}
示例4: debug
public static function debug($vars) {
ob_get_clean();
Evaluer::$path[] = 'debug';
Evaluer::sandbox_vars($vars, false);
$parser = new Parser;
$interrupted = false;
while(!$interrupted) {
$line = Input::read(Evaluer::pathenize());
$statement = $parser->parse($line);
$result = Evaluer::execute($statement);
Output::write($result);
$interrupted = $statement->interrupted();
}
$vars = Evaluer::sandbox_vars();
array_pop(Evaluer::$path);
ob_start();
return $vars;
}
示例5: fn_help
/**
* Display the help page
*
* @param string $q
* @param array $matches
* @param array $params
*/
function fn_help($q, $matches, $params)
{
Logger::write("Running: " . __FUNCTION__);
Output::write(Template::render('functions/help.tpl.php', $data), false, true);
}
示例6: print_ticker
function print_ticker()
{
if (RUN_MODE == 'INTERACTIVE') {
Output::write(TICKER, 'bold');
}
}
示例7: Rss
#include_once('3rd-party/simplepie/idn/idna_convert.class.php');
# RSS init:
$rss = new Rss();
# Get the posts:
Debug::info("Getting the posts");
$posts = $rss->getPosts($Config->getFeeds());
# Write mode output openning:
Debug::info("Generating HTML output at " . OUTDIR . "/" . OUTFILE);
Debug::info("Generating RSS 2.0 output at " . OUTDIR . "/rss20.xml");
$fOutput = new Output();
#
# Output files generation:
#
# Header:
Debug::info("Headers");
$fOutput->write(File::ReadAndParse('html/header.html'));
$fOutput->writeRss(File::ReadAndParse('xml/rss20_head.xml'));
# Javascript:
Debug::info("HTML: Javascript functions");
$fOutput->write(File::Read('html/functions.js'));
# Body:
Debug::info("Bodies");
# The posts:
Debug::info("The posts");
$fOutput->write('<div id="posts">');
# Posts loop:
foreach ($posts as $post) {
Debug::info(" Output (" . $post['author'] . ") " . $post['title']);
$fOutput->write(File::ReadAndParse('html/post.html', $post));
$fOutput->writeRss(File::ReadAndParse('xml/rss20_item.xml', $post));
}
示例8: fn_listincludes
/**
* Display a list of the base class includes
*
* @param string $q
* @param array $matches
* @param array $params
*/
function fn_listincludes($q, $matches, $params)
{
Logger::write("Running: " . __FUNCTION__);
$data = array('includes' => Titanium::loaded_classes());
Output::write(Template::render('functions/listincludes.tpl.php', $data), false, true);
}
示例9: help
/**
* Outputs the help menu.
*
* @return PhpCli\Parser Returns $this, for object-chaining.
*/
public function help()
{
echo PHP_EOL;
$output = new Output();
$output->write('Available Commands', ['color' => 'red', 'bold' => true, 'underline' => true]);
echo PHP_EOL;
$maxlen = 0;
foreach ($this->supportedArgs as $key => $description) {
$len = strlen($key);
if ($len > $maxlen) {
$maxlen = $len;
}
}
foreach ($this->supportedArgs as $key => $description) {
$len = strlen($key);
$output->write(' ')->write($key, ['color' => 'yellow'])->write(str_repeat(' ', $maxlen - $len))->write(' - ')->write($description);
echo PHP_EOL;
}
echo PHP_EOL;
}
示例10: writeln
/**
* 换行输入
*
* @param string $message
*/
function writeln($message = '')
{
$this->out->write($message, true);
}
示例11: fn_tutorial
/**
* Display the tutorial page
*
* @param string $q
* @param array $matches
* @param array $params
*/
function fn_tutorial($q, $matches, $params)
{
Logger::write("Running: " . __FUNCTION__);
Output::write(Template::render('functions/tutorial.tpl.php'), false, true);
}
示例12: write
/**
* Writes to an output and returns the output
*
* @param var $value
* @param text.json.Output $output
* @return text.json.Output The given output
*/
public static function write($value, Output $output)
{
$output->write($value);
return $output;
}