mirror of
https://github.com/getgrav/grav.git
synced 2026-07-19 14:40:24 +02:00
Added ignores to install options for Installer::sophisticatedInstall() #1447
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
# v1.2.4
|
||||
## 04/xx/2017
|
||||
|
||||
1. [](#improved)
|
||||
* Added optional ignores for `Installer::sophisticatedInstall()` [#1447](https://github.com/getgrav/grav/issues/1447)
|
||||
1. [](#bugfix)
|
||||
* Allow multiple calls to `Themes::initTheme()` without throwing errors
|
||||
* Fixed querystrings in root pages with multi-lang enabled [#1436](https://github.com/getgrav/grav/issues/1436)
|
||||
|
||||
@@ -58,6 +58,7 @@ class Installer
|
||||
'sophisticated' => false,
|
||||
'theme' => false,
|
||||
'install_path' => '',
|
||||
'ignores' => [],
|
||||
'exclude_checks' => [self::EXISTS, self::NOT_FOUND, self::IS_LINK]
|
||||
];
|
||||
|
||||
@@ -134,7 +135,7 @@ class Installer
|
||||
self::moveInstall($extracted, $install_path);
|
||||
}
|
||||
} else {
|
||||
self::sophisticatedInstall($extracted, $install_path);
|
||||
self::sophisticatedInstall($extracted, $install_path, $options['ignores']);
|
||||
}
|
||||
|
||||
Folder::delete($tmp);
|
||||
@@ -280,11 +281,11 @@ class Installer
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function sophisticatedInstall($source_path, $install_path)
|
||||
public static function sophisticatedInstall($source_path, $install_path, $ignores = [])
|
||||
{
|
||||
foreach (new \DirectoryIterator($source_path) as $file) {
|
||||
|
||||
if ($file->isLink() || $file->isDot()) {
|
||||
if ($file->isLink() || $file->isDot() || in_array($file->getBasename(),$ignores)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -296,7 +297,7 @@ class Installer
|
||||
|
||||
if ($file->getBasename() == 'bin') {
|
||||
foreach (glob($path . DS . '*') as $bin_file) {
|
||||
@chmod($bin_file, 0755);
|
||||
@chmod($bin_file, 0755);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user