Skip to content

Add a -s / --serialize command line option. #19

Description

@beporter

It would be handy to be able to spit out a sub-section of a Cake app's Configure array in a format that could be consumed by another PHP script easily. This would improve the fidelity of data transfer for things like our Shell Scripts' db-credentials script, which currently uses the ConfigReadShell to dump DB connection values to bash variables, then has to parse that format back into a PHP data structure before spitting it back out in the appropriate format itself.

It'd be great to be able to do something like this from a calling script instead:

<?php
$cmd = escapeshellcmd('bin/cake ConfigRead --serialize Key.SubValueWithSubArrays');
$serialized = [];
$code = 0;
exec($cmd, $serialized, $code);
$data = unserialize($serialized);
echo $data['sub-sub-key']['property'];

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions