-
-
Notifications
You must be signed in to change notification settings - Fork 17
feat(runtime): close out PROJ-1 PHP 8.5 baseline with QA + deploy verification #10
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,15 @@ | ||
| <?php $has_subscriptions = !empty($user->tag_subscriptions) && $user->tag_subscriptions->size() > 0; ?> | ||
| <?php | ||
| $listingUser = $this->user ?? ($user ?? null); | ||
| $subscriptions = $listingUser ? $listingUser->tag_subscriptions : null; | ||
| $has_subscriptions = $subscriptions && $subscriptions->size() > 0; | ||
| ?> | ||
|
|
||
| <?php if (!$has_subscriptions) : ?> | ||
| <?= $this->t('sub_none') ?> | ||
| <?php else : ?> | ||
| <?= $this->tag_subscription_listing($user) ?> | ||
| <?= $this->tag_subscription_listing($listingUser) ?> | ||
| <?php endif ?> | ||
|
|
||
| <?php if (current_user()->id == $user->id) : ?> | ||
| <?php if ($listingUser && current_user()->id == $listingUser->id) : ?> | ||
| (<?= $this->linkTo($this->t('sub_edit'), 'tag_subscription#index') ?>) | ||
| <?php endif ?> |
47 changes: 47 additions & 0 deletions
47
db/migrate/20260218221000_ensure_user_logs_table_exists.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| <?php | ||
| class EnsureUserLogsTableExists extends Rails\ActiveRecord\Migration\Base | ||
| { | ||
| public function up() | ||
| { | ||
| if (!$this->tableExists('user_logs')) { | ||
| $this->execute(<<<SQL | ||
| CREATE TABLE `user_logs` ( | ||
| `id` int(11) unsigned NOT NULL AUTO_INCREMENT, | ||
| `user_id` int(11) NOT NULL, | ||
| `ip_addr` varchar(46) NOT NULL, | ||
| `created_at` datetime NOT NULL, | ||
| PRIMARY KEY (`id`), | ||
| KEY `created_at` (`created_at`), | ||
| KEY `user_id` (`user_id`) | ||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8 | ||
| SQL | ||
| ); | ||
| } | ||
|
|
||
| if (!$this->foreignKeyExists('user_logs', 'fk_user_logs__user_id')) { | ||
| $this->execute( | ||
| "ALTER TABLE `user_logs` ADD CONSTRAINT `fk_user_logs__user_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE" | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| private function tableExists($tableName) | ||
| { | ||
| $stmt = $this->connection->executeSql("SHOW TABLES LIKE ?", $tableName); | ||
| $row = $stmt->fetch(\PDO::FETCH_NUM); | ||
|
|
||
| return $row !== false; | ||
| } | ||
|
|
||
| private function foreignKeyExists($tableName, $constraintName) | ||
| { | ||
| $stmt = $this->connection->executeSql( | ||
| "SELECT COUNT(*) AS count_value FROM information_schema.TABLE_CONSTRAINTS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = ? AND CONSTRAINT_NAME = ? AND CONSTRAINT_TYPE = 'FOREIGN KEY'", | ||
| $tableName, | ||
| $constraintName | ||
| ); | ||
| $row = $stmt->fetch(\PDO::FETCH_ASSOC); | ||
|
|
||
| return $row && (int)$row['count_value'] > 0; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,34 +1,34 @@ | ||
| <?php | ||
| return array ( | ||
| 0 => | ||
| 0 => | ||
| array ( | ||
| 'id' => | ||
| 'id' => | ||
| array ( | ||
| 'type' => 'int(11) unsigned', | ||
| 'default' => NULL, | ||
| ), | ||
| 'user_id' => | ||
| 'user_id' => | ||
| array ( | ||
| 'type' => 'int(11)', | ||
| 'default' => NULL, | ||
| ), | ||
| 'ip_addr' => | ||
| 'ip_addr' => | ||
| array ( | ||
| 'type' => 'varchar(46)', | ||
| 'default' => NULL, | ||
| ), | ||
| 'created_at' => | ||
| 'created_at' => | ||
| array ( | ||
| 'type' => 'datetime', | ||
| 'default' => NULL, | ||
| ), | ||
| ), | ||
| 1 => | ||
| 1 => | ||
| array ( | ||
| 'pri' => | ||
| 'pri' => | ||
| array ( | ||
| 0 => 'id', | ||
| ), | ||
| ), | ||
| ) | ||
| ; | ||
| ; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.