public function diagnostics() { /* * TODO move all the Model finding code to the Apps Bootstraps.php files and than use the bootstapper to * load all the files calling them directly instead of this method * * I was in too much of a hurry to edit all the apps and their bootstraps, this is big step forward the right direction though */ // bootstap each mini-app these are in apps folder, as well as in vender/dioscouri $app = \Base::instance(); $app->set('APP_NAME', 'site'); $apps = \Dsc\Apps::instance()->bootstrap(null, [], false); var_dump($apps); $app = \Base::instance(); $app->set('APP_NAME', 'admin'); $apps = \Dsc\Apps::instance()->bootstrap(null, [], false); var_dump($apps); $classes = get_declared_classes(); foreach ($classes as $class) { echo $class . '<br>'; if (strpos($class, 'Model') !== false && $class != '\\Dsc\\Models\\Collection' || strpos($class, 'Dsc\\Models\\Collection') !== false && $class != '\\Dsc\\Models\\Collection') { $model = new $class(); if (method_exists($model, 'DscAppCreateIndexes') && $model instanceof \Dsc\Mongo\Collection) { try { $model->DscAppCreateIndexes(); } catch (\Exception $e) { \Dsc\System::addMessage($e->getMessage(), 'error'); } } } } die; $result = \Dsc\System::instance()->trigger('onSystemDiagnostics'); \Base::instance()->set('result', $result); $this->app->set('meta.title', 'Diagnostics'); echo \Dsc\System::instance()->get('theme')->renderTheme('Admin/Views::system/diagnostics.php'); }
<?php define('PATH_ROOT', realpath(__DIR__ . '/../../../../../../') . '/'); //AUTOLOAD all your composer libraries now. @(include_once realpath(__DIR__ . '/../../../../../../') . '/vendor/autoload.php') or die("You need to run php composer.phar install for your application to run."); //Require FatFree Base Library https://github.com/bcosca/fatfree $app = Base::instance(); $app->set('PATH_ROOT', PATH_ROOT); $app->set('AUTOLOAD', $app->get('PATH_ROOT') . 'apps/;'); //require $app->get('PATH_ROOT') . 'vendor/autoload.php'; $app->set('APP_NAME', 'cli'); require $app->get('PATH_ROOT') . 'config/config.php'; // bootstap each mini-app \Dsc\Apps::instance()->bootstrap(); // process the queue! \Dsc\Queue::process('local');