Skip to content
This repository has been archived by the owner on Sep 19, 2019. It is now read-only.

Releases: harikt/conduit-skelton

0.7.0

25 Mar 12:07
Compare
Choose a tag to compare

This release removed attaching objects to dispatcher. So you got rid of doing

$dispatcher->setObject('blog', $di->lazyNew('Controller\Blog'));

Instead you can add to route itself as a callable or can pass the fully qualified class name.

$router = $di->get('router');
$router->add('home', '/')
    ->addValues(array('controller' => function ($response) {
            return $response
                ->getBody()
                ->write("<p>Home page in html.</p>")
                ->withHeader('Content-Type', 'text/html');
        }
    ));

$router->add('greet', '/greet')
    ->addValues(array(
        'controller' => 'Controller\Greet',
        'action' => 'hello'
    ));

The controller now can return string, PSR-7 Response object or even a Response\Payload .

namespace Controller;

use Psr\Http\Message\ResponseInterface;
use Response\Payload;

class Blog
{
    public function hello()
    {
        $available = array(
            'text/html' => '.html',
            'application/json' => '.json',
        );
        // $data, $view, $layout, $available
        return new Payload(array('name' => 'Hari KT'), 'greet', null, $available);
    }

    public function returnString()
    {
        return "Hello World";
    }

    public function returnResponse(ResponseInterface $response)
    {
        return $response->withStatus(200)
                    ->withHeader('Content-Type', 'text/html')
                    ->write("returns response");
    }
}

From the payload it can detect the requested content type and send the corresponding response. By default it can send html only.

Please see the tests on the usage.

0.6.0

17 Feb 16:47
Compare
Choose a tag to compare

See https://github.com/phly/conduit/releases/tag/0.14.0

  • Phly\Conduit\Http\Request::getBodyParams() changed to Phly\Conduit\Http\Request::getParsedBody().
  • Phly\Conduit\Http\Request::withBodyParams() changed to Phly\Conduit\Http\Request::withParsedBody().

0.5.0

14 Feb 16:41
Compare
Choose a tag to compare
  • Removed Aura.Auth, Aura.Session
  • Introduced ZF2 authentication, session and its dependencies
  • Example application rewritten

0.4.1

27 Jan 16:29
Compare
Choose a tag to compare
  • update conduit to make use of 0.12

0.4.0

27 Jan 07:04
Compare
Choose a tag to compare
  • update conduit version to 0.11.0. So is MiddlewarePipe , and implemented interface for middleware
  • Fixed negotiation middleware to return the next callable.

0.3.1

22 Jan 15:15
Compare
Choose a tag to compare

Install conduit version 0.10 and only bug fixes.

0.3.0

22 Jan 03:26
Compare
Choose a tag to compare

When we point browser to http://localhost:8000 path is / , and when you point to http://localhost:8000/about , path is /about and when pointing to http://localhost:8000/about/ is /about/ .

But $uri->getPath() have some sort of issue, may be it relies on parse_url and the router relies on $_SERVER['REQUEST_URI']

For details see phly/http#23 , phly/conduit#27

0.2.0

21 Jan 04:33
Compare
Choose a tag to compare

Immutable Version of PSR-7

0.1.0

20 Jan 09:23
Compare
Choose a tag to compare

Mutable Version of PSR-7