public function Micon::setArchive in Micon 8
Same name and namespace in other branches
- 2.x src/Entity/Micon.php \Drupal\micon\Entity\Micon::setArchive()
Set the archive as base64 encoded string.
Parameters
string $zip_path: The URI of the zip file.
Return value
$this
Overrides MiconInterface::setArchive
File
- src/
Entity/ Micon.php, line 165
Class
- Micon
- Defines the Micon entity.
Namespace
Drupal\micon\EntityCode
public function setArchive($zip_path) {
$data = strtr(base64_encode(addslashes(gzcompress(serialize(file_get_contents($zip_path)), 9))), '+/=', '-_,');
$parts = str_split($data, 200000);
$this
->set('archive', $parts);
}