PHP code example of sanprojects / interceptor

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

    

sanprojects / interceptor example snippets


// Intercept all kind of requests
\Sanprojects\Interceptor\Interceptor::interceptAll();

\Sanprojects\Interceptor\Interceptor::interceptAll();



Interceptor.DEBUG: curl -vX POST 'https://www.example.com/' \ 
 --data 'postvar1=value1&postvar2=value2&postvar3=value3'
Interceptor.DEBUG: CURL> <!doctype html> ...
Interceptor.DEBUG: fopen /Users/san/PhpstormProjects/interceptor/tests/test.txt w+b [resource(stream)] 
Interceptor.DEBUG: fwrite /Users/san/PhpstormProjects/interceptor/tests/test.txt test 4 
Interceptor.DEBUG: fread /Users/san/PhpstormProjects/interceptor/tests/test.txt 100 test 
Interceptor.DEBUG: file_put_contents /Users/san/PhpstormProjects/interceptor/tests/test.txt test 4 
Interceptor.DEBUG: Redis::__construct NULL 
Interceptor.DEBUG: Redis tcp://127.0.0.1:6379 set test {"jsonKey":123} Predis\Response\Status 
Interceptor.DEBUG: Redis tcp://127.0.0.1:6379 get test {"jsonKey":123} 
Interceptor.DEBUG: mysqli_connect ensembldb.ensembl.org anonymous  mysqli 
Interceptor.DEBUG: mysqli_query ensembldb.ensembl.org SELECT 123 mysqli_result 
Interceptor.DEBUG: PDO::__construct mysql:dbname=;host=ensembldb.ensembl.org anonymous  NULL 
Interceptor.DEBUG: PDO::query SELECT 123 Sanprojects\Interceptor\Hooks\PDOStatement 
Interceptor.DEBUG: PDOStatement::execute SELECT 123; true
bash
curl -O https://sanprojects.github.io/interceptor/interceptor.phar
php -d opcache.enable=0 -d auto_prepend_file=interceptor.php <yourScript.php>