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 23
23
"nette/di" : " ~2.3" ,
24
24
"latte/latte" : " ~2.3.0"
25
25
},
26
+ "suggest" : {
27
+ "ext-pdo_sqlite" : " to use SQLiteStorage or SQLiteJournal"
28
+ },
26
29
"conflict" : {
27
30
"nette/nette" : " <2.2"
28
31
},
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 ' )
35
- ->setFactory ('Nette\Caching\Storages\SQLiteJournal ' , [$ this ->tempDir . '/cache/journal.s3db ' ]);
36
- }
32
+ $ builder ->addDefinition ($ this ->prefix ('journal ' ))
33
+ ->setClass ('Nette\Caching\Storages\IJournal ' )
34
+ ->setFactory ('Nette\Caching\Storages\SQLiteJournal ' , [$ this ->tempDir . '/cache/journal.s3db ' ]);
37
35
38
36
$ builder ->addDefinition ($ this ->prefix ('storage ' ))
39
37
->setClass ('Nette\Caching\IStorage ' )
40
38
->setFactory ('Nette\Caching\Storages\FileStorage ' , [$ 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 @@ -28,15 +28,16 @@ class SQLiteJournal extends Nette\Object implements IJournal
28
28
*/
29
29
public function __construct ($ path = ':memory: ' )
30
30
{
31
- if (!extension_loaded ('pdo_sqlite ' )) {
32
- throw new Nette \NotSupportedException ('SQLiteJournal requires PHP extension pdo_sqlite which is not loaded. ' );
33
- }
34
31
$ this ->path = $ path ;
35
32
}
36
33
37
34
38
35
private function open ()
39
36
{
37
+ if (!extension_loaded ('pdo_sqlite ' )) {
38
+ throw new Nette \NotSupportedException ('SQLiteJournal requires PHP extension pdo_sqlite which is not loaded. ' );
39
+ }
40
+
40
41
$ this ->pdo = new \PDO ('sqlite: ' . $ this ->path );
41
42
$ this ->pdo ->setAttribute (\PDO ::ATTR_ERRMODE , \PDO ::ERRMODE_EXCEPTION );
42
43
$ this ->pdo ->exec ('
You can’t perform that action at this time.
0 commit comments