mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 12:05:56 +00:00
API-CHANGE: refactoring getDMSinstance() to inst()
This commit is contained in:
parent
c571d5bc8d
commit
6fa0cc5a32
@ -18,7 +18,7 @@ class DMS implements DMSInterface {
|
|||||||
* @static
|
* @static
|
||||||
* @return DMSInterface An instance of the Document Management System
|
* @return DMSInterface An instance of the Document Management System
|
||||||
*/
|
*/
|
||||||
static function getDMSInstance() {
|
static function inst() {
|
||||||
$dmsPath = self::get_DMS_path();
|
$dmsPath = self::get_DMS_path();
|
||||||
|
|
||||||
$dms = new DMS();
|
$dms = new DMS();
|
||||||
|
@ -22,7 +22,7 @@ class DMSUploadField extends UploadField {
|
|||||||
* @param File
|
* @param File
|
||||||
*/
|
*/
|
||||||
protected function attachFile($file) {
|
protected function attachFile($file) {
|
||||||
$dms = DMS::getDMSInstance();
|
$dms = DMS::inst();
|
||||||
$record = $this->getRecord();
|
$record = $this->getRecord();
|
||||||
|
|
||||||
if($record instanceof DMSDocument) {
|
if($record instanceof DMSDocument) {
|
||||||
|
@ -16,7 +16,7 @@ interface DMSInterface {
|
|||||||
* @abstract
|
* @abstract
|
||||||
* @return DMSInterface An instance of the Document Management System
|
* @return DMSInterface An instance of the Document Management System
|
||||||
*/
|
*/
|
||||||
static function getDMSInstance();
|
static function inst();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Takes a File object or a String (path to a file) and copies it into the DMS. The original file remains unchanged.
|
* Takes a File object or a String (path to a file) and copies it into the DMS. The original file remains unchanged.
|
||||||
|
@ -62,7 +62,7 @@ class DMSTest extends FunctionalTest {
|
|||||||
|
|
||||||
|
|
||||||
function testDMSStorage() {
|
function testDMSStorage() {
|
||||||
$dms = DMS::getDMSInstance();
|
$dms = DMS::inst();
|
||||||
|
|
||||||
$file = self::$testFile;
|
$file = self::$testFile;
|
||||||
$document = $dms->storeDocument($file);
|
$document = $dms->storeDocument($file);
|
||||||
@ -75,7 +75,7 @@ class DMSTest extends FunctionalTest {
|
|||||||
|
|
||||||
function testDMSFolderSpanning() {
|
function testDMSFolderSpanning() {
|
||||||
DMS::$dmsFolderSize = 5;
|
DMS::$dmsFolderSize = 5;
|
||||||
$dms = DMS::getDMSInstance();
|
$dms = DMS::inst();
|
||||||
|
|
||||||
$file = self::$testFile;
|
$file = self::$testFile;
|
||||||
|
|
||||||
@ -102,7 +102,7 @@ class DMSTest extends FunctionalTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function testReplaceDocument() {
|
function testReplaceDocument() {
|
||||||
$dms = DMS::getDMSInstance();
|
$dms = DMS::inst();
|
||||||
|
|
||||||
//store the first document
|
//store the first document
|
||||||
$document = $dms->storeDocument(self::$testFile);
|
$document = $dms->storeDocument(self::$testFile);
|
||||||
@ -121,7 +121,7 @@ class DMSTest extends FunctionalTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function testDownloadDocument() {
|
function testDownloadDocument() {
|
||||||
// $dms = DMS::getDMSInstance();
|
// $dms = DMS::inst();
|
||||||
//
|
//
|
||||||
// //store the first document
|
// //store the first document
|
||||||
// $document = $dms->storeDocument(self::$testFile);
|
// $document = $dms->storeDocument(self::$testFile);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user