Skip to content

Commit 4cab155

Browse files
committed
Remove(legacy): drop PHP v5.3 check for SQLite version match
1 parent 2b5a586 commit 4cab155

File tree

3 files changed

+7
-18
lines changed

3 files changed

+7
-18
lines changed

lib/cache/sfSQLiteCache.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ protected function isSqLite3()
306306
protected function getSqLiteVersion()
307307
{
308308
if (null === $this->sqlLiteVersion) {
309-
$this->sqlLiteVersion = version_compare(PHP_VERSION, '5.3', '>') ? 3 : 2;
309+
$this->sqlLiteVersion = 3;
310310
}
311311

312312
return $this->sqlLiteVersion;

lib/i18n/sfMessageSource.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public static function factory($type, $source = '.', $filename = '')
130130
include_once $filename;
131131
}
132132

133-
if (('SQLite' == $type) && version_compare(PHP_VERSION, '5.3', '>')) {
133+
if ('SQLite' === $type) {
134134
$type .= '3';
135135
}
136136

test/unit/i18n/sfMessageSource_SQLiteTest.php

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -92,23 +92,12 @@ function init_fixtures($temp)
9292
"INSERT INTO trans_unit (msg_id, cat_id, id, source, target, translated) VALUES (2, 1, 2, 'another english sentence', 'une autre phrase en français', 1)",
9393
);
9494

95-
if (version_compare(PHP_VERSION, '5.3', '>')) {
96-
$db = new SQLite3($temp);
97-
98-
foreach ($queries as $query) {
99-
$db->exec($query);
100-
}
101-
102-
$db->close();
103-
} else {
104-
$db = sqlite_open($temp);
105-
106-
foreach ($queries as $query) {
107-
sqlite_query($query, $db);
108-
}
109-
110-
sqlite_close($db);
95+
$db = new SQLite3($temp);
96+
foreach ($queries as $query) {
97+
$db->exec($query);
11198
}
11299

100+
$db->close();
101+
113102
return sfMessageSource::factory('SQLite', 'sqlite://localhost/'.$temp);
114103
}

0 commit comments

Comments
 (0)