Ejemplo n.º 1
0
 function __construct(\Puzzlout\Framework\Core\Application $app, $data)
 {
     parent::__construct($app);
     $this->rootDirectory = Config::Init($this->app)->Get(\Puzzlout\Framework\Enums\AppSettingKeys::RootDocumentUpload);
     //@todo: webDirectory is different from context: is it a document or an image?
     $this->webDirectory = Config::Init($this->app)->Get(\Puzzlout\Framework\Enums\AppSettingKeys::DefaultUrl) . Config::Init($this->app)->Get(\Puzzlout\Framework\Enums\AppSettingKeys::RootDocumentUpload);
     $this->dataPost = array_key_exists("dataPost", $data) ? $data["dataPost"] : [];
 }
Ejemplo n.º 2
0
 /**
  * Magic method construct.
  * @param string $api
  * The SQL API to use. 
  * @param \Puzzlout\Framework\Core\Application $app
  * Instance of \Puzzlout\Framework\Core\Application to 
  * @todo Build an interface to use any API. Basically a MYSQL factory or a 
  * MYSQLI factory class must be built to use those API. The default is PDO.
  */
 public function __construct($api, \Puzzlout\Framework\Core\Application $app)
 {
     $this->databaseApi = $api;
     $this->databaseConnection = PDOFactory::getMysqlConnexion($app);
     $this->dalApplicationFolderPath = \Puzzlout\Framework\Core\Config::Init($app)->Get(\Puzzlout\Framework\Enums\AppSettingKeys::ApplicationsDalFolderPath);
     $this->dalApplicationsNamespace = $this->GetDalApplicationNamespace();
     $this->dalFrameworkNameSpace = "\\Puzzlout\\Framework\\Dal\\Modules\\";
 }
Ejemplo n.º 3
0
 public function setLanguage()
 {
     $this->defaultLang = $this->app->cultures[Config::Init($this->app)->Get(\Puzzlout\Framework\Enums\AppSettingKeys::DefaultCulture)];
 }
Ejemplo n.º 4
0
 /**
  * Instanciate the class
  * 
  * 
  * @param \Puzzlout\Framework\Core\Application $app
  */
 public function __construct(\Puzzlout\Framework\Core\Application $app)
 {
     parent::__construct($app);
     $typeOfCache = \Puzzlout\Framework\Core\Config::Init($app)->Get(\Puzzlout\Framework\Enums\AppSettingKeys::CACHETYPEUSED);
     $this->cacheType = constant("\\Puzzlout\\Framework\\Core\\Cache\\BaseCache::{$typeOfCache}");
 }
Ejemplo n.º 5
0
 /**
  * Instanciate the Route object from the current request.
  * 
  * @return \Puzzlout\Framework\Core\Route the Route instance
  */
 private function FindRouteMatch()
 {
     $route = new Route();
     $route->setDefaultUrl(Config::Init($this->app)->Get(\Puzzlout\Framework\Enums\AppSettingKeys::DefaultUrl));
     $this->getRoute($route, $this->url);
     return $route;
 }
Ejemplo n.º 6
0
 /**
  * @see \Puzzlout\Framework\Interfaces\ICacher
  * @param string $key
  * @param mixed $value
  * @return bool
  * @throws \Exception
  */
 public function Update($key, $value)
 {
     $doesKeyExist = $this->KeyExists($key);
     if (!$doesKeyExist) {
         $errMsg = "Key wasn't found in the store. You need to use the Create method.";
         throw new \Exception($errMsg, Codes\CacheErrors::KEY_NOT_FOUND_ON_UPDATE, null);
     }
     $isValueCached = apc_store($key, $value, \Puzzlout\Framework\Core\Config::Init($this->app)->Get("CacheTtl"));
     return $isValueCached;
 }
Ejemplo n.º 7
0
 public function __construct(\Puzzlout\Framework\Core\Application $app)
 {
     parent::__construct($app);
     $this->rootDirectory = Config::Init($this->app)->Get(\Puzzlout\Framework\Enums\AppSettingKeys::RootDocumentUpload);
 }