/**
  * Object constructor
  * 
  * @param \THCFrame\Security\Authorization\RoleManager $roleManager
  * @param array $resources
  */
 public function __construct(RoleManager $roleManager, array $resources)
 {
     parent::__construct();
     $this->_roleManager = $roleManager;
     $this->_resources = $resources;
     $this->normalizeResources();
 }
 /**
  * Object constructor
  * 
  * @param array $options
  */
 public function __construct($options = array())
 {
     parent::__construct($options);
     Event::fire('framework.router.construct.before', array());
     $this->_createRoutes(self::$_defaultRoutes);
     Event::fire('framework.router.construct.after', array($this));
     $this->_findRoute($this->url);
 }
 /**
  * 
  * @param type $options
  */
 public function __construct($options = array())
 {
     parent::__construct($options);
     Event::fire('framework.view.construct.before', array($this->file));
     $this->_session = Registry::get('session');
     $this->_template = new Template\Template(array('implementation' => new Template\Implementation\Extended()));
     $this->_checkMessage();
     Event::fire('framework.view.construct.after', array($this->file, $this->template));
 }
 /**
  * Object constructor
  * 
  * @param array $options
  */
 public function __construct($options = array())
 {
     parent::__construct($options);
     Event::fire('framework.module.initialize.before', array($this->moduleName));
     $this->addModuleEvents();
     Event::add('framework.router.construct.after', function ($router) {
         $router->addRedirects($this->getRedirects());
         $router->addRoutes($this->getRoutes());
     });
     Event::fire('framework.module.initialize.after', array($this->moduleName));
 }
 /**
  * Create instance and load an image, or create an image from scratch
  *
  * @param null|string	$filename	Path to image file (may be omitted to create image from scratch)
  * @param int		$width		Image width (is used for creating image from scratch)
  * @param int|null		$height		If omitted - assumed equal to $width (is used for creating image from scratch)
  * @param null|string	$color		Hex color string, array(red, green, blue) or array(red, green, blue, alpha).
  *                                              Where red, green, blue - integers 0-255, alpha - integer 0-127<br>
  *                                              (is used for creating image from scratch)
  *
  * @return Image
  */
 public function __construct($filename = null, $base64 = null, $width = null, $height = null, $color = null)
 {
     parent::__construct();
     if ($filename) {
         $this->load($filename);
     } elseif ($base64) {
         $this->loadBase64($base64);
     } elseif ($width) {
         $this->create($width, $height, $color);
     }
     return $this;
 }
 /**
  * Class constructor
  * 
  * @param array $options
  * @throws \Exception
  */
 public function __construct($options = array())
 {
     parent::__construct($options);
     $configuration = Registry::get('configuration');
     if (!empty($configuration->files)) {
         $this->_pathToDocs = trim($configuration->files->pathToDocuments, '/');
         $this->_pathToImages = trim($configuration->files->pathToImages, '/');
         $this->_pathToThumbs = trim($configuration->files->pathToThumbs, '/');
         $this->checkDirectories();
     } else {
         throw new \Exception('Error in configuration file');
     }
 }
 /**
  * Object constructor
  * 
  * @param array $options
  */
 public function __construct($options = array())
 {
     if (!empty($options['response'])) {
         $response = $this->_response = $options['response'];
         unset($options['response']);
     }
     parent::__construct($options);
     $pattern = '#HTTP/\\d\\.\\d.*?$.*?\\r\\n\\r\\n#ims';
     preg_match_all($pattern, $response, $matches);
     $headers = array_pop($matches[0]);
     $headers = explode('\\r\\n', str_replace('\\r\\n\\r\\n', '', $headers));
     $this->_body = str_replace($headers, '', $response);
     $version = array_shift($headers);
     preg_match('#HTTP/(\\d\\.\\d)\\s(\\d\\d\\d)\\s(.*)#', $version, $matches);
     $this->_headers['Http-Version'] = $matches[1];
     $this->_headers['Status-Code'] = $matches[2];
     $this->_headers['Status'] = $matches[2] . ' ' . $matches[3];
     foreach ($headers as $header) {
         preg_match('#(.*?)\\:\\s(.*)#', $header, $matches);
         $this->_headers[$matches[1]] = $matches[2];
     }
 }
 public function __construct($options = array())
 {
     parent::__construct($options);
 }
 /**
  * 
  * @param type $options
  */
 public function __construct($options = array())
 {
     parent::__construct($options);
     $this->agent = RequestMethods::server('HTTP_USER_AGENT', 'Curl/PHP ' . PHP_VERSION);
 }
 /**
  * Object constructor
  * 
  * @param array $options
  */
 public function __construct($options = array())
 {
     parent::__construct($options);
     Event::fire('framework.controller.construct.before', array($this->name));
     //get resources
     $configuration = Registry::get('configuration');
     $session = Registry::get('session');
     $router = Registry::get('router');
     if (!empty($configuration->view)) {
         $this->defaultExtension = $configuration->view->extension;
         $this->defaultLayout = $configuration->view->layout;
         $this->mobileLayout = $configuration->view->mobilelayout;
         $this->tabletLayout = $configuration->view->tabletlayout;
         $this->defaultPath = $configuration->view->path;
     } else {
         throw new \Exception('Error in configuration file');
     }
     //collect main variables
     $module = $router->getLastRoute()->getModule();
     $controller = $router->getLastRoute()->getController();
     $action = $router->getLastRoute()->getAction();
     $deviceType = $session->get('devicetype');
     if ($deviceType == 'phone' && $this->mobileLayout != '') {
         $defaultLayout = $this->mobileLayout;
     } elseif ($deviceType == 'tablet' && $this->tabletLayout != '') {
         $defaultLayout = $this->tabletLayout;
     } else {
         $defaultLayout = $this->defaultLayout;
     }
     $defaultPath = sprintf($this->defaultPath, $module);
     $defaultExtension = $this->defaultExtension;
     //create view instances
     if ($this->willRenderLayoutView) {
         $view = new View(array('file' => APP_PATH . "/{$defaultPath}/{$defaultLayout}.{$defaultExtension}"));
         $this->layoutView = $view;
     }
     if ($this->willRenderActionView) {
         $view = new View(array('file' => APP_PATH . "/{$defaultPath}/{$controller}/{$action}.{$defaultExtension}"));
         $this->actionView = $view;
     }
     Event::fire('framework.controller.construct.after', array($this->name));
 }
Example #11
0
 /**
  * 
  * @param type $options
  */
 public function __construct($file)
 {
     parent::__construct();
     $this->_filename = $file;
     $this->_loadMetaData();
 }
 /**
  * 
  * @param type $options
  */
 public function __construct($options = array())
 {
     parent::__construct($options);
     //$this->load();
 }
 /**
  * Object constructor
  * 
  * @param \THCFrame\Security\Authorization\RoleManager $roleManager
  */
 public function __construct(RoleManager $roleManager)
 {
     parent::__construct();
     $this->_roleManager = $roleManager;
 }
 /**
  * Object constructor
  * 
  * @param array $users
  */
 public function __construct($users = array())
 {
     parent::__construct();
     $this->_users = $users;
     $this->normalizeUsers();
 }