Some questions and bugs regarding EPV

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
User avatar
LukeWCS
Registered User
Posts: 245
Joined: Mon Dec 08, 2014 12:32 pm
Location: Germany

Some questions and bugs regarding EPV

Post by LukeWCS »

Hello

Today I discovered by chance that the local version of EPV checks extensions in a different way like the online version of EPV. I use for all examples the GitHub repo from "bb3mobi/washere" so you can reproduce the problem. I use EPV in a WAMP environment by the way.

1. The biggest issue: very different checks

If I check the repo with online EPV I got this:

https://image.ibb.co/f53Sez/Pic-Pick-20 ... -53-54.png

In summary 2 fatals, 1 errors and 65 warnings.

But if I download this repo and copy the extension files in the correct folder "bb3mobi/washere" and check it with local EPV I got this:

Code: Select all

Running Extension Pre Validator on directory ..
Running tests.


 Validation: FAILED
 Fatal: 0, Error: 0, Warning: 2, Notice: 0


Test results for extension:
Warning: "GPL-2.0" is a deprecated SPDX license identifier, use "GPL-2.0-only" instead. in \bb3mobi\washere\composer.json
Warning: Found potential SQL injection on line 324 in \bb3mobi\washere\core\who_was_here.php
So it seems the local EPV doesn't check services.yml and also doesn't check the language files. But why?

2. The next difference between online EPV and local EPV: license identifier

The online EPV wants "GPL-2.0" as license identifier
The local EPV wants "GPL-2.0-only" as license identifier

So, what's correct?

3. What exactly does "--verbose" ? And how this can be used?

The help says:
Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
But there is no syntax example and so I tried with --verbose 3 and --verbose=3 but none of them was accepted and I got this:

Code: Select all

Exception trace:
 () at G:\programme\wamp\www\epv\vendor\symfony\console\Input\ArgvInput.php:229
 Symfony\Component\Console\Input\ArgvInput->addLongOption() at G:\programme\wamp\www\epv\vendor\symfony\console\Input\ArgvInput.php:157
 Symfony\Component\Console\Input\ArgvInput->parseLongOption() at G:\programme\wamp\www\epv\vendor\symfony\console\Input\ArgvInput.php:82
 Symfony\Component\Console\Input\ArgvInput->parse() at G:\programme\wamp\www\epv\vendor\symfony\console\Input\Input.php:55
 Symfony\Component\Console\Input\Input->bind() at G:\programme\wamp\www\epv\vendor\symfony\console\Command\Command.php:214
 Symfony\Component\Console\Command\Command->run() at G:\programme\wamp\www\epv\vendor\symfony\console\Application.php:960
 Symfony\Component\Console\Application->doRunCommand() at G:\programme\wamp\www\epv\vendor\symfony\console\Application.php:255
 Symfony\Component\Console\Application->doRun() at G:\programme\wamp\www\epv\vendor\symfony\console\Application.php:148
 Symfony\Component\Console\Application->run() at G:\programme\wamp\www\epv\src\EPV.php:30
4. It's not possible to use the local EPV with a online GithHub repo

If i use this:

# php src/EPV.php run --github="bb3mobi/who-was-here"

then I got this:

Code: Select all

Checkout https://github.com/bb3mobi/who-was-here from git on branch master.

In Admin.php line 138:

  Error while initializing repository: fatal: unable to access 'https://github.com/bb3mobi/who-was-here/': Could not resolve host: github.com


run [--dir [DIR]] [--git [GIT]] [--github [GITHUB]] [--branch [BRANCH]] [--debug]
If i use this:

# php src/EPV.php run --git="https://github.com/bb3mobi/who-was-here"

then I got this:

Code: Select all

In Admin.php line 138:

  Error while initializing repository: fatal: unable to access 'https://github.com/bb3mobi/who-was-here/': Could not resolve host: github.com


