Download the PHP package hashbang/epoctools without Composer

On this page you can find all versions of the php package hashbang/epoctools. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package epoctools

EpocTools - PHP epoc manipulation

A simple library to provide various epoc handling functionality.

Installation

Installing into CodeIgniter

Download this repo and copy into your application directory.

Alternatively, install with Composer.

Functions

age - Helper function for humanize that returns the age of something

This function is used to calculate the age of an item relative to another time. See humanize for a full example list

$this->EpocTools = new EpocTools();
$this->EpocTools->Age(strtotime('2011-01-01'), strtotime('2011-01-02')) // Reutns '1 day'
$this->EpocTools->Age(strtotime('2011-01-01 22:00'), strtotime('2011-01-02 23:00')) // Reutns '1 day, 1 hour'

date - Return the time at midnight of an epoc

When given any epoc style date this function sets the time of that epoc to midnight precicely.

$this->EpocTools = new EpocTools();
$this->EpocTools->date(time()); // Returns the epoc at midnight today
$this->EpocTools->date(strtotime('2011-01-01 04:32:21')); // Returns midnight on 01/01/2011

epocdateend - Return the last second of a given epoc date

In contrast to epocdate this function returns the last possible second of a given date.

$this->EpocTools = new EpocTools();
$this->EpocTools->dateend(time()); // Returns the last possible second of todays date
$this->EpocTools->dateend(strtotime('2011-01-01 04:32:21')); // Returns 23:59:59 on 01/01/2011

getstamp - The inverse of date()

This function takes a given string and converts it into a date using the template provided. This is in contrast to the default PHP Date() function which does the opposit.

$this->EpocTools = new EpocTools();
$this->EpocTools->getstamp('d/m/Y H:M','02/07/1983 1035'); // Returns unix timestamp 425952900

humanize - Returns a sequence of seconds in human format

This function can be used to return how far an event occurs in the past or future relative to the current time

$this->EpocTools = new EpocTools();
$this->EpocTools->Humanize(time() - 60); // Returns '60 seconds ago'
$this->EpocTools->Humanize(time() - 5400); // Returns '1 hour, 30 minutes ago'
$this->EpocTools->Humanize(time() - 72576000); // Returns '2 weeks ago'

A vareity of options can be specified including how many time scales should be selected (i.e. how specific) for example '2 weeks, 1 hour' would have two blocks, '2 weeks, 1 hour, 38 minutes, 42 seconds' would have four.

shorthand - Return the number of seconds from a human readable time shorthand

This function returns the number of seconds determined from a shorthand time string.

$this->EpocTools = new EpocTools();
$this->EpocTools->Shorthand('1h') // Returns 3600 (1 hour - 60*60)
$this->EpocTools->Shorthand('1h30m') // Returns 5400 (1 hour 30 minutes - 60*60 + 30*60)
$this->EpocTools->Shorthand('2w') // Returns 72576000 (2 weeks - 7*24*60*60*60*2)

All versions of epoctools with dependencies

PHP Build Version
Package Version
Requires php Version >=5.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package hashbang/epoctools contains the following files

Loading the files please wait ....