?> <br> Copyright © 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>
/** * Magic getter for human-readable file size. * * @return type */ public function getFmtSize() { return FileUtil::formatSize($this->resolveSize()); }
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)); } }