-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #278 from Verivox/provide_response_cache
Provide response cache
- Loading branch information
Showing
9 changed files
with
588 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<?php | ||
/** | ||
* Pimcore | ||
* | ||
* This source file is available under two different licenses: | ||
* - GNU General Public License version 3 (GPLv3) | ||
* - Pimcore Enterprise License (PEL) | ||
* Full copyright and license information is available in | ||
* LICENSE.md which is distributed with this source code. | ||
* | ||
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org) | ||
* @license http://www.pimcore.org/license GPLv3 and PEL | ||
*/ | ||
|
||
namespace Pimcore\Bundle\DataHubBundle\Event\GraphQL\Model; | ||
|
||
use Pimcore\Event\Traits\RequestAwareTrait; | ||
use Symfony\Component\EventDispatcher\Event; | ||
use Symfony\Component\HttpFoundation\Request; | ||
|
||
class OutputCachePreLoadEvent extends Event | ||
{ | ||
use RequestAwareTrait; | ||
|
||
/** | ||
* @var Request | ||
*/ | ||
protected $request; | ||
|
||
/** | ||
* @var bool | ||
*/ | ||
protected $useCache; | ||
|
||
/** | ||
* @return Request | ||
*/ | ||
public function getRequest() | ||
{ | ||
return $this->request; | ||
} | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function isUseCache() | ||
{ | ||
return $this->useCache; | ||
} | ||
|
||
/** | ||
* @param bool $useCache | ||
*/ | ||
public function setUseCache(bool $useCache) | ||
{ | ||
$this->useCache = $useCache; | ||
} | ||
|
||
/** | ||
* @param Request $request | ||
* @param bool $useCache | ||
*/ | ||
public function __construct(Request $request, bool $useCache) | ||
{ | ||
$this->request = $request; | ||
$this->useCache = $useCache; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<?php | ||
/** | ||
* Pimcore | ||
* | ||
* This source file is available under two different licenses: | ||
* - GNU General Public License version 3 (GPLv3) | ||
* - Pimcore Enterprise License (PEL) | ||
* Full copyright and license information is available in | ||
* LICENSE.md which is distributed with this source code. | ||
* | ||
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org) | ||
* @license http://www.pimcore.org/license GPLv3 and PEL | ||
*/ | ||
|
||
namespace Pimcore\Bundle\DataHubBundle\Event\GraphQL\Model; | ||
|
||
use Pimcore\Event\Traits\RequestAwareTrait; | ||
use Pimcore\Event\Traits\ResponseAwareTrait; | ||
use Symfony\Component\EventDispatcher\Event; | ||
use Symfony\Component\HttpFoundation\Request; | ||
use Symfony\Component\HttpFoundation\Response; | ||
|
||
class OutputCachePreSaveEvent extends Event | ||
{ | ||
use RequestAwareTrait; | ||
use ResponseAwareTrait; | ||
|
||
/** | ||
* @var Request | ||
*/ | ||
protected $request; | ||
|
||
/** | ||
* @var Response | ||
*/ | ||
protected $response; | ||
|
||
/** | ||
* @return Request | ||
*/ | ||
public function getRequest() | ||
{ | ||
return $this->request; | ||
} | ||
|
||
/** | ||
* @return Response | ||
*/ | ||
public function getResponse() | ||
{ | ||
return $this->response; | ||
} | ||
|
||
/** | ||
* @param Response $response | ||
*/ | ||
public function setResponse(Response $response) | ||
{ | ||
$this->response = $response; | ||
} | ||
|
||
/** | ||
* @param Request $request | ||
* @param Response $response | ||
*/ | ||
public function __construct(Request $request, Response $response) | ||
{ | ||
$this->request = $request; | ||
$this->response = $response; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* Pimcore | ||
* | ||
* This source file is available under two different licenses: | ||
* - GNU General Public License version 3 (GPLv3) | ||
* - Pimcore Enterprise License (PEL) | ||
* Full copyright and license information is available in | ||
* LICENSE.md which is distributed with this source code. | ||
* | ||
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org) | ||
* @license http://www.pimcore.org/license GPLv3 and PEL | ||
*/ | ||
|
||
namespace Pimcore\Bundle\DataHubBundle\Event\GraphQL; | ||
|
||
final class OutputCacheEvents | ||
{ | ||
/** | ||
* Fired to determine if a response should be cached. | ||
* | ||
* @Event("Pimcore\Bundle\DataHubBundle\Event\GraphQL\Model\CachePreLoadEvent") | ||
* | ||
* @var string | ||
*/ | ||
const PRE_LOAD = 'pimcore.datahub.graphql.cache.preLoad'; | ||
|
||
/** | ||
* Fired before the response is written to cache. Can be used to set or purge | ||
* data on the cached response. | ||
* | ||
* @Event("Pimcore\Bundle\DataHubBundle\Event\GraphQL\Model\CachePreSaveEvent") | ||
* | ||
* @var string | ||
*/ | ||
const PRE_SAVE = 'pimcore.datahub.graphql.cache.preSave'; | ||
} |
Oops, something went wrong.