PHP code example of steveworley / restrict

1. Go to this page and download the library: Download steveworley/restrict 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/ */

    

steveworley / restrict example snippets

 php
$settings['restrict_whitelist'] = [
  '107.20.238.9',
  '70.102.97.2/30'
];
 php
$settings['restrict_blacklist'] = [
  '107.20.238.9',
  '70.102.97.2/30'
];
 php
$settings['restrict_basic_auth_credentials'] = [
  'Editor' => 'P455w0rd',
  'user' => 'password',
  ]
];
 php
$settings['restrict_response_code'] = 'RESTRICT_NOT_FOUND';
 php
$settings['restrict_trusted_proxies'] = [
  '127.0.0.1',
];