{"id":19871603,"url":"https://github.com/millsoft/shit2pdo","last_synced_at":"2026-05-12T18:35:05.918Z","repository":{"id":82654488,"uuid":"138866681","full_name":"millsoft/shit2pdo","owner":"millsoft","description":"Converts shitty php SQL to PDO - warning! this is only for one of my internal projects, not intended for everyone.","archived":false,"fork":false,"pushed_at":"2018-06-28T13:34:18.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-11T16:36:22.363Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/millsoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-27T10:29:21.000Z","updated_at":"2019-10-18T16:46:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"f7e584f7-6ac2-4889-90e5-f1eb6b8627e7","html_url":"https://github.com/millsoft/shit2pdo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/millsoft%2Fshit2pdo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/millsoft%2Fshit2pdo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/millsoft%2Fshit2pdo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/millsoft%2Fshit2pdo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/millsoft","download_url":"https://codeload.github.com/millsoft/shit2pdo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241295659,"owners_count":19939871,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T16:12:56.695Z","updated_at":"2026-05-12T18:35:00.869Z","avatar_url":"https://github.com/millsoft.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# shit2pdo\n\n## WTF?\n\nA script for converting shitty (old) mysql queries to PDO. This is just a personal project for one of our projects. Cloning is not recommended as it won't solve any of your problems. But go ahead and check the code if you like.\n\n## Why?\nOne of my current tasks is to convert old php-mysql code into the modern and secure PDO. The project consists of hundreds of php files with 500-10000 lines of code each. Doing this by hand is a reason to hang myself on a tree with easy access to bears. Because I want to live a long and fulfilled life I created this helper tool.\n\n## Requirments\n- Autohotkey\n- PHP 7\n- Shitty PHP-MySQL code.\n\n## How does it work?\nIf you press a hotkey on your keyboard, it will be copied into the clipboard. How? I use autohotkey for this task. Then the clipboard is saved as a text file. Then a php script (`go.php`) is called which precesses the clipboard date from the text file. Then a new text file is written back which then autohotkey reads and pastes into the editor by pressing ctrl+v.\n\nFor parsing I use PHP-Parser by nikic.\n\n### Why not automate this completly?\nI could write a script that converts the mysql code automatically but some queries are still very complex, with this semi automatic mode I have still the control over the output and can adjust it accordinaly. Short: I don't trust this shit. I am scared of destroying the code.. so thats why just semi automatic.\n\n## Example\n\nSo here you go, the script converts \n\nthis:\n\n```\n$sql = 'UPDATE events SET mpc_provided_photographer='.(int)$_POST['mpc_provided_photographer'].', id_users__changedBy='.getParameter('userid').' WHERE id='.$GET['id'];\ntoDatabase($sql);\n```\n\ninto this:\n\n```\n$sql = \"UPDATE events SET mpc_provided_photographer=:mpc_provided_photographer, id_users__changedBy=:userid WHERE id=:id\";\n$db-\u003etoDatabase($sql, [\n'mpc_provided_photographer' =\u003e $_POST[\"mpc_provided_photographer\"],\n'userid' =\u003e getParameter('userid'),\n'id' =\u003e $GET[\"id\"]\n])\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmillsoft%2Fshit2pdo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmillsoft%2Fshit2pdo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmillsoft%2Fshit2pdo/lists"}