DevUtils-app
DevUtils-app copied to clipboard
[Feature] Add PHP unserialize/serialize
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 👍
Hi there! Thanks for the suggestion and the details, this is noted 😄
Thanks a lot 🎉 👏