|
Moodle
2.2.1
http://www.collinsharper.com
|

The class that handles the various stages of the actual export and the communication between the caller and the portfolio plugin. this is stored in the database between page requests in serialized base64 encoded form also contains helper methods for the plugin and caller to use (at the end of the file) {
Definition at line 41 of file exporter.php.
| __construct | ( | &$ | instance, |
| &$ | caller, | ||
| $ | callerfile | ||
| ) |
construct a new exporter for use
| portfolio_plugin_base | subclass $instance portfolio instance (passed by reference) | |
| portfolio_caller_base | subclass $caller portfolio caller (passed by reference) | |
| string | $callerfile | path to callerfile (relative to dataroot) |
Definition at line 135 of file exporter.php.

| caller | ( | ) |
helper function to return the caller object
Definition at line 275 of file exporter.php.

| cancel_request | ( | $ | logreturn = false | ) |
cancels a potfolio request and cleans up the tempdata and redirects the user back to where they started
Definition at line 615 of file exporter.php.


| copy_existing_file | ( | $ | oldfile | ) |
copies a file from somewhere else in moodle to the portfolio temporary working directory associated with this export
| $oldfile | stored_file object |
Reimplemented in portfolio_exporter_test.
Definition at line 745 of file exporter.php.

| get | ( | $ | field | ) |
returns the context, filearea, and itemid parts of a filearea (not filepath) to be used by plugins if they want to do things like zip up the contents of the temp area to here, or something that can't be done just using write_new_file, copy_existing_file or get_tempfiles
Definition at line 833 of file exporter.php.

| get_tempfiles | ( | $ | skipfile = 'portfolio-export.zip' | ) |
returns an arary of files in the temporary working directory for this export always use this instead of the files api directly
Definition at line 808 of file exporter.php.

| instance | ( | ) |
helper function to return the portfolio instance
Definition at line 266 of file exporter.php.

| log_transfer | ( | ) |
log the transfer this should only be called after the file has been sent either via push, or sent from a pull request.
Definition at line 530 of file exporter.php.


| static print_cleaned_export | ( | $ | log, |
| $ | instance = null |
||
| ) | [static] |
Definition at line 860 of file exporter.php.


| static print_expired_export | ( | ) | [static] |
wrapper function to print a friendly error to users
this is generally caused by them hitting an expired transfer through the usage of the backbutton
Definition at line 847 of file exporter.php.
| static print_finish_info | ( | $ | returnurl, |
| $ | continueurl, | ||
| $ | extras = null |
||
| ) | [static] |
| print_header | ( | $ | headingstr, |
| $ | summary = true |
||
| ) |
local print header function to be reused across the export
| string | $headerstring | full language string |
Definition at line 585 of file exporter.php.


| process_stage | ( | $ | stage, |
| $ | alreadystolen = false |
||
| ) |
process the given stage calling whatever functions are necessary
| int | $stage | (see PORTFOLIO_STAGE_* constants) |
| boolean | $alreadystolen | used to avoid letting plugins steal control twice. |
Definition at line 205 of file exporter.php.

| process_stage_cleanup | ( | $ | pullok = false | ) |
processes the 'cleanup' stage of the export
| boolean | $pullok | normally cleanup is deferred for pull plugins until after the file is requested from portfolio/file.php if you want to clean up earlier, pass true here (defaults to false) |
Definition at line 486 of file exporter.php.


processes the 'config' stage of the export
Definition at line 284 of file exporter.php.

processes the 'confirm' stage of the export
Definition at line 375 of file exporter.php.

| process_stage_finished | ( | $ | queued = false | ) |
processes the 'finish' stage of the export
Definition at line 560 of file exporter.php.


processes the 'package' stage of the export
Definition at line 455 of file exporter.php.

processes the 'queueornext' stage of the export
Definition at line 440 of file exporter.php.

processes the 'send' stage of the export
Definition at line 508 of file exporter.php.

| static rewaken_object | ( | $ | id | ) | [static] |
rewakens the data from the database given the id makes sure to load the required files with the class definitions
| int | $id | id of data |
Definition at line 664 of file exporter.php.


| save | ( | ) |
writes out the contents of this object and all its data to the portfolio_tempdata table and sets the 'id' field.
Definition at line 631 of file exporter.php.


| set | ( | $ | field, |
| &$ | value | ||
| ) |
generic setter for properties belonging to this instance outside the subclass like name, visible, etc.
Definition at line 172 of file exporter.php.

| set_forcequeue | ( | ) |
sets this export to force queued sometimes plugins need to set this randomly if an external system changes its mind about what's supported
Definition at line 193 of file exporter.php.
| update_log_url | ( | $ | url | ) |
in some cases (mahara) we need to update this after the log has been done because of MDL-20872
Definition at line 550 of file exporter.php.
| verify_rewaken | ( | $ | readonly = false | ) |
verifies a rewoken object
checks to make sure it belongs to the same user and session as is currently in use.
| boolean | $readonly | if we're reawakening this for a user to just display in the log view, don't verify the sessionkey when continuing transfers, you must pass false here. |
| portfolio_exception |
Definition at line 718 of file exporter.php.

| write_new_file | ( | $ | content, |
| $ | name, | ||
| $ | manifest = true |
||
| ) |
writes out some content to a file in the portfolio temporary working directory associated with this export
| string | $content | content to write |
| string | $name | filename to use |
| bool | $maifest | whether this is the main file or an secondary file (eg attachment) |
Definition at line 773 of file exporter.php.

| zip_tempfiles | ( | $ | filename = 'portfolio-export.zip', |
| $ | filepath = '/final/' |
||
| ) |
zips all files in the temporary directory
| string | $filename | name of resulting zipfile (optional, defaults to portfolio-export.zip |
| string | $filepath | subpath in the filearea (optional, defaults to final) |
Definition at line 790 of file exporter.php.

| $callerfile |
the file to include that contains the class definition of the caller object used to re-waken the object after sleep
Definition at line 74 of file exporter.php.
| $instancefile |
the file to include that contains the class defintion of the portfolio instance plugin used to re-waken the object after sleep
Definition at line 67 of file exporter.php.