public static function replaceInAllPath($source, $target) { self::cache(); foreach (self::$imagePaths as $name => $path) { self::$imagePaths[$name] = str_replace($source, $target, $path); } }
/** * Replace a part in each path * * @param string $source * @param string $target */ function redirect_img_dir($source, $target) { ImageRepo::replaceInAllPath($source, $target); }