This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
khosb/includes/kohana/modules/userguide/classes/Kohana/Kodoc/Missing.php

37 lines
917 B
PHP
Raw Normal View History

2010-08-21 04:43:03 +00:00
<?php defined('SYSPATH') or die('No direct script access.');
/**
2011-05-13 06:00:25 +00:00
* 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.
2010-08-21 04:43:03 +00:00
*
* @package Kohana/Userguide
* @category Undocumented
* @author Kohana Team
* @since 3.0.7
*/
abstract class Kohana_Kodoc_Missing {
/**
* Creates classes when they are otherwise not found.
*
* Kodoc::create_class('ThisClassDoesNotExist');
*
* [!!] All classes created will extend [Kodoc_Missing].
*
* @param string class name
* @return boolean
* @since 3.0.7
*/
public static function create_class($class)
{
if ( ! class_exists($class))
{
// Create a new missing class
eval("class {$class} extends Kodoc_Missing {}");
}
return TRUE;
}
} // End Kohana_Kodoc_Missing