From 172b7f46d2e0d203c9f2f058557efb246cb45c44 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Sat, 15 Feb 2020 07:22:43 +0200 Subject: [PATCH] Moved humans.txt and robots.txt to template files --- app/app.php | 18 +++++------------- app/views/general/humans.phtml | 8 ++++++++ app/views/general/robots.phtml | 3 +++ composer.lock | 34 +++++++++++++++++----------------- 4 files changed, 33 insertions(+), 30 deletions(-) create mode 100644 app/views/general/humans.phtml create mode 100644 app/views/general/robots.phtml diff --git a/app/app.php b/app/app.php index d0cd5ecb2..df6a14fd8 100644 --- a/app/app.php +++ b/app/app.php @@ -342,10 +342,8 @@ $utopia->get('/robots.txt') ->label('docs', false) ->action( function () use ($response) { - $response->text('# robotstxt.org/ - -User-agent: * -'); + $template = new View(__DIR__.'/views/general/robots.phtml'); + $response->text($template->render(false)); } ); @@ -355,14 +353,8 @@ $utopia->get('/humans.txt') ->label('docs', false) ->action( function () use ($response) { - $response->text('# humanstxt.org/ -# The humans responsible & technology colophon - -# TEAM - -- -- - -# THANKS - '); + $template = new View(__DIR__.'/views/general/humans.phtml'); + $response->text($template->render(false)); } ); @@ -370,7 +362,7 @@ $utopia->get('/v1/info') // This is only visible to gods ->label('scope', 'god') ->label('docs', false) ->action( - function () use ($response, $user, $project, $version, $env) { //TODO CONSIDER BLOCKING THIS ACTION TO ROLE GOD + function () use ($response, $user, $project, $version, $env) { $response->json([ 'name' => 'API', 'version' => $version, diff --git a/app/views/general/humans.phtml b/app/views/general/humans.phtml new file mode 100644 index 000000000..1595d08bf --- /dev/null +++ b/app/views/general/humans.phtml @@ -0,0 +1,8 @@ +# humanstxt.org/ +# The humans responsible & technology colophon + +# TEAM + -- -- + +# THANKS + \ No newline at end of file diff --git a/app/views/general/robots.phtml b/app/views/general/robots.phtml new file mode 100644 index 000000000..ef9d9f6ed --- /dev/null +++ b/app/views/general/robots.phtml @@ -0,0 +1,3 @@ +# robotstxt.org/ + +User-agent: * \ No newline at end of file diff --git a/composer.lock b/composer.lock index 1542e0772..a9597a149 100644 --- a/composer.lock +++ b/composer.lock @@ -1387,12 +1387,12 @@ "source": { "type": "git", "url": "https://github.com/utopia-php/framework.git", - "reference": "4474932a797e8e5441163fa007aea8b6c6ae0186" + "reference": "ac1bdf5d34432620c5be97249a5e5ab0e49a69c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/framework/zipball/4474932a797e8e5441163fa007aea8b6c6ae0186", - "reference": "4474932a797e8e5441163fa007aea8b6c6ae0186", + "url": "https://api.github.com/repos/utopia-php/framework/zipball/ac1bdf5d34432620c5be97249a5e5ab0e49a69c7", + "reference": "ac1bdf5d34432620c5be97249a5e5ab0e49a69c7", "shasum": "" }, "require": { @@ -1423,7 +1423,7 @@ "php", "upf" ], - "time": "2020-02-13T08:25:02+00:00" + "time": "2020-02-15T05:02:58+00:00" }, { "name": "utopia-php/locale", @@ -1988,12 +1988,12 @@ "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "35ac7d8479b312530648b28914620120446fa0ae" + "reference": "70d7abb1fdad964379676d629923de0dd1918f4f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/35ac7d8479b312530648b28914620120446fa0ae", - "reference": "35ac7d8479b312530648b28914620120446fa0ae", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/70d7abb1fdad964379676d629923de0dd1918f4f", + "reference": "70d7abb1fdad964379676d629923de0dd1918f4f", "shasum": "" }, "require": { @@ -2026,7 +2026,7 @@ } ], "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "time": "2020-02-10T19:49:09+00:00" + "time": "2020-02-14T12:50:24+00:00" }, { "name": "phpspec/prophecy", @@ -3156,12 +3156,12 @@ "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "4d62307f9899420a2027d2b963f5c9b2b5b06fbd" + "reference": "d876bc45c9b4cd115585ec5e6fcf522611469f20" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/4d62307f9899420a2027d2b963f5c9b2b5b06fbd", - "reference": "4d62307f9899420a2027d2b963f5c9b2b5b06fbd", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/d876bc45c9b4cd115585ec5e6fcf522611469f20", + "reference": "d876bc45c9b4cd115585ec5e6fcf522611469f20", "shasum": "" }, "require": { @@ -3213,20 +3213,20 @@ "keywords": [ "templating" ], - "time": "2020-02-13T13:24:02+00:00" + "time": "2020-02-14T15:15:54+00:00" }, { "name": "webmozart/assert", - "version": "1.6.0", + "version": "1.7.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "573381c0a64f155a0d9a23f4b0c797194805b925" + "reference": "aed98a490f9a8f78468232db345ab9cf606cf598" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/573381c0a64f155a0d9a23f4b0c797194805b925", - "reference": "573381c0a64f155a0d9a23f4b0c797194805b925", + "url": "https://api.github.com/repos/webmozart/assert/zipball/aed98a490f9a8f78468232db345ab9cf606cf598", + "reference": "aed98a490f9a8f78468232db345ab9cf606cf598", "shasum": "" }, "require": { @@ -3261,7 +3261,7 @@ "check", "validate" ], - "time": "2019-11-24T13:36:37+00:00" + "time": "2020-02-14T12:15:55+00:00" } ], "aliases": [],