Skip to content
This repository has been archived by the owner on Sep 26, 2020. It is now read-only.

invalid document for insert: keys cannot contain "." #29

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions external/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ function () {
} else {
$data['profile'] = xhprof_disable();
}

$profile = [];
foreach($data['profile'] as $key => $value) {
$profile[strtr($key, ['.' => '_'])] = $value;
}
$data['profile'] = $profile;
Copy link
Member

Choose a reason for hiding this comment

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

Won't you lose filename information this way?

Copy link
Author

Choose a reason for hiding this comment

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

Maybe I should use save.handler from config and if that's == 'mongodb' the keys are updated?

On xhgui is all as expected, however, instead of seeing admin/index.php in the function list and function details, you see admin/index_php. Mongo won't accept dot as index.


Before the PR

Screenshot 2019-08-21 at 17 23 34 578


After the PR

Screenshot 2019-08-21 at 17 24 00 147

Copy link
Member

Choose a reason for hiding this comment

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

Is there another replacement character that could be used? Perhaps a unicode dot that isn't recognized by Mongo as a dot?


// ignore_user_abort(true) allows your PHP script to continue executing, even if the user has terminated their request.
// Further Reading: http://blog.preinheimer.com/index.php?/archives/248-When-does-a-user-abort.html
Expand Down