public function describeExtension(Extension $ext) { $info = array('Name' => $ext->getExtensionName(), 'Source Directory' => $ext->getSourceDirectory(), 'Config' => $ext->getConfigM4Path(), 'INI File' => $ext->getConfigFilePath(), 'Extension' => $ext instanceof PeclExtension ? 'Pecl' : 'Core', 'Zend' => $ext->isZend() ? 'yes' : 'no', 'Loaded' => extension_loaded($ext->getExtensionName()) ? $this->formatter->format('yes', 'green') : $this->formatter->format('no', 'red')); foreach ($info as $label => $val) { $this->logger->writeln(sprintf('%20s: %s', $label, $val)); } $options = $ext->getConfigureOptions(); if (!empty($options)) { $this->logger->newline(); $this->logger->writeln(sprintf('%20s: ', 'Configure Options')); $this->logger->newline(); foreach ($options as $option) { $this->logger->writeln(sprintf(' %-32s %s', $option->option . ($option->valueHint ? '[=' . $option->valueHint . ']' : ''), $option->desc)); $this->logger->newline(); } } }
public function createExtensionConfig(Extension $ext) { $sourceDir = $ext->getSourceDirectory(); $ini = $ext->getConfigFilePath() . '.disabled'; $this->logger->info("===> Creating config file {$ini}"); if (!file_exists(dirname($ini))) { mkdir(dirname($ini), 0755, true); } // create extension config file if (file_exists($ini)) { return; } if ($ext->isZend()) { $makefile = file_get_contents("{$sourceDir}/Makefile"); preg_match('/EXTENSION\\_DIR\\s=\\s(.*)/', $makefile, $regs); $content = "zend_extension=" . $ext->getSharedLibraryPath(); } else { $content = "extension=" . $ext->getSharedLibraryName(); } file_put_contents($ini, $content); $this->logger->debug("{$ini} is created."); }