From 8e56855ba644fc0cf81d5201349e38e99e32cbc5 Mon Sep 17 00:00:00 2001 From: Stephen Bau Date: Sat, 18 Jun 2011 09:48:50 -0700 Subject: [PATCH 1/2] Enable creation of install files if they do not already exist --- extension.driver.php | 47 ++++++++++++++++---------------------------- 1 file changed, 17 insertions(+), 30 deletions(-) diff --git a/extension.driver.php b/extension.driver.php index 1f0cc7a..f830658 100755 --- a/extension.driver.php +++ b/extension.driver.php @@ -5,8 +5,8 @@ public function about(){ return array( 'name' => 'Export Ensemble', - 'version' => '1.15', - 'release-date' => '2011-05-22', + 'version' => '1.16', + 'release-date' => '2011-06-18', 'author' => array( array( 'name' => 'Alistair Kearney', @@ -126,36 +126,23 @@ private function __saveInstallFiles(){ $install_file = $this->__createInstallFile(); ## Write the install files - if(!is_writable(DOCROOT . '/install.sql') || !is_writable(DOCROOT . '/workspace/install.sql') || !is_writable(DOCROOT . '/install.php')) { - - Administration::instance()->Page->pageAlert(__('Check permissions for the install files. At least one of the files is not writable.'), Alert::ERROR); - - } else { - - try { - file_put_contents(DOCROOT . '/install.sql', $sql_schema); - } - catch (Exception $e) { - Administration::instance()->Page->pageAlert(__('An error occurred while trying to write the install files: ' . $e->getMessage()), Alert::ERROR); - } - try { - file_put_contents(DOCROOT . '/workspace/install.sql', $sql_data); - } - catch (Exception $e) { - Administration::instance()->Page->pageAlert(__('An error occurred while trying to write the install files: ' . $e->getMessage()), Alert::ERROR); - } - try { - file_put_contents(DOCROOT . '/install.php', $install_file); - } - catch (Exception $e) { - Administration::instance()->Page->pageAlert(__('An error occurred while trying to write the install files: ' . $e->getMessage()), Alert::ERROR); - } - - Administration::instance()->Page->pageAlert(__('The install files were successfully saved.'), Alert::SUCCESS); - + if(FALSE !== @file_put_contents(DOCROOT . '/install.sql', $sql_schema)); + else { + Administration::instance()->Page->pageAlert(__('An error occurred while trying to write the install.sql file. Check the file permissions.'), Alert::ERROR); + return; + } + if(FALSE !== @file_put_contents(DOCROOT . '/install.php', $install_file)); + else { + Administration::instance()->Page->pageAlert(__('An error occurred while trying to write the install.php file. Check the file permissions.'), Alert::ERROR); + return; + } + if(FALSE !== @file_put_contents(DOCROOT . '/workspace/install.sql', $sql_data)); + else { + Administration::instance()->Page->pageAlert(__('An error occurred while trying to write the workspace/install.sql file. Check the file permissions.'), Alert::ERROR); + return; } - + Administration::instance()->Page->pageAlert(__('The install files were successfully saved.'), Alert::SUCCESS); } private function __getDatabaseTables($tbl_prefix){ From 8e75ced18c8d0f5caf1a40e8cef64b70b684e85f Mon Sep 17 00:00:00 2001 From: Stephen Bau Date: Sat, 18 Jun 2011 10:13:37 -0700 Subject: [PATCH 2/2] Update README file for version 1.16 --- README.markdown | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.markdown b/README.markdown index 86f27dc..3d50303 100644 --- a/README.markdown +++ b/README.markdown @@ -3,8 +3,8 @@ This extension exports your Symphony website. It is part of the Symphony core download package. -- Version: 1.15 -- Date: 22nd May 2011 +- Version: 1.16 +- Date: 18th June 2011 - Requirements: Symphony 2.2 or above. The `Download ZIP` feature requires the ZIP module for PHP (`--enable-zip`). - Author: Alistair Kearney, alistair@symphony-cms.com - Constributors: [A list of contributors can be found in the commit history](http://github.com/symphonycms/export_ensemble/commits/master) @@ -24,7 +24,7 @@ Information about [installing and updating extensions](http://symphony-cms.com/l ## Usage -As of version 1.15, the Export Ensemble extension is able to save all tables needed to recreate the entire site, excluding sensitive author data and cache data. There are two options for creating ensembles: `Save Install Files` or `Download ZIP`. If you don't have the ZipArchive module enabled for PHP, it would still be possible to manually create an ensemble. +The Export Ensemble extension is able to save all tables needed to recreate the entire site, excluding sensitive author data and cache data. There are two options for creating ensembles: `Save Install Files` or `Download ZIP`. If you don't have the ZipArchive module enabled for PHP, it would still be possible to manually create an ensemble. ### Save Install Files @@ -105,6 +105,10 @@ To manually create an ensemble: ## Change Log +**Version 1.16** + +- Enable creation of install files if they do not already exist + **Version 1.15** - Dump all tables with `tbl_prefix`