public function detectMagento(InputInterface $input = null, OutputInterface $output = null)
{
// do not detect magento twice
if ($this->_magentoDetected) {
return;
}
if (null === $input) {
$input = new ArgvInput();
}
if (null === $output) {
$output = new ConsoleOutput();
}
if ($this->getMagentoRootFolder() === null) {
$this->_checkRootDirOption($input);
$folder = OperatingSystem::getCwd();
} else {
$folder = $this->getMagentoRootFolder();
}
$this->getHelperSet()->set(new MagentoHelper($input, $output), 'magento');
$magentoHelper = $this->getHelperSet()->get('magento');
/* @var $magentoHelper MagentoHelper */
if (!$this->_directRootDir) {
$subFolders = $this->config->getDetectSubFolders();
} else {
$subFolders = array();
}
$this->_magentoDetected = $magentoHelper->detect($folder, $subFolders);
$this->_magentoRootFolder = $magentoHelper->getRootFolder();
$this->_magentoEnterprise = $magentoHelper->isEnterpriseEdition();
$this->_magentoMajorVersion = $magentoHelper->getMajorVersion();
$this->_magerunStopFileFound = $magentoHelper->isMagerunStopFileFound();
$this->_magerunStopFileFolder = $magentoHelper->getMagerunStopFileFolder();
}