Beispiel #1
0
 /**
  * Clear all the vertices out of the list
  * 
  */
 public function clear()
 {
     $this->edges = RestrictedSet::build(array(), $this->restrictions, array('strict' => true));
     $newEdge = new OrderedEdge();
     $this->edges->addReference($newEdge);
 }
Beispiel #2
0
 /**
  * Find a particular filename in the path
  * 
  * This method returns a filename (or '' on failure) when a given
  * filename is found in the path with an acceptable extension.
  * 
  * NOTE: Do not pass the required extension in $filename
  *       Use $reqExtension instead.
  * 
  * @param string The filename (without path or extension) to check
  * @param string Any particular extension we're looking for?
  * @param string Base path for relative path
  * 
  * @return string The full path with extension, or '' on failure
  * 
  */
 public function isFilename($filename, $reqExtension = '', $basePath = '')
 {
     $extensions = $this->extensions->getArray();
     if ($filename[0] == DIRECTORY_SEPARATOR) {
         $filename = ltrim($filename, DIRECTORY_SEPARATOR);
     }
     if ($this->relative && !$basePath) {
         throw new \InvalidArgumentException('Path->isFilename Relative Path Must have basePath ' . 'in filecheck');
     } else {
         if ($this->relative) {
             $path = $basePath . DIRECTORY_SEPARATOR . $this->path;
         } else {
             $path = $this->path;
         }
     }
     $path = substr($path, -1) != DIRECTORY_SEPARATOR ? $path . DIRECTORY_SEPARATOR : $path;
     $path = realpath($path);
     if ($reqExtension) {
         if ($this->conf->suppresswarnings && @file_exists($path . DIRECTORY_SEPARATOR . $filename . '.' . $reqExtension) || file_exists($path . DIRECTORY_SEPARATOR . $filename . '.' . $reqExtension)) {
             return $path . DIRECTORY_SEPARATOR . $filename . '.' . $reqExtension;
         }
         return '';
     }
     foreach ($extensions as $extension) {
         if ($this->conf->suppresswarnings && @file_exists($path . DIRECTORY_SEPARATOR . $filename . '.' . $extension) || file_exists($path . DIRECTORY_SEPARATOR . $filename . '.' . $extension)) {
             return $path . DIRECTORY_SEPARATOR . $filename . '.' . $extension;
         }
     }
     return '';
 }
Beispiel #3
0
 /**
  * Retrieve an ARRAY of the observing objects for this publisher
  * 
  * @return array
  * 
  */
 public function getListeners()
 {
     return $this->observers->getArray();
 }
Beispiel #4
0
 /**
  * Retrieve a list of publishers in an array
  * 
  * @return array
  * 
  */
 public function getPublishers()
 {
     return $this->publishers->getArray();
 }
 /**
  * Detach from the publisher
  * 
  */
 public function detach(PatternsResource\PublisherInterface $publisher)
 {
     if ($this->subject->in($publisher)) {
         $this->subject->remove($publisher);
     }
 }