Beispiel #1
0
 /**
  * Constructor
  *
  * @since   1.0
  */
 public function __construct()
 {
     $container = Container::getInstance();
     $container->registerServiceProvider(new ApplicationServiceProvider($this))->registerServiceProvider(new ConfigServiceProvider())->registerServiceProvider(new DatabaseServiceProvider());
     $this->setContainer($container);
     // Set error reporting based on config
     $errorReporting = (int) $container->get('config')->get('errorReporting', 0);
     error_reporting($errorReporting);
     parent::__construct();
 }
 /**
  * Instantiate the controller.
  *
  * @param   Input                $input  The input object.
  * @param   AbstractApplication  $app    The application object.
  *
  * @since   1.0
  */
 public function __construct(Input $input = null, AbstractApplication $app = null)
 {
     parent::__construct($input, $app);
     $this->container = Container::getInstance();
 }
Beispiel #3
0
 public static function getModel($modelName)
 {
     $fqcn = 'Cobalt\\Model\\' . $modelName;
     return \Cobalt\Container::getInstance()->buildObject($fqcn);
 }
Beispiel #4
0
 /**
  * Application constructor
  *
  * @since   1.0
  */
 public function __construct()
 {
     parent::__construct();
     $container = Container::getInstance();
     $container->registerServiceProvider(new Provider\ApplicationServiceProvider($this));
     // Setup the application pieces.
     $this->setContainer($container);
     $this->loadDocument();
     // Load the library language file
     //$this->getLanguage()->load('lib_joomla', JPATH_BASE);
     // TODO - NO MORE JFACTORY
     JFactory::$application = $this;
 }