Public Member Functions | |
init (Mage_Api_Controller_Action $controller, $adapter='default', $handler='default') | |
run () | |
getAdapter () | |
Protected Attributes | |
$_adapter |
Definition at line 34 of file Server.php.
getAdapter | ( | ) |
Retrieve web service adapter
Definition at line 84 of file Server.php.
init | ( | Mage_Api_Controller_Action $ | controller, | |
$ | adapter = 'default' , |
|||
$ | handler = 'default' | |||
) |
Definition at line 43 of file Server.php.
00044 { 00045 $adapters = Mage::getSingleton('api/config')->getActiveAdapters(); 00046 $handlers = Mage::getSingleton('api/config')->getHandlers(); 00047 if (isset($adapters[$adapter])) { 00048 $adapterModel = Mage::getModel((string) $adapters[$adapter]->model); 00049 /* @var $adapterModel Mage_Api_Model_Server_Adapter_Interface */ 00050 if (!($adapterModel instanceof Mage_Api_Model_Server_Adapter_Interface)) { 00051 Mage::throwException(Mage::helper('api')->__('Invalid webservice adapter specified')); 00052 } 00053 00054 $this->_adapter = $adapterModel; 00055 $this->_adapter->setController($controller); 00056 00057 if (!isset($handlers->$handler)) { 00058 Mage::throwException(Mage::helper('api')->__('Invalid webservice handler specified')); 00059 } 00060 00061 $handlerClassName = Mage::getConfig()->getModelClassName((string) $handlers->$handler->model); 00062 $this->_adapter->setHandler($handlerClassName); 00063 } else { 00064 Mage::throwException(Mage::helper('api')->__('Invalid webservice adapter specified')); 00065 } 00066 00067 return $this; 00068 }
run | ( | ) |
Run server
Definition at line 74 of file Server.php.
00075 { 00076 $this->getAdapter()->run(); 00077 }
$_adapter [protected] |
Definition at line 41 of file Server.php.