guilhermegeek/communia

There is no license information available for the latest version (dev-master) of this package.

Installs: 26

Dependents: 2

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Language:Hack

dev-master 2016-06-16 15:31 UTC

This package is not auto-updated.

Last update: 2024-05-17 20:25:21 UTC


README

DON'T USE THIS - NOT READ YET!

A common library i created from pi-framework and i reused in others projects.

A set of tools and common implementations/interfaces i use as well.

Http Request

HttpRequest is a utility object to execute HTTP requests supporting features like headers, cookies and authentication.

Responses are returned as HttpMessage

Container

My implementation for a IOC is horrible and temporary. I've wrote a custom one because i want direct implementation with cache mechanism and others providers like AbstractMetadataFactory and AbstractHydratorFactory.

Cache Provider

The Cache Providers implements the ICacheProvider interface:

public function get($key = null) : ?mixed; 
public function set($key, $value) : void;
public function getArray(string $key) : ?array;
public function push(string $key, string $value) : void;
public function pushObject(string $key, mixed $obj) : void;
public function getAs(string $key, string $className) : ?mixed;
public function getMap(string $key) : ?Map<string,string>;
public function pushMap(string $key, string $mapKey, string $mapValue) : void;
public function contains($key) : bool;

Available Cache Providers

  • APC
  • Redis (not finished yet)
  • Memcached (not testes yet)

Log

The Log Providers implements the ILogFactory interface. Each factory is responsible for returning a ILog instance (available for specific types) implementing:

public function debug(string $message);
public function error($message);
public function fatal($message);
public function info($message);
public function warn($message);