Welcome Guest, Not a member yet? Register   Sign In
Screencast tutorial series updates: Building a complete website using CodeIgniter 2 and ORM.
#1

[eluser]ShawnMcCool[/eluser]
I have begun a series of screencast tutorials designed to help people get adjusted to using ORM with CodeIgniter. The 3rd episode will probably be released middle of next week.

http://heybigname.com/2011/07/28/codeign...tallation/

http://heybigname.com/2011/08/03/codeign...ser-model/
#2

[eluser]JonoB[/eluser]
Nice intro.

I am very familiar with php.activerecord...and one of the first things I did when CI2 came out was hook it up. I've since gone back to native CI "ActiveRecord".

Question: I currently run CI validation in my models...would it be possible to hook the phpar validation into the CI validation class?

Slightly off-topic: the requirement to use Facebook to comment on your blog is a major turn off.

Even more off topic: I saw the post on using SwiftMailer on your blog. I use Swiftmailer on another non-CI project, but the native CI lib in CI projects. Whats the advantage of use Swiftmailer in CI?
#3

[eluser]ShawnMcCool[/eluser]
I don't think that there's a particularly good reason to hook the PHPAR validation into the CI validation class. I'm going to tackle validation in an upcoming video.

I realize that the Facebook comments are a turnoff, we're switching to a new solution shortly. It was an experiment that ended up to be not worth it.

Regarding SwiftMailer. I'm not huge on CI's email class. It's absolutely fine and can do quite a few things however I SwiftMailer is an established open-source project that is being actively developed upon. SwiftMailer supports ssl encryption and has extensive documentation. It supports multi-part messages and has a number of plugins such as throttler, logger, decorator, and antiflood. You can easily customize the transport as well.

Not only that. I'm not ONLY working with CodeIgniter. I also other PHP projects including one that is written in Kohana. By using SwiftMailer and easily being able to add it to my code I'm able to reuse functionality from one site to another despite the fact that it's written with a different framework.

Anyway, to each their own on the SwiftMailer library. As far as I see it, it just comes down to what you like to use.
#4

[eluser]JonoB[/eluser]
[quote author="ShawnMcCool" date="1312459870"]
Anyway, to each their own on the SwiftMailer library. As far as I see it, it just comes down to what you like to use.[/quote] Not disagreeing with you on Swiftmailer...it is a very good lib.
#5

[eluser]JonoB[/eluser]
Oh yeah, the one other thing that prevented me using phpar in CI - benchmarking. Using CI AR, we get nice benchmarks on each query run through the system, which is absolutely crucial during development (FYI, I use https://github.com/lonnieezell/codeigniter-forensics).

I realise that phpar uses PDO...so getting the query profile is not exactly straight forward. I managed to get pear logging up and running (http://www.phpactiverecord.org/boards/1/...sql-string), which logs the actual query, but thats pre-substitution, and therefore doesnt give profile performance. See https://github.com/greut/php-activerecor...-profiling, for another example workaround. Lastly, I guess we could use mysql slow query log...but that sucks compared to proper profiling. Something for the next screencast perhaps?
#6

[eluser]ShawnMcCool[/eluser]
Profiling is a really great idea for a screencast. Actually, I've been itching to put together something for this purpose for a while, now.
#7

[eluser]ShawnMcCool[/eluser]
I posted an update that adds query logging directly to the CodeIgniter log. In general I'm not a fan of the amount of control a developer has over what is logged, but this works fine. Look at the 2nd comment.

http://heybigname.com/2011/08/03/codeign...ser-model/
#8

[eluser]JonoB[/eluser]
[quote author="ShawnMcCool" date="1312544385"]I posted an update that adds query logging directly to the CodeIgniter log. In general I'm not a fan of the amount of control a developer has over what is logged, but this works fine. Look at the 2nd comment.

http://heybigname.com/2011/08/03/codeign...ser-model/[/quote]
Just to confirm - thats logging, not profiling, right?
#9

[eluser]ShawnMcCool[/eluser]
It's just a quick modification that logs both the query and the amount of time that the query took.
#10

[eluser]JonoB[/eluser]
[quote author="ShawnMcCool" date="1312550504"]It's just a quick modification that logs both the query and the amount of time that the query took.[/quote] OK cool...thats helpful. Thanks!




Theme © iAndrew 2016 - Forum software by © MyBB