PHP code example of 00f100 / fcphp-context

1. Go to this page and download the library: Download 00f100/fcphp-context library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

00f100 / fcphp-context example snippets



/**
 * Construct instance of Context
 *
 * @param array $context Context to apply
 * @return void
 */
$context = new Context(array $context = []);



use FcPhp\Context\Context;

$context = [
	'cache' => [
		'file' => 'tests/var/cache',
	]
];

$context = new Context($context);

// Print
// tests/var/cache
echo $context->get('cache.file');



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);