Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Scandir error

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

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

Page: 1
Go to End
Author Topic: 1582 Views
  • WebGuest481
    Avatar
    Community Member
    4 Posts

    Scandir error Link to this post

    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);
             }
          }
       }

  • simon_w
    Avatar
    Forum Moderator
    473 Posts

    Re: Scandir error Link to this post

    It helps if you give the actual error as well.

  • WebGuest481
    Avatar
    Community Member
    4 Posts

    Re: Scandir error Link to this post

    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

  • simon_w
    Avatar
    Forum Moderator
    473 Posts

    Re: Scandir error Link to this post

    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.

  • WebGuest481
    Avatar
    Community Member
    4 Posts

    Re: Scandir error Link to this post

    Thanks!

    1582 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.