Exemple #1
0
 /**
  * Create a new shared mem object
  *
  * @param string $type  the shared mem type (or false on autodetect)
  * @param array  $options  an associative array of option names and values
  *
  * @return object  a new System_Shared object
  *
  */
 public static function factory($type = false, $options = array())
 {
     if ($type === false) {
         $type = System_SharedMemory::getAvailableTypes(true);
     } else {
         $type = ucfirst(strtolower($type));
     }
     require_once dirname(__FILE__) . '/SharedMemory/' . $type . '.php';
     $class = 'System_SharedMemory_' . $type;
     return new $class($options);
 }
Exemple #2
0
 /**
  * Create a new shared mem object
  *
  * @param string $type  the shared mem type (or false on autodetect)
  * @param array  $options  an associative array of option names and values
  *
  * @return object  a new System_Shared object
  *
  */
 static function &factory($type = false, $options = array())
 {
     if ($type === false) {
         $type = System_SharedMemory::getAvailableTypes(true);
     } else {
         $type = ucfirst(strtolower($type));
     }
     include_once 'SharedMemory/' . $type . '.php';
     $class = 'System_SharedMemory_' . $type;
     $ref = new $class($options);
     return $ref;
 }