forked from phpDocumentor/phpDocumentor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace tedivm/stash with Symfony Cache
Symfony Cache provides a PSR-6/16 compatible cache interface that, with the Contracts, can be a simpler alternative to Stash. In this change I have also done a couple of optimizations to the output of phpDocumentor so that users see less notices and have a better output.
- Loading branch information
Showing
21 changed files
with
133 additions
and
503 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
45 changes: 0 additions & 45 deletions
45
src/phpDocumentor/Application/Stage/Cache/ConfigureCache.php
This file was deleted.
Oops, something went wrong.
50 changes: 50 additions & 0 deletions
50
src/phpDocumentor/Application/Stage/Cache/PurgeCachesWhenForced.php
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,50 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* This file is part of phpDocumentor. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* @author Mike van Riel <[email protected]> | ||
* @copyright 2010-2018 Mike van Riel / Naenius (http://www.naenius.com) | ||
* @license http://www.opensource.org/licenses/mit-license.php MIT | ||
* @link http://phpdoc.org | ||
*/ | ||
|
||
namespace phpDocumentor\Application\Stage\Cache; | ||
|
||
use phpDocumentor\Application\Stage\Payload; | ||
use Psr\Log\LoggerInterface; | ||
use Symfony\Component\Cache\Adapter\AdapterInterface; | ||
|
||
final class PurgeCachesWhenForced | ||
{ | ||
private $filesCache; | ||
private $descriptorsCache; | ||
private $logger; | ||
|
||
public function __construct( | ||
AdapterInterface $filesCache, | ||
AdapterInterface $descriptorsCache, | ||
LoggerInterface $logger | ||
) { | ||
$this->filesCache = $filesCache; | ||
$this->descriptorsCache = $descriptorsCache; | ||
$this->logger = $logger; | ||
} | ||
|
||
public function __invoke(Payload $payload) | ||
{ | ||
$this->logger->info('Checking whether to purge cache'); | ||
if (! $payload->getConfig()['phpdocumentor']['use-cache']) { | ||
$this->logger->info('Purging cache'); | ||
$this->filesCache->clear(); | ||
$this->descriptorsCache->clear(); | ||
} | ||
|
||
return $payload; | ||
} | ||
} |
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
Oops, something went wrong.