Book Image

CodeIgniter 1.7 Professional Development

By : Adam Griffiths
Book Image

CodeIgniter 1.7 Professional Development

By: Adam Griffiths

Overview of this book

<p>CodeIgniter is an open source PHP framework with a small footprint and exceptional performance. It gives you a rich set of libraries for common tasks, with a simple interface to access them. There are several unexplored aspects of CodeIgniter that can help developers build applications more easily and quickly. In this book, you will learn the intricacies of the framework and explore some of its hidden gems.<br /><br />If you want to get the most out of CodeIgniter, this book is for you. It teaches you what you need to know to use CodeIgniter on a daily basis. You will create mini-applications that teach a specific technique and let you build on top of the base. <br /><br />This book will take you through developing applications with CodeIgniter. You will learn how to make your CodeIgniter application more secure than a default installation, how to build large-scale applications and web services, how to release code to the community, and much more. You will be able to authenticate users, validate forms, and also build libraries to complete different tasks and functions.<br /><br />The book starts off introducing the framework and how to install it on your web server or a local machine. You are introduced to the Model-View-Controller design pattern and how it will affect your development. Some important parts of the CodeIgniter Style Guide are included to keep CodeIgniter development as standardized as possible; this helps greatly when working as part of a team or taking on an old CodeIgniter project. You will quickly move on to how CodeIgniter URLs work and learn about CodeIgniter-specific files such as helpers and plugins. By the time you finish this book, you will be able to create a CodeIgniter application of any size with confidence, ease, and speed.</p>
Table of Contents (16 chapters)
CodeIgniter 1.7 Professional Development
Credits
About the Author
About the Reviewers
Preface
Index

Preface

This book takes you beyond the CodeIgniter user guide and into more advanced subjects that you need to know if you plan to use CodeIgniter on a daily basis. The book will teach you how to build libraries in order to complete different tasks and functions. You will create mini-applications each of which teaches a specific technique and builds on top of the CodeIgniter base. By the time that you finish this book you will be able to create a CodeIgniter application of any size with confidence, ease, and speed.

What this book covers

Chapter 1, Getting Started with CodeIgniter—This chapter guides you from installing CodeIgniter to learning about its URL structure, the MVC design pattern, helpers, plugins, and extending and replacing libraries.

Chapter 2, Learning the Libraries—You are taken through a number of the core CodeIgniter libraries, being introduced to each library, what it does and how you go about using it. Some libraries work together, and if this is the case, then this chapter explains how they can be used together.

Chapter 3, Form Validation and Database Interaction—Form validation is a task that some users find difficult. This chapter focuses on teaching you the correct way to validate your forms, by using the Form Validation library. You will also cover the Database library and Database Forge, a way to easily manage database tables.

Chapter 4, User Authentication 1—The first User Authentication chapter focuses on building your own authentication system. We build a model that handles the registration and logging in of users. We also include a function to check whether a user is logged in or not.

Chapter 5, User Authentication 2—The second and final User Authentication chapter focuses solely on user log-in in through Twitter oAuth and Facebook Connect. For each example the CodeIgniter code is explained, as well as how both company's APIs work, and to some extent how each differs from the other.

Chapter 6, Application Security—This chapter discusses how CodeIgniter is secure by design, for example, disallowing certain characters in the URI strings. We also go over what you can do to make your CodeIgniter application more secure than a default installation.

Chapter 7, Building a Large-Scale Application—This chapter takes you through some of the techniques that you can use to make your CodeIgniter application scalable. You learn about identifying bottlenecks via benchmarking results, caching, using better PHP functions, optimizing SQL queries, and using memcache and multiple application instances.

Chapter 8, Web Services—This chapter builds an example web service by using the REST principle. This includes a simple client library that issues requests, and a server library that deals with requests and responds as appropriate.

Chapter 9, Extending CodeIgniter—This chapter covers everything you need to know about extending CodeIgniter's default functionality without hacking at the core files. This is very useful, especially when it is time to upgrade to the newest version of CodeIgniter.

Chapter 10, Developing and Releasing Code to the Community—In this chapter you will learn how to release code to the community, gain exposure for your released code, and how to properly maintain the code and give good support to those using your code.

Who this book is for

This book is written for advanced PHP developers with a good working knowledge of Object Oriented Programming techniques who are comfortable with developing applications and wish to use CodeIgniter to make their development easier, quicker and more fun. Basic knowledge of CodeIgniter will be helpful. This book will suit developers who fall into three categories:

  • Professional Developers—Employees of a software house or other type of development company

  • Freelance Developers—A sole developer working in the industry on their own

  • Just for fun Developer—A person using PHP to build web applications is their spare time for fun

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "We can include other contexts through the use of the include directive."

A block of code is set as follows:

[default]
exten => s,1,Dial(Zap/1|30)
exten => s,2,Voicemail(u100)
exten => s,102,Voicemail(b100)
exten => i,1,Voicemail(s0)

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

[default]
exten => s,1,Dial(Zap/1|30)
exten => s,2,Voicemail(u100)
exten => s,102,Voicemail(b100)
exten => i,1,Voicemail(s0)

Any command-line input or output is written as follows:

# cp /usr/src/asterisk-addons/configs/cdr_mysql.conf.sample
     /etc/asterisk/cdr_mysql.conf

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "clicking on the Next button moves you to the next screen".

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title in the subject of your message.

If there is a book that you need and would like to see us publish, please send us a note via the SUGGEST A TITLE form on www.packtpub.com, or send an e-mail to .

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book on, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Note

Downloading the example code for the book

Visit http://www.packtpub.com/files/code/0905_Code.zip to directly download the example code.

The downloadable files contain instructions on how to use them.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us to improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the let us know link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.