This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://davidwalsh.name/php-cache-function | |
/* gets the contents of a file if it exists, otherwise grabs and caches */ | |
function get_content($file,$url,$hours = 24,$fn = '',$fn_args = '') { | |
//vars | |
$current_time = time(); $expire_time = $hours * 60 * 60; $file_time = filemtime($file); | |
//decisions, decisions | |
if(file_exists($file) && ($current_time - $expire_time < $file_time)) { | |
//echo 'returning from cached file'; | |
return file_get_contents($file); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0: jdbc:phoenix:localhost> create table test.testing(k integer primary key, v bigint not null); | |
No rows affected (2.547 seconds) | |
0: jdbc:phoenix:localhost> upsert into test.testing(k,v) values(1, 5); | |
1 row affected (0.014 seconds) | |
0: jdbc:phoenix:localhost> select * from test.testing; | |
+------------+------------+ | |
| K | V | | |
+------------+------------+ |