Ticket #99 (closed 新機能/拡張: fixed)
任意のコールバックによってランタイム環境を設定するクライアントインタフェース
| Reported by: | iteman | Owned by: | iteman |
|---|---|---|---|
| Priority: | major | Milestone: | 1.5.0 |
| Component: | 01: Piece_Unity | Version: | 1.0 |
| Keywords: | Cc: | ||
| Blocking: | Blocked By: |
Description
任意のコールバックによってランタイム環境を設定するクライアントインタフェースを準備する。下記は使用例である。
htdocs/index.php:
<?php require dirname(__FILE__) . '/../webapp/lib/prepare.php'; $runtime = &Piece_Unity::createRuntime('configureRuntime'); $runtime->setConfiguration('Configurator_Event', 'eventName', 'Static_Index'); $runtime->setExtension('Controller', 'dispatcher', 'Dispatcher_Simple'); $runtime->dispatch(); ?>
web/webapp/lib/prepare.php:
<?php error_reporting(E_ALL); if (file_exists(dirname(__FILE__) . '/../../../imports')) { set_include_path(dirname(__FILE__) . '/../../../imports/pear' . PATH_SEPARATOR . dirname(__FILE__) . '/../../../imports/spyc-0.2.5' ); } require 'Piece/Unity.php'; Piece_Unity_Error::pushCallback(create_function('$error', 'var_dump($error); return ' . PEAR_ERRORSTACK_DIE . ';')); function configureRuntime(&$runtime) { $base = dirname(__FILE__) . '/..'; $runtime->configure("$base/config", "$base/cache"); $runtime->setConfiguration('Configurator_AppRoot', 'appRoot', dirname(__FILE__) . '/../../htdocs'); } ?>
Change History
Note: See
TracTickets for help on using
tickets.

