Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

1.16 #9

Merged
merged 2 commits into from

2 participants

@bauhouse
Owner

I realized after the release of 1.15 that it was not possible to save the install files if they did not already exist. Plus, the try catch blocks did not seem to be doing anything. So, I took a look at what Nils was doing with the Dump DB extension.

Now, instead of testing whether the files are writable before attempting to save the files, the extension will attempt to save the file and display an error for each file if there is an issue. If all files save successfully, the success message will be displayed.

The README file has also been updated for version 1.16 and I have added tags for versions 1.15 and 1.16.

@brendo brendo merged commit db1fdd5 into symphonycms:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 24 additions and 33 deletions.
  1. +7 −3 README.markdown
  2. +17 −30 extension.driver.php
View
10 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`
View
47 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 <code>install.sql</code> 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 <code>install.php</code> 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 <code>workspace/install.sql</code> 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){
Something went wrong with that request. Please try again.