mirror of
https://github.com/silverstripe/silverstripe-staticpublisher
synced 2024-10-22 14:05:54 +02:00
Update to SilverStripe 3.1
Static exporter will now work with SilverStripe 3.1.x. There's a few things to note: mkdir() fails on windows platforms, fopen fails to get external files.
This commit is contained in:
parent
efb7b1dc94
commit
77eebfcbf3
@ -49,8 +49,15 @@ class StaticExporter extends Controller {
|
||||
if(!$this->config()->get('disable_sitetree_export')) {
|
||||
$objs[] = $this->config()->get('export_objects');
|
||||
$objs[] = "SiteTree";
|
||||
|
||||
$this->config()->set('export_objects', $objs);
|
||||
$objs[] = "Page";
|
||||
foreach($objs as $obj){
|
||||
if(is_string($obj)) {
|
||||
$mypage = $obj::get();
|
||||
foreach($mypage as $page){
|
||||
StaticExporter::$export_objects []= $page;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -225,12 +232,10 @@ class StaticExporter extends Controller {
|
||||
* @return array
|
||||
*/
|
||||
public function getExportUrls() {
|
||||
$classes = $this->config()->get('export_objects');
|
||||
$classes = StaticExporter::$export_objects;
|
||||
$urls = array();
|
||||
|
||||
foreach($classes as $obj) {
|
||||
$link = $obj->Link;
|
||||
|
||||
$link = $obj->Link();
|
||||
$urls[$link] = $link;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user