[pLog-svn] r847 - in plog/trunk/class: locale template/menu

Oscar Renalias phunkphorce at gmail.com
Wed Jan 26 11:26:09 GMT 2005


doing some memory profiling would be interesting but it could also
take a lot of time and I am not sure if there are any good tools for
doing this kind of things in php... It could be a pain to do this
manually!

Oscar


On Wed, 26 Jan 2005 10:11:46 +0000 (GMT), ork at devel.plogworld.net
<ork at devel.plogworld.net> wrote:
> Author: ork
> Date: 2005-01-26 10:11:45 +0000 (Wed, 26 Jan 2005)
> New Revision: 847
> 
> Modified:
>    plog/trunk/class/locale/locale.class.php
>    plog/trunk/class/template/menu/menurenderer.class.php
> Log:
> added few debugging info. changed menurenderer to not load locales all
> the time. :)
> the unsetting of loaded locale infos works well, we still have more than
> 7 megs located just for the dashboard. i'll take a look where all the
> memory went to :)
> 
> Modified: plog/trunk/class/locale/locale.class.php
> ===================================================================
> --- plog/trunk/class/locale/locale.class.php    2005-01-25 23:44:21 UTC (rev 846)
> +++ plog/trunk/class/locale/locale.class.php    2005-01-26 10:11:45 UTC (rev 847)
> @@ -92,6 +92,10 @@
>                                 include( $fileName );
> 
>                         $this->_messages = $messages;
> +
> +            unset($messages);
> +
> +            $this->log->debug('Memory used after loading locale ' . $this->_code . ': ' . memory_get_usage());
>                 }
> 
>                 /**
> @@ -114,6 +118,7 @@
> 
>                         unset( $this->_messages );
>                         $this->_messages = NULL;
> +            $this->log->debug('Freeing memory for locate ' . $this->_code . ': ' . memory_get_usage());
> 
>                         return( true );
>                 }
> @@ -190,8 +195,9 @@
>                 function getString( $id )
>                 {
>                         // load the file if it hadn't been loaded yet
> -                       if( !is_array($this->_messages))
> +                       if( !is_array($this->_messages)) {
>                                 $this->_loadLocaleFile();
> +            }
> 
>                         $string = $this->_messages[ $id ];
>              if( $string == "" )
> 
> Modified: plog/trunk/class/template/menu/menurenderer.class.php
> ===================================================================
> --- plog/trunk/class/template/menu/menurenderer.class.php       2005-01-25 23:44:21 UTC (rev 846)
> +++ plog/trunk/class/template/menu/menurenderer.class.php       2005-01-26 10:11:45 UTC (rev 847)
> @@ -28,7 +28,7 @@
> 
>                         // load the right locale
>                         if( $blogInfo != null ) {
> -                               $this->_locale = $blogInfo->getLocale();
> +                               $this->_locale =& $blogInfo->getLocale();
>                         }
>                         else {
>                                 $localeCode = $config->getValue( "default_locale" );
> 
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.plogworld.net
> http://devel.plogworld.net/mailman/listinfo/plog-svn
>



More information about the pLog-svn mailing list