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 updating ranges #23

Closed
S1SYPHOS opened this issue Nov 11, 2020 · 3 comments · Fixed by #24
Closed

Problem updating ranges #23

S1SYPHOS opened this issue Nov 11, 2020 · 3 comments · Fixed by #24

Comments

@S1SYPHOS
Copy link
Contributor

S1SYPHOS commented Nov 11, 2020

// Update: The ISBN page currently is unavailable due to maintenance:

image

In case the XML format / syntax changes, I'll notify you again - sorry for bothering!

// Original message

Hey there,
it seems that with PHP v7.4 (in my case 7.4.11) the update script throws a great many errors:

❯ composer run update-ranges
> php bin/update-ranges.php
Requesting range information...
Getting XML from https://www.isbn-international.org/?q=download_range//...
PHP Notice:  Trying to get property 'result' of non-object in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 30
PHP Notice:  Trying to get property 'value' of non-object in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 30
PHP Notice:  Trying to get property 'result' of non-object in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 31
PHP Notice:  Trying to get property 'filename' of non-object in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 31
Converting to PHP array...
PHP Warning:  simplexml_load_string(): Entity: line 48: parser error : Opening and ending tag mismatch: meta line 4 and head in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 39
PHP Warning:  simplexml_load_string(): </head> in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 39
PHP Warning:  simplexml_load_string():        ^ in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 39
PHP Warning:  simplexml_load_string(): Entity: line 61: parser error : Opening and ending tag mismatch: img line 4 and a in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 39
PHP Warning:  simplexml_load_string():                 </a> in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 39
PHP Warning:  simplexml_load_string():                     ^ in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 39
PHP Warning:  simplexml_load_string(): Entity: line 62: parser error : Opening and ending tag mismatch: a line 4 and div in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 39
PHP Warning:  simplexml_load_string():             </div> in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 39
PHP Warning:  simplexml_load_string():                   ^ in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 39
PHP Warning:  simplexml_load_string(): Entity: line 89: parser error : Opening and ending tag mismatch: div line 4 and body in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 39
PHP Warning:  simplexml_load_string(): </body></html> in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 39
PHP Warning:  simplexml_load_string():        ^ in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 39
PHP Warning:  simplexml_load_string(): Entity: line 89: parser error : Opening and ending tag mismatch: body line 4 and html in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 39
PHP Warning:  simplexml_load_string(): </body></html> in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 39
PHP Warning:  simplexml_load_string():               ^ in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 39
PHP Warning:  simplexml_load_string(): Entity: line 90: parser error : EndTag: '</' not found in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 39
PHP Warning:  simplexml_load_string():  in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 39
PHP Warning:  simplexml_load_string(): ^ in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 39
PHP Notice:  Undefined index: EAN.UCCPrefixes in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 43
PHP Notice:  Trying to access array offset on value of type null in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 43
PHP Notice:  Undefined index: RegistrationGroups in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 44
PHP Notice:  Trying to access array offset on value of type null in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 44
Saving to /path/to/project/vendor/biblys/isbn/bin/../src/Biblys/Isbn/ranges-array.php...

This results in an empty ranges-array.php file:

<?php
/*
 * This file is generated automatically by update-ranges.php, do not edit
 * manually! See README.md for more info. 
 *
 * This file is part of the biblys/isbn package.
 *
 * (c) Clément Bourgoin
 *
 * This package is Open Source Software. For the full copyright and license
 * information, please view the LICENSE file which was distributed with this
 * source code.
 */

$groups = array (
);
$prefixes = array (
);

I'll have a look at this later, or maybe you beat me to it? 🦊

Cheers,
S1SYPHOS

Composer v1.10.13
PHP v7.4.11

@clemlatz clemlatz reopened this Nov 11, 2020
@clemlatz
Copy link
Member

Hey @S1SYPHOS, thanks for warning me about this. While the problem is indeed due to the ISBN international agency site being down, I've reopened your issue because I think this situation should be handled by the library. Displaying an error message and exiting would be better than the current behavior, ie throwing a bunch of warnings and generating an empty file. I'll have a look as soon as possible.

@S1SYPHOS
Copy link
Contributor Author

Maybe I find the time to provide a simple PR, whoever gets there first ;)

@S1SYPHOS
Copy link
Contributor Author

PR is open for review - have a nice evening!

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

Successfully merging a pull request may close this issue.

2 participants