-
-
Notifications
You must be signed in to change notification settings - Fork 433
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
Error when trying to read .info/serverTimeOffset #665
Comments
When I remove the If this is supposed to work, can you please show me some official documentation or a place where this works in one of the official Admin SDKs? |
Thank you for a prompt reply. I found information about the |
Dot is really a special reserved character, that can only be used in special reserved path references like |
This is a feature available in the Firebase Client SDK, not the Admin SDK, and honestly… I don't know how they do it 😅. It's definitely not a real database reference or the Firebase REST API doesn't allow access to it. However, I will consider this a feature request. In the meantime, you can simulate the same behavior with something like the following: $offsetRef = $db->getReference('serverTimeOffset')->set(\Kreait\Firebase\Database::SERVER_TIMESTAMP);
$offsetValue = (int) $offsetRef->getValue();
$here = new DateTimeImmutable();
$there = DateTime::createFromFormat('U.v', number_format($offsetValue/1000, 3, '.', ''));
$offset = $there->getTimestamp() - $here->getTimestamp(); |
There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale. Please make sure to update to the latest version and check if that solves the issue. Let me know if that works for you by leaving a 👍. Because this issue is marked as stale, it will be closed and locked in 7 days if no further activity occurs. Thank you for your contributions! |
Describe the issue you are experiencing
I want to read the serverTimeOffset to understand the difference in time between the local server and Firebase hosting.
I get error:
Is there any way to read the time offset?
Installed packages
PHP version and extensions
On which operating system(s) does the issue occur?
Steps to reproduce the issue.
Error message/Stack trace
In Database.php line 43:
The child key ".info" contains one of the following invalid characters: ".$#[]"
In Validator.php line 66:
The child key ".info" contains one of the following invalid characters: ".$#[]"
Additional information
No response
The text was updated successfully, but these errors were encountered: