| 54 |
} |
} |
| 55 |
|
|
| 56 |
/** |
/** |
| 57 |
* Return the storage engine |
* Return the storage engine. We first find out which storage engine is |
| 58 |
|
* used, then we load specified file and then we call the function that |
| 59 |
|
* needs to be in the storage engine file "fast_gallery_get_storage, |
| 60 |
|
* which then returns the correct storage engine |
| 61 |
* @return Istorage |
* @return Istorage |
| 62 |
*/ |
*/ |
| 63 |
public function getStorageEngine() { |
public function getStorageEngine() { |
| 64 |
$engines = module_invoke_all('fast_gallery_info'); |
$storage_engine_info = variable_get('fg_storage_engine', array()); |
| 65 |
|
|
| 66 |
|
//we fetch the file with the storage engine |
| 67 |
|
include_once($storage_engine_info['path'] . '/' . $storage_engine_info['file']); |
| 68 |
|
return fast_gallery_get_storage();//and call the function to return it. |
| 69 |
|
|
|
$file = variable_get('fg_storage_engine', FG_DEFAULT_STORAGE_ENGINE); |
|
|
|
|
|
include_once($engines['storageengine'][$file]['path'].'/'.$engines['storageengine'][$file]['file']); |
|
|
switch ($file) { |
|
|
case 'default': |
|
|
print 'hallo welt'; |
|
|
return new DefaultStorage(); |
|
|
} |
|
| 70 |
} |
} |
| 71 |
|
|
| 72 |
/** |
/** |
| 167 |
} |
} |
| 168 |
return $bc; |
return $bc; |
| 169 |
} |
} |
| 170 |
|
|
| 171 |
|
/** |
| 172 |
|
* removing a file that has been deleted from the file system |
| 173 |
|
* @param $file |
| 174 |
|
* @return unknown_type |
| 175 |
|
*/ |
| 176 |
|
public function deleteFile($file) { |
| 177 |
|
$storage = $this->getStorageEngine(); |
| 178 |
|
$storage->deleteFile($file); |
| 179 |
|
} |
| 180 |
} |
} |