Moodle

file storage methods to move files out from storage

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Cannot Reproduce
  • Affects Version/s: 2.0
  • Fix Version/s: 2.0
  • Component/s: Files API
  • Labels:
    None
  • Affected Branches:
    MOODLE_20_STABLE
  • Fixed Branches:
    MOODLE_20_STABLE

Description

There are a bunch of methods to add files/content to the (file_)storage:

create_file_from_pathname(); from normal filesystem to storage
create_file_from_url(): from url to storage
create_file_from_string(): from variable to storage
create_file_from_storedfile(): from storage to storage

I think we need at least two functions doing the inverse:

create_pathname_from_file(): from storage to normal filesystem
create_string_from_file(): from storage to variable

So, some processes like backup/restore can copy files out from storage and make their work there. I think that doing everything in the storage would be far from optimal.

Note I don't like the function names. They are only an "example". Perhaps they should be "export_xxxx" or another thing.

Ciao

Activity

Hide
Petr Škoda (skodak) added a comment -

backup does not need to create any temp files because you can zip directly from file areas

Show
Petr Škoda (skodak) added a comment - backup does not need to create any temp files because you can zip directly from file areas
Hide
Petr Škoda (skodak) added a comment -

there already is:
$stored_file->copy_content_to($pathname)
$stored_file->get_content()

is that what you wanted?

Show
Petr Škoda (skodak) added a comment - there already is: $stored_file->copy_content_to($pathname) $stored_file->get_content() is that what you wanted?
Hide
Petr Škoda (skodak) added a comment -

no answer? closing

Show
Petr Škoda (skodak) added a comment - no answer? closing

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: