mirror of
https://github.com/silverstripe/silverstripe-staticpublisher
synced 2024-10-22 14:05:54 +02:00
26 lines
703 B
PHP
26 lines
703 B
PHP
|
<?php
|
||
|
/**
|
||
|
* @package static
|
||
|
*/
|
||
|
class StaticExporterTask extends BuildTask {
|
||
|
|
||
|
public function run($request) {
|
||
|
$export = new StaticExporter();
|
||
|
|
||
|
$url = $request->getVar('baseurl');
|
||
|
$sym = $request->getVar('symlink');
|
||
|
$quiet = $request->getVar('quiet');
|
||
|
$folder = $request->getVar('path');
|
||
|
|
||
|
if(!$folder) $folder = TEMP_FOLDER . '/static-export';
|
||
|
|
||
|
$url = ($url) ? $url : Director::baseURL();
|
||
|
$symlink = ($sym != "false");
|
||
|
$quiet = ($quiet) ? $quiet : false;
|
||
|
|
||
|
if(!$quiet) printf("Exporting website with %s base URL... %s", $url, PHP_EOL);
|
||
|
$path = $export->doExport($url, $folder, $symlink, $quiet);
|
||
|
|
||
|
if(!$quiet) printf("Completed. Website exported to %s. %s", $path, PHP_EOL);
|
||
|
}
|
||
|
}
|