Auto detects the locale directory location.

@param string $handlerClass  The name of a class implementing the
Horde_Translation_Handler interface.
776479
public static function loadHandler($handlerClass)
    {
        if (!static::$_domain) {
            throw new Horde_Translation_Exception('The domain property must be set by the class that extends Horde_Translation_Autodetect.');
        }

        $directory = static::_searchLocaleDirectory();
        if (!$directory) {
            throw new Horde_Translation_Exception(sprintf('Could not found find any locale directory for %s domain.', static::$_domain));
        }

        static::$_directory = $directory;
        parent::loadHandler($handlerClass);
    }
682906
public function locate($class, $basepath = null)
    {
        if (substr($class, 0, 3) === 'Mod')
        {
            /*
             * Exception rule for Exception classes
             *
             * Transform class to lower case to always load the exception class from the /exception/ folder.
             */
            if ($pos = strpos($class, 'Exception'))
            {
                $filename = substr($class, $pos + strlen('Exception'));
                $class    = str_replace($filename, ucfirst(strtolower($filename)), $class);
            }

            $word  = strtolower(preg_replace('/(?<=\\w)([A-Z])/', ' \\1', $class));
            $parts = explode(' ', $word);

            array_shift($parts);
            $package   = array_shift($parts);
            $namespace = ucfirst($package);

            $module = 'mod_'.$package;
            $file 	= array_pop($parts);

            if(count($parts))
            {
                if($parts[0] === 'view') {
                    $parts[0] = KStringInflector::pluralize($parts[0]);
                }

                $path = implode('/', $parts);
                $path = $path.'/'.$file;
            }
            else $path = $file;

            //Switch basepath
            if(!$this->getNamespace($namespace)) {
                $basepath = $this->getNamespace('\\');
            } else {
                $basepath = $this->getNamespace($namespace);
            }

            return $basepath.'/'.$module.'/'.$path.'.php';
        }

        return false;
    }
205274
public function loadClass($class)
    {
        if (0 === strpos($class, 'Admingenerated')) {
            $filePath = $this->basePath.DIRECTORY_SEPARATOR.str_replace('\\', DIRECTORY_SEPARATOR, $class).'.php';

            if (!file_exists($filePath)) {
                $this->generateEmptyController($class);
            }

            if (file_exists($filePath)) {
                require $filePath;
            }
        }
    }
190598
protected function setFormClass($formClass){

        if (is_string($formClass)){
            $formClass = explode(" " , $formClass);
        }

        $this->formClass = $formClass;
    }
240347
public function locate($class)
    {
        $path = false;

        if(self::$__loader) {
            $path = self::$__loader->findFile($class);
        }

        return $path;
    }
636042
public static function autoload($class)
    {
        if (substr($class, -10) == "Controller") {
            self::loadController($class);
        } else if (substr($class, -5) == "Model") {
            self::loadModel($class);
        } else if (substr($class, -6) == "Helper") {
            self::loadHelper($class);
        }
    }
986452
protected function autoload($class) {
		$class=$this->fixslashes(ltrim($class,'\\'));
		/** @var callable $func */
		$func=NULL;
		if (is_array($path=$this->hive['AUTOLOAD']) &&
			isset($path[1]) && is_callable($path[1]))
			list($path,$func)=$path;
		foreach ($this->split($this->hive['PLUGINS'].';'.$path) as $auto)
			if ($func && is_file($file=$func($auto.$class).'.php') ||
				is_file($file=$auto.$class.'.php') ||
				is_file($file=$auto.strtolower($class).'.php') ||
				is_file($file=strtolower($auto.$class).'.php'))
				return require($file);
	}
1183671
public void initLoad(String configClass, String xmlLocations, String handlerLocations) {
        // 设置配置的文件路径的值，并开始加载ZealotConfig配置信息
        this.xmlLocations = xmlLocations;
        this.handlerLocations = handlerLocations;
        this.initLoad(configClass);
    }
877850
public function provider($class)
    {

        $class = ltrim($class, '\\');

        if (isset($this->providers[$class])) {
            return $this->providers[$class];
        }

        if (!isset($this->providerFactories[$class])) {
            throw new HandlerNotFoundException("No provider for class $class found.");
        }

        $this->providers[$class] = call_user_func($this->providerFactories[$class], $class);

        return $this->providers[$class];

    }
371307
public static function load($class)
    {
        if (substr($class, 0, 10) !== "Highlight\\") {
            return false;
        }

        $c = str_replace("\\", "/", substr($class, 10)) . ".php";
        $res = include __DIR__ . "/$c";

        return $res == 1 ? true : false;
    }
266523
private function getMaximumAttempts($handlerClass)
    {
        $handler = $this->handlerFactory->create($handlerClass);
        if (!$handler instanceof RetryTaskHandlerInterface) {
            return 1;
        }

        return $handler->getMaximumAttempts();
    }
742277
public static function autoload($class)
    {
        $baseRoot = Container::get('config')->get('app_full_path');
        // project-specific namespace prefix
        $prefix = Container::get('config')->get('namespace_prefix');

        // does the class use the namespace prefix?
        $len = strlen($prefix);
        if (strncmp($prefix, $class, $len) !== 0) {
            // no, move to the next registered autoloader
            return;
        }

        // get the relative class name
        $relativeClass = substr($class, $len);

        // replace the namespace prefix with the base directory, replace namespace
        // separators with directory separators in the relative class name, append
        // with .php
        $file = $baseRoot . '/' . str_replace('\\', '/', $relativeClass) . '.php';

        self::import($file);
    }
979699
public function createTranslator($locale, $class = null, $cacheDir = null, $debug = false)
    {
        if (null === $class) {
            $class = '\Symfony\Component\Translation\Translator';
        }
        if (null === $locale) {
            $locale = 'en';
        }
        /** @var Translator $translator */
        $translator = new $class($locale, null, $cacheDir, $debug);
        $translator->addLoader('xml', new XliffFileLoader());
        $configuration = new SanityCheckConfiguration();
        $translations = $configuration->getTranslationResources();
        foreach ($translations as $locale => $resources) {
            foreach ($resources as $resource) {
                $translator->addResource('xml', $resource, $locale, 'chameleon_system_sanitycheck');
            }
        }

        return $translator;
    }
600297
public function handleDefaultLocale(HydrateEvent $event)
    {
        // set the default locale
        if (null === $event->getLocale()) {
            $event->setLocale($this->documentRegistry->getDefaultLocale());
        }
    }
1357368
public static function registerAutoload($class = 'Zend_Loader', $enabled = true)
    {
        if (!function_exists('spl_autoload_register')) {
            include_once 'Zend/Exception.php';
            throw new Zend_Exception('spl_autoload does not exist in this PHP installation');
        }

        self::loadClass($class);
        $methods = get_class_methods($class);
        if (!in_array('autoload', (array) $methods)) {
            include_once 'Zend/Exception.php';
            throw new Zend_Exception("The class \"$class\" does not have an autoload() method");
        }

        if ($enabled === true) {
            spl_autoload_register(array($class, 'autoload'));
        } else {
            spl_autoload_unregister(array($class, 'autoload'));
        }
    }
50904
public function getLocator($class)
    {
        $result = false;

        if(!false == $pos = strrpos($class, '\\'))
        {
            $namespace = substr($class, 0, $pos);

            if(isset($this->_namespaces[$namespace])) {
                $result = $this->_namespaces[$namespace];
            }
        }

        return $result;
    }
1156606
public function load($locale)
    {
        if ($this->isLoaded($locale)) {
            return;
        }
        $this->languages[$locale] = $this->handler->load($locale);
    }