Back to ExtensionInstallCommand class

Method processPathInstallation

public bool
processPathInstallation
(mixed $path)
Used for installing extension from a path
Parameters
  • string $path Path to the extension zip file
Returns
  • bool
Since
  • 4.0.0
-
  • \Exception

Method processPathInstallation - Source code

/**
 * Used for installing extension from a path
 *
 * @param   string  $path  Path to the extension zip file
 *
 * @return boolean
 *
 * @since 4.0.0
 *
 * @throws \Exception
 */
public function processPathInstallation($path) : bool
{
    if (!file_exists($path)) {
        $this->ioStyle->warning('The file path specified does not exist.');
        return false;
    }
    $tmpPath = $this->getApplication()->get('tmp_path');
    $tmpPath = $tmpPath . '/' . basename($path);
    $package = InstallerHelper::unpack($path, true);
    if ($package['type'] === false) {
        return false;
    }
    $jInstaller = Installer::getInstance();
    $result = $jInstaller->install($package['extractdir']);
    InstallerHelper::cleanupInstall($tmpPath, $package['extractdir']);
    return $result;
}