Search found 747 matches

by kasimi
Sat Feb 17, 2018 5:28 pm
Forum: Extension Writers Discussion
Topic: loading lang file for another user.
Replies: 12
Views: 522

Re: loading lang file for another user.

In 3.2 you don't need a new user instance, you can work with the language class: // Inject this if you're in a service $language_loader = $phpbb_container->get('language.loader'); $other_language = new \phpbb\language\language($language_loader); $other_language->set_user_language($sleeper['user_lang...
by kasimi
Fri Feb 09, 2018 10:37 pm
Forum: Extension Writers Discussion
Topic: Extensions and version-check (w/ github)
Replies: 38
Views: 1366

Re: Extensions and version-check (w/ github)

The version_check json contents are not the problem. The script I posted can't even establish a connection, to neither of our json files. I guess it must be an issue on my server.
by kasimi
Fri Feb 09, 2018 9:45 pm
Forum: Extension Writers Discussion
Topic: Extensions and version-check (w/ github)
Replies: 38
Views: 1366

Re: Extensions and version-check (w/ github)

@3Di, I can't fetch your version check file. The output of this script is Error: '' (0) <?php $host = '3d-i.github.io'; $path = '/site/vchecks/hlposts-vcheck.json'; $port = 443; $timeout = 10; $fp = fsockopen("tls://$host", $port, $errno, $errstr, $timeout); if (!$fp) { echo "Error: '$errstr' ($errn...
by kasimi
Fri Feb 09, 2018 6:36 pm
Forum: Extension Writers Discussion
Topic: Extensions and version-check (w/ github)
Replies: 38
Views: 1366

Re: Extensions and version-check (w/ github)

I use github's gh-pages FWIW Yes, gh-pages work fine for me, too (my bad, they don't, same issue there), but my version checks use github.io. Github deactivated tls 1.1. Maybe that is the problem. That's good to know. It does seem to be an issue with the TLS version: When I run openssl s_client -tl...
by kasimi
Fri Feb 09, 2018 5:17 pm
Forum: Extension Writers Discussion
Topic: Extensions and version-check (w/ github)
Replies: 38
Views: 1366

Re: Extensions and version-check (w/ github)

I noticed my GitHub version checks stopped working. When clicking on Details of an affected extension in the ACP Customize tab, I'm seeing this message: Failed to obtain latest version information. The operation could not be completed because the fsockopen function has been disabled or the server be...
by kasimi
Wed Feb 07, 2018 9:51 pm
Forum: Extensions in Development
Topic: [3.2][RC] Log Connections
Replies: 31
Views: 2676

Re: [3.2][RC] Log Connections

The core.auth_login_session_create_before event has a parameter autologin, maybe that's what you're looking for?
by kasimi
Wed Feb 07, 2018 9:31 am
Forum: Extension Writers Discussion
Topic: How to know phpBB version in getSubscribedEvents?
Replies: 9
Views: 226

Re: How to know phpBB version in getSubscribedEvents?

You cannot check if an event exists. phpBB would have to parse all files in your board to find out. You can use the dispatcher service to check if there is a listener registered for a specific event, but there's no generic way to tell if it ever gets triggered, until it does. Which two events are yo...
by kasimi
Sat Feb 03, 2018 6:22 pm
Forum: Extension Writers Discussion
Topic: [Help] Config_Text Usage Problem.
Replies: 27
Views: 489

Re: [Help] Config_Text Usage Problem.

Your code looks fine. :)
by kasimi
Sat Feb 03, 2018 5:29 pm
Forum: Extension Writers Discussion
Topic: [Help] Config_Text Usage Problem.
Replies: 27
Views: 489

Re: [Help] Config_Text Usage Problem.

Is $db_text a global ? config_text is the service name, db_text the class behind it ( \phpbb\config\db_text ). Of course you could create your own instance of the db_text class, but there really is no reason to, because the container most likely has one already. I was trying to avoid $phpbb_contain...
by kasimi
Sat Feb 03, 2018 5:09 pm
Forum: Extension Writers Discussion
Topic: [Help] Config_Text Usage Problem.
Replies: 27
Views: 489

Re: [Help] Config_Text Usage Problem.

Dark❶ wrote:
Sat Feb 03, 2018 4:55 pm
I prefer not to use : $config_text = $phpbb_container->get('config_text'); .
Is there a reason you don't? $config_text is not a global, there is no way around getting it from the service container.
by kasimi
Wed Jan 31, 2018 8:53 am
Forum: Extension Writers Discussion
Topic: phpBB 3.2 Upgrade Notes for Extensions
Replies: 31
Views: 11558

Re: phpBB 3.2 Upgrade Notes for Extensions

With lang being the @language service: $array = $this->lang->lang_raw('hlposts_tokens') /** * Returns the raw value associated to a language key or the language key no translation is available. * No parameter substitution is performed, can be a string or an array. * * @param string|array $key Langua...
by kasimi
Mon Jan 29, 2018 5:59 pm
Forum: Extension Writers Discussion
Topic: Last Posts without 1 User
Replies: 7
Views: 363

Re: Last Posts without 1 User

Don't do this on a live board without being absolutely sure it doesn't have any side effects: https://github.com/phpbb/phpbb/blob/rel ... 1915-L1920 Also, adding your if there will not only affect the index page but your entire board.
by kasimi
Sun Jan 28, 2018 11:50 am
Forum: Extension Writers Discussion
Topic: Last Posts without 1 User
Replies: 7
Views: 363

Re: Last Posts without 1 User

The last post information is stored in each forum row, because fetching this information when viewing the forum would be too expensive. When submitting a post, the post's forum row is updated, see the submit_post() function in functions_posting.php . This is what you need to prevent from happening i...
by kasimi
Wed Jan 24, 2018 8:49 pm
Forum: Extension Writers Discussion
Topic: Using $this->table_prefix outside migrations
Replies: 6
Views: 278

Re: Using $this->table_prefix outside migrations

Yes, that should work, as long as you define() it after config.php is loaded, obviously. :P

Using define() is not encouraged in general though. You should create a tables.yml:

Go to advanced search