Update Admin routes with new Class@method syntax to save memory

This commit is contained in:
Giuseppe Criscione 2018-10-16 10:26:41 +02:00
parent 40cb2ff644
commit 2576277a9b

View File

@ -160,11 +160,11 @@ class Admin
$this->router->add( $this->router->add(
array('GET', 'POST'), array('GET', 'POST'),
'/login/', '/login/',
array(new Controllers\Authentication(), 'login') Controllers\Authentication::class . '@login'
); );
$this->router->add( $this->router->add(
'/logout/', '/logout/',
array(new Controllers\Authentication(), 'logout') Controllers\Authentication::class . '@logout'
); );
// Backup // Backup
@ -172,12 +172,12 @@ class Admin
'XHR', 'XHR',
'POST', 'POST',
'/backup/make/', '/backup/make/',
array(new Controllers\Backup(), 'make') Controllers\Backup::class . '@make'
); );
$this->router->add( $this->router->add(
'POST', 'POST',
'/backup/download/{backup}/', '/backup/download/{backup}/',
array(new Controllers\Backup(), 'download') Controllers\Backup::class . '@download'
); );
// Cache // Cache
@ -185,74 +185,74 @@ class Admin
'XHR', 'XHR',
'POST', 'POST',
'/cache/clear/', '/cache/clear/',
array(new Controllers\Cache(), 'clear') Controllers\Cache::class . '@clear'
); );
// Dashboard // Dashboard
$this->router->add( $this->router->add(
'/dashboard/', '/dashboard/',
array(new Controllers\Dashboard(), 'index') Controllers\Dashboard::class . '@index'
); );
// Options // Options
$this->router->add( $this->router->add(
'/options/', '/options/',
array(new Controllers\Options(), 'index') Controllers\Options::class . '@index'
); );
$this->router->add( $this->router->add(
array('GET', 'POST'), array('GET', 'POST'),
'/options/system/', '/options/system/',
array(new Controllers\Options(), 'systemOptions') Controllers\Options::class . '@systemOptions'
); );
$this->router->add( $this->router->add(
array('GET', 'POST'), array('GET', 'POST'),
'/options/site/', '/options/site/',
array(new Controllers\Options(), 'siteOptions') Controllers\Options::class . '@siteOptions'
); );
$this->router->add( $this->router->add(
'/options/updates/', '/options/updates/',
array(new Controllers\Options(), 'updates') Controllers\Options::class . '@updates'
); );
$this->router->add( $this->router->add(
'/options/info/', '/options/info/',
array(new Controllers\Options(), 'info') Controllers\Options::class . '@info'
); );
// Pages // Pages
$this->router->add( $this->router->add(
'/pages/', '/pages/',
array(new Controllers\Pages(), 'index') Controllers\Pages::class . '@index'
); );
$this->router->add( $this->router->add(
'POST', 'POST',
'/pages/new/', '/pages/new/',
array(new Controllers\Pages(), 'create') Controllers\Pages::class . '@create'
); );
$this->router->add( $this->router->add(
array('GET', 'POST'), array('GET', 'POST'),
'/pages/{page}/edit/', '/pages/{page}/edit/',
array(new Controllers\Pages(), 'edit') Controllers\Pages::class . '@edit'
); );
$this->router->add( $this->router->add(
'XHR', 'XHR',
'POST', 'POST',
'/pages/reorder/', '/pages/reorder/',
array(new Controllers\Pages(), 'reorder') Controllers\Pages::class . '@reorder'
); );
$this->router->add( $this->router->add(
'POST', 'POST',
'/pages/{page}/file/upload/', '/pages/{page}/file/upload/',
array(new Controllers\Pages(), 'uploadFile') Controllers\Pages::class . '@uploadFile'
); );
$this->router->add( $this->router->add(
'POST', 'POST',
'/pages/{page}/file/{filename}/delete/', '/pages/{page}/file/{filename}/delete/',
array(new Controllers\Pages(), 'deleteFile') Controllers\Pages::class . '@deleteFile'
); );
$this->router->add( $this->router->add(
'POST', 'POST',
'/pages/{page}/delete/', '/pages/{page}/delete/',
array(new Controllers\Pages(), 'delete') Controllers\Pages::class . '@delete'
); );
// Updates // Updates
@ -260,34 +260,34 @@ class Admin
'XHR', 'XHR',
'POST', 'POST',
'/updates/check/', '/updates/check/',
array(new Controllers\Updates(), 'check') Controllers\Updates::class . '@check'
); );
$this->router->add( $this->router->add(
'XHR', 'XHR',
'POST', 'POST',
'/updates/update/', '/updates/update/',
array(new Controllers\Updates(), 'update') Controllers\Updates::class . '@update'
); );
// Users // Users
$this->router->add( $this->router->add(
'/users/', '/users/',
array(new Controllers\Users(), 'index') Controllers\Users::class . '@index'
); );
$this->router->add( $this->router->add(
'POST', 'POST',
'/users/new/', '/users/new/',
array(new Controllers\Users(), 'create') Controllers\Users::class . '@create'
); );
$this->router->add( $this->router->add(
'POST', 'POST',
'/users/{user}/delete/', '/users/{user}/delete/',
array(new Controllers\Users(), 'delete') Controllers\Users::class . '@delete'
); );
$this->router->add( $this->router->add(
array('GET', 'POST'), array('GET', 'POST'),
'/users/{user}/profile/', '/users/{user}/profile/',
array(new Controllers\Users(), 'profile') Controllers\Users::class . '@profile'
); );
} }