Class Kodoc_Missing

Kodoc_Missing

extends Kohana_Kodoc_Missing

Set Kodoc_Missing::create_class as an autoloading to prevent missing classes from crashing the api browser. Classes that are missing a parent will extend this class, and get a warning in the API browser.

package
Kohana/Userguide
category
Undocumented
author
Kohana Team
copyright
(c) Kohana Team
license
https://koseven.ga/LICENSE.md
since
3.0.7


Information

This class is a transparent base class for Kohana_Kodoc_Missing

Constants

  • None

Properties

  • None

Methods

Methods

public static create_class(string $class ) (defined in Kohana_Kodoc_Missing)

Creates classes when they are otherwise not found.

Kodoc::create_class('ThisClassDoesNotExist');

All classes created will extend Kodoc_Missing.

Parameters

  • string $class required - Class name

Tags

  • Since - 3.0.7

Return Values

  • boolean

Source Code

public static function create_class($class)
{
	if ( ! class_exists($class))
	{
		// Create a new missing class
		if (FALSE === strpos($class, '\\'))
		{
			eval("class {$class} extends Kodoc_Missing {}");
		}
		else
		{
			$namespace = explode('\\', $class);
			$class = array_pop($namespace);
			eval("namespace ".implode('\\', $namespace)."; class {$class} extends \Kodoc_Missing {}");
		}
	}

	return TRUE;
}

Do you want to contribute to Koseven?

We need YOUR help!

This project is open source. What does this mean? YOU can help:
  • Found a bug? Report it on Github
  • Need a feature? Add it Here
  • Want to help? Join the Forum
Go to Github