HEX
Server: LiteSpeed
System: Linux atali.colombiahosting.com.co 5.14.0-570.12.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 13 06:11:55 EDT 2025 x86_64
User: coopserp (1713)
PHP: 8.2.29
Disabled: dl,exec,passthru,proc_open,proc_close,shell_exec,memory_limit,system,popen,curl_multi_exec,show_source,symlink,link,leak,listen,diskfreespace,tmpfile,ignore_user_abord,highlight_file,source,show_source,fpaththru,virtual,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,posix_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setid,posix_times,posix_ttyname,posix_uname,proc_get_status,proc_nice,proc_terminate
Upload Files
File: //opt/cpanel/ea-wappspector/vendor/clue/phar-composer/src/Command/Install.php
<?php

namespace Clue\PharComposer\Command;

use Clue\PharComposer\Phar\Packager;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\ConfirmationQuestion;

class Install extends Command
{
    /** @var Packager */
    private $packager;

    /** @var bool */
    private $isWindows;

    public function __construct(Packager $packager = null, $isWindows = null)
    {
        if ($packager === null) {
            $packager = new Packager();
        }
        if ($isWindows === null) {
            $isWindows = DIRECTORY_SEPARATOR === '\\';
        }
        $this->packager = $packager;
        $this->isWindows = $isWindows;

        parent::__construct();
    }

    protected function configure()
    {
        $this->setName('install')
             ->setDescription('Install phar into system wide binary directory' . ($this->isWindows ? ' (not available on Windows)' : ''))
             ->addArgument('project', InputArgument::OPTIONAL, 'Project name or path', '.')
             ->addArgument('target', InputArgument::OPTIONAL, 'Path to install to', '/usr/local/bin');
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        if ($this->isWindows) {
            $output->writeln('<error>Command not available on this platform. Please use the "build" command and place Phar in your $PATH manually.</error>');
            return 1;
        }

        $this->packager->setOutput($output);
        $this->packager->coerceWritable();

        $pharer = $this->packager->getPharer($input->getArgument('project'));

        $path = $this->packager->getSystemBin($pharer->getPackageRoot(), $input->getArgument('target'));

        if (is_file($path)) {
            $helper = $this->getHelper('question');
            assert($helper instanceof QuestionHelper);

            $question = new ConfirmationQuestion('Overwrite existing file <info>' . $path . '</info>? [y] > ', true);
            if (!$helper->ask($input, $output, $question)) {
                $output->writeln('Aborting');
                return 0;
            }
        }

        $this->packager->install($pharer, $path);

        return 0;
    }
}