API-CHANGE: refactoring getDMSinstance() to inst()

This commit is contained in:
Julian Seidenberg 2012-08-07 11:07:34 +12:00
parent c571d5bc8d
commit 6fa0cc5a32
4 changed files with 7 additions and 7 deletions

View File

@ -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();

View File

@ -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) {

View File

@ -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.

View File

@ -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);