示例#1
0
 public function valid()
 {
     if (!parent::valid()) {
         return false;
     }
     if ($aKey = FsKey::createKey(parent::current())) {
         $this->aCurrentKey = $aKey;
         return true;
     } else {
         return false;
     }
 }
示例#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;
 }
示例#3
0
文件: FsKey.php 项目: JeCat/framework
 public function deleteKey()
 {
     $this->arrItems = array();
     if ($aFolder = $this->folder()) {
         FsKey::setFlyweight(null, $aFolder->path());
         $aFolder->delete(true, true);
         $this->bDataChanged = false;
     }
 }