Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File/Dir Filter && not catched exceptions (JSON parse error) #55

Closed
SilverioMiranda opened this issue Aug 19, 2012 · 1 comment
Closed

Comments

@SilverioMiranda
Copy link
Contributor

Hi , i'm here again

  1. I use svn to control application version , so in the test dir (in my app folder) i have .svn dir , and i want to remove this
    So i changed FileList.php

foreach ( $files as $file ) { if ( $file != '.' && $file != '..' ) { $path = $dir . $file; $ext = strtolower(pathinfo($path, PATHINFO_EXTENSION)); if ( is_dir($path) ) { if(in_array($file, \app\lib\Library::retrieve('files_filter')) !== false) { continue; } $final_dirs[] = array( 'type' => 'directory', 'name' => $file, 'path' => $path ); } elseif ( is_file($path) && $ext == 'php' ) { $final_files[] = array( 'type' => 'file', 'name' => $file, 'path' => $path ); } } }
and added option in bootstrap.php

// Paths to any necessary bootstraps
'bootstraps' => array(
// '/path/to/bootstrap.php'
),
'files_filter' => array('.svn')

=)

The other issue is if the php fails (return unhandled error/exception) the json parse throw a error like :
Erro: SyntaxError: JSON.parse: unexpected character
Arquivo-fonte: http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
Linha: 2

In this example the returned response from server is purposely :


Parse error: syntax error, unexpected '}' in Z:\Ikariam\app\Test\ResourceTransporterTest.php on line 164

Add a handle to json parser is a good idea , no ? show a error like 'the tests cannot be completed' or something like

Thx again

@edit

Please fix this file Archives.php line 16 to :
while ( ($file = readdir($handler)) == TRUE ) {

i use zend studio and i hate errors in code (assignment in condition)

@ghost
Copy link

ghost commented Aug 19, 2012

Hi, thanks for your feedback. Please wrap your code excerpts in backticks (```) - this will preserve formatting and make it much, much easier to read. Also, please open a separate report for each issue so I can tackle them separately (I've extracted these out: #56, #57, #58). Thanks!

@ghost ghost closed this as completed Aug 19, 2012
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant