2009-07-02 00:28:06 +02:00
|
|
|
<?php
|
2010-04-23 02:11:32 +02:00
|
|
|
/**
|
|
|
|
* @package cms
|
|
|
|
* @subpackage assets
|
|
|
|
*/
|
2009-07-02 00:28:06 +02:00
|
|
|
class FilesystemSyncTask extends BuildTask {
|
2009-10-21 06:37:02 +02:00
|
|
|
|
2009-07-02 00:28:06 +02:00
|
|
|
protected $title = "Sync Files & Images assets";
|
|
|
|
|
|
|
|
protected $description = "The Files & Images system in SilverStripe maintains its own database
|
|
|
|
of the contents of the assets/ folder. This action will update that database, and
|
|
|
|
should be called whenever files are added to the assets/ folder from outside
|
|
|
|
SilverStripe, for example, if an author uploads files via FTP.";
|
|
|
|
|
|
|
|
function run($request) {
|
2009-10-21 06:37:02 +02:00
|
|
|
if(isset($_GET['folderID'])) {
|
|
|
|
$folderID = $_GET['folderID'];
|
|
|
|
} else {
|
|
|
|
$folderID = null;
|
|
|
|
}
|
2011-09-27 14:03:05 +02:00
|
|
|
|
|
|
|
echo Filesystem::sync($folderID, !($request->getVar('skipSyncLinkTracking'))) . "\n";
|
2009-07-02 00:28:06 +02:00
|
|
|
}
|
2009-10-21 06:37:02 +02:00
|
|
|
|
2012-04-12 09:23:20 +02:00
|
|
|
}
|