Ejemplo n.º 1
0
 /**
  * Class constructor.
  *
  * @param string  $key             Consumer key
  * @param mixed   $storage         String containing table name prefix, or database connection object, or array containing one or both values (optional, default is MySQL with an empty table name prefix)
  * @param boolean $autoEnable      true if the tool consumers is to be enabled automatically (optional, default is false)
  */
 public function __construct($key = null, $storage = '', $autoEnable = false)
 {
     $this->storage = AbstractStorage::getStorage($storage);
     if (!empty($key)) {
         $this->load($key, $autoEnable);
     } else {
         $this->secret = AbstractStorage::getRandomString(32);
     }
 }
Ejemplo n.º 2
0
 /**
  * Get an array of defined tool consumers
  *
  * @return array Array of ToolConsumer objects
  */
 public function getConsumers()
 {
     // Initialise data connector
     $this->storage = AbstractStorage::getStorage($this->storage);
     return $this->storage->toolConsumerList();
 }