Exemple #1
0
 /**
  * Set up the object. Initialize the proper folder for storing the files.
  *
  * @param string            $cacheDir
  * @param Silex\Application $app
  *
  * @throws \Exception
  */
 public function __construct($cacheDir, Silex\Application $app)
 {
     $this->app = $app;
     try {
         parent::__construct($cacheDir, $this->extension);
     } catch (\Exception $e) {
         $app['logger.system']->critical($e->getMessage(), ['event' => 'exception', 'exception' => $e]);
         throw $e;
     }
 }
 /**
  * Set up the object. Initialize the proper folder for storing the
  * files.
  *
  * @param  string                               $cacheDir
  * @throws \Exception|\InvalidArgumentException
  */
 public function __construct($cacheDir = null)
 {
     $filesystem = new Filesystem();
     if (!$filesystem->isAbsolutePath($cacheDir)) {
         $cacheDir = realpath(__DIR__ . "/" . $cacheDir);
     }
     try {
         parent::__construct($cacheDir, self::DEFAULT_EXTENSION);
     } catch (\InvalidArgumentException $e) {
         throw $e;
     }
 }
Exemple #3
0
 /**
  * Set up the object. Initialize the proper folder for storing the files.
  *
  * @param string      $cacheDir
  * @param Application $app
  *
  * @throws \Exception
  */
 public function __construct($cacheDir, Application $app)
 {
     $this->app = $app;
     try {
         parent::__construct($cacheDir, $this->extension);
         // If the Bolt version has changed, flush our cache
         if (!$this->checkCacheVersion()) {
             $this->clearCache();
         }
     } catch (\Exception $e) {
         $app['logger.system']->critical($e->getMessage(), ['event' => 'exception', 'exception' => $e]);
         throw $e;
     }
 }
Exemple #4
0
 /**
  * Set up the object. Initialize the proper folder for storing the
  * files.
  *
  * @param  string                               $cacheDir
  * @throws \Exception|\InvalidArgumentException
  */
 public function __construct($cacheDir = null)
 {
     if (!isset($cacheDir)) {
         $cacheDir = BOLT_CACHE_DIR;
     } else {
         // We don't have $app here, so we use the filesystem component
         // directly here.
         $filesystem = new Filesystem();
         if (!$filesystem->isAbsolutePath($cacheDir)) {
             $cacheDir = realpath(__DIR__ . "/" . $cacheDir);
         }
     }
     try {
         parent::__construct($cacheDir, self::DEFAULT_EXTENSION);
     } catch (\InvalidArgumentException $e) {
         throw $e;
     }
 }
Exemple #5
0
 /**
  * Cache constructor.
  *
  * @param string                       $directory
  * @param string                       $extension
  * @param int                          $umask
  * @param AggregateFilesystemInterface $filesystem
  */
 public function __construct($directory, $extension = self::EXTENSION, $umask = 02, AggregateFilesystemInterface $filesystem = null)
 {
     parent::__construct($directory, $extension, $umask);
     $this->filesystem = $filesystem;
 }
Exemple #6
0
 public function __construct()
 {
     return parent::__construct(sys_get_temp_dir() . DIRECTORY_SEPARATOR . "sonos");
 }
 public function __construct($cacheDir)
 {
     parent::__construct($cacheDir);
 }
Exemple #8
0
 public function __construct()
 {
     parent::__construct($this->path);
 }