$64 GRAYBYTE WORDPRESS FILE MANAGER $71

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.217.254 | ADMIN IP 216.73.216.180
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : mail

/opt/alt/php54/usr/share/pear/Symfony/Component/Translation/Dumper/

HOME
Current File : /opt/alt/php54/usr/share/pear/Symfony/Component/Translation/Dumper//FileDumper.php
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <[email protected]>
 *
 * 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 <[email protected]>
 */
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();
}


Current_dir [ NOT WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
3 Mar 2024 10.54 PM
root / root
0755
CsvFileDumper.php
1.45 KB
18 Dec 2019 11.22 AM
root / root
0644
DumperInterface.php
0.791 KB
18 Dec 2019 11.22 AM
root / root
0644
FileDumper.php
1.839 KB
18 Dec 2019 11.22 AM
root / root
0644
IcuResFileDumper.php
3.642 KB
18 Dec 2019 11.22 AM
root / root
0644
IniFileDumper.php
0.961 KB
18 Dec 2019 11.22 AM
root / root
0644
JsonFileDumper.php
0.872 KB
18 Dec 2019 11.22 AM
root / root
0644
MoFileDumper.php
2.313 KB
18 Dec 2019 11.22 AM
root / root
0644
PhpFileDumper.php
0.824 KB
18 Dec 2019 11.22 AM
root / root
0644
PoFileDumper.php
1.502 KB
18 Dec 2019 11.22 AM
root / root
0644
QtFileDumper.php
1.319 KB
18 Dec 2019 11.22 AM
root / root
0644
XliffFileDumper.php
1.93 KB
18 Dec 2019 11.22 AM
root / root
0644
YamlFileDumper.php
0.803 KB
18 Dec 2019 11.22 AM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF