예제 #1
0
/**
 * Returns the main instance of vscript to prevent the need to use globals.
 *
 * @since  1.0.0
 * @return object vscript
 */
function vscript()
{
    $instance = vscript::instance(__FILE__, '1.0.0');
    if (is_null($instance->settings)) {
        $instance->settings = vscript_Settings::instance($instance);
    }
    return $instance;
}
 /**
  * Main vscript_Settings Instance
  *
  * Ensures only one instance of vscript_Settings is loaded or can be loaded.
  *
  * @since 1.0.0
  * @static
  * @see vscript()
  * @return Main vscript_Settings instance
  */
 public static function instance($parent)
 {
     if (is_null(self::$_instance)) {
         self::$_instance = new self($parent);
     }
     return self::$_instance;
 }