phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] api/starter.inc.php, 1.1.1.1.2.35


From: nomail
Subject: [Phpgroupware-cvs] api/starter.inc.php, 1.1.1.1.2.35
Date: Tue, 22 Jun 2004 16:15:46 +0200

Update of /api
Modified Files:
        Branch: proposal-branch
          starter.inc.php

date: 2004/06/22 14:15:46;  author: dcech;  state: Exp;  lines: +33 -27

Log Message:
new input parser for xmlrpc interface
moved some environment initialisation stuff from core_functions.inc.php into 
starter.inc.php
moved interface check code into class.interface.php
=====================================================================
Index: api/starter.inc.php
diff -u api/starter.inc.php:1.1.1.1.2.34 api/starter.inc.php:1.1.1.1.2.35
--- api/starter.inc.php:1.1.1.1.2.34    Sat May  8 01:15:00 2004
+++ api/starter.inc.php Tue Jun 22 14:15:46 2004
@@ -42,14 +42,12 @@
                exit;
        }
 
-       
/****************************************************************************\
-       * Make sure we have a valid client type                                 
     *
-       
\****************************************************************************/
-       if(!isset($GLOBALS['phpgw_interface']) || 
!preg_match("/^(browser|xmlrpc|soap)$/i", $GLOBALS['phpgw_interface'] ))
+       if ($_GET['showinfo'] == '1')
        {
-               $GLOBALS['phpgw_interface'] = 'browser';
+               phpinfo();
+               exit;
        }
-       
+
        
/****************************************************************************\
        * Load up the initial base environment                                  
     *
        
\****************************************************************************/
@@ -69,30 +67,36 @@
                exit;
        }
        include_once(PHPGW_API.SEP.'core_functions.inc.php');
-       // load workarounds for old php versions
-       include_once(PHPGW_API.SEP.'workaround.inc.php');
-       include_once(PHPGW_API.SEP.'class.xmltool.php');
-
+       
+       /* Will use phpgw_exit to handle things */
+       register_shutdown_function('phpgw_exit');
+       
+       /* Now start catching all output. */
+       ob_start('phpgw_checkoutput');
+       
+       $GLOBALS['performance_timer'] = new performance_timer();
+       $GLOBALS['performance_timer']->start('phpgw');
+       
        /* Clean up magic quotes */
        fix_magic_quotes();
-
+       
+       // load workarounds for old php versions
+       include_once(PHPGW_API.SEP.'workaround.inc.php');
+       
        
/****************************************************************************\
        * If request is for XSLT then we want to fasttrack the request          
     *
        * for performance reasons.                                              
     *
        
\****************************************************************************/
 
-       if ($_GET['showinfo'] == '1')
-       {
-               phpinfo();
-               exit;
-       }
-
        if ($_GET['op'] == 'api.xslt.get')
        {
                execMethod('api.xslt.get', $_GET);
                exit;
        }
        
+       /* load xmltool */
+       include_once(PHPGW_API.SEP.'class.xmltool.php');
+       
        
/****************************************************************************\
        * START - Read and check config file                                    
     *
        
\****************************************************************************/
@@ -223,7 +227,7 @@
        
\**************************************************************************/
        $inputs = $GLOBALS['phpgw']->interface->get_inputs();
        unset($inputs['phpgw_data'], $inputs['serialized_classes']);
-
+       
        
/**************************************************************************\
        * Attempt to load and execute the operation requested                   
   *
        
\**************************************************************************/
@@ -278,7 +282,7 @@
        {
                if ($GLOBALS['force_setup'] || 
$GLOBALS['phpgw']->acl->check($methodname, 1))
                {
-                       $GLOBALS['performance_timer']->start($methodname);      
        
+                       $GLOBALS['performance_timer']->start($methodname);
                        // FIXME: This explode happens FAR too much, this 
should ONLY happen *1* time and everything
                        // Should access those variables instead.  Maybe make 
it a constant for extra security. (jengo)
                        list($a,$c,$m) = explode('.',$methodname);
@@ -293,9 +297,11 @@
                                $GLOBALS['msgbox']->add('Attempted access for a 
protected method: ' . $methodname, 'fatal');
                                
$GLOBALS['phpgw']->interface->handle_result($result);
                        }
-                       ob_start();     
+                       
+                       ob_start();
+                       
                        $result = execMethod($methodname,$inputs);
-       
+                       
                        if($result == '##NOMETHOD##')
                        {
                                if (isset($_SESSION['phpgw_session']['prevop']))
@@ -307,15 +313,15 @@
                                        /* Otherwise then we try and keep the 
user in the app and class they requested */
                                        $methodname = 
$GLOBALS['phpgw_data']['flags']['req_app'].'.'.$GLOBALS['phpgw_data']['flags']['req_class'].'.start';
     
                                }
-       
+                               
                                $result = execMethod($methodname,$inputs, true);
-       
+                               
                                /* If the method still doesnt exist, then we 
try and keep the user in the app they requested */
                                if ($result == '##NOMETHOD##')
                                {
                                        $methodname = 
$GLOBALS['phpgw_data']['flags']['req_app'].'.base.start'; 
                                        $result     = 
execMethod($methodname,$inputs, true);
-       
+                                       
                                        if ($result == '##NOMETHOD##')
                                        {
                                                /* If the method still doesnt 
exist, then just make sure result is empty */
@@ -323,15 +329,15 @@
                                        }
                                }
                        }
+                       
                        $outputtrap = ob_get_contents();
                        if(!empty($outputtrap))
                        {
                                define('MISBEHAVEDAPP',true);
                                
$GLOBALS['phpgw_xmldoc']->add_node($outputtrap,'APPHTML');
                                $_GET['fxsl'] = 2;
-                               ob_clean();
                        }
-                       ob_end_flush();
+                       ob_end_clean();
                        
                        $GLOBALS['performance_timer']->stop($methodname);
                }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]