diff --git a/config/services.config.php b/config/services.config.php index 9db2f34..266dcc6 100644 --- a/config/services.config.php +++ b/config/services.config.php @@ -79,7 +79,7 @@ * Direct manager, handles instantiation of requested services */ 'kjsencha.direct.manager' => function(ServiceManager $sm) { - $directManager = new DirectManager(); + $directManager = new DirectManager($sm); $directManager->addPeeringServiceManager($sm); return $directManager; diff --git a/src/KJSencha/Controller/DirectController.php b/src/KJSencha/Controller/DirectController.php index 4299b8d..0752028 100644 --- a/src/KJSencha/Controller/DirectController.php +++ b/src/KJSencha/Controller/DirectController.php @@ -176,7 +176,7 @@ protected function getRPC() $rpcs = array(); if ($request->getContent()) { - $rpcs = json_decode($GLOBALS['HTTP_RAW_POST_DATA'], true); + $rpcs = json_decode(file_get_contents("php://input"), true); } elseif ($this->params()->fromQuery('callback')) { $rpcs = json_decode($this->params()->fromQuery('data'), true); } diff --git a/src/KJSencha/Direct/DirectManager.php b/src/KJSencha/Direct/DirectManager.php index 5683dff..8f663f8 100644 --- a/src/KJSencha/Direct/DirectManager.php +++ b/src/KJSencha/Direct/DirectManager.php @@ -3,12 +3,23 @@ namespace KJSencha\Direct; use Zend\ServiceManager\AbstractPluginManager; +use Zend\ServiceManager\ServiceLocatorInterface; /** * Manages the creation of Direct classes */ class DirectManager extends AbstractPluginManager { + /** + * DirectManager constructor. + * @param ServiceLocatorInterface $sl + */ + public function __construct(ServiceLocatorInterface $sl) + { + parent::__construct(); + $this->setServiceLocator($sl); + } + /** * {@inheritDoc} */