Vous êtes connecté en tant que anonymous Se Deconnecter
Browse code

Application modulaire fonctionnelle !

Emmanuel ROY authored on 12/08/2019 15:10:25
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,63 +0,0 @@
1
-<?php
2
-
3
-/*
4
- * This file is part of the Symfony package.
5
- *
6
- * (c) Fabien Potencier <fabien@symfony.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
-namespace Symfony\Component\Translation\Dumper;
13
-
14
-use Symfony\Component\Translation\MessageCatalogue;
15
-
16
-/**
17
- * CsvFileDumper generates a csv formatted string representation of a message catalogue.
18
- *
19
- * @author Stealth35
20
- */
21
-class CsvFileDumper extends FileDumper
22
-{
23
-    private $delimiter = ';';
24
-    private $enclosure = '"';
25
-
26
-    /**
27
-     * {@inheritdoc}
28
-     */
29
-    public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = [])
30
-    {
31
-        $handle = fopen('php://memory', 'r+b');
32
-
33
-        foreach ($messages->all($domain) as $source => $target) {
34
-            fputcsv($handle, [$source, $target], $this->delimiter, $this->enclosure);
35
-        }
36
-
37
-        rewind($handle);
38
-        $output = stream_get_contents($handle);
39
-        fclose($handle);
40
-
41
-        return $output;
42
-    }
43
-
44
-    /**
45
-     * Sets the delimiter and escape character for CSV.
46
-     *
47
-     * @param string $delimiter Delimiter character
48
-     * @param string $enclosure Enclosure character
49
-     */
50
-    public function setCsvControl($delimiter = ';', $enclosure = '"')
51
-    {
52
-        $this->delimiter = $delimiter;
53
-        $this->enclosure = $enclosure;
54
-    }
55
-
56
-    /**
57
-     * {@inheritdoc}
58
-     */
59
-    protected function getExtension()
60
-    {
61
-        return 'csv';
62
-    }
63
-}
Browse code

initial commit

Emmanuel ROY authored on 09/08/2019 08:39:02
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,63 @@
1
+<?php
2
+
3
+/*
4
+ * This file is part of the Symfony package.
5
+ *
6
+ * (c) Fabien Potencier <fabien@symfony.com>
7
+ *
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
12
+namespace Symfony\Component\Translation\Dumper;
13
+
14
+use Symfony\Component\Translation\MessageCatalogue;
15
+
16
+/**
17
+ * CsvFileDumper generates a csv formatted string representation of a message catalogue.
18
+ *
19
+ * @author Stealth35
20
+ */
21
+class CsvFileDumper extends FileDumper
22
+{
23
+    private $delimiter = ';';
24
+    private $enclosure = '"';
25
+
26
+    /**
27
+     * {@inheritdoc}
28
+     */
29
+    public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = [])
30
+    {
31
+        $handle = fopen('php://memory', 'r+b');
32
+
33
+        foreach ($messages->all($domain) as $source => $target) {
34
+            fputcsv($handle, [$source, $target], $this->delimiter, $this->enclosure);
35
+        }
36
+
37
+        rewind($handle);
38
+        $output = stream_get_contents($handle);
39
+        fclose($handle);
40
+
41
+        return $output;
42
+    }
43
+
44
+    /**
45
+     * Sets the delimiter and escape character for CSV.
46
+     *
47
+     * @param string $delimiter Delimiter character
48
+     * @param string $enclosure Enclosure character
49
+     */
50
+    public function setCsvControl($delimiter = ';', $enclosure = '"')
51
+    {
52
+        $this->delimiter = $delimiter;
53
+        $this->enclosure = $enclosure;
54
+    }
55
+
56
+    /**
57
+     * {@inheritdoc}
58
+     */
59
+    protected function getExtension()
60
+    {
61
+        return 'csv';
62
+    }
63
+}