コード例 #1
0
ファイル: fDOMDocument.php プロジェクト: KingNoosh/Teknik
 /**
  * Forward to DOMXPath->registerPHPFunctions()
  *
  * @param mixed $restrict Array of function names or string with functionname to restrict callabilty to
  *
  * @throws fDOMException
  *
  * @return void
  */
 public function registerPHPFunctions($restrict = NULL)
 {
     if (is_null($this->xp)) {
         $this->getDOMXPath();
     }
     $this->xp->registerPHPFunctions($restrict);
     if (libxml_get_last_error()) {
         throw new fDOMException("Registering php functions failed.", fDOMException::RegistrationFailed);
     }
 }
コード例 #2
0
ファイル: XPathQuery.php プロジェクト: KingNoosh/Teknik
 private function buildQuery(fDOMXPath $xp, array $values = NULL)
 {
     $backup = $this->values;
     if (count($values) > 0) {
         foreach ($values as $k => $v) {
             $this->bind($k, $v);
         }
     }
     $query = $xp->prepare($this->query, $this->values);
     $this->values = $backup;
     return $query;
 }