$opt = $this->wdir . '/' . $clean;
if (!file_exists($opt) || !filesize($opt) || filemtime($path) > filemtime($opt)) {
+ if (file_exists($opt) && is_link($opt)) {
+ unlink($opt);
+ }
SVGTools::_optimizeSVG($path, $opt);
}
return $clean;
if (file_exists($fixed) && filemtime($fixed) >= filemtime($source)) {
return $fixed;
}
+ if (file_exists($fixed) && is_link($fixed)) {
+ unlink($fixed);
+ }
$svg = simplexml_load_string(file_get_contents($source));
$attr = $svg->attributes();
if (isset($attr['width'], $attr['height'])) {
public function getAssetDir()
{
- return Files::mkdir('/application/protected/fluidbookpublication/working/' . $this->id);
+ return Files::mkdir(protected_path('fluidbookpublication/working/' . $this->id));
}
public function asset_path($path)
{
- return $this->getAssetDir() . '/' . $path;
+ return $this->getAssetDir() . ltrim($path,'/');
}
public function getCompositionUpdate(): int