daniloaz / myphp-backup

Simple and fast MySQL backups using PHP
GNU General Public License v3.0
201 stars 115 forks source link

json #10

Closed wings77 closed 5 years ago

wings77 commented 5 years ago

trate de enviar informacion por medio de json par alo cual le inderte el siguiente codigo al final.... pero la informacion no llega, como puedo hacerlo? Gracias

if (php_sapi_name() != "cli") { echo '

'; }

$processResult = [];

if ($result=="OK"){
    $processResult ['success'] = true;
    $processResult ['message'] = "La copia de seguridad termino con exito!";
    $processResult ['backup_file'] = $dest;
}else{
    $processResult ['success'] = false;
    $processResult ['message'] = "No fue posible hacer la copia de Seguridad!";
    $processResult ['backup_file'] = "";
}
echo json_encode($processResult, JSON_UNESCAPED_UNICODE);
daniloaz commented 5 years ago

The script is not intended to output information in json format, but through the screen, and therefore the output buffer is controlled by the obfPrint function. If you want to get that information in JSON you should overwrite that function or write an alternative to do it.