récupération de l'ensemble des constantes de définition des extensions de fichier image autorisées au
téléchargement
@return array                    : tableau des extensions de fichier image autorisées
@throws ReflectionException
190262
private function getImageExtensionConstant()
    {
        $retour = [];
        if (empty($this->const_imagExt)) {
            $constants = $this->getConstants();
            foreach ($constants as $key => $constant) {
                $pos = strpos($key, 'EXT_IMAG');
                if ($pos !== false) {
                    $retour[$key] = $constant;
                }
            }
            $this->const_imagExt = $retour;
        } else {
            $retour = $this->const_imagExt;
        }
        return $retour;
    }
146018
public function getDeletedExtensions()
    {
        $oModuleValidatorFactory = $this->getModuleValidatorFactory();
        $oModuleMetadataValidator = $oModuleValidatorFactory->getModuleMetadataValidator();
        $aModulesIds = $this->getModuleIds();
        $oModule = $this->getModule();
        $aDeletedExt = [];

        foreach ($aModulesIds as $sModuleId) {
            $oModule->setModuleData(['id' => $sModuleId]);
            if (!$oModuleMetadataValidator->validate($oModule)) {
                $aDeletedExt[$sModuleId]['files'] = [$sModuleId . '/metadata.php'];
            } else {
                $aInvalidExtensions = $this->_getInvalidExtensions($sModuleId);
                if ($aInvalidExtensions) {
                    $aDeletedExt[$sModuleId]['extensions'] = $aInvalidExtensions;
                }
            }
        }

        return $aDeletedExt;
    }
828165
public static function listAll()
    {
        $structure = General::listStructure(TOOLKIT . '/fields', '/field.[a-z0-9_-]+.php/i', false, 'asc', TOOLKIT . '/fields');
        $extensions = Symphony::ExtensionManager()->listInstalledHandles();
        $types = array();

        if (is_array($extensions) && !empty($extensions)) {
            foreach ($extensions as $handle) {
                $path = EXTENSIONS . '/' . $handle . '/fields';
                if (is_dir($path)) {
                    $tmp = General::listStructure($path, '/field.[a-z0-9_-]+.php/i', false, 'asc', $path);

                    if (is_array($tmp['filelist']) && !empty($tmp['filelist'])) {
                        $structure['filelist'] = array_merge($structure['filelist'], $tmp['filelist']);
                    }
                }
            }

            $structure['filelist'] = General::array_remove_duplicates($structure['filelist']);
        }

        foreach ($structure['filelist'] as $filename) {
            $types[] = self::__getHandleFromFilename($filename);
        }

        return $types;
    }
1049359
public function getInterfaces()
    {
        $extendedInterfaces = [];
        $interfaces = parent::getInterfaces();
        foreach ($interfaces as $interface) {
            $extendedInterfaces[] = new ClassReflection($interface->getName());
        }
        return $extendedInterfaces;
    }
1141560
public function getConstants()
    {
        $constants = parent::getConstants();
        $returnConstants = array();
        foreach ($constants as $key => $value) {
            $returnConstants[$key] = new ReflectionConstant($this->getName(), $key);
        }

        return $returnConstants;
    }
304232
public function toNative()
    {
        if ($this->valueEquals($this->getAttribute()->getNullValue())) {
            return [];
        }

        $images = [];
        foreach ($this->getValue() as $image) {
            $images[] = $image->toNative();
        }

        return $images;
    }
1364892
protected function get_meta_data() {
        //gather meta data
        if (empty($this->imagestring)) {
            $info = getimagesize($this->filename);
            switch ($info['mime']) {
                case 'image/gif':
                    $this->image = imagecreatefromgif($this->filename);
                    break;
                case 'image/jpeg':
                    $this->image = imagecreatefromjpeg($this->filename);
                    break;
                case 'image/png':
                    $this->image = imagecreatefrompng($this->filename);
                    break;
                default:
                    throw new Exception('Invalid image: ' . $this->filename);
                    break;
            }
        } elseif (function_exists('getimagesizefromstring')) {
            $info = getimagesizefromstring($this->imagestring);
        } else {
            throw new Exception('PHP 5.4 is required to use method getimagesizefromstring');
        }
        $this->original_info = array(
            'width' => $info[0],
            'height' => $info[1],
            'orientation' => $this->get_orientation(),
            'exif' => function_exists('exif_read_data') && $info['mime'] === 'image/jpeg' && $this->imagestring === null ? $this->exif = @exif_read_data($this->filename) : null,
            'format' => preg_replace('/^image\//', '', $info['mime']),
            'mime' => $info['mime']
        );
        $this->width = $info[0];
        $this->height = $info[1];
        imagesavealpha($this->image, true);
        imagealphablending($this->image, true);
        return $this;
    }
