*/
protected string $cache;
- /**
- * The ContainerInterface instance
- *
- * @var ContainerInterface
- */
- protected $container;
-
/**
* The ImageUtil instance
*/
/**
* The public path
*/
- protected string $public;
+ protected string $path;
/**
* The SluggerUtil instance
* @param ImageUtil $image The MapUtil instance
* @param SluggerUtil $slugger The SluggerUtil instance
* @param string $cache The cache path
- * @param string $public The public path
+ * @param string $path The public path
+ * @param string $prefix The prefix
*/
- function __construct(ContainerInterface $container, ImageUtil $image, SluggerUtil $slugger, string $cache = '../var/cache/image', string $public = './bundles/rapsyspack/image') {
+ function __construct(ContainerInterface $container, ImageUtil $image, SluggerUtil $slugger, string $cache = '../var/cache', string $path = './bundles/rapsyspack', string $prefix = 'image') {
//Set cache
- $this->cache = $cache;
+ $this->cache = $cache.'/'.$prefix;
//Set container
$this->container = $container;
//Set image
$this->image = $image;
- //Set public
- $this->public = $public;
+ //Set path
+ $this->path = $path.'/'.$prefix;
//Set slugger
$this->slugger = $slugger;
$hashed = array_reverse(str_split(strval($updated)));
//Set captcha
- $captcha = $this->public.'/'.$hashed[0].'/'.$hashed[1].'/'.$hashed[2].'/'.$updated.'/'.$equation.'/'.$width.'x'.$height.'.jpeg';
+ $captcha = $this->path.'/'.$hashed[0].'/'.$hashed[1].'/'.$hashed[2].'/'.$updated.'/'.$equation.'/'.$width.'x'.$height.'.jpeg';
//Unshort equation
$equation = $this->slugger->unshort($equation);
$draw->setFontSize($this->image->captchaFontSize/1.5);
//Set stroke width
- $draw->setStrokeWidth($this->image->captchaStrokeWidth / 2);
+ $draw->setStrokeWidth($this->image->captchaStrokeWidth / 3);
//Set rotation
$draw->rotate($rotate = (rand(25, 75)*(rand(0,1)?-.1:.1)));
$hashed = array_reverse(str_split(strval($updated)));
//Set thumb
- $thumb = $this->public.'/'.$hashed[0].'/'.$hashed[1].'/'.$hashed[2].'/'.$updated.'/'.$path.'/'.$width.'x'.$height.'.jpeg';
+ $thumb = $this->path.'/'.$hashed[0].'/'.$hashed[1].'/'.$hashed[2].'/'.$updated.'/'.$path.'/'.$width.'x'.$height.'.jpeg';
//Unshort path
$path = $this->slugger->unshort($path);