Changeset View
Changeset View
Standalone View
Standalone View
src/applications/macro/engine/PhabricatorMemeEngine.php
| Show First 20 Lines • Show All 157 Lines • ▼ Show 20 Lines | final class PhabricatorMemeEngine extends Phobject { | ||||
| } | } | ||||
| private function newAssetFile(PhabricatorFile $template) { | private function newAssetFile(PhabricatorFile $template) { | ||||
| $data = $this->newAssetData($template); | $data = $this->newAssetData($template); | ||||
| return PhabricatorFile::newFromFileData( | return PhabricatorFile::newFromFileData( | ||||
| $data, | $data, | ||||
| array( | array( | ||||
| 'name' => 'meme-'.$template->getName(), | 'name' => 'meme-'.$template->getName(), | ||||
| 'ttl.relative' => phutil_units('24 hours in seconds'), | |||||
| 'canCDN' => true, | 'canCDN' => true, | ||||
| // In modern code these can end up linked directly in email, so let | |||||
| // them stick around for a while. | |||||
| 'ttl.relative' => phutil_units('30 days in seconds'), | |||||
| )); | )); | ||||
| } | } | ||||
| private function newAssetData(PhabricatorFile $template) { | private function newAssetData(PhabricatorFile $template) { | ||||
| $template_data = $template->loadFileData(); | $template_data = $template->loadFileData(); | ||||
| $result = $this->newImagemagickAsset($template, $template_data); | $result = $this->newImagemagickAsset($template, $template_data); | ||||
| if ($result) { | if ($result) { | ||||
| ▲ Show 20 Lines • Show All 206 Lines • Show Last 20 Lines | |||||