00f100 / fcphp-context
Context for FcPhp
Installs: 58
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 1
Open Issues: 0
Type:package
Requires
- php: >=7.2
- 00f100/fcphp-autoload: 0.*
- 00f100/fcphp-cache: 0.*
- 00f100/fcphp-di: 0.*
Requires (Dev)
- 00f100/phpdbug: *
- phpunit/phpunit: 6.*
This package is auto-updated.
Last update: 2024-11-18 06:42:56 UTC
README
Context to FcPhp Application. Autoload Context inside packages with cache using FcPhp Cache and FcPhp Autoload
How to install
Composer:
$ composer require 00f100/fcphp-context
or add in composer.json
{ "require": { "00f100/fcphp-context": "*" } }
How to use
<?php /** * Construct instance of Context * * @param array $context Context to apply * @return void */ $context = new Context(array $context = []);
Example
<?php use FcPhp\Context\Context; $context = [ 'cache' => [ 'file' => 'tests/var/cache', ] ]; $context = new Context($context); // Print // tests/var/cache echo $context->get('cache.file');
Autoload, update Context and cache
<?php use FcPhp\Context\Context; use FcPhp\Autoload\Autoload; use FcPhp\Cache\Facades\CacheFacade; $context = [ 'cache' => [ 'file' => 'tests/var/cache', ] ]; $context = new Context($context); $vendorPath = 'vendor/*/*/config'; $autoload = new Autoload(); $cache = CacheFacade::getInstance('tests/var/cache'); $context->autoload($vendorPath, $autoload, $cache);