Skip to content

Commit 1abeb65

Browse files
committed
Changed back sprinkle path constant to full app dir path.
Fixes error in CheckEnvironment. Revert part of cc736ed. Windows path should be fixed from URI package update.
1 parent 16f7e8f commit 1abeb65

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

app/defines.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
define('UserFrosting\SRC_DIR_NAME', 'src');
3636

3737
// Full path to Sprinkles directory
38-
define('UserFrosting\SPRINKLES_DIR', APP_DIR_NAME . DS . SPRINKLES_DIR_NAME);
38+
define('UserFrosting\SPRINKLES_DIR', APP_DIR . DS . SPRINKLES_DIR_NAME);
3939

4040
// Full path to sprinkles schema file
4141
define('UserFrosting\SPRINKLES_SCHEMA_FILE', APP_DIR . DS . 'sprinkles.json');

app/system/Sprinkle/SprinkleManager.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class SprinkleManager
3434
protected $sprinkles = [];
3535

3636
/**
37-
* @var string Relaive path to the sprinkles directory. Will be used to register the location with the ResourceLocator
37+
* @var string Path to the sprinkles directory. Will be used to register the location with the ResourceLocator
3838
*/
3939
protected $sprinklesPath = \UserFrosting\SPRINKLES_DIR . \UserFrosting\DS;
4040

@@ -60,7 +60,7 @@ public function addResources()
6060
}
6161

6262
/**
63-
* Register a sprinkle as a locator location, using relative path to the sprinkle
63+
* Register a sprinkle as a locator location
6464
* @param string $sprinkleName
6565
*/
6666
public function addSprinkleResources($sprinkleName)
@@ -85,13 +85,12 @@ public function getSprinklePath($sprinkleName)
8585
}
8686

8787
// Get path and make sure it exist
88-
$relPath = $this->getSprinklesPath() . $sprinkle;
89-
$fullpath = \UserFrosting\ROOT_DIR . \UserFrosting\DS . $relPath;
90-
if (!file_exists($fullpath)) {
91-
throw new FileNotFoundException("Sprinkle `$sprinkleName` should be found at `$fullpath`, but that directory doesn't exist.");
88+
$path = $this->getSprinklesPath() . $sprinkle;
89+
if (!file_exists($path)) {
90+
throw new FileNotFoundException("Sprinkle `$sprinkleName` should be found at `$path`, but that directory doesn't exist.");
9291
}
9392

94-
return $relPath;
93+
return $path;
9594
}
9695

9796
/**

0 commit comments

Comments
 (0)