Add prefix for public path and cache
Cleanup
protected string $cache;
/**
protected string $cache;
/**
- protected string $public;
+ protected string $path;
/**
* The RouterInterface instance
/**
* The RouterInterface instance
protected SluggerUtil $slugger;
/**
protected SluggerUtil $slugger;
/**
- * Creates a new map util
+ * Creates a new image util
*
* @param RouterInterface $router The RouterInterface instance
* @param SluggerUtil $slugger The SluggerUtil instance
*
* @param RouterInterface $router The RouterInterface instance
* @param SluggerUtil $slugger The SluggerUtil instance
+ * @param string $cache The cache directory
+ * @param string $path The public path
+ * @param string $prefix The prefix
- function __construct(RouterInterface $router, SluggerUtil $slugger, string $cache = '../var/cache/image', string $public = './bundles/rapsyspack/image', $captchaBackground = self::captchaBackground, $captchaFill = self::captchaFill, $captchaFontSize = self::captchaFontSize, $captchaStroke = self::captchaStroke, $captchaStrokeWidth = self::captchaStrokeWidth) {
+ function __construct(RouterInterface $router, SluggerUtil $slugger, string $cache = '../var/cache', string $path = './bundles/rapsyspack', string $prefix = 'image', $captchaBackground = self::captchaBackground, $captchaFill = self::captchaFill, $captchaFontSize = self::captchaFontSize, $captchaStroke = self::captchaStroke, $captchaStrokeWidth = self::captchaStrokeWidth) {
+ $this->cache = $cache.'/'.$prefix;
//set captcha background
$this->captchaBackground = $captchaBackground;
//set captcha background
$this->captchaBackground = $captchaBackground;
//set captcha stroke width
$this->captchaStrokeWidth = $captchaStrokeWidth;
//set captcha stroke width
$this->captchaStrokeWidth = $captchaStrokeWidth;
- //Set public
- $this->public = $public;
+ //Set path
+ $this->path = $path.'/'.$prefix;
//Set router
$this->router = $router;
//Set router
$this->router = $router;
$hash = array_reverse(str_split(strval($updated)));
//Set dir
$hash = array_reverse(str_split(strval($updated)));
//Set dir
- $dir = $this->public.'/'.$hash[0].'/'.$hash[1].'/'.$hash[2].'/'.$updated.'/'.$this->slugger->short($path);
+ $dir = $this->path.'/'.$hash[0].'/'.$hash[1].'/'.$hash[2].'/'.$updated.'/'.$this->slugger->short($path);
//Set removes
$removes = [];
//Set removes
$removes = [];