31 lines
555 B
PHP
Executable File
31 lines
555 B
PHP
Executable File
<?php
|
|
|
|
require_once ('vn/image/db.php');
|
|
|
|
use Vn\Image;
|
|
use Vn\Web\Auth;
|
|
use Vn\Rest;
|
|
|
|
class RestMod extends Rest\Module
|
|
{
|
|
function run ()
|
|
{
|
|
// throw new Rest\Exception ('Image', 'inMaintenance',
|
|
// 'Servicio no disponible temporalmente por '.
|
|
// 'mantenimiento, intentalo de nuevo más tarde');
|
|
|
|
try {
|
|
Image\Db::init (Auth::getUser (), Auth::getPassword ());
|
|
Image\Db::upload ();
|
|
Image\Db::deinit ();
|
|
return TRUE;
|
|
}
|
|
catch (Exception $e)
|
|
{
|
|
throw new Rest\Exception ('Image', $e->getCode (), $e->getMessage ());
|
|
}
|
|
}
|
|
}
|
|
|
|
?>
|