Download the PHP package modulework/cachework without Composer

On this page you can find all versions of the php package modulework/cachework. 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 cachework

CACHEWork

A simple way of caching information to disk

Installation:

Make sure that you enter the relative path to the cache directory from where the is called! The MODULE will do the work for you of determining the absolute path. This way you can can cache items from everywhere and don' t need to worry of pathes.

HowTo

There are 5 methods available for you to interact with your cache.

Everywhere you find something like this , it' s an optional value. If you don' t pass any information for this variable it will set it to the default value. The default values are the most commonly used.

PUT

This method will store a value into the cache for a undefined time.

Example usage:

$variable = file_get_contents('http://google.com');
Cache::put('key', $variable);

This will store the result of the into the cache. But you can even store closures (functions) into the cache like this:

Cache::put('get_google', function() {
     $localvar = file_get_contents('http://google.com');
     //complicated alogrithem
     return $result;
});

The will get stored into the cache.

GET

This method will retrieve a value from the cache, but only if it is NOT older then seconds

Example usage:

$key = 'get_google';
$expire = 60 * 60 * 24; // 1 day
Cache::get('key', $expire);

This will return the result the closure (used in the previous example) as long as the was not before 1 day.

FORGET

This will remove the cache item for the given key.

Cache::forget('get_google');

This will remove the file from the disk, forever (a very long time).

REMEMBER

This is the most used method from this class and combines and .
The syntax looks like that:

As you can see it is using the same parameters as and .

An example:

 Cache::remember('get_google', function() {
    return file_get_contents('http://google.com');
 }, 60 * 60 * 24); //1 day

This will save the the contents of into the cache and refreshes the the result every 24 hours (if you are visting the site every 1 hour :D). This is in most cases the most useful method, because you do not have two write your own refresh code.

CLEAR

This function will clear all cached items older than seconds.
Cache::clear($expire);

Thats it! Simple and straight forward.

You can always have a look at the PHP doc for a brief explanation.


All versions of cachework with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.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 modulework/cachework contains the following files

Loading the files please wait ....