public function load($option, $strict = false)
	{
		$option = $this->canonical($option);

		if (isset(self::$components[$option]))
		{
			return self::$components[$option];
		}

		// Do we have a database connection?
		if ($this->app->has('db'))
		{
			$db = $this->app->get('db');

			$query = $db->getQuery()
				->select('extension_id', 'id')
				->select('element', '"option"')
				->select('params')
				->select('enabled')
				->from('#__extensions')
				->whereEquals('type', 'component')
				->whereEquals('element', $option);

			$db->setQuery($query->toString());

			if (!$this->app->has('cache.store') || !($cache = $this->app['cache.store']))
			{
				$cache = new \Hubzero\Cache\Storage\None();
			}

			if (!($data = $cache->get('_system.' . $option)))
			{
				$data = $db->loadObject();
				$cache->put('_system.' . $option, $data, $this->app['config']->get('cachetime', 15));
			}

			self::$components[$option] = $data;

			if ($error = $db->getErrorMsg())
			{
				throw new Exception($this->app['language']->translate('JLIB_APPLICATION_ERROR_COMPONENT_NOT_LOADING', $option, $error), 500);
			}
		}

		// Create a default object
		if (empty(self::$components[$option]))
		{
			self::$components[$option] = new stdClass;
			self::$components[$option]->option  = $option;
			self::$components[$option]->enabled = $strict ? 0 : 1;
			self::$components[$option]->params  = '';
			self::$components[$option]->id      = 0;
		}

		// Convert the params to an object.
		if (is_string(self::$components[$option]->params))
		{
			self::$components[$option]->params = new Registry(self::$components[$option]->params);
		}

		return self::$components[$option];
	}
public function load($option, $strict = false)
	{
		$option = $this->canonical($option);

		if (isset(self::$components[$option]))
		{
			return self::$components[$option];
		}

		// Do we have a database connection?
		if ($this->app->has('db'))
		{
			$db = $this->app->get('db');

			$query = $db->getQuery()
				->select('extension_id', 'id')
				->select('element', '"option"')
				->select('params')
				->select('enabled')
				->from('#__extensions')
				->whereEquals('type', 'component')
				->whereEquals('element', $option);

			$db->setQuery($query->toString());

			if (!$this->app->has('cache.store') || !($cache = $this->app['cache.store']))
			{
				$cache = new \Hubzero\Cache\Storage\None();
			}

			if (!($data = $cache->get('_system.' . $option)))
			{
				$data = $db->loadObject();
				$cache->put('_system.' . $option, $data, $this->app['config']->get('cachetime', 15));
			}

			self::$components[$option] = $data;

			if ($error = $db->getErrorMsg())
			{
				throw new Exception($this->app['language']->translate('JLIB_APPLICATION_ERROR_COMPONENT_NOT_LOADING', $option, $error), 500);
			}
		}

		// Create a default object
		if (empty(self::$components[$option]))
		{
			self::$components[$option] = new stdClass;
			self::$components[$option]->option  = $option;
			self::$components[$option]->enabled = $strict ? 0 : 1;
			self::$components[$option]->params  = '';
			self::$components[$option]->id      = 0;
		}

		// Convert the params to an object.
		if (is_string(self::$components[$option]->params))
		{
			self::$components[$option]->params = new Registry(self::$components[$option]->params);
		}

		return self::$components[$option];
	}
public function load ( $ option , $ strict = false ) { $ option = $ this -> canonical ( $ option ) ; if ( isset ( self :: $ components [ $ option ] ) ) { return self :: $ components [ $ option ] ; } // Do we have a database connection? if ( $ this -> app -> has ( 'db' ) ) { $ db = $ this -> app -> get ( 'db' ) ; $ query = $ db -> getQuery ( ) -> select ( 'extension_id' , 'id' ) -> select ( 'element' , '"option"' ) -> select ( 'params' ) -> select ( 'enabled' ) -> from ( '#__extensions' ) -> whereEquals ( 'type' , 'component' ) -> whereEquals ( 'element' , $ option ) ; $ db -> setQuery ( $ query -> toString ( ) ) ; if ( ! $ this -> app -> has ( 'cache.store' ) || ! ( $ cache = $ this -> app [ 'cache.store' ] ) ) { $ cache = new \ Hubzero \ Cache \ Storage \ None ( ) ; } if ( ! ( $ data = $ cache -> get ( '_system.' . $ option ) ) ) { $ data = $ db -> loadObject ( ) ; $ cache -> put ( '_system.' . $ option , $ data , $ this -> app [ 'config' ] -> get ( 'cachetime' , 15 ) ) ; } self :: $ components [ $ option ] = $ data ; if ( $ error = $ db -> getErrorMsg ( ) ) { throw new Exception ( $ this -> app [ 'language' ] -> translate ( 'JLIB_APPLICATION_ERROR_COMPONENT_NOT_LOADING' , $ option , $ error ) , 500 ) ; } } // Create a default object if ( empty ( self :: $ components [ $ option ] ) ) { self :: $ components [ $ option ] = new stdClass ; self :: $ components [ $ option ] -> option = $ option ; self :: $ components [ $ option ] -> enabled = $ strict ? 0 : 1 ; self :: $ components [ $ option ] -> params = '' ; self :: $ components [ $ option ] -> id = 0 ; } // Convert the params to an object. if ( is_string ( self :: $ components [ $ option ] -> params ) ) { self :: $ components [ $ option ] -> params = new Registry ( self :: $ components [ $ option ] -> params ) ; } return self :: $ components [ $ option ] ; }
Load the installed components into the components property.

@param   string   $option  The element value for the extension
@param   boolean  $strict  If set and the component does not exist, the enabled attribute will be set to false.
@return  object
Load the installed components into the components property .