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`
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){