From 5aed1fa31d8f77222c60fdc82df7072653a77cfb Mon Sep 17 00:00:00 2001 From: Philip Olson Date: Wed, 15 Sep 2010 22:17:18 +0000 Subject: [PATCH] Added an example that lists inclued files, and clarified the inclued.dumpdir description git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@303409 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/inclued/examples.xml | 62 +++++++++++++++++++++++++++++++++- reference/inclued/ini.xml | 4 ++- 2 files changed, 64 insertions(+), 2 deletions(-) diff --git a/reference/inclued/examples.xml b/reference/inclued/examples.xml index fa970b4777..bdc6d0900b 100644 --- a/reference/inclued/examples.xml +++ b/reference/inclued/examples.xml @@ -12,7 +12,7 @@ - Getting the data from inclued + Getting the data within the PHP application itself (function) + + + Listing data via inclued dumps (configuration) + + When using the inclued.dumpdir + directive, files (include clues) are dumped with every request. Here's one + way to list those files, and unserialize them. + + +count() === 0) { + echo 'No clues today', PHP_EOL; + exit; + } + + foreach ($inclues as $inclue) { + + echo 'Inclued file: ', $inclue->getFilename(), PHP_EOL; + + $data = file_get_contents($inclue->getPathname()); + if ($data) { + $inc = unserialize($data); + echo ' -- filename: ', $inc['request']['SCRIPT_FILENAME'], PHP_EOL; + echo ' -- number of includes: ', count($inc['includes']), PHP_EOL; + } + echo PHP_EOL; + } +} else { + echo 'I am totally clueless today.', PHP_EOL; +} +?> +]]> + + &example.outputs.similar; + + + + + diff --git a/reference/inclued/ini.xml b/reference/inclued/ini.xml index 95d28c152e..3db54b193b 100644 --- a/reference/inclued/ini.xml +++ b/reference/inclued/ini.xml @@ -63,7 +63,9 @@ Location (path) to the directory that stores inclued files. If set, each - PHP request will create a file. + PHP request will create a file. These files are serialized versions of + what inclued_get_data would produce, so may be + unserialized with unserialize.