2017 © Pedro Peláez
 

library labrador

A microframework providing a plugin and event system to build PHP powered applications.

image

cspray/labrador

A microframework providing a plugin and event system to build PHP powered applications.

  • Sunday, January 14, 2018
  • by cspray
  • Repository
  • 3 Watchers
  • 10 Stars
  • 151 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 13 Versions
  • 0 % Grown

The README.md

Labrador Core

PHP Unit Testing & Code Lint GitHub release GitHub license, (*1)

An opinionated, asynchronous micro-framework written on top of amphp. Built using SOLID principles, unit testing, and a modular ecosystem Labrador aims to be a production-ready framework for creating asynchronous PHP applications. Labrador Core serves as the foundation for this framework and provides important key concepts for building apps with Labrador., (*2)

Installation

Composer is the only supported method for installing Labrador packages., (*3)

composer require cspray/labrador

Quick Start

If you'd rather get started quickly without having to read a bunch of documentation the code below demonstrates how to quickly get an Application implemented and running. Otherwise, we recommend checking out the Documentation for more detailed information, and a complete guide to getting started., (*4)

<?php

// app.php in your project's root directory

require_once __DIR__ . '/vendor/autoload.php';

use Cspray\Labrador\AbstractApplication;
use Cspray\Labrador\EnvironmentType;
use Cspray\Labrador\CoreApplicationObjectGraph;
use Cspray\Labrador\Engine;
use Cspray\Labrador\StandardEnvironment;
use Amp\Promise;
use Amp\Delayed;
use Amp\Log\StreamHandler;
use Auryn\Injector;
use Monolog\Logger;
use function Amp\call;
use function Amp\ByteStream\getStdout;

class HelloWorldApplicationObjectGraph extends CoreApplicationObjectGraph {

    public function wireObjectGraph() : Injector {
        $injector = parent::wireObjectGraph();

        // wire up your app's dependencies

        return $injector;
    }

}

class HelloWorldApplication extends AbstractApplication {

    protected function doStart() : Promise {
        return call(function() {
            yield new Delayed(500);  // just to show that we are running on the Loop
            $this->logger->info('Hello Labrador!');
        }); 
    }

}

$environment = new StandardEnvironment(EnvironmentType::Development());
$logger = new Logger('labrador.hello-world', [new StreamHandler(getStdout())]);

$injector = (new HelloWorldApplicationObjectGraph($environment, $logger))->wireObjectGraph();

$app = $injector->make(HelloWorldApplication::class);
$engine = $injector->make(Engine::class);

$engine->run($app);

Documentation

Labrador packages have thorough documentation in-repo in the docs/ directory. You can also check out the documentation online at https://labrador-kennel.io/docs/core., (*5)

Governance

All Labrador packages adhere to the rules laid out in the Labrador Governance repo, (*6)

The Versions

14/01 2018

dev-master

9999999-dev

A microframework providing a plugin and event system to build PHP powered applications.

  Sources   Download

MIT

The Requires

 

The Development Requires

14/01 2018

3.0.0-beta

3.0.0.0-beta

A microframework providing a plugin and event system to build PHP powered applications.

  Sources   Download

MIT

The Requires

 

The Development Requires

14/01 2018

dev-refactor-amp

dev-refactor-amp

A microframework providing a plugin and event system to build PHP powered applications.

  Sources   Download

MIT

The Requires

 

The Development Requires

20/03 2016

2.0.0

2.0.0.0

A microframework providing a plugin and event system to build PHP powered applications.

  Sources   Download

MIT

The Requires

 

The Development Requires

14/03 2016

1.2.1

1.2.1.0

A microframework providing a plugin and event system to build PHP powered applications.

  Sources   Download

MIT

The Requires

 

The Development Requires

14/02 2016

1.2.0

1.2.0.0

A microframework providing a plugin and event system to build PHP powered applications.

  Sources   Download

MIT

The Requires

 

The Development Requires

13/02 2016

1.1.0

1.1.0.0

A microframework providing a plugin and event system to build PHP powered applications.

  Sources   Download

MIT

The Requires

 

The Development Requires

14/01 2016

1.0.0

1.0.0.0

A microframework providing a plugin and event system to build PHP powered applications.

  Sources   Download

MIT

The Requires

 

The Development Requires

09/01 2016

0.3.1

0.3.1.0

A microframework providing a plugin and event system to build PHP powered applications.

  Sources   Download

MIT

The Requires

 

The Development Requires

18/12 2015

0.3.0

0.3.0.0

A microframework providing a plugin and event system to build PHP powered applications.

  Sources   Download

MIT

The Requires

 

The Development Requires

17/08 2015

0.2.0

0.2.0.0

A microframework providing a plugin and event system to build PHP powered applications.

  Sources   Download

MIT

The Requires

 

The Development Requires

17/08 2015

0.1.1

0.1.1.0

A microframework providing a plugin and event system to build PHP powered applications.

  Sources   Download

MIT

The Requires

 

The Development Requires

17/08 2015

0.1.0

0.1.0.0

A microframework providing a plugin and event system to build PHP powered applications.

  Sources   Download

MIT

The Requires

 

The Development Requires