Exemple #1
0
 public static function createKey(Folder $aFolder)
 {
     $sFlyweightKey = $aFolder->path();
     if (!($aKey = FsKey::flyweight($sFlyweightKey, false))) {
         $aKey = new FsKey($aFolder);
         FsKey::setFlyweight($aKey, $sFlyweightKey);
     }
     return $aKey;
 }
Exemple #2
0
 /**
  * @return IKey 
  */
 public function key($sPath, $bAutoCreate = false)
 {
     $sKeyPath = self::transPath($sPath, false);
     $sFlyweightKey = $this->aRootFolder->path() . '/' . $sKeyPath;
     if (!($aKey = FsKey::flyweight($sFlyweightKey, false))) {
         if (!($aFolder = $this->aRootFolder->findFolder($sKeyPath, $bAutoCreate ? Folder::FIND_AUTO_CREATE : 0))) {
             return null;
         }
         $aKey = new FsKey($aFolder);
         FsKey::setFlyweight($aKey, $sFlyweightKey);
     }
     return $aKey;
 }