@@ 67-77 (lines=11) @@ | ||
64 | * |
|
65 | * @return string |
|
66 | */ |
|
67 | public function getGzName(string $path):string |
|
68 | { |
|
69 | $fullPath = $this->getFullPath($path); |
|
70 | $extension = pathinfo($fullPath, PATHINFO_EXTENSION); |
|
71 | ||
72 | if ($extension == 'json') { |
|
73 | return $path.'.gz'; |
|
74 | } |
|
75 | ||
76 | return $path; |
|
77 | } |
|
78 | ||
79 | /** |
|
80 | * Get link name from gz. |
|
@@ 86-96 (lines=11) @@ | ||
83 | * |
|
84 | * @return string |
|
85 | */ |
|
86 | protected function getLink(string $path):string |
|
87 | { |
|
88 | $fullPath = $this->getFullPath($path); |
|
89 | $extension = pathinfo($fullPath, PATHINFO_EXTENSION); |
|
90 | ||
91 | if ($extension == 'gz') { |
|
92 | return substr($path, 0, -3); |
|
93 | } |
|
94 | ||
95 | return $path; |
|
96 | } |
|
97 | ||
98 | /** |
|
99 | * Decode from gz after read from disk. |