예제 #1
0
        function ascLogo($txtTableInfo)
        {
            $line_length = array_sum($txtTableInfo) + count($txtTableInfo) + 1;
            $asc_logo_data = <<<ASC_LOGO
                                   __         v%s
  ______________  ______________  / /_  ____
 / ___/ ___/ __ \\/ ___/ ___/ __ \\/ __ \\/ __ \\
/ /__/ /  / /_/ (__  )__  ) /_/ / / / / /_/ /
\\___/_/   \\____/____/____/ .___/_/ /_/ .___/
                        /_/         /_/
ASC_LOGO;
            $logo_lines = explode("\n", sprintf($asc_logo_data, \Cross\Core\Delegate::getVersion()));
            $offset = 6;
            $max_length = 0;
            foreach ($logo_lines as $line) {
                $length = strlen($line);
                if ($length > $max_length) {
                    $max_length = $length;
                }
            }
            $half_length = floor($line_length / 2 - ($max_length - $offset) / 2);
            foreach ($logo_lines as $line) {
                for ($i = 0; $i <= $line_length; $i++) {
                    if ($i == $half_length) {
                        echo $line;
                    } elseif ($i < $half_length) {
                        echo ' ';
                    }
                }
                echo PHP_EOL;
            }
            echo PHP_EOL;
        }
예제 #2
0
파일: Main.php 프로젝트: wonli/skeleton
 /**
  * 默认控制器
  */
 function index()
 {
     $this->data['version'] = Delegate::getVersion();
     $this->display($this->data);
 }