Import class files based on the class name and the namespace

@param string $class The class fully qualified name

@return bool True only if the class is exists after the import
768374
public function load( $class ) {

    // do not import class that is exists already
    if( static::exist( $class ) ) return true;
    else {

      // fix for absolute class definitions
      $class = ltrim( $class, '\\' );

      $path = explode( '\\', $class );
      $name = array_pop( $path );

      // try first the custom paths (custom autoload path support)
      foreach( $this->definition as $namespace => list( $directory, $length ) ) {
        if( strpos( $class, $namespace ) === 0 ) {

          // return when the loader find a perfect match, and the class really exist
          if( $this->search( $name, array_slice( $path, $length ), $directory ) && static::exist( $class ) ) {
            return true;
          }
        }
      }

      return false;
    }
  }
536706
public function findFile($class) {
		if ('\\' === $class[0]) {
			$class = substr($class, 1);
		}

		if (isset($this->classMap[$class])) {
			return $this->classMap[$class];
		}
		elseif ($this->classMapAuthoratative) {
			return false;
		}

		$classPath = $this->getClassPath($class);

		foreach ($this->prefixes as $prefix => $dirs) {
			if (0 === strpos($class, $prefix)) {
				foreach ($dirs as $dir) {
					if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
						return $dir.DIRECTORY_SEPARATOR.$classPath;
					}
				}
			}
		}

		foreach ($this->fallbackDirs as $dir) {
			if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
				return $dir.DIRECTORY_SEPARATOR.$classPath;
			}
		}

		if ($this->useIncludePath && $file = self::resolveIncludePath($classPath)) {
			return $file;
		}

		return $this->classMap[$class] = false;
	}
215648
public function allowed($class)
    {
        foreach ($this->_exclude as $namespace) {
            if (strpos($class, $namespace) === 0) {
                return false;
            }
        }
        if ($this->_include === ['*']) {
            return true;
        }
        foreach ($this->_include as $namespace) {
            if (strpos($class, $namespace) === 0) {
                return true;
            }
        }
        return false;
    }
555657
public function load($class)
    {
        if ($class[0] == '\\') $class = substr($class, 1);
        $class = str_replace(array('\\', '_'), DIRECTORY_SEPARATOR, $class).'.php';

        foreach ($this->directories as $directory)
        {
            if (file_exists($path = $directory.DIRECTORY_SEPARATOR.$class))
            {
                require_once $path;
                return true;
            }
        }
        return false;
    }
497098
public static function load($class)
	{
		$class = static::normalizeClass($class);

		foreach (static::$directories as $directory)
		{
			if (file_exists($path = $directory . DIRECTORY_SEPARATOR . $class))
			{
				require_once $path;

				return true;
			}

			if (file_exists($path = $directory . DIRECTORY_SEPARATOR . strtolower($class)))
			{
				require_once $path;

				return true;
			}
		}

		return false;
	}
1321643
private static function findFile($class)
    {
        $namespace = substr($class, 0, strpos($class, '\\'));
        $filePath = substr($class, strlen($namespace)) . EXT;
        return strtr($namespace . $filePath, '\\', DIRECTORY_SEPARATOR);
    }
479678
public static function load($class) 
	{
		if (substr($class, 0, 8)=='Ripcord_') 
		{
			$root = dirname(__FILE__).'/ripcord_';
			$class = substr($class, 8);
			$file = str_replace('.', '', $class);
			$file = str_replace('_', '/', $file);
			$file = strtolower($file);
			while ($file && $file!='.') 
			{
				if ( file_exists($root.$file.'.php') ) 
				{
					require_once($root.$file.'.php');
					return true;
				} else {
					$file = dirname($file);
				}
			}
		}
		return false;
	}
614602
private function load($class)
    {
        if ($this->isLoaded($class)) {
            throw new \InvalidArgumentException(sprintf(
                "Error loading class '%s', the class already exists",
                $class
            ));
        }

        if ($file = $this->findFile($class)) {
            return $this->loadFile($file, $class);
        }

        return false;
    }
466818
protected function needAliasForClassName($class, $namespace)
    {
        if ($namespace == $this->getNamespace()) {
            return false;
        }

        if (str_replace('\\Base', '', $namespace) == str_replace('\\Base', '', $this->getNamespace())) {
            return true;
        }

        if (empty($namespace) && 'Base' === $this->getNamespace()) {
            if (str_replace(['Query'], '', $class) == str_replace(['Query'], '', $this->getUnqualifiedClassName())) {
                return true;
            }

            if ((false !== strpos($class, 'Query'))) {
                return true;
            }

            // force alias for model without namespace
            if (false === array_search($class, $this->whiteListOfDeclaredClasses, true)) {
                return true;
            }
        }

        if ('Base' === $namespace && '' === $this->getNamespace()) {
            // force alias for model without namespace
            if (false === array_search($class, $this->whiteListOfDeclaredClasses, true)) {
                return true;
            }
        }

        return false;
    }
386345
public static function autoload($class)
    {
        if ($class === 'Cpdf') {
            require_once __DIR__ . "/../lib/Cpdf.php";
            return;
        }

        $prefixLength = strlen(self::PREFIX);
        if (0 === strncmp(self::PREFIX, $class, $prefixLength)) {
            $file = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, $prefixLength));
            $file = realpath(__DIR__ . (empty($file) ? '' : DIRECTORY_SEPARATOR) . $file . '.php');
            if (file_exists($file)) {
                require_once $file;
            }
        }
    }
