Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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

Expand Down Expand Up @@ -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`
Expand Down
47 changes: 17 additions & 30 deletions extension.driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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){
Expand Down