File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -152,7 +152,11 @@ public function __construct($pdo)
152152 wp_die ('Database is not initialized. ' , 'Database Error ' );
153153 }
154154 foreach ($ this ->functions as $ f => $ t ) {
155- $ pdo ->sqliteCreateFunction ($ f , [$ this , $ t ]);
155+ if (PHP_VERSION_ID >= 80400 ) {
156+ $ pdo ->createFunction ($ f , [$ this , $ t ]);
157+ } else {
158+ $ pdo ->sqliteCreateFunction ($ f , [$ this , $ t ]);
159+ }
156160 }
157161 }
158162
@@ -1163,7 +1167,11 @@ function __construct()
11631167 $ status = 0 ;
11641168 do {
11651169 try {
1166- $ this ->pdo = new PDO ($ dsn , null , null , [PDO ::ATTR_ERRMODE => PDO ::ERRMODE_EXCEPTION ]);
1170+ if (PHP_VERSION_ID >= 80400 ) {
1171+ $ this ->pdo = new \Pdo \Sqlite ($ dsn , null , null , [\PDO ::ATTR_ERRMODE => \PDO ::ERRMODE_EXCEPTION ]);
1172+ } else {
1173+ $ this ->pdo = new PDO ($ dsn , null , null , [PDO ::ATTR_ERRMODE => PDO ::ERRMODE_EXCEPTION ]);
1174+ }
11671175 new PDOSQLiteUDFS ($ this ->pdo );
11681176 $ GLOBALS ['@pdo ' ] = $ this ->pdo ;
11691177 } catch (PDOException $ ex ) {
You can’t perform that action at this time.
0 commit comments