Jump to:

23493 Posts in 18996 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Using flush=all with sake

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 1113 Views
  • theorytank
    Avatar
    Community Member
    8 Posts

    Using flush=all with sake Link to this post

    I have a site that deploys from SVN to various servers. (Dev, Staging and Production). I have a fairly straight forward script that runs the SVN update, the runs sake like so:

    sake dev/build flush=all

    All works fine, however when you go to the live site it's as if the flush=all didn't run. I then have to login as admin and run the flush=all as a url parameter otherwise it doesn't find new templates and classes.

    I'm using an _ss_environment file to specify the domain names as so:

    // Staging
    $_FILE_TO_URL_MAPPING['/home/user/public_html'] = 'http://www.sitename.com/';

    It's like two different caches are being kept. One for sake, and one for the site.

    This makes deployment a little slower than I'd like. Any idea why the flush=all through sake isn't working on the site itself?

    These sites are in "test" and "live" modes. I'm not sure if this fails in dev mode as I don't need to deploy to that site as it's the dev site.

  • theorytank
    Avatar
    Community Member
    8 Posts

    Re: Using flush=all with sake Link to this post

    Ok.. a little more info. I dug into the tmp directory and I seem to have two manifest files:

    manifest-cli-script
    manifest-main

    Obviously one from sake and one from main.php (which is sapphire). Not sure why it would do that. I guess an easy (but unpredictable solution) would be to copy the cli one over top of the main one after doing the flush, however that seems really hacky.

    Any other thoughts?

  • theorytank
    Avatar
    Community Member
    8 Posts

    Re: Using flush=all with sake Link to this post

    Solved it, but I don't love the hack.

    First I tried copying the file which worked fine. Then I did some digging and found the code that generated the path. So, if I pre-define it in my _ss_environment.php file then all works as expected.

    define("MANIFEST_FILE", getSysTempDir() . '/silverstripe-cache' . str_replace(array(' ', "/", ":", "\\"), "-", dirname(__FILE__) ) . "/manifest-main");

    It's not pretty, but it works.

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: Using flush=all with sake Link to this post

    Obviously one from sake and one from main.php (which is sapphire). Not sure why it would do that.

    It appends the name of the root PHP files onto the mainfest (line 5 on MainfestBuilder). I cannot track down why it would do this. I assume it would be because most cli uses may involve a different user than the webserver user so to avoid permission issues it keeps it separate. From the looks of 3.0 this behaviour has been removed for a single file.

    If you want to keep a single manifest file then you can hard code this in your _config or _ss_environment

    define('MANIFEST_FILE', TEMP_FOLDER . "/manifest-main");

    1113 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.