Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

Scandir error


Go to End


5 Posts   2478 Views

Avatar
WebGuest481

Community Member, 4 Posts

7 December 2008 at 8:07am

I'm getting an error for line 272 in the MasterBuilder.php and I'm not sure why. Can anyone see what the deal is from this? I do have a site theme, the $themeName=null to the actual theme name?

* Generates the template manifest - a list of all the .SS files in the
* application
*/
private static function getTemplateManifest($baseDir, $folder, &$templateManifest, &$cssManifest, $themeName = null) {
$items = scandir("$baseDir/$folder");
if($items) foreach($items as $item) {
if(substr($item,0,1) == '.') continue;
if(substr($item,-3) == '.ss') {
$templateName = substr($item, 0, -3);
$templateType = substr($folder,strrpos($folder,'/')+1);
if($templateType == "templates") $templateType = "main";

if($themeName) {
$templateManifest[$templateName]['themes'][$themeName][$templateType] = "$baseDir/$folder/$item";
} else {
$templateManifest[$templateName][$templateType] = "$baseDir/$folder/$item";
}

} else if(substr($item,-4) == '.css') {
$cssName = substr($item, 0, -4);
// Debug::message($item);

if($themeName) {
$cssManifest[$cssName]['themes'][$themeName] = "$folder/$item";
} else {
$cssManifest[$cssName]['unthemed'] = "$folder/$item";
}

} else if(@is_dir("$baseDir/$folder/$item")) {
ManifestBuilder::getTemplateManifest($baseDir, "$folder/$item", $templateManifest, $cssManifest, $themeName);
}
}
}

Avatar
(deleted)

Community Member, 473 Posts

7 December 2008 at 8:53am

It helps if you give the actual error as well.

Avatar
WebGuest481

Community Member, 4 Posts

7 December 2008 at 9:03am

Edited: 07/12/2008 9:14am

Whoops..I get this -

Warning: scandir(/home/content/a/w/a/aweelley/html/themes/holeinone4.tar.gz) [function.scandir]: failed to open dir: Not a directory in /home/content/a/w/a/aweelley/html/sapphire/core/ManifestBuilder.php on line 272

Warning: scandir() [function.scandir]: (errno 20): Not a directory in /home/content/a/w/a/aweelley/html/sapphire/core/ManifestBuilder.php on line 272

Avatar
(deleted)

Community Member, 473 Posts

7 December 2008 at 9:07am

Edited: 07/12/2008 9:07am

You've left the archive containing the theme in the themes folder. As it starts with the same name as the theme, the manifestbuilder is trying to get all the files in it, which is causing it to generate the error. Deleting or renaming the archive should fix this.

Avatar
WebGuest481

Community Member, 4 Posts

7 December 2008 at 9:15am

Thanks!