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 24
24
"latte/latte" : " ~2.4" ,
25
25
"tracy/tracy" : " ^2.4"
26
26
},
27
+ "suggest" : {
28
+ "ext-pdo_sqlite" : " to use SQLiteStorage or SQLiteJournal"
29
+ },
27
30
"conflict" : {
28
31
"nette/nette" : " <2.2"
29
32
},
Original file line number Diff line number Diff line change @@ -29,20 +29,16 @@ public function loadConfiguration()
29
29
{
30
30
$ builder = $ this ->getContainerBuilder ();
31
31
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 ' ]);
37
35
38
36
$ builder ->addDefinition ($ this ->prefix ('storage ' ))
39
37
->setClass (Nette \Caching \IStorage::class)
40
38
->setFactory (Nette \Caching \Storages \FileStorage::class, [$ this ->tempDir . '/cache ' ]);
41
39
42
40
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 ' ));
46
42
$ builder ->addAlias ('cacheStorage ' , $ this ->prefix ('storage ' ));
47
43
}
48
44
}
Original file line number Diff line number Diff line change @@ -30,15 +30,16 @@ class SQLiteJournal implements IJournal
30
30
*/
31
31
public function __construct ($ path )
32
32
{
33
- if (!extension_loaded ('pdo_sqlite ' )) {
34
- throw new Nette \NotSupportedException ('SQLiteJournal requires PHP extension pdo_sqlite which is not loaded. ' );
35
- }
36
33
$ this ->path = $ path ;
37
34
}
38
35
39
36
40
37
private function open ()
41
38
{
39
+ if (!extension_loaded ('pdo_sqlite ' )) {
40
+ throw new Nette \NotSupportedException ('SQLiteJournal requires PHP extension pdo_sqlite which is not loaded. ' );
41
+ }
42
+
42
43
if ($ this ->path !== ':memory: ' && !is_file ($ this ->path )) {
43
44
touch ($ this ->path ); // ensures ordinary file permissions
44
45
}
You can’t perform that action at this time.
0 commit comments