run [--dir [DIR]] [--git [GIT]] [--github [GITHUB]] [--branch [BRANCH]] [--debug]
But updating the composer package (I'm not sure what that is, a library for EPV I assume?) works without problems:

# php composer.phar update

and also

# php composer.phar self-update
May the backup be with you. Always.
User avatar
AlfredoRamos
Recognised Extension Developer
Posts: 1302
Joined: Wed Dec 25, 2013 9:06 pm
Location: /dev/null
Name: Alfredo
Contact:

Re: Some questions and bugs regarding EPV

Post by AlfredoRamos »

1. The tool that provides phpBB here, which by the way I didn't know that existed, seems to be very outdated.

You should use the phpBB repository test your extension.

https://area51.phpbb.com/docs/dev/3.2.x ... sting.html

2. You should use the GPL-2.0-only license identifier, the other one is deprecated.

https://spdx.org/licenses/

I can't answer 3 nor 4, I haven't used those flags.
Some of my phpBB extensions:
:chart_with_upwards_trend: SEO Metadata | Image Markdown | :shield: hCaptcha
:trophy: Check out all my validated extensions :trophy:

:penguin: Arch Linux user | Linux Boards :penguin:
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 28619
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: Some questions and bugs regarding EPV

Post by Paul »

1.
  • It looks like the online EPV was pretty out of date. I just updated the online version and it should now match the local version. (I actually think I broke it now, will check after easter dinner)
  • The service.yml error looks like it caused because you don't have quotes around your services. It should be - '@template' instead of - @template (This might be caused by the symfony version used locally vs online.)
  • The packageing error can be ignored, as long as it doesn't show up when you submit it to the CDB.
  • In general it is suggested to use travis to run EPV
2. This is also caused by an outdated EPV on .com. It should be GPL-2.0-only.
3. I would say it is --verbose, without anything else. But don't expect more detailed errors.
4. The problem seems your PC can't access github: Could not resolve host: github.com
User avatar
LukeWCS
Registered User
Posts: 245
Joined: Mon Dec 08, 2014 12:32 pm
Location: Germany

Re: Some questions and bugs regarding EPV

Post by LukeWCS »

@AbaddonOrmuz

Thanks for your answer.

To 1: I know this section of documentation, but thanks nevertheless. Well, this is simply too complicated for me and a day have only 24 hours. ^^ I prefer EPV.
To 2: Thanks.

@Paul

Thanks Paul

Point 2 fixed now. ;) Tested with my own ext which uses already "GPL-2.0-only".

About point 1, I think you misunderstood me. That was not meant as a question about the several error messages. These errors was fixed by me very long ago (last year) on my second release of LFWWH. This was meant as a question why the local EPV doesn't check services.yml and the language files.

3. This is not meant for more (deeper) tests? Okay, understood.
4. Yes, but why? I mean, composer.phar update works also, so there is no general problem regarding connecting to a host.

But Paul, point 4 isn't that important to me. Point 1 is much more important. The local EPV should also be able to detect the same problems like the online EPV can. And currently this is not the case.
May the backup be with you. Always.
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 28619
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: Some questions and bugs regarding EPV

Post by Paul »

Well, if you use the latest version of EPV, the language items should at least be shown. Make sure that the version is up to date. The latest commit is ef657d8, which show both here on www.phpbb.com as locally on my machine the same language errors from your repo.
The services.yml error depends on the symfony version used, and as such depends on what composer did install (Which again depends on php version and your dependencies in your composer.json). phpbb.com is using symfony 3.4 for the yaml parsing.

3. No, all tests are in all cases performed. The --verbose is an option from symfony. EPV contains a --debug, which shows what it is doing, but it won't generate any extra information.

4. I have no idea why. phpBB.com uses the same option, and it works here. We simply do a HTTP request to github.com and thats it.
User avatar
LukeWCS
Registered User
Posts: 245
Joined: Mon Dec 08, 2014 12:32 pm
Location: Germany

Re: Some questions and bugs regarding EPV

Post by LukeWCS »

