Example #1
0
 function __construct(\PEAR2\Pyrus\PackageFile\v2\Files $parent, \PEAR2\Pyrus\PackageFile\v2 $ultraparent, array $info)
 {
     $this->parent = $parent;
     $this->pkg = $ultraparent;
     $this->tasksNs = $ultraparent->getTasksNs() . ':';
     parent::__construct($info);
 }
Example #2
0
 function fromPackageFile(\PEAR2\Pyrus\PackageFileInterface $package)
 {
     \PEAR2\Pyrus\PackageFile\v2::fromPackageFile($package);
     if (isset($this->packageInfo['contents']['dir']['attribs']['baseinstalldir'])) {
         $this->baseinstalldirs = array('/' => $this->packageInfo['contents']['dir']['attribs']['baseinstalldir']);
     }
 }
Example #3
0
 function _analyzePhpFiles()
 {
     if (!$this->_pf->packagefile) {
         throw new \PEAR2\Pyrus\PackageFile\Exception('Cannot validate files, no path to package file is set (use setPackageFile())');
     }
     foreach ($this->_pf->contents as $fa) {
         if (!file_exists($this->_pf->getFilePath($fa->name))) {
             $this->errors->E_ERROR[] = new \PEAR2\Pyrus\PackageFile\Exception('File "' . $this->_pf->getFilePath($fa->name) . '" in package.xml does not exist');
             continue;
         }
         $this->analyzeSourceCode($this->_pf->getFilePath($fa->name));
     }
     return !count($this->errors->E_ERROR);
 }
Example #4
0
 function __set($var, $value)
 {
     if (!isset($this->packagename)) {
         throw new \PEAR2\Pyrus\Registry\Exception('Attempt to retrieve ' . $var .
             ' from unknown package');
     }
     \PEAR2\Pyrus\PackageFile\v2::__set($var, $value);
     // occasionally, this next line will result in failure to install when incomplete data is there,
     // so we silently skip the save, and mark the packagefile as dirty
     try {
         $this->reg->replace($this);
         $this->dirty = false;
     } catch (\PEAR2\Pyrus\Registry\Exception $e) {
         $this->dirty = true;
     }
 }
Example #5
0
    /**
     * Allow setting of attributes and tasks directly
     *
     * @param string $var
     * @param string|object $value
     */
    function __set($var, $value)
    {
        if (strpos($var, $this->_packagefile->getTasksNs()) === 0) {
            // setting a file task
            if ($value instanceof \PEAR2\Pyrus\Task\Common) {
                $this->_packagefile->setFileAttribute($this->dir . $this['attribs']['name'], $var, $value);
                return;
            }

            throw new \PEAR2\Pyrus\PackageFile\Exception('Cannot set ' . $var . ' to non-' .
                '\PEAR2\Pyrus\Task\Common object in file ' . $this->dir .
                $this['attribs']['name']);
        }

        $this->_packagefile->setFileAttribute($this->dir . $this['attribs']['name'], $var, $value);
        parent::__construct($this->_packagefile->files[$this->dir . $this['attribs']['name']]);
    }
Example #6
0
 function __set($var, $value)
 {
     if (!isset($this->packagename)) {
         throw new \PEAR2\Pyrus\Registry\Exception('Attempt to retrieve ' . $var . ' from unknown package');
     }
     parent::__set($var, $value);
     $this->reg->replace($this);
 }
Example #7
0
 function getMaintainer()
 {
     // can't get email addresses from REST, have to grab the entire package.xml
     $this->grabEntirePackagexml();
     return parent::getMaintainer();
 }