Jump to:

23486 Posts in 18995 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » StaticExporter still working?

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: 1065 Views
  • x75
    Avatar
    Community Member
    42 Posts

    StaticExporter still working? Link to this post

    Hi,

    I tried to use StaticExporter to export several Silverstripe sites. I tried pages based on 2.4.0, 2.4.2 and 2.4.3. They all just return empty "mysite.tar.gz" files when I call http://domain.tld/StaticExporter/export. Is there anything I'm missing, or does Static Exporter not work in 2.4?

    Thanks
    Johannes

  • x75
    Avatar
    Community Member
    42 Posts

    Re: StaticExporter still working? Link to this post

    Ok, little update.

    My first problem was, that shell_exec was disabled in the php.ini.
    The exporter starts working now, but fails at the end before packing and sending the file to the browser. If I check in the silverstripe-cache dir, the export is there...

    [Warning] copy(/var/www/silverstripe-cache/static-export/mysite/home/index.html): failed to open stream: No such file or directory
    GET /StaticExporter/export

    Line 93 in /var/www/cms/code/StaticExporter.php
    Source

    84
    85          // Write to file
    86          if($fh = fopen($contentfile, 'w')) {
    87             fwrite($fh, $response->getBody());
    88             fclose($fh);
    89          }
    90       }
    91
    92       // copy homepage (URLSegment: "home") to webroot
    93       copy("$tmpFolder/home/index.html", "$tmpFolder/index.html");         
    94       
    95       // archive all generated files
    96       `cd $tmpBaseFolder; tar -czhf $baseFolderName.tar.gz $baseFolderName`;
    97       $archiveContent = file_get_contents("$tmpBaseFolder/$baseFolderName.tar.gz");
    98       
    99       // remove temporary files and folder

    Trace

    * copy(/var/www/silverstripe-cache/static-export/mysite/home/index.html,/var/www/silverstripe-cache/static-export/mysite/index.html)
    Line 93 of StaticExporter.php
    * StaticExporter->export(SS_HTTPRequest)
    Line 193 of Controller.php
    * Controller->handleAction(SS_HTTPRequest)
    Line 137 of RequestHandler.php
    * RequestHandler->handleRequest(SS_HTTPRequest)
    Line 147 of Controller.php
    * Controller->handleRequest(SS_HTTPRequest)
    Line 281 of Director.php
    * Director::handleRequest(SS_HTTPRequest,Session)
    Line 124 of Director.php
    * Director::direct(/StaticExporter/export)
    Line 127 of main.php

    Any idea?

    Thanks
    Johannes

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