PHP code example of baks-dev / files-cdn

1. Go to this page and download the library: Download baks-dev/files-cdn 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/ */

    

baks-dev / files-cdn example snippets

 php


namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
use Symfony\Config\SecurityConfig;

return static function(SecurityConfig $config) {
	
	$config->enableAuthenticatorManager(true);

	$config->firewall('dev')
		->pattern('^/(_(profiler|wdt)|css|images|js)/')
		->security(false)
	;

	$config->passwordHasher(PasswordAuthenticatedUserInterface::class)->algorithm('bcrypt');

	$config->provider('in_memory_users')
		->memory()
		->user('<user>')
		->password('<hash-password-result>')
		->roles(['ROLE_CDN'])
	;
	
	$config->firewall('main')
		->pattern('^/cdn/upload')
		->provider('in_memory_users')
		->httpBasic()
	;
};