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

Commit

Permalink
closing for #15 fixes #15
Browse files Browse the repository at this point in the history
  • Loading branch information
cdowdy committed Sep 14, 2017
1 parent 7e9f2c7 commit d1cf3e6
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/Helpers/FilePathHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,14 @@ public function __construct(Application $app)
* Get Bolt's Files path
* @return mixed
*
* The version is "reversed" from what you would logically use..
* instead of 'this version is greater than or equal too 3.3.0'
* we have to think ok the current bolt version is less than the one we are comparing
*
* example: bolt version 3.2.14 is less than 3.3.0 so
* Version::compare( '3.3.0', '>=') would need to use resources not path_resolver
* Use PHP's version_compare instead of bolts Version::compare since it's "broken"
*/
public function boltFilesPath()
{
if (Version::compare( '3.3.0', '>=')) {
return $this->app['resources']->getPath( 'filespath' );
} else {
if ( version_compare( Version::VERSION , '3.3.0', '>=' ) ) {
return $this->app['path_resolver']->resolve('files');

} else {
return $this->app['resources']->getPath( 'filespath' );
}
}

Expand All @@ -54,7 +48,7 @@ public function boltFilesPath()
*/
public function boltExtensionsPath()
{
if (Version::compare('3.3.0', '>=')) {
if ( version_compare( Version::VERSION , '3.3.0', '>=' ) ) {
return $this->app['path_resolver']->resolve('extensions');
} else {
return $this->app['resources']->getPath('extensions');
Expand Down

0 comments on commit d1cf3e6

Please sign in to comment.