Post by CamaroSS » Tue Jul 09, 2013 2:43 am

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

New member

Posts

Joined
Tue Jun 25, 2013 11:53 pm

Post by CamaroSS » Wed Jul 10, 2013 11:45 pm

hello is there anyone on here?

New member

Posts

Joined
Tue Jun 25, 2013 11:53 pm

Post by blindjoedeath » Tue Aug 27, 2013 5:01 am

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!

My Opencart Extensions
My site for installed home products: Home - Windows - Water Heaters -
Furnaces - and more!


Newbie

Posts

Joined
Fri Jul 19, 2013 2:17 am

Post by Qphoria » Wed Aug 28, 2013 5:08 am

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

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by igorko82 » Wed Oct 23, 2013 5:40 pm


Newbie

Posts

Joined
Wed Oct 23, 2013 5:39 pm

Post by dfumagalli » Fri Oct 25, 2013 4:42 pm

igorko82 wrote:PDO class for opencart https://github.com/webimperia/oc-pdo
Very nice!

Heavy OpenCart Customizations. Current project in progress: fleurworld.com


Active Member

Posts

Joined
Tue Aug 20, 2013 3:34 am

Post by timparnell » Thu Nov 07, 2013 6:26 pm

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
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.
(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


User avatar
New member

Posts

Joined
Wed Feb 01, 2012 11:03 pm
Location - Norwich, Norfolk, UK

Post by rph » Fri Nov 08, 2013 1:18 am

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.)

-Ryan


rph
Expert Member

Posts

Joined
Fri Jan 08, 2010 5:05 am
Location - Lincoln, Nebraska

Post by timparnell » Fri Nov 08, 2013 1:36 am

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


User avatar
New member

Posts

Joined
Wed Feb 01, 2012 11:03 pm
Location - Norwich, Norfolk, UK

Post by Qphoria » Fri Nov 08, 2013 1:45 am

Seems 2.0 will have pdo and mysqli choices in the installer already

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by rph » Fri Nov 08, 2013 1:55 am

I thought so too but for whatever reason the database directory has disappeared completely from the master repo.

-Ryan


rph
Expert Member

Posts

Joined
Fri Jan 08, 2010 5:05 am
Location - Lincoln, Nebraska

Post by timparnell » Fri Nov 08, 2013 2:06 am

Cool beans. So everyone's happy. Now I need to unpick all my modifications into vQmods - in preparation for upgrades.
Thanks.

tim@pointreddesign.co.uk | http://www.pointreddesign.co.uk


User avatar
New member

Posts

Joined
Wed Feb 01, 2012 11:03 pm
Location - Norwich, Norfolk, UK

Post by Qphoria » Mon Nov 11, 2013 12:33 pm

timparnell wrote:
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
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.
(Well 2.1, if you remember the rule to "never upgrade to anything with a "0" on the end of it!!!.)
Tim
http://net.tutsplus.com/tutorials/php/p ... d-you-use/

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

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by rph » Mon Nov 11, 2013 4:45 pm

You'd really have to be drinking the Kool-Aid to find a 6.5% hit on prepared statements acceptable.

-Ryan


rph
Expert Member

Posts

Joined
Fri Jan 08, 2010 5:05 am
Location - Lincoln, Nebraska

Post by timparnell » Mon Nov 11, 2013 7:26 pm

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

tim@pointreddesign.co.uk | http://www.pointreddesign.co.uk


User avatar
New member

Posts

Joined
Wed Feb 01, 2012 11:03 pm
Location - Norwich, Norfolk, UK
Who is online

Users browsing this forum: No registered users and 36 guests