mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
510c556739
API Improved support for versioned DataObject API GridField extensions for versioned dataobjects API De-couple File and ErrorPage API File::handle_shortcode now respects canView() API AssetControlExtension is now able to delete, publish, or protect files API Upload now protects new assets by default
26 lines
650 B
PHP
26 lines
650 B
PHP
<?php
|
|
|
|
/**
|
|
* Migrates all 3.x file dataobjects to use the new DBFile field.
|
|
*
|
|
* @package framework
|
|
* @subpackage filesystem
|
|
*/
|
|
class MigrateFileTask extends BuildTask {
|
|
|
|
protected $title = 'Migrate File dataobjects from 3.x';
|
|
|
|
protected $description
|
|
= 'Imports all files referenced by File dataobjects into the new Asset Persistence Layer introduced in 4.0';
|
|
|
|
public function run($request) {
|
|
$migrated = FileMigrationHelper::singleton()->run();
|
|
if($migrated) {
|
|
DB::alteration_message("{$migrated} File DataObjects upgraded", "changed");
|
|
} else {
|
|
DB::alteration_message("No File DataObjects need upgrading", "notice");
|
|
}
|
|
}
|
|
|
|
}
|