277059
public static function autoload($class)
    {
        /**
         * Classes from unified namespace canot be loaded by this auto loader.
         * Do not try to load them in order to avoid strange errors in edge cases.
         */
        if (false !== strpos($class, 'OxidEsales\Eshop\\')) {
            return false;
        }
        $instance = static::getInstance();

        $class = strtolower(basename($class));

        if ($classPath = $instance->getFilePath($class)) {
            include $classPath;
        } else {
            $class = preg_replace('/_parent$/i', '', $class);

            if (!in_array($class, $instance->triedClasses)) {
                $instance->triedClasses[] = $class;
                $instance->createExtensionClassChain($class);
            }
        }
    }
492893
public function autoload($class)
    {
        if (isset($this->classes[$class])) {
            require $this->classes[$class];

            return true;
        }
        // fallback for classes defined with leading backslash
        if (strpos($class, '\\') === 0) {
            $class = substr($class, 1);

            return $this->autoload($class);
        }

        return false;
    }
465274
public static function _autoload ($class)
	{
		
		// Strip first slash
		
		$class		= ltrim ($class, '\\');
		$namespace	= NULL;
		$filename	= NULL;
		
		// If we're loading a sonic class
		
		if (stripos ($class, 'Sonic\\') === 0)
		{
			
			// Process namespace
			
			if ($nsPos = strripos ($class, '\\'))
			{
				$namespace	= substr ($class, 0, $nsPos);
				$class		= substr ($class, $nsPos + 1);
				$filename	= str_replace ('\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;
			}
			
			// Replace _ with directory seperator in class
			
			$filename	.= str_replace ('_', DIRECTORY_SEPARATOR, $class) . '.php';
			
			// Check for framework class first
			
			if (defined ('ABS_SONIC') && file_exists (ABS_SONIC . $filename))
			{
				require_once (ABS_SONIC . $filename);
			}
			
			// Else check class library
			
			else if (defined ('ABS_CLASSES') && file_exists (ABS_CLASSES . $filename))
			{
				require_once (ABS_CLASSES . $filename);
			}
			
		}
		
	}
1019688
public function findFile($class)
    {
        // class map lookup
        if (isset($this->_classMap[$class])) {
            return $this->_classMap[$class];
        }
        if ($this->_classMapAuthoritative || isset($this->_missingClasses[$class])) {
            return false;
        }
        if ($this->_apcuPrefix !== null) {
            $file = apcu_fetch($this->_apcuPrefix . $class, $hit);
            if ($hit) {
                return $file;
            }
        }

        $file = $this->_findFileWithExtension($class, '.php');

        // Search for Hack files if we are running on HHVM
        if (!$file && defined('HHVM_VERSION')) {
            $file = $this->_findFileWithExtension($class, '.hh');
        }

        if ($this->_apcuPrefix !== null) {
            apcu_add($this->_apcuPrefix . $class, $file);
        }

        if ($file !== false) {
            $file = realpath($file);
        } else {
            // Remember that this class does not exist.
            $this->_missingClasses[$class] = true;
        }
        return $this->_patchers ? $this->_patchers->findFile($this, $class, $file) : $file;
    }
771436
public function load($class)
    {
        $class = ltrim($class, '\\');

        if (strpos($class, $this->namespace) === 0) {
            $nsparts = explode('\\', $class);
            $class = array_pop($nsparts);
            $nsparts[ ] = '';
            $path = $this->path . implode(DIRECTORY_SEPARATOR, $nsparts);
            $path .= str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php';

            if (file_exists($path)) {
                require $path;

                return true;
            }
        }

        return false;
    }
1091528
public function loadClass($class)
    {
        $e = error_reporting(error_reporting() | E_PARSE | E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR);

        try {
            if ($this->isFinder && !isset($this->loaded[$class])) {
                $this->loaded[$class] = true;
                if (!$file = $this->classLoader[0]->findFile($class) ?: false) {
                    // no-op
                } elseif (\function_exists('opcache_is_script_cached') && @opcache_is_script_cached($file)) {
                    require $file;

                    return;
                } else {
                    require $file;
                }
            } else {
                ($this->classLoader)($class);
                $file = false;
            }
        } finally {
            error_reporting($e);
        }

        $this->checkClass($class, $file);
    }
1024259
public function loadClass($class) {

		// reset debug info

		$this->debug = array('Loading ' . $class);
	
		// is class mapped to file

		if (isset($this->classPaths[$class])) {

			$file = $this->classPaths[$class];

			if ($this->requireFile($file)) {
				$this->debug[] = 'Loaded from: ' . $file;
				$this->loadedClasses[$class] = $file;
				return $file;
			}
		}
	
		// no map entry found
		
		$this->debug[] = 'No explicit class file';
	
		$prefix = $class;
	
		// work backwards through the namespace names of the fully-qualified
		// class name to find a mapped file name

		while (FALSE !== ($pos = strrpos($prefix, '\\'))) {
	
			// retain the trailing namespace separator in the prefix

			$prefix = substr($class, 0, $pos + 1);
	
			// the rest is the relative class name

			$relativeClass = substr($class, $pos + 1);
	
			// try to load a mapped file for the prefix and relative class

			$file = $this->loadFile($prefix, $relativeClass);

			if ($file) {
				$this->debug[] = 'Loaded from ' . $prefix . ': ' . $file;
				$this->loadedClasses[$class] = $file;
				return $file;
			}
	
			$prefix = rtrim($prefix, '\\');

		}
	
		// did not find a file for the class

		$this->debug[] = $class . 'not loaded';
		return FALSE;
	}