root/trunk/wifidog-auth/wifidog/classes/Dependencies.php @ 753

Revision 753, 2.1 KB (checked in by fproulx, 8 years ago)

2005-09-13 Francois Proulx <francois.proulx@…>

  • Added access permissions for statistics.
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
RevLine 
[734]1<?php
[747]2
3
[734]4/********************************************************************\
5 * This program is free software; you can redistribute it and/or    *
6 * modify it under the terms of the GNU General Public License as   *
7 * published by the Free Software Foundation; either version 2 of   *
8 * the License, or (at your option) any later version.              *
9 *                                                                  *
10 * This program is distributed in the hope that it will be useful,  *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
13 * GNU General Public License for more details.                     *
14 *                                                                  *
15 * You should have received a copy of the GNU General Public License*
16 * along with this program; if not, contact:                        *
17 *                                                                  *
18 * Free Software Foundation           Voice:  +1-617-542-5942       *
19 * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652       *
20 * Boston, MA  02111-1307,  USA       gnu@gnu.org                   *
21 *                                                                  *
22 \********************************************************************/
23/**@file Dependencies.php
24 * @author Copyright (C) 2005 Philippe April <philippe@ilesansfil.org>
25 */
26
27class Dependencies
28{
[747]29        static public function check($component, & $errmsg)
30        {
[750]31                $components = array();
32                $components["ImageGraph"] = array ("name" => "PEAR::Image_Graph", "file" => "Image/Graph.php");
33                $components["Phlickr"] = array ("name" => "PEAR::Phlickr", "file" => "Phlickr/Api.php");
[751]34               
[747]35                if (isset ($components[$component]))
36                {
37                        $component_info = $components[$component];
[753]38                        if(@include_once($component_info["file"]))
39                                return true;
40                        else
41                        {
42                                // Otherwise, the requirement is not met
43                                $errmsg = $component_info["name"]._(" is not installed");
44                                return false;
45                        }
[747]46                }
47                else
48                        throw new Exception("Component not found");
49        }
[734]50
51} // End class
[745]52?>
Note: See TracBrowser for help on using the browser.