devtoolboxuk / utilitybundle
Basic Utility Bundle
Installs: 5 749
Dependents: 6
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires (Dev)
README
Version: 1.0.0
Table of Contents
- Summary
- Install
- Usage
- [Call Utility Bundle](#Call Utility Bundle)
- Memory
- [Memory Usage](#Memory Usage)
- [Peak Memory Usage](#Peak Memory Usage)
- Debug
- [Get execution time](#Get execution time)
- Date
- [Get date](#Get date)
- Maintainers
Summary
PHP Library to perform some basic utility tasks (I got fed up of writing them for multiple projects)
Install
Install Composer:
$ php -r "readfile('https://getcomposer.org/installer');" | php
Install dependencies:
$ php composer.phar install
use devtoolboxuk\utilitybundle; $this->utility = new UtilityService();
Memory
$memory = $this->utility->memory();
Memory usage
$memory->getMemUsage(); //Outputs the memory usage
Peak Memory usage
$memory->getPeakMemUsage(); //Outputs the peak memory usage
Debug
$debug = $this->utility->debug();
Get execution time
$debug->initialise(); $debug->executionTime();
Date
$debug = $this->utility->date();
Get date
$debug->convert(); //Returns the date time of now $debug->convert('2019-02-07T12:00:00'); //Returns 2019-02-07 12:00:00