Package

BEAR.Sunday application is a composer package taking BEAR.Sunday framework as dependency package. You can also install another BEAR.Sunday application package as dependency.

Application organization

The file layout of the BEAR.Sunday application conforms to php-pds/skeleton standard.

├── bin
│   ├── app.php
│   └── page.php
├── env.php
├── autoload.php
├── bootstrap.php
├── composer.json
├── composer.lock
├── public
│   └── index.php
├── src
│   ├── (Annotation)
│   ├── (Interceptor)
│   ├── Module
│   └── Resource
├── tests
│   ├── (Fake)
├── var
│   ├── (conf)
│   ├── log
│   └── tmp
└── vendor

Invoke sequence

  1. Console input(bin/app.php, bin/page.php) or web entry file (public/index.php) excute bootstrap.php function.
  2. $app application object is created by $context in boostrap.php.
  3. A router in $app convert external resource request to internal resource request.
  4. A resource request is invoked. The representation of the result transfered to a client.

bootstrap/

You can access same resource through console input or web access with same boot file.

php bin/app.php options /todos // console API access (app resource)
php bin/page.php get '/todos?id=1' // console Web access (page resource)
php -S 127.0.0.1bin/app.php // PHP server

You can create your own boot file for different context.

bin/

Plavce command-line executable files.

src/

Place application class file.

publc/

Web public folder.

var/

log and tmp folder need write permission.

Framework Package

ray/aop

Scrutinizer Quality Score Code Coverage Build Status

An aspect oriented framework based on Java AOP Alliance API.

ray/di

Scrutinizer Quality Score Code Coverage Build Status

A Google Guice style DI framework. It contains ray/aop.

bear/resource

Scrutinizer Code Quality Code Coverage Build Status

A REST framework for PHP object as a service. It contains ray/di.

bear/sunday

Scrutinizer Code Quality Code Coverage Build Status

A web application interface package. It contains bear/resource.

bear/package

Scrutinizer Code Quality Code Coverage Build Status

A web application implmentation package. It contains bear/sunday.

bear/middleware

Scrutinizer Code Quality Code Coverage Build Status

An optional PSR-7 middleware package.

Library Package

Optional library package can be installed with composer require command.

Category Composer package Library
Router    
  bear/aura-router-module Aura.Router v2
Database    
  ray/aura-sql-module Aura.Sql v2
  ray/dbal-module Doctrine DBAL
  ray/cake-database-module CakePHP v3 database
  ray/doctrine-orm-module Doctrine ORM
Storage    
  bear/query-repository CQRS inspired repository
  bear/query-module Separation of external access such as DB or Web API
Web    
  madapaja/twig-module Twig
  ray/web-form-module Web form
  ray/aura-web-module Aura.Web
  ray/aura-session-module Aura.Session
  ray/symfony-session-module Symfony Session
Validation    
  ray/validate-module Aura.Filter
  satomif/extra-aura-filter-module Aura.Filter
Authorization and Authentication    
  ray/oauth-module OAuth
  kuma-guy/jwt-auth-module JSON Web Token
  ray/role-module Zend Acl
  bear/acl-resource ACL based embedded resource
Hypermedia    
  kuma-guy/siren-module Siren
Development    
  ray/test-double Test Double
Asynchronous high performance    
  MyVendor.Swoole Swoole

Vendor Package

You can reuse common packages and tool combinations as modules with only modules and share modules of similar projects.1

Semver

All packages adhere to Semantic Versioning.