Ignore:
Timestamp:
03/29/10 14:46:01 (14 years ago)
Author:
pedroerp
Message:

Ticket #609 - Merged 2197:2356 /sandbox/workflow/branches/609/ em /sandbox/workflow/trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sandbox/workflow/trunk/inc/common.inc.php

    r1484 r2372  
    11<?php 
    2 if (file_exists(dirname(__FILE__) . '/../../header.session.inc.php')) { 
    3         require_once dirname(__FILE__) . '/../../header.session.inc.php'; 
     2/**************************************************************************\ 
     3* eGroupWare                                                               * 
     4* http://www.egroupware.org                                                * 
     5* --------------------------------------------                             * 
     6*  This program is free software; you can redistribute it and/or modify it * 
     7*  under the terms of the GNU General Public License as published by the   * 
     8*  Free Software Foundation; either version 2 of the License, or (at your  * 
     9*  option) any later version.                                              * 
     10\**************************************************************************/ 
     11 
     12/** 
     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. 
     21 * @name EGW_SERVER_ROOT 
     22 */ 
     23define('EGW_SERVER_ROOT', dirname(dirname(dirname(__FILE__)))); 
     24//define('EGW_SERVER_ROOT', $GLOBALS['HTTP_SERVER_VARS']['DOCUMENT_ROOT']); 
     25 
     26/** 
     27 * Server include base path. We must define our own constants 
     28 * because there are several cases in which workflow is called 
     29 * directly, thus PHPGW constants are not defined. 
     30 * @name EGW_INC_ROOT 
     31 */ 
     32define('EGW_INC_ROOT', EGW_SERVER_ROOT . '/phpgwapi/inc/'); 
     33 
     34/** 
     35 * Workflow base path. 
     36 * @name WF_SERVER_ROOT 
     37 */ 
     38define('WF_SERVER_ROOT', EGW_SERVER_ROOT.'/workflow/'); 
     39 
     40/** 
     41 * Workflow include path. 
     42 * @name WF_INC_ROOT 
     43 */ 
     44define('WF_INC_ROOT', WF_SERVER_ROOT.'/inc/'); 
     45 
     46/** 
     47 * Workflow lib base dir. 
     48 * @name WF_LIB_ROOT 
     49 */ 
     50define('WF_LIB_ROOT', WF_SERVER_ROOT.'/lib/'); 
     51 
     52 
     53if (file_exists(EGW_SERVER_ROOT . '/header.session.inc.php')) { 
     54        require_once EGW_SERVER_ROOT . '/header.session.inc.php'; 
    455} 
    556 
    6 /* garante que durante a execução de funções que modificam strings, os 
    7  * caracteres acentuados sejam tratados corretamente (e.g. strtoupper) 
    8  */ 
     57 
     58/* assure that the correct encondig will be used (e.g string functions) */ 
    959setlocale(LC_CTYPE, 'pt_BR', 'pt_BR.iso-8859-1', 'pt_BR.utf-8'); 
     60 
    1061 
    1162/* define o umask para a criação de arquivos por parte do Workflow */ 
    1263umask(007); 
    1364 
    14 require_once dirname(__FILE__) . '/class.factory.inc.php'; 
    1565 
    16 /** 
    17  * Objeto que implementa uma Factory 
    18  * @global object $GLOBALS['workflow']['factory'] 
    19  * @name $factory 
    20  */ 
    21 $GLOBALS['workflow']['factory'] = new Factory(); 
     66/* including common classes */ 
     67require_once WF_LIB_ROOT . 'security/Security.php'; 
     68require_once WF_LIB_ROOT . 'factory/Factory.php'; 
     69require_once WF_LIB_ROOT . 'factory/BaseFactory.php'; 
     70require_once WF_LIB_ROOT . 'factory/WorkflowFactory.php'; 
     71require_once WF_LIB_ROOT . 'factory/ProcessFactory.php'; 
    2272 
    23 /** 
    24  * Objeto que cria objetos voltados exclusivamente para o módulo Workflow 
    25  * @global object $GLOBALS['workflow']['workflowObjects'] 
    26  * @name $workflowObjects 
    27  */ 
    28 $GLOBALS['workflow']['workflowObjects'] = $GLOBALS['workflow']['factory']->newInstance('WorkflowObjects'); 
     73$GLOBALS['workflow']['workflowObjects'] = Factory::getInstance('WorkflowObjects'); 
    2974?> 
Note: See TracChangeset for help on using the changeset viewer.