DevUtils-app icon indicating copy to clipboard operation
DevUtils-app copied to clipboard

[Feature] Add PHP unserialize/serialize

Open ajaegers opened this issue 4 years ago • 3 comments

It's such common as a PHP developer to convert or edit (a nightmare) serialized objects stored in database or everywhere else. https://www.php.net/manual/en/function.unserialize.php

On MacOs, there's php installed by default, so would be pretty easy to do.

Unserialize

tmp_serialized.txt content:

a:6:{s:7:"task_id";s:19:"0161052925790982000";s:8:"time_sur";s:10:"1610406000";s:16:"version_notified";s:7:"1.7.6.8";s:12:"cf_sitetitle";s:8:"My title";s:13:"cache_preview";i:120089;s:9:"cf_passwd";N;}

Unserialize it in command line: php -r "var_export(unserialize(file_get_contents('tmp_serialized.txt')));"

Result:

array (
  'task_id' => '0161052925790982000',
  'time_sur' => '1610406000',
  'version_notified' => '1.7.6.8',
  'cf_sitetitle' => 'My title',
  'cache_preview' => 120089,
  'cf_passwd' => NULL,
)

Serialize

The same thing to php serializing something: php -r "echo serialize(file_get_contents('tmp_unserialized.txt'));"

Ps: I'm not used to develop MacOS application, otherwise, I would do a PR

Also, thanks for your app 👍

ajaegers avatar Jan 14 '21 11:01 ajaegers

Hi there! Thanks for the suggestion and the details, this is noted 😄

trungdq88 avatar Jan 14 '21 13:01 trungdq88

Now available in version 1.14 🥳

CleanShot 2022-04-11 at 20 18 13@2x CleanShot 2022-04-11 at 20 18 07@2x

trungdq88 avatar Apr 11 '22 13:04 trungdq88

Thanks a lot 🎉 👏

ajaegers avatar May 08 '22 20:05 ajaegers