/** * create instances of all the registered preview providers * @return void */ private static function initProviders() { if (!\OC_Config::getValue('enable_previews', true)) { $provider = new Preview\Unknown(array()); self::$providers = array($provider->getMimeType() => $provider); return; } if (count(self::$providers) > 0) { return; } foreach (self::$registeredProviders as $provider) { $class = $provider['class']; $options = $provider['options']; /** @var $object Provider */ $object = new $class($options); self::$providers[$object->getMimeType()] = $object; } $keys = array_map('strlen', array_keys(self::$providers)); array_multisort($keys, SORT_DESC, self::$providers); }
/** * create instances of all the registered preview providers * @return void */ private static function initProviders() { if (!\OC::$server->getConfig()->getSystemValue('enable_previews', true)) { self::$providers = array(); return; } if (!empty(self::$providers)) { return; } self::registerCoreProviders(); foreach (self::$registeredProviders as $provider) { $class = $provider['class']; $options = $provider['options']; /** @var $object Provider */ $object = new $class($options); self::$providers[$object->getMimeType()] = $object; } $keys = array_map('strlen', array_keys(self::$providers)); array_multisort($keys, SORT_DESC, self::$providers); }