isEncoded example



    /** * {@inheritdoc} */
    public function getUrl($path)
    {
        if (empty($path)) {
            return null;
        }

        if ($this->strategy->isEncoded($path)) {
            return $this->mediaUrl . '/' . ltrim($path, '/');
        }

        $this->migrateFileLive($path);
        $path = $this->strategy->encode($path);

        return $this->mediaUrl . '/' . ltrim($path, '/');
    }

    /** * {@inheritdoc} */
if (!isset($val['path'])) {
                        continue;
                    }
                    $val['path'] = $this->mediaService->normalize($val['path']);
                }
                unset($val);
            }

            $value = Zend_Json::encode($value);
        }

        if (\is_string($value) && \in_array($xType$mediaFields, true) && $this->mediaService->isEncoded($value)) {
            $value = $this->mediaService->normalize($value);
        }

        if (\is_array($value)) {
            throw new UnexpectedValueException(sprintf('Use field value type "%s" if arrays should be saved. Got value type "%s" instead', Field::VALUE_TYPE_JSON, $valueType));
        }

        return $value;
    }

    /** * Fetch all emotions with same category ID and * mark existing emotions with same devices and category */

    private function migrateFile($path, MediaServiceInterface $fromFilesystem, MediaServiceInterface $toFileSystem)
    {
        // only do migration if it's on the local filesystem since could take a long time         // to read and write all the files         if ($fromFilesystem->getAdapterType() === 'local') {
            if (!$fromFilesystem->isEncoded($path)) {
                ++$this->counter['migrated'];
                $fromFilesystem->migrateFile($path);
            }
        }

        // file already exists         if ($toFileSystem->has($path)) {
            ++$this->counter['skipped'];

            return;
        }

        
return $matches[2] . '/' . $matches[3];
        }

        return $path;
    }

    /** * {@inheritdoc} */
    public function encode($path)
    {
        if (!$path || $this->isEncoded($path)) {
            return $this->substringPath($path);
        }

        $path = $this->normalize($path);

        $path = ltrim($path, '/');
        $pathElements = explode('/', $path);
        $pathInfo = pathinfo($path);
        $md5hash = md5($path);

        if (empty($pathInfo['extension'])) {
            
Home | Imprint | This part of the site doesn't use cookies.