-
Notifications
You must be signed in to change notification settings - Fork 6
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
Cannot access protected property #3
Comments
I still use an older version or Yourls, and of PHP, so I won't be able to test this until I have time to upgrade everything. But it looks as if you will need to change this line in yapchache/plugin.php
to
I don't think this will solve all your problems though. At the least, you'll have to look at similar issues around lines 95 and 96
They'll need changing to use $ydb->set_option() and $ydb->set_installed() instead. |
Mmm, actually, the $ydb->option bit is going to be more complicated, as we're trying to set an entire array here. Probably need to cycle through it. |
Thanks for taking a look at this Chris. I'm happy to test anything further that might help! |
OK. I built YAPCache against 1.7.1. It necessarily needs quite low level access to the database and there have been some important changes to the all powerful $ydb object since 1.7.1. Several properties that YAPCache accesses directly are now protected and must be accessed via methods. Methods that didn't exist in 1.7.1, so I can't actually make the changes until I can upgrade. But if you fancy poking about in the code I think what you'll have to do is this (get the latest commit from GitHub first): Around line 138 change
to
Around line 95 change
to
Let me know how you get on. And if you can't face hacking the code, at least the notes are here for me when I get around to it :) |
And as a 'note to self'... I need to look at all the |
Thanks, Chris. Those changes allowed me to use the plugin and edit and delete URLs properly. I do notice that the speed increase from using the cache is not as great as it was before, fwiw. Thanks again, --Chris |
Yourls 1.7.4
Ubuntu 18.04
MySQL 5.7.25
php 7.2.15
Loading the plugin produces this error:
(I can get the plugin to load by not using the user/cache.php file, and caching does seem to work, but the same error is produced when I attempt to edit or delete a URL.)
Next Error: Cannot access protected property YOURLS\Database\YDB::$infos in /var/www/xxxxxx/user/plugins/yapcac he/plugin.php:139 Stack trace: #0 /var/www/xxx in /var/www/xxxxxx/user/plugins/yapcache/plugin.php on line 139 [04-Mar-2019 19:25:56 UTC] PHP Fatal error: Uncaught Error: Cannot access protected property YOURLS\Database\YDB ::$infos in /var/www/xxxxxx/user/plugins/yapcache/plugin.php:139 Stack trace: #0 /var/www/xxxxxx/includes/functions-plugins.php(152): yapc_pre_get_keyword(Array) #1 /var/www/xxxxxx/includes/functions-plugins.php(191): yourls_apply_filter('pre_get_keyword', Array) #2 /var/www/xxxxxx/includes/functions.php(459): yourls_do_action('pre_get_keyword', 'mastering-colla...', true) #3 /var/www/xxxxxx/includes/functions.php(494): yourls_get_keyword_infos('mastering-colla...') #4 /var/www/xxxxxx/includes/functions.php(516): yourls_get_keyword_info('mastering-colla...', 'url', false) #5 /var/www/xxxxxx/includes/functions-html.php(483): yourls_get_keyword_longurl('mastering-colla...') #6 /var/www/xxxxxx/admin/admin-ajax.php(25): yourls_table_edit_row('mastering-colla...') #7 {main}
The text was updated successfully, but these errors were encountered: