Exemple #1
0
 public function handleRequest($p)
 {
     Zinc::loadLib('migration');
     $methodName = "handle" . $p[1];
     // var_dump($methodName);
     // die();
     if (method_exists($this, $methodName)) {
         $this->{$methodName}($p);
     } else {
         trigger_error("invalid command\n\n");
     }
 }
Exemple #2
0
 static function getConnection($params, $name)
 {
     if (isset(self::$modules[$params['driver']])) {
         Zinc::loadLib(self::$modules[$params['driver']]);
     }
     if (!isset(self::$classMap[$params['driver']])) {
         trigger_error("unknown driver type: " . $params['driver']);
     } else {
         $className = self::$classMap[$params['driver']];
     }
     return new $className($params, $name);
 }
Exemple #3
0
 public function init()
 {
     Zinc::loadLib('zone');
     Zinc::loadLib('db');
     //if(php_sapi_name() != "cli")
     //	Zinc::loadLib('session');
     Zinc::loadLib('form');
     Zinc::loadLib('mail');
     //	register classess
     Zinc::reg('AppZone', 'domain');
     Zinc::reg('AppGui', 'domain');
     Zinc::reg('Person', 'domain');
     Zinc::reg('Token', 'domain');
     //	register zones
     Zinc::reg('ZoneUser', 'zones');
 }
Exemple #4
0
<?php

include 'const.php';
include '[[$zincDir]]/Zinc.php';
Zinc::loadLib('app');
Zinc::loadLib('zone');
$i = new ApplicationInstance();
Exemple #5
0
<?php

// include('config.php');
define('app_dir', __DIR__);
include dirname(dirname(__DIR__)) . '/framework/Zinc.php';
Zinc::loadLib('app');
Zinc::loadLib('db');
$map = SqlFetchSimpleMap('select * from test', 'one', 'two', array());
echo_r($map);
$rows = SqlFetchRows('select * from test', array());
echo_r($rows);
Exemple #6
0
    public static function reg($className, $dirPath = null)
    {
        if ($dirPath) {
            if ($dirPath[0] == '/') {
                $fullPath = "{$dirPath}/{$className}.php";
            } else {
                $fullPath = app_dir . "/{$dirPath}/{$className}.php";
            }
        } else {
            $fullPath = app_dir . "/{$className}.php";
        }
        self::registerClass($className, $fullPath);
    }
    /**
     * Register a "domain" class for autoload (a domain class is a
     * class that is located in the "domains" directory under
     * the project root with the filename <classname>.php)
     *
     * @param unknown_type $className
     */
    public static function registerDomain($className)
    {
        self::registerClass($className, app_dir . '/domain/' . $className . '.php');
    }
}
Zinc::registerLib('boot');
Zinc::registerLib('core');
Zinc::registerLib('experimental');
Zinc::registerLib('vendor');
Zinc::loadLib('boot');
Exemple #7
0
 public function handleDomain($p)
 {
     Zinc::loadLib('utils');
     // print_r($p);
     // die();
     $name = $p[3];
     $stationaryFilename = 'domain.tpl';
     $stationaryFilename = app_dir . "/stationary/{$stationaryFilename}";
     if (!file_exists($stationaryFilename)) {
         echo "stationary file at {$stationaryFilename} does not exist\n";
         return;
     }
     $params = array();
     $params['className'] = $name;
     $dir = app_dir . '/domain';
     $newFilename = $dir . '/' . $name . '.php';
     if (file_exists($newFilename)) {
         echo "file at {$newFilename} already exists\n";
         return;
     }
     self::gen($stationaryFilename, $newFilename, $params);
 }