public function __construct()
 {
     parent::__construct(array('templates.path' => TEMPLATE_PATH, 'view' => new RainTplView()));
     $this->container->singleton('mysuperclass', function ($container) {
         return new MySuperClass();
     });
 }
Пример #2
0
 /**
  * Constructor
  * calls parent Slim::__construct
  * @param   array $userSettings
  * @return  void
  */
 public function __construct($userSettings = array())
 {
     $this->settings = array_merge_recursive(array('meta' => array('title' => 'Slimplr Framework', 'about' => 'A fork of http://www.slimframework.com/'), 'templates.path' => './templates', 'templates.default' => 'page_html5.php', 'navigation' => array('main' => array('filter' => array('status' => 'online'), 'level' => array('start' => 0, 'depth' => 100), 'modus' => 'nested'), 'global' => array('filter' => array('status' => 'online'), 'selection' => array('global' => "true"), 'level' => array('start' => 0, 'depth' => 100), 'modus' => 'nested'), 'breadcrumb' => array('filter' => array('status' => 'online'), 'selection' => array('first' => 1, 'current' => 1, 'parent' => 1), 'level' => array('start' => 0, 'depth' => 100), 'modus' => 'linear'), 'context' => array('filter' => array('status' => 'online'), 'selection' => array('current' => 1, 'child' => 1, 'brother' => 1), 'level' => array('start' => 0, 'depth' => 100), 'modus' => 'nested'))), $userSettings);
     parent::__construct($this->settings);
     #show($this->settings['meta']['about']);
     #show($this->settings['mode']);
     #show($this->request);
     $this->getRouting();
     #$this->run();
 }
Пример #3
0
    public function __construct($userSettings = array())
    {
        parent::__construct($userSettings);
        $this->add(new Slim_Middleware_SessionCookie());


        $this->config('db', $this->initDb());
        $this->config('source', $this->initSource());

        $this->view()->appendData(array(
            'app' => $this,
            'translation' => include 'assets/translation/de.php',
            'language' => 'de'
        ));

        $app = $this;
        $this->get('/', function () use ($app) {
            $app->render('index.php', array(
                'action' => 'index'
            ));
        })->via('GET', 'POST')->name('index');

        $this->get('/system', function () use ($app) {
            $system = new Shopware_Components_Check_System();
            $app->render('system.php', array(
                'action' => 'system',
                'system' => $system,
                'error' => false
            ));
        })->via('GET', 'POST')->name('system');

        $this->get('/update', function () use ($app) {
            echo "SET NAMES 'utf8';\n";
            echo "SET FOREIGN_KEY_CHECKS = 0;\n";
            echo "ALTER DATABASE DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;\n\n";
            $export = new Shopware_Components_DbDiff_Mysql(
                $this->config('source'),
                $this->config('db')
            );
            $tables = $export->listTables();
            foreach($tables as $table) {
                echo $export->getTableUpdate($table);
            }
        })->via('GET', 'POST')->name('backup');

        $this->get('/backup', function () use ($app) {
            $skipTables = array(
                's_articles_translations',
                's_search_index',
                's_search_keywords',
                's_core_log',
                's_core_sessions'
            );

            echo "SET NAMES 'utf8';\n";
            echo "SET FOREIGN_KEY_CHECKS = 0;\n\n";
            $export = new Shopware_Components_DbExport_Mysql(
                $this->config('db')
            );
            $tables = $export->listTables();
            foreach($tables as $table) {
                $export->setTable($table);
                foreach($export as $line) {
                    echo $line;
                    if(in_array($table, $skipTables)) {
                        break;
                    }
                }
            }
        })->via('GET', 'POST')->name('backup');

        //Shopware_Components_DbExport_Mysql
    }
Пример #4
0
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct();
 }