List Directives via CLI

General discussion forum for the Zend Server
Post Reply
terr3089
Posts: 14
Joined: Tue Sep 22, 2015 10:05 am

List Directives via CLI

Post by terr3089 » Thu Feb 02, 2017 1:21 pm

I am trying to do an automatic deploy of Zend Server 8.5 and I want to check the PHP directives from the command line.

I can get a list of extensions using zsmanage. I can store a directive but I can't seem to list the directives.

Is there a way of doing this without using the GUI

Thanks

Terry

User avatar
zend_eyalt
Posts: 266
Joined: Thu Jan 22, 2009 3:16 pm

Re: List Directives via CLI

Post by zend_eyalt » Thu Feb 02, 2017 3:25 pm

you can get directives value via zs-client.sh, as in

Code: Select all

zs-client.sh configurationDirectivesList --zskey=<web-api-key> --zssecret=<webapi-secret> --zsurl=<url-for-the-webadmin-interface, by default: http://localhost:10081/> 


If you want to get the output as json you can add --output-format=json. Another possibility, that is easier to parse from shell scripts is kv (stands for key-value)

Helpful information with explanation and example can be found by running:

Code: Select all

zs-client.sh configurationDirectivesList -h


So for instance to get all the directives of the date extension, you would run:

Code: Select all

zs-client.sh configurationDirectivesList --zskey=<web-api-key> --zssecret=<webapi-secret> --extension=date

terr3089
Posts: 14
Joined: Tue Sep 22, 2015 10:05 am

Re: List Directives via CLI

Post by terr3089 » Wed Mar 15, 2017 5:11 pm

After many distractions. Got back to this today. Thanks for that. It worked well.

soph7549
Posts: 1
Joined: Thu Mar 16, 2017 10:32 am
Contact:

Re: List Directives via CLI

Post by soph7549 » Thu Mar 16, 2017 10:43 am

Hey, this worked well in my case too. I'm glad you're reaching out to the customers - it's really important for us. Thanks and have a nice Thursday.

Post Reply