Limpieza de objetos externos
This commit is contained in:
@ -2,28 +2,39 @@
|
||||
use Psr\Container\ContainerInterface as Container;
|
||||
|
||||
return [
|
||||
'folders' => function(Container $c) {
|
||||
$arr = [
|
||||
'base' => dirname(__DIR__, 2)
|
||||
];
|
||||
$arr['resources'] = implode(DIRECTORY_SEPARATOR, [
|
||||
$arr['base'],
|
||||
'resources'
|
||||
]);
|
||||
$arr['routes'] = implode(DIRECTORY_SEPARATOR, [
|
||||
$arr['resources'],
|
||||
'routes'
|
||||
]);
|
||||
$arr['public'] = implode(DIRECTORY_SEPARATOR, [
|
||||
$arr['base'],
|
||||
'public'
|
||||
]);
|
||||
return (object) $arr;
|
||||
},
|
||||
'urls' => function(Container $c) {
|
||||
$arr = [
|
||||
'python' => 'http://python:5000'
|
||||
];
|
||||
return (object) $arr;
|
||||
}
|
||||
'folders' => function(Container $c) {
|
||||
return \ProVM\Implement\Collection::fromArray([
|
||||
'base' => dirname(__DIR__, 2),
|
||||
'resources' => function(\Psr\Collection\CollectionInterface $collection) {
|
||||
return implode(DIRECTORY_SEPARATOR, [
|
||||
$collection['base'],
|
||||
'resources'
|
||||
]);
|
||||
},
|
||||
'documentation' => function(\Psr\Collection\CollectionInterface $collection) {
|
||||
return implode(DIRECTORY_SEPARATOR, [
|
||||
$collection['resources'],
|
||||
'documentation'
|
||||
]);
|
||||
},
|
||||
'routes' => function(\Psr\Collection\CollectionInterface $collection) {
|
||||
return implode(DIRECTORY_SEPARATOR, [
|
||||
$collection['resources'],
|
||||
'routes'
|
||||
]);
|
||||
},
|
||||
'public' => function(\Psr\Collection\CollectionInterface $collection) {
|
||||
return implode(DIRECTORY_SEPARATOR, [
|
||||
$collection['base'],
|
||||
'public'
|
||||
]);
|
||||
}
|
||||
]);
|
||||
},
|
||||
'urls' => function(Container $c) {
|
||||
$arr = [
|
||||
'python' => 'http://python:5000'
|
||||
];
|
||||
return (object) $arr;
|
||||
}
|
||||
];
|
||||
|
@ -14,15 +14,6 @@ return [
|
||||
'name' => $_ENV['MYSQL_DATABASE']
|
||||
]
|
||||
];
|
||||
function toObj($arr) {
|
||||
$obj = (object) $arr;
|
||||
foreach ($arr as $k => $v) {
|
||||
if (is_array($v)) {
|
||||
$obj->{$k} = toObj($v);
|
||||
}
|
||||
}
|
||||
return $obj;
|
||||
}
|
||||
return (object) ['databases' => toObj($arr), 'short_names' => true];
|
||||
return (object) ['databases' => \ProVM\Implement\Collection::fromArray($arr), 'short_names' => true];
|
||||
}
|
||||
];
|
||||
|
Reference in New Issue
Block a user