Welcome Guest, Not a member yet? Register   Sign In
How CodeIgniter Works?
#1

[eluser]FutureKing[/eluser]
I found a slideshow about how joomla works.
http://www.slideshare.net/teamphp/how-joomla-works

You can see the flowchart type diagram there.

Can somebody post similar diagram about CodeIgniter. So that we can understand how CI works?
#2

[eluser]pistolPete[/eluser]
Have a look at the user guide:

http://ellislab.com/codeigniter/user-gui...pflow.html
#3

[eluser]FutureKing[/eluser]
Thanks for link. But it is not in details. The above link shows a diagram which explains the request sent from index.php goes to router then security and then app controller. But it does not shows the files,classes and functions associated with it.
#4

[eluser]Dam1an[/eluser]
You could always just follow the application flow through the code itself, starting off with index.php, codeigniter.php and so on
It's well commented, so you should be able to understand what happens and in what order
#5

[eluser]Nick Husher[/eluser]
You can dig around in the codeigniter source files. There isn't a lot there and things are named and documented quite well. Why do you need to know?
#6

[eluser]BrianDHall[/eluser]
Without knowing exactly what you are after, its hard to give good advice. If you want down-and-dirty "exactly how it all works" details I reccommend you use a debugger and put a break on the index.php file, then walk through the code. I've done this just for giggles, and its rather interesting.

...however, if you just want to learn about CI or evaluate it for use in a project, this is entirely unnecessary. I didn't do it until after I was pretty much done with a commercial project, and I can't say I use anything I learned from debugging a line at a time - I don't want to build a framework or modify it, I just want to use it.

If you just want to evaluate it and learn it just give it a quick download, pull up a localhost server with WampServer or XAMP and run the welcome app it comes with by default.

It's nothing like joomla at all - I had a system built partially inside joomla when I got my present job and it had been worked on for months. I threw it all away and rebuilt it in a week in pure php, then rewrote it in about 3 days inside CodeIgniter and haven't been happier.
#7

[eluser]FutureKing[/eluser]
[quote author="BrianDHall" date="1252109018"]Without knowing exactly what you are after, its hard to give good advice. If you want down-and-dirty "exactly how it all works" details I reccommend you use a debugger and put a break on the index.php file, then walk through the code. I've done this just for giggles, and its rather interesting.
[/quote]

This is what I want.I need some more info about debugger(Where to download and how to use?).

One more thing:

I have seen that some people show the test results of PHP and .NET performance. How they calculate the performance results? Which software they use?

If I want to know how much time a function took to run then what software should I use?
#8

[eluser]BrianDHall[/eluser]
First, doing performance measuring properly is, simply..."extremely hard". Its far easier to do it wrong than do it right. But basically you need to get something like microtime() in PHP before you run the test, run the test 100-10000+ times to get a large enough sampling to determine the actual time it took to run the tests, and do so in a way that you are sure something isn't getting cached or short-circuited so that every call of the function past the first one was happening far faster than it would "in the real world" (where a function isn't artificially called so many times).

Not to be overly opinionated, but unless you are having a site that will be drawing hundreds of thousands of users in a very short period of time, performance doesn't really matter. If you are getting that much traffic you should be getting a lot of money - and if you are, why don't you just deploy into a cloud environment or with a managed cluster? It doesn't cost THAT much more than other methods of hosting (the price is tiny compared to what you should be making if you are getting hundreds of thousands of viewers a day), and you don't waste your valuable time worrying about execution times when you could be building valuable applications.

If this is a purely intellectual/academic project...well then go right ahead Smile But proper execution testing is a science unto itself, and I wouldn't even know where to put you to get started, other than to articles that warn against premature optimization.

Now, on to debugging. I have one that I use and know works, so I'll just reccommend that. It's called PhpED, from NuSphere. There's a free trial you can download. To get debugging working in CodeIgniter you'll want to check out ZuggSoft's tutorial on setting up debugging for CI in PhpED

Then you just open up the index.php in the main directory where you put your CI project, stuff a DebugBreak() function call at the top, then visit your localhost server page and tada - PhpED will take you right to the breakpoint line and allow you to step through things one line at a time.

PhpED is so far the only editor I've gotten it working in, and it works great once you've set it up - though that does take a bit of work.
#9

[eluser]FutureKing[/eluser]
[quote author="BrianDHall" date="1252134807"]First, doing performance measuring properly is, simply..."extremely hard". Its far easier to do it wrong than do it right. But basically you need to get something like microtime() in PHP before you run the test, run the test 100-10000+ times to get a large enough sampling to determine the actual time it took to run the tests, and do so in a way that you are sure something isn't getting cached or short-circuited so that every call of the function past the first one was happening far faster than it would "in the real world" (where a function isn't artificially called so many times).

Not to be overly opinionated, but unless you are having a site that will be drawing hundreds of thousands of users in a very short period of time, performance doesn't really matter. If you are getting that much traffic you should be getting a lot of money - and if you are, why don't you just deploy into a cloud environment or with a managed cluster? It doesn't cost THAT much more than other methods of hosting (the price is tiny compared to what you should be making if you are getting hundreds of thousands of viewers a day), and you don't waste your valuable time worrying about execution times when you could be building valuable applications.

If this is a purely intellectual/academic project...well then go right ahead Smile But proper execution testing is a science unto itself, and I wouldn't even know where to put you to get started, other than to articles that warn against premature optimization.

Now, on to debugging. I have one that I use and know works, so I'll just reccommend that. It's called PhpED, from NuSphere. There's a free trial you can download. To get debugging working in CodeIgniter you'll want to check out ZuggSoft's tutorial on setting up debugging for CI in PhpED

Then you just open up the index.php in the main directory where you put your CI project, stuff a DebugBreak() function call at the top, then visit your localhost server page and tada - PhpED will take you right to the breakpoint line and allow you to step through things one line at a time.

PhpED is so far the only editor I've gotten it working in, and it works great once you've set it up - though that does take a bit of work.[/quote]
Thank you for advice.
#10

[eluser]garymardell[/eluser]
For measuring the performance and benchmarking you will want to use apache ab.

http://httpd.apache.org/docs/2.0/programs/ab.html

For example to test a website you can type in terminal (command line)
Code:
ab -n 100 http://localhost:8888/garden

This will perform 100 requests, you can also specify more options like posting data aswell having more concurrent access at the same time. This is meant to simulate how well your site will perform in a real environment with users on it.




Theme © iAndrew 2016 - Forum software by © MyBB