public function resolvePackage($name)
	{
		$packages = $this->getPackages();

		//most commonly we have Foobar or SupraPackageFoobar, which maps directly to package class
		//the other options is "foobar", which is mapped to AbstractPackage::getName
		foreach ($packages as $instance) {
			$class = get_class($instance);
			$classParts = explode('\\', $class);
			$className = $classParts[count($classParts) - 1];

			if ($name == $className || 'SupraPackage' . $name == $className) {
				return $class;
			}

			if ($name == $instance->getName()) {
				return $class;
			}
		}

		throw new \Exception(sprintf('Package "%s" can not be resolved', $name));
	}
public function resolvePackage($name)
	{
		$packages = $this->getPackages();

		//most commonly we have Foobar or SupraPackageFoobar, which maps directly to package class
		//the other options is "foobar", which is mapped to AbstractPackage::getName
		foreach ($packages as $instance) {
			$class = get_class($instance);
			$classParts = explode('\\', $class);
			$className = $classParts[count($classParts) - 1];

			if ($name == $className || 'SupraPackage' . $name == $className) {
				return $class;
			}

			if ($name == $instance->getName()) {
				return $class;
			}
		}

		throw new \Exception(sprintf('Package "%s" can not be resolved', $name));
	}
public function resolvePackage ( $ name ) { $ packages = $ this -> getPackages ( ) ; //most commonly we have Foobar or SupraPackageFoobar, which maps directly to package class //the other options is "foobar", which is mapped to AbstractPackage::getName foreach ( $ packages as $ instance ) { $ class = get_class ( $ instance ) ; $ classParts = explode ( '\\' , $ class ) ; $ className = $ classParts [ count ( $ classParts ) - 1 ] ; if ( $ name == $ className || 'SupraPackage' . $ name == $ className ) { return $ class ; } if ( $ name == $ instance -> getName ( ) ) { return $ class ; } } throw new \ Exception ( sprintf ( 'Package "%s" can not be resolved' , $ name ) ) ; }
This function uses woodoo magic to resolve package class name

@param string $name
@throws \Exception
@return string
This function uses woodoo magic to resolve package class name