Пример #1
0
?>
 
    <br>
    Copyright &copy; 2011-<?php 
echo date('Y');
?>
 X2Engine Inc.
	<?php 
if (Yii::app()->edition === 'opensource') {
    ?>
		Released as free software without warranties under the <a href="<?php 
    echo Yii::app()->getBaseUrl();
    ?>
/LICENSE.txt" title="GNU Affero General Public License version 3">GNU Affero GPL v3</a>.
	<?php 
}
?>
	<br>
	<?php 
echo CHtml::link(CHtml::image(Yii::app()->params->x2Power, '', array('id' => 'powered-by-x2engine')), 'http://www.x2engine.com/');
?>
	<div id="response-time">
	<?php 
echo round(Yii::getLogger()->getExecutionTime() * 1000), 'ms ';
$peak_memory = memory_get_peak_usage(true);
echo FileUtil::formatSize($peak_memory, 2);
?>
</div>
	
</div>
Пример #2
0
 /**
  * Magic getter for human-readable file size.
  *
  * @return type
  */
 public function getFmtSize()
 {
     return FileUtil::formatSize($this->resolveSize());
 }
Пример #3
0
 public function testFormatSize()
 {
     $sizes = array('0 B' => 0, '200 B' => 200, '10 KB' => 1024 * 10, '6 MB' => 6 * 1024 * 1024, '2 GB' => 2 * pow(1024, 3), '3 TB' => 3 * pow(1024, 4));
     foreach ($sizes as $readable => $size) {
         $this->assertEquals($readable, FileUtil::formatSize($size));
     }
 }