Exemplo n.º 1
0
 /**
  * Construct.
  *
  */
 public function __construct()
 {
     parent::__construct();
     $this->setShared('db', function () {
         $db = new \Mos\Database\CDatabaseBasic();
         $db->setOptions(require ANAX_APP_PATH . 'config/database/config_mysql.php');
         $db->connect();
         return $db;
     });
     $this->setShared('auth', function () {
         $auth = new \Anax\Auth\Auth();
         return $auth;
     });
     $this->setShared('form', function () {
         $form = new \Mos\HTMLForm\CForm();
         return $form;
     });
     $this->setShared('gravatar', function () {
         $gravatar = new \Anax\User\Gravatar();
         return $gravatar;
     });
     $this->setShared('user', function () {
         $form = new \Anax\User\User();
         return $form;
     });
     $this->setShared('tags', function () {
         $tags = new \Anax\Tag\Tag();
         return $tags;
     });
 }
Exemplo n.º 2
0
 /**
  * Construct.
  *
  */
 public function __construct()
 {
     parent::__construct();
     $this->set('documentation', function () {
         $fc = new \Anax\Content\CFileContent();
         $fc->setBasePath(ANAX_INSTALL_PATH . 'docs/');
         return $fc;
     });
 }
Exemplo n.º 3
0
 /**
  * Construct.
  *
  */
 public function __construct()
 {
     parent::__construct();
     // Add CDatabase to framework
     $this->setShared('db', function () {
         $db = new \Mos\Database\CDatabaseBasic();
         // LOCALp
         $db->setOptions(require ANAX_APP_PATH . 'config/config_mysql.php');
         // BTH
         // $db->setOptions(require ANAX_APP_PATH . 'config/config_mysql_bth.php');
         $db->connect();
         return $db;
     });
     // Add CForm to framework
     $this->set('form', '\\Mos\\HTMLForm\\CForm');
     // Create extra navbar for top menu
     $this->setShared('topnav', function () {
         $navbar = new \Anax\Navigation\CNavbar();
         $navbar->setDI($this);
         $navbar->configure(ANAX_APP_PATH . 'config/topnav.php');
         return $navbar;
     });
     // Add UserController to framework
     $this->set('UserController', function () {
         $controller = new \Anax\User\UserController();
         $controller->setDI($this);
         return $controller;
     });
     // Add QuestionsController to framework
     $this->set('QuestionsController', function () {
         $controller = new \Anax\Questions\QuestionsController();
         $controller->setDI($this);
         $controller->setup();
         return $controller;
     });
     // Add AnswersController to framework
     $this->set('AnswersController', function () {
         $controller = new \Anax\Answers\AnswersController();
         $controller->setDI($this);
         $controller->setup();
         return $controller;
     });
     // Add CommentsController to framework
     $this->set('CommentsController', function () {
         $controller = new \Anax\Comments\CommentsController();
         $controller->setDI($this);
         $controller->setup();
         return $controller;
     });
     // Add TagsController to framework
     $this->set('TagsController', function () {
         $controller = new \Anax\Tags\TagsController();
         $controller->setDI($this);
         $controller->setup();
         return $controller;
     });
 }
Exemplo n.º 4
0
 /**
  * Construct.
  *
  */
 public function __construct()
 {
     parent::__construct();
     $this->set('documentation', function () {
         $fc = new \Anax\Content\CFileContent();
         $fc->setBasePath(ANAX_INSTALL_PATH . 'docs/documentation');
         return $fc;
     });
     $this->theme->setVariable('style', "article {max-width: 650px;}");
     $this->theme->setBaseTitle(" - Anax documentation");
 }
Exemplo n.º 5
0
 public function __construct()
 {
     parent::__construct();
     $this->set('form', '\\Mos\\HTMLForm\\CForm');
     $this->setShared('db', function () {
         $db = new \Mos\Database\CDatabaseBasic();
         $db->setOptions(require ANAX_APP_PATH . 'config/database_sqlite.php');
         $db->connect();
         return $db;
     });
 }
Exemplo n.º 6
0
 /**
  * Construct.
  *
  */
 public function __construct()
 {
     parent::__construct();
     // Add forms service
     $this->set('form', '\\Mos\\HTMLForm\\CForm');
     // Add databas service as a singleton
     $this->setShared('db', function () {
         $db = new \Mos\Database\CDatabaseBasic();
         $db->setOptions(require ANAX_APP_PATH . 'config/database_mysql.php');
         $db->connect();
         return $db;
     });
 }
Exemplo n.º 7
0
 /**
  * Construct.
  *
  */
 public function __construct()
 {
     parent::__construct();
     $this->setShared('db', function () {
         $db = new \Mos\Database\CDatabaseBasic();
         if (isset($_SERVER['HTTP-HOST'])) {
             if ($_SERVER['HTTP-HOST'] == 'localhost') {
                 $db->setOptions(require ANAX_APP_PATH . 'config/config_mysql.php');
             }
         } else {
             $db->setOptions(require ANAX_APP_PATH . 'config/config_mysql_bth.php');
         }
         $db->connect();
         return $db;
     });
     $this->setShared('form', function () {
         $form = new \Mos\HTMLForm\CForm();
         $this->session;
         //$form->saveInSession = true;
         return $form;
     });
     // Set controllers
     $this->set('CommentController', function () {
         $controller = new \Phpmvc\Comment\CommentController();
         $controller->setDI($this);
         return $controller;
     });
     $this->set('UsersController', function () {
         $controller = new \Anax\Users\UsersController();
         $controller->setDI($this);
         return $controller;
     });
     $this->set('FormController', function () {
         $controller = new \Anax\HTMLForm\FormController();
         $controller->setDI($this);
         return $controller;
     });
     $this->set('logger', function () {
         $logger = new \Eden\Log\Clog();
         //$controller->setDI($logger);
         return $logger;
     });
 }
 /**
  * Construct.
  *
  */
 public function __construct()
 {
     parent::__construct();
     $this->setShared('theme', function () {
         $themeEngine = new \Anax\ThemeEngine\CThemeExtended();
         $themeEngine->setDI($this);
         $themeEngine->configure(ANAX_APP_PATH . 'config/theme.php');
         return $themeEngine;
     });
     // Forms service
     $this->set('form', '\\Mos\\HTMLForm\\CForm');
     // Database service for Anax
     $this->setShared('db', function () {
         $db = new \Mos\Database\CDatabaseBasic();
         $db->setOptions(require ANAX_APP_PATH . 'config/config_sqlite.php');
         $db->connect();
         return $db;
     });
     // Flash messages
     $this->setShared('flashmessage', function () {
         $flashmessages = new \helikopterspark\FlashMsg\FlashMsg();
         $flashmessages->setDI($this);
         return $flashmessages;
     });
     // Comments
     $this->set('CommentsController', function () {
         $commentscontroller = new \CR\Comment\CommentsController();
         $commentscontroller->setDI($this);
         return $commentscontroller;
     });
     // Users
     $this->set('UsersController', function () {
         $userscontroller = new \Anax\Users\UsersController();
         $userscontroller->setDI($this);
         return $userscontroller;
     });
     $this->setShared('logger', function () {
         $logger = new \Toeswade\Log\Clog();
         return $logger;
     });
 }
Exemplo n.º 9
0
 /**
  * Construct.
  *
  */
 public function __construct()
 {
     parent::__construct();
     $this->theme->setBaseTitle(" - Anax test case");
     $this->url->setStaticBaseUrl($this->request->getBaseUrl() . "/..");
 }