File tree Expand file tree Collapse file tree 2 files changed +17
-15
lines changed Expand file tree Collapse file tree 2 files changed +17
-15
lines changed Original file line number Diff line number Diff line change 77use Hyde \Hyde ;
88use Hyde \Foundation \HydeKernel ;
99use Hyde \Foundation \PharSupport ;
10+ use Hyde \Support \Filesystem \MediaFile ;
1011use Illuminate \Support \Collection ;
1112
1213use function collect ;
@@ -96,11 +97,7 @@ public function pathToRelative(string $path): string
9697 */
9798 public function mediaPath (string $ path = '' ): string
9899 {
99- if (empty ($ path )) {
100- return Hyde::path (Hyde::getMediaDirectory ());
101- }
102-
103- return Hyde::path (path_join (Hyde::getMediaDirectory (), unslash ($ path )));
100+ return MediaFile::sourcePath ($ path );
104101 }
105102
106103 /**
@@ -120,13 +117,7 @@ public function sitePath(string $path = ''): string
120117 */
121118 public function siteMediaPath (string $ path = '' ): string
122119 {
123- if (empty ($ path )) {
124- return Hyde::sitePath (Hyde::getMediaOutputDirectory ());
125- }
126-
127- $ path = unslash ($ path );
128-
129- return Hyde::sitePath (Hyde::getMediaOutputDirectory ()."/ $ path " );
120+ return MediaFile::outputPath ($ path );
130121 }
131122
132123 /**
Original file line number Diff line number Diff line change 66
77use Hyde \Hyde ;
88use Hyde \Facades \Config ;
9- use Hyde \Foundation \HydeKernel ;
109use Hyde \Framework \Exceptions \FileNotFoundException ;
1110use Illuminate \Support \Str ;
1211
12+ use function Hyde \unslash ;
13+ use function Hyde \path_join ;
1314use function extension_loaded ;
1415use function file_exists ;
1516use function array_merge ;
@@ -47,15 +48,25 @@ public static function files(): array
4748 */
4849 public static function sourcePath (string $ path = '' ): string
4950 {
50- return HydeKernel::getInstance ()->mediaPath ($ path );
51+ if (empty ($ path )) {
52+ return Hyde::path (Hyde::getMediaDirectory ());
53+ }
54+
55+ return Hyde::path (path_join (Hyde::getMediaDirectory (), unslash ($ path )));
5156 }
5257
5358 /**
5459 * Get the absolute path to the compiled site's media directory, or a file within it.
5560 */
5661 public static function outputPath (string $ path = '' ): string
5762 {
58- return HydeKernel::getInstance ()->siteMediaPath ($ path );
63+ if (empty ($ path )) {
64+ return Hyde::sitePath (Hyde::getMediaOutputDirectory ());
65+ }
66+
67+ $ path = unslash ($ path );
68+
69+ return Hyde::sitePath (Hyde::getMediaOutputDirectory ()."/ $ path " );
5970 }
6071
6172 public function getIdentifier (): string
You can’t perform that action at this time.
0 commit comments