Archive for the "Codeigniter" Category

6
Mar

it’s easiest to install a package such as Xampplite, which installs Apache, PHP, and MySQL on to a Windows machine with minimum configuration by you,If you aren’t familiar with the process of setting up a web server. It also helps to have a good PHP editor on your system. You can do it all on a text editor, but I find that the syntax highlighting feature of a good editor saves me from making lots of simple mistakes with unclosed brackets or mismatched quotation marks and notepad++ is enough for me too.

Once you’ve reached this far, now to have CI running on your system. Once your server is set up, go to the CodeIgniter site at http://www.codeigniter.com/ and download the latest version of the framework. Version 1.7.1, the latest, is only 893KB when zipped, so the download doesn’t take that long. Unzip the folder, and install the CodeIgniter files in your web root folder. If you are using Xampplite(XAMPP), this is usually the htdocs folder within the Xampplite folder. Included with CI is a comprehensive user guide (in the user_guide folder). You’ll use this a lot. It is usually clear, and often goes into more detail than this book can. So, try it if you get stuck.

When these files are on your machine, you can access them in two ways:
As a URL—e.g., http://127.0.0.1
Through the normal directory path: e.g.,
C:/xampplite/htdocs/index.php or http://localhost/CodeIgniter_1.7.1
You should be able to see the CI welcome screen by simply navigating to your URL with the browser. It’s that simple! The welcome page tells you that what you are seeing is built by two files, a view and a controller.

(source:Upton, David. 2007. CodeIgniter for Rapid PHP Application Development. Packt Publishing, Birmingham.)

18
Feb

Most of us just want to write applications that work well, and to do it as simply and easily as we can. If you need to produce results, if you think that the details and intricacies of coding are for geeks, then you should look at CodeIgniter (CI to its friends). CI is free, lightweight, and simple to install, and it really does make your life much easier. If you are already writing code in PHP, CodeIgniter will help you to do it better, and more easily.
It will cut down on the amount of code you actually type. Your scripts will be easier to read and update.

Here are two examples (If you are already writing code in PHP, CodeIgniter will help you to do it better, and more easily ).
Imagine you are writing a database query. This is how you might write a function within your PHP programme to query a MySQL database:
$connection = mysql_connect(“localhost”,”fred”,”12345″);
mysql_select_db(“websites”, $connection);
$result = mysql_query (“SELECT * FROM sites”, $connection);
while ($row = mysql_fetch_array($result, MYSQL_NUM))
{
foreach ($row as $attribute)
print “{$attribute[1]} “;

}

Now see how a CI function would handle a similar query:
$this->load->database(‘websites’);
$query = $this->db->get(’sites’);
foreach ($query->result() as $row)
{
print $row->url
}

Compare the character counts: 244 for the traditional syntax; 112 for CI.
READ THE FULL ARTICLE->->->

16
Feb

CodeIgniter vs Zend

Author: Bo1

CodeIgniter
Set Up: CodeIgniter is very easy to set up. Copy all the framework files to the web server and it’s good to go. It also has a small folder size – about 2.1 Mb.
Documentation: The documentation is very well-structured and organized although it is a bit less detailed than the Zend framework documentation. CodeIgniter also has forums and a wiki which feature a lot of user-submitted code.
Flexibility: CI is very flexible allowing almost all defaults to be modified.
Performance: CI has about double the performance of the Zend Framework.
Testing: CodeIgniter has a unit testing class but it encourages mixing the test code with the actual source code so I don’t recommend it.A third-party extension for SimpleTest is available though.Using PHPUnit with the CI classes should also be possible.

*CodeIgniter advantages include:

  • Extremely easy to setup.
  • Lower learning curve then the Zend Framework.
  • More accessible documentation.
  • Concise syntax – The Zend Framework syntax is wordier.
  • 100% faster than the Zend framework.

Zend Framework
Set Up:The Zend Framework requires a bit of effort to setup the project. It requires the creation of a bootstrap file with all the initialisation stuff it. The framework is relatively large – about 12.4Mb and the set-up process took about 19 minutes.
Documentation: The Zend Framework has very detailed documentation with a lot of examples. It is less organised than the CodeIgniter docs in my view although this could be down to the afore-mentioned detail and the large number of components available in the framework.ZF also has a wiki with a few tutorials.
Flexibility: CZF is simply a collection classes and as such any file or folder can be placed anywhere as long as the location is added to the bootstrap file.
Performance: The Zend Framework is about half as fast as CodeIgniter.
Testing:The Zend Framework does not have a built-in unit testing class but the core classes use PHPUnit as their test framework and this can be extended to include any additional classes.Using SimpleTest with the ZF classes should also be possible.

*The Zend Framework advantages include:

  • The “official PHP framework”.
  • My workplace is already a Zend “partner”.
  • Full-featured layout and template system.
  • Massive number of classes and components.
  • Extremely flexible.
  • More advanced database library.
  • More advanced validation library.
  • Internationalization support.

Conclusion
CodeIgniter is over twice the speed of the Zend framework in all cases and CakePHP is a lot slower than the other two PHP frameworks.

for the benchmarks is in here : PHP framework comparison benchmarks

(Source: http://www.avnetlabs.com/php/php-frameworks-revisited-codeigniter-vs-zend-framework)