Ignore:
Timestamp:
01/14/12 16:18:10 (4 months ago)
Author:
bogdan2412
Message:

Make infoarena compatible with HPHP.

  • Implemented APC caching support since eaccelerator is not compatible with HPHP and although we support memcached, we do not use it on live.
  • Replaced instances of create_function_cached with php anonymous functions. This bumps the PHP version requirement to 5.3, but it allows the code to work with HPHP, since dynamic function generation is replaced with staticly analyzable functions. This also removes a horrible, terrible hack in Textile.php which was storing the current instance of the Textile class being processed as a static variable so that it could be accessed by anonymous functions.
  • Replaced occurrences of assert with log_assert.
  • When running under HPHP, IA_HPHP_ENV is defined and is used to bypass some incompatible code (redundant ini configuration checks).
  • Fixed some includes that were dependent on the working directory being www/
  • Included a sample HPHP configuration file and a Makefile with compilation commands.

REVIEW URL: http://reviewboard.infoarena.ro/r/182/

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/common/db/attachment.php

    r1145 r1164  
    151151// You may use % as a wildcard 
    152152function 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)); 
    155155    $query = sprintf("SELECT ia_file.*, ia_user.username, ia_user.full_name as user_fullname 
    156156                      FROM ia_file 
     
    165165// _count for the above. 
    166166function 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)); 
    169169    $query = sprintf("SELECT COUNT(*) 
    170170                      FROM ia_file 
     
    184184// FIXME: does this belong here? 
    185185function attachment_get_filepath($attach) { 
    186     assert(is_array($attach)); 
     186    log_assert(is_array($attach)); 
    187187    return IA_ROOT_DIR.'attach/'. 
    188188            strtolower(preg_replace('/[^a-z0-9\.\-_]/i', '_', $attach['page'])) . '_' . 
Note: See TracChangeset for help on using the changeset viewer.