execute() public method

public execute ( $cmd )
示例#1
0
	public static function render($views = array()){
		foreach($views as $view){
			Util::execute(function() use ($view) {
				extract($view->args());
				include $view->path();
			});
		}
	}
示例#2
0
 public function render()
 {
     $meta = array_merge($this->meta, array('description' => '', 'author' => ''));
     $title = $this->title;
     $views = $this->views;
     Util::execute(function () use($meta, $title, $views) {
         extract($views);
         include 'views/HTML.php';
     });
     $this->afterRender();
 }
示例#3
0
 function main()
 {
     $util = new Util();
     $uptime = $util->execute('cat /proc/uptime');
     $uptime = preg_split("/[\\s]+/", $uptime[0]);
     $uptime = $uptime[0];
     $uptime = (int) ($uptime / 86400) . " day(s) " . (int) ($uptime / 3600) . " hour(s) " . floor($uptime / 60 % 60) . " minute(s) " . floor($uptime % 60) . " second(s)";
     $body = '
        <div class="container-fluid" style="margin:60px;">
            <div class="row-fluid show-grid">
                <div class="span6">
                    <div class="well"  style="font-size:14px; height:450px; overflow-x:auto; overflow-y:auto;">
                        <h2>Server Information</h2>
                        <br>Operating System: <span style="color:#08C;">' . php_uname('s') . ' ' . php_uname('r') . '</span><br><br>
                        Platform: <span style="color:#08C;">' . php_uname('m') . '</span><br><br>
                        Up Time: <span style="color:#08C;">' . $uptime . '</span><br><br>
                        Name: <span style="color:#08C;">' . php_uname('n') . '</span><br><br>
                        Document Root: <span style="color:#08C;">' . $_SERVER['DOCUMENT_ROOT'] . '</span><br><br>
                        Server Admin: <span style="color:#08C;">' . $_SERVER['SERVER_ADMIN'] . '</span><br><br>
                        Id:<br><span style="color:#08C;">' . implode('', $util->execute('id')) . '</span><br><br>
                        Uname -a:<br><span style="color:#08C;">' . implode('', $util->execute('uname -a')) . '</span><br><br>
                    </div>
                </div>
                <div class="span6">
                    <div class="well" style="height:450px; overflow-x:auto; overflow-y:auto;">
                        <h2>Disk</h2>
                        <span style="color:#08C;">' . $this->getFixedFormat($util->fixFormat($util->execute('df -h')), 5, 50) . '</span>
                    </div>
                </div>
            </div>
            <div class="row-fluid show-grid">
                <div class="span12">
                    <h2>Running Process</h2>
                    <div class="well" style="height:450px; overflow-x:auto; overflow-y:auto;">
                        <span style="color:#08C; ">' . $this->getFixedFormat($util->fixFormat($util->execute('ps aux')), 10, 20) . '</span><br><br>
                    </div>
                </div>
            </div>
        </div>
    ';
     return $body;
 }
示例#4
0
	public function render(){
		$meta = array_merge($this->meta, array(
			'description'=>'OSS Match is a tool to help match you to open source projects',
			'author'=>'Nicky Leach',
		));
		$title = $this->title;
		$views = $this->views;
		
		Util::execute(function() use ($meta, $title, $views){
			extract($views);
			include 'Views/template.php';
		});
		
		flush();
	}