Пример #1
0
 function init()
 {
     parent::init();
     require_once 'fw/handler/form.class.php';
     require_once 'fw/handler/resource.class.php';
     $this->registerHandler(self::WHEN_BEFORE_RUN, array($this, 'form'));
     $this->registerHandler(self::WHEN_BEFORE_RUN, array($this, 'resource'));
     $this->registerHandler(self::WHEN_BEFORE_APP_RUN, array($this, 'app_start'));
     $this->registerHandler(self::WHEN_AFTER_APP_RUN, array($this, 'app_end'));
 }
Пример #2
0
 /**
  * @param NyaaStore Configuration
  */
 function __construct($Conf)
 {
     $this->info = array();
     $this->appdir = $Conf->get('app.dir');
     $this->tpldir = $Conf->get('template.dir');
     $this->pkgdir = $Conf->get('package.dir');
     $this->rootdir = $Conf->get('root.dir');
     foreach ($Conf->get('app.dir', 'template.dir') as $dir) {
         if (!is_dir($dir)) {
             mkdir($dir);
             chmod($dir, 0777);
         }
     }
     parent::__construct();
 }
Пример #3
0
<?php

/**
 * kamunagara
 */
require_once 'header.php';
require_once 'fw/fw.class.php';
$rootdir = ROOT . '/site';
$file = ROOT . '/site/root.conf';
$installer = NyaaFW::factory($file, array('fw.type' => "installer", 'fw.appmap' => 'default', 'root.dir' => $rootdir, 'package.dir' => ROOT . '/package'));
//$installer->disable('system');
//$installer->enable('system');
//$installer->update('system');
//$installer->run( );
$install = array('system', 'user');
foreach ($install as $package) {
    $installer->install($package);
}
$installer->save();
foreach ($_NYAA_LOG as $log) {
    echo '<li>' . $log . '</li>';
}
Пример #4
0
<?php

/**
 * kamunagara
 */
require_once 'header.php';
require_once 'fw/fw.class.php';
$rootdir = ROOT . '/site';
$file = ROOT . '/site/root.conf';
$handler = NyaaFW::factory($file, array('fw.type' => "web", 'fw.appmap' => 'default', 'root.dir' => $rootdir));
$handler->setSession($_SESSION);
$handler->setCookie($_COOKIE);
$handler->setRequest(isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : '', $_POST, $_GET);
$handler->init();
$handler->run();
foreach ($_NYAA_LOG as $log) {
    echo '<li>' . $log . '</li>';
}