setPackage() public méthode

public setPackage ( PEARX\Package $pkg )
$pkg PEARX\Package
 public static function createPeclExtension($packageName, $packageXmlPath)
 {
     $parser = new PackageXmlParser();
     $package = $parser->parse($packageXmlPath);
     $ext = new PeclExtension($packageName);
     $ext->setPackage($package);
     /**
      * xhprof stores package.xml in the root directory, but putting the 
      * config.m4 in the extension directory.
      * the path can be retrieve from the contents part from the package.xml
      */
     if ($m4path = $ext->findConfigM4FileFromPackageXml()) {
         $sourceDirectory = dirname($packageXmlPath);
         $m4dir = dirname($m4path);
         if ($m4dir != '.') {
             $sourceDirectory .= DIRECTORY_SEPARATOR . $m4dir;
         }
         $ext->setSourceDirectory($sourceDirectory);
     } else {
         $ext->setSourceDirectory(dirname($packageXmlPath));
     }
     return $ext;
 }