Ejemplo n.º 1
0
 public function success(Form $form)
 {
     $values = $form->getValues();
     if ($values['section'] === 'all') {
         $this->cacheStorage->clean(array(Cache::ALL => true));
         $this->session->destroy();
     } elseif ($values['section'] === 'cache') {
         $this->cacheStorage->clean(array(array(Cache::ALL => true)));
     } elseif ($values['section'] === 'sessions') {
         $this->session->destroy();
     }
 }
Ejemplo n.º 2
0
Archivo: Model.php Proyecto: ytnuk/orm
 public function __construct(array $configuration, Nextras\Orm\Model\IRepositoryLoader $repositoryLoader, Nextras\Orm\Model\MetadataStorage $metadataStorage, Nette\Caching\IStorage $cacheStorage)
 {
     parent::__construct($configuration, $repositoryLoader, $metadataStorage);
     $this->onFlush[] = function () use($cacheStorage) {
         $cacheStorage->clean([Nette\Caching\Cache::TAGS => $this->tags]);
         $this->tags = [];
     };
 }
Ejemplo n.º 3
0
 /**
  * Removes items from the cache by conditions.
  * Conditions are:
  * - Cache::PRIORITY => (int) priority
  * - Cache::TAGS => (array) tags
  * - Cache::ALL => TRUE
  * @return void
  */
 public function clean(array $conditions = NULL)
 {
     $conditions = (array) $conditions;
     if (isset($conditions[self::TAGS])) {
         $conditions[self::TAGS] = array_values((array) $conditions[self::TAGS]);
     }
     $this->storage->clean($conditions);
 }
Ejemplo n.º 4
0
 /**
  * Removes items from the cache by conditions.
  * Conditions are:
  * - Cache::PRIORITY => (int) priority
  * - Cache::TAGS => (array) tags
  * - Cache::ALL => TRUE
  * @return void
  */
 public function clean(array $conditions = NULL)
 {
     $this->release();
     $this->storage->clean((array) $conditions);
 }
Ejemplo n.º 5
0
 /**
  * Removes items from the cache by conditions.
  * Conditions are:
  * - Cache::PRIORITY => (int) priority
  * - Cache::TAGS => (array) tags
  * - Cache::ALL => TRUE
  * @return void
  */
 public function clean(array $conditions = NULL)
 {
     $this->key = $this->data = NULL;
     $this->storage->clean((array) $conditions);
 }
Ejemplo n.º 6
0
 /**
  * Removes items from the cache by conditions.
  * Conditions are:
  * - Cache::PRIORITY => (int) priority
  * - Cache::TAGS => (array) tags
  * - Cache::ALL => TRUE
  *
  * @param  array
  *
  * @return void
  */
 public function clean(array $conds = null)
 {
     $this->release();
     $this->storage->clean((array) $conds);
 }