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.

Archive

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

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

Scandir error


Reply

5 Posts   1597 Views

Avatar
WebGuest481

7 December 2008 at 8:07am Community Member, 4 Posts

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
simon_w

7 December 2008 at 8:53am Forum Moderator, 474 Posts

It helps if you give the actual error as well.

Avatar
WebGuest481

7 December 2008 at 9:03am (Last edited: 7 December 2008 9:14am), Community Member, 4 Posts

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
simon_w

7 December 2008 at 9:07am (Last edited: 7 December 2008 9:07am), Forum Moderator, 474 Posts

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

7 December 2008 at 9:15am Community Member, 4 Posts

Thanks!