]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Api/ApiResponse.php
Fix test
[friendica.git] / src / Module / Api / ApiResponse.php
index 8f493138390ec3299c308c8eba44f36511628d37..a6a94ad81c559e209635013e2da2039b35eb1e73 100644 (file)
@@ -103,7 +103,7 @@ class ApiResponse extends Response
                        'alternate'    => $user_info['url'],
                        'self'         => $this->baseUrl . '/' . $this->args->getQueryString(),
                        'base'         => $this->baseUrl,
-                       'updated'      => DateTimeFormat::utc(null, DateTimeFormat::API),
+                       'updated'      => DateTimeFormat::utcNow(DateTimeFormat::API),
                        'atom_updated' => DateTimeFormat::utcNow(DateTimeFormat::ATOM),
                        'language'     => $user_info['lang'],
                        'logo'         => $this->baseUrl . '/images/friendica-32.png',
@@ -221,6 +221,16 @@ class ApiResponse extends Response
                $this->addContent($return);
        }
 
+       /**
+        * Wrapper around exit() for JSON only responses
+        *
+        * @param array $data
+        */
+       public function exitWithJson(array $data)
+       {
+               $this->exit('content', ['content' => $data], static::TYPE_JSON);
+       }
+
        /**
         * Quit execution with the message that the endpoint isn't implemented
         *