PHP code example of ozziest / overdose
1. Go to this page and download the library: Download ozziest/overdose 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/ */
ozziest / overdose example snippets
// Creating new cache object
use Desarrolla2\Cache\Cache;
use Desarrolla2\Cache\Adapter\File;
$cacheDir = '/tmp';
$adapter = new File($cacheDir);
$adapter->setOption('ttl', 3600);
$cache = new Cache($adapter);
// Creating overdose
$overdose = new Ozziest\Overdose\Overdose($cache);
try {
$overdose->isSecure();
} catch (Ozziest\Overdose\OverdoseException $e) {
exit($e->getMessage());
}
$overdose = new Ozziest\Overdose\Overdose($cache);
$overdose->set([
'acceptable' => 5,
'safe' => 10,
'max' => 3,
'recreation' => 60
])
->isSecure();