2017 © Pedro PelĆ”ez
 

library core

The Hoa\Core library.

image

hoa/core

The Hoa\Core library.

  • Monday, January 11, 2016
  • by Hoa
  • Repository
  • 13 Watchers
  • 36 Stars
  • 653,832 Installations
  • PHP
  • 5 Dependents
  • 0 Suggesters
  • 23 Forks
  • 0 Open issues
  • 19 Versions
  • 3 % Grown

The README.md

Hoa, (*1)

Hoa is a modular, extensible and structured set of PHP libraries. Moreover, Hoa aims at being a bridge between industrial and research worlds., (*2)

Hoa\Core state

This library is the foundation —the core— of all libraries of Hoa. It provides fundamental algorithms, paradigms and mechanisms, organized as follows:, (*3)

  • Core: core of the core;
  • Consistency: adds consistency to PHP (from/import, xcallable, dnew, curry etc.);
  • Exception: homogenises exceptions and errors;
  • Protocol: abstracts resources —and more— accesses (e.g. hoa://Library or hoa://Application);
  • Parameter: manages parameters of libraries;
  • Event: adds support of events and listeners;
  • Data: adds support of polymorphic data with high performance.

Warning

This library is deprecated. It has been splitted into: * Hoa\Consistency, * Hoa\Event, * Hoa\Exception, * Hoa\Protocol, * Hoa\Zformat., (*4)

This library is no longer used., (*5)

Installation

The core can be placed where you want. We recommand /usr/local/lib/Hoa for Unix-like systems and C:\Program Files\Hoa for Windows systems., (*6)

Then, you have to require Core.php and it is enough to use all libraries of Hoa; thus:, (*7)

<?php

require '/usr/local/lib/Hoa/Core/Core.php';
var_dump(HOA); // bool(true)

With Composer, you do not need to require Core.php, only vendor/autoload.php as usual., (*8)

Quick usage

We propose a quick overview of some layers of the core., (*9)

Exceptions and errors

Errors are unified to exceptions. Exceptions are of 3 kinds: idle, normal and error. They support formatted messages, auto-catch, dedicated event channel etc., (*10)

Protocol

hoa:// defines an abstraction for application ressources (with roots Data and Application) and another abstraction for libraries resources (with root Library). For example:, (*11)

$conf = require 'hoa://Data/Etc/Configuration/Foo.php';

We can attach more than resources on this protocol. Example with the Hoa\Registry library:, (*12)

Hoa\Registry\Registry::set('foo', 'bar');
echo resolve('hoa://Library/Registry#foo'); // bar

Events and listeners

Libraries can use events and listeners (which have some similarities). For example, if we attach a function to the channel of exceptions:, (*13)

event('hoa://Event/Exception')->attach(function ($bucket) {
    $exception = $bucket->getData();
    echo 'Exception: ', $exception->getMessage(), "\n";
})

throw new Hoa\Core\Exception('Hello %s!', 0, 'Gordon');
// Exception: Hello Gordon!

Some libraries define their own channels, such as the Hoa\Stream library with, for example, hoa://Event/Stream/<stream-name>:close-before, or hoa://Event/Log/<channel> etc., (*14)

For listeners, we are closer to the emitter:, (*15)

$websocket = new Hoa\Websocket\Server(
    new Hoa\Socket\Server('tcp://127.0.0.1:8889')
);
$websocket->on('message', $callable);
$websocket->run();

Documentation

Different documentations can be found on the website: http://hoa-project.net/., (*16)

License

Hoa is under the NewĀ BSDĀ License (BSD-3-Clause). Please, see LICENSE., (*17)

The Versions

11/01 2016

dev-master

9999999-dev http://hoa-project.net/

The Hoa\Core library.

  Sources   Download

BSD-3-Clause

The Requires

  • ext-spl *
  • php >=5.4.0

 

The Development Requires

library core data parameter event listener protocol consistency

09/11 2015

2.15.11.09

2.15.11.09 http://hoa-project.net/

The Hoa\Core library.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0
  • ext-spl *

 

The Development Requires

library core data parameter event listener protocol consistency

03/09 2015

2.15.09.03

2.15.09.03 http://hoa-project.net/

The Hoa\Core library.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0
  • ext-spl *

 

The Development Requires

library core data parameter event listener protocol consistency

01/09 2015

2.15.09.01

2.15.09.01 http://hoa-project.net/

The Hoa\Core library.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0
  • ext-spl *

 

The Development Requires

library core data parameter event listener protocol consistency

07/07 2015

2.15.07.07

2.15.07.07 http://hoa-project.net/

The Hoa\Core library.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0
  • ext-spl *

 

The Development Requires

library core data parameter event listener protocol consistency

05/07 2015

2.15.07.05

2.15.07.05 http://hoa-project.net/

The Hoa\Core library.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0
  • ext-spl *

 

The Development Requires

library core data parameter event listener protocol consistency

02/06 2015

2.15.06.02

2.15.06.02 http://hoa-project.net/

The Hoa\Core library.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0
  • ext-spl *

 

The Development Requires

library core data parameter event listener protocol consistency

01/06 2015

2.15.06.01

2.15.06.01 http://hoa-project.net/

The Hoa\Core library.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0
  • ext-spl *

 

The Development Requires

library core data parameter event listener protocol consistency

29/05 2015

2.15.05.29

2.15.05.29 http://hoa-project.net/

The Hoa\Core library.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0
  • ext-spl *

 

The Development Requires

library core data parameter event listener protocol consistency

13/04 2015

2.15.04.13

2.15.04.13 http://hoa-project.net/

The Hoa\Core library.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0
  • ext-spl *

 

The Development Requires

library core data parameter event listener protocol consistency

18/02 2015

2.15.02.18

2.15.02.18 http://hoa-project.net/

The Hoa\Core library.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0
  • ext-spl *

 

The Development Requires

library core data parameter event listener protocol consistency

23/01 2015

2.15.01.24

2.15.01.24 http://hoa-project.net/

The Hoa\Core library.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0
  • ext-spl *

 

The Development Requires

library core data parameter event listener protocol consistency

23/01 2015

2.15.01.23

2.15.01.23 http://hoa-project.net/

The Hoa\Core library.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0
  • ext-spl *

 

The Development Requires

library core data parameter event listener protocol consistency

10/12 2014

2.14.12.10

2.14.12.10 http://hoa-project.net/

The Hoa\Core library.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0
  • ext-spl *

 

The Development Requires

library core data parameter event listener protocol consistency

25/11 2014

2.14.11.26

2.14.11.26 http://hoa-project.net/

The Hoa\Core library.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0
  • ext-spl *

 

The Development Requires

library core data parameter event listener protocol consistency

09/11 2014

2.14.11.09

2.14.11.09 http://hoa-project.net/

The Hoa\Core library.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0
  • ext-spl *

 

The Development Requires

library core data parameter event listener protocol consistency

23/09 2014

2.14.09.23

2.14.09.23 http://hoa-project.net/

The Hoa\Core library.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0
  • ext-spl *

 

library core data parameter event listener protocol consistency

17/09 2014

2.14.09.17

2.14.09.17 http://hoa-project.net/

The Hoa\Core library.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0
  • ext-spl *

 

library core data parameter event listener protocol consistency

16/09 2014

1.14.09.16

1.14.09.16 http://hoa-project.net/

The Hoa\Core library.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.3
  • ext-spl *

 

library core data parameter event listener protocol consistency