- $path = $temp->getPathname();
- $stat = stat($file);
-
- try {
- $this->info("Running INI owner transfer ... ");
- $ugid = sprintf("%d:%d", $stat["uid"], $stat["gid"]);
- $cmd = new ExecCmd("chown", $this->args->verbose);
- if (isset($this->args->sudo)) {
- $cmd->setSu($this->args->sudo);
- }
- $cmd->run([$ugid, $path]);
- $this->info("OK\n");
-
- $this->info("Running INI permission transfer ... ");
- $perm = decoct($stat["mode"] & 0777);
- $cmd = new ExecCmd("chmod", $this->args->verbose);
- if (isset($this->args->sudo)) {
- $cmd->setSu($this->args->sudo);
- }
- $cmd->run([$perm, $path]);
- $this->info("OK\n");
-
- $this->info("Running INI activation ... ");
- $cmd = new ExecCmd("mv", $this->args->verbose);
- if (isset($this->args->sudo)) {
- $cmd->setSu($this->args->sudo);
- }
- $cmd->run([$path, $file]);
- $this->info("OK\n");
- } catch (\Exception $e) {
- $this->error("%s\n", $e->getMessage());
- $this->error("%s\n", $cmd->getOutput());
- exit(5);
+ try {
+ $this->info("Running INI activation ...\n");
+ $activate = new Task\Activate($temp, $files, $sudo);
+ if (!$activate->run($this->args->verbose)) {
+ $this->info("Extension already activated ...\n");