MarkLogic - XDMP:node-replace not showing results as expected - xquery

I am trying to create an endpoint that will be used for ingest of content.
When I receive a JSON Document, I am trying to submit it to a Semantic Classification Service, get the tags, and add it to the document.
Right now I can receive the document, send it to classification, get the tags just fine. Printing the logs shows that $tags is populated with
2017-10-20 15:29:40.333 Info: App-Services: {"value":"Greenville", "score":"1.00", "cskey":"43236", "tag_source":"smartlogic", "key":"43236", "original_key":"0", "name":"Location", "id":"5b1c5c25-f532-4fa9-a5c6-65eab0972032"}
2017-10-20 15:29:40.333 Info: App-Services: {"value":"Philadelphia", "score":"0.83", "cskey":"415938", "tag_source":"smartlogic", "key":"415938", "original_key":"0", "name":"Location", "id":"6cadfcd3-6a91-476d-a313-ed6f6fab7b3b"}
2017-10-20 15:29:40.333 Info: App-Services: {"value":"Russia", "score":"0.99", "cskey":"226313", "tag_source":"smartlogic", "key":"226313", "original_key":"0", "name":"Location", "id":"7fc9223e-e922-422d-b3fc-ed97b531eed6"}
2017-10-20 15:29:40.333 Info: App-Services: {"value":"South Carolina", "score":"0.69", "cskey":"299308", "tag_source":"smartlogic", "key":"299308", "original_key":"0", "name":"Location", "id":"82610e94-2f6e-4f4b-adde-c05dd9f4491c"}
2017-10-20 15:29:40.333 Info: App-Services: {"value":"Spartanburg", "score":"1.00", "cskey":"300651", "tag_source":"smartlogic", "key":"300651", "original_key":"0", "name":"Location", "id":"b32a9141-83be-49b9-91e2-afdcece7e180"}
2017-10-20 15:29:40.333 Info: App-Services: {"value":"Pennsylvania", "score":"0.84", "cskey":"248736", "tag_source":"smartlogic", "key":"248736", "original_key":"0", "name":"Location", "id":"b6697012-bb0d-4b52-8a16-157fed1f1658"}
2017-10-20 15:29:40.333 Info: App-Services: {"value":"White House", "score":"0.48", "cskey":"243472", "tag_source":"smartlogic", "key":"243472", "original_key":"0", "name":"Location", "id":"d69f639d-01a7-4273-9a92-835f6ce6bf18"}
2017-10-20 15:29:40.333 Info: App-Services: {"value":"Charleston", "score":"1.00", "cskey":"48402", "tag_source":"smartlogic", "key":"48402", "original_key":"0", "name":"Location", "id":"da4c7ff4-edb2-412b-84e7-00b87531ef10"}
2017-10-20 15:29:40.333 Info: App-Services: {"value":"Detroit", "score":"0.58", "cskey":"247983", "tag_source":"smartlogic", "key":"247983", "original_key":"0", "name":"Location", "id":"e957c0f1-4307-47b4-9e64-4bf9df40ce23"}
2017-10-20 15:29:40.333 Info: App-Services: {"value":"Chaka Fattah", "score":"0.51", "cskey":"2447795", "tag_source":"smartlogic", "key":"2447795", "original_key":"0", "name":"Person", "id":"09d4c57e-8581-4851-b059-fa6a2c139fa3"}
2017-10-20 15:29:40.333 Info: App-Services: {"value":"Hillary Clinton", "score":"0.61", "cskey":"4186582", "tag_source":"smartlogic", "key":"4186582", "original_key":"0", "name":"Person", "id":"3a2c01e0-e0c8-4619-ac91-6c214084d92b"}
2017-10-20 15:29:40.333 Info: App-Services: {"value":"Martin Luther King Jr.", "score":"0.48", "cskey":"2973808", "tag_source":"smartlogic", "key":"2973808", "original_key":"0", "name":"Person", "id":"632e2dd0-3599-44eb-b03c-824098102da9"}
2017-10-20 15:29:40.333 Info: App-Services: {"value":"Mitt Romney", "score":"0.49", "cskey":"2089044", "tag_source":"smartlogic", "key":"2089044", "original_key":"0", "name":"Person", "id":"714d7f31-0d84-42c0-9ab8-691bc37efece"}
2017-10-20 15:29:40.333 Info: App-Services: {"value":"Thomas Davis", "score":"0.49", "cskey":"1948480", "tag_source":"smartlogic", "key":"1948480", "original_key":"0", "name":"Person", "id":"ae4022ce-735a-4b05-a5e4-d8b400fd69a4"}
2017-10-20 15:29:40.333 Info: App-Services: {"value":"Jonathan Allen", "score":"0.48", "cskey":"2511948", "tag_source":"smartlogic", "key":"2511948", "original_key":"0", "name":"Person", "id":"aefda552-f582-4951-a053-824f4ff8fe78"}
2017-10-20 15:29:40.333 Info: App-Services: {"value":"Jonathan Capehart", "score":"0.48", "cskey":"4741366", "tag_source":"smartlogic", "key":"4741366", "original_key":"0", "name":"Person", "id":"be35ab01-fd3f-49a8-a119-a9f7c1a1d692"}
2017-10-20 15:29:40.333 Info: App-Services: {"value":"Howard Dean", "score":"0.49", "cskey":"3887714", "tag_source":"smartlogic", "key":"3887714", "original_key":"0", "name":"Person", "id":"c8672836-ef35-452c-a049-10079cb790bf"}
2017-10-20 15:29:40.333 Info: App-Services: {"value":"Thomas Davis", "score":"0.49", "cskey":"1731508", "tag_source":"smartlogic", "key":"1731508", "original_key":"0", "name":"Person", "id":"cb53685e-8261-4ad4-a3ab-6da348b026f3"}
2017-10-20 15:29:40.333 Info: App-Services: {"value":"Gun politics", "score":"0.42", "cskey":"5509249", "tag_source":"smartlogic", "key":"5509249", "original_key":"0", "name":"Subject", "id":"03df7c0d-d07d-47d7-9b75-ac9c2df5970e"}
2017-10-20 15:29:40.333 Info: App-Services: {"value":"Gun control", "score":"0.44", "cskey":"5242478", "tag_source":"smartlogic", "key":"5242478", "original_key":"0", "name":"Subject", "id":"5534bc22-b2e5-44cd-a37e-4280e2fea604"}
2017-10-20 15:29:40.333 Info: App-Services: {"value":"Gun violence", "score":"0.48", "cskey":"5529178", "tag_source":"smartlogic", "key":"5529178", "original_key":"0", "name":"Subject", "id":"60214456-6ebc-4ea5-92eb-89274bf02d6b"}
2017-10-20 15:29:40.333 Info: App-Services: {"value":"Climate", "score":"0.41", "cskey":"5345616", "tag_source":"smartlogic", "key":"5345616", "original_key":"0", "name":"Subject", "id":"65e8b0ac-f853-43d5-a92c-842947f3fdd3"}
2017-10-20 15:29:40.333 Info: App-Services: {"value":"Shootings", "score":"0.52", "cskey":"5470240", "tag_source":"smartlogic", "key":"5470240", "original_key":"0", "name":"Subject", "id":"b593e4f0-cf7a-4234-8ce9-3beba31a16bb"}
2017-10-20 15:29:40.333 Info: App-Services: {"value":"Violence", "score":"0.42", "cskey":"5428634", "tag_source":"smartlogic", "key":"5428634", "original_key":"0", "name":"Subject", "id":"f8eaed62-64b1-4125-8878-4088f1aef13d"}
The document I am trying to update is JSON. I am trying to replace the node of tags which will either be Null or Empty Array-node []
Per the docks of xdmp:node-replace I am trying to do the following line
let $_ := xdmp:node-replace($doc//headers/tags, array-node { $tags } )
This does not seem to apply the expect results (update document with tags)
I issue a xdmp:document-insert at the end of the code to make sure we insert the updated version.
Current Query Console
let $doc_uri := '/adocument.json'
let $doc := fn:doc($doc_uri)
(: content used for submission :)
let $content := $doc//description
let $title := $doc//title
let $smart_uri := 'http://10.203.10.229:5058'
let $body := fn:concat($title,'
',$content )
let $xml_payload :=
<request op="CLASSIFY">
<document>
<body type="TEXT"> {$body}</body>
<path/>
<multiarticle/>
<language>Default</language>
<threshold>1</threshold>
<clustering type="RMS" threshold="1"/>
<operation_mode>CAT</operation_mode>
<feedback/>
<use_generated_keys/>
</document>
</request>
let $test := xdmp:quote($xml_payload)
let $test2 := fn:encode-for-uri($test)
let $response := xdmp:http-get(fn:concat($smart_uri,'?XML_INPUT=',$test2))
(: Response has the tag information :)
(: parse the response to look like the values I want :)
let $tags := (
for $tag in $response//response/STRUCTUREDDOCUMENT/META
let $tag_map := map:map()
let $_ :=
(: this one should not be stored :)
if ($tag/#name = 'Type') then
()
else
let $_ := map:put($tag_map, 'name', $tag/#name)
let $_ := map:put($tag_map, 'value', $tag/#value)
let $_ := map:put($tag_map, 'id', $tag/#id)
let $_ := map:put($tag_map, 'score', $tag/#score)
let $_ := map:put($tag_map, 'key', $tag/#key)
let $_ := map:put($tag_map, 'original_key', $tag/#original_key)
let $_ := map:put($tag_map, 'cskey', $tag/#cskey)
let $_ := map:put($tag_map, 'tag_source', 'smartlogic')
return $_
let $ret :=
(: Only send back maps that are populated :)
if (map:count($tag_map) > 0) then
$tag_map
else ()
return $ret
)
(: some testing :)
let $doc_as_json := xdmp:to-json($doc)
let $test_map := map:map()
let $_ := map:put($test_map, 'tags', xdmp:to-json($tags))
let $_ := xdmp:log($tags)
let $_ := xdmp:node-replace($doc//headers/tags, array-node { $tags } )
let $_ := xdmp:log($doc)
(: return the updated $doc :)
return xdmp:to-json($doc)
In the production Scneario, the document will be received VIA a PUT request, and will not already be in the database

A couple things: 1) xdmp:node-replace replaces the database nodes, not in-memory nodes. 2) The database updates you make during a transaction are not visible by reading from the database or from the in-memory nodes.
It sounds like you may be updating the tags node correctly with xdmp:node-replace but then overwriting everything at the end with xdmp:document-insert. I can't be sure without seeing more of your code, but first try removing the final insert from your query.

Related

Ansible: Need help n printing msgs one by one without /n ..I have given the code and the current output n the description

Need help from the output:
Below line from the output need to be printed line by line without \n..plz help..code and actual output pasted with this post
"msg": "19:19:11.445 UTC Thu Jul 07 2022\n1657235951 \n1657235051 \n19:04:11 EDT Thu Jul 07 2022\n2022 Jul 07 19:04:11\n"
---
- name: Cisco NXOS
hosts: all
connection: network_cli
gather_facts: false
vars:
- cmdlist1: sh clock
- ansible_python_interpreter: /usr/bin/python3
- ansible_network_os: nxos
- cmdlist2: sh logging | include 2/3
tasks:
- name: Execute command
nxos_command:
commands: "{{ cmdlist1 }}"
register: output
- set_fact:
arr: "{{ output.stdout_lines[0][1] }}"
- debug:
msg: |
{{ arr | trim }}
{{ t1 }}
{{ t2 }}
{{ t3 }}
{{ t4 }}
# msg: "{{ msg.split('\n') }}"
vars:
t1: "{{ (arr|to_datetime('%H:%M:%S.%f %Z %a %b %d %Y')).strftime('%s') }}"
t2: "{{ t1|int - 15 * 60 }}"
t3: "{{ '%H:%M:%S %Z %a %b %d %Y'|strftime(t2) }}"
t4: "{{ '%Y %b %d %H:%M:%S' | strftime(t2) }}"
================
OUTPUT
[LABPC#lab-jump-host dow]$ ansible-playbook interfaceflappingdup.yml -i inventory1.txt --limit nxos --verbose
Using /etc/ansible/ansible.cfg as config file
PLAY [Cisco NXOS] ******************************************************************************************************************************************************************************************
TASK [Execute command] *************************************************************************************************************************************************************************************
ok: [nxos] => {"changed": false, "stdout": ["Time source is NTP\n19:19:11.445 UTC Thu Jul 07 2022"], "stdout_lines": [["Time source is NTP", "19:19:11.445 UTC Thu Jul 07 2022"]]}
TASK [set_fact] ********************************************************************************************************************************************************************************************
ok: [nxos] => {"ansible_facts": {"arr": "19:19:11.445 UTC Thu Jul 07 2022"}, "changed": false}
TASK [debug] ***********************************************************************************************************************************************************************************************
ok: [nxos] => {
"msg": "19:19:11.445 UTC Thu Jul 07 2022\n1657235951 \n1657235051 \n19:04:11 EDT Thu Jul 07 2022\n2022 Jul 07 19:04:11\n"
}
PLAY RECAP *************************************************************************************************************************************************************************************************
nxos : ok=3 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
- debug:
msg:
- "currenttime: {{arr}}"
- " timetostring: {{ t1 }}"
- " currentimeless15min: {{t2}}"
- " back15min: {{t3}}"
- "needmin: {{t4}}"
I have changed the above portion n my code and getting output as expected.
TASK [debug] ***********************************************************************************************************************************************************************************************
ok: [nxos] => {
"msg": [
"currenttime: 06:47:12.579 UTC Fri Jul 08 2022",
" timetostring: 1657277232",
" currentimeless15min: 1657276332",
" back15min: 06:32:12 EDT Fri Jul 08 2022",
"needmin: 2022 Jul 08 06:32:12"
]
}
Ah, I see you posted a solution in your own answer but I would just like to point out the reason for the original problem.
In YAML, using | to specify a multi-line string results in newlines (\n) at each line break. In Ansible debug output, the string is parsed literally so it includes the newline characters, and not actual newlines.
Your workaround by doing each message as a single item in a list fed to msg works for your case. I don't think there is a way to get the result you're looking for by using the other multi-line YAML specifiers. Here's an answer with a detailed explanation of multi-line strings in YAML, it's... complicated:
How do I break a string in YAML over multiple lines?

Can't upload pdf to slack “no_file_data” with Elixir and Hackney using without using :file

I'm writing a slack bot in Elixir that has to upload a file to a channel.
I have figured out how to do it using the :file option from :hackney.send_multipart_body but I haven't been able to send data directly, using either the :data or :part options, I keep getting %{"error" => "no_file_data", "ok" => false}.
I don't know much about multipart/form-data and I'm not sure if the problem comes from the data being sent or from the way it's being sent.
I used socat to dump my requests.
Solution with :file
{:ok, ref} =
:hackney.request(
:post,
# "http://localhost:6143?" <>
"https://slack.com/api/files.upload?" <>
Plug.Conn.Query.encode(%{
"channels" => "AAAAAA",
"filename" => "mix.exs",
"filetype" => "elixir"
}),
[
{"Authorization", "Bearer #{#token}"}
],
:stream_multipart,
[]
)
:hackney.send_multipart_body(
ref,
{:file, "./mix.exs"}
)
{:ok, _status, _headers, ref} = :hackney.start_response(ref)
{:ok, body} = :hackney.body(ref)
body |> Poison.decode!()
POST ?channels=AAAAAAAA&filename=mix.exs&filetype=elixir HTTP/1.1
Authorization: Bearer xoxb-XXXXXX
Host: localhost:6143
User-Agent: hackney/1.16.0
Content-Type: multipart/form-data; boundary=---------------------------tmktxwwsruoirfey
Transfer-Encoding: chunked
af
-----------------------------tmktxwwsruoirfey
content-length: 646
content-type: application/octet-stream
content-disposition: form-data; name="file"; filename="mix.exs"
286
defmodule TestAppSlackCowboy.MixProject do
use Mix.Project
def project do
[
app: :test_app_slack_cowboy,
version: "0.1.0",
elixir: "~> 1.10",
start_permanent: Mix.env() == :prod,
deps: deps()
]
end
# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: [:logger, :plug_cowboy],
mod: {TestAppSlackCowboy.Application, []}
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:plug, "~> 1.10"},
{:plug_cowboy, "~> 2.0"},
{:poison, "~> 3.1"},
{:hackney, "~> 1.15"}
]
end
end
2
31
-----------------------------tmktxwwsruoirfey--
0
Solution with :data
{:ok, content} = File.read("mix.exs")
{:ok, ref} =
:hackney.request(
:post,
# "http://localhost:6143?" <>
"https://slack.com/api/files.upload?" <>
Plug.Conn.Query.encode(%{
"channels" => "AAAAAA",
"filename" => "mix.exs",
"filetype" => "elixir"
}),
[
{"Authorization", "Bearer #{#token}"}
],
:stream_multipart,
[]
)
:hackney.send_multipart_body(
ref,
{:data, "file", content}
)
{:ok, _status, _headers, ref} = :hackney.start_response(ref)
{:ok, body} = :hackney.body(ref)
body |> Poison.decode!()
The delimitation of parts is different here.
POST ?channels=AAAAA&filename=mix.exs&filetype=elixir HTTP/1.1
Authorization: Bearer xoxb-XXXXXX
Host: localhost:6143
User-Agent: hackney/1.16.0
Content-Type: multipart/form-data; boundary=---------------------------liugtwbcxxsgwiyg
Transfer-Encoding: chunked
321
-----------------------------liugtwbcxxsgwiyg
content-length: 4
content-type: application/octet-stream
content-disposition: form-data; name="file"
defmodule TestAppSlackCowboy.MixProject do
use Mix.Project
def project do
[
app: :test_app_slack_cowboy,
version: "0.1.0",
elixir: "~> 1.10",
start_permanent: Mix.env() == :prod,
deps: deps()
]
end
# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: [:logger, :plug_cowboy],
mod: {TestAppSlackCowboy.Application, []}
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:plug, "~> 1.10"},
{:plug_cowboy, "~> 2.0"},
{:poison, "~> 3.1"},
{:hackney, "~> 1.15"}
]
end
end
31
-----------------------------liugtwbcxxsgwiyg--
0
Solution with :part
The only difference with :file here is the absence of filename="mix.exs" in the part header.
{:ok, content} = File.read("mix.exs")
{:ok, ref} =
:hackney.request(
:post,
# "http://localhost:6143?" <>
"https://slack.com/api/files.upload?" <>
Plug.Conn.Query.encode(%{
"channels" => "AAAAAA",
"filename" => "mix.exs",
"filetype" => "elixir"
}),
[
{"Authorization", "Bearer #{#token}"}
],
:stream_multipart,
[]
)
:hackney.send_multipart_body(
ref,
{:part, "file", String.length(content)}
)
:hackney.send_multipart_body(
ref,
{:part_bin, content}
)
:hackney.send_multipart_body(
ref,
{:part, :eof}
)
{:ok, _status, _headers, ref} = :hackney.start_response(ref)
{:ok, body} = :hackney.body(ref)
body |> Poison.decode!()
The only difference with :file here is the absence of filename="mix.exs" in the part header.
POST ?channels=AAAAAA&filename=mix.exs&filetype=elixir HTTP/1.1
Authorization: Bearer xoxb-XXXXXX
Host: localhost:6143
User-Agent: hackney/1.16.0
Content-Type: multipart/form-data; boundary=---------------------------rqimofvzwjzelkol
Transfer-Encoding: chunked
9b
-----------------------------rqimofvzwjzelkol
content-length: 646
content-type: application/octet-stream
content-disposition: form-data; name="file"
286
defmodule TestAppSlackCowboy.MixProject do
use Mix.Project
def project do
[
app: :test_app_slack_cowboy,
version: "0.1.0",
elixir: "~> 1.10",
start_permanent: Mix.env() == :prod,
deps: deps()
]
end
# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: [:logger, :plug_cowboy],
mod: {TestAppSlackCowboy.Application, []}
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:plug, "~> 1.10"},
{:plug_cowboy, "~> 2.0"},
{:poison, "~> 3.1"},
{:hackney, "~> 1.15"}
]
end
end
2
31
-----------------------------rqimofvzwjzelkol--
0
Versions:
Elixir: 1.10.2
OTP: 22.0.7
Hackney: 1.15
PLug: 1.10

what is lastModTime for a OOZIE workflow?

When I talk to the OOZIE rest API about a specific workflow,
curl "http://[OOZIE_URL]/oozie/v1/job/7039276-181005225000195-oozie-oozi-W?show=info&time=GMT"
I get a response like this,
...
'createdTime': 'Fri, 19 Oct 2018 05:12:26 GMT',
'endTime': None,
'externalId': None,
'group': None,
'id': '7039276-181005225000195-oozie-oozi-W',
'lastModTime': 'Fri, 19 Oct 2018 21:15:01 GMT',
'parentId': '7024011-181005225000195-oozie-oozi-C#4',
'run': 1,
'startTime': 'Fri, 19 Oct 2018 17:56:07 GMT',
'status': 'RUNNING',
'toString': 'Workflow id[7039276-181005225000195-oozie-oozi-W] '
'status[RUNNING]',
Does anyone know what exactly is this 'lastModTime'?
I want to monitor my jobs that run today, and I'm not sure if 'lastModTime' is the correct field to use for this purpose.

Firebase checking deployed files

When I run firebase deploy command, I would like to know which files are deployed.
I tried firebase deploy --debug, but I don't see any information about uploaded files.
[2018-05-25T09:48:26.423Z] ----------------------------------------------------------------------
[2018-05-25T09:48:26.426Z] Command: /usr/local/bin/node /usr/local/bin/firebase deploy --debug
[2018-05-25T09:48:26.427Z] CLI Version: 3.18.4
[2018-05-25T09:48:26.427Z] Platform: darwin
[2018-05-25T09:48:26.427Z] Node Version: v9.2.0
[2018-05-25T09:48:26.428Z] Time: Fri May 25 2018 11:48:26 GMT+0200 (CEST)
[2018-05-25T09:48:26.428Z] ----------------------------------------------------------------------
[2018-05-25T09:48:26.439Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[2018-05-25T09:48:26.440Z] > authorizing via signed-in user
[2018-05-25T09:48:26.441Z] > refreshing access token with scopes: ["email","https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","openid"]
[2018-05-25T09:48:26.442Z] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token
{ refresh_token: '1/sNSNg7xxbzwVujBEzRAQ2eZHkEuT0d6A2jVVUGa-e9Jgrc8NASizU4RK7MEmNnov',
client_id: '563584335869-fgrhgmd47bqnekij5i8b5pr03ho849e6.apps.googleusercontent.com',
client_secret: 'j9iVZfS8kkCEFUPaAeJV0sAi',
grant_type: 'refresh_token',
scope: 'email https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/cloudplatformprojects.readonly https://www.googleapis.com/auth/firebase openid' }
Fri May 25 2018 11:48:26 GMT+0200 (CEST)
[2018-05-25T09:48:26.585Z] <<< HTTP RESPONSE 200 cache-control=no-cache, no-store, max-age=0, must-revalidate, pragma=no-cache, expires=Mon, 01 Jan 1990 00:00:00 GMT, date=Fri, 25 May 2018 09:48:26 GMT, vary=X-Origin, Origin,Accept-Encoding, content-type=application/json; charset=UTF-8, x-content-type-options=nosniff, x-frame-options=SAMEORIGIN, x-xss-protection=1; mode=block, server=GSE, alt-svc=hq=":443"; ma=2592000; quic=51303433; quic=51303432; quic=51303431; quic=51303339; quic=51303335,quic=":443"; ma=2592000; v="43,42,41,39,35", accept-ranges=none, connection=close
[2018-05-25T09:48:26.593Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/projects/test-table
Fri May 25 2018 11:48:26 GMT+0200 (CEST)
[2018-05-25T09:48:27.222Z] <<< HTTP RESPONSE 200 server=nginx, date=Fri, 25 May 2018 09:48:27 GMT, content-type=application/json; charset=utf-8, content-length=141, connection=close, x-content-type-options=nosniff, strict-transport-security=max-age=31536000; includeSubdomains, cache-control=no-cache, no-store
[2018-05-25T09:48:27.223Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/database/test-table/tokens
Fri May 25 2018 11:48:27 GMT+0200 (CEST)
[2018-05-25T09:48:27.777Z] <<< HTTP RESPONSE 200 server=nginx, date=Fri, 25 May 2018 09:48:27 GMT, content-type=application/json; charset=utf-8, content-length=274, connection=close, x-content-type-options=nosniff, strict-transport-security=max-age=31536000; includeSubdomains, cache-control=no-cache, no-store
=== Deploying to 'test-table'...
i deploying hosting
i hosting: preparing dist directory for upload...
[2018-05-25T09:48:28.900Z] >>> HTTP REQUEST PUT https://deploy.firebase.com/v1/hosting/test-table/uploads/-LDLglCdzpfzQK77Fbrb?fileCount=2&message=
Fri May 25 2018 11:48:28 GMT+0200 (CEST)
Uploading: [ ] 0%[2018-05-25T09:48:32.752Z] <<< HTTP RESPONSE 200 server=nginx, date=Fri, 25 May 2018 09:48:32 GMT, content-type=application/json; charset=utf-8, content-length=49, connection=close, access-control-allow-origin=*, access-control-allow-methods=GET, PUT, POST, DELETE, OPTIONS, strict-transport-security=max-age=31556926; includeSubDomains; preload, x-content-type-options=nosniff
[2018-05-25T09:48:32.753Z] [hosting] .tgz uploaded successfully, waiting for extraction
✔ hosting: 2 files uploaded successfully
[2018-05-25T09:48:33.642Z] [hosting] deploy completed after 5190ms
[2018-05-25T09:48:33.643Z] >>> HTTP REQUEST POST https://deploy.firebase.com/v1/projects/test-table/releases
{ hosting:
{ public: 'dist',
ignore: [ 'firebase.json', '**/.*', '**/node_modules/**' ],
version: '-LDLglCdzpfzQK77Fbrb',
prefix: '-LDLglCdzpfzQK77Fbrb/',
manifest: [] } }
Fri May 25 2018 11:48:33 GMT+0200 (CEST)
[2018-05-25T09:48:34.951Z] <<< HTTP RESPONSE 200 server=nginx, date=Fri, 25 May 2018 09:48:34 GMT, content-type=application/json; charset=utf-8, content-length=34, connection=close, access-control-allow-origin=*, access-control-allow-methods=GET, PUT, POST, DELETE, OPTIONS, strict-transport-security=max-age=31556926; includeSubDomains; preload, x-content-type-options=nosniff
✔ Deploy complete!
The only information the Firebase CLI shows is:
i hosting: preparing dist directory for upload...
So this means that everything in your dist directory is deployed, and nothing else.
Since the files are uploaded as a single .tgz file, there is no progress report for individual files.

What PHP default_timezone_set based on?

I want to use the same time on master and slave.
I did that and has problem about date not return the same:
Server #1:
date_default_timezone_set('America/Los_Angeles');
date('r'); // => Thu, 17 Nov 2011 09:16:11 -0800
Server #2:
date_default_timezone_set('America/Los_Angeles');
date('r'); // => Thu, 17 Nov 2011 08:40:21 -0800
Server #3:
date_default_timezone_set('America/Los_Angeles');
date('r'); // => Thu, 17 Nov 2011 02:24:30 -0800
Any reason date('r') not return the same value on all server with same timezone set?
Thanks for your answer.
maybe the time is simple set wrong on the system. you could try to use a timeserver to fetch the date if you dont have enough rights.

Resources