600531
public static function getConstants() : array
    {
        if (self::$constCacheArray == null) {
            self::$constCacheArray = [];
        }
        $calledClass = get_called_class();
        if (!array_key_exists($calledClass, self::$constCacheArray)) {
            $reflect = new ReflectionClass($calledClass);
            self::$constCacheArray[$calledClass] = $reflect->getConstants();
        }
        return self::$constCacheArray[$calledClass];
    }
828241
public static function toList()
    {
        $class = static::class;
        if (!array_key_exists($class, self::$cache)) {
            $reflection = new \ReflectionClass($class);
            self::$cache[$class] = $reflection->getConstants();
        }

        return self::$cache[$class];
    }
1084098
private function getImageFiles()
    {
        if ($this->imageFiles === null) {
            // Get a list of images.
            $this->imageFiles = $this->filesystem
                ->find()
                ->in('files://')
                ->name('/\.jpe?g$/')
                ->name('*.png')
                ->toArray()
            ;
        }

        return $this->imageFiles;
    }
1085002
public function getFrom()
    {
        $result = [];
        $params = [];

        $refCount = $this->query->aliasRefCount;

        foreach ($this->query->tablesAliasList as $alias) {
            if (!ArrayHelper::getValue($refCount, $alias)) {
                continue;
            }

            try {
                /** @var $from BaseJoin */
                $from = ArrayHelper::getValue(
                    $this->query->tableJoinsMap,
                    $alias,
                    ArrayHelper::STRICT
                );

                list($fromSql, $fromParams) = $this->compile($from);
                array_push($result, $fromSql);

                $params = array_merge($params, $fromParams);
            } catch (KeyError $e) {
                continue;
            }
        }

        return [$result, $params];
    }
260037
public function getExtensionsClassesNames()
    {
        return array_replace([
            Extensions\VinCodeValidatorExtension::class,
            Extensions\GrzCodeValidatorExtension::class,
            Extensions\StsCodeValidatorExtension::class,
            Extensions\PtsCodeValidatorExtension::class,
            Extensions\BodyCodeValidatorExtension::class,
            Extensions\ChassisCodeValidatorExtension::class,
            Extensions\DriverLicenseNumberValidatorExtension::class,
        ], $this->getConfigExtensionsClassesNames());
    }
947586
private static function table()
    {
        if (!isset(self::$tableMap[static::class])) {
            if (isset(static::$table)) {
                self::$tableMap[static::class] = static::$table;
            } else {
                self::$tableMap[static::class] = strtolower((new \ReflectionClass(static::class))->getShortName());
            }
        }
        return self::$tableMap[static::class];
    }
1212432
protected function getAcceptFileTypes()
    {
        $extensions = $this->getValidator()->getAllowedExtensions();
        if (!$extensions) {
            return [];
        }

        $accept = [];
        $mimeTypes = HTTP::config()->uninherited('MimeTypes');
        foreach ($extensions as $extension) {
            $accept[] = ".{$extension}";
            // Check for corresponding mime type
            if (isset($mimeTypes[$extension])) {
                $accept[] = $mimeTypes[$extension];
            }
        }

        return array_unique($accept);
    }
260033
private function getConstants()
    {
        if (empty($this->constants)) {
            try {
                $reflection      = new \ReflectionClass($this->getClassName());
                $this->constants = $reflection->getConstants();
            } catch (\ReflectionException $e) {
                $this->constants = [];
            }
        }

        return $this->constants;
    }
1113000
private static function constants(): array
    {
        $class = get_called_class();

        if (isset(self::$constants[$class])) {
            return self::$constants[$class];
        }

        $reflection = new \ReflectionClass($class);

        return self::$constants[$class] = $reflection->getConstants();
    }
367736
protected function resolveExtends()
    {
        $extend = [];
        foreach ($this->_targets as $name => $target) {
            if (empty($target['extend'])) {
                continue;
            }
            $parent = $target['extend'];
            if (empty($this->_targets[$parent])) {
                throw new RuntimeException("Invalid extend in '$name'. There is no '$parent' target defined.");
            }
            $extend[] = $name;
        }

        $expander = function ($target) use (&$expander, $extend) {
            $config = $this->_targets[$target];
            $parentConfig = false;

            // Recurse through parents to collect all config.
            if (in_array($target, $extend)) {
                $parentConfig = $expander($config['extend']);
            }
            if (!$parentConfig) {
                return $config;
            }
            $config['files'] = array_merge($parentConfig['files'], $config['files']);
            $config['filters'] = array_merge($parentConfig['filters'], $config['filters']);
            $config['theme'] = $parentConfig['theme'] || $config['theme'];
            return $config;
        };

        foreach ($extend as $target) {
            $this->_targets[$target] = $expander($target);
        }
    }