Paul wrote: Sun Apr 21, 2019 6:37 pm Well, if you use the latest version of EPV, the language items should at least be shown.
Yes it should, but it isn't.
Make sure that the version is up to date. The latest commit is ef657d8,
It is up to date. After I reported the PCRE bug (#86) and after kasimi fixed it (#87) I downloaded EPV again. And since them there was no further updates.
which show both here on www.phpbb.com as locally on my machine the same language errors from your repo.
Well, what can I do to give you more informations about the problem?
The services.yml error depends on the symfony version used, and as such depends on what composer did install (Which again depends on php version and your dependencies in your composer.json). phpbb.com is using symfony 3.4 for the yaml parsing.
I started with ext development last summer. Until now iI hadn't anything to do with "composer" or "symfony" or "yaml". I only know composer.json and services.yml. So sorry, I don't know what you are talking about. :|

I can only say, that a local EPV works different to the online EPV.
May the backup be with you. Always.
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 28619
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: Some questions and bugs regarding EPV

Post by Paul »

Running epv with --github locally is exactly the same as how it is ran on www.phpbb.com. We don't have any specific phpbb.com code for running epv at all.
I have no idea why your local install doesn't show it. It might be caused by your pcre version, that it doesn't find it, but can't check it right now as I am on my phone.
User avatar
LukeWCS
Registered User
Posts: 245
Joined: Mon Dec 08, 2014 12:32 pm
Location: Germany

Re: Some questions and bugs regarding EPV

Post by LukeWCS »

Okay, no problem. This is not a time-critical problem. ^^

After you wrote something about --debug I tried that. Maybe it can help you:

Code: Select all

Running Extension Pre Validator on directory ..
Running tests.


 Validation: FAILED
 Fatal: 0, Error: 0, Warning: 2, Notice: 0


Found G:\programme\wamp\www\epv\src\Tests\Tests\epv_test_validate_composer.php.
Found G:\programme\wamp\www\epv\src\Tests\Tests\epv_test_validate_directory_structure.php.
Found G:\programme\wamp\www\epv\src\Tests\Tests\epv_test_validate_event_names.php.
Found G:\programme\wamp\www\epv\src\Tests\Tests\epv_test_validate_languages.php.
Found G:\programme\wamp\www\epv\src\Tests\Tests\epv_test_validate_linefeeds.php.
Found G:\programme\wamp\www\epv\src\Tests\Tests\epv_test_validate_php_functions.php.
Found G:\programme\wamp\www\epv\src\Tests\Tests\epv_test_validate_revert_schema.php.
Found G:\programme\wamp\www\epv\src\Tests\Tests\epv_test_validate_routing.php.
Found G:\programme\wamp\www\epv\src\Tests\Tests\epv_test_validate_service.php.
Found G:\programme\wamp\www\epv\src\Tests\Tests\epv_test_validate_sql_queries.php.
Attempting to load Z:\temp\bb3mobi\washere\.travis.yml with extension yml
Attempting to load Z:\temp\bb3mobi\washere\README.md with extension md
Attempting to load Z:\temp\bb3mobi\washere\acp\acp_wwh_info.php with extension php
Attempting to load Z:\temp\bb3mobi\washere\acp\acp_wwh_module.php with extension php
Attempting to load Z:\temp\bb3mobi\washere\adm\index.html with extension html
Attempting to load Z:\temp\bb3mobi\washere\adm\style\acp_wwh.html with extension html
Attempting to load Z:\temp\bb3mobi\washere\composer.json with extension json
Attempting to load Z:\temp\bb3mobi\washere\config\services.yml with extension yml
Attempting to load Z:\temp\bb3mobi\washere\core\who_was_here.php with extension php
Attempting to load Z:\temp\bb3mobi\washere\event\listener.php with extension php
Attempting to load Z:\temp\bb3mobi\washere\index.htm with extension htm
Attempting to load Z:\temp\bb3mobi\washere\language\ar\info_acp_wwh.php with extension php
Attempting to load Z:\temp\bb3mobi\washere\language\ar\lang_wwh.php with extension php
Attempting to load Z:\temp\bb3mobi\washere\language\de\info_acp_wwh.php with extension php
Attempting to load Z:\temp\bb3mobi\washere\language\de\lang_wwh.php with extension php
Attempting to load Z:\temp\bb3mobi\washere\language\de_x_sie\info_acp_wwh.php with extension php
Attempting to load Z:\temp\bb3mobi\washere\language\de_x_sie\lang_wwh.php with extension php
Attempting to load Z:\temp\bb3mobi\washere\language\en\info_acp_wwh.php with extension php
Attempting to load Z:\temp\bb3mobi\washere\language\en\lang_wwh.php with extension php
Attempting to load Z:\temp\bb3mobi\washere\language\fr\info_acp_wwh.php with extension php
Attempting to load Z:\temp\bb3mobi\washere\language\fr\lang_wwh.php with extension php
Attempting to load Z:\temp\bb3mobi\washere\language\it\info_acp_wwh.php with extension php
Attempting to load Z:\temp\bb3mobi\washere\language\it\lang_wwh.php with extension php
Attempting to load Z:\temp\bb3mobi\washere\language\nl\info_acp_wwh.php with extension php
Attempting to load Z:\temp\bb3mobi\washere\language\nl\lang_wwh.php with extension php
Attempting to load Z:\temp\bb3mobi\washere\language\ru\info_acp_wwh.php with extension php
Attempting to load Z:\temp\bb3mobi\washere\language\ru\lang_wwh.php with extension php
Attempting to load Z:\temp\bb3mobi\washere\license.txt with extension txt
Attempting to load Z:\temp\bb3mobi\washere\migrations\v_1_2_1.php with extension php
Attempting to load Z:\temp\bb3mobi\washere\migrations\v_1_2_2.php with extension php
Attempting to load Z:\temp\bb3mobi\washere\styles\bb3-mobi\template\event\index_body_stat_blocks_before.html with extension html
Attempting to load Z:\temp\bb3mobi\washere\styles\prosilver\index.html with extension html
Attempting to load Z:\temp\bb3mobi\washere\styles\prosilver\template\event\index_body_stat_blocks_before.html with extension html
Attempting to load Z:\temp\bb3mobi\washere\styles\prosilver\template\index.html with extension html
tests to run:
Test: Validate composer structure.
Test: Validate directory structure.
Test: Test event names.
Test: Test languages.
Test: Validate linefeeds.
Test: Validate php structure and deprecated functions.
Test: Validate presence of revert_schema().
Test: Validate route.
Test: Validate service.
Test: Validate SQL queries.
Attempting to parse file: \bb3mobi\washere\acp\acp_wwh_info.php
Did not find IN_PHPBB, but php file contains a namespace with just classes or is a test file.
Attempting to parse file: \bb3mobi\washere\acp\acp_wwh_module.php
Did not find IN_PHPBB, but php file contains a namespace with just classes or is a test file.
Attempting to parse file: \bb3mobi\washere\core\who_was_here.php
Did not find IN_PHPBB, but php file contains a namespace with just classes or is a test file.
Attempting to parse file: \bb3mobi\washere\event\listener.php
Did not find IN_PHPBB, but php file contains a namespace with just classes or is a test file.
Attempting to parse file: \bb3mobi\washere\language\ar\info_acp_wwh.php
Attempting to parse file: \bb3mobi\washere\language\ar\lang_wwh.php
Attempting to parse file: \bb3mobi\washere\language\de\info_acp_wwh.php
Attempting to parse file: \bb3mobi\washere\language\de\lang_wwh.php
Attempting to parse file: \bb3mobi\washere\language\de_x_sie\info_acp_wwh.php
Attempting to parse file: \bb3mobi\washere\language\de_x_sie\lang_wwh.php
Attempting to parse file: \bb3mobi\washere\language\en\info_acp_wwh.php
Attempting to parse file: \bb3mobi\washere\language\en\lang_wwh.php
Attempting to parse file: \bb3mobi\washere\language\fr\info_acp_wwh.php
Attempting to parse file: \bb3mobi\washere\language\fr\lang_wwh.php
Attempting to parse file: \bb3mobi\washere\language\it\info_acp_wwh.php
Attempting to parse file: \bb3mobi\washere\language\it\lang_wwh.php
Attempting to parse file: \bb3mobi\washere\language\nl\info_acp_wwh.php
Attempting to parse file: \bb3mobi\washere\language\nl\lang_wwh.php
Attempting to parse file: \bb3mobi\washere\language\ru\info_acp_wwh.php
Attempting to parse file: \bb3mobi\washere\language\ru\lang_wwh.php
Attempting to parse file: \bb3mobi\washere\migrations\v_1_2_1.php
Did not find IN_PHPBB, but php file contains a namespace with just classes or is a test file.
Attempting to parse file: \bb3mobi\washere\migrations\v_1_2_2.php
Did not find IN_PHPBB, but php file contains a namespace with just classes or is a test file.
Test results for extension:
Warning: "GPL-2.0" is a deprecated SPDX license identifier, use "GPL-2.0-only" instead. in \bb3mobi\washere\composer.json
Warning: Found potential SQL injection on line 324 in \bb3mobi\washere\core\who_was_here.php
May the backup be with you. Always.
User avatar
LukeWCS
Registered User
Posts: 245
Joined: Mon Dec 08, 2014 12:32 pm
Location: Germany

Re: Some questions and bugs regarding EPV

Post by LukeWCS »

I solved the problems by myself.

1. Language files (EPV structure): the language files are not checked because there is a RegEx that supports only Unix but not Windows. I changed the RegEx to support both systems.

2. services.yml (vendor structure): the code line for the relevant error message is disabled (commented out). I simply enabled it.

Now I get exact the same results as with the online EPV.

You should state on the EPV site, that your tool is only meant for Unix. In his current state it is not suitable for Windows systems.
May the backup be with you. Always.
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 28619
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: Some questions and bugs regarding EPV

Post by Paul »

It should work on windows as well, otherwise it is a bug and best is to report it at github.
User avatar
LukeWCS
Registered User
Posts: 245
Joined: Mon Dec 08, 2014 12:32 pm
Location: Germany

Re: Some questions and bugs regarding EPV

Post by LukeWCS »

Ah, okay, in that case: what do you prefer? As Issue or as PR?

But that would only be for 1. What is with 2.? The vendor structure is created by composer.phar install. And there is the second "bug" present, regarding "it seems the local EPV doesn't check services.yml".
May the backup be with you. Always.
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 28619
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: Some questions and bugs regarding EPV

Post by Paul »

If you have a few a pr would be nice 😊.
The second issue is something can't fix really, as it depends on the installed symfony version.
User avatar
LukeWCS
Registered User
Posts: 245
Joined: Mon Dec 08, 2014 12:32 pm
Location: Germany

Re: Some questions and bugs regarding EPV

Post by LukeWCS »

Okay, then a PR.

But what's about "symfony"? I don't know what's meant with that. I only done the following:

1. Downloaded and extracted EPV.
2. Executed php src/EPV.php. Then EPV wrote:

"Composer autoloading seems to be missing. Did you run composer.phar install?"

3. Executed php composer.phar install.

Then there was several folders created. At the top he wrote:

"Warning: This development build of composer is over 60 days old. It is recommended to update it by running "composer.phar self-update" to get the latest version."

4. Executed php composer.phar self-update and that's it.

Do you mean epv\vendor\symfony? That was created by composer.phar install. And there is the second bug present, the disabled code line as I wrote.
May the backup be with you. Always.
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 28619
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: Some questions and bugs regarding EPV

Post by Paul »

Anything in vendor is software written by someone else, and there are specific versions of those software dependencies. Symfony being one of them. In one of the versions symfony made a change that results in the error you get.
We can't just change something in that directory, and as such it might sometimes happen that an error does show on one install and not on another.
The version of the dependencies that get installed depend on for example the local php version, and other dependencies you have.
User avatar
LukeWCS
Registered User
Posts: 245
Joined: Mon Dec 08, 2014 12:32 pm
Location: Germany

Re: Some questions and bugs regarding EPV

Post by LukeWCS »

@Paul

It would be helpful, if EPV would give a normal version information with --version, instead of "Console Tool".
PicPick_2020-01-09_12-16-36_.png

By the way: the online EPV has not worked for a long time. I discovered this a few weeks ago, but I assumed a temporary failure. But it still doesn't work. Just for info.
Oopsies… what you have requested is gone!
I’m only a computer server and can only give you what I’ve got. I’ve searched and search and searched, yet there was no document of this name. So as they say… “this page is an ex-parrot”, perhaps you should use the search?
May the backup be with you. Always.
Post Reply

Return to “Extension Writers Discussion”