Skip to content

Commit

Permalink
Merge pull request #1741 from ushahidi/lumen-move-code-out-of-kohana-…
Browse files Browse the repository at this point in the history
…application

Move code out of kohana application
  • Loading branch information
rjmackay authored May 30, 2017
2 parents b903c73 + 7464939 commit 90b6519
Show file tree
Hide file tree
Showing 169 changed files with 2,256 additions and 3,107 deletions.
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

0 comments on commit 90b6519

Please sign in to comment.