mirror of
https://github.com/ZeJMaN/LBCAlerte_ynh.git
synced 2025-07-06 11:50:48 +02:00
Initial commit
Functional, without SSO
This commit is contained in:
30
sources/others/update/3.2.php
Normal file
30
sources/others/update/3.2.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
require_once __DIR__."/update.php";
|
||||
|
||||
class Update_32 extends Update
|
||||
{
|
||||
public function update()
|
||||
{
|
||||
if ("db" == $this->_storage) {
|
||||
$this->_dbConnection->query("ALTER TABLE `LBC_Alert` CHANGE `last_id` `last_id` TEXT NULL DEFAULT NULL");
|
||||
$this->_dbConnection->query('UPDATE `LBC_Alert` SET `url` = REPLACE(`url`, "http://www.leboncoin.fr/", "https://www.leboncoin.fr/")');
|
||||
|
||||
} elseif ("files" == $this->_storage) {
|
||||
$dir = DOCUMENT_ROOT.DS."var".DS."configs";
|
||||
if (is_dir($dir)) {
|
||||
$files = glob($dir.DS."*.csv");
|
||||
foreach ($files AS $file) {
|
||||
file_put_contents(
|
||||
$file,
|
||||
str_replace(
|
||||
"http://www.leboncoin.fr",
|
||||
"https://www.leboncoin.fr",
|
||||
file_get_contents($file)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user