Exemplo n.º 1
0
 /**
  * @param string $version
  * @param string $root
  */
 public function install($version, $root)
 {
     $path = $this->getPackagePath($version, 'package');
     $pluginDir = basename($root);
     if (strpos($root, '.') !== false) {
         throw new IOException("Invalid plugin root directory: {$root}");
     }
     $targetDir = elgg_get_config('pluginspath') . $pluginDir . '/';
     if (!srokap_zip::extractByRoot($path, $targetDir, $root)) {
         throw new IOException("Error while extracting files from archive: {$path}");
     }
     return true;
 }