url-shortener-php icon indicating copy to clipboard operation
url-shortener-php copied to clipboard

Refactor for PDO & Modularity

Open runninguru opened this issue 7 years ago • 3 comments

PDO would allow this to be database-agnostic, and while it's refactored to support PDO, it should be implemented in a more modular way.

  • create a Connection class and store each database connection there. This will make url-shortener more portable, because other projects are more likely to have a modular approach to creating & managing database connections.

  • place the SQL statements in separate methods within the UrlShortener class. This, combined with the use of bindParam(), is a best-practice.

I've cloned the project and partially finished these changes. If you want, we could create a branch and I could push my current changes to it so we can work on it before pushing it to the master branch.

runninguru avatar Nov 25 '17 05:11 runninguru

I've cloned the project and partially finished these changes. If you want, we could create a branch and I could push my current changes to it so we can work on it before pushing it to the master branch.

@runninguru Great! Let me know when you are done with the changes.

amarlearning avatar Nov 27 '17 14:11 amarlearning

I'm finished with the changes. If you create a branch, I can make a pull request to that branch so you can review what i've done before you merge it with the master branch.

runninguru avatar Nov 27 '17 21:11 runninguru

@runninguru you can push your changes in the develop branch for the review.

amarlearning avatar Nov 28 '17 19:11 amarlearning