コード例 #1
0
ファイル: RequestTest.php プロジェクト: thornberger/empire
 /**
  * Tests deleting a values from a method.
  *
  * @covers empire\framework\request\Request::deleteAll
  */
 public function testDeleteAll()
 {
     $this->resetGetPost();
     $_GET['hello'] = 'world';
     $_GET['hello2'] = 'world2';
     $_POST['hi'] = 'universe';
     $_POST['hi2'] = 'universe2';
     $this->request->deleteAll(INPUT_GET);
     $this->request->deleteAll(INPUT_POST);
     $this->assertEmpty($_GET);
     $this->assertEmpty($_POST);
 }
コード例 #2
0
ファイル: SessionRemote.php プロジェクト: thornberger/empire
<?php

namespace empire\framework\tests\session;

define('IPC_FILE', __DIR__ . DIRECTORY_SEPARATOR . "session_ipc.json");
$decoded = json_decode(file_get_contents(IPC_FILE), true);
$bootstrap = $decoded['bootstrap'];
require $bootstrap;
use empire\framework\request\Request;
use empire\framework\session\Session;
$request = new Request();
$method = $request->get('method', INPUT_GET, Request::TYPE_STRING, '#^[a-zA-Z]+$#');
$arguments = unserialize(base64_decode($_POST['arguments']));
/* @var $session Session */
$session = array_shift($arguments);
// call the method
call_user_func_array(__NAMESPACE__ . '\\' . $method, $arguments);
function get($key)
{
    global $session;
    echo base64_encode(serialize($session->get($key)));
}
function set($key, $value)
{
    global $session;
    $res = $session->set($key, $value);
    echo base64_encode(serialize($res));
}
function delete($key)
{
    global $session;