1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/freshrss_ynh.git synced 2024-09-03 18:36:33 +02:00
freshrss_ynh/scripts/update-ynh.php

25 lines
626 B
PHP
Raw Normal View History

2015-02-08 18:55:48 +01:00
<?php
2015-02-09 12:47:46 +01:00
echo "including libs \n";
2015-02-08 18:55:48 +01:00
require('constants.php');
require(LIB_PATH . '/lib_rss.php');
2015-02-09 12:24:23 +01:00
if (FRESHRSS_VERSION === '0.8.1'){
require('app/Models/Configuration.php');
require('app/Models/Entry.php');
}
2015-02-09 12:47:46 +01:00
echo "downloading update script \n";
2015-02-08 18:55:48 +01:00
$ch = curl_init(FRESHRSS_UPDATE_WEBSITE);
$fp = fopen("update.php", "w");
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
fclose($fp);
2015-02-09 12:47:46 +01:00
echo "checking if update needed \n";
2015-02-09 12:42:06 +01:00
if (!strstr(file_get_contents('update.php'), 'NO_UPDATE')){
2015-02-09 12:47:46 +01:00
echo "launching update \n";
2015-02-09 12:42:06 +01:00
require('update.php');
apply_update();
}
2015-02-08 18:55:48 +01:00
?>