Example #1
0
 public static function getByUri(&$uri)
 {
     $ret = new self();
     if (!($folders = Cache::get('f'))) {
         $folders = $ret->getFolder(0);
         Cache::set('f', $folders);
     }
     foreach ($folders as $k => $v) {
         if (strncmp($k, $uri, $v[1]) == 0) {
             $ret->id = $v[0];
             $ret->path = $k . '/';
         }
     }
     $key = 'f' . $ret->id;
     if ($c = Cache::get($key)) {
         return $c;
     }
     $ret->get();
     Cache::set($key, $ret);
     return $ret;
 }