FreederTeam / Freeder

An easy-to-use free feed reader
Other
5 stars 1 forks source link

PHP 5.3: invalid syntax #35

Closed marienfressinaud closed 9 years ago

marienfressinaud commented 9 years ago

It's me again! In views.php you're using:

if (!($rule = $query->fetch(PDO::FETCH_ASSOC)['rule'])) {
    $rule = '';
}

But you cannot use directly function()[index] in PHP 5.3. You have to call it as following:

$result = function();
$result[index];

Full error is:

PHP Parse error:  syntax error, unexpected '[' in /var/www/html/inc/views.php on line 219, referer: http://localhost/index.php

I suggest you, if you want to be sure Freeder runs on PHP 5.3, to test with CentOS 6 in a VM (or better, with Docker!). It is what I did for FreshRSS ;) If you want to use Docker, I can help you.

marienfressinaud commented 9 years ago

Same error in feeds.php:

PHP Parse error:  syntax error, unexpected '[' in /var/www/html/inc/feeds.php on line 145

and

PHP Parse error:  syntax error, unexpected '[' in /var/www/html/inc/feeds.php on line 179

and

PHP Parse error:  syntax error, unexpected '[', expecting ')' in /var/www/html/inc/feeds.php on line 336

and in favicons.php:

PHP Fatal error:  Can't use method return value in write context in /var/www/html/inc/favicons.php on line 69

Same kind of error for (new DateTime(…))->format(…):

PHP Parse error:  syntax error, unexpected T_OBJECT_OPERATOR in /var/www/html/inc/feed2array.php on line 249
PHP Parse error:  syntax error, unexpected T_OBJECT_OPERATOR in /var/www/html/inc/feed2array.php on line 249
PHP Parse error:  syntax error, unexpected T_OBJECT_OPERATOR in /var/www/html/inc/feed2array.php on line 330
eliemichel commented 9 years ago

Docker is still in my todo-list =P Thanks a lot for monitoring our advances!

marienfressinaud commented 9 years ago

I have an image for FreshRSS with documentation. You can reuse the code if you want (it is the one I use to test Freeder actually). Freeder has just no need of the MySQL database.

Phyks commented 9 years ago

Thanks for the link, I'll have a look at it ASAP =)

I'll fix the issue ASAP also, unless someone as some spare time to handle it before me =)

Phyks commented 9 years ago

@marienfressinaud : It should work now, with the todo branch. However, I did not test it intensively for now.

Thanks for the docker link, this is a really nice software I had to look at, that's done now =) A docker image based on CentOS 6 is available here although it is certainly not perfect.

Please reopen if anything is wrong.