Skip to content
A simple module for Drupal 7 which provides a Drush command to dump entities in JSON format.
PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
includes
README.md
gh640_exit.info
gh640_exit.module

README.md

gh640_exit

This is a simple module for Drupal 7 which provides a Drush command to dump entities in JSON format.

Usage

After installing this module, you can use a Drush command gh640-exit-bundle.

drush gh640-exit-bundle node article
drush gh640-exit-bundle node page

You can get entities in JSON format via the standard output by specifying the machine names of the entity type and bundle.

It's required to pass 2 arguments. The first one is the machine name of the entity type. The second one is the machine name of the bundle.

Sample

The following is a sample output of the command (The actual outputs are not pretty-formatted).

[
  {
    "body": {
      "value": "Thank you and goodbye Drupal.",
      "summary": "",
      "format": "full_html",
      "safe_value": "Thank you and goodbye Drupal.",
      "safe_summary": ""
    },
    "nid": "458",
    "vid": "458",
    "is_new": false,
    "type": "page",
    "title": "Hello world.",
    "language": "ja",
    "url": "http://default/list",
    "edit_url": "http://default/node/458/edit",
    "status": "1",
    "promote": "0",
    "sticky": "0",
    "created": "1500000000",
    "changed": "1600000000",
    "author": {
      "uid": "100",
      "name": "hayato",
      "mail": "example@example.com",
      "url": "http://default/users/hayato",
      "edit_url": "http://default/user/100/edit",
      "last_access": "1550000000",
      "last_login": "1500000000",
      "created": "1400000000",
      "roles": [
        2,
        3
      ],
      "status": "1",
      "theme": "a_clean_theme",
      "language": "ja"
    },
    "source": null,
    "log": "",
    "revision": null
  }
]

Note that the outermost element is an Array ([]).

Instalation

  1. Checkout this repository under your DRUPAL_ROOT/sites/all/modules/[custom/] directory.
  2. Enable the module.

This module is not registered as a project in drupal.org and the only way to use this module is directly use this repository.

Dependencies

This module depends on the following modules:

You can’t perform that action at this time.