protected function find($cls)
	{
		if (!empty(self::$paths))
		{
			foreach (self::$paths as $path)
			{
				$inc = $path . DS . strtolower($cls) . '.php';

				if (file_exists($inc))
				{
					$code = file_get_contents($inc);

					$tokens = token_get_all($code);

					for ($i = 2; $i < count($tokens); $i++)
					{
						if ($tokens[$i - 2][0] === T_CLASS
						 && $tokens[$i - 1][0] === T_WHITESPACE
						 && $tokens[$i][0] === T_STRING)
						{
							include_once $inc;

							return $tokens[$i][1];
						}
					}
				}
			}
		}

		return null;
	}
protected function find($cls)
	{
		if (!empty(self::$paths))
		{
			foreach (self::$paths as $path)
			{
				$inc = $path . DS . strtolower($cls) . '.php';

				if (file_exists($inc))
				{
					$code = file_get_contents($inc);

					$tokens = token_get_all($code);

					for ($i = 2; $i < count($tokens); $i++)
					{
						if ($tokens[$i - 2][0] === T_CLASS
						 && $tokens[$i - 1][0] === T_WHITESPACE
						 && $tokens[$i][0] === T_STRING)
						{
							include_once $inc;

							return $tokens[$i][1];
						}
					}
				}
			}
		}

		return null;
	}
protected function find ( $ cls ) { if ( ! empty ( self :: $ paths ) ) { foreach ( self :: $ paths as $ path ) { $ inc = $ path . DS . strtolower ( $ cls ) . '.php' ; if ( file_exists ( $ inc ) ) { $ code = file_get_contents ( $ inc ) ; $ tokens = token_get_all ( $ code ) ; for ( $ i = 2 ; $ i < count ( $ tokens ) ; $ i ++ ) { if ( $ tokens [ $ i - 2 ] [ 0 ] === T_CLASS && $ tokens [ $ i - 1 ] [ 0 ] === T_WHITESPACE && $ tokens [ $ i ] [ 0 ] === T_STRING ) { include_once $ inc ; return $ tokens [ $ i ] [ 1 ] ; } } } } } return null ; }
Search added paths for a callable class

@param   string  $cls
@return  string  Fully resolved class name
Search added paths for a callable class