fix deprecations
change default statusCode to 200
This commit is contained in:
parent
6c61179546
commit
3d28c44fde
4 changed files with 15 additions and 18 deletions
|
@ -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');
|
||||||
|
|
||||||
|
|
|
@ -72,9 +72,3 @@ Router::scope('/', function (RouteBuilder $routes) {
|
||||||
|
|
||||||
//$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();
|
|
||||||
|
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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');
|
||||||
|
|
Loading…
Reference in a new issue