예제 #1
0
 public static function getInstance()
 {
     if (!isset(self::$instance)) {
         self::$instance = new self();
     }
     return self::$instance;
 }
예제 #2
0
 private function setBeanFromShell()
 {
     if (knl_lib_ShellArgs::getInstance()->isSetShellArgs()) {
         $this->bean->setApp(knl_lib_Registry::getShellArg(1));
         $this->bean->setController(knl_lib_Registry::getShellArg(2));
     }
 }
예제 #3
0
파일: Index.php 프로젝트: nilzao/cmspwiki
 private function setBeanFromShell()
 {
     if (knl_lib_ShellArgs::getInstance()->isSetShellArgs()) {
         $this->bean->setVarSample(knl_lib_Registry::getShellArg(3));
     }
 }
예제 #4
0
 /**
  * 
  * Return value from $argv shell
  * @param int $argnum
  */
 public static function getShellArg($argnum)
 {
     $shell = knl_lib_ShellArgs::getInstance();
     return $shell->getShellArg($argnum);
 }
예제 #5
0
파일: index.php 프로젝트: nilzao/cmspwiki
<?php

error_reporting(E_ALL | E_STRICT);
function __autoloadKnl($className)
{
    if (substr($className, 0, 4) == 'knl_') {
        $location = 'knl/' . str_replace("_", "/", substr($className, 4)) . ".php";
        if (file_exists($location)) {
            require_once $location;
        } else {
            throw new Exception("Class {$className} not found");
        }
    }
    if (substr($className, 0, 4) == 'app_') {
        $location = 'app/' . str_replace("_", "/", substr($className, 4)) . ".php";
        if (file_exists($location)) {
            require_once $location;
        } else {
            throw new Exception("Class {$className} not found");
        }
    }
}
spl_autoload_register('__autoloadKnl');
$path = './libext/adodb5' . PATH_SEPARATOR . "./libext/phpmailer" . PATH_SEPARATOR . "./libext/snoopy";
set_include_path(get_include_path() . PATH_SEPARATOR . $path);
header('Content-type: text/html; charset=utf-8');
//date_default_timezone_set(knl_lib_Config::getInstance()->getTimezone());
require_once "adodb.inc.php";
$shell = isset($argv) ? $argv : array();
knl_lib_ShellArgs::getInstance()->setShellArgs($shell);
knl_controller_FrontController::dispatch();
예제 #6
0
파일: Registry.php 프로젝트: nilzao/EcmFlow
 public static function getShellArgs()
 {
     $shell = knl_lib_ShellArgs::getInstance();
     return $shell;
 }