Ignore:
Timestamp:
04/05/10 15:30:21 (14 years ago)
Author:
pedroerp
Message:

Ticket #993 - Versão inicial da classe 'Settings' e substituicao de chamadas 'read_repository'.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sandbox/workflow/branches/993/inc/common.inc.php

    r2372 r2418  
    1111 
    1212/** 
    13  * Server base path. This constant is somewhat simililar to 
    14  * 'PHPGW_SERVER_ROOT'. Nevertheless, there are cases that we 
    15  * access Workflow directly and it must be defined somewhere. 
    16  * Recently discovered, when we are runnnig jobs HTTP_SERVER_VARS 
    17  * exported by apache are not available. 
    18  * Therefore, we are using this workaround here, setting 
    19  * EGW_SERVER_ROOT based on the location of this file. This constant 
    20  * should be updated properly every time we move this file. 
     13 * This is other big workaround. In ajax calls, we use controller.php 
     14 * directly, which do not includes header.inc for performance issues. 
     15 * However, for phpgwAPI to work properly we need to set several 
     16 * constants and objects, which are created in this file (header.inc). 
     17 * As much as this problem still unsolved (by phpAPI group), this potencially 
     18 * problematic and ugly code must still here.. =( 
     19 */ 
     20$old = $GLOBALS['phpgw_info']['flags']; 
     21$GLOBALS['phpgw_info']['flags'] = array( 
     22        'noheader' => True, 
     23        'nonavbar' => True, 
     24        'currentapp' => 'workflow' 
     25); 
     26/* TODO TODO TODO TODO */ 
     27$base = dirname(dirname(dirname(__FILE__))); 
     28require_once ($base . '/header.inc.php'); 
     29$GLOBALS['phpgw_info']['flags'] = $old; 
     30 
     31 
     32/** 
     33 * Server base path. In this module, we should only use 
     34 * constants defined here. PHPGW_SERVER_ROOT is defined 
     35 * on 'header.inc.php' which is always included by this 
     36 * file. 
    2137 * @name EGW_SERVER_ROOT 
    2238 */ 
    23 define('EGW_SERVER_ROOT', dirname(dirname(dirname(__FILE__)))); 
    24 //define('EGW_SERVER_ROOT', $GLOBALS['HTTP_SERVER_VARS']['DOCUMENT_ROOT']); 
     39define('EGW_SERVER_ROOT', PHPGW_SERVER_ROOT); 
    2540 
    2641/** 
     
    5166 
    5267 
    53 if (file_exists(EGW_SERVER_ROOT . '/header.session.inc.php')) { 
    54         require_once EGW_SERVER_ROOT . '/header.session.inc.php'; 
    55 } 
    56  
    5768 
    5869/* assure that the correct encondig will be used (e.g string functions) */ 
     
    7081require_once WF_LIB_ROOT . 'factory/WorkflowFactory.php'; 
    7182require_once WF_LIB_ROOT . 'factory/ProcessFactory.php'; 
     83require_once WF_LIB_ROOT . 'settings/Settings.php'; 
     84 
     85Settings::load(); 
    7286 
    7387$GLOBALS['workflow']['workflowObjects'] = Factory::getInstance('WorkflowObjects'); 
Note: See TracChangeset for help on using the changeset viewer.