Example #1
0
 /**
  * {@inheritdoc}
  */
 public function gc($dataTTL)
 {
     $files = $this->fileSystem->glob($this->sessionPath . '/*');
     if (is_array($files)) {
         foreach ($files as $file) {
             if ($this->fileSystem->lastModified($file) + $dataTTL < time() && $this->fileSystem->isWritable($file)) {
                 $this->fileSystem->delete($file);
             }
         }
     }
 }
Example #2
0
 /**
  * Returns all package migrations.
  *
  * @access  protected
  * @return  array
  */
 protected function findPackageMigrations()
 {
     $migrations = [];
     foreach ($this->application->getPackages() as $package) {
         foreach ($this->fileSystem->glob($package->getPath() . '/src/migrations/*.php') as $migration) {
             $migrations[] = (object) ['package' => $package->getName(), 'version' => $this->getBasename($migration)];
         }
     }
     return $migrations;
 }
Example #3
0
 /**
  * {@inheritdoc}
  */
 public function clear()
 {
     $files = $this->fileSystem->glob($this->cachePath . '/*');
     if (is_array($files)) {
         foreach ($files as $file) {
             if ($this->fileSystem->isFile($file) && $this->fileSystem->delete($file) === false) {
                 return false;
             }
         }
     }
     return true;
 }