Skip to content

Commit

Permalink
Remove all index.php files inside the old courses directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmontoyaa committed May 4, 2015
1 parent ef9eb0d commit 41952c2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions main/install/update-files-1.9.0-1.10.0.inc.php
@@ -1,6 +1,9 @@
<?php
/* For licensing terms, see /license.txt */

use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Finder\Finder;

/**
* Chamilo LMS
*
Expand Down Expand Up @@ -161,6 +164,19 @@
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.

$movePathList = [
Expand Down

0 comments on commit 41952c2

Please sign in to comment.