diff options
author | icewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-05-01 14:16:23 +0000 |
---|---|---|
committer | icewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-05-01 14:16:23 +0000 |
commit | 9816315e13355806d2e4cb4302a1f81de9c2af89 (patch) | |
tree | 26a0964a2b0350d21d6323269d1f8d259ecf9423 /engine/lib | |
parent | 9119f0a5442ece4213080016a68264dfcc64d819 (diff) | |
download | elgg-9816315e13355806d2e4cb4302a1f81de9c2af89.tar.gz elgg-9816315e13355806d2e4cb4302a1f81de9c2af89.tar.bz2 |
Marcus Povey <marcus@dushka.co.uk>
* Bugfix: uses the correct filename
git-svn-id: https://code.elgg.org/elgg/trunk@594 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r-- | engine/lib/filestore.php | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/engine/lib/filestore.php b/engine/lib/filestore.php index 32b8a63ad..62de55b9e 100644 --- a/engine/lib/filestore.php +++ b/engine/lib/filestore.php @@ -333,7 +333,7 @@ */ public function open($mode) { - if (!$this->title) + if (!$this->getFilename()) throw new IOException("You must specify a name before opening a file."); // See if file has already been saved @@ -616,6 +616,15 @@ return true; } + + /** + * Run once and only once. + */ + function filestore_run_once() + { + // Register a class + add_subtype("object", "file", "ElggFile"); + } /** * Initialise the file modules. @@ -623,13 +632,13 @@ */ function filestore_init() { - // Register a class - add_subtype("object", "file", "ElggFile"); - // Now register a default filestore set_default_filestore(new ElggDiskFilestore($CONFIG->dataroot)); + + // Now run this stuff, but only once + run_function_once("filestore_run_once"); } // Register a startup event - register_event_handler('init','system','filestore_init',0); + register_event_handler('init','system','filestore_init',0); ?>
\ No newline at end of file |