Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 5.6 Compatibility: Replace HTTP_RAW_POST_DATA with php://input #43

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion config/services.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/KJSencha/Controller/DirectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
11 changes: 11 additions & 0 deletions src/KJSencha/Direct/DirectManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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}
*/
Expand Down