Habari\Media::get_silo PHP Метод

get_silo() публичный статический Метод

Return the instance of a silo
public static get_silo ( mixed &$silo, boolean $parse_path = false ) : habari\MediaSilo
$silo mixed A silo instance or the name of a silo
$parse_path boolean If true, parse the siloname from the path and return the remainder path by reference
Результат habari\MediaSilo The requested silo
    public static function get_silo(&$silo, $parse_path = false)
    {
        if ($silo instanceof MediaSilo) {
            return $silo;
        }
        $siloname = $silo;
        if ($parse_path) {
            $exp = explode('/', $silo, 2);
            if (count($exp) > 1) {
                list($siloname, $silo) = $exp;
            } else {
                $siloname = $exp[0];
                $silo = '';
            }
        }
        self::init_silos();
        return self::$silos[$siloname];
    }