The new 2.0 setup is under way... (added backup + file copy + sample data + admin language)

SVN:trunk[2187]
This commit is contained in:
Romain Quetiez
2012-09-18 09:59:36 +00:00
parent 308f40c11b
commit bb404f8a95
7 changed files with 309 additions and 75 deletions

View File

@@ -14,6 +14,9 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
require_once(APPROOT.'setup/setuputils.class.inc.php');
class DOMFormatException extends Exception
{
}
@@ -97,7 +100,7 @@ class MFCompiler
$sRelativeDir = substr($sModuleRootDir, strlen($this->sSourceDir) + 1);
// Push the other module files
$this->CopyDirectory($sModuleRootDir, $sTargetDir.'/'.$sRelativeDir);
SetupUtils::copydir($sModuleRootDir, $sTargetDir.'/'.$sRelativeDir);
$sCompiledCode = '';
@@ -257,51 +260,6 @@ EOF;
}
}
/**
* Helper to copy the module files to the exploitation environment
* Returns true if successfull
*/
protected function CopyDirectory($sSource, $sDest)
{
if (is_dir($sSource))
{
if (!is_dir($sDest))
{
mkdir($sDest);
}
$aFiles = scandir($sSource);
if(sizeof($aFiles) > 0 )
{
foreach($aFiles as $sFile)
{
if ($sFile == '.' || $sFile == '..' || $sFile == '.svn')
{
// Skip
continue;
}
if (is_dir($sSource.'/'.$sFile))
{
$this->CopyDirectory($sSource.'/'.$sFile, $sDest.'/'.$sFile);
}
else
{
copy($sSource.'/'.$sFile, $sDest.'/'.$sFile);
}
}
}
return true;
}
elseif (is_file($sSource))
{
return copy($sSource, $sDest);
}
else
{
return false;
}
}
/**
* Helper to format the flags for an attribute, in a given state
* @param object $oAttNode DOM node containing the information to build the flags