1. Go to this page and download the library: Download frdl/remote-psr4 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/ */
$config = [
'FRDL_UPDATE_CHANNEL' => 'latest', // stable | latest
'FRDL_REMOTE_PSR4_CACHE_DIR'=> \sys_get_temp_dir().\DIRECTORY_SEPARATOR. \get_current_user()
.\DIRECTORY_SEPARATOR.'.frdl'.\DIRECTORY_SEPARATOR.'runtime'.\DIRECTORY_SEPARATOR.'cache'.\DIRECTORY_SEPARATOR
.'classes'.\DIRECTORY_SEPARATOR.'psr4'.\DIRECTORY_SEPARATOR,
'FRDL_REMOTE_PSR4_CACHE_LIMIT'=> 24 * 60 * 60,
];
// $workspace is the DEFAULT Psr4 Server
// e.g.: $workspace = 'https://webfan.de/install/'. $config['FRDL_UPDATE_CHANNEL'].'/?source=${class}&salt=${salt}&source-encoding=b64'
$loader = call_user_func(function($config,$workspace){
return \frdl\implementation\psr4\RemoteAutoloaderApiClient::getInstance($workspace, false, $config['FRDL_UPDATE_CHANNEL'], false, false,
/*Classmap (with PSR4 and Alias)*/
[
// (CLASSMAP) Concrete Classes:
\frdlweb\Thread\ShutdownTasks::class => 'https://raw.githubusercontent.com/frdl/shutdown-helper/master/src/ShutdownTasks.php',
\Webfan\Webfat\Jeytill::class => 'https://raw.githubusercontent.com/frdl/webfat-jeytill/main/src/Jeytill.php',
// (PSR4) NAMESPACES = \\ at the end:
'frdl\\Proxy\\' => 'https://raw.githubusercontent.com/frdl/proxy/master/src/${class}.php?cache_bust=${salt}',
// ALIAS = @ as first char:
'@Webfan\\Autoloader\\Remote' => __CLASS__,
// ALIAS works with PSR4-Namespace too:
'@BetterReflection\\'=>'Roave\BetterReflection\\',
//Versions at Webfan:
// Default/Fallback Versions Server:
\webfan\hps\Format\DataUri::class => 'https://webfan.de/install/?salt=${salt}&source=webfan\hps\Format\DataUri',
// Stable/Current Versions Server:
//\webfan\hps\Format\DataUri::class => 'https://webfan.de/install/stable/?salt=${salt}&source=webfan\hps\Format\DataUri',
// Latest/Beta Versions Server:
// \webfan\hps\Format\DataUri::class => 'https://webfan.de/install/latest/?salt=${salt}&source=webfan\hps\Format\DataUri',
],
$config['FRDL_REMOTE_PSR4_CACHE_DIR'],
$config['FRDL_REMOTE_PSR4_CACHE_LIMIT']
);
}, $config,'https://webfan.de/install/'. $config['FRDL_UPDATE_CHANNEL'].'/?source=${class}&salt=${salt}&source-encoding=b64');
/** More Examples: */
$loader->withClassmap([
//Alias:
'@'.\BetterReflection\Reflection\ReflectionFunction::class => \Roave\BetterReflection\BetterReflection::class,
'@'.\BetterReflection\SourceLocator\Exception\TwoClosuresOneLine::class =>
\Roave\BetterReflection\SourceLocator\Exception\TwoClosuresOnSameLine::class,
\Webfan\Webfat\MainModule::class =>
'https://raw.githubusercontent.com/frdl/recommendations/master/src/Webfan/Webfat/MainModule.php?cache_bust=${salt}',
//Conrete class AND namespace: ORDER matters!
//Classmaps SHOULD be sorted DESC in most cases, CLASS should be listed BEFORE namespace if equal FQN.
\Webfan\Webfat\Module::class => 'https://raw.githubusercontent.com/frdl/recommendations/master/src/Webfan/Webfat/Module.php?cache_bust=${salt}',
'Webfan\Webfat\Module\\' => 'https://raw.githubusercontent.com/frdl/recommendations/master/src/Webfan/Webfat/Module/${class}.php?cache_bust=${salt}',
'Webfan\Webfat\Intent\\' => 'https://raw.githubusercontent.com/frdl/recommendations/master/src/Webfan/Webfat/Intent/${class}.php?cache_bust=${salt}', \Pimple::class => 'https://raw.githubusercontent.com/silexphp/Pimple/1.1/lib/Pimple.php',
'Task\Plugin\Console\\' => 'https://github.com/taskphp/console/blob/00bfa982c4502938ca0110d2f23c5cd04ffcbcc3/src/${class}.php?cache_bust=${salt}',
'Task\\' => 'https://raw.githubusercontent.com/taskphp/task/7618739308ba484b5f90a83d5e1a44e1d90968d2/src/${class}.php?cache_bust=${salt}',
'@BetterReflection\\'=>'Roave\BetterReflection\\',
]);
$loader->register(false);
// Prepend autoloader to autoloader-stack:
// $loader->register(true);