]>
git.immae.eu Git - github/shaarli/Shaarli.git/blob - application/updater/UpdaterUtils.php
4 * Read the updates file, and return already done updates.
6 * @param string $updatesFilepath Updates file path.
8 * @return array Already done update methods.
10 function read_updates_file($updatesFilepath)
12 if (! empty($updatesFilepath) && is_file($updatesFilepath)) {
13 $content = file_get_contents($updatesFilepath);
14 if (! empty($content)) {
15 return explode(';', $content);
24 * @param string $updatesFilepath Updates file path.
25 * @param array $updates Updates array to write.
27 * @throws Exception Couldn't write version number.
29 function write_updates_file($updatesFilepath, $updates)
31 if (empty($updatesFilepath)) {
32 throw new Exception(t('Updates file path is not set, can\'t write updates.'));
35 $res = file_put_contents($updatesFilepath, implode(';', $updates));
37 throw new Exception(t('Unable to write updates in '. $updatesFilepath . '.'));