Re: [3.1 SVN] tmp/chemin.txt est ré écrit à chaque hit

Gilles Vincent <[email protected]>
Newsgroups gmane.comp.web.spip.devel
Message-ID <CA+Q4CmveETs4mfqrTjY=XUVApifDEXE0CDqwhx3Rv3XqjpybgQ@mail.gmail.com>
Je ne comprends pas, les logs aussi sont écris à chaque hit.
En quoi est-ce gênant ?

Tu proposerais que le chemin soit mis en cache ?
Quel gain de performance est-ce que cela représenterait selon toi ?

On Mon, Oct 26, 2015 at 5:48 PM, RealET <[email protected]> wrote:

> Bonjour,
>
> Nicod a signalé ça sur IRC.
> J'ai instrumenté utils.php :
>         foreach(creer_chemin() as $dir) {
>                 if (!isset($dirs[$a = $dir . $dirname]))
>                         $dirs[$a] = (is_dir(_ROOT_CWD . $a) || !$a) ;
>                 if ($dirs[$a]) {
>                         if (file_exists(_ROOT_CWD . ($a .= $file))) {
>                                 if ($include AND
> !isset($inc[$dirname][$file])) {
>                                         include_once _ROOT_CWD . $a;
>                                         $inc[$dirname][$file] =
> $inc[''][$dirname . $file] = true;
>                                 }
>                                 if (!defined('_SAUVER_CHEMIN')) {
>                                         define('_SAUVER_CHEMIN',true);
>                                         echo("1) file : $file , dirname :
> $dirname<br />");
>                                         echo
> "<pre>".debug_print_backtrace()."</pre>";
>                                 }
>                                 return
> $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] =
> $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = $a;
>                         }
>                 }
>         }
>
> Ce qui donne :
> 1) file : objets.php , dirname : base/
>
> #0 find_in_path(base/objets.php, , 1) called at [ecrire\inc\utils.php:124]
> #1 include_spip(base/objets) called at [ecrire\base\connect_sql.php:19]
> #2 require_once(ecrire\base\connect_sql.php) called at
> [ecrire\inc_version.php:337]
> #3 include_once(ecrire\inc_version.php) called at [spip.php:15]
> #4 include(spip.php) called at [index.php:3]
>
> Et le chemin.txt généré contien :
> s:15:"base/objets.php";s:22:"ecrire/base/objets.php";
> s:10:"objets.php";s:22:"ecrire/base/objets.php";
>
> Si ça peut aider au débug
>
> --
> RealET
>
>
> _______________________________________________
> liste: http://listes.rezo.net/mailman/listinfo/spip-dev
> doc: http://www.spip.net/
> dev: http://trac.rezo.net/trac/spip/
> irc://irc.freenode.net/spip
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.