Added ignores to install options for Installer::sophisticatedInstall() #1447

This commit is contained in:
Andy Miller
2017-04-24 15:00:31 -06:00
parent 34281a14a4
commit e5a522a2fe
2 changed files with 7 additions and 4 deletions

View File

@@ -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)

View File

@@ -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 {