original_string: public static function load($package, $path = null)
  	{
  		if (is_array($package))
  		{
  			foreach ($package as $pkg => $path)
  			{
  				if (is_numeric($pkg))
  				{
  					$pkg = $path;
  					$path = null;
  				}
  				static::load($pkg, $path);
  			}
  			return false;
  		}
  
  		if (static::loaded($package))
  		{
  			return;
  		}
  
  		// if no path is given, try to locate the package
  		if ($path === null)
  		{
  			$paths = \Config::get('package_paths', array());
  			empty($paths) and $paths = array(PKGPATH);
  
  			if ( ! empty($paths))
  			{
  				foreach ($paths as $modpath)
  				{
  					if (is_dir($path = $modpath.strtolower($package).DS))
  					{
  						break;
  					}
  				}
  			}
  
  		}
  
  		if ( ! is_dir($path))
  		{
  			throw new \PackageNotFoundException("Package '$package' could not be found at '".\Fuel::clean_path($path)."'");
  		}
  
  		\Finder::instance()->add_path($path, 1);
  		\Fuel::load($path.'bootstrap.php');
  		static::$packages[$package] = $path;
  
  		return true;
  	}
code: public static function load($package, $path = null)
  	{
  		if (is_array($package))
  		{
  			foreach ($package as $pkg => $path)
  			{
  				if (is_numeric($pkg))
  				{
  					$pkg = $path;
  					$path = null;
  				}
  				static::load($pkg, $path);
  			}
  			return false;
  		}
  
  		if (static::loaded($package))
  		{
  			return;
  		}
  
  		// if no path is given, try to locate the package
  		if ($path === null)
  		{
  			$paths = \Config::get('package_paths', array());
  			empty($paths) and $paths = array(PKGPATH);
  
  			if ( ! empty($paths))
  			{
  				foreach ($paths as $modpath)
  				{
  					if (is_dir($path = $modpath.strtolower($package).DS))
  					{
  						break;
  					}
  				}
  			}
  
  		}
  
  		if ( ! is_dir($path))
  		{
  			throw new \PackageNotFoundException("Package '$package' could not be found at '".\Fuel::clean_path($path)."'");
  		}
  
  		\Finder::instance()->add_path($path, 1);
  		\Fuel::load($path.'bootstrap.php');
  		static::$packages[$package] = $path;
  
  		return true;
  	}
code_tokens: public static function load ( $ package , $ path = null ) { if ( is_array ( $ package ) ) { foreach ( $ package as $ pkg => $ path ) { if ( is_numeric ( $ pkg ) ) { $ pkg = $ path ; $ path = null ; } static :: load ( $ pkg , $ path ) ; } return false ; } if ( static :: loaded ( $ package ) ) { return ; } // if no path is given, try to locate the package if ( $ path === null ) { $ paths = \ Config :: get ( 'package_paths' , array ( ) ) ; empty ( $ paths ) and $ paths = array ( PKGPATH ) ; if ( ! empty ( $ paths ) ) { foreach ( $ paths as $ modpath ) { if ( is_dir ( $ path = $ modpath . strtolower ( $ package ) . DS ) ) { break ; } } } } if ( ! is_dir ( $ path ) ) { throw new \ PackageNotFoundException ( "Package '$package' could not be found at '" . \ Fuel :: clean_path ( $ path ) . "'" ) ; } \ Finder :: instance ( ) -> add_path ( $ path , 1 ) ; \ Fuel :: load ( $ path . 'bootstrap.php' ) ; static :: $ packages [ $ package ] = $ path ; return true ; }
docstring: Loads the given package.  If a path is not given, if will search through
  the defined package_paths. If not defined, then PKGPATH is used.
  It also accepts an array of packages as the first parameter.
  
  @param   string|array  $package  The package name or array of packages.
  @param   string|null   $path     The path to the package
  @return  bool  True on success
  @throws  PackageNotFoundException
docstring_tokens: Loads the given package . If a path is not given if will search through the defined package_paths . If not defined then PKGPATH is used . It also accepts an array of packages as the first parameter .