Fix delete course folder.

1.10.x
Julio 9 years ago
parent d8b0b70217
commit 8f3a7a5fdf
  1. 31
      main/install/update-files-1.9.0-1.10.0.inc.php

@ -164,21 +164,7 @@ if (defined('SYSTEM_INSTALLATION')) {
unlink(api_get_path(SYS_PATH).'courses/.htaccess'); unlink(api_get_path(SYS_PATH).'courses/.htaccess');
} }
// Delete all "courses/ABC/index.php" files.
$finder = new Finder();
$dirs = $finder->directories()->in(api_get_path(SYS_APP_PATH).'courses');
$fs = new Filesystem();
/** @var Symfony\Component\Finder\SplFileInfo $dir */
foreach ($dirs as $dir) {
$indexFile = $dir->getPath().'/index.php';
if ($fs->exists($indexFile)) {
$fs->remove($indexFile);
}
}
// Move dirs into new structures. // Move dirs into new structures.
$movePathList = [ $movePathList = [
api_get_path(SYS_CODE_PATH).'upload/users/groups' => api_get_path(SYS_UPLOAD_PATH), api_get_path(SYS_CODE_PATH).'upload/users/groups' => api_get_path(SYS_UPLOAD_PATH),
api_get_path(SYS_CODE_PATH).'upload/users' => api_get_path(SYS_UPLOAD_PATH), api_get_path(SYS_CODE_PATH).'upload/users' => api_get_path(SYS_UPLOAD_PATH),
@ -194,6 +180,23 @@ if (defined('SYSTEM_INSTALLATION')) {
} }
} }
// Delete all "courses/ABC/index.php" files.
$courseDir = api_get_path(SYS_APP_PATH).'courses';
$finder = new Finder();
if (is_dir($courseDir)) {
$dirs = $finder->directories()->in(api_get_path(SYS_APP_PATH).'courses');
$fs = new Filesystem();
/** @var Symfony\Component\Finder\SplFileInfo $dir */
foreach ($dirs as $dir) {
$indexFile = $dir->getPath().'/index.php';
if ($fs->exists($indexFile)) {
$fs->remove($indexFile);
}
}
}
// Remove archive // Remove archive
@rrmdir(api_get_path(SYS_PATH).'archive'); @rrmdir(api_get_path(SYS_PATH).'archive');

Loading…
Cancel
Save