public static function loadClassFile($file) {
		$before = array_merge(get_declared_classes(), get_declared_interfaces());
		require_once $file;
		$after = array_merge(get_declared_classes(), get_declared_interfaces());

		$diff = array_diff($after, $before);

		#class was maybe already loaded
		if(!$diff) {
			foreach(array_merge(get_declared_classes(), get_declared_interfaces()) as $class) {
				$reflector = new \ReflectionClass($class);
				if($reflector->getFileName() == realpath($file)) {
					$result = $class;
					break;
				}
			}
			if(!isset($result))
				throw new \Exception('File '.$file.' does not contain any class.');
		}
		else
			$result = array_values($diff)[count($diff)-1];

		return $result;
	}
public static function loadClassFile($file) {
		$before = array_merge(get_declared_classes(), get_declared_interfaces());
		require_once $file;
		$after = array_merge(get_declared_classes(), get_declared_interfaces());

		$diff = array_diff($after, $before);

		#class was maybe already loaded
		if(!$diff) {
			foreach(array_merge(get_declared_classes(), get_declared_interfaces()) as $class) {
				$reflector = new \ReflectionClass($class);
				if($reflector->getFileName() == realpath($file)) {
					$result = $class;
					break;
				}
			}
			if(!isset($result))
				throw new \Exception('File '.$file.' does not contain any class.');
		}
		else
			$result = array_values($diff)[count($diff)-1];

		return $result;
	}
public static function loadClassFile ( $ file ) { $ before = array_merge ( get_declared_classes ( ) , get_declared_interfaces ( ) ) ; require_once $ file ; $ after = array_merge ( get_declared_classes ( ) , get_declared_interfaces ( ) ) ; $ diff = array_diff ( $ after , $ before ) ; #class was maybe already loaded
 if ( ! $ diff ) { foreach ( array_merge ( get_declared_classes ( ) , get_declared_interfaces ( ) ) as $ class ) { $ reflector = new \ ReflectionClass ( $ class ) ; if ( $ reflector -> getFileName ( ) == realpath ( $ file ) ) { $ result = $ class ; break ; } } if ( ! isset ( $ result ) ) throw new \ Exception ( 'File ' . $ file . ' does not contain any class.' ) ; } else $ result = array_values ( $ diff ) [ count ( $ diff ) - 1 ] ; return $ result ; }
Load a file and return the class contained in the file.
@param  string $file
@return string
@api
Load a file and return the class contained in the file .