osCommerce / oscommerce2

osCommerce Online Merchant v2.x
http://www.oscommerce.com
MIT License
281 stars 222 forks source link

Remove install directory after install #595

Open drillsar opened 7 years ago

drillsar commented 7 years ago

Something like this:

Removes install directory after installation

    delete_files($dir_fs_document_root . 'install');
       function delete_files($target) {
     if(is_dir($target)){
        $files = glob( $target . '*', GLOB_MARK ); //GLOB_MARK adds a slash to directories returned
        foreach( $files as $file )
        {
            delete_files( $file );      
        }
        rmdir( $target );
    } elseif(is_file($target)) {
        unlink( $target );  
    }
}

?>
Gergely commented 6 years ago

Hi @drillsar ,

as a developer it would be better to use a select action for this. After install when log into admin this option should be noticed on dashboard and take a link with it. I'd prefer a preinstalled dashboard module. The security check modules could handle this when configuration files checked.

Installation directory exists at: C:/wamp/www/projects/oscom24_g/catalog/install. Please remove this directory for security reasons.

We could insert an action link into this notice.