Sorry, I can’'t make it works, tested with last php 7.3, 7,4 and 8 over apache and nginx.
<?php
require('../../../../../dmxConnectLib/dmxConnect.php');
$app = new \lib\App();
$app->define(<<<'JSON'
{
"meta": {
"$_POST": [
{
"type": "number",
"name": "id_evento"
},
{
"type": "text",
"name": "nombre_evento"
},
{
"type": "text",
"name": "ruta_imagen"
},
{
"type": "text",
"name": "descripcion"
},
{
"type": "text",
"name": "evento_url"
}
]
},
"exec": {
"steps": [
"SecurityProviders/ses_clientes",
{
"name": "",
"module": "auth",
"action": "restrict",
"options": {
"provider": "ses_clientes",
"permissions": [
"admin"
],
"loginUrl": "/",
"forbiddenUrl": "/"
}
},
{
"name": "subir_imagen_evento",
"module": "upload",
"action": "upload",
"options": {
"path": "/imagenes/eventos/highres",
"fields": "{{$_POST.ruta_imagen}}"
},
"meta": [
{
"name": "name",
"type": "text"
},
{
"name": "path",
"type": "text"
},
{
"name": "url",
"type": "text"
},
{
"name": "type",
"type": "text"
},
{
"name": "size",
"type": "text"
},
{
"name": "error",
"type": "number"
}
],
"outputType": "array"
},
{
"name": "image_resize",
"module": "image",
"action": "load",
"options": {
"path": "{{subir_imagen_evento.url}}"
},
"outputType": "object",
"meta": [
{
"name": "width",
"type": "number"
},
{
"name": "height",
"type": "number"
}
]
},
{
"name": "imageInfo",
"module": "image",
"action": "getImageSize",
"options": {
"path": "{{subir_imagen_evento.url}}"
},
"outputType": "object",
"meta": [
{
"name": "width",
"type": "number"
},
{
"name": "height",
"type": "number"
}
]
},
{
"name": "",
"module": "core",
"action": "condition",
"options": {
"if": "{{imageInfo.width>500}}",
"then": {
"steps": [
{
"name": "",
"module": "image",
"action": "resize",
"options": {
"instance": "image_resize",
"width": 500,
"height": 500
}
},
{
"name": "newImage",
"module": "image",
"action": "save",
"options": {
"instance": "image_resize",
"path": "/imagenes/eventos/lowres",
"template": "{name}_lowres75{ext}"
}
},
{
"name": "newImage_copy",
"module": "image",
"action": "save",
"options": {
"instance": "image_resize",
"quality": 20,
"path": "/imagenes/eventos/lowres",
"template": "{name}_lowres20{ext}"
}
},
{
"name": "",
"module": "core",
"action": "condition",
"options": {
"if": "{{newImage}}",
"then": {
"steps": {
"name": "actualizar_ultimo_evento",
"module": "dbupdater",
"action": "insert",
"options": {
"connection": "db_main",
"sql": {
"type": "insert",
"values": [
{
"table": "main_eventos",
"column": "id_evento",
"type": "number",
"value": "{{$_POST.id_evento}}"
},
{
"table": "main_eventos",
"column": "nombre_evento",
"type": "text",
"value": "{{$_POST.nombre_evento}}"
},
{
"table": "main_eventos",
"column": "ruta_imagen",
"type": "text",
"value": "{{newImage}}"
},
{
"table": "main_eventos",
"column": "descripcion",
"type": "text",
"value": "{{$_POST.descripcion}}"
},
{
"table": "main_eventos",
"column": "evento_url",
"type": "text",
"value": "{{$_POST.evento_url}}"
}
],
"table": "main_eventos",
"returning": "id",
"query": "INSERT INTO main_eventos\n(id_evento, nombre_evento, ruta_imagen, descripcion, evento_url) VALUES (:P1 /* {{$_POST.id_evento}} */, :P2 /* {{$_POST.nombre_evento}} */, :P3 /* {{newImage}} */, :P4 /* {{$_POST.descripcion}} */, :P5 /* {{$_POST.evento_url}} */)",
"params": [
{
"name": ":P1",
"type": "expression",
"value": "{{$_POST.id_evento}}"
},
{
"name": ":P2",
"type": "expression",
"value": "{{$_POST.nombre_evento}}"
},
{
"name": ":P3",
"type": "expression",
"value": "{{newImage}}"
},
{
"name": ":P4",
"type": "expression",
"value": "{{$_POST.descripcion}}"
},
{
"name": ":P5",
"type": "expression",
"value": "{{$_POST.evento_url}}"
}
]
}
},
"meta": [
{
"name": "identity",
"type": "text"
},
{
"name": "affected",
"type": "number"
}
]
}
}
},
"outputType": "boolean"
}
]
}
},
"outputType": "boolean"
}
]
}
}
JSON
);
?>
This are the output save files:
Even I have re-upload the whole directory to server deleting first everything in there.
What I can do to debug this.
Thanks