public static function getPlugins($criteria = 'both', $exclude = false, $status = 2)
	{
		static $instances;
		if (!isset($instances)) {
			$instances = array();
		}
		$db = self::getDBO();

		$query = $db->getQuery(true)
			->select('*')
			->from('#__jfusion');

		$key = $criteria . '_' . $exclude . '_' . $status;
		if (!isset($instances[$key])) {
			if ($exclude !== false) {
				$query->where('name NOT LIKE ' . $db->quote($exclude));
			}
			$query->where('status >= ' . (int)$status);
			$query->order('ordering');

			$db->setQuery($query);
			$list = $db->loadObjectList();

			switch ($criteria) {
				case 'slave':
					if (isset($list[0])) {
						unset($list[0]);
					}
					break;
				case 'master':
					if (isset($list[0])) {
						$list = $list[0];
					} else {
						$list = null;
					}
					break;
			}
			$instances[$key] = $list;
		}
		return $instances[$key];
	}