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


PHP Output::write方法代码示例

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

示例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);
    }
}
开发者ID:Wixel,项目名称:TitaniumPHP-Console,代码行数:17,代码来源:fn.logs.php

示例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'"));
		}
	}
开发者ID:rATRIJS,项目名称:AIP,代码行数:14,代码来源:REPL.php

示例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;
	}
开发者ID:rATRIJS,项目名称:AIP,代码行数:24,代码来源:Debugger.php

示例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);
}
开发者ID:Wixel,项目名称:TitaniumPHP-Console,代码行数:12,代码来源:fn.help.php

示例6: print_ticker

function print_ticker()
{
    if (RUN_MODE == 'INTERACTIVE') {
        Output::write(TICKER, 'bold');
    }
}
开发者ID:Wixel,项目名称:TitaniumPHP-Console,代码行数:6,代码来源:shell.php

示例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));
}
开发者ID:jorgefuertes,项目名称:qPlanet,代码行数:31,代码来源:planet.php

示例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);
}
开发者ID:Wixel,项目名称:TitaniumPHP-Console,代码行数:13,代码来源:fn.listincludes.php

示例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;
 }
开发者ID:corycollier,项目名称:php-cli,代码行数:25,代码来源:Parser.php

示例10: writeln

 /**
  * 换行输入
  * 
  * @param string $message
  */
 function writeln($message = '')
 {
     $this->out->write($message, true);
 }
开发者ID:slince,项目名称:console,代码行数:9,代码来源:Io.php

示例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);
}
开发者ID:Wixel,项目名称:TitaniumPHP-Console,代码行数:12,代码来源:fn.tutorial.php

示例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;
 }
开发者ID:xp-forge,项目名称:json,代码行数:12,代码来源:Json.class.php


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