getExtensionName() public méthode

public getExtensionName ( )
Exemple #1
0
 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 describeExtension(Extension $ext)
 {
     $this->logger->write(sprintf(' [%s] %-12s %-12s', extension_loaded($ext->getExtensionName()) ? '*' : ' ', $ext->getExtensionName(), phpversion($ext->getExtensionName())));
     if ($this->options->{'show-path'}) {
         $this->logger->write(sprintf(' from %s', $ext->getConfigM4Path()));
     }
     $this->logger->newline();
     // $this->logger->writeln(sprintf('config: %s', $ext->getConfigFilePath()));
     if ($this->options->{'show-options'}) {
         $padding = '     ';
         if ($ext instanceof M4Extension) {
             $options = $ext->getConfigureOptions();
             if (!empty($options)) {
                 $this->logger->info($padding . 'Configure options:');
                 foreach ($options as $option) {
                     $this->logger->info($padding . '  ' . sprintf('%-32s %s', $option->option . ($option->valueHint ? '[=' . $option->valueHint . ']' : ''), $option->desc));
                 }
             }
         }
     }
 }
 public function renameSourceDirectory(Extension $ext)
 {
     $currentPhpExtensionDirectory = Config::getBuildDir() . '/' . Config::getCurrentPhpName() . '/ext';
     $extName = $ext->getExtensionName();
     $name = $ext->getName();
     $extensionDir = $currentPhpExtensionDirectory . DIRECTORY_SEPARATOR . $extName;
     $extensionExtractDir = $currentPhpExtensionDirectory . DIRECTORY_SEPARATOR . $name;
     if ($name != $extName) {
         $this->logger->info("===> Rename source directory to {$extensionDir}...");
         $cmds = array("rm -rf {$extensionDir}", "mv {$extensionExtractDir} {$extensionDir}");
         foreach ($cmds as $cmd) {
             $this->logger->debug($cmd);
             Utils::system($cmd);
         }
         // replace source directory to new source directory
         $sourceDir = str_replace($extensionExtractDir, $extensionDir, $ext->getSourceDirectory());
         $ext->setSourceDirectory($sourceDir);
         $ext->setName($extName);
     }
 }
 /**
  * Disables ini file for current extension
  * @return boolean
  */
 public function disableExtension(Extension $ext)
 {
     $name = $ext->getExtensionName();
     $enabled_file = $ext->getConfigFilePath();
     $disabled_file = $enabled_file . '.disabled';
     if (file_exists($disabled_file)) {
         $this->logger->info("[ ] {$name} extension is already disabled.");
         return true;
     }
     if (file_exists($enabled_file)) {
         if (rename($enabled_file, $disabled_file)) {
             $this->logger->info("[ ] {$name} extension is disabled.");
             return true;
         }
         $this->logger->warning("failed to disable {$name} extension.");
     }
     return false;
 }