source: sandbox/workflow/branches/993/inc/common.inc.php @ 2418

Revision 2418, 2.9 KB checked in by pedroerp, 14 years ago (diff)

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

RevLine 
[795]1<?php
[2372]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\**************************************************************************/
[1468]11
[2372]12/**
[2418]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.
[2372]37 * @name EGW_SERVER_ROOT
[795]38 */
[2418]39define('EGW_SERVER_ROOT', PHPGW_SERVER_ROOT);
[795]40
[2372]41/**
42 * Server include base path. We must define our own constants
43 * because there are several cases in which workflow is called
44 * directly, thus PHPGW constants are not defined.
45 * @name EGW_INC_ROOT
46 */
47define('EGW_INC_ROOT', EGW_SERVER_ROOT . '/phpgwapi/inc/');
[795]48
[2372]49/**
50 * Workflow base path.
51 * @name WF_SERVER_ROOT
52 */
53define('WF_SERVER_ROOT', EGW_SERVER_ROOT.'/workflow/');
[795]54
55/**
[2372]56 * Workflow include path.
57 * @name WF_INC_ROOT
[795]58 */
[2372]59define('WF_INC_ROOT', WF_SERVER_ROOT.'/inc/');
[795]60
61/**
[2372]62 * Workflow lib base dir.
63 * @name WF_LIB_ROOT
[795]64 */
[2372]65define('WF_LIB_ROOT', WF_SERVER_ROOT.'/lib/');
66
67
68
69/* assure that the correct encondig will be used (e.g string functions) */
70setlocale(LC_CTYPE, 'pt_BR', 'pt_BR.iso-8859-1', 'pt_BR.utf-8');
71
72
73/* define o umask para a criação de arquivos por parte do Workflow */
74umask(007);
75
76
77/* including common classes */
78require_once WF_LIB_ROOT . 'security/Security.php';
79require_once WF_LIB_ROOT . 'factory/Factory.php';
80require_once WF_LIB_ROOT . 'factory/BaseFactory.php';
81require_once WF_LIB_ROOT . 'factory/WorkflowFactory.php';
82require_once WF_LIB_ROOT . 'factory/ProcessFactory.php';
[2418]83require_once WF_LIB_ROOT . 'settings/Settings.php';
[2372]84
[2418]85Settings::load();
86
[2372]87$GLOBALS['workflow']['workflowObjects'] = Factory::getInstance('WorkflowObjects');
[795]88?>
Note: See TracBrowser for help on using the repository browser.