Skip to content

Commit

Permalink
Revert "occ web executor (#24957)"
Browse files Browse the repository at this point in the history
This reverts commit 9fcb269.
  • Loading branch information
MorrisJobke committed Jul 7, 2016
1 parent 4782b92 commit f593a09
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 324 deletions.
13 changes: 0 additions & 13 deletions core/application.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

use OC\AppFramework\Utility\SimpleContainer;
use OC\AppFramework\Utility\TimeFactory;
use OC\Core\Controller\OccController;
use \OCP\AppFramework\App;
use OC\Core\Controller\LostController;
use OC\Core\Controller\UserController;
Expand Down Expand Up @@ -90,18 +89,6 @@ public function __construct(array $urlParams=array()){
$c->query('Logger')
);
});
$container->registerService('OccController', function(SimpleContainer $c) {
return new OccController(
$c->query('AppName'),
$c->query('Request'),
$c->query('Config'),
new \OC\Console\Application(
$c->query('Config'),
$c->query('ServerContainer')->getEventDispatcher(),
$c->query('Request')
)
);
});

/**
* Core class wrappers
Expand Down
147 changes: 0 additions & 147 deletions core/controller/occcontroller.php

This file was deleted.

1 change: 0 additions & 1 deletion core/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
['name' => 'avatar#postCroppedAvatar', 'url' => '/avatar/cropped', 'verb' => 'POST'],
['name' => 'avatar#getTmpAvatar', 'url' => '/avatar/tmp', 'verb' => 'GET'],
['name' => 'avatar#postAvatar', 'url' => '/avatar/', 'verb' => 'POST'],
['name' => 'occ#execute', 'url' => '/occ/{command}', 'verb' => 'POST'],
]
]);

Expand Down
19 changes: 3 additions & 16 deletions lib/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@
*
*/

use OCP\IRequest;

require_once 'public/constants.php';

/**
Expand Down Expand Up @@ -298,20 +296,9 @@ public static function checkInstalled() {
}
}

/**
* Limit maintenance mode access
* @param IRequest $request
*/
public static function checkMaintenanceMode(IRequest $request) {
// Check if requested URL matches 'index.php/occ'
$isOccControllerRequested = preg_match('|/index\.php$|', $request->getScriptName()) === 1
&& strpos($request->getPathInfo(), '/occ/') === 0;
public static function checkMaintenanceMode() {
// Allow ajax update script to execute without being stopped
if (
\OC::$server->getSystemConfig()->getValue('maintenance', false)
&& OC::$SUBURI != '/core/ajax/update.php'
&& !$isOccControllerRequested
) {
if (\OC::$server->getSystemConfig()->getValue('maintenance', false) && OC::$SUBURI != '/core/ajax/update.php') {
// send http status 503
header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Status: 503 Service Temporarily Unavailable');
Expand Down Expand Up @@ -934,7 +921,7 @@ public static function handleRequest() {
$request = \OC::$server->getRequest();
$requestPath = $request->getRawPathInfo();
if (substr($requestPath, -3) !== '.js') { // we need these files during the upgrade
self::checkMaintenanceMode($request);
self::checkMaintenanceMode();
self::checkUpgrade();
}

Expand Down
3 changes: 1 addition & 2 deletions lib/private/console/application.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,9 @@ public function setAutoExit($boolean) {
* @throws \Exception
*/
public function run(InputInterface $input = null, OutputInterface $output = null) {
$args = isset($this->request->server['argv']) ? $this->request->server['argv'] : [];
$this->dispatcher->dispatch(ConsoleEvent::EVENT_RUN, new ConsoleEvent(
ConsoleEvent::EVENT_RUN,
$args
$this->request->server['argv']
));
return $this->application->run($input, $output);
}
Expand Down
4 changes: 2 additions & 2 deletions public.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
exit;
}

$request = \OC::$server->getRequest();
OC::checkMaintenanceMode($request);
OC::checkMaintenanceMode();
OC::checkSingleUserMode(true);
$request = \OC::$server->getRequest();
$pathInfo = $request->getPathInfo();

if (!$pathInfo && $request->getParam('service', '') === '') {
Expand Down
143 changes: 0 additions & 143 deletions tests/Core/Controller/OccControllerTest.php

This file was deleted.

0 comments on commit f593a09

Please sign in to comment.