Ejemplo n.º 1
0
 /**
  * Get the last edge in the list
  * 
  * This returns a reference to the edge that has null on it's
  * next entry, making it the last in the list.
  * 
  * @return Falcraft\Data\Types\Node\OrderedEdge|null
  *              The last edge in the list
  * 
  */
 private function &getLastEdge()
 {
     // Look through the elements of the RestrictedSet
     foreach ($this->edges->getArray() as $edge) {
         /* If this edge has a null next edge, then it's the 
            end of the list */
         if ($edge->getNextEdge() == null) {
             return $edge;
         }
     }
     /* There is no last element of the list (shouldn't be if
        constructed appropriately) */
     $r = null;
     $r =& $r;
     return $r;
     //return null;
 }
Ejemplo n.º 2
0
 /**
  * Retrieve a list of publishers in an array
  * 
  * @return array
  * 
  */
 public function getPublishers()
 {
     return $this->publishers->getArray();
 }
Ejemplo n.º 3
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 '';
 }
Ejemplo n.º 4
0
 /**
  * Retrieve an ARRAY of the observing objects for this publisher
  * 
  * @return array
  * 
  */
 public function getListeners()
 {
     return $this->observers->getArray();
 }