Changeset 830
- Timestamp:
- 03/21/08 07:24:41 (10 months ago)
- Files:
-
- trunk/lib/jelix/installer/jInstallerApp.class.php (modified) (1 diff)
- trunk/lib/jelix/installer/jInstallerApp.class.php (modified) (1 diff)
- trunk/lib/jelix/installer/jInstallerApp.class.php (modified) (1 diff)
- trunk/lib/jelix/installer/jInstallerBase.class.php (modified) (3 diffs)
- trunk/lib/jelix/installer/jInstallerBase.class.php (modified) (3 diffs)
- trunk/lib/jelix/installer/jInstallerBase.class.php (modified) (3 diffs)
- trunk/testapp/install/installer.php (modified) (1 diff)
- trunk/testapp/install/installer.php (modified) (1 diff)
- trunk/testapp/install/installer.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/jelix/installer/jInstallerApp.class.php
r824 r830 30 30 throw new Exception("installModules not implemented"); 31 31 } 32 32 33 33 function uninstallModules() { 34 34 throw new Exception("uninstallModules not implemented"); 35 35 } 36 36 37 37 } 38 38 trunk/lib/jelix/installer/jInstallerApp.class.php
r824 r830 30 30 throw new Exception("installModules not implemented"); 31 31 } 32 32 33 33 function uninstallModules() { 34 34 throw new Exception("uninstallModules not implemented"); 35 35 } 36 36 37 37 } 38 38 trunk/lib/jelix/installer/jInstallerApp.class.php
r824 r830 30 30 throw new Exception("installModules not implemented"); 31 31 } 32 32 33 33 function uninstallModules() { 34 34 throw new Exception("uninstallModules not implemented"); 35 35 } 36 36 37 37 } 38 38 trunk/lib/jelix/installer/jInstallerBase.class.php
r827 r830 32 32 } 33 33 34 35 34 /** 36 35 * main method for the installation … … 44 43 45 44 /** 46 * import a sql script into 45 * import a sql script into the given profile. 47 46 * @param string $name the part of the file name : $name.databasetype.sql 47 * for example, if you provide example.mysql.sql and example.pgsql.sql, give 'example' 48 48 */ 49 49 function execSQLScript($name, $profil='') { … … 67 67 68 68 /** 69 * @param string $ path relative path to the install directory70 * @param string $target 69 * @param string $sourcePath 70 * @param string $targetPath 71 71 */ 72 function copyDirectoryContent($path, $target) { 73 throw new Exception("copyDirectoryContent not implemented"); 74 /*$currentTarget = $target; 75 $dir = new DirectoryIterator($this->basePath.$path); 72 function copyDirectoryContent($sourcePath, $targetPath) { 73 jFile::createDir($targetPath); 74 $dir = new DirectoryIterator($sourcePath); 76 75 foreach ($dir as $dirContent) { 77 76 if ($dirContent->isFile()) { 78 copy($dirContent->getPathName(),$currentTarget.'/'.); 79 } else { 80 // recursive directory deletion 77 copy($dirContent->getPathName(), $targetPath.substr($dirContent->getPathName(), strlen($dirContent->getPath()))); 78 } else { 81 79 if (!$dirContent->isDot() && $dirContent->isDir()) { 82 $this->copyDirectoryContent($dirContent->getPathName()); 83 } 84 } 80 $newTarget = $targetPath.substr($dirContent->getPathName(), strlen($dirContent->getPath())); 81 $this->copyDirectoryContent($dirContent->getPathName(),$newTarget ); 82 } 83 } 85 84 } 86 85 } trunk/lib/jelix/installer/jInstallerBase.class.php
r827 r830 32 32 } 33 33 34 35 34 /** 36 35 * main method for the installation … … 44 43 45 44 /** 46 * import a sql script into 45 * import a sql script into the given profile. 47 46 * @param string $name the part of the file name : $name.databasetype.sql 47 * for example, if you provide example.mysql.sql and example.pgsql.sql, give 'example' 48 48 */ 49 49 function execSQLScript($name, $profil='') { … … 67 67 68 68 /** 69 * @param string $ path relative path to the install directory70 * @param string $target 69 * @param string $sourcePath 70 * @param string $targetPath 71 71 */ 72 function copyDirectoryContent($path, $target) { 73 throw new Exception("copyDirectoryContent not implemented"); 74 /*$currentTarget = $target; 75 $dir = new DirectoryIterator($this->basePath.$path); 72 function copyDirectoryContent($sourcePath, $targetPath) { 73 jFile::createDir($targetPath); 74 $dir = new DirectoryIterator($sourcePath); 76 75 foreach ($dir as $dirContent) { 77 76 if ($dirContent->isFile()) { 78 copy($dirContent->getPathName(),$currentTarget.'/'.); 79 } else { 80 // recursive directory deletion 77 copy($dirContent->getPathName(), $targetPath.substr($dirContent->getPathName(), strlen($dirContent->getPath()))); 78 } else { 81 79 if (!$dirContent->isDot() && $dirContent->isDir()) { 82 $this->copyDirectoryContent($dirContent->getPathName()); 83 } 84 } 80 $newTarget = $targetPath.substr($dirContent->getPathName(), strlen($dirContent->getPath())); 81 $this->copyDirectoryContent($dirContent->getPathName(),$newTarget ); 82 } 83 } 85 84 } 86 85 } trunk/lib/jelix/installer/jInstallerBase.class.php
r827 r830 32 32 } 33 33 34 35 34 /** 36 35 * main method for the installation … … 44 43 45 44 /** 46 * import a sql script into 45 * import a sql script into the given profile. 47 46 * @param string $name the part of the file name : $name.databasetype.sql 47 * for example, if you provide example.mysql.sql and example.pgsql.sql, give 'example' 48 48 */ 49 49 function execSQLScript($name, $profil='') { … … 67 67 68 68 /** 69 * @param string $ path relative path to the install directory70 * @param string $target 69 * @param string $sourcePath 70 * @param string $targetPath 71 71 */ 72 function copyDirectoryContent($path, $target) { 73 throw new Exception("copyDirectoryContent not implemented"); 74 /*$currentTarget = $target; 75 $dir = new DirectoryIterator($this->basePath.$path); 72 function copyDirectoryContent($sourcePath, $targetPath) { 73 jFile::createDir($targetPath); 74 $dir = new DirectoryIterator($sourcePath); 76 75 foreach ($dir as $dirContent) { 77 76 if ($dirContent->isFile()) { 78 copy($dirContent->getPathName(),$currentTarget.'/'.); 79 } else { 80 // recursive directory deletion 77 copy($dirContent->getPathName(), $targetPath.substr($dirContent->getPathName(), strlen($dirContent->getPath()))); 78 } else { 81 79 if (!$dirContent->isDot() && $dirContent->isDir()) { 82 $this->copyDirectoryContent($dirContent->getPathName()); 83 } 84 } 80 $newTarget = $targetPath.substr($dirContent->getPathName(), strlen($dirContent->getPath())); 81 $this->copyDirectoryContent($dirContent->getPathName(),$newTarget ); 82 } 83 } 85 84 } 86 85 } trunk/testapp/install/installer.php
r824 r830 13 13 14 14 function install(){ 15 $this->reporter->message("Test ok"); 15 //$this->copyDirectoryContent($this->basePath.'/www', JELIX_APP_WWW_PATH.'test'); 16 $this->reporter->message("Test ok"); 16 17 //$this->execSQLScript('install'); 17 18 } trunk/testapp/install/installer.php
r824 r830 13 13 14 14 function install(){ 15 $this->reporter->message("Test ok"); 15 //$this->copyDirectoryContent($this->basePath.'/www', JELIX_APP_WWW_PATH.'test'); 16 $this->reporter->message("Test ok"); 16 17 //$this->execSQLScript('install'); 17 18 } trunk/testapp/install/installer.php
r824 r830 13 13 14 14 function install(){ 15 $this->reporter->message("Test ok"); 15 //$this->copyDirectoryContent($this->basePath.'/www', JELIX_APP_WWW_PATH.'test'); 16 $this->reporter->message("Test ok"); 16 17 //$this->execSQLScript('install'); 17 18 }
