Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Commit

Permalink
adds method to check for bolt version for #44
Browse files Browse the repository at this point in the history
  • Loading branch information
cdowdy committed Aug 29, 2017
1 parent 69987ab commit 5f24603
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/Controller/BetterThumbsBackendController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
use Symfony\Component\HttpFoundation\JsonResponse;


use Bolt\Version as Version;

use League\Flysystem\Adapter\Local;
use League\Flysystem\Filesystem;

Expand Down Expand Up @@ -334,6 +336,10 @@ public function doPrime( Application $app, Request $request )
return new JsonResponse( $primed );
}

/**
* @param $driver
* @return array|string
*/
protected function checkAccpetedTypes( $driver )
{
$acceptedTypes = '';
Expand All @@ -353,5 +359,29 @@ protected function checkAccpetedTypes( $driver )

}

/**
* @param Application $app
* @return string
*
* a method to check to make sure bolt is greater than or equal too 3.3.0 since they changed backend page routes
*/
public function buildProperExtensionPath(Application $app )
{
// bolt devs like to break things in a non backwards manner in minor releases. So we have to
// hackishly build a url here.. check for the version number and then move on cause you know... who likes
// to do things in a normal sane backwards compatible manner? not bolt devs for extension authors

$urlGenerator = $app['url_generator'];
$dashboardRoute = $urlGenerator->generate( 'dashboard' );

if (Version::compare('3.3.0', '>=')) {
$extensionsRoute = 'extensions';
} else {
$extensionsRoute = 'extend';
}

return $dashboardRoute . '/' . $extensionsRoute ;
}


}

0 comments on commit 5f24603

Please sign in to comment.