Changeset 17898

Show
Ignore:
Timestamp:
10/03/08 16:57:33 (2 months ago)
Author:
bergie
Message:

Various cleanups and fewer debug messages

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/midcom.core/midcom/application.php

    r17843 r17898  
    493493    public function content() 
    494494    { 
    495  
    496  
    497  
    498         debug_push_class(__CLASS__, __FUNCTION__); 
    499  
    500495        // Enter Context 
    501         debug_add("Entering Context 0 (old Context: {$this->_currentcontext})", MIDCOM_LOG_DEBUG); 
    502496        $oldcontext = $this->_currentcontext; 
     497        if ($oldcontext != 0) 
     498        { 
     499            debug_push_class(__CLASS__, __FUNCTION__); 
     500            debug_add("Entering Context 0 (old Context: {$this->_currentcontext})", MIDCOM_LOG_DEBUG); 
     501            debug_pop(); 
     502        } 
    503503        $this->_currentcontext = 0; 
    504504        $this->style->enter_context(0); 
     
    507507 
    508508        // Leave Context 
    509         debug_add("Leaving Context 0 (new Context: {$oldcontext})", MIDCOM_LOG_DEBUG); 
     509        if ($oldcontext != 0) 
     510        { 
     511            debug_push_class(__CLASS__, __FUNCTION__); 
     512            debug_add("Leaving Context 0 (new Context: {$oldcontext})", MIDCOM_LOG_DEBUG); 
     513            debug_pop(); 
     514        } 
     515 
    510516        $this->style->leave_context(); 
    511517        $this->_currentcontext = $oldcontext; 
    512  
    513         debug_pop(); 
    514518    } 
    515519 
     
    12261230    private function _output() 
    12271231    { 
    1228         debug_push_class(__CLASS__, __FUNCTION__); 
    12291232        ob_start(); 
    12301233 
    1231         debug_add("We are operating in Context {$this->_currentcontext}.", MIDCOM_LOG_DEBUG); 
     1234        //debug_add("We are operating in Context {$this->_currentcontext}.", MIDCOM_LOG_DEBUG); 
    12321235 
    12331236        if (!$this->skip_page_style) 
     
    12381241        if ($this->get_context_data(MIDCOM_CONTEXT_REQUESTTYPE) != MIDCOM_REQUEST_CONTENT) 
    12391242        { 
     1243            debug_push_class(__CLASS__, __FUNCTION__); 
    12401244            debug_add("Unkown Request Type encountered:" . $this->_context[$this->current_context][MIDCOM_CONTEXT_REQUESTTYPE], MIDCOM_LOG_ERROR); 
     1245            debug_pop(); 
    12411246            $this->generate_error(MIDCOM_ERRCRIT, "Unkown Request Type encountered:" . $this->_context[$this->current_context][MIDCOM_CONTEXT_REQUESTTYPE]); 
    12421247        } 
     
    12641269            ob_end_clean(); 
    12651270        } 
    1266  
    1267         debug_pop(); 
    12681271    } 
    12691272 
     
    16311634            || !array_key_exists($key, $this->_context[$contextid][MIDCOM_CONTEXT_CUSTOMDATA][$component])) 
    16321635        { 
    1633             debug_push("midcom_application::get_custom_context_data"); 
    1634             $midcom_errstr = "Requested Key ID $key or the component $component is invalid."; 
    1635             debug_add($midcom_errstr, MIDCOM_LOG_WARN); 
    1636             debug_pop(); 
     1636            //debug_push("midcom_application::get_custom_context_data"); 
     1637            $midcom_errstr = "Requested Key ID {$key} for the component {$component} is invalid."; 
     1638            //debug_add($midcom_errstr, MIDCOM_LOG_WARN); 
     1639            //debug_pop(); 
    16371640            $result = false; 
    16381641            return $result; 
     
    16711674    function substyle_append ($newsub) 
    16721675    { 
    1673         if ($this->_status < MIDCOM_STATUS_HANDLE) { 
     1676        if ($this->_status < MIDCOM_STATUS_HANDLE)  
     1677        { 
    16741678            $this->generate_error(MIDCOM_ERRCRIT, "Cannot do a substyle_append before the HANDLE phase."); 
    16751679        } 
    16761680 
    1677         debug_push("midcom_application::substyle_append"); 
    1678  
    16791681        $current_style = $this->_context[$this->_currentcontext][MIDCOM_CONTEXT_SUBSTYLE]; 
    16801682 
    16811683        if (strlen($current_style) > 0) 
    1682             $newsub = $current_style . "/" . $newsub; 
    1683  
    1684         debug_add("Updating Component Context Substyle from $current_style to $newsub", MIDCOM_LOG_DEBUG); 
     1684        { 
     1685            $newsub = $current_style . '/' . $newsub; 
     1686        } 
     1687 
     1688        //debug_push_class(__CLASS__, __FUNCTION__); 
     1689        //debug_add("Updating Component Context Substyle from '{$current_style}' to '{$newsub}'", MIDCOM_LOG_DEBUG); 
     1690        //debug_pop(); 
    16851691 
    16861692        $this->_context[$this->_currentcontext][MIDCOM_CONTEXT_SUBSTYLE] = $newsub; 
    1687         debug_pop(); 
    16881693    } 
    16891694 
     
    22712276        } 
    22722277 
    2273         debug_push("midcom_application::serve_attachment"); 
    2274  
    22752278        // Sanity check expires 
    22762279        if (   !is_int($expires) 
    22772280            || $expires < -1) 
    22782281        { 
    2279             $this->generate_error(MIDCOM_ERRCRIT, "\$expires has to be a positive integer or zero or -1."); 
     2282            $this->generate_error(MIDCOM_ERRCRIT, "\$expires has to be a positive integer or zero or -1, is now {$expires}."); 
    22802283            // This will exit() 
    22812284        } 
     
    22962299        { 
    22972300 
    2298             debug_add('_check_not_modified returned true, finishing up here then'); 
     2301            //debug_add('_check_not_modified returned true, finishing up here then'); 
    22992302            if (!headers_sent()) 
    23002303            { 
    2301                 debug_add('For the weirdest reason headers have not been sent by _check_not_modified, send them again'); 
     2304                //debug_add('For the weirdest reason headers have not been sent by _check_not_modified, send them again'); 
    23022305                $this->cache->content->cache_control_headers(); 
    23032306                // Doublemakesure these are present 
     
    23062309            } 
    23072310            while(@ob_end_flush()); 
    2308             debug_add('headers sent, exit()ing so nothing has a chance the mess things up anymore'); 
    2309             debug_pop(); 
     2311            //debug_add('headers sent, exit()ing so nothing has a chance the mess things up anymore'); 
     2312            //debug_pop(); 
    23102313            exit(); 
    23112314        } 
  • trunk/midcom/midcom.core/midcom/baseclasses/core/dbobject.php

    r17869 r17898  
    15611561            if (! $_MIDCOM->auth->can_do('midgard:read', $object)) 
    15621562            { 
    1563                 debug_push_class($object, __FUNCTION__); 
    1564                 debug_add("Failed to load object, read privilege on the {$object->__table__} ID {$object->id} not granted for the current user.", 
    1565                     MIDCOM_LOG_ERROR); 
     1563                //debug_push_class($object, __FUNCTION__); 
     1564                //debug_add("Failed to load object, read privilege on the {$object->__table__} ID {$object->id} not granted for the current user.", 
     1565                //    MIDCOM_LOG_ERROR); 
    15661566                midcom_baseclasses_core_dbobject::_clear_object($object); 
    1567                 debug_pop(); 
     1567                //debug_pop(); 
    15681568                return false; 
    15691569            } 
     
    15801580        else 
    15811581        { 
    1582             debug_push_class($object, __FUNCTION__); 
    1583             debug_add("Failed to load the record identified by path {$path}, last Midgard error was: " . mgd_errstr(), MIDCOM_LOG_INFO); 
    1584             debug_pop(); 
     1582            //debug_push_class($object, __FUNCTION__); 
     1583            //debug_add("Failed to load the record identified by path {$path}, last Midgard error was: " . mgd_errstr(), MIDCOM_LOG_INFO); 
     1584            //debug_pop(); 
    15851585            return false; 
    15861586        } 
  • trunk/midcom/midcom.core/midcom/helper/_styleloader.php

    r17558 r17898  
    6161 * @package midcom 
    6262 */ 
    63 class midcom_helper__styleloader { 
    64  
    65     /** 
    66      * @ignore 
    67      */ 
    68     var $_debug_prefix; 
    69  
     63class midcom_helper__styleloader  
     64
    7065    /** 
    7166     * Current style scope 
     
    152147    function __construct() 
    153148    { 
    154         $this->_debug_prefix = "midcom_helper__styleloader::"; 
    155  
    156149        $this->_context = array (); 
    157150        $this->_scope = array (); 
     
    208201    function get_style_id_from_path($path, $rootstyle = 0) 
    209202    { 
    210         debug_push_class(__CLASS__, __FUNCTION__); 
    211  
    212203        $path = preg_replace("/^\/(.*)/", "$1", $path); // leading "/" 
    213204        $path_array = explode('/', $path); 
     
    526517        { 
    527518            debug_push_class(__CLASS__, __FUNCTION__); 
    528             debug_add("Trying to show '$path' but there is no context set", MIDCOM_LOG_INFO); 
     519            debug_add("Trying to show '{$path}' but there is no context set", MIDCOM_LOG_INFO); 
    529520            debug_pop(); 
    530521            return false; 
     
    640631        { 
    641632            debug_push_class(__CLASS__, __FUNCTION__); 
    642             debug_add("The element {$path} could not be found.", MIDCOM_LOG_INFO); 
     633            debug_add("The element '{$path}' could not be found.", MIDCOM_LOG_INFO); 
    643634            debug_pop(); 
    644635            return false; 
     
    789780    function prepend_styledir ($dirname) 
    790781    { 
    791         if (!file_exists(MIDCOM_ROOT . $dirname)) { 
    792             $_MIDCOM->generate_error(MIDCOM_ERRCRIT,"Styledirectory $dirname does not exist!"); 
     782        if (!file_exists(MIDCOM_ROOT . $dirname)) 
     783        { 
     784            $_MIDCOM->generate_error(MIDCOM_ERRCRIT, "Style directory {$dirname} does not exist."); 
    793785        } 
    794786        $this->_styledirs_prepend[] = $dirname; 
  • trunk/midcom/midcom.core/midcom/services/_sessioning.php

    r17686 r17898  
    6565        if ($started) 
    6666        { 
    67       $_MIDCOM->generate_error(MIDCOM_ERRCRIT, "MidCOM Sessioning has already been started, it must not be started twice. Aborting"); 
     67            $_MIDCOM->generate_error(MIDCOM_ERRCRIT, "MidCOM Sessioning has already been started, it must not be started twice. Aborting"); 
    6868        } 
    6969 
    7070        $started = true; 
    71  
    7271    } 
    7372 
     
    120119 
    121120        // Check for session data and load or initialize it, if necessary 
    122         if (! array_key_exists("midcom_session_data", $_SESSION)) 
    123         { 
    124             $_SESSION["midcom_session_data"] = Array(); 
    125             $_SESSION["midcom_session_data"]["midcom.service.sessioning"]["startup"] = serialize(time()); 
     121        if (! array_key_exists('midcom_session_data', $_SESSION)) 
     122        { 
     123            $_SESSION['midcom_session_data'] = Array(); 
     124            $_SESSION['midcom_session_data']['midcom.service.sessioning']['startup'] = serialize(time()); 
    126125        } 
    127126        $initialized = true; 
     
    138137     * @return boolean                Indicating availability. 
    139138     */ 
    140     function exists ($domain, $key) 
     139    function exists($domain, $key) 
    141140    { 
    142141        if (!$this->_initialize()) 
     
    144143            return false; 
    145144        } 
    146         if (! array_key_exists($domain, $_SESSION["midcom_session_data"])) 
     145        if (!isset($_SESSION['midcom_session_data'][$domain])) 
    147146        { 
    148147            debug_push_class(__CLASS__, __FUNCTION__); 
    149             debug_add("Request for the domain [{$domain}] failed, because the domain doesn't exist."); 
     148            debug_add("Request for the domain '{$domain}' failed, because the domain doesn't exist."); 
    150149            debug_pop(); 
    151150            return false; 
    152151        } 
    153152 
    154         if (! array_key_exists($key, $_SESSION["midcom_session_data"][$domain])) 
    155         { 
    156             debug_push_class(__CLASS__, __FUNCTION__); 
    157             debug_add("Request for the key [{$key}] in the domain [{$domain}] failed, because the key doesn't exist."); 
    158             debug_pop(); 
     153        if (!isset($_SESSION['midcom_session_data'][$domain][$key])) 
     154        { 
    159155            return false; 
    160156        } 
     
    203199        else 
    204200        { 
     201            debug_push_class(__CLASS__, __FUNCTION__); 
     202            debug_add("Request for the key '{$key}' in the domain '{$domain}' failed, because the key doesn't exist."); 
     203            debug_pop(); 
    205204            return null; 
    206205        } 
  • trunk/midcom/midcom.core/midcom/services/cache/backend/memcached.php

    r17556 r17898  
    5757     * @var Memcache 
    5858     */ 
    59     var $_cache = null; 
     59    static $memcache = null; 
    6060     
    6161    /** 
     
    9696 
    9797        // Open the persistant connection. 
    98         $this->_cache = new Memcache(); 
    99         if (! @$this->_cache->pconnect($this->_host, $this->_port)) 
    100         { 
    101             // Memcache connection failed 
    102             if ($this->_abort_on_fail) 
     98        if (is_null(self::$memcache)) 
     99        { 
     100            self::$memcache = new Memcache(); 
     101            if (! @self::$memcache->pconnect($this->_host, $this->_port)) 
    103102            { 
    104                 // Abort the request 
    105                 /** 
    106                  * We don't have the superglobal initialized yet 
    107                 $_MIDCOM->generate_error(MIDCOM_ERRCRIT, "memcache handler: Failed to connect to {$this->_host}:{$this->_port}."); 
    108                  */ 
    109                 header('HTTP/1.0 503 Service Unavailable'); 
    110                 header('Retry-After: 60'); 
    111                 header('Cache-Control: no-store, no-cache, must-revalidate'); 
    112                 header('Cache-Control: post-check=0, pre-check=0', false); 
    113                 header('Pragma: no-cache'); 
    114                 die("memcache handler: Failed to connect to {$this->_host}:{$this->_port}."); 
    115                 // This will exit. 
     103                // Memcache connection failed 
     104                if ($this->_abort_on_fail) 
     105                { 
     106                    // Abort the request 
     107                    /** 
     108                     * We don't have the superglobal initialized yet 
     109                    $_MIDCOM->generate_error(MIDCOM_ERRCRIT, "memcache handler: Failed to connect to {$this->_host}:{$this->_port}."); 
     110                     */ 
     111                    header('HTTP/1.0 503 Service Unavailable'); 
     112                    header('Retry-After: 60'); 
     113                    header('Cache-Control: no-store, no-cache, must-revalidate'); 
     114                    header('Cache-Control: post-check=0, pre-check=0', false); 
     115                    header('Pragma: no-cache'); 
     116                    die("memcache handler: Failed to connect to {$this->_host}:{$this->_port}."); 
     117                    // This will exit. 
     118                } 
     119                 
     120                // Otherwise we just skip caching 
     121                debug_push_class(__CLASS__, __FUNCTION__); 
     122                debug_add("memcache handler: Failed to connect to {$this->_host}:{$this->_port}. Serving this request without cache.", MIDCOM_LOG_ERROR); 
     123                debug_pop(); 
     124                $this->_memcache_operational = false; 
    116125            } 
    117              
    118             // Otherwise we just skip caching 
    119             debug_push_class(__CLASS__, __FUNCTION__); 
    120             debug_add("memcache handler: Failed to connect to {$this->_host}:{$this->_port}. Serving this request without cache.", MIDCOM_LOG_ERROR); 
    121             debug_pop(); 
    122             $this->_memcache_operational = false; 
    123126        } 
    124127 
    125128        /* 
    126129        debug_push_class(__CLASS__, __FUNCTION__); 
    127         debug_print_r('Current MemCache stats:', $this->_cache->getStats()); 
     130        debug_print_r('Current MemCache stats:', self::$memcache->getStats()); 
    128131        debug_pop(); 
    129132        */ 
     
    151154        /* TODO: Remove when done 
    152155        debug_push_class(__CLASS__, __FUNCTION__); 
    153         debug_add("Returning \$this->_cache->get('{$key}')"); 
    154         debug_pop(); 
    155         */ 
    156         return (@$this->_cache->get($key)); 
     156        debug_add("Returning \self::$memcache->get('{$key}')"); 
     157        debug_pop(); 
     158        */ 
     159        return (@self::$memcache->get($key)); 
    157160    } 
    158161 
     
    169172            /* TODO: Remove when done 
    170173            debug_push_class(__CLASS__, __FUNCTION__); 
    171             debug_add("Returning \$this->_cache->set('{$key}', \$data, 0, {$timeout})"); 
     174            debug_add("Returning \self::$memcache->set('{$key}', \$data, 0, {$timeout})"); 
    172175            debug_pop(); 
    173176            */ 
    174             @$this->_cache->set($key, $data, 0, $timeout); 
    175             return; 
    176         } 
    177         /* TODO: Remove when done 
    178         debug_push_class(__CLASS__, __FUNCTION__); 
    179         debug_add("Returning \$this->_cache->set('{$key}', \$data)"); 
    180         debug_pop(); 
    181         */ 
    182         @$this->_cache->set($key, $data); 
     177            @self::$memcache->set($key, $data, 0, $timeout); 
     178            return; 
     179        } 
     180        /* TODO: Remove when done 
     181        debug_push_class(__CLASS__, __FUNCTION__); 
     182        debug_add("Returning \self::$memcache->set('{$key}', \$data)"); 
     183        debug_pop(); 
     184        */ 
     185        @self::$memcache->set($key, $data); 
    183186    } 
    184187 
     
    193196        /* TODO: Remove when done 
    194197        debug_push_class(__CLASS__, __FUNCTION__); 
    195         debug_add("Returning \$this->_cache->delete('{$key}')"); 
    196         debug_pop(); 
    197         */ 
    198         @$this->_cache->delete($key); 
     198        debug_add("Returning \self::$memcache->delete('{$key}')"); 
     199        debug_pop(); 
     200        */ 
     201        @self::$memcache->delete($key); 
    199202    } 
    200203 
     
    207210         
    208211        debug_push_class(__CLASS__, __FUNCTION__); 
    209         debug_add("Calling \$this->_cache->flush()"); 
    210         $stat = @$this->_cache->flush(); 
    211         debug_add("\$this->_cache->flush() returnder with " . (int)$stat); 
     212        debug_add("Calling \self::$memcache->flush()"); 
     213        $stat = @self::$memcache->flush(); 
     214        debug_add("\self::$memcache->flush() returnder with " . (int)$stat); 
    212215        debug_pop(); 
    213216    } 
  • trunk/midcom/midcom.core/midcom/services/cache/module/content.php

    r17888 r17898  
    399399                break; 
    400400            default: 
    401                 debug_add("Cache headers strategy '{$this->_headers_strategy}' is not valid, try 'no-cache', 'revalidate', 'public' or 'private'", MIDCOM_LOG_ERROR); 
     401                $message = "Cache headers strategy '{$this->_headers_strategy}' is not valid, try 'no-cache', 'revalidate', 'public' or 'private'"; 
     402                debug_push_class(__CLASS__, __FUNCTION__); 
     403                debug_add($message, MIDCOM_LOG_ERROR); 
     404                debug_pop(); 
    402405                $this->no_cache(); 
    403406                /* Copied from midcom_application::generate_error, because we do not yet have midcom fully loaded */ 
    404                 $message = "Cache headers strategy '{$this->_headers_strategy}' is not valid, try 'no-cache', 'revalidate', 'public' or 'private'"; 
    405407                $title = "Server Error"; 
    406408                $code = 500; 
     
    541543                $this->_meta_cache->close();             
    542544                debug_push_class(__CLASS__, __FUNCTION__); 
    543                 debug_add("Current page is in cache, but has expired.", MIDCOM_LOG_INFO); 
     545                debug_add('Current page is in cache, but has expired on ' . gmdate('c', $data['expires']), MIDCOM_LOG_INFO); 
    544546                debug_pop(); 
    545547                return; 
    546548            } 
    547549        } 
     550 
    548551        $this->_meta_cache->close(); 
    549552        header("X-MidCOM-meta-cache: HIT {$content_id}", false); 
     
    559562                $this->_data_cache->close(); 
    560563                debug_push_class(__CLASS__, __FUNCTION__); 
    561                 debug_add("Current page is in not in the data cache, (possible ghost read).", MIDCOM_LOG_WARN); 
     564                debug_add("Current page is in not in the data cache, possible ghost read.", MIDCOM_LOG_WARN); 
    562565                debug_pop(); 
    563566                return; 
    564567            } 
     568 
    565569            header("X-MidCOM-data-cache: HIT {$content_id}"); 
    566570            $content = $this->_data_cache->get($content_id); 
     
    784788    function invalidate($guid) 
    785789    { 
    786         debug_push_class(__CLASS__, __FUNCTION__); 
    787790        $this->_meta_cache->open(); 
    788791 
    789792        if (!$this->_meta_cache->exists($guid)) 
    790793        { 
    791             debug_add("no entry for {$guid} in meta cache"); 
     794            debug_push_class(__CLASS__, __FUNCTION__); 
     795            debug_add("No entry for {$guid} in meta cache, ignoring invalidation request."); 
    792796            debug_pop(); 
    793797            return; 
     
    800804            if ($this->_meta_cache->exists($content_id)) 
    801805            { 
    802                 debug_add("Removing key {$content_id} from meta cache"); 
     806                //debug_push_class(__CLASS__, __FUNCTION__); 
     807                //debug_add("Removing key {$content_id} from meta cache"); 
     808                //debug_pop() 
    803809                $this->_meta_cache->remove($content_id); 
    804810            } 
     
    806812            if ($this->_data_cache->exists($content_id)) 
    807813            { 
    808                 debug_add("Removing key {$content_id} from data cache"); 
     814                //debug_push_class(__CLASS__, __FUNCTION__); 
     815                //debug_add("Removing key {$content_id} from data cache"); 
     816                //debug_pop(); 
    809817                $this->_data_cache->remove($content_id); 
    810818            } 
    811819        } 
    812         debug_pop(); 
    813820    } 
    814821 
     
    10861093    function check_dl_hit(&$context, &$dl_config) 
    10871094    { 
    1088         debug_push_class(__CLASS__, __FUNCTION__); 
     1095        //debug_push_class(__CLASS__, __FUNCTION__); 
    10891096        if (   $this->_no_cache 
    10901097            || $this->_live_mode) 
    10911098        { 
    1092             debug_add('no_cache/live mode, not checking any further'); 
    1093             debug_pop(); 
    10941099            return false; 
    10951100        } 
    10961101        $dl_request_id = 'DL' . $this->generate_request_identifier($context, $dl_config); 
    1097         debug_add("Checking if we have '{$dl_request_id}' in \$this->_meta_cache"); 
     1102        //debug_add("Checking if we have '{$dl_request_id}' in \$this->_meta_cache"); 
    10981103        $this->_meta_cache->open(); 
    10991104        if ($this->_meta_cache->exists($dl_request_id)) 
     
    11021107            $this->_meta_cache->close(); 
    11031108            $this->_data_cache->open(); 
    1104             debug_add("Checking if we have '{$dl_content_id}' in \$this->_data_cache"); 
     1109            //debug_add("Checking if we have '{$dl_content_id}' in \$this->_data_cache"); 
    11051110            if ($this->_data_cache->exists($dl_content_id)) 
    11061111            { 
    1107                 debug_add('Cached content found, serving it'); 
     1112                //debug_add('Cached content found, serving it'); 
    11081113                echo $this->_data_cache->get($dl_content_id); 
    11091114                $this->_data_cache->close(); 
     
    11111116                return true; 
    11121117            } 
    1113             debug_add("We received content_id ({$dl_content_id}), but did not find corresponding data in cache", MIDCOM_LOG_INFO); 
     1118            //debug_add("We received content_id ({$dl_content_id}), but did not find corresponding data in cache", MIDCOM_LOG_INFO); 
    11141119            $this->_data_cache->close(); 
    11151120        } 
     
    11181123            $this->_meta_cache->close(); 
    11191124        } 
    1120         debug_pop(); 
     1125        //debug_pop(); 
    11211126        return false; 
    11221127    } 
     
    11241129    function store_dl_content(&$context, &$dl_config, &$dl_cache_data) 
    11251130    { 
    1126         debug_push_class(__CLASS__, __FUNCTION__); 
     1131        //debug_push_class(__CLASS__, __FUNCTION__); 
    11271132        if (   $this->_no_cache 
    11281133            || $this->_live_mode) 
    11291134        { 
    1130             debug_add('no_cache/live mode, not storing data'); 
    1131             debug_pop(); 
    11321135            return; 
    11331136        } 
    11341137        if ($this->_uncached) 
    11351138        { 
    1136             debug_add('Uncached mode, not storing data'); 
    1137             debug_pop(); 
    11381139            return; 
    11391140        } 
     
    11471148        $this->_data_cache->open(true); 
    11481149        $this->_meta_cache->put($dl_request_id, $dl_content_id); 
    1149         debug_add("Writing cache entry for '{$dl_content_id}' in request '{$dl_request_id}'"); 
     1150        //debug_add("Writing cache entry for '{$dl_content_id}' in request '{$dl_request_id}'"); 
    11501151        $this->_data_cache->put($dl_content_id, $dl_cache_data); 
    11511152        // Cache where the object have been 
     
    11551156        $this->_data_cache->close(); 
    11561157        unset($dl_cache_data, $dl_content_id, $dl_request_id); 
    1157         debug_pop(); 
     1158        //debug_pop(); 
    11581159    } 
    11591160 
     
    12521253 
    12531254            debug_push_class(__CLASS__, __FUNCTION__); 
    1254             debug_add("Setting last modified to the timestamp {$time} which is: " . gmdate("D, d M Y H:i:s", $time) . ' GMT'); 
     1255            debug_add("Setting last modified to " . gmdate('c', $time)); 
    12551256            debug_pop(); 
    12561257 
    1257             $header = "Last-Modified: " . gmdate("D, d M Y H:i:s", $time) . ' GMT'; 
     1258            $header = "Last-Modified: " . gmdate('D, d M Y H:i:s', $time) . ' GMT'; 
    12581259            header ($header); 
    12591260            $this->_sent_headers[] = $header; 
     
    12701271    function cache_control_headers() 
    12711272    { 
    1272         debug_push_class(__CLASS__, __FUNCTION__); 
     1273        //debug_push_class(__CLASS__, __FUNCTION__); 
    12731274        // Add Expiration and Cache Control headers 
    12741275        $cache_control = false; 
     
    13311332            header ($header); 
    13321333            $this->_sent_headers[] = $header; 
    1333             debug_add("Added Header '{$header}'"); 
     1334            //debug_add("Added Header '{$header}'"); 
    13341335        } 
    13351336        if ($pragma !== false) 
     
    13381339            header ($header); 
    13391340            $this->_sent_headers[] = $header; 
    1340             debug_add("Added Header '{$header}'"); 
     1341            //debug_add("Added Header '{$header}'"); 
    13411342        } 
    13421343        if ($expires !== false) 
     
    13451346            header ($header); 
    13461347            $this->_sent_headers[] = $header; 
    1347             debug_add("Added Header '{$header}'"); 
    1348         } 
    1349         debug_pop(); 
     1348            //debug_add("Added Header '{$header}'"); 
     1349        } 
     1350        //debug_pop(); 
    13501351    } 
    13511352} 
  • trunk/midcom/midcom.core/midcom/services/dbclassloader.php

    r17869 r17898  
    12391239             
    12401240            if (   !empty($component) 
    1241                 && isset($_MIDCOM->componentloader->manifests[$component])) 
    1242             { 
    1243                 debug_push_class(__CLASS__, __FUNCTION__); 
    1244                 debug_add("Loading component {$component} to get DBA class {$classname}.", MIDCOM_LOG_INFO); 
     1241                && isset($_MIDCOM->componentloader->manifests[$component]) 
     1242                && !$_MIDCOM->componentloader->is_loaded($component)) 
     1243            { 
     1244                //debug_push_class(__CLASS__, __FUNCTION__); 
     1245                //debug_add("Loading component {$component} to get DBA class {$classname}.", MIDCOM_LOG_INFO); 
    12451246                $_MIDCOM->componentloader->load_graceful($component); 
    1246                 debug_pop(); 
     1247                //debug_pop(); 
    12471248                return true; 
    12481249            } 
  • trunk/midcom/midcom.helper.datamanager2/formmanager.php

    r17858 r17898  
    175175    function _load_type_qfrules($fieldname) 
    176176    { 
     177        static $initialized = array(); 
     178 
    177179        $config = $this->_schema->fields[$fieldname]; 
    178180        $filename = MIDCOM_ROOT . "/midcom/helper/datamanager2/QuickForm_rules/{$config['type']}.php"; 
    179181        $classname = "midcom_helper_datamanager2_qfrule_{$config['type']}_manager"; 
    180         if (class_exists($classname)) 
     182        if (!isset($initialized[$classname])) 
    181183        { 
    182184            // We have already initialized rules for this type 
     
    188190            return; 
    189191        } 
    190         include_once($filename); 
     192        include($filename); 
    191193        $manager = new $classname(); 
    192194        $manager->register_rules($this->form); 
     195        $initialized[$classname] = true; 
    193196    } 
    194197 
  • trunk/midcom/net.nemein.tag/handler.php

    r17813 r17898  
    266266        $qb = net_nemein_tag_link_dba::new_query_builder(); 
    267267        $qb->add_constraint('fromGuid', '=', $guid); 
    268         if (class_exists('midgard_query_builder')) 
    269         { 
    270             // 1.8 branch allows ordering by linked properties 
    271             // PONDER: Order by metadata->navorder or by tag alpha ?? 
    272             $qb->add_order('tag.tag', 'ASC'); 
    273         } 
     268        $qb->add_order('tag.tag', 'ASC'); 
    274269        $links = $qb->execute(); 
    275270        if (!is_array($links)) 
     
    286281            $tags[$tagname] = $tag->url; 
    287282        } 
    288         debug_push_class(__CLASS__, __FUNCTION__); 
    289         debug_print_r("Tags for {$guid}: ", $tags); 
    290         debug_pop(); 
    291283        return $tags; 
    292284    }