See the helper readme
Use this class to measure response time when debugging or to include time in your API responses.
$time = new MeasureTime();
/* Do some stuff */
echo $time->mark(); /* Total time since $time was instantiated */
/* Do more stuff */
echo $time->markInterval(); /* Time since last mark() */
/* Do even more stuff */
echo $time->mark(); /* Total time since $time was instantiated */
Create a PID file and lock out running the script multiple times.
composer require thenexxuz/utils
Add use TheNexxuz\Utils\ProcessId;
to your file.
Within your code add the following to the start of your script.
$pid = new ProcessId('myScriptName');
$pid->setLock();
or
$pid = new ProcessId();
$pid->setScriptName('myScriptName');
$pid->setLock();
If no name is given then script
is used.
You can check if the process is running (boolean returned).
$pid->isRunning()
Add the following to the end of your script.
$pid->releaseLock();
Run the tests with vendor/bin/phpunit --coverage-html build/coverage-report
Please try to use GitFlow. More information here. And here.
- Fork it!
- Create your feature branch:
git checkout -b feature/my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin feature/my-new-feature
- Submit a pull request!