Esempio n. 1
0
 /**
  * print information about this application
  *
  * @param array 		$params 
  */
 public function action_info($params)
 {
     $app = \ClanCats::runtime();
     // print the app name
     $this->line(\CCForge_Php::make('comment', $app::$name . PHP_EOL . "*" . PHP_EOL . "Running on ClanCatsFramework " . \ClanCats::VERSION . PHP_EOL . "© 2010 - " . date('Y') . " ClanCats GmbH" . PHP_EOL), 'cyan');
     // list printer
     $list = function ($array) {
         foreach ($array as $key => $value) {
             $this->line($key . ': ' . CCCli::color($value, 'green'));
         }
     };
     // print info
     $list(array('Runtime Class' => $app, 'CCF Version' => \ClanCats::version(), 'CCF Environment' => \ClanCats::environment(), 'Development env' => var_export(\ClanCats::in_development(), true), 'File extention' => EXT, 'Core namespace' => CCCORE_NAMESPACE));
     // paths
     $this->line(PHP_EOL . "Paths", 'cyan');
     $list(\ClanCats::paths());
     // paths
     $this->line(PHP_EOL . "Directories", 'cyan');
     $list(\ClanCats::directories());
     // autoloader
     $this->line(PHP_EOL . "Autoloader - namespaces", 'cyan');
     $list(\CCFinder::$namespaces);
 }
Esempio n. 2
0
 /**
  * Test CC version
  */
 public function testVersion()
 {
     $this->assertTrue(!is_null(\ClanCats::version()));
 }
Esempio n. 3
0
 /**
  * start the ccf lifecycle
  *
  * this method sets the current environment, loads the configuration
  * and wakes the application
  *
  * @param string			$environment
  * @return void
  */
 public static function wake($environment)
 {
     if (!is_null(static::$environment)) {
         throw new CCException("ClanCats::wake - you cannot wake the application twice.");
     }
     // set environment
     static::$environment = $environment;
     // load the main configuration
     static::$config = CCConfig::create('main');
     // setup the application error tables
     CCError_Inspector::info_callback('ClanCatsFramework', function () {
         return array('Runtime Class' => \ClanCats::runtime(), 'CCF Version' => \ClanCats::version(), 'CCF Environment' => \ClanCats::environment(), 'Development env' => var_export(\ClanCats::in_development(), true), 'File extention' => EXT, 'Core namespace' => CCCORE_NAMESPACE);
     });
     CCError_Inspector::info_callback('CCF Paths', array('ClanCats', 'paths'));
     CCError_Inspector::info_callback('CCF Directories', array('ClanCats', 'directories'));
     CCError_Inspector::info_callback('Namespaces', function () {
         return \CCFinder::$namespaces;
     });
 }