Elgg
Version 2.2
|
Go to the source code of this file.
Namespaces | |
Elgg\Core | |
Activate a plugin or plugins. | |
Functions | |
get_dir_size ($dir, $total_size=0) | |
Get the size of the specified directory. More... | |
get_uploaded_file ($input_name) | |
Get the contents of an uploaded file. More... | |
get_resized_image_from_uploaded_file ($input_name, $maxwidth, $maxheight, $square=false, $upscale=false) | |
Gets the jpeg contents of the resized version of an uploaded image (Returns false if the uploaded file was not an image) More... | |
get_resized_image_from_existing_file ($input_name, $maxwidth, $maxheight, $square=false, $x1=0, $y1=0, $x2=0, $y2=0, $upscale=false) | |
Gets the jpeg contents of the resized version of an already uploaded image (Returns false if the file was not an image) More... | |
get_image_resize_parameters ($width, $height, $options) | |
Calculate the parameters for resizing an image. More... | |
file_delete ($guid) | |
Delete an file. More... | |
delete_directory ($directory) | |
Delete a directory and all its contents. More... | |
_elgg_clear_entity_files ($entity) | |
Removes all entity files. More... | |
get_default_filestore () | |
Return the default filestore. More... | |
set_default_filestore (\ElggFilestore $filestore) | |
Set the default filestore for the system. More... | |
elgg_get_file_simple_type ($mime_type) | |
Returns the category of a file from its MIME type. More... | |
_elgg_filestore_boot () | |
Bootstraps the default filestore at "boot, system" event. More... | |
_elgg_filestore_init () | |
Register file-related handlers on "init, system" event. More... | |
_elgg_filestore_detect_mimetype ($hook, $type, $mime_type, $params) | |
Fix MIME type detection for Microsoft zipped formats. More... | |
_elgg_filestore_parse_simpletype ($hook, $type, $simple_type, $params) | |
Parse a file category of file from a MIME type. More... | |
_elgg_filestore_test ($hook, $type, $value) | |
Unit tests for files. More... | |
elgg_get_download_url (\ElggFile $file, $use_cookie=true, $expires= '+2 hours') | |
Returns file's download URL. More... | |
elgg_get_inline_url (\ElggFile $file, $use_cookie=false, $expires= '') | |
Returns file's URL for inline display Suitable for displaying cacheable resources, such as user avatars. More... | |
elgg_get_embed_url (\ElggEntity $entity, $size) | |
Returns a URL suitable for embedding entity's icon in a text editor. More... | |
_elgg_filestore_serve_icon_handler () | |
Handler for /serve-icon resources /serve-icon/<entity_guid>/<size> More... | |
_elgg_filestore_touch_icons ($event, $type, $entity) | |
Reset icon URLs if access_id has changed. More... | |
_elgg_filestore_move_icons ($event, $type, $entity) | |
Listen to entity ownership changes and update icon ownership by moving icons to their new owner's directory on filestore. More... | |
Variables | |
$DEFAULT_FILE_STORE = null | |
Variable holding the default datastore. More... | |
return | function (\Elgg\EventsService $events,\Elgg\HooksRegistrationService $hooks) |
_elgg_clear_entity_files | ( | $entity | ) |
Removes all entity files.
\ElggEntity | $entity | An |
Definition at line 415 of file filestore.php.
_elgg_filestore_boot | ( | ) |
Bootstraps the default filestore at "boot, system" event.
Definition at line 473 of file filestore.php.
_elgg_filestore_detect_mimetype | ( | $hook, | |
$type, | |||
$mime_type, | |||
$params | |||
) |
Fix MIME type detection for Microsoft zipped formats.
string | $hook | "mime_type" |
string | $type | "file" |
string | $mime_type | Detected MIME type |
array | $params | Hook parameters |
Definition at line 522 of file filestore.php.
_elgg_filestore_init | ( | ) |
Register file-related handlers on "init, system" event.
Definition at line 488 of file filestore.php.
_elgg_filestore_move_icons | ( | $event, | |
$type, | |||
$entity | |||
) |
Listen to entity ownership changes and update icon ownership by moving icons to their new owner's directory on filestore.
This will only transfer icons that have a custom location on filestore and are owned by the entity's owner (instead of the entity itself). Even though core icon service does not store icons in the entity's owner directory, there are plugins that do (e.g. file plugin) - this handler helps such plugins avoid ownership mismatch.
string | $event | "update:after" |
string | $type | "object"|"group" |
ElggObject | $entity | Entity |
Definition at line 697 of file filestore.php.
_elgg_filestore_parse_simpletype | ( | $hook, | |
$type, | |||
$simple_type, | |||
$params | |||
) |
Parse a file category of file from a MIME type.
string | $hook | "simple_type" |
string | $type | "file" |
string | $simple_type | The category of file |
array | $params | Hook parameters |
Definition at line 541 of file filestore.php.
_elgg_filestore_serve_icon_handler | ( | ) |
Handler for /serve-icon resources /serve-icon/<entity_guid>/<size>
Definition at line 648 of file filestore.php.
_elgg_filestore_test | ( | $hook, | |
$type, | |||
$value | |||
) |
Unit tests for files.
string | $hook | unit_test |
string | $type | system |
mixed | $value | Array of tests |
Definition at line 576 of file filestore.php.
_elgg_filestore_touch_icons | ( | $event, | |
$type, | |||
$entity | |||
) |
Reset icon URLs if access_id has changed.
string | $event | "update:after" |
string | $type | "object"|"group" |
ElggObject | $entity | Entity |
Definition at line 663 of file filestore.php.
delete_directory | ( | $directory | ) |
Delete a directory and all its contents.
string | $directory | Directory to delete |
Definition at line 371 of file filestore.php.
elgg_get_download_url | ( | \ElggFile | $file, |
$use_cookie = true , |
|||
$expires = '+2 hours' |
|||
) |
Returns file's download URL.
\ElggFile | $file | File object or entity (must have the default filestore) |
bool | $use_cookie | Limit URL validity to current session only |
string | $expires | URL expiration, as a string suitable for strtotime() |
Definition at line 593 of file filestore.php.
elgg_get_embed_url | ( | \ElggEntity | $entity, |
$size | |||
) |
Returns a URL suitable for embedding entity's icon in a text editor.
We can not use elgg_get_inline_url() for these purposes due to a URL structure bound to user session and file modification time. This function returns a generic (permanent) URL that will then be resolved to an inline URL whenever requested.
\ElggEntity | $entity | Entity |
string | $size | Size |
Definition at line 636 of file filestore.php.
elgg_get_file_simple_type | ( | $mime_type | ) |
Returns the category of a file from its MIME type.
string | $mime_type | The MIME type |
Definition at line 462 of file filestore.php.
elgg_get_inline_url | ( | \ElggFile | $file, |
$use_cookie = false , |
|||
$expires = '' |
|||
) |
Returns file's URL for inline display Suitable for displaying cacheable resources, such as user avatars.
\ElggFile | $file | File object or entity (must have the default filestore) |
bool | $use_cookie | Limit URL validity to current session only |
string | $expires | URL expiration, as a string suitable for strtotime() |
Definition at line 613 of file filestore.php.
file_delete | ( | $guid | ) |
get_default_filestore | ( | ) |
get_dir_size | ( | $dir, | |
$total_size = 0 |
|||
) |
Get the size of the specified directory.
string | $dir | The full path of the directory |
int | $total_size | Add to current dir size |
Definition at line 18 of file filestore.php.
get_image_resize_parameters | ( | $width, | |
$height, | |||
$options | |||
) |
Calculate the parameters for resizing an image.
int | $width | Width of the original image |
int | $height | Height of the original image |
array | $options | See $defaults for the options |
Definition at line 210 of file filestore.php.
get_resized_image_from_existing_file | ( | $input_name, | |
$maxwidth, | |||
$maxheight, | |||
$square = false , |
|||
$x1 = 0 , |
|||
$y1 = 0 , |
|||
$x2 = 0 , |
|||
$y2 = 0 , |
|||
$upscale = false |
|||
) |
Gets the jpeg contents of the resized version of an already uploaded image (Returns false if the file was not an image)
string | $input_name | The name of the file on the disk |
int | $maxwidth | The desired width of the resized image |
int | $maxheight | The desired height of the resized image |
bool | $square | If set to true, takes the smallest of maxwidth and maxheight and use it to set the dimensions on the new image. If no crop parameters are set, the largest square that fits in the image centered will be used for the resize. If square, the crop must be a square region. |
int | $x1 | x coordinate for top, left corner |
int | $y1 | y coordinate for top, left corner |
int | $x2 | x coordinate for bottom, right corner |
int | $y2 | y coordinate for bottom, right corner |
bool | $upscale | Resize images smaller than $maxwidth x $maxheight? |
Definition at line 115 of file filestore.php.
get_resized_image_from_uploaded_file | ( | $input_name, | |
$maxwidth, | |||
$maxheight, | |||
$square = false , |
|||
$upscale = false |
|||
) |
Gets the jpeg contents of the resized version of an uploaded image (Returns false if the uploaded file was not an image)
string | $input_name | The name of the file input field on the submission form |
int | $maxwidth | The maximum width of the resized image |
int | $maxheight | The maximum height of the resized image |
bool | $square | If set to true, will take the smallest of maxwidth and maxheight and use it to set the dimensions on all size; the image will be cropped. |
bool | $upscale | Resize images smaller than $maxwidth x $maxheight? |
Definition at line 75 of file filestore.php.
get_uploaded_file | ( | $input_name | ) |
Get the contents of an uploaded file.
(Returns false if there was an issue.)
string | $input_name | The name of the file input field on the submission form |
Definition at line 43 of file filestore.php.
set_default_filestore | ( | \ElggFilestore | $filestore | ) |
Set the default filestore for the system.
\ElggFilestore | $filestore | An object. |
Definition at line 447 of file filestore.php.
$DEFAULT_FILE_STORE = null |
Variable holding the default datastore.
Definition at line 425 of file filestore.php.
return function(\Elgg\EventsService $events,\Elgg\HooksRegistrationService $hooks) |
Definition at line 744 of file filestore.php.