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,74 +0,0 @@
1
-<?php
2
-
3
-namespace Illuminate\View\Compilers;
4
-
5
-use InvalidArgumentException;
6
-use Illuminate\Filesystem\Filesystem;
7
-
8
-abstract class Compiler
9
-{
10
-    /**
11
-     * The Filesystem instance.
12
-     *
13
-     * @var \Illuminate\Filesystem\Filesystem
14
-     */
15
-    protected $files;
16
-
17
-    /**
18
-     * Get the cache path for the compiled views.
19
-     *
20
-     * @var string
21
-     */
22
-    protected $cachePath;
23
-
24
-    /**
25
-     * Create a new compiler instance.
26
-     *
27
-     * @param  \Illuminate\Filesystem\Filesystem  $files
28
-     * @param  string  $cachePath
29
-     * @return void
30
-     *
31
-     * @throws \InvalidArgumentException
32
-     */
33
-    public function __construct(Filesystem $files, $cachePath)
34
-    {
35
-        if (! $cachePath) {
36
-            throw new InvalidArgumentException('Please provide a valid cache path.');
37
-        }
38
-
39
-        $this->files = $files;
40
-        $this->cachePath = $cachePath;
41
-    }
42
-
43
-    /**
44
-     * Get the path to the compiled version of a view.
45
-     *
46
-     * @param  string  $path
47
-     * @return string
48
-     */
49
-    public function getCompiledPath($path)
50
-    {
51
-        return $this->cachePath.'/'.sha1($path).'.php';
52
-    }
53
-
54
-    /**
55
-     * Determine if the view at the given path is expired.
56
-     *
57
-     * @param  string  $path
58
-     * @return bool
59
-     */
60
-    public function isExpired($path)
61
-    {
62
-        $compiled = $this->getCompiledPath($path);
63
-
64
-        // If the compiled file doesn't exist we will indicate that the view is expired
65
-        // so that it can be re-compiled. Else, we will verify the last modification
66
-        // of the views is less than the modification times of the compiled views.
67
-        if (! $this->files->exists($compiled)) {
68
-            return true;
69
-        }
70
-
71
-        return $this->files->lastModified($path) >=
72
-               $this->files->lastModified($compiled);
73
-    }
74
-}
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,74 @@
1
+<?php
2
+
3
+namespace Illuminate\View\Compilers;
4
+
5
+use InvalidArgumentException;
6
+use Illuminate\Filesystem\Filesystem;
7
+
8
+abstract class Compiler
9
+{
10
+    /**
11
+     * The Filesystem instance.
12
+     *
13
+     * @var \Illuminate\Filesystem\Filesystem
14
+     */
15
+    protected $files;
16
+
17
+    /**
18
+     * Get the cache path for the compiled views.
19
+     *
20
+     * @var string
21
+     */
22
+    protected $cachePath;
23
+
24
+    /**
25
+     * Create a new compiler instance.
26
+     *
27
+     * @param  \Illuminate\Filesystem\Filesystem  $files
28
+     * @param  string  $cachePath
29
+     * @return void
30
+     *
31
+     * @throws \InvalidArgumentException
32
+     */
33
+    public function __construct(Filesystem $files, $cachePath)
34
+    {
35
+        if (! $cachePath) {
36
+            throw new InvalidArgumentException('Please provide a valid cache path.');
37
+        }
38
+
39
+        $this->files = $files;
40
+        $this->cachePath = $cachePath;
41
+    }
42
+
43
+    /**
44
+     * Get the path to the compiled version of a view.
45
+     *
46
+     * @param  string  $path
47
+     * @return string
48
+     */
49
+    public function getCompiledPath($path)
50
+    {
51
+        return $this->cachePath.'/'.sha1($path).'.php';
52
+    }
53
+
54
+    /**
55
+     * Determine if the view at the given path is expired.
56
+     *
57
+     * @param  string  $path
58
+     * @return bool
59
+     */
60
+    public function isExpired($path)
61
+    {
62
+        $compiled = $this->getCompiledPath($path);
63
+
64
+        // If the compiled file doesn't exist we will indicate that the view is expired
65
+        // so that it can be re-compiled. Else, we will verify the last modification
66
+        // of the views is less than the modification times of the compiled views.
67
+        if (! $this->files->exists($compiled)) {
68
+            return true;
69
+        }
70
+
71
+        return $this->files->lastModified($path) >=
72
+               $this->files->lastModified($compiled);
73
+    }
74
+}