fix creating of configuration file

createExtensionConf() will in any case create a file, even if there
are no extensions available. It will not automatically include that
file anymore.
This commit is contained in:
Uwe Steinmann 2014-11-13 13:56:13 +01:00
parent 48ae373d87
commit 803d819c03

View File

@ -57,19 +57,25 @@ class SeedDMS_Extension_Mgr {
return $this->cachedir."/extensions.php"; return $this->cachedir."/extensions.php";
} /* }}} */ } /* }}} */
/**
* Create the cached file containing extension information
*
* This function will always create a file, even if no extensions
* are installed.
*/
function createExtensionConf() { /* {{{ */ function createExtensionConf() { /* {{{ */
$extensions = self::getExtensions(); $extensions = self::getExtensions();
$fp = fopen($this->cachedir."/extensions.php", "w");
if($extensions) { if($extensions) {
$fp = fopen($this->cachedir."/extensions.php", "w");
foreach($extensions as $_ext) { foreach($extensions as $_ext) {
if(file_exists($this->extdir . "/" . $_ext . "/conf.php")) { if(file_exists($this->extdir . "/" . $_ext . "/conf.php")) {
$content = file_get_contents($this->extdir . "/" . $_ext . "/conf.php"); $content = file_get_contents($this->extdir . "/" . $_ext . "/conf.php");
fwrite($fp, $content); fwrite($fp, $content);
} }
} }
fclose($fp);
include($this->cachedir."/extensions.php");
} }
fclose($fp);
//include($this->cachedir."/extensions.php");
} /* }}} */ } /* }}} */
function getExtensions() { /* {{{ */ function getExtensions() { /* {{{ */