gException -What does it do in this code?

Howdy again!
Will someone explain what this line of code does?


if(strstr($class, 'Controller')):
   throw new gException('Class \\''.$class.'\\' could not be loaded by the          autoloader');
endif;

It’s pulled from this block of code which I understand for the most part.

<?php

class autoload
{
	public function __construct($class)
	{
            /*The next line is also in the utility.php file. Each occurance is to set up
             * 
             */
		$paths = parse_ini_file('../application/config/paths.ini.php', true);

		foreach($paths['include_paths'] as $path):
			$class = str_replace('_', '/', $class);
			$file = $path.$class.'.php';
			if(file_exists($file)):
				include $file;
				return;
			endif;
		endforeach;

		if(strstr($class, 'Controller')):
			throw new gException('Class \\''.$class.'\\' could not be loaded by the autoloader');
		endif;
	}
}

Thanks much.

I’m sorry. The I meant to say block. The first block of code with the gException in it.

Thanks

Which line in particular?

firstly it checks if the value of $class contains the word Controller, which by the looks of it the application disallows access to (after including it) by throwing an exception and possibly halting execution of the application (cant be sure of this without looking at the code within the gException class).

Thanks for the clarification.

The exception is only thrown if the class’s file could not be found in one of the defined paths and if the class name contains Controller. If the file could be found, or does not contain Controller then the gException is not thrown.

Here is the gException code. Can you tell me what purpose would including access and then disallowing it would serve?

<?php

class gException extends Exception
{
	public function __construct($message)
	{
		printr('', 'MVC APP');

		printr($message, 'Message');

		printr($this->file.'<br />Line: '.$this->getLine(), 'File');

		printr($this->getTraceAsString(), 'Stack Trace');

		printr(get_included_files(), 'Included Files');

		die();
	}
}

Thanks