Skip to content

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

@beporter

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'];

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