setSourceDirectory() public method

public setSourceDirectory ( $dir )
示例#1
0
 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);
     }
 }