Skip to content

reinvanoyen/oak

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple PHP building blocks framework

Config

<?php

use Oak\Config\Facade\Config;

Config::set('package', [
  'client_id' => '123',
  'client_secret' => 'F1jK4s5mPs9s1_sd1wpalnbs5H1',
]);

echo Config::get('package.client_secret'); // F1jK4s5mPs9s1_sd1wpalnbs5H1
Config commands
php oak config clear-cache
php oak config cache

Console

Documentation coming soon

Container

Documentation coming soon

Cookie

Example usage
<?php

use Oak\Cookie\Facade\Cookie;

Cookie::set('key', 'value');

echo Cookie::get('key'); // value
Cookie config options
Name Default
path /
secure false
http_only true

Dispatcher

<?php

use Oak\Dispatcher\Facade\Dispatcher;

Dispatcher::addListener('created', function($event) {
  echo 'Creation happened!';
});

Dispatcher::dispatch('created', new Event());

Filesystem

Documentation coming soon

Logger

Example usage
<?php

use Oak\Logger\Facade\Logger;

Logger::log('This message will be logged');
Logger config options
Name Default
filename cache/logs/log.txt
date_format d/m/Y H:i

Session

Example usage
<?php

use Oak\Session\Facade\Session;

Session::set('key', 'value');
Session::save();

echo Session::get('key'); // value
Session config options
Name Default
path cache/sessions
name oak_app
cookie_prefix session
identifier_length 40