Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move code out of kohana application #1741

Merged
merged 13 commits into from
May 30, 2017
7 changes: 5 additions & 2 deletions app/Http/Controllers/API/Posts/GeoJSONController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
* @license https://www.gnu.org/licenses/agpl-3.0.html GNU Affero General Public License Version 3 (AGPL3)
*/

use Ushahidi\App\Util\Tile;
use Ushahidi\App\Util\BoundingBox;

class GeoJSONController extends PostsController
{

Expand All @@ -27,9 +30,9 @@ public function prepBoundingBox(Request $request)
if ($zoom !== false and
$x !== false and
$y !== false) {
$boundingBox = \Util_Tile::tileToBoundingBox($zoom, $x, $y);
$boundingBox = Tile::tileToBoundingBox($zoom, $x, $y);

$request->merge(['bbox' => implode(',', $boundingBox->as_array())]);
$request->merge(['bbox' => implode(',', $boundingBox->asArray())]);
}
}

Expand Down
5 changes: 2 additions & 3 deletions app/Http/Controllers/RESTController.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,9 @@ public function __construct(UsecaseFactory $usecaseFactory)
/**
* @var array List of HTTP methods which may be cached
*/
protected $cacheableMethods = array
(
protected $cacheableMethods = [
Request::METHOD_GET,
);
];

/**
* Get current api version
Expand Down
9 changes: 6 additions & 3 deletions app/Passport/TokenGuard.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,10 @@ protected function authenticateViaBearerToken($request)

return $token ? $user->withAccessToken($token) : null;
} catch (OAuthServerException $e) {
// return Container::getInstance()->make(
// ExceptionHandler::class
// )->report($e);
// Log the error
Container::getInstance()->make(
ExceptionHandler::class
)->report($e);

// Adding WWW-Authenticate ourselves because thephpleague/oauth2-server sucks
// https://github.com/thephpleague/oauth2-server/issues/738
Expand All @@ -157,6 +158,8 @@ protected function authenticateViaBearerToken($request)
$e->getMessage(),
$e->getHttpHeaders() + ['WWW-Authenticate' => 'Bearer realm="OAuth"']
);

return;
}
}

Expand Down
54 changes: 0 additions & 54 deletions application/classes/OAuth2/Request.php

This file was deleted.

90 changes: 0 additions & 90 deletions application/classes/OAuth2/Storage.php

This file was deleted.

138 changes: 0 additions & 138 deletions application/classes/OAuth2/Storage/Client.php

This file was deleted.

54 changes: 0 additions & 54 deletions application/classes/OAuth2/Storage/Scope.php

This file was deleted.

Loading