protected function preAdmin() { parent::preAdmin(); \Dsc\Apps::registerPath($this->dir . "/src/Shop/MassUpdate", 'massupdate'); if (class_exists('\\Minify\\Factory')) { \Minify\Factory::registerPath($this->dir . "/src/"); $files = array('Shop/Assets/js/jquery.sortable.css', 'Shop/Assets/css/jquery.star-rating.css'); foreach ($files as $file) { \Minify\Factory::css($file); } $files = array('Shop/Assets/js/class.js', 'Shop/Assets/js/validation.js', 'Shop/Assets/js/jquery.star-rating.js'); foreach ($files as $file) { \Minify\Factory::js($file); } } \Shop\Models\Reports::register('\\Shop\\Reports\\CustomersExpiredCarts', array('title' => 'Expired Carts', 'icon' => 'fa fa-shopping-cart', 'type' => 'customers', 'slug' => 'customers-expired-carts')); \Shop\Models\Reports::register('\\Shop\\Reports\\OrdersByCouponCode', array('title' => 'Orders - by Coupon Code', 'icon' => 'fa fa-inbox', 'type' => 'orders', 'slug' => 'orders-coupon-code')); $path = $this->app->hive()['PATH']; if (strpos($path, '/admin/shop/reports') !== false) { // Bootstrap the reports \Shop\Models\Reports::bootstrap(); } if (class_exists('\\Search\\Factory')) { \Search\Factory::registerSource(new \Search\Models\Source(array('id' => 'shop.products', 'title' => 'Products', 'class' => '\\Shop\\Models\\Products', 'priority' => 20))); \Search\Factory::registerSource(new \Search\Models\Source(array('id' => 'shop.orders', 'title' => 'Orders', 'class' => '\\Shop\\Models\\Orders', 'priority' => 20))); } \Shop\Models\PaymentMethods::register('\\Shop\\PaymentMethods\\OmnipayPaypalExpress', array('title' => 'Paypal Express (via Omnipay)', 'identifier' => 'omnipay.paypal_express')); \Shop\Models\PaymentMethods::register('\\Shop\\PaymentMethods\\OmnipayCybersource', array('title' => 'Cybersource (via Omnipay)', 'identifier' => 'omnipay.cybersource')); \Shop\Models\PaymentMethods::register('\\Shop\\PaymentMethods\\CCAvenue', array('title' => 'CCAvenue', 'identifier' => 'ccavenue')); static::diagnostics(); }
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'); }
protected function preAdmin() { parent::preAdmin(); \Dsc\Apps::registerPath($this->dir . "/src/Redirect/MassUpdate", 'massupdate'); }
<?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');