2017 © Pedro Peláez
 

yii2-extension globals

Global functions and constants

image

rsmike/globals

Global functions and constants

  • Tuesday, December 19, 2017
  • by rsmike
  • Repository
  • 1 Watchers
  • 0 Stars
  • 37 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

Global functions and constants

Contents

Constants

Time intervals

  • MONTHS_IN_YEAR, DAYS_IN_WEEK, DAYS_IN_MONTH, DAYS_IN_YEAR
  • HOURS_IN_DAY, HOURS_IN_WEEK, HOURS_IN_MONTH, HOURS_IN_YEAR
  • MINUTES_IN_HOUR, MINUTES_IN_DAY, MINUTES_IN_WEEK, MINUTES_IN_MONTH, MINUTES_IN_YEAR
  • SECONDS_IN_MINUTE, SECONDS_IN_HOUR, SECONDS_IN_DAY, SECONDS_IN_WEEK, SECONDS_IN_MONTH, SECONDS_IN_YEAR

Datetime format

  • MYSQL_DATE = 'Y-m-d'
  • MYSQL_TIME = 'H:i:s'
  • MYSQL_DATETIME = 'Y-m-d H:i:s'

Misc

EMPTY_GIF - inline 1x1 transparent gif. To be used as an "img src", (*1)

Functions

  • e($variable...) - preformatted, dump variables
  • ed($variable...) - dump variables and die
  • tmpfn($key='temp') - generate full path to a temporary file in the temporary directory
  • pl($n, $singleform, $pluralform, $ifempty) - simple pluraliser. Plural form can be omitted for simple cases. Ifempty is optional, too. Replaces # with $n.
  • lines($n) - split string to array of lines using the newline regexp "\R"

Yii2 specific

  • qq(\yii\db\Query) - generate SQL from the query object
  • qqd(\yii\db\Query) - prnt SQL and die

Installation

Either run, (*2)

$ composer require rsmike/globals

or add, (*3)

"rsmike/globals": "*"

to the require section of your composer.json file., (*4)

The Versions

19/12 2017

dev-master

9999999-dev

Global functions and constants

  Sources   Download

MIT

constants seconds global functions minutes

19/12 2017

0.7.6

0.7.6.0

Global functions and constants

  Sources   Download

MIT

constants seconds global functions minutes

09/08 2017

0.7.5

0.7.5.0

Global functions and constants

  Sources   Download

MIT

constants seconds global functions minutes

21/07 2017

0.7.4

0.7.4.0

Global functions and constants

  Sources   Download

MIT

constants seconds global functions minutes

20/07 2017

0.7.3

0.7.3.0

Global functions and constants

  Sources   Download

MIT

constants seconds global functions minutes

13/07 2017

0.7.2

0.7.2.0

Global functions and constants

  Sources   Download

MIT

constants seconds global functions minutes

30/06 2017

0.6

0.6.0.0

Global functions and constants

  Sources   Download

MIT

constants seconds global functions minutes