Exemple #1
0
 /**
  * Test CC directories
  */
 public function testDirectories()
 {
     // check return
     $this->assertTrue(is_array(\ClanCats::directories()));
     // add a path
     ClanCats::directories(array('phpunittest' => 'phpunit/'));
     // check define
     $this->assertEquals('phpunit/', CCDIR_PHPUNITTEST);
     // check array
     $this->assertTrue(in_array('phpunittest', array_keys(\ClanCats::directories())));
 }
Exemple #2
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);
 }
Exemple #3
0
 /**
  * Init the migrator directory
  */
 public static function _init()
 {
     \ClanCats::directories(array('migration' => 'database/'));
     // read the migration configuration
     static::$config = \CCConfig::create('migrator', 'json');
 }
Exemple #4
0
 *---------------------------------------------------------------
 * 
 * Because we got now our nice own error handlers we don't wont 
 * that PHP itself prints any errors directly to the user.
 */
error_reporting(-1);
/*
 *---------------------------------------------------------------
 * pass the paths and directories
 *---------------------------------------------------------------
 * 
 * CCF wants to know wich paths and directories are registerd
 * so we pass the initinal param to the CCF object.
 */
ClanCats::paths($paths, false);
ClanCats::directories($directories, false);
unset($paths, $directories);
/*
 *---------------------------------------------------------------
 * environment setup
 *---------------------------------------------------------------
 * 
 * In CCF 1.0 we used a $_SERVER environment variable to set the
 * current CCF environment. This works great if you are abel to  
 * change the server conf. But often people dont have access to 
 * the configurations. 
 * So after doing multiple projects came to the 
 * conclusion that the framework itself should detect the 
 * environent using the hostname or other params.
 */
if (!isset($environment)) {