fix deprecations

change default statusCode to 200
This commit is contained in:
Niko Storni 2018-12-03 17:52:22 -05:00
parent 6c61179546
commit 3d28c44fde
4 changed files with 15 additions and 18 deletions

View file

@ -213,13 +213,5 @@ Type::build('timestamp')
* *
*/ */
/*
* Only try to load DebugKit in development mode
* Debug Kit should not be installed on a production system
*/
if (Configure::read('debug')) {
Plugin::load('DebugKit', ['bootstrap' => true]);
}
Configure::load('lbry'); Configure::load('lbry');

View file

@ -71,10 +71,4 @@ Router::scope('/', function (RouteBuilder $routes) {
$routes->connect('/api/v1/claims/browse', ['controller' => 'Claims', 'action' => 'apibrowse']); $routes->connect('/api/v1/claims/browse', ['controller' => 'Claims', 'action' => 'apibrowse']);
//$routes->fallbacks(DashedRoute::class); //$routes->fallbacks(DashedRoute::class);
}); });
/**
* Load all plugin routes. See the Plugin documentation on
* how to customize the loading of plugin routes.
*/
Plugin::routes();

View file

@ -12,6 +12,7 @@
* @since 3.3.0 * @since 3.3.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License * @license http://www.opensource.org/licenses/mit-license.php MIT License
*/ */
namespace App; namespace App;
use Cake\Core\Configure; use Cake\Core\Configure;
@ -40,13 +41,23 @@ class Application extends BaseApplication
// Catch any exceptions in the lower layers, // Catch any exceptions in the lower layers,
// and make an error page/response // and make an error page/response
->add(ErrorHandlerMiddleware::class) ->add(ErrorHandlerMiddleware::class)
// Handle plugin/theme assets like CakePHP normally does. // Handle plugin/theme assets like CakePHP normally does.
->add(AssetMiddleware::class) ->add(AssetMiddleware::class)
// Apply routing // Apply routing
->add(RoutingMiddleware::class); ->add(RoutingMiddleware::class);
return $middleware; return $middleware;
} }
public function bootstrap()
{
parent::bootstrap(); // TODO: Change the autogenerated stub
/*
* Only try to load DebugKit in development mode
* Debug Kit should not be installed on a production system
*/
if (Configure::read('debug')) {
$this->addPlugin(\DebugKit\Plugin::class);
}
}
} }

View file

@ -68,7 +68,7 @@ class AppController extends Controller
} }
} }
protected function _jsonResponse($object = [], $statusCode = null) protected function _jsonResponse($object = [], $statusCode = 200)
{ {
$this->response->withStatus($statusCode); $this->response->withStatus($statusCode);
$this->response->withType('json'); $this->response->withType('json');