1. Go to this page and download the library: Download arc/prototype 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/ */
$di = \arc\prototype::create([
'dsn' => 'mysql:dbname=testdb;host=127.0.0.1';
'user' => 'dbuser',
'password' => 'dbpassword',
'database' => \arc\prototype::memoize( function() {
// this generates a single PDO object once and then returns it for each subsequent call
return new PDO( $this->dsn, $this->user, $this->password );
} ),
'session' => function() {
// this returns a new mySession object for each call
return new mySession();
}
] );
$diCookieSession = \arc\prototype::extend( $di, [
'session' => function() {
return new myCookieSession();
}
] );