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

problem with opcache.save_comments=0 #357

Closed
drdim opened this issue Jan 9, 2017 · 5 comments
Closed

problem with opcache.save_comments=0 #357

drdim opened this issue Jan 9, 2017 · 5 comments

Comments

@drdim
Copy link

drdim commented Jan 9, 2017

With this version can get error
{"name":"PHP User Notice","message":"Required @swg\Info() not found","code":1024,"type":"yii\base\ErrorException","file":"/vagrant/vendor/zircote/swagger-...

On latest version php 7.0.14 without error and generate json normal. Configureation php modules, php.ini - identical.

@drdim drdim closed this as completed Jan 9, 2017
@drdim drdim reopened this Jan 9, 2017
@bfanger
Copy link
Collaborator

bfanger commented Jan 9, 2017

I've upgraded to PHP 7.1.0 and ran the unittests without a problem.

Since the latest swagger-php version, the default is to scan only *.php files. other than that i don't know what could be wrong.

Could you investigate what the issue is and provide the offending code-snippet?
Otherwise there is not much i can do.

@alexeyshockov
Copy link
Contributor

I think it's because swagger-php generates a user notice on 7.1 about Required @SWG\Info() not found (don't know why). And Yii wraps this notice into an exception.

@drdim, could you turn off Yii's error handler and check the result again? I think it can help to understand what's wrong. A small notice might not affect the unit tests and the results, but with "fanatic" error handlers it's a problem (that should be fixed, of course).

@drdim
Copy link
Author

drdim commented Jan 10, 2017

If yii_debug sets to false on php 7.1 - i get on generate 500 error. On php7.0.14 work fine.

php 7.1
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT

if disable all error php.ini:
{ "swagger": "2.0", "paths": {}, "definitions": {} }

I think problem with parsing files in structure directories.
invoke scan for me \Swagger\scan(Yii::getAlias('@api'));
where @api - folder /vagrant/api

@drdim
Copy link
Author

drdim commented Jan 25, 2017

Problem related with enable option in opcache.save_comments=0
if option enable, static files, saved in bytecode without comments and parser not found in file Info.
I think add check and exception, if this option enable on client configuration php.

@drdim drdim changed the title php7.1.0 compatibility problem with opcache.save_comments=0 Jan 25, 2017
@bfanger
Copy link
Collaborator

bfanger commented May 20, 2017

swagger-php now checks for if opcache.save_comments is set to false

bfanger added a commit that referenced this issue Aug 16, 2017
- Implemented Swagger->ref(). $swagger->ref('#/info/contact') === $swagger->info->contact
- Added validation of internal refs.
- Misc typos and improved unittests #357, #399, #402, #407, #423, #424
- Misc improvements to the documentation.
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

3 participants