File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -101,4 +101,17 @@ public function getKeys(): array {
101101
102102 return $ keys ;
103103 }
104+
105+ /**
106+ * Get original key.
107+ *
108+ * @param string $key
109+ *
110+ * @return string
111+ */
112+ public function getKey (string $ key ): string {
113+ $ data = $ this ->runCommand ('get ' .$ key );
114+
115+ return $ data [1 ];
116+ }
104117}
Original file line number Diff line number Diff line change @@ -191,7 +191,7 @@ private function viewKey($memcached): string {
191191 Http::redirect (['db ' ]);
192192 }
193193
194- $ value = $ memcached ->get ($ key );
194+ $ value = $ memcached ->getKey ($ key );
195195
196196 [$ value , $ encode_fn , $ is_formatted ] = Value::format ($ value );
197197
@@ -243,11 +243,13 @@ private function import($memcached): void {
243243 private function form ($ memcached ): string {
244244 $ key = Http::get ('key ' );
245245 $ expire = Http::get ('ttl ' , 'int ' );
246+ $ expire = $ expire === -1 ? 0 : $ expire ;
247+
246248 $ encoder = Http::get ('encoder ' , 'string ' , 'none ' );
247249 $ value = Http::post ('value ' );
248250
249251 if (isset ($ _GET ['key ' ]) && $ memcached ->get ($ key )) {
250- $ value = $ memcached ->get ($ key );
252+ $ value = $ memcached ->getKey ($ key );
251253 }
252254
253255 if (isset ($ _POST ['submit ' ])) {
You can’t perform that action at this time.
0 commit comments