array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'fr', ), 'this' => array ( 0 => 'function.xhprof-enable.php', 1 => 'xhprof_enable', ), 'up' => array ( 0 => 'ref.xhprof.php', 1 => 'Fonctions Xhprof', ), 'prev' => array ( 0 => 'function.xhprof-disable.php', 1 => 'xhprof_disable', ), 'next' => array ( 0 => 'function.xhprof-sample-disable.php', 1 => 'xhprof_sample_disable', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'fr', 'path' => 'reference/xhprof/functions/xhprof-enable.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL xhprof >= 0.9.0)
xhprof_enable — Démarre le profilage xhprof
flags
Drapeaux optionnels pour ajouter des informations supplémentaires au
profilage. Voir les
constantes XHprof pour plus
d'informations sur ces drapeaux, comme XHPROF_FLAGS_MEMORY
pour activer le profilage de la mémoire.
options
Un tableau d'options optionnelles, comme par exemple l'option 'ignored_functions' pour spécifier des fonctions à ignorer durant le profilage.
Version | Description |
---|---|
PECL xhprof 0.9.2 |
Le paramètre optionnel options a été ajouté.
|
Exemple #1 Exemple avec xhprof_enable()
<?php
// 1. profilage du temps écoulé + mémoire + CPU ; et on ignore les fonctions internes
xhprof_enable(XHPROF_FLAGS_NO_BUILTINS | XHPROF_FLAGS_CPU | XHPROF_FLAGS_MEMORY);
// 2. profilage du temps écoulé ; on ignore les fonctions call_user_func* lors du profilage
xhprof_enable(
0,
array('ignored_functions' => array('call_user_func',
'call_user_func_array')));
// 3. profilage du temps écoulé ainsi que de la mémoire ; on ignore les fonctions call_user_func* lors du profilage
xhprof_enable(
XHPROF_FLAGS_MEMORY,
array('ignored_functions' => array('call_user_func',
'call_user_func_array')));
?>