include_once 'medick/Exception.php'; include_once 'medick/Registry.php'; include_once 'medick/util.php'; include_once 'medick/io/Folder.php'; include_once 'medick/ConsoleOptions.php'; // include_once('simpletest/web_tester.php'); include_once 'simpletest/unit_tester.php'; include_once 'simpletest/reporter.php'; include_once 'configurator/LoggerConfigurator.php'; include_once 'logger/Logger.php'; // }}} // {{{ configure console $options = new ConsoleOptions(); $options->setNoValueFor('debug', '-d', '--debug'); $options->load(isset($argv) ? $argv : $_SERVER['argv']); $options->alias('debug', '-d, --debug'); // }}} // {{{ logger. $logger = new Logger(new LoggerConfigurator()); // }}} $test = new GroupTest("=== Medick Framework Unit Tests ==="); $test_files = Folder::recursiveFindRelative('.', 'test', 'Test.php'); foreach ($test_files as $file) { if ($options->has('debug')) { $logger->debug('Adding test file: ' . $file); } $test->addTestFile($file); } $test->run(new TextReporter()); if ($options->has('debug')) { $time_end = microtime(true);
touch(make_path($app_real_path, 'log', 'localhost.log')); chmod(make_path($app_real_path, 'log', 'localhost.log'), 0777); exit; } class Object { } error_reporting(E_ALL | E_NOTICE | E_RECOVERABLE_ERROR); require make_path(dirname(__FILE__), '..', 'lib', 'core', 'ErrorHandler.php'); require make_path(dirname(__FILE__), '..', 'lib', 'utils', 'ConsoleOptions.php'); set_error_handler(array(new ErrorHandler(), 'raiseError')); $c = new ConsoleOptions(); //$_SERVER['argv'] ); $c->setNoValueFor('generate'); $c->load($_SERVER['argv']); $c->alias('generate', '-g'); $c->alias('app'); $c->alias('controller', '-c'); $c->alias('task', '-t'); if ($c->has('generate')) { // we need to run a generator if ($c->has('app')) { generate_application($c->get()); } elseif ($c->has('controller')) { p('controller', 'Not Implemented'); } else { usage($c); } exit(0); } elseif ($c->has('task')) { p('umm', 'Not Implemented :|');