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

Failed to open Stream #8

Closed
push32 opened this issue Apr 13, 2018 · 3 comments
Closed

Failed to open Stream #8

push32 opened this issue Apr 13, 2018 · 3 comments
Labels
question Further information is requested wait feedback

Comments

@push32
Copy link

push32 commented Apr 13, 2018

Php version: 7.1.14

Os: MacOS High Sierra

Composer packages with detection troubles:

Which type of autoload it uses?

Code example of package classes usage that not detected:

unused_scanner /path/to/configuration/file/scanner_config.php --silent
PHP Warning: require_once(/path/to/configuration/file/scanner_config.php): failed to open stream: No such file or directory in /Users/enz/.composer/vendor/insolita/unused-scanner/Lib/Runner.php on line 86
PHP Fatal error: require_once(): Failed opening required '/path/to/configuration/file/scanner_config.php' (include_path='.:') in /Users/enz/.composer/vendor/insolita/unused-scanner/Lib/Runner.php on line 86

@Insolita
Copy link
Owner

Insolita commented Apr 13, 2018

Seems like your /path/to/configuration/file/scanner_config.php is wrong
You should create scanner_config.php based on scanner_config.example.php in my repository, put it near project which you want to check and call unused_scanner with full path to your scanner_config.php as argument

@Insolita Insolita added question Further information is requested wait feedback labels Apr 13, 2018
@push32
Copy link
Author

push32 commented Apr 13, 2018

I follow the step and please correct me in which area i'm wrong

Step by Step

  1. Install composer global require insolita/unused-scanner
  2. Ensure ~/.composer/vendor/bin directory declared in $PATH

  3. echo $PATH and i dont see ~/.composer/vendor/bin not in my path
  4. Add export PATH=$PATH:~/.composer/vendor/bin
  5. echo $path and now i have ~/.composer/vendor/bin
  6. composer global update and result is nothing to update
  7. prepare configuration file, see scanner_config.example.php, i'm copy example.php and rename it to scanner_config.php and put it my project folder
  8. run composer dumpautoload in your project directory
  9. run unused_scanner /path/to/configuration/file/scanner_config.php
  10. Error is Failed to Open Stream

Please guide me @Insolita

@Insolita
Copy link
Owner

  1. prepare configuration file, see scanner_config.example.php, i'm copy example.php and rename it to >scanner_config.php and put it my project folder

Just to copy - is not enough. You must modify it for setup valid path to composer.json of your project, vendor directory of your project and list of directories for scanning.

  1. /path/to/configuration/file/scanner_config.php - is not a part of command, is just example path, you should change it with real path to location scanner_config.php from step 7 (it may be like /home/www/my_project/scanner_config.php or /var/www/project_name/scanner_config.php)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested wait feedback
Projects
None yet
Development

No branches or pull requests

2 participants