addDependency() public static method

Add a dependency.
public static addDependency ( array $input, string $type, string $optional, &$result ) : null
$input array The input array.
$type string The dependency type.
$optional string Optional dependency or not?
return null
示例#1
0
 /**
  * Convert the PEAR server response into an array that we would get when
  * accessing the dependencies of a local package.xml via PEAR.
  *
  * @param string $type     The dependency type.
  * @param array  $input    The input array.
  * @param string $optional Indicates if it is an optional dependency.
  * @param array  &$result  The result array.
  *
  * @return NULL
  */
 private function _convert($type, $input, $optional, &$result)
 {
     if (in_array($type, array('package', 'extension')) && !isset($input['name'])) {
         foreach ($input as $element) {
             $this->_convert($type, $element, $optional, $result);
         }
     } else {
         Horde_Pear_Package_Dependencies::addDependency($input, $type, $optional, $result);
     }
 }
示例#2
0
文件: Xml.php 项目: raz0rsdge/horde
 /**
  * Complete the dependency information.
  *
  * @param DOMNode $parent   The parent node ("required" or "optional").
  * @param array   &$result  The result array.
  * @param string  $optional Optional dependency or not?
  *
  * @return NULL
  */
 private function _completeDependencies($parent, &$result, $optional)
 {
     if ($parent === false) {
         return;
     }
     foreach ($parent->childNodes as $dep) {
         if ($dep->nodeType == XML_TEXT_NODE) {
             continue;
         }
         $input = array();
         $this->_dependencyInputValue($input, 'min', $dep);
         $this->_dependencyInputValue($input, 'max', $dep);
         $this->_dependencyInputValue($input, 'name', $dep);
         $this->_dependencyInputValue($input, 'channel', $dep);
         $this->_dependencyInputValue($input, 'conflicts', $dep);
         Horde_Pear_Package_Dependencies::addDependency($input, $dep->nodeName, $optional, $result);
     }
 }
示例#3
0
 /**
  * @expectedException Horde_Pear_Exception
  */
 public function testUnsupported()
 {
     $result = array();
     Horde_Pear_Package_Dependencies::addDependency(array('name' => 'Z'), 'unsupported', 'yes', $result);
 }