ccampbell / chromephp

class for logging PHP variables to Google Chrome console
http://www.chromelogger.com
1.38k stars 450 forks source link

Suggestion: snippet for automatic download of ChromePhp.php #67

Closed bimlas closed 6 years ago

bimlas commented 6 years ago

It can be boring to download ChromePhp.php and upload it to the local (Vagrant) server, so I just wrote a snippet which downloads the file to the server's temp dir before using it. It needs PHP >= 5.2.1.

if (!is_file(sys_get_temp_dir() . '/ChromePhp.php')) {
    file_put_contents(
        sys_get_temp_dir() . '/ChromePhp.php',
        fopen('https://raw.githubusercontent.com/ccampbell/chromephp/master/ChromePhp.php', 'r')
    );
}
require_once sys_get_temp_dir() . '/ChromePhp.php';
ChromePhp::log('Hello automatization!');

I hope it usefull enough to include in the README. :innocent: