devtoolboxuk/utilitybundle

Basic Utility Bundle

1.0.16 2019-09-24 13:55 UTC

This package is auto-updated.

Last update: 2024-10-25 01:24:47 UTC


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

Maintainers

@devtoolboxuk.