Skip to content

Instantly share code, notes, and snippets.

@mrpollo
Created December 16, 2011 07:21
Show Gist options
  • Select an option

  • Save mrpollo/1484948 to your computer and use it in GitHub Desktop.

Select an option

Save mrpollo/1484948 to your computer and use it in GitHub Desktop.
Extending Zend_Rest_Server to use namespaces
<?php
class EventManager_Framework_Rest extends Zend_Rest_Server
{
/**
* Implement Zend_Server_Interface::setClass()
*
* @param string $classname Class name
* @param string $namespace Class namespace (unused)
* @param array $argv An array of Constructor Arguments
*/
public function setClass($classname, $namespace = '', $argv = array())
{
$this->_args = $argv;
foreach ($this->_reflection->reflectClass($classname, $argv)->getMethods() as $method) {
$this->_functions[$namespace.".".$method->getName()] = $method;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment