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.

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 codecov Type Coverage Continuous Integration

An aspect oriented framework based on Java AOP Alliance API.

ray/di

Scrutinizer Quality Score codecov Type Coverage Continuous Integration

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

bear/resource

Scrutinizer Code Quality codecov Type Coverage Continuous Integration

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

bear/sunday

Scrutinizer Code Quality codecov Type Coverage Continuous Integration

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

bear/package

Scrutinizer Code Quality codecov Type Coverage Continuous Integration

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

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/media-query  
  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.