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

Source for file Interface.php

Documentation is available at Interface.php

  1. <?php
  2. /**
  3.  * MediaSearch
  4.  *
  5.  * LICENSE
  6.  *
  7.  * "THE BEER-WARE LICENSE" (Revision 42):
  8.  * "Sven Strittmatter" <ausserirdisch@sven-space.de> wrote this file.
  9.  * As long as you retain this notice you can do whatever you want with
  10.  * this stuff. If we meet some day, and you think this stuff is worth it,
  11.  * you can buy me a beer in return.
  12.  *
  13.  * $Author$
  14.  * $Revision$
  15.  *
  16.  * @category    MediaSearch
  17.  * @package     MediaSearch_Config
  18.  * @copyright   Copyright (c) 2009 Sven Strittmatter
  19.  */
  20.  
  21.  /**
  22.   * @todo Write apidoc.
  23.   *
  24.   * @category   MediaSearch
  25.   * @package    MediaSearch_Config
  26.   * @copyright  Copyright (c) 2009 Sven Strittmatter
  27.   */
  28.     /**
  29.      * Specifies the file extions for text configurations.
  30.      */
  31.     const TYPE_TEXT 'txt';
  32.     /**
  33.      * Specifies the file extions for php configurations.
  34.      */
  35.     const TYPE_PHP  'php';
  36.     /**
  37.      * Specifies the file extions for json configurations.
  38.      */
  39.     const TYPE_JSON 'json';
  40.     /**
  41.      * Specifies the file extions for sql configurations.
  42.      */
  43.     const TYPE_SQL  'sql';
  44.  
  45.     /**
  46.      * Returns the string from the loaded config file.
  47.      *
  48.      * @access public
  49.      */
  50.     public function getRawData();
  51.     /**
  52.      * Parses the config string. Depending on the config type.
  53.      *
  54.      * @access public
  55.      */
  56.     public function parseData();
  57.     /**
  58.      * Expects the full filepath to the config file you want to load.
  59.      *
  60.      * @access public
  61.      * @param string $fileName 
  62.      */
  63.     public function setFileName($fileName);
  64.     /**
  65.      * Returns the file name of the config file.
  66.      *
  67.      * @access public
  68.      */
  69.     public function getFileName();
  70.     /**
  71.      * With this method you can add some parse options. These are objects
  72.      * which impplements MediaSearch_Config_ParseOptions_Interface. With
  73.      * this oarse options you can implement things like: You have a text file
  74.      * config and you want to load each line of the file as config value. To
  75.      * achieve this you can implement a parse option which explodes the given
  76.      * string by line break character.
  77.      *
  78.      * Parse options are called in the order you addded them. The first parse
  79.      * object receives the origin config string as input to process. The following
  80.      * parse options get the return value of the previous parse option.
  81.      *
  82.      * @access public
  83.      * @param MediaSearch_Config_ParseOptions_Interface $option 
  84.      */
  85.     public function addParseOption(MediaSearch_Config_ParseOptions_Interface $option);
  86.     /**
  87.      * Removes all parse options.
  88.      *
  89.      * @access public
  90.      */
  91.     public function removeParseOptions();
  92.     /**
  93.      * Returns if the config file has parse options added.
  94.      *
  95.      * @access public
  96.      * @return bool 
  97.      */
  98.     public function hasParseOptions();
  99.     /**
  100.      * Returns a config value from the loaded and parsed configuration by its
  101.      * index. The index could be a string or integer. Thats depending on the
  102.      * implemention of the config file types and your parse options.
  103.      *
  104.      * @access public
  105.      * @param  string $name Default is null.
  106.      * @return mixed 
  107.      */
  108.     public function get($name null);
  109. }

Documentation generated on Mon, 17 Aug 2009 14:53:13 +0200 by phpDocumentor 1.4.2