home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / xampp-win32-1.6.7-installer.exe / php / PEAR / System / SharedMemory / Common.php < prev    next >
Encoding:
PHP Script  |  2008-07-02  |  2.4 KB  |  95 lines

  1. <?php
  2. /* vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4: */
  3. /**
  4. *
  5. * Contains the System_SharedMemory_Common base class
  6. *
  7. * PHP versions 4 and 5
  8. *
  9. * LICENSE: This source file is subject to version 3.0 of the PHP license
  10. * that is available through the world-wide-web at the following URI:
  11. * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
  12. * the PHP License and are unable to obtain it through the web, please
  13. * send a note to license@php.net so we can mail you a copy immediately.
  14. *
  15. * @category   System
  16. * @package    System_Sharedmemory
  17. * @author     Evgeny Stepanischev <bolk@lixil.ru>
  18. * @copyright  2005 Evgeny Stepanischev
  19. * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
  20. * @version    CVS: $Id:$
  21. * @link       http://pear.php.net/package/System_SharedMemory
  22. */
  23.  
  24. /**
  25. *
  26. * System_SharedMemory_Common is the base class from which each database driver class extends
  27. *
  28. * @category   System
  29. * @package    System_Sharedmemory
  30. * @package    System_Sharedmemory
  31. * @author     Evgeny Stepanischev <bolk@lixil.ru>
  32. * @copyright  2005 Evgeny Stepanischev
  33. * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
  34. * @version    CVS: $Id:$
  35. * @link       http://pear.php.net/package/System_SharedMemory
  36. */
  37.  
  38. // {{{ class System_SharedMemory_Common
  39.  
  40. class System_SharedMemory_Common
  41. {
  42.     // {{{ isConnected()
  43.  
  44.    /**
  45.     * returns true if plugin was 
  46.     * successfully connected to backend
  47.     *
  48.     * @return bool true if connected
  49.     * @access public
  50.     */
  51.     function isConnected()
  52.     {
  53.         return true;
  54.     }
  55.  
  56.     // }}}
  57.     // {{{ engineName()
  58.  
  59.     /**
  60.      * returns name of current engine
  61.      *
  62.      * @return string name of engine
  63.      * @access public
  64.      */
  65.     function engineName()
  66.     {
  67.         return strtolower(substr(basename(__FILE__), 0, -4));
  68.     }
  69.  
  70.     // }}}
  71.     // {{{ _default()
  72.  
  73.     /**
  74.      * fill non-set properties by def values
  75.      *
  76.      * @param array options array
  77.      * @param array hash of pairs keys and default values
  78.      *
  79.      * @return array filled array
  80.      * @access public
  81.      */
  82.     function _default($options, $def)
  83.     {
  84.         foreach ($def as $key=>$val) {
  85.             if (!isset($options[$key])) {
  86.                 $options[$key] = $val;
  87.             }
  88.         }
  89.  
  90.         return $options;
  91.     }
  92.     // }}}
  93. }
  94. // }}}
  95. ?>