ProxyDetector
[ class tree: ProxyDetector ] [ index: ProxyDetector ] [ all elements ]

Source for file config.php

Documentation is available at config.php

  1. <?php
  2.  
  3. /**
  4.  * ProxyDetector v1.0
  5.  * Copyright (c) 2008, Atikae (Hugo Busiere) <atikae@gmail.com>
  6.  * All rights reserved.
  7.  * See COPYING file for more informations
  8.  * 
  9.  * Main class of ProxyDetector.
  10.  * 
  11.  * @author Atikae (Hugo Busiere) <atikae@gmail.com>
  12.  * @version 1.0
  13.  * @licence COPYING BSD licence
  14.  * @package ProxyDetector
  15.  */
  16.  
  17. /**
  18.  * This is the config class of ProxyDetector Project.
  19.  * All config options MUST set here
  20.  * @package ProxyDetector
  21.  * @subpackage config
  22.  */
  23. class Config {
  24.     
  25.     /**
  26.      * Using Tor Check ?
  27.      * 
  28.      * If false, think change {@link $errorFile} for don't display
  29.      * "Use Tor" field
  30.      * @access protected
  31.      * @var boolean 
  32.      */
  33.     var $useTor = true;
  34.     
  35.     /**
  36.      * URI of TORdnsel server
  37.      * 
  38.      * (Don't touch if you don't know what does it mean)
  39.      * @access protected
  40.      * @var string 
  41.      */
  42.     var $torNodeAddr = 'ip-port.exitlist.torproject.org';
  43.     
  44.     /**
  45.      * Optional HTTP Headers you want to check
  46.      * 
  47.      * (Don't touch if you don't know what does it mean)
  48.      * @access protected
  49.      * @var array 
  50.      */
  51.     var $headers = array();
  52.     
  53.      /**
  54.      * Non-default session_name
  55.      * 
  56.      * (Don't uncomment if you don't know what does it mean)
  57.      * @access protected
  58.      * @var string 
  59.      */
  60.     //var $session_name = '';
  61.     
  62.     /**
  63.      * Error file without -{LANGUAGE} extension_loaded
  64.      * 
  65.      * Example : if fileName is proxy.html-en, just set proxy.html
  66.      * 
  67.      * 
  68.      * File MAY be html and MUST implement {HEADERS_HERE} for headers
  69.      * detected and can (if {@link $useTor} is true) {TOR_HERE 
  70.      * for tor checking
  71.      * 
  72.      * @access protected
  73.      * @var string 
  74.      */
  75.     var $errorFile = 'proxy-with-tor.html';
  76.  
  77.     /**
  78.      * If you change {@link $errorFile} or {@link $language},
  79.      * don't forget clean cookie for refresh PHP_SESSION
  80.      */
  81.     
  82.      /**
  83.      * Language, needed for {@link $errorFile} personnification
  84.      * 
  85.      * FileName pattern : {@link $errorFile}-{@link $language}
  86.      * 
  87.      * 
  88.      * Defaut value : en, fr
  89.      * @access protected
  90.      * @var string 
  91.      */
  92.     var $language = 'en';
  93.     
  94.     /**
  95.      * All strings for translations
  96.      * @access protected
  97.      * @var array 
  98.      */
  99.     var $strings = array('en' => array('none' => 'None''yes' => 'Yes''no' => 'No'),
  100.                          'fr' => array('none' => 'Aucun''yes' => 'Oui''no' => 'Non')
  101.                         );
  102.     
  103.     /**
  104.      * Get conf or if not set or empty, return $default parameter
  105.      * @param string $name Config variable name
  106.      * @param string $default Default string return if config variable doesn't exist or is empty
  107.      * @return string Default or Attribut value
  108.      */
  109.     function getConf($name$default{
  110.         $attributs get_class_vars('Config');
  111.         if (!array_key_exists($name$attributs|| empty($attributs[$name]))
  112.             return $default;
  113.         else
  114.             return $attributs[$name];
  115.     }
  116. }
  117.  
  118. ?>

Documentation generated on Tue, 26 Aug 2008 18:42:00 +0200 by phpDocumentor 1.4.1