Recommend this page to a friend! |
![]() |
Info | Documentation | ![]() |
![]() |
![]() |
Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not enough user ratings | Total: 89 | All time: 9,977 This week: 488![]() |
Version | License | PHP version | Categories | |||
tuadmin-cache 1.0.1 | The PHP License | 5.4 | PHP 5, Files and Folders, User Manage..., C... |
Description | Author | ||||||||
This package can cache variable value in file or session variable. |
|
system for caching data
-(new file($PATH_FOLDER_CACHE))->{ANY_ID}($callback,$seconds_cache)
-(new session())->{ANY_ID}($callback,$seconds_cache)
<?php
require 'tuadmin\cache.php';
$cache = new tuadmin\cache\file(__DIR__ .'/tmp');
<?php
require 'tuadmin\cache.php';
$cache = new tuadmin\cache\session(md5('var_in_session'));//alternative for name ,cache in $__SESSION[md5('var_in_session')]
$cache_expire_in=3600;//seconds
$variable_key= '123';//for use in identifier
$var = $cache->{"id_is_$variable_key"}(function()use($variable_key){
return array(time()." this is cached for var".$variable_key);
},$cache_expire_in);
echo $var[0];
echo $cache->_("id_is_for_ever_string",function(){
return time()." this is cached for var";
},60);
![]() |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() |
||||
![]() ![]() |
Example | Example script | ||
![]() ![]() |
Example | Example script | ||
![]() ![]() |
Lic. | License text | ||
![]() ![]() |
Doc. | Documentation | ||
![]() ![]() |
Doc. | Documentation |
![]() |
/ | temp |
File | Role | Description |
---|---|---|
![]() ![]() |
Data | Auxiliary data |
![]() ![]() |
Data | Auxiliary data |
![]() |
/ | tuadmin | / | cache |
File | Role | Description |
---|---|---|
![]() |
Class | Class source |
![]() |
Class | Class source |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
![]() |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.