PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » PHP » PHP_Beautifier » Bug #7776

Problem with recursivity scanning and outputing

Details

Submitted2006-06-01 07:45 UTC
Fromnicolasembleton at yahoo dot fr
StatusOpen
PackagePHP_Beautifier
PHP Version5.1.2
OSn/a
Roadmaps1.0.0RC2

Comments

[2006-06-01 07:45 UTC] nicolasembleton at yahoo dot fr

Description:
------------
While trying to beautify a complete recursive file structure with pattern *.php5, outputing give completly messy files, with truncated names, without putting files correctly in the output structure, etc...

Filename are often truncated, like "ss.xml.php5" instead of "/class/class.xml.php5" ( with path truncated too, i guess, so that's why file structure is not respected.

When trying to parse myself directory, it gives something clean, but i have to let to false "setRecursive()" because problems come from here. Sometimes, it stops alone from scanning directories with a big .php5 file, so work is partially done.

What else can i say to help you... I think a part of the problem come from glob() function using. Don't really now why, but...

Test script:
---------------
Tried:
------
$oBeaut = new PHP_Beautifier( );
$oBatch = new PHP_Beautifier_Batch( $oBeaut );
$oBatch->addFilter( 'Dirox' );

$oBatch->setRecursive( true );

// Contains my sources
$in_path = "d:/Projects/regie_pub/_/_/*.php5";

// Will contain output
$out_path = "c:/tests/test-" .date( "ymdHi" ) ."/";

$oBatch->setInputFile( $in_path );
$oBatch->setOutputFile( $out_path );
$oBatch->process();
$oBatch->save();

And also:
---------

$oBeaut = new PHP_Beautifier( );
$oBatch = new PHP_Beautifier_Batch( $oBeaut );

$oBatch->addFilter( 'Dirox' );
$oBatch->setRecursive( true );

$in_path = "d:/Projects/regie_pub/_/_/*.php5";
$out_path = "c:/tests/test-" .date( "ymdHi" ) ."/";

$oBatch->setInputFile( $in_path );
$oBatch->setOutputFile( $out_path );
$oBatch->process();

$oBatchDir = new PHP_Beautifier_Batch_Output_Directory( $oBatch );
$oBatchDir->save();

Expected result:
----------------
Same file structure as original one with file beautified

Actual result:
--------------
It only can be viewed as a screenshot. Result is written and beautifying is done, but files are messy.

Looks like:

Outputdir/ail.php5 instead of
Outputdir/acces/detail.php5

... Everything like this with some dir created, but named with truncated strings.

One thing strange is that the output is ALWAYS the same. Tried lots of workaround, but everytime, same output.

( Under linux, the command line works nice, but it stops at a certain file ( very big ) and so the whole work is not done )

[2006-06-06 04:37 UTC] clbustos at php dot net

Ufff... Please, use xargs and find with individual files. Probably, in >v2.0 I will try to fix it.

[2007-01-19 08:00 UTC] hkroger at gmail dot com

I can confirm this bug and it sucks big time.