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

Introduce PHP5 compatible class constants #25

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

fbrinker
Copy link

@fbrinker fbrinker commented Feb 1, 2022

I've added class constants to resolve the problem that we have to use a class_exists before using the OPENTBS_PLUGIN constant. New / Additional usage: clsOpenTBS::OPENTBS_PLUGIN. That will trigger the autoloading automatically.

My goal was to keep a maximum of backwards compatibility, since I didn't find any minimum requirements. We could apply a change and use "public const" or even remove the define statements, but I guess that's not that important.

@keeeew
Copy link

keeeew commented Mar 9, 2022

👍

@justOneOtherDev
Copy link

Hello @Skrol29,
do you have any ETA about this merge?

@Skrol29
Copy link
Owner

Skrol29 commented Aug 27, 2022

As mentioned in the documentation, the workaround to load the OpenTBS plugin using PHP auto-loading is simply :

$TBS = new clsTinyButStrong;
$TBS->Plugin(TBS_INSTALL, 'clsOpenTBS');

Does that solve the targeted problem ?

@fbrinker
Copy link
Author

Okay I see. We could use the string variant, but why shouldn't we use the proper constant for the string 'clsOpenTBS' when it already exists?

And we would be able to use $tbs->LoadTemplate($template, clsOpenTBS::OPENTBS_ALREADY_UTF8) etc. do see where the constants come from :)

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 this pull request may close these issues.

4 participants