[ Index ]
 

Code source de Horde 3.1.3

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/Horde/Text/Filter/ -> environment.php (source)

   1  <?php
   2  /**
   3   * Replaces occurences of %VAR% with VAR, if VAR exists in the webserver's
   4   * environment.  Ignores all text after a '#' character (shell-style
   5   * comments).
   6   *
   7   * $Horde: framework/Text_Filter/Filter/environment.php,v 1.3.10.4 2006/01/01 21:28:38 jan Exp $
   8   *
   9   * Copyright 2004-2006 Jan Schneider <jan@horde.org>
  10   *
  11   * See the enclosed file COPYING for license information (LGPL). If you did
  12   * not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
  13   *
  14   * @author  Jan Schneider <jan@horde.org>
  15   * @since   Horde 3.0
  16   * @package Horde_Text
  17   */
  18  class Text_Filter_environment extends Text_Filter {
  19  
  20      /**
  21       * Returns a hash with replace patterns.
  22       *
  23       * @return array  Patterns hash.
  24       */
  25      function getPatterns()
  26      {
  27          $regexp = array('/^#.*$\n/m' => '',
  28                          '/^([^#]*)#.*$/m' => '$1',
  29                          '/%([A-Za-z_]+)%/e' => 'getenv("$1")');
  30          return array('regexp' => $regexp);
  31      }
  32  
  33  }


Généré le : Sun Feb 25 18:01:28 2007 par Balluche grâce à PHPXref 0.7