Immediate download CodeIgniter for Rapid PHP Application Development Improve your PHP coding productivity with the free compact open source MVC CodeIgniter framework 1st Edition David Upton ebooks 2024
Immediate download CodeIgniter for Rapid PHP Application Development Improve your PHP coding productivity with the free compact open source MVC CodeIgniter framework 1st Edition David Upton ebooks 2024
com
OR CLICK BUTTON
DOWNLOAD EBOOK
https://ebookname.com/product/multi-tier-application-programming-with-
php-1st-edition-david-wall/
ebookname.com
https://ebookname.com/product/building-php-applications-with-symfony-
cakephp-and-zend-framework-1st-edition-bartosz-porebski/
ebookname.com
https://ebookname.com/product/wood-fracture-characterization-first-
edition-marcelo-f-s-f-de-moura/
ebookname.com
Electrons in Solids Mesoscopics Photonics Quantum
Computing Correlations Topology Graduate Texts in
Condensed Matter 1st Edition Hendrik Bluhm
https://ebookname.com/product/electrons-in-solids-mesoscopics-
photonics-quantum-computing-correlations-topology-graduate-texts-in-
condensed-matter-1st-edition-hendrik-bluhm/
ebookname.com
https://ebookname.com/product/unimaginable-bodies-intellectual-
disability-performance-and-becomings-1st-edition-anna-catherine-
hickey-moody/
ebookname.com
https://ebookname.com/product/traumatic-brain-injury-part-ii-1st-
edition-jordan-grafman-and-andres-m-salazar-eds/
ebookname.com
https://ebookname.com/product/writing-and-reading-across-the-
curriculum-eleventh-edition-laurence-behrens/
ebookname.com
https://ebookname.com/product/a-psychoanalytic-perspective-on-reading-
literature-1st-edition-merav-roth/
ebookname.com
Women Work and Autoimmune Disease Keep Working Girlfriend
1st Edition Rosalind Joffe
https://ebookname.com/product/women-work-and-autoimmune-disease-keep-
working-girlfriend-1st-edition-rosalind-joffe/
ebookname.com
CodeIgniter for Rapid PHP
Application Development
David Upton
BIRMINGHAM - MUMBAI
CodeIgniter for Rapid PHP Application Development
Improve your PHP coding productivity with the free compact
open-source MVC CodeIgniter framework!
All rights reserved. No part of this book may be reproduced, stored in a retrieval
system, or transmitted in any form or by any means, without the prior written
permission of the publisher, except in the case of brief quotations embedded in
critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of
the information presented. However, the information contained in this book is sold
without warranty, either express or implied. Neither the author, Packt Publishing,
nor its dealers or distributors will be held liable for any damages caused or alleged to
be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.
ISBN 978-1-847191-74-8
www.packtpub.com
Reviewers Indexer
Rick Ellis Bhushan Pangoankar
Derek Allard
Proofreader
Development Editor Chris Smith
Douglas Peterson
Production Coordinator
Assistant Development Editor Shantanu Zagade
Nikhil Bangera
Cover Designer
Technical Editor Shantanu Zagade
Ajay S
Editorial Manager
Dipali Chittar
About the Author
I’d like to thank Rick Ellis for writing CI and for making it available,
free. This spirit of generosity with such valuable intellectual
property is what makes the Open Source movement a success, and
an example to the rest of us.
I’d also like to thank Rick, and Derek Allard, for undertaking a
technical review of the book and making many helpful suggestions.
Lastly, but not least, my thanks to Julia, John, and James for their
love, support, and patience.
About the Reviewers
Rick Ellis is the founder and CEO of EllisLab.com, the company that develops
CodeIgniter and several other widely used web applications. Rick Ellis has a diverse
background in media technology, having worked in creative and technical capacities
on interactive projects for Disney, to feature films for Oliver Stone, and almost every
kind of web-based project in-between.
[ ii ]
Table of Contents
My 'Display' Model 78
CI's Validation Class: Checking Data Easily 79
Set Up Validation 80
Set Up the Controller 81
Set Up the Forms 81
Summary 83
Chapter 6: Simplifying Sessions and Security 85
Starting to Design a Practical Site with CI 85
Moving Around the Site 86
Security/Sessions: Using Another CI Library Class 91
Turning Sessions into Security 94
Security 96
Summary 98
Chapter 7: CodeIgniter and Objects 99
Object-Oriented Programming 99
Working of the CI 'Super-Object' 100
Copying by Reference 103
Adding Your own Code to the CI 'Super-Object' 105
Problems with the CI 'Super-Object' 106
Summary 109
Chapter 8: Using CI to Test Code 111
Why Test, and What For? 111
CI's Error Handling Class 113
CI's Unit Test Class 115
When to Use Unit Tests 117
Example of a Unit Test 118
CI's Benchmarking Class 121
CI's Profiler Class 122
Testing with Mock Databases 123
Control and Timing 124
Summary 125
Chapter 9: Using CI to Communicate 127
Using the FTP Class to Test Remote Files 127
Machines Talking to Machines Again—XML-RPC 129
Getting the XML-RPC Server and Client in Touch with Each Other 131
Formatting XML-RPC Exchanges 132
Debugging 134
Issues with XML-RPC? 135
Talking to Humans for a Change: the Email Class 136
Summary 139
[ iii ]
Table of Contents
[ iv ]
Table of Contents
[]
Preface
This book sets out to explain some of the main features of CI. It doesn't cover them
all, or cover any of them in full detail. CI comes with an excellent on-line User Guide
that explains most things. This is downloaded with the CI files.
This book doesn't try to duplicate the User Guide. Instead it tries to make it easier for
you to pick up how the CI framework works, so you can decide whether it is right
for you, and start using it quickly.
In some places, this book goes beyond the User Guide, though, when it tries to
explain how CI works. (The User Guide is more practically oriented.) This means
that there are some fairly theoretical chapters in between the "here's how" pages. I've
found that it helps to understand what CI is doing under the hood; otherwise you
sometimes get puzzling error messages that aren't easy to resolve.
I've tried to use a 'real-world' example when showing sections of CI code. I want
to show that CI can be used to develop a serious website with a serious purpose.
I'm currently running several websites for clients, and I want a program that will
monitor them, test them in ways I specify, keep a database of what it has done, and
let me have reports when I want them.
The examples in this book don't show it in full detail, of course: but they do, I hope,
demonstrate that you can use CI to make pretty well any common coding simpler,
and some uncommon stuff as well.
This book steps you through the main features of CodeIgniter in a systematic way,
explaining them clearly with illustrative code examples.
Preface
Chapter 2 explains what happens when you install the site, and which files will be
created. It gives a detailed overview of the required software, and explains the basic
configuration of CodeIgniter.
Chapter 3 explains how MVC helps to organize a dynamic website. It goes further
to explain the process by which CodeIgniter analyzes an incoming Internet request
and decodes which part of your code will handle it. Then CodeIgniter syntax rules
and the different types of files or classes you can find—or write for yourself—on a
CodeIgniter site are explained. At the end of the chapter, some practical hints on site
design are given.
Chapter 4 looks at how you set up a database to work with CodeIgniter, and then
how you use the Active Record class to manipulate the database.
Chapter 5 covers various ways of building views, how to create HTML forms quickly,
and how to validate your forms using CodeIgniter's validation class.
Chapter 6 looks at one of the basic questions affecting any website i.e. session
management and security; we also explore CodeIgniter's session class.
Chapter 7 covers the way in which CodeIgniter uses objects, and the different ways in
which you can write and use your own objects.
Chapter 8 covers CodeIgniter classes to help with testing: Unit tests, Benchmarking,
the 'profiler' and ways in which CodeIgniter helps you to involve your database in
tests without scrambling live data.
Chapter 9 looks at using CodeIgniter's FTP class and email class to make
communication easier, and then we venture into Web 2.0 territory using XML-RPC.
Chapter 10 talks about CodeIgniter classes that help in overcoming problems arising
regularly when you are building a website, for example, the date helper, the text and
inflector helpers, the language class, and the table class.
Chapter 11 looks at several useful CodeIgniter functions and helpers: file helper,
download helper, file upload class, image manipulation class, and the ZIP class.
Chapter 12 covers exploring your config files, using diagnostic tools, and potential
differences between servers, along with some notes on security.
[]
Exploring the Variety of Random
Documents with Different Content
Holmia Walcott.
Holmia Lundgreni Moberg, Sveriges äldsta trilobiter, Tafl. 14, fig. 10,
11, 12. The maculæ are much prominent and tubercular, elongate
narrow, oblique but not mentioned in the description. Hypostoma
probably belonging to the terrace-line group. As well seen in original
specimens and in the figures in Dr. Holm's paper on Olenellus
(Holmia) Kjerulfi there are also in this species two distinct macula;
near the posterior margin of the hypostoma, above the marginal
groove.
Homalonotus König.
Maculæ have been previously observed in the following species.
Hom. delphinocephalus Green, Hall Pal. N. York vol. II pl. 68 fig. 11,
incomplete figure with two well marked tubercular maculæ. No
description.
Hom. Knighti König. Salter II, pl. 12 fig. 10. Maculæ well expressed
as oblique tubercles. On page 120 it is said »with a pair of lateral
tubercles well developed (as in Asaphus ...)».
This species is identical with Angelin's Homalon. rhinotropis, Pal. Sc.,
pl. XX fig. 1 e and his figure has two hollow maculæ seen from the
inside of the hypostoma.
Hysterolenus Moberg.
Hyst. Törnquisti Mbg., En trilobit från Dictyograptusskiffern p. 320. In
the descriptive letter-press, there is said, that in the exterior (lateral)
parts of the anterior groove of the hypostoma a distinct tubercle is
to be seen on each side. But none of the figures given, Pl. 17 figs. 6,
7, shows them or at least very indistinctly.
Illænus Dalman.
It is remarkable, considering the great number of species in this
almost exclusively Lower Silurian species, that there is none but a
single species in which the maculæ hitherto have been delineated.
This is Illænus angustifrons var. depresses Holm I, pl. VIII fig. 18. A
little, fragmentary hypostoma with globular maculæ.
Lichas Dalman.
We have not been able to find any notice about the exceptional
maculæ of this genus. There is only a figure of the hypostoma of
Lichas hylæus Hall Pal. of N. York vol. VII pl. XXV fig. 5 which would
seem to show a pair of narrow, oblique maculæ, but these are quite
without resemblance with the maculæ of the true Lichas.
The hypostoma of Lichas is of a characteristic type, broad, with the
incised posterior margin and its two lappets reminding of Asaphus,
with its large rounded, faintly elevated median part near the anterior
margin reminding of Illænus, as also do the lenticles of the maculæ.
The maculæ are of a minimal size, scarcely 1 millim. in diameter and
thence easily overlooked. Pl. IV figs. 46, 48.
As the hypostomas in this genus generally are found detached it is
often difficult to decide to which species they have belonged. So it is
with that delineated in Pl. IV fig. 44 natural size. The two maculæ
are situated near the centre of the hypostoma, just below the
grooves which surround the large, globular disc. They are sunk in a
little cavity, rounded and entirely covered by globular lenses (pl. IV
fig. 46).
In another detached hypostoma of an unknown species the macula
is smaller and the few lenticular globules larger than in the other, fig.
48.
Megalaspides Brögger.
This author has a figure of M. dalecarlicus in II pl. 1 fig. 19 and also
of an unnamed species fig. 20, both showing globular maculæ. In
Holm's original description of his Megalaspis dalecarlicus (Trilobiten
des Phyllograptusschiefers Dalecarliens figs. 8, 9) the same
hypostoma is also figured. This genus seems to have a closer affinity
with Ptychopyge than with Megalaspis.
Megalaspis Ang.
The following figures of hypostomas with maculæ have been
published.
Megal. limbata by Brögger I, tab. XII, fig. 10, and in II pl. 2, fig. 22,
somewhat differing from the first figure.
Meg. planilimbata Brögger II tab. 2 figs. 21, 21 a. Both figures
incomplete and incorrect.
The hypostoma has a large central ovate gibbosity with the maculæ
near its basis, surrounded by the winglike expanded limbus.
Nileus Dalman.
Hypostoma with maculæ figured in N. armadillo by Angelin pl. XVI
fig. 5 c, and Br. II pl. 3 fig. 40.
The hypostoma in this genus is transversal with large lateral
expansions, the central convexity only faintly elevated and almost
coherent with the posterior part. The maculæ lie exactly on the
horizontal median line of the hypostoma. The anterior wings are well
developed like slightly bent acuminated horns and the posterior
wings are conical points. The terrace lines are transverse and a little
wavy.
Niobe Angelin.
The following figures have formerly been given of its hypostoma
with maculæ.
N. emarginula Br. II tab. 2 fig. 33.
N. explanata Br. II tab. 2 fig. 35.
N. frontalis Br. II fig. 37.
N. insignis Br. I tab. IV fig. 1 d, 11 tab. 2 fig. 28.
N. læviceps Br. II pl. 2 fig. 34.
The maculæ are distinguished from all other sorts of maculæ,
excepting those of Megalaspis, in being, as it were, shelved on a sort
of support, formed through the bulging of the hypostomic surface
just below them, one such console for each. Their surface lies
consequently almost rectangularly to the adjoining surface of the
hypostoma. They are white and smooth.
Ogygia Brongn.
Figures of the maculæ are found in
O. Buchi Salter, Mem. Geol. Surv., Dec. II pl. VI fig. 3 p. 2, where it
is stated that »there are two transverse furrows near the apex, with
compressed tubercles between them» There are two narrow
crescentic maculæ and between them a little lower a longer,
crescentic ridge, which may be the ridge that in other species
connects the maculæ. Moreover, the shape of the hypostoma is not
concordant with that of the other species. In Monogr. Brit Trilob. pl.
15 figs. 2, 3 there is only a reproduction of the former figure.
O. corndensis Murch. Salter in Monogr. pl. 16 fig. 10 interior side of
the hypostoma with two lateral maculæ. In the description two pairs
of furrows the uppermost is the maculæ. H. Wyatt-Edgell »On the
Genera of Trilobites Asaphus and Ogygia and the Subgenus
Ptychopyge» in Geol. Magaz. 1867, p. 14, 15 fig. 2 probably a cast
with two oblique impressions of maculæ.
O. dilatata (Asaphus) Sars var. Sarsi Ang. Sars in Isis 1835 p. 342, pl.
IX fig. 11. The figure has two small maculæ near the posterior
margin and the author says »mit einer starken Vertiefung oder
Einschnitt an jeder Seite des Endes». Angelin pl. XLII fig. 1 b.
Brögger's fig. 38 pl. 3, in II, collies near to the specimen, which is
described below, also belonging to Dr. G. Holm.
Paradoxides Brongn.
The oldest record of any hypostoma at all amongst the trilobites is
that given by Wahlenberg in his Petref. Suecana (1818) p. 37 Tab. 1,
fig. 6, which he, however, considered as the head of the trilobite
which he named Entomostracites bucephalus. Figures with maculæ
have been given of
Par. Davidis Salter Mem. Geol. Survey Dec. XI pl. X, fig. 3, a fine
figure of a hypostoma with two large oblique maculæ. Linnarsson in
»de undre Paradoxideslagren vid Andrarum» pl. II fig. 2 delineates a
gigantic hypostoma with two crescentic tubercular maculæ, having
10 mms. in length.
Par. Forchhammeri Angelin Pl. II fig. 3. Brögger, Paradoxidesskiffr. vid
Krækling tab. II fig. 10 two marks somewhat different from Angelin's
figure. Linnarsson 1. c. pl. I figs. 9, 10 two hypostomas with maculæ.
Par. Tessini, var. Wahlenbergi Angel. Pl. I a, fig. 1 b.
Par. Tessini, var. oelandicus Ang. Tab. I a, fig. 2 b. Angelin's figure of
this hypostoma is incomplete in so far that he had not found the
peculiar falciform horns on both sides of the posterior border. Pl. V,
fig. 33.
Par. rugulosus Corda has, according to Brögger, Krækling, pl. II fig. 2
two long, straight callosities, probably corresponding to the maculæ
in other Paradoxidæ.
Chr. Boeck gives in Mag. for Naturvidenskaberne Bd 8, 1828, in his
paper on the Trilobites on the plate fig. 16 the hypostoma of a
Bohemian species with well developed concave maculæ, probably a
cast. He compares it with the Entom. bucephalus of Wahlenberg, but
says he cannot explain its nature.
The maculæ of P. oelandicus, pl. V, fig. 34, are tubercles, oblong,
smooth, and have invariably an oblong scar along the centre, where
probably once a thinner membrane, as in the cephalic eyes of
Calymmene, contained the lenses.
Peltura M. Edw.
Phaëtonides Barr.
Phillipsia Portlock.
De Koninck figured a hypostoma of Phillipsia in his »Description des
Animaux Foss. de Belgique» as Cyclus Brongniartianus pl. LII fig. J
and Novák in III figs. 6, 7 copied it and corrected the error. It is
provided with two globular maculæ united by a curved ridge.
Phillipsia Eichwaldi Woodw. Novák III fig. 5 a hypostoma with globular
maculæ. We have been able to examine three different, unnamed or
undeterminated species, which we distinguish by numbering them.
Phill. No. 1 from the Keokuk group of Crawfordsville, N. America.
The hypostoma is broader than in the other species. The nearly
horizontal elongated maculæ placed near the median line, close to
the lateral margins.
Phill. No. 2 (pl. VI, figs. 15-18) probably from the Carboniferous
formation of Belgium is of a lengthened form. The elliptic maculæ in
the groove, below the central elevation. They are smooth and
surrounded by a flat border.
The cephalic eyes are much destroyed, but seem to have consisted
of somewhat semi-prismatic lenses or prisms of the same type as
Dysplanus.
Phillipsia No. 3 (pl. VI figs. 12-14) from the Carboniferous strata of
Beeren Eiland communicated by Hr J. G. Andersson. It comes near
the preceding, is lengthened, but has broader and shorter anterior
wings and the inferior surface just above the posterior border
peculiarly pitted. The macula lying above this pitted field are ovate.
The lenses of the cephalic eye are hemispheric on the surface.
Platymetopus Angelin.
Pliomera Ang.
Proetus Steininger.
There are some indistinct indications of maculæ in several of the
hypostomas figured in Barrande's Système pl. 15.
Proet. signatus Lindstr., Gotl. Trilob. Pl. XV fig. 17, shows very
distinctly the two maculæ.
Ptychoparia Corda.
Walcott in »Palæontology of the Eureka District», gives on plate X
fig. 21 a representation of a hypostoma which near the posterior
margin shows two maculæ as narrow, crescentlike ridges and above
them two longer and thicker ridges directed obliquely toward the
central axis of the hypostoma.
Ptychopyge Ang.
Previous figures of hypostomas with maculæ are the following:
Pt. aciculata Br. II, pl. 1 fig. 13.
Pt. glabrata Br. II, pl. 1 fig. 14.
Schmidtia Marcou.
Moberg has in his paper on »Sveriges äldsta Trilobiter», pl. 15, fig. 6,
drawn a hypostoma of Schmidtia Torelli with scars of maculæ,
placed like that of the Paradoxidæ. There is no mention made of
them in the descriptions.
Trochurus Beyrich.
Trochurus sp.
Pl. IV figs. 54, 55.
This hypostoma belongs to an unknown species of Trochurus from
the Southern Gotland (Burs). Its macula are placed almost as in the
preceding species, but are much larger. They are surrounded by
prominent margins. No lenses have been discovered on them.
CONCLUSIONS.
In reviewing the genera and species enumerated above, as to their
number in which the structure of the macula has been observed, we
arrive at the following results.
the plates.