Welcome Guest, Not a member yet? Register   Sign In
Missing .htaccess in zip file
#5

[eluser]spec[/eluser]
Here's the code:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
&lt;html &gt;

&lt;head&gt;
    &lt;meta http-equiv="Refresh" content="2; URL=http://localhost/proj" /&gt;
    &lt;meta name="author" content="" /&gt;

    &lt;title&gt;Backup&lt;/title&gt;
&lt;/head&gt;

&lt;body&gt;

&lt;?php class Backup extends Controller {

    function __construct() {
        parent::Controller();
    }

    function index() {
        
        //DB backup:
        $this->load->dbutil();

        $backup = &$this->dbutil->backup();

        $this->load->helper('file');
        $date = strftime("%d-%b-%y at %Hh%M ");
        $db_backup_file = $date . 'db.gz';

        write_file('d:/htdocs/backup/proj/' . $db_backup_file, $backup);
        //<-DB backup
        
        //proj backup:
        $this->load->lib('zip');
        $path = 'd:/htdocs/proj/';

        $this->zip->read_dir($path);
        $date = strftime("%d-%b-%y at %Hh%M ");
        $proj_backup_file = $date . 'proj.zip';
        $this->zip->archive('d:/htdocs/backup/proj/' . $proj_backup_file); // Creates a file named myarchive.zip
        $data = 'Done. Redirecting in 2 sec<br>
        <strong>' . $db_backup_file . '</strong> - '.round((filesize('d:/htdocs/backup/proj/' . $db_backup_file)/1024),1).' KB <br>
        <strong>' . $proj_backup_file . '</strong> - '.round((filesize('d:/htdocs/backup/proj/'.$proj_backup_file)/1024),1).' KB <br>';
        
        $this->out->set_out($data);//display status info
        //<-proj backup
    }

} ?&gt;

&lt;/body&gt;
&lt;/html&gt;


Messages In This Thread
Missing .htaccess in zip file - by El Forum - 03-08-2011, 01:55 PM
Missing .htaccess in zip file - by El Forum - 03-08-2011, 09:38 PM
Missing .htaccess in zip file - by El Forum - 03-08-2011, 09:43 PM
Missing .htaccess in zip file - by El Forum - 03-08-2011, 10:17 PM
Missing .htaccess in zip file - by El Forum - 03-08-2011, 10:26 PM
Missing .htaccess in zip file - by El Forum - 03-08-2011, 11:32 PM
Missing .htaccess in zip file - by El Forum - 03-08-2011, 11:35 PM
Missing .htaccess in zip file - by El Forum - 03-08-2011, 11:48 PM
Missing .htaccess in zip file - by El Forum - 03-08-2011, 11:55 PM
Missing .htaccess in zip file - by El Forum - 03-09-2011, 11:15 AM
Missing .htaccess in zip file - by El Forum - 03-09-2011, 11:54 AM
Missing .htaccess in zip file - by El Forum - 03-09-2011, 11:57 AM



Theme © iAndrew 2016 - Forum software by © MyBB