-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This change ensures that projects created in PHP 5.x will work as they do in the latest PHP 8.3. Add CacheModule and version check in AppInjector The current commit introduces the CacheModule and inserts it in the AppInjector module's installation process. In addition, a function named 'checkVersion' has been created to ensure the existence of 'Doctrine\Common\Cache\FilesystemCache', failing which an exception is triggered. The check is performed during the AppInjector’s construction. This ensures that a doctrine cache ^1.0 is always present for the functioning of AppInjector.
- Loading branch information
Showing
3 changed files
with
38 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace BEAR\Package\Module; | ||
|
||
use Doctrine\Common\Cache\ArrayCache; | ||
use Doctrine\Common\Cache\Cache; | ||
use Ray\Di\AbstractModule; | ||
use function interface_exists; | ||
|
||
/** | ||
* @deprecated | ||
*/ | ||
class CacheModule extends AbstractModule | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected function configure(): void | ||
{ | ||
if (interface_exists(Cache::class)) { | ||
$this->bind(Cache::class)->to(ArrayCache::class); | ||
} | ||
} | ||
} |