Changeset 830

Show
Ignore:
Timestamp:
03/21/08 07:24:41 (10 months ago)
Author:
laurentj
Message:

worked on ticket #31: the base class of the installer is now finished

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/jelix/installer/jInstallerApp.class.php

    r824 r830  
    3030        throw new Exception("installModules not implemented"); 
    3131    } 
    32      
     32 
    3333    function uninstallModules() { 
    3434        throw new Exception("uninstallModules not implemented"); 
    3535    } 
    36      
     36 
    3737} 
    3838 
  • trunk/lib/jelix/installer/jInstallerApp.class.php

    r824 r830  
    3030        throw new Exception("installModules not implemented"); 
    3131    } 
    32      
     32 
    3333    function uninstallModules() { 
    3434        throw new Exception("uninstallModules not implemented"); 
    3535    } 
    36      
     36 
    3737} 
    3838 
  • trunk/lib/jelix/installer/jInstallerApp.class.php

    r824 r830  
    3030        throw new Exception("installModules not implemented"); 
    3131    } 
    32      
     32 
    3333    function uninstallModules() { 
    3434        throw new Exception("uninstallModules not implemented"); 
    3535    } 
    36      
     36 
    3737} 
    3838 
  • trunk/lib/jelix/installer/jInstallerBase.class.php

    r827 r830  
    3232    } 
    3333 
    34  
    3534    /** 
    3635     * main method for the installation 
     
    4443 
    4544    /** 
    46      * import a sql script into  
     45     * import a sql script into the given profile. 
    4746     * @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' 
    4848     */ 
    4949    function execSQLScript($name, $profil='') { 
     
    6767 
    6868    /** 
    69      * @param string $path relative path to the install directory 
    70      * @param string $target  
     69     * @param string $sourcePath 
     70     * @param string $targetPath 
    7171     */ 
    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); 
    7675        foreach ($dir as $dirContent) { 
    7776            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 { 
    8179                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            } 
    8584        } 
    8685    } 
  • trunk/lib/jelix/installer/jInstallerBase.class.php

    r827 r830  
    3232    } 
    3333 
    34  
    3534    /** 
    3635     * main method for the installation 
     
    4443 
    4544    /** 
    46      * import a sql script into  
     45     * import a sql script into the given profile. 
    4746     * @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' 
    4848     */ 
    4949    function execSQLScript($name, $profil='') { 
     
    6767 
    6868    /** 
    69      * @param string $path relative path to the install directory 
    70      * @param string $target  
     69     * @param string $sourcePath 
     70     * @param string $targetPath 
    7171     */ 
    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); 
    7675        foreach ($dir as $dirContent) { 
    7776            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 { 
    8179                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            } 
    8584        } 
    8685    } 
  • trunk/lib/jelix/installer/jInstallerBase.class.php

    r827 r830  
    3232    } 
    3333 
    34  
    3534    /** 
    3635     * main method for the installation 
     
    4443 
    4544    /** 
    46      * import a sql script into  
     45     * import a sql script into the given profile. 
    4746     * @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' 
    4848     */ 
    4949    function execSQLScript($name, $profil='') { 
     
    6767 
    6868    /** 
    69      * @param string $path relative path to the install directory 
    70      * @param string $target  
     69     * @param string $sourcePath 
     70     * @param string $targetPath 
    7171     */ 
    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); 
    7675        foreach ($dir as $dirContent) { 
    7776            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 { 
    8179                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            } 
    8584        } 
    8685    } 
  • trunk/testapp/install/installer.php

    r824 r830  
    1313 
    1414    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"); 
    1617        //$this->execSQLScript('install'); 
    1718    } 
  • trunk/testapp/install/installer.php

    r824 r830  
    1313 
    1414    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"); 
    1617        //$this->execSQLScript('install'); 
    1718    } 
  • trunk/testapp/install/installer.php

    r824 r830  
    1313 
    1414    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"); 
    1617        //$this->execSQLScript('install'); 
    1718    } 
Download in other formats: Unified Diff Zip Archive