Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

/styleguide/html/styleguide.html 404 for some files #2

Closed

Description

@benedfit

image

Getting the above 404 errors on a fresh install after running builder for the first time

Activity

  1. benedfit commented on Aug 29, 2013

    @benedfit
    Author

    Would appear that the static assets aren't being copied from source to public. Maybe a Windows issue?

  2. benedfit commented on Aug 29, 2013

    @benedfit
    Author

    Note than I ran the builder command from the command line and /public/index.html generated successfully, and does so on subsequent builds

  3. dmolsen commented on Aug 30, 2013

    @dmolsen
    Member

    I'm assuming this has something to do with how I'm handling the results returned from the RecursiveDirectoryIterator() and RecursiveIteratorIterator() calls on line #41 of builder/lib/generator.lib.php. Can you do me a favor and do a print($name."\n"); exit; on line #43 of that file? Then copy and paste at least some of the results here. I don't have access to a Windows machine to test this. Fixing this should fix what I suspect is a similar problem in watcher.lib.php.

    Thanks, @benedfit . I'll try to borrow a Windows machine here.

  4. bmuenzenmeyer commented on Aug 31, 2013

    @bmuenzenmeyer
    Member

    I see the same thing on Windows. I also had to set error_reporting on and define my APP_PATH and include it in the include path. PHP 101, perhaps.

    I will look at the error @benedfit mentions and report findings.

  5. bmuenzenmeyer commented on Aug 31, 2013

    @bmuenzenmeyer
    Member

    Probably related....

    Running the builder provides the following error for (what I think is) every pattern:

    Warning: mkdir(): Invalid argument in [PATH OMITTED]\builder\lib\generator.lib.php on line 53
    

    Line #53:

    mkdir(__DIR__."/../../public/".$fileName);
  6. bmuenzenmeyer commented on Aug 31, 2013

    @bmuenzenmeyer
    Member

    @dmolsen I did what you asked @benedfit above, I get the following results:

    [APP+PATH]\patternlab-php\builder\lib/../../source\.
    

    Hope this helps. Will look at this all later - have a crying son so bye!

  7. dmolsen commented on Aug 31, 2013

    @dmolsen
    Member

    Have a couple of ideas for this. I'm going to create a branch for this and post it. I'm also going to get a VM set-up on Tuesday so I can test this myself. builder.inc.php uses glob() for iterating over directories. This seems cross-platform so the initial patterns and what not are created. generator.inc.php and watcher.inc.php use the more powerful RecursiveDirectoryIterator() but it seems to want some more configuration. This is why other files like images and JS are not getting copied. I think the latter has some flags (related to 'dot' files and paths) that I should be able to set to make all of our lives easier.

  8. dmolsen commented on Aug 31, 2013

    @dmolsen
    Member

    Added a branch called diriterator-fix. I hope it'll address this issue for you. I only attempted to fix generator.lib.php. The two commits:

    support for SKIP_DOTS
    support for win directory separator

    I appreciate your help.

  9. bmuenzenmeyer commented on Sep 1, 2013

    @bmuenzenmeyer
    Member

    Hi Dave.

    This appears to have done the trick. style.css and the other assets are now found when generated.

  10. dmolsen commented on Sep 1, 2013

    @dmolsen
    Member

    I've updated watcher.lib.php in the branch diriterator-fix. Fingers crossed that that works as well. Basically, start the watch, make file changes, and see if they show up in public/.

  11. dmolsen commented on Sep 4, 2013

    @dmolsen
    Member

    Finally got a Windows 7 VM. Going to give this a run out tonight.

  12. dmolsen commented on Sep 5, 2013

    @dmolsen
    Member

    I believe this is now fixed. I used PHP 5.3 from php.net on the Win 7 VM to test. I've merged the changes into master. Let me know if anything still seems broken.

    Note: if you update your copy make sure to a) generate your site again and b) to double-check you've properly refreshed:

    public/styleguide/js/styleguide.js
    public/styleguide/js/url-handler.js
    public/styleguide/html/styleguide.html
    

    I ran into cache issues when testing.

  13. bmuenzenmeyer commented on Sep 5, 2013

    @bmuenzenmeyer
    Member

    Looks good to me 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions