clearCache example

Zend_Translate_Adapter::removeCache();
    }

    /** * Clears all set cache data * * @param string $tag Tag to clear when the default tag name is not used * @return void */
    public static function clearCache($tag = null)
    {
        Zend_Translate_Adapter::clearCache($tag);
    }

    /** * Calls all methods from the adapter */
    public function __call($method, array $options)
    {
        if (method_exists($this->_adapter, $method)) {
            return call_user_func_array(array($this->_adapter, $method)$options);
        }
        throw new Zend_Translate_Exception("Unknown method '" . $method . "' called!");
    }
$this->context = Context::createDefaultContext();
        $this->ids = new TestDataCollection();

        $this->browser = $this->createCustomSalesChannelBrowser([
            'id' => $this->ids->create('sales-channel'),
        ]);
        $this->assignSalesChannelContext($this->browser);

        $this->salesChannelContextFactory = $this->getContainer()->get(SalesChannelContextFactory::class)->getDecorated();
        $this->salesChannelContext = $this->salesChannelContextFactory->create(Uuid::randomHex()$this->ids->get('sales-channel'));

        $this->clearCache();

        $session = $this->getSession();
        static::assertInstanceOf(Session::class$session);
        $session->getFlashBag()->clear();

        $this->translator = $this->getContainer()->get('translator');
    }

    public function testGenerateAccountRecoveryRateLimit(): void
    {
        $passwordRecoveryMailRoute = $this->createMock(SendPasswordRecoveryMailRoute::class);
        
/** * clear cached content for the given template and cache id * * @param string $tpl_file name of template file * @param string $cache_id name of cache_id * @param string $compile_id name of compile_id * @param string $exp_time expiration time * @return boolean */
    public function clear_cache($tpl_file = null, $cache_id = null, $compile_id = null, $exp_time = null)
    {
        return $this->clearCache($tpl_file$cache_id$compile_id$exp_time);
    }

    /** * clear the entire contents of cache (all templates) * * @param string $exp_time expire time * @return boolean */
    public function clear_all_cache($exp_time = null)
    {
        return $this->clearCache(null, null, null, $exp_time);
    }
$plugin->setUpdated(new DateTime());
            $em->flush($plugin);
            $this->write();

            $em->flush();

            $this->Application()->Container()->get(DatabaseHandler::class)->loadToDatabase($bootstrap->Path() . 'Snippets/');
            $this->Application()->Container()->get(DatabaseHandler::class)->loadToDatabase($bootstrap->Path() . 'snippets/');
            $this->Application()->Container()->get(DatabaseHandler::class)->loadToDatabase($bootstrap->Path() . 'Resources/snippet/');

            // Clear proxy cache             $this->Application()->Hooks()->getProxyFactory()->clearCache();
        }

        $db = $this->Application()->Container()->get('db');

        $resourceId = $db->fetchOne(
            "SELECT id FROM s_core_acl_resources WHERE name = 'widgets'"
        );

        if (!$resourceId) {
            return $result;
        }

        
return array_values(array_filter(array_map(
      [$this, 'createInstance'],
      $plugin_ids
    )));
  }

  /** * {@inheritdoc} */
  public function clearCachedDefinitions(): void {
    parent::clearCachedDefinitions();
    $this->componentNegotiator->clearCache();
  }

  /** * Creates the library declaration array from a component definition. * * @param array $definition * The component definition. * * @return array * The library for the Library API. */
  
Zend_Locale_Data::removeCache();
    }

    /** * Clears all set cache data * * @param string $tag Tag to clear when the default tag name is not used * @return void */
    public static function clearCache($tag = null)
    {
        Zend_Locale_Data::clearCache($tag);
    }

    /** * Sets a new locale for data retreivement * Example: 'de_XX' will be set to 'de' because 'de_XX' does not exist * 'xx_YY' will be set to 'root' because 'xx' does not exist * * @param string|Zend_Locale $locale (Optional) Locale for parsing input * @throws Zend_Currency_Exception When the given locale does not exist * @return Zend_Currency Provides fluent interface */
    

    public function delete($id)
    {
        $this->checkPrivilege('delete');

        if (empty($id)) {
            throw new ParameterMissingException('id');
        }

        $this->clearCache($id);

        return true;
    }

    public function getIdByData($data)
    {
        return $data['id'] ?? false;
    }

    /** * Overwrites the base implementation as the cache endpoint does not involve any entity related logic * * @param array $data * * @return array */

        $this->context = Context::createDefaultContext();
        $this->ids = new TestDataCollection();

        $this->browser = $this->createCustomSalesChannelBrowser([
            'id' => $this->ids->create('sales-channel'),
        ]);
        $this->assignSalesChannelContext($this->browser);

        $this->salesChannelContextFactory = $this->getContainer()->get(SalesChannelContextFactory::class)->getDecorated();

        $this->clearCache();
    }

    protected function tearDown(): void
    {
        DisableRateLimiterCompilerPass::enableNoLimit();
    }

    public function testRateLimitLoginRoute(): void
    {
        $email = Uuid::randomHex() . '@example.com';
        $password = 'wrongPassword';
        

        return [
            SnippetEvents::SNIPPET_WRITTEN_EVENT => 'invalidate',
            SnippetEvents::SNIPPET_DELETED_EVENT => 'invalidate',
            SnippetEvents::SNIPPET_SET_DELETED_EVENT => 'invalidate',
        ];
    }

    public function invalidate(EntityWrittenEvent $event): void
    {
        if ($event->getEntityName() === SnippetSetDefinition::ENTITY_NAME) {
            $this->clearCache($event->getIds());

            return;
        }

        if ($event->getEntityName() === SnippetDefinition::ENTITY_NAME) {
            $snippetIds = $event->getIds();

            $setIds = $this->connection->fetchFirstColumn(
                'SELECT LOWER(HEX(snippet_set_id)) FROM snippet WHERE HEX(id) IN (:ids)',
                ['ids' => $snippetIds],
                ['ids' => ArrayParameterType::STRING]
            );


    /** * Callback for event Shopware_CronJob_ClearHttpCache * * Clears the file-based http-cache storage directory * * @return string */
    public function onClearHttpCache(Shopware_Components_Cron_CronJob $job)
    {
        if ($this->clearCache()) {
            return "Cleared HTTP-Cache\n";
        }

        return '';
    }

    /** * Callback for Shopware_Plugins_HttpCache_ClearCache-Event * * This events should be used to clear the http-cache without having * to check if the http-cache-plugin is installed and enabled. * * <code> * Shopware()->Events()->notify('Shopware_Plugins_HttpCache_ClearCache'); * </code> * * @return void */
Zend_Locale_Data::removeCache();
    }

    /** * Clears all set cache data * * @param string $tag Tag to clear when the default tag name is not used * @return void */
    public static function clearCache($tag = null)
    {
        Zend_Locale_Data::clearCache($tag);
    }

    /** * Disables the set cache * * @param boolean $flag True disables any set cache, default is false * @return void */
    public static function disableCache($flag)
    {
        Zend_Locale_Data::disableCache($flag);
    }
Home | Imprint | This part of the site doesn't use cookies.