N98\Magento\Command\MagentoConnect\AbstractConnectCommand::findMageScript PHP Method

findMageScript() private method

private findMageScript ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
    private function findMageScript(InputInterface $input, OutputInterface $output)
    {
        if ($this->mageScript === null) {
            $this->detectMagento($output);
            @chdir($this->_magentoRootFolder);
            $this->mageScript = './mage';
            if (!is_file($this->mageScript)) {
                throw new RuntimeException('Could not find "mage" shell script in current installation');
            }
            if (!is_executable($this->mageScript)) {
                if (!@chmod($this->mageScript, 0755)) {
                    throw new RuntimeException('Cannot make "mage" shell script executable. Please chmod the file manually.');
                }
            }
            if (!strstr(shell_exec($this->mageScript . ' list-channels'), 'community')) {
                // no channels available -> try to setup
                shell_exec($this->mageScript . ' mage-setup');
            }
        }
    }