PHP code example of thipages / pca-helper
1. Go to this page and download the library: Download thipages/pca-helper 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/ */
thipages / pca-helper example snippets
[
'debug'=>true,
'authorization.tableHandler' => function ($operation, $tableName) {
return $tableName != 'user';
}
]
Base::setup_connection(
$database, $username, $password,
$driver = 'mysql',$address='localhost',
$port = null
)
Base::setup_SQLite($filePath)
Base::setup_cache($cacheType = 'NoCache', $cacheTime = 10, $cachePath = null)
BdAuth::setup(
$sessionName,
$passwordLength=12, $mode='word',
$registerUser='1')
// Note that dbAuth has a strong default setup
[
'multiTenancy.handler'=>AutoFK::multiTenancy_handler(
$relations,
$user=['user','id','user_id']
)
]
[
'customzation.beforeHandler'=>Upload::customzation_beforeHandler (
$table, $field, $filesPath
)
]
Helper::echo(
[
Base::setup_SQLite($dbPath),
Base::setup_cache(),
DbAuth::setup('pca_helper',8),
[
'authorization.tableHandler' => function ($operation, $tableName) {
return $tableName != 'user';
},
'multiTenancy.handler' => AutoFK::multiTenancy_handler(['note'=>'user_id']),
'customzation.beforeHandler'=>function($operation, $tableName, $request, $environment) {
$request= Upload::customzation_beforeHandler ($table, $field, $filesPath)(func_get_args());
// ...
return $request;
},
Base::debug=>true
]
]);