@@ 75-85 (lines=11) @@ | ||
72 | * |
|
73 | * @return string |
|
74 | */ |
|
75 | public function getGzName(string $path):string |
|
76 | { |
|
77 | $fullPath = $this->getFullPath($path); |
|
78 | $extension = pathinfo($fullPath, PATHINFO_EXTENSION); |
|
79 | ||
80 | if ($extension == 'json') { |
|
81 | return $path.'.gz'; |
|
82 | } |
|
83 | ||
84 | return $path; |
|
85 | } |
|
86 | ||
87 | /** |
|
88 | * Get link name from gz |
|
@@ 93-103 (lines=11) @@ | ||
90 | * @param string $path |
|
91 | * @return string |
|
92 | */ |
|
93 | protected function getLink(string $path):string |
|
94 | { |
|
95 | $fullPath = $this->getFullPath($path); |
|
96 | $extension = pathinfo($fullPath, PATHINFO_EXTENSION); |
|
97 | ||
98 | if ($extension == 'gz') { |
|
99 | return substr($path, 0, -3); |
|
100 | } |
|
101 | ||
102 | return $path; |
|
103 | } |
|
104 | ||
105 | /** |
|
106 | * Decode from gz after read from disk. |