private function parseClassFromFile($file, $returnAsParts = false)
	{
		// replace some values in file path to get what we need
		$file = str_replace(
			array(
				PATH_CORE . DS . 'components' . DS . 'com_',
				PATH_APP . DS . 'components' . DS . 'com_',
				'.php'
			),
			array('', '', ''),
			$file
		);

		// split by "/"
		$parts = explode(DS, $file);
		array_unshift($parts, 'components');

		// do we want to return as parts?
		if ($returnAsParts)
		{
			$parts['namespace']  = $parts[0];
			$parts['component']  = $parts[1];
			$parts['client']     = $parts[2];
			$parts['controller'] = $parts[4];
			$b = explode('v', $parts[4]);
			$parts['version']    = end($b);//$parts[4];
			return $parts;
		}

		// capitalize first letter
		$parts = array_map('ucfirst', $parts);

		// put all the pieces back together
		return str_replace('.', '_', implode('\\', $parts));
	}
private function parseClassFromFile($file, $returnAsParts = false)
	{
		// replace some values in file path to get what we need
		$file = str_replace(
			array(
				PATH_CORE . DS . 'components' . DS . 'com_',
				PATH_APP . DS . 'components' . DS . 'com_',
				'.php'
			),
			array('', '', ''),
			$file
		);

		// split by "/"
		$parts = explode(DS, $file);
		array_unshift($parts, 'components');

		// do we want to return as parts?
		if ($returnAsParts)
		{
			$parts['namespace']  = $parts[0];
			$parts['component']  = $parts[1];
			$parts['client']     = $parts[2];
			$parts['controller'] = $parts[4];
			$b = explode('v', $parts[4]);
			$parts['version']    = end($b);//$parts[4];
			return $parts;
		}

		// capitalize first letter
		$parts = array_map('ucfirst', $parts);

		// put all the pieces back together
		return str_replace('.', '_', implode('\\', $parts));
	}
private function parseClassFromFile ( $ file , $ returnAsParts = false ) { // replace some values in file path to get what we need $ file = str_replace ( array ( PATH_CORE . DS . 'components' . DS . 'com_' , PATH_APP . DS . 'components' . DS . 'com_' , '.php' ) , array ( '' , '' , '' ) , $ file ) ; // split by "/" $ parts = explode ( DS , $ file ) ; array_unshift ( $ parts , 'components' ) ; // do we want to return as parts? if ( $ returnAsParts ) { $ parts [ 'namespace' ] = $ parts [ 0 ] ; $ parts [ 'component' ] = $ parts [ 1 ] ; $ parts [ 'client' ] = $ parts [ 2 ] ; $ parts [ 'controller' ] = $ parts [ 4 ] ; $ b = explode ( 'v' , $ parts [ 4 ] ) ; $ parts [ 'version' ] = end ( $ b ) ; //$parts[4]; return $ parts ; } // capitalize first letter $ parts = array_map ( 'ucfirst' , $ parts ) ; // put all the pieces back together return str_replace ( '.' , '_' , implode ( '\\' , $ parts ) ) ; }
Get class name based on file

@param   string  $file           File path
@param   bool    $returnAsParts  Return as parts?
@return  mixed
Get class name based on file