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

refactor: Add KeymanSiteEnvironment #12

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

darcywong00
Copy link
Contributor

@darcywong00 darcywong00 commented Dec 13, 2023

Addresses this point from keymnapp/keyman.com#403

Refactor environment getenv() calls into module so we have a single global KeymanSiteEnvironment class

TODO: Refactor KeymanHosts?

@darcywong00 darcywong00 added this to the A17S28 milestone Dec 13, 2023
$props = get_class_vars($class);
var_dump($props);
}
}
Copy link
Contributor Author

@darcywong00 darcywong00 Dec 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. unset a property

I'd prefer to rewrite how that particular function works. It's suboptimal at present.

  1. return a boolean if the env var is ''?

No, if the env var is unsset, then the property value should be NULL (testable with is_null, isset, isempty etc).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, if the env var is unsset, then the property value should be NULL ...

I meant for 2. to check when vars are initialized to ''

https://github.com/keymanapp/help.keyman.com/blob/9169d57566ca64026b4421b2fc4a80cc7b7f38b1/_includes/HelpSiteEnvironment.php#L9-L12

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it is needed?

@darcywong00 darcywong00 marked this pull request as draft December 14, 2023 00:51
$props = get_class_vars($class);
foreach($props as $name => $value) {
if (isset($env[$name])) {
self::$instance->$name = $env[$name];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Back to draft since this line is giving me errors

@mcdurdin mcdurdin modified the milestones: A17S28, A17S29 Dec 30, 2023
@mcdurdin mcdurdin modified the milestones: A17S29, A17S30 Jan 6, 2024
@mcdurdin mcdurdin modified the milestones: A17S30, A17S31 Jan 20, 2024
@mcdurdin mcdurdin modified the milestones: A17S31, B17S1 Feb 3, 2024
Base automatically changed from chore/v0.4 to main February 5, 2024 03:26
@mcdurdin mcdurdin modified the milestones: B17S1, B17S2 Feb 17, 2024
@mcdurdin mcdurdin modified the milestones: B17S2, B17S3 Mar 3, 2024
@darcywong00 darcywong00 modified the milestones: B17S3, B17S4 Mar 16, 2024
@mcdurdin mcdurdin modified the milestones: B17S4, B17S5 Mar 30, 2024
@darcywong00 darcywong00 modified the milestones: B17S5, B17S6 Apr 12, 2024
@darcywong00 darcywong00 removed this from the B17S6 milestone Apr 28, 2024
@mcdurdin mcdurdin added this to the A18S4 milestone Jun 7, 2024
@darcywong00 darcywong00 modified the milestones: A18S4, A18S5 Jun 21, 2024
@darcywong00 darcywong00 modified the milestones: A18S5, A18S6 Jul 5, 2024
@darcywong00 darcywong00 modified the milestones: A18S6, A18S7 Jul 19, 2024
@darcywong00 darcywong00 modified the milestones: A18S7, A18S8 Aug 2, 2024
@darcywong00 darcywong00 modified the milestones: A18S8, A18S9 Aug 17, 2024
@darcywong00 darcywong00 modified the milestones: A18S9, A18S10 Aug 31, 2024
@darcywong00 darcywong00 modified the milestones: A18S10, A18S11 Sep 14, 2024
darcywong00 pushed a commit that referenced this pull request Sep 18, 2024
@darcywong00 darcywong00 modified the milestones: A18S11, A18S12 Sep 28, 2024
@darcywong00 darcywong00 modified the milestones: A18S12, A18S13 Oct 11, 2024
@darcywong00 darcywong00 modified the milestones: A18S13, A18S14 Oct 26, 2024
@darcywong00 darcywong00 modified the milestones: A18S14, A18S15 Nov 9, 2024
@darcywong00 darcywong00 modified the milestones: A18S15, A18S16 Nov 24, 2024
@darcywong00 darcywong00 modified the milestones: A18S16, A18S17 Dec 7, 2024
@darcywong00 darcywong00 modified the milestones: A18S17, A18S18 Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants