Permalink
Browse files

An alert is thrown, during installation, if the ZipArchive class is n…

…ot available
  • Loading branch information...
1 parent c7d4bdf commit 8d46d41b483ea7011076c9b195a3a1a16f4ffc06 @pointybeard committed Dec 7, 2008
Showing with 13 additions and 1 deletion.
  1. +13 −1 extension.driver.php
View
@@ -29,6 +29,11 @@ public function getSubscribedDelegates(){
);
}
+ public function install(){
+ $this->_Parent->Page->pageAlert('Export Ensemble cannot be installed, since the "<a href="http://php.net/manual/en/book.zip.php">ZipArchive</a>" class is not available. Ensure that PHP was compiled with the <code>--enable-zip</code> flag.', AdministrationPage::PAGE_ALERT_ERROR);
+ return false;
+ }
+
private function __addFolderToArchive(&$archive, $path, $parent=NULL){
$iterator = new DirectoryIterator($path);
foreach($iterator as $file){
@@ -176,7 +181,14 @@ public function appendPreferences($context){
$div = new XMLElement('div', NULL, array('id' => 'file-actions', 'class' => 'label'));
$span = new XMLElement('span');
- $span->appendChild(new XMLElement('button', 'Create', array('name' => 'action[export]', 'type' => 'submit')));
+
+ if(!class_exists('ZipArchive')){
+ $span->appendChild(new XMLElement('p', '<strong>Warning: It appears you do not have the "ZipArchive" class available. Ensure that PHP was compiled with <code>--enable-zip</code>'));
+ }
+ else{
+ $span->appendChild(new XMLElement('button', 'Create', array('name' => 'action[export]', 'type' => 'submit')));
+ }
+
$div->appendChild($span);
$div->appendChild(new XMLElement('p', 'Packages entire site as a <code>.zip</code> archive for download.', array('class' => 'help')));

0 comments on commit 8d46d41

Please sign in to comment.