* [Friends] Members can now apply to be added to the contact list.
[pivip.git] / project / library / Pivip / Debug.php
blobf90dc51092e6bee149d51a2f78a56c75184d0b1d
1 <?php
3 /**
4 * Pivip
5 * Copyright (C) 2008 Vincent Tunru
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
20 * @license http://www.fsf.org/licensing/licenses/info/GPLv2.html GPL v.2
21 * @category Pivip
22 * @package Pivip
23 * @copyright (C) 2008 Vincent Tunru
24 * @author Vincent Tunru <email@vincentt.org>
27 /**
28 * Pivip debugging utility class
30 class Pivip_Debug extends Zend_Debug
32 /**
33 * @var string The current setup (i.e. "dev" or "production")
35 protected static $_setup = 'production';
37 /**
38 * Retrieve the current setup
40 * @return string The current setup
42 public static function getSetup()
44 $configuration = new Zend_Config_Ini('data/config/general.ini', 'developers');
45 switch($configuration->setup)
47 case 'dev':
48 // Break intentionally omitted
49 case 'devel':
50 self::$_setup = 'dev';
51 break;
52 case 'live':
53 // Break intentionally omitted
54 case 'production':
55 // Break intentionally omitted
56 default:
57 self::$_setup = 'production';
58 break;
60 return self::$_setup;
63 /**
64 * Find out whether we're currently in a testing environment
66 * @return bool True when in a testing environment
68 public static function isTesting()
70 if('dev' == self::getSetup())
72 return true;
74 return false;