Post by matteoraggi » Sun Nov 18, 2012 10:01 pm

People managing multiple sites and multiple stores with opencart could have problems managing many backup files all with the same name. Why not create the backup file directly with the domain name or store name?

http://www.restaurantsupplies.eu Restaurant Supplies
Opencart 1.5.6.4 VQMOD 2.4.1
Languages: Italian, French, German, Hungarian, English, Russian, Polish and Spanish


Active Member

Posts

Joined
Fri Apr 10, 2009 8:16 pm

Post by straightlight » Mon Nov 19, 2012 6:25 am

Good point.

In admin/controller/tool/backup.php file,

find:

Code: Select all

$this->response->addheader('Pragma: public');
add above:

Code: Select all

$store_name = preg_replace('/[[:space:]]/is', '_', strtolower(trim($this->config->get('config_name'))));
Then, replace:

Code: Select all

$this->response->addheader('Content-Disposition: attachment; filename=' . date('Y-m-d_H-i-s', time()).'_backup.sql');
with:

Code: Select all

$this->response->addheader('Content-Disposition: attachment; filename=' . date('Y-m-d_H-i-s', time()).'_' . html_entity_decode($store_name, ENT_QUOTES, 'UTF-8') . '_backup.sql');

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 1 guest