File tree Expand file tree Collapse file tree 3 files changed +11
-11
lines changed Expand file tree Collapse file tree 3 files changed +11
-11
lines changed Original file line number Diff line number Diff line change 2424 "latte/latte" : " ~2.4" ,
2525 "tracy/tracy" : " ^2.4"
2626 },
27+ "suggest" : {
28+ "ext-pdo_sqlite" : " to use SQLiteStorage or SQLiteJournal"
29+ },
2730 "conflict" : {
2831 "nette/nette" : " <2.2"
2932 },
Original file line number Diff line number Diff line change @@ -29,20 +29,16 @@ public function loadConfiguration()
2929 {
3030 $ builder = $ this ->getContainerBuilder ();
3131
32- if (extension_loaded ('pdo_sqlite ' )) {
33- $ builder ->addDefinition ($ this ->prefix ('journal ' ))
34- ->setClass (Nette \Caching \Storages \IJournal::class)
35- ->setFactory (Nette \Caching \Storages \SQLiteJournal::class, [$ this ->tempDir . '/cache/journal.s3db ' ]);
36- }
32+ $ builder ->addDefinition ($ this ->prefix ('journal ' ))
33+ ->setClass (Nette \Caching \Storages \IJournal::class)
34+ ->setFactory (Nette \Caching \Storages \SQLiteJournal::class, [$ this ->tempDir . '/cache/journal.s3db ' ]);
3735
3836 $ builder ->addDefinition ($ this ->prefix ('storage ' ))
3937 ->setClass (Nette \Caching \IStorage::class)
4038 ->setFactory (Nette \Caching \Storages \FileStorage::class, [$ this ->tempDir . '/cache ' ]);
4139
4240 if ($ this ->name === 'cache ' ) {
43- if (extension_loaded ('pdo_sqlite ' )) {
44- $ builder ->addAlias ('nette.cacheJournal ' , $ this ->prefix ('journal ' ));
45- }
41+ $ builder ->addAlias ('nette.cacheJournal ' , $ this ->prefix ('journal ' ));
4642 $ builder ->addAlias ('cacheStorage ' , $ this ->prefix ('storage ' ));
4743 }
4844 }
Original file line number Diff line number Diff line change @@ -30,15 +30,16 @@ class SQLiteJournal implements IJournal
3030 */
3131 public function __construct ($ path )
3232 {
33- if (!extension_loaded ('pdo_sqlite ' )) {
34- throw new Nette \NotSupportedException ('SQLiteJournal requires PHP extension pdo_sqlite which is not loaded. ' );
35- }
3633 $ this ->path = $ path ;
3734 }
3835
3936
4037 private function open ()
4138 {
39+ if (!extension_loaded ('pdo_sqlite ' )) {
40+ throw new Nette \NotSupportedException ('SQLiteJournal requires PHP extension pdo_sqlite which is not loaded. ' );
41+ }
42+
4243 if ($ this ->path !== ':memory: ' && !is_file ($ this ->path )) {
4344 touch ($ this ->path ); // ensures ordinary file permissions
4445 }
You can’t perform that action at this time.
0 commit comments