First commit

This commit is contained in:
Nathan
2026-09-18 20:29:17 -06:00
commit 3b09abe571
2840 changed files with 467153 additions and 0 deletions
@@ -0,0 +1,38 @@
<?php
// +-----------------------------------------------------------------------+
// | This file is part of Piwigo. |
// | |
// | For copyright and license information, please view the COPYING.txt |
// | file that was distributed with this source code. |
// +-----------------------------------------------------------------------+
class PwgJsonEncoder extends PwgResponseEncoder
{
function encodeResponse($response)
{
if ($response instanceof PwgError)
{
return json_encode(
array(
'stat' => 'fail',
'err' => $response->code(),
'message' => $response->message(),
)
);
}
parent::flattenResponse($response);
return json_encode(
array(
'stat' => 'ok',
'result' => $response,
)
);
}
function getContentType()
{
return 'text/plain';
}
}
?>