Example #1
0
 /**
  * Load methods as returned from {@link getFunctions}
  *
  * Typically, you will not use this method; it will be called using the
  * results pulled from {@link Zend\XmlRpc\Server\Cache::get()}.
  *
  * @param  array|Definition $definition
  * @return void
  * @throws Server\Exception\InvalidArgumentException on invalid input
  */
 public function loadFunctions($definition)
 {
     if (!is_array($definition) && !$definition instanceof Definition) {
         if (is_object($definition)) {
             $type = get_class($definition);
         } else {
             $type = gettype($definition);
         }
         throw new Server\Exception\InvalidArgumentException('Unable to load server definition; must be an array or Zend_Server_Definition, received ' . $type, 612);
     }
     $this->table->clearMethods();
     $this->registerSystemMethods();
     if ($definition instanceof Definition) {
         $definition = $definition->getMethods();
     }
     foreach ($definition as $key => $method) {
         if ('system.' == substr($key, 0, 7)) {
             continue;
         }
         $this->table->addMethod($method, $key);
     }
 }