PHP code example of sweetchuck / git-hooks-stdinput-reader
1. Go to this page and download the library: Download sweetchuck/git-hooks-stdinput-reader 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/ */
sweetchuck / git-hooks-stdinput-reader example snippets
#!/usr/bin/env php
use Sweetchuck\GitHooksStdInputReader\PreReceiveReader;
$reader = new PreReceiveReader(STDIN);
foreach ($reader as $item) {
echo 'Old value: ', $item->oldValue, PHP_EOL;
echo 'New value: ', $item->newValue, PHP_EOL;
echo 'Ref name: ', $item->refName, PHP_EOL;
echo '-----------', PHP_EOL;
}