Changeset 1164 for trunk/common
- Timestamp:
- 01/14/12 16:18:10 (4 months ago)
- Location:
- trunk/common
- Files:
-
- 4 edited
-
cache.php (modified) (2 diffs)
-
common.php (modified) (1 diff)
-
db/attachment.php (modified) (3 diffs)
-
textblock.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/common/cache.php
r966 r1164 144 144 // mem_cache_purge deletes everything from the cache. Try to avoid calling it. 145 145 // 146 // FIXME: cache is not logged. See IA_LOG_MEM_CACHE.147 146 if (IA_MEM_CACHE_METHOD == 'none') { 148 147 … … 259 258 } 260 259 } 260 261 } else if (IA_MEM_CACHE_METHOD == 'apc') { 262 // APC cache implementation 263 function mem_cache_get($cache_id) { 264 $res = apc_fetch($cache_id); 265 if ($res === false) { 266 if (IA_LOG_MEM_CACHE) { 267 log_print("MEM CACHE: miss on $cache_id"); 268 } 269 return false; 270 } else { 271 if (IA_LOG_MEM_CACHE) { 272 log_print("MEM CACHE: hit on $cache_id"); 273 } 274 return unserialize($res); 275 } 276 } 277 278 function mem_cache_set($cache_id, $object, $ttl = IA_MEM_CACHE_EXPIRATION) { 279 log_assert($object !== 'false', "Can't cache false values"); 280 apc_store($cache_id, serialize($object), $ttl); 281 282 if (IA_LOG_MEM_CACHE) { 283 log_print("MEM CACHE: store $cache_id"); 284 } 285 return $object; 286 } 287 288 function mem_cache_delete($cache_id) { 289 apc_delete($cache_id); 290 if (IA_LOG_MEM_CACHE) { 291 log_print("MEM CACHE: delete $cache_id"); 292 } 293 } 294 295 function mem_cache_purge() { 296 if (IA_LOG_MEM_CACHE) { 297 log_print("MEM CACHE: purge"); 298 } 299 apc_clear_cache(); 300 } 261 301 } 262 302 -
trunk/common/common.php
r1163 r1164 332 332 333 333 // Check for retarded php.ini settings. 334 if (IA_HTTP_ENV ) {334 if (IA_HTTP_ENV && !defined('IA_HPHP_ENV')) { 335 335 log_assert(!ini_get("session.auto_start"), 336 336 "Please disable session.auto_start. It kills babies!"); -
trunk/common/db/attachment.php
r1145 r1164 151 151 // You may use % as a wildcard 152 152 function attachment_get_all($page, $name='%', $start = 0, $count = 99999999) { 153 assert(is_whole_number($start));154 assert(is_whole_number($count));153 log_assert(is_whole_number($start)); 154 log_assert(is_whole_number($count)); 155 155 $query = sprintf("SELECT ia_file.*, ia_user.username, ia_user.full_name as user_fullname 156 156 FROM ia_file … … 165 165 // _count for the above. 166 166 function attachment_get_count($page, $name='%', $start = 0, $count = 99999999) { 167 assert(is_whole_number($start));168 assert(is_whole_number($count));167 log_assert(is_whole_number($start)); 168 log_assert(is_whole_number($count)); 169 169 $query = sprintf("SELECT COUNT(*) 170 170 FROM ia_file … … 184 184 // FIXME: does this belong here? 185 185 function attachment_get_filepath($attach) { 186 assert(is_array($attach));186 log_assert(is_array($attach)); 187 187 return IA_ROOT_DIR.'attach/'. 188 188 strtolower(preg_replace('/[^a-z0-9\.\-_]/i', '_', $attach['page'])) . '_' . -
trunk/common/textblock.php
r1098 r1164 152 152 function textblock_copy_replace($srcprefix, $dstprefix, $replace, $security, 153 153 $user_id, $remote_ip_info = null) { 154 assert($srcprefix != $dstprefix); 155 assert($security === null || is_textblock_security_descriptor($security)); 156 assert(is_whole_number($user_id)); 154 log_assert($srcprefix != $dstprefix); 155 log_assert($security === null || 156 is_textblock_security_descriptor($security)); 157 log_assert(is_whole_number($user_id)); 157 158 158 159 $textblocks = textblock_get_by_prefix($srcprefix, true, false);
Note: See TracChangeset
for help on using the changeset viewer.
![[infoarena] development](/chrome/site/logo.png)