Added isSymlink logic to determine if Grav is symbolically linked or not.

This commit is contained in:
Djamil Legato
2015-08-07 13:31:15 -07:00
parent 8f753696ea
commit d98644277c
4 changed files with 26 additions and 8 deletions

View File

@@ -168,6 +168,16 @@ class Gpm
public static function selfupgrade() {
$upgrader = new Upgrader();
if (!Installer::isGravInstance(GRAV_ROOT)) {
return false;
}
if (is_link(GRAV_ROOT . DS . 'index.php')) {
Installer::setError(Installer::IS_LINK);
return false;
}
$update = $upgrader->getAssets()['grav-update'];
$tmp = CACHE_DIR . 'tmp/Grav-' . uniqid();
$file = self::_downloadSelfupgrade($update, $tmp);