Open nvaken opened 7 years ago
@nvaken We implemented something like this on the site:status
command
> drupal site:status --format=json
{
"system": {
"Drupal": "8.3.0",
"Access to update.php": "Protected",
"Configuration files": "Protected",
"Cron maintenance tasks": "Last run 18 hours 6 minutes ago",
"Database system": "MySQL, MariaDB, Percona Server, or equivalent",
"Database system version": "5.7.16",
"Database updates": "Up to date",
"Drupal core update status": "Up to date",
"Entity\/field definitions": "Up to date",
"File system": "Writable (public download method)",
"GD library": "bundled (2.1.0 compatible)",
"GD library PNG support": "bundled (2.1.0 compatible)",
"Image toolkit": "gd",
"Node Access Permissions": "Disabled",
"PHP": "5.6.29 (more information)",
"PHP extensions": "Enabled",
"PHP memory limit": "2048M",
"PHP OPcode caching": "Not enabled",
"Random number generation": "Successful",
"Search index progress": "100% (0 remaining)",
"Trusted Host Settings": "Not enabled",
"Unicode library": "PHP Mbstring Extension",
"Update notifications": "Enabled",
"Upload progress": "Not enabled",
"Web server": "",
"Hash salt": "zbwXd94_PJlSKxYg0zE73pwqZ4lzHPq1cKYdt_vB8Fsj4BKYSKfu-MZgJOw0m4zjK23yJ8GwSg",
"Drupal Console": "1.0.0-rc16"
},
"database": {
"Driver": "mysql",
"Host": "127.0.0.1",
"Database connection": "drupal",
"Port": "3306",
"Username": "root",
"Connection": "mysql\/\/root:root@127.0.0.1:3306\/drupal"
},
"theme": {
"theme_default": "bartik",
"theme_admin": "seven"
},
"directory": {
"Site root directory": "\/Users\/jmolivas\/develop\/drupal\/sites\/drupal.dev\/web",
"Site temporary directory": "\/tmp",
"Default theme directory": "\/core\/themes\/bartik",
"Admin theme directory": "\/core\/themes\/seven"
}
}
I am really interested on implement this feature globally.
I will do some investigation about extending the output component.
Just to add another use case (of many). We'd be interested in fetching the output from user:login:url
to use after deployment simulation we run locally, so we allow our developers to quickly sign into the setup. But currently, the output shows:
[OK] One-time login for "[USER]":
"[ONE-TIME-LOGIN-URL]"
Which is really awful to parse.
@nvaken This totally make sense to support --format=json
for some of the commands we can probably create a list of the commands we want to have fixed and assigned them a priority.
Currently, processing any data from the output of DC is a cumbersome task. Nothing is formatted in a decent way, except for human reading. I'd expect a
--format
flag in which you're able to define which output format you're expecting.For example, running
site:debug
could look like following:Or:
Of course, this should not be limited to
site:debug
and I think this should be a global flag. Though, this might have a lot of implications for the global structure of DC? Not sure.Suggested formats