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; }
/** * @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; }