Changeset 1443535
- Timestamp:
- 06/26/2016 06:42:32 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
wp-legisearch/trunk/os-client/WpJsonCacheable.class.php
r1333351 r1443535 29 29 $sql = "SELECT * FROM {$this->cacheTableName} WHERE url = '{$url}';"; 30 30 $result = $wpdb->get_row( $sql ); 31 if( $wpdb->num_rows > 0 && strtotime( $result->retrieved ) >= strtotime( "- {$this->cacheTimeout} hours" ) ) { 31 32 if( $wpdb->num_rows > 0 && ( strtotime( $result->retrieved ) >= strtotime( "- {$this->cacheTimeout} hours" ) ) ) { 32 33 // Cache match and it's fresh 33 34 return $result->data; … … 44 45 array( // data 45 46 'url' => $url, 46 'data' => $json 47 'data' => $json, 48 'retrieved' => current_time( 'mysql' ) 47 49 ), 48 50 array( // where … … 52 54 '%s', 53 55 '%s', 56 '%s' 54 57 ), 55 58 array( // where format … … 68 71 array( // data 69 72 'url' => $url, 70 'data' => $json 73 'data' => $json, 74 'retrieved' => current_time( 'mysql' ) 71 75 ), 72 76 array( // data format 73 77 '%s', 74 78 '%s', 79 '%s' 75 80 ) 76 81 ); … … 87 92 } 88 93 } 94
Note: See TracChangeset
for help on using the changeset viewer.