Changeset 11845

Show
Ignore:
Timestamp:
08/30/07 10:37:46 (1 year ago)
Author:
bergie
Message:

Remove some unnecessary logging, refs #102

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/midcom.core/midcom/baseclasses/components/request.php

    r11359 r11845  
    579579    function can_handle($argc, $argv) 
    580580    { 
    581         debug_push_class($this, 'can_handle'); 
    582  
    583581        // Call the general can_handle event handler 
    584582        $result = $this->_on_can_handle($argc, $argv); 
    585583        if (! $result) 
    586584        { 
     585            debug_push_class($this, 'can_handle'); 
    587586            debug_add('The _on_can_handle event handler returned false, aborting.'); 
    588587            debug_pop(); 
     
    597596            $namespace = $argv[0]; 
    598597            $plugin = $argv[1]; 
     598            debug_push_class($this, 'can_handle'); 
    599599            debug_add("Loading the plugin {$namespace}/{$plugin}"); 
     600            debug_pop(); 
    600601            $this->_load_plugin($namespace, $plugin); 
    601602        } 
    602603 
    603         debug_add('Finally preparing the request switch for usage.'); 
    604604        $this->_prepare_request_switch(); 
    605605 
    606         debug_print_r('Checking against this argument list: ', $argv); 
    607606        foreach ($this->_request_switch as $key => $request) 
    608         { 
    609             debug_add("Checking handler ID {$key}"); 
    610              
     607        {    
    611608            $fixed_args_count = count($request['fixed_args']); 
    612609            $total_args_count = $fixed_args_count + $request['variable_args']; 
     
    614611            if (( $argc != $total_args_count && (  $request['variable_args'] >= 0 )) || $fixed_args_count > $argc) 
    615612            { 
    616                 debug_add('Argument count does not match, skipping.'); 
    617613                continue; 
    618614            } 
     
    623619                if ($argv[$i] != $request['fixed_args'][$i]) 
    624620                { 
    625                     debug_add("The argument {$i} did not match, got {$argv[$i]} should be {$request['fixed_args'][$i]}, skipping."); 
    626621                    continue 2; 
    627622                } 
     
    642637            if (method_exists($handler, $method)) 
    643638            { 
    644                 debug_add("Executing {$method} on the handler object."); 
    645639                $result = $handler->$method($this->_handler['id'], $this->_handler['args'], $this->_request_data); 
    646640                if ($result) 
    647641                { 
    648                     debug_add('The handler matches, the _can_handle callback returned true, reporting success.'); 
    649                     debug_pop(); 
    650642                    return true; 
    651643                } 
     644                else 
     645                { 
     646                    debug_push_class($this, 'can_handle'); 
     647                    debug_add("Handler method {$method} returned FALSE, we cannot handle this therefore."); 
     648                    debug_pop(); 
     649                } 
    652650            } 
    653651            else 
    654652            { 
    655                 debug_add('The handler matches, no _can_handle callback is defined, reporting success.'); 
    656                 debug_pop(); 
    657653                return true; 
    658654            } 
     
    660656 
    661657        // No match 
    662         debug_add('No match could be found, we cannot handle this therefore.'); 
     658        debug_push_class($this, 'can_handle'); 
     659        debug_add('No matching handler could be found, we cannot handle this therefore.'); 
    663660        debug_pop(); 
    664661        return false; 
     
    680677    function handle($argc, $argv) 
    681678    { 
    682         debug_push_class($this, 'handle'); 
    683  
    684679        // Init 
    685680        $handler =& $this->_handler['handler'][0]; 
     
    708703        if (! $result) 
    709704        { 
     705            debug_push_class($this, 'handle'); 
    710706            debug_add('The _on_handle event handler returned false, aborting.'); 
    711707            debug_pop(); 
     
    730726            $_MIDCOM->cache->content->expires($this->_handler['expires']); 
    731727        } 
    732         debug_pop(); 
     728 
    733729        return $result; 
    734730    } 
     
    801797 
    802798    } 
    803  
    804     /** 
    805      * Returns the metadata of the currently selected object. It uses a callback to determine 
    806      * a metadata object which contains the neccessary information. 
    807      * 
    808      * This interface function is no longer in use in MidCOM 2.4 upwards. Instead, the framework 
    809      * accesses the metadata information directly. 
    810      * 
    811      * @return Array Metadata information 
    812      * @see _on_get_metadata() 
    813      * @deprecated in MidCOM 2.4 
    814      */ 
    815     function get_metadata() 
    816     { 
    817         $metadata =& $this->_on_get_metadata(); 
    818         if (is_null($metadata)) 
    819         { 
    820             return false; 
    821         } 
    822         $creator = $metadata->get('creator'); 
    823         $editor = $metadata->get('editor'); 
    824         return array 
    825         ( 
    826             MIDCOM_META_CREATOR => $creator->id, 
    827             MIDCOM_META_EDITOR  => $editor->id, 
    828             MIDCOM_META_CREATED => $metadata->get('created'), 
    829             MIDCOM_META_EDITED  => $metadata->get('editor') 
    830         ); 
    831     } 
    832  
    833799 
    834800    /** 
  • trunk/midcom/midcom.core/midcom/services/auth.php

    r11843 r11845  
    810810            return true; 
    811811        } 
    812         debug_push_class(__CLASS__, __FUNCTION__); 
    813         if (is_null($user)) 
    814         { 
    815             debug_add("Querying privilege {$privilege} to {$object_class} {$object_guid}", MIDCOM_LOG_DEBUG); 
    816         } 
    817         else 
    818         { 
    819             if (is_string($user)) 
    820             { 
    821                 debug_add("Querying privilege {$privilege} to {$object_class} {$object_guid} (for user {$user})", MIDCOM_LOG_DEBUG); 
    822             } 
    823             else 
    824             { 
    825                 debug_add("Querying privilege {$privilege} to {$object_class} {$object_guid} (for user {$user->id})", MIDCOM_LOG_DEBUG); 
    826             } 
    827         } 
    828812         
    829813        if ($this->_internal_sudo) 
    830814        { 
    831             debug_add('INTERNAL SUDO mode is enabled. Generic Read-Only mode set.', MIDCOM_LOG_DEBUG); 
    832             debug_pop(); 
     815            //debug_push_class(__CLASS__, __FUNCTION__); 
     816            //debug_add('INTERNAL SUDO mode is enabled. Generic Read-Only mode set.', MIDCOM_LOG_DEBUG); 
     817            //debug_pop(); 
    833818            return $this->_can_do_internal_sudo($privilege); 
    834819        } 
     
    836821        if ($this->_component_sudo) 
    837822        { 
    838             debug_pop(); 
    839823            return true; 
    840824        } 
     
    865849            } 
    866850        } 
    867         debug_add("privilege_key={$privilege_key}"); 
     851 
    868852        if (!array_key_exists($privilege_key, $cached_privileges)) 
    869853        { 
     854            debug_push_class(__CLASS__, __FUNCTION__);         
    870855            debug_add("Cache miss, fetching privileges for {$object_guid}"); 
    871856            debug_pop(); 
     
    874859            if (! array_key_exists($privilege, $full_privileges)) 
    875860            { 
     861                debug_push_class(__CLASS__, __FUNCTION__);             
    876862                debug_add("The privilege {$privilege} is unknown at this point. Assuming not granted privilege.", MIDCOM_LOG_WARN); 
    877863                debug_pop();