6 use Symfony\Component\Mime\Part\DataPart;
47 if (empty($filepath) || !is_file($filepath)) {
48 throw new InvalidArgumentException(__METHOD__ .
': $options[filepath] didn\'t result in a valid file');
51 $content = file_get_contents($filepath);
54 $options[
'filename'] = basename($filepath);
63 $content_type =
$options[
'type'] ??
null;
64 $encoding =
$options[
'encoding'] ??
null;
70 if (!str_contains(
$id,
'@')) {
74 $attachment->setContentId(
$id);
89 if (!$file->exists()) {
94 'content' => $file->grabFile(),
95 'type' => $file->getMimeType(),
96 'filename' => basename($file->getFilename()),
$content
Set robots.txt action.
$id
Generic annotation delete action.
static fromElggFile(\ElggFile $file)
Create an attachment from an ElggFile.
static factory(mixed $options)
Create an attachment.
static factory(array $options=[])
Create an email instance form an array of options.
Exception thrown if an argument is not of the expected type.
if($who_can_change_language==='nobody') elseif($who_can_change_language==='admin_only' &&!elgg_is_admin_logged_in()) $options
_elgg_services()
Get the global service provider.
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
if(parse_url(elgg_get_site_url(), PHP_URL_PATH) !=='/') if(file_exists(elgg_get_root_path() . 'robots.txt'))
Set robots.txt.