Hi,
I have experience coding PHP as well as many other languages. I am a user of OpenCart and was thinking about trying to contribute to the project.
Currently, the code is somewhat deprecated and does not use PHP Data Objects.
If I wanted to rewrite some of the base code using PDO can someone give me some ideas if this would be appreciated?
Also, what files need the most work and which files can remain untouched? Please email me with any suggestions.
Best,
Julian
juliansvinyl@gmail.com
I have experience coding PHP as well as many other languages. I am a user of OpenCart and was thinking about trying to contribute to the project.
Currently, the code is somewhat deprecated and does not use PHP Data Objects.
If I wanted to rewrite some of the base code using PDO can someone give me some ideas if this would be appreciated?
Also, what files need the most work and which files can remain untouched? Please email me with any suggestions.
Best,
Julian
juliansvinyl@gmail.com
Hi, CamaroSS - I can't help you directly, but if you weren't aware, there's an extension with a lot of comments that is trying to do the same thing. http://www.opencart.com/index.php?route ... on_id=3913. You may want to take a look at it for ideas.
Good luck!
Good luck!
My Opencart Extensions
My site for installed home products: Home - Windows - Water Heaters -
Furnaces - and more!
PDO is a more sizable rewrite.
But this may help as a starting point
http://www.sitepoint.com/migrate-from-t ... on-to-pdo/
also, the mysql extension may be deprecated but mysqli is the likely replacement we'll see in opencart
But this may help as a starting point
http://www.sitepoint.com/migrate-from-t ... on-to-pdo/
also, the mysql extension may be deprecated but mysqli is the likely replacement we'll see in opencart
Very nice!igorko82 wrote:PDO class for opencart https://github.com/webimperia/oc-pdo
Heavy OpenCart Customizations. Current project in progress: fleurworld.com
Interesting choice - The link you recommend suggests skipping mysqli and going straight to PDO. It's logic being that as mysql has been deprecated then maybe at sometime mysqli may be deprecated. So if you are doing the work to change then change straight to PDO. Kind of like upgrading 1.0 to 1.5 when 2.0 is already available.Qphoria wrote:PDO is a more sizable rewrite.
But this may help as a starting point
http://www.sitepoint.com/migrate-from-t ... on-to-pdo/
also, the mysql extension may be deprecated but mysqli is the likely replacement we'll see in opencart
(Well 2.1, if you remember the rule to "never upgrade to anything with a "0" on the end of it!!!.)
Tim
tim@pointreddesign.co.uk | http://www.pointreddesign.co.uk
I wouldn't worry too much. The reason mysql_* functions were deprecated in PHP 5.5 is because:
1) They can be difficult for novices to use safely and correctly (mainly because of a bunch of horrible old tutorials floating around the net), and
2) It's simpler to maintain one function set when they both do the same thing.
In OpenCart all you have to do is update your config files to start using MySQLi. A similar PDO driver could be made but what most developers are going to be looking for is prepared statements which would require a major rewrite of the model. With a job that big you really want to weigh all the pros/cons beyond "MySQLi might be deprecated some day". (For instance, PDO benchmarks tend to show it running around 10% slower than MySQLi.)
1) They can be difficult for novices to use safely and correctly (mainly because of a bunch of horrible old tutorials floating around the net), and
2) It's simpler to maintain one function set when they both do the same thing.
In OpenCart all you have to do is update your config files to start using MySQLi. A similar PDO driver could be made but what most developers are going to be looking for is prepared statements which would require a major rewrite of the model. With a job that big you really want to weigh all the pros/cons beyond "MySQLi might be deprecated some day". (For instance, PDO benchmarks tend to show it running around 10% slower than MySQLi.)
-Ryan
OK. Thanks. Like the OP I'd love to contribute to OpenCart as a coder, but I don't think at my current level of skill would add anything useful. (Probably the opposite).
tim@pointreddesign.co.uk | http://www.pointreddesign.co.uk
Cool beans. So everyone's happy. Now I need to unpick all my modifications into vQmods - in preparation for upgrades.
Thanks.
Thanks.
tim@pointreddesign.co.uk | http://www.pointreddesign.co.uk
http://net.tutsplus.com/tutorials/php/p ... d-you-use/timparnell wrote:Interesting choice - The link you recommend suggests skipping mysqli and going straight to PDO. It's logic being that as mysql has been deprecated then maybe at sometime mysqli may be deprecated. So if you are doing the work to change then change straight to PDO. Kind of like upgrading 1.0 to 1.5 when 2.0 is already available.Qphoria wrote:PDO is a more sizable rewrite.
But this may help as a starting point
http://www.sitepoint.com/migrate-from-t ... on-to-pdo/
also, the mysql extension may be deprecated but mysqli is the likely replacement we'll see in opencart
(Well 2.1, if you remember the rule to "never upgrade to anything with a "0" on the end of it!!!.)
Tim
Another point:
http://net.tutsplus.com/tutorials/php/p ... d-you-use/
PDO wins because it supports multiple databases... but we only care about one so there is really no major benefit
If myslqi will do the job then I'm happy.
I'm still learning so probably I don't appreciate all the factors involved.
I shall read the link and try to understand.
Tim
I'm still learning so probably I don't appreciate all the factors involved.
I shall read the link and try to understand.
Tim
tim@pointreddesign.co.uk | http://www.pointreddesign.co.uk
Who is online
Users browsing this forum: No registered users and 36 guests