AppServer.object
上传用户:xiao730204
上传日期:2007-01-04
资源大小:141k
文件大小:1k
- <?php
- class AppServer extends BaseObject {
- var $apps;
- var $default_app;
- Function AppServer() {
- $this->BaseObject( 'AppServer' );
- $this->default_app = '';
- $this->apps = Array();
- }
- Function Open() {}
- Function Close() {}
- Function AppRegister( $my_app ) {
- if ( is_object( $my_app ) ) {
- $this->apps[ $my_app->app_name ] = $my_app;
- }
- }
- Function Handle( $my_var = '' ) {
- $app_name = '';
- $obj_ref = '';
- $mode = '';
- $stuff = explode( '_', $my_var );
- $app_name = $stuff[ 0 ];
- for( $i = 1; $i < count( $stuff ); $i++ ) {
- if ( $mode != '' ) { $mode .= '_'; }
- $mode .= $stuff[ $i ] ;
- }
- $obj_ref = $this->apps[ $app_name ];
- if ( ! is_object( $obj_ref ) ) {
- if ( $this->default_app != '' ) {
- $obj_ref = $this->apps[ $this->default_app ];
- if ( ! is_object( $obj_ref ) ) {
- return 0;
- }
- } else {
- return 0;
- }
- }
- return $obj_ref->Handle( $mode );
- }
- }
- ?>