This example show how to parse all files into a directory and also one other file outside this directory.
This example requires mandatory resources :
The very basic script to parse the directory and file defined on line 14
- 8/17 files [==============>----------------] 47.06% Elapsed Time: 00:00.61 array ( 'ignored_files' => array ( ), 'ignored_functions' => array ( ), 'ignored_extensions' => array ( ), 'ignored_constants' => array ( ), 'max_version' => '', 'version' => '4.3.0', 'extensions' => array ( 0 => 'date', 1 => 'hash', 2 => 'pcre', 3 => 'sqlite', ), 'constants' => array ( 0 => 'STDOUT', 1 => '__FILE__', ), 'tokens' => array ( ), 'cond_code' => array ( 0 => 4, ), '/tmp/Log-1.10.0/Log/composite.php' => array ( 'ignored_functions' => array ( ), 'ignored_extensions' => array ( ), 'ignored_constants' => array ( ), 'max_version' => '', 'version' => '4.2.0', 'extensions' => array ( ), 'constants' => array ( ), 'tokens' => array ( ), 'cond_code' => array ( 0 => 0, ), ), [... more file details (hidden) ... ] '/tmp/File_Find-1.3.0/Find.php' => array ( 'ignored_functions' => array ( ), 'ignored_extensions' => array ( ), 'ignored_constants' => array ( ), 'max_version' => '', 'version' => '4.3.0', 'extensions' => array ( 0 => 'pcre', ), 'constants' => array ( ), 'tokens' => array ( ), 'cond_code' => array ( 0 => 4, ), ),
Because parsing a directory (with lot of file) can take a long time, we use the progress bar (message) wait behavior, common to all renderers, when running in CLI mode.
This progress bar is turn on at line 12
At line 18, we used the parseArray() method because we have two different data sources. We can also use now the new unified method parseData().
Final results (array dump) gave first the summary of all files parsed, then details for each file
We will see with next example (group 3) what this cond_code value means, and how to catch it well.