Menu

Error parsing wikindx/core/file/FILE.php on line 877

Help
Tony
2020-01-25
2020-01-26
  • Tony

    Tony - 2020-01-25

    Hi folks,

    new here. Apologies, only after posting to the ML and realising there was not much activity did I realise there is also a forum that is a lot busier :-)

    I'm trying to get WIkindx installed after many years of RefBase. I want to move to something that keeps up with technology (RefBase is stuck in 2014 with PHP 5).

    Having downloaded the stable V6 from SVN and created the database (and the config.php amended accordingly), plus changed the permissions to 770 throughout the wikindx folder (user is www-data.www-data on a debian 10 machine), I get the following code error when connecting my borwser to the http://server:80/wikindx folder:

    Parse error: syntax error, unexpected '|', expecting variable (T_VARIABLE) in /var/www/wikindx/core/file/FILE.php on line 877

    I wouldn't be expecting a PHP parsing error on a stable version, unless there is something wrong with my installation procedure or my PHP/Apache installation on the server (I doubt it would be the latter as I have Nexcloud successfully running on my Apache setup).

    Hope you can help me debug the issue. I'm keen to start using Wikindx.

    Thanks

     
  • Mark Grimshaw

    Mark Grimshaw - 2020-01-25

    Hi Tony,

    Sorry to hear you are having problems.

    Precisely which version of v6 do you have (v6.0.1?)? I'm using the same version of FILE.php that is in SVN stable/ on several servers without problems.

    With a little patience, we'll figure it out.

    Regards,

    Mark

     
    • Tony

      Tony - 2020-01-25

      Seems like the tar.gz package made no difference at all.

      Here are my steps:
      a) deflate tar.gz in the /var/www folder
      b) sudo chown -R www-data.www-data /var/www/wikindx
      c) sudo chmod -R 770 /var/www/wikindx
      d) Copy across the config.php file I saved in the upper level (so I don't have to modify all the time)
      e) http://server:80/wikindx from my browser an I get a nice white page with the following:

      Parse error: syntax error, unexpected '|', expecting variable (T_VARIABLE) in /var/www/wikindx/core/file/FILE.php on line 877

      Any clues?

      Sent with ProtonMail Secure Email.

       

      Last edit: Stéphane Aulery 2024-02-19
    • Tony

      Tony - 2020-01-25

      Hi,

      thanks for your response. Indeed, version 6.0.1. I'm going to try and download a tar.gz tarball and see if that makes a difference. Will keep you posted.

      Sent with ProtonMail Secure Email.

       

      Last edit: Stéphane Aulery 2024-02-19
    • Stéphane Aulery

      Hello Tony and Mark,

      At line 877 of FILE.php of 6.0.1 I find:

              try
              {
                  $filephar = new PharFileInfo($fileorig);
                  file_put_contents($DestinationFolder . DIRECTORY_SEPARATOR . $file, $filephar->getContent());
                  unset($filephar);
              }
              catch (BadMethodCallException | UnexpectedValueException $e)
              {
                  $success = FALSE;
              }
      

      catch (BadMethodCallException | UnexpectedValueException $e) is legal according to https://www.php.net/manual/en/language.exceptions.php, example #6 if you use PHP 7.1.

      In PHP 7.1 and later, a catch block may specify multiple exceptions using the pipe (|) character. This is useful for when different exceptions from different class hierarchies are handled the same.

      Sorry, It is a mistake on my part to have introduced a functionality not compatible with PHP 5.6, because most of the time I don't use PHP 5.6 myself.

      For a quick fix, comments lines 871-880 and lines 1010-1019 in FILE.php and I will do a quick release tonight to fix that bug immediatly.

      Regards,

       

      Last edit: Stéphane Aulery 2020-01-25
  • Tony

    Tony - 2020-01-25

    Hi Mark,

    thanks for getting back to me. I tried to download the tar.gz package as an alternative to the SVN bu made no difference at all. I'm on 6.0.1.

    Here are my steps:
    a) deflate tar.gz in the /var/www folder
    b) sudo chown -R www-data.www-data /var/www/wikindx
    c) sudo chmod -R 770 /var/www/wikindx
    d) Copy across the config.php file I saved in the upper level (so I don't have to modify all the time)
    e) http://server:80/wikindx from my browser an I get a nice white page with the following:

    Parse error: syntax error, unexpected '|', expecting variable (T_VARIABLE) in /var/www/wikindx/core/file/FILE.php on line 877

    Any clues?

     
  • Tony

    Tony - 2020-01-25

    Hi Stephane,

    just to let you know that it works now. Strugling to upload PDFs to the citations but I'll post a different message about that. We can consider this now closed.

    On reflection, aside for the PHP synta issue, the installation is not that complicated.

    Thanks for your support. It seems like this is the only server side bibliographical managment system that appears to be alive and maintained.

    Good to see that.

     
    • Stéphane Aulery

      Hi Tony,

      It seems that the development version (trunk) of RefBase almost supports PHP 7 fully. Did you see that someone had posted a patch on the ML:

      https://sourceforge.net/p/refbase/mailman/message/36357682/

      And they released v0.9.7 in 2017 in the trunk without tag and tarball published in the Files section of SF. So I think RefBase is not abandoned but lack of developers or its developers lack of time or interest. A little help could easily rectify the situation. Or the software would have to find a new motivated maintainer.

      Mark, the Wikindx founder, is an academics and he uses a good development practice. He uses Wikindx daily, Eating his own dog food. So the software is well maintained and there is no error that blocks its operation for a long time.

      After that it's like everything. We are only two developers, we miss things, like you experienced, and we cannot work on all fronts. There are many things to improve and do for those who want to participate.

      Regards,

       
  • Tony

    Tony - 2020-01-26

    Hi Stephane,

    thanks for the tip on RefBase. I hadn't spotted that. I was working off the files section here.

    Rearding the work you guys are doing on Wikindx, it was by no means a criticism of any type; I was actually praising your efforts. Its great to see the project so well and regularly maintained by Mark. Of course this is justified by the fact that he needs to the tool so he maintains it. So, in fact, the community (including myself) is lucky to to be tapping into the efforts that Mark puts into Wikindx, like many other OS projects. I'm very happy to be contributing in a very small part by pointing out issues and helping you guys fix them, via testing, etc. That is what OS is about :-)

    WIkindx is by far more advanced that RefBase so if and when I can work out how to migrate my database to Wikindx, I shall make that move.

    Thanks for all your support.

     

    Last edit: Tony 2020-01-26
  • Mark Grimshaw

    Mark Grimshaw - 2020-01-26

    Thanks for the compliments Tony,

    For the record, most of the maintenance and correcting and updating my old code is done by Stéphane these days although I occasionally chip in.

    If your existing database is just references, what format can refbase export to? Have a look at the importexport plugin for wikindx. If you can install the bibutils binaries on your system (https://sourceforge.net/p/bibutils/home/Bibutils/) then there is an interface in that plugin that converts between many bibliographic formats and one of them is bibtex that wikindx can import.

    Things are complicated by quotations, attachments etc.

    Regards,

    Mark

     

Log in to post a comment.