Beispiel #1
0
 /**
  * Xapp_Singleton interface impl.
  *
  * static singleton method to create static instance of driver with optional third parameter
  * xapp options array or object
  *
  * @error 15501
  * @param null|mixed $options expects optional xapp option array or object
  * @return XApp_Commander_Bootstrap
  */
 public static function instance($options = null)
 {
     if (self::$_instance === null) {
         self::$_instance = new self($options);
     }
     return self::$_instance;
 }
Beispiel #2
0
require_once XAPP_BASEDIR . '/Bootstrap.php';
XApp_Bootstrap::loadMin();
XApp_Bootstrap::loadRPC();
xapp_setup_language_standalone();
xapp_import('xapp.Service');
xapp_import('xapp.File.Utils');
xapp_import('xapp.Directory.Utils');
xapp_import('xapp.Directory.Service');
xapp_import('xapp.xide.Directory.Service');
xapp_import('xapp.Path.Utils');
xapp_import('xapp.VFS.Interface.Access');
xapp_import('xapp.VFS.Base');
xapp_import('xapp.VFS.Local');
xapp_import('xapp.Resource.Renderer');
xapp_import('xapp.Xapp.Hook');
xapp_import('xapp.Option.*');
xapp_import("xapp.xide.Models.User");
xapp_import('xapp.xide.Controller.UserManager');
xapp_import('xapp.xide.Controller.UserService');
xapp_import('xapp.xide.Workbench.Service');
xapp_import('xapp.Store.Json.Json');
/***
 * Build bootstrap config for the RPC service
 */
$user = new XApp_User();
$user->setName('A');
$opt = array(XApp_Bootstrap::BASEDIR => XAPP_BASEDIR, XApp_Bootstrap::FLAGS => array(XAPP_BOOTSTRAP_SETUP_XAPP, XAPP_BOOTSTRAP_SETUP_RPC, XAPP_BOOTSTRAP_SETUP_GATEWAY, XAPP_BOOTSTRAP_SETUP_SERVICES), XApp_Bootstrap::RPC_TARGET => $XAPP_SMD_TARGET, XApp_Bootstrap::SIGNED_SERVICE_TYPES => array(), XApp_Bootstrap::GATEWAY_CONF => array(Xapp_Rpc_Gateway::OMIT_ERROR => XApp_Service_Entry_Utils::isDebug()), XApp_Bootstrap::LOGGING_FLAGS => array(), XApp_Bootstrap::LOGGING_CONF => array(Xapp_Log::PATH => $XAPP_LOG_DIRECTORY, Xapp_Log::EXTENSION => 'log', Xapp_Log::NAME => 'xide'), XApp_Bootstrap::XAPP_CONF => array(XAPP_CONF_DEBUG_MODE => null, XAPP_CONF_AUTOLOAD => false, XAPP_CONF_DEV_MODE => XApp_Service_Entry_Utils::isDebug(), XAPP_CONF_HANDLE_BUFFER => true, XAPP_CONF_HANDLE_SHUTDOWN => false, XAPP_CONF_HTTP_GZIP => true, XAPP_CONF_CONSOLE => false, XAPP_CONF_HANDLE_ERROR => true, XAPP_CONF_HANDLE_EXCEPTION => true), XApp_Bootstrap::SERIVCE_CONF => array(XApp_Service::instance('XIDE_Directory_Service', array(XApp_Directory_Service::REPOSITORY_ROOT => $XAPP_WORKSPACE_DIRECTORY, XApp_Directory_Service::FILE_SYSTEM => 'XApp_VFS_Local', XApp_Directory_Service::VFS_CONFIG_PATH => $XAPP_VFS_CONFIG_PATH, XApp_Directory_Service::FILE_SYSTEM_CONF => array(XApp_VFS_Base::ABSOLUTE_VARIABLES => array('WS_ABS_PATH' => $XAPP_WORKSPACE_DIRECTORY), XApp_VFS_Base::RELATIVE_VARIABLES => array()))), XApp_Service::factory('xapp.xide.Workbench.Service', array(XApp_XIDE_Workbench_Service::WORKBENCH_USER => $user, XApp_XIDE_Workbench_Service::WORKBENCH_DIRECTORY => $XAPP_WORKSPACE_DIRECTORY, XApp_XIDE_Workbench_Service::SITE_CONFIG_DIRECTORY => realpath(XAPP_BASEDIR . '/xide/Workbench/siteconfig/'))), XApp_Service::instance('XApp_XIDE_Controller_UserService', array(XApp_Service::MANAGED_CLASS_OPTIONS => array(XApp_UserManager::STORE_CONF => array(XApp_Store_JSON::CONF_FILE => $XAPP_BASE_DIRECTORY . "xide" . DIRECTORY_SEPARATOR . "Data" . DIRECTORY_SEPARATOR . "Users.json"))))));
$xappBootrapper = new XApp_Bootstrap($opt);
$xappBootrapper->init();
//$userService = XApp_XIDE_Controller_UserService::instance();
//$xappBootrapper->run();