vmInstall(); } public function install () { //$this->vmInstall(); } public function discover_install () { $this->tcpdfInstall (); } public function postflight () { $this->tcpdfInstall (); } public function tcpdfInstall () { jimport ('joomla.filesystem.file'); jimport ('joomla.installer.installer'); $this->path = JInstaller::getInstance ()->getPath ('extension_administrator'); // libraries auto move $src = $this->path . DS . "libraries"; $dst = JPATH_ROOT . DS . "libraries"; $this->recurse_copy ($src, $dst); echo ' Cart '; echo '

TcPdf moved to the joomla libraries folder

'; echo "

Installation Successful.

"; return TRUE; } /** * copy all $src to $dst folder and remove it * * @author Max Milbers * @param String $src path * @param String $dst path * @param String $type modulesBE, modules, plugins, languageBE, languageFE */ private function recurse_copy ($src, $dst) { static $failed = false; $dir = opendir ($src); if (is_resource ($dir)) { while (FALSE !== ($file = readdir ($dir))) { if (($file != '.') && ($file != '..')) { if (is_dir ($src . DS . $file)) { if(!JFolder::create($dst . DS . $file)){ $app = JFactory::getApplication (); $app->enqueueMessage ('Couldnt create folder ' . $dst . DS . $file); } $this->recurse_copy ($src . DS . $file, $dst . DS . $file); } else { if (JFile::exists ($dst . DS . $file)) { if (!JFile::delete ($dst . DS . $file)) { $app = JFactory::getApplication (); $app->enqueueMessage ('Couldnt delete ' . $dst . DS . $file); //return false; } } if (!JFile::move ($src . DS . $file, $dst . DS . $file)) { $app = JFactory::getApplication (); $app->enqueueMessage ('Couldnt move ' . $src . DS . $file . ' to ' . $dst . DS . $file); $failed = true; //return false; } } } } closedir ($dir); if (is_dir ($src) and !$failed) { JFolder::delete ($src); } } else { $app = JFactory::getApplication (); $app->enqueueMessage ('Couldnt read dir ' . $dir . ' source ' . $src); return false; } return true; } public function uninstall () { return TRUE; } /** * creates a folder with empty html file * * @author Max Milbers * */ public function createIndexFolder ($path) { if (JFolder::create ($path)) { /*if (!JFile::exists ($path . DS . 'index.html')) { JFile::copy (JPATH_ROOT . DS . 'components' . DS . 'index.html', $path . DS . 'index.html'); }*/ return TRUE; } return FALSE; } } if (!defined ('_VM_SCRIPT_INCLUDED')) { // PLZ look in #vminstall.php# to add your plugin and module function com_install () { if (!version_compare (JVERSION, '1.6.0', 'ge')) { $vmInstall = new com_virtuemart_allinoneInstallerScript(); $vmInstall->tcpdfInstall (); } return TRUE; } function com_uninstall () { return TRUE; } } } //if defined // pure php no tag