-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
110-PHP-Library-Channel.html
290 lines (262 loc) · 16.9 KB
/
110-PHP-Library-Channel.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
<!DOCTYPE html><!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--><html lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8" />
<title>PHP Library Channelphly, boy, phly</title>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link href="/css/SkeletonCss/base.css" media="screen" rel="stylesheet" type="text/css">
<link href="/css/SkeletonCss/skeleton.css" media="screen" rel="stylesheet" type="text/css">
<link href="/css/SkeletonCss/layout.css" media="screen" rel="stylesheet" type="text/css">
<link href="/css/Application/site.css" media="screen" rel="stylesheet" type="text/css">
<link href="/images/Application/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon">
<link href="/css/Application/blog.css" media="screen" rel="stylesheet" type="text/css">
<link href="/blog-atom.xml" rel="alternate" type="application/atom+xml" title="phly, boy, phly Atom Feed">
<link href="/blog-rss.xml" rel="alternate" type="application/rss+xml" title="phly, boy, phly RSS Feed">
<script type="text/javascript">
//<!--
dojoConfig={
has: {
"dojo-firebug": false
},
baseurl: "/js/",
parseOnLoad: false,
async: true,
tlmSiblingOfDojo: false,
packages: [
{ name: "dijit", location: "../dijit" },
{ name: "dojox", location: "../dojox" },
{ name: "Application", location: "../Application" }
]
};
//-->
</script>
<script type="text/javascript" src="/js/dojo/dojo.js"></script>
<script type="text/javascript">
//<!--
require(["Application/blog"]); //-->
</script>
<script type="text/javascript">
//<!--
require(["Application/scroll"], function(scroll) {}); //-->
</script>
<script src="https://www.google.com/jsapi?ABQIAAAAGybdRRvLZwVUcF0dE3oVdBTO-MlgA7VGJpGqyqTOeDXlNzyZQxTGq17s-iAB0m0vwqLQ_A2dHhTg2Q"></script>
<script type="text/javascript">
google.load('search', '1', {style: google.loader.themes.ESPRESSO});
google.setOnLoadCallback(function(){
new google.search.CustomSearchControl().draw('search');
}, true);
</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-27037983-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body>
<div class="container">
<header class="sixteen columns">
<div class="one-half column logo">
<a href="/"><img src="/images/Application/logo.gif" height="37" width="37" alt="Celtic Knot" /></a>
<span class="main_title">phly, boy, phly: matthew weier o'phinney</span>
</div>
<nav class="one-half column" id="menu"><ul>
<li><a href="/">Home</a></li>
<li><a href="/blog.html">Blog</a></li>
<li><a href="/resume">Résumé</a></li>
<li><a href="/contact">Contact</a></li>
</ul></nav>
</header>
<div class="sixteen columns clearfix content">
<div class="row">
<article class="eleven columns alpha blog">
<h2>PHP Library Channel</h2>
<p>
I've been working on <a href="http://cgiapp.sourceforge.net/">Cgiapp</a> in
the past few months, in particular to introduce one possibility for a Front
Controller class. To test out ideas, I've decided to port areas of my
personal site to Cgiapp2 using the Front Controller. Being the
programmer I am, I quickly ran into some areas where I needed some reusable
code -- principally for authentication and input handling.
</p>
<p>
I've been exposed to a ton of good code via <a href="http://pear.php.net/">PEAR</a>,
<a href="http://www.solarphp.com/">Solar</a>,
<a href="http://ez.no/products/ez_components">eZ components</a>, and
<a href="http://framework.zend.com/">Zend Framework</a>. However, I have
several criteria I need met:
</p>
<ul>
<li>I want PHP5 code. I'm coding in PHP5, I should be able to use PHP5
libraries, not PHP4 libraries that work in PHP5 but don't take advantage of
any of its features.</li>
<li>I prefer few dependencies, particularly lock-in with existing
frameworks. If I want to swap out a storage container from one library and
use one from another, I should be free to do so without having to write
wrappers so they'll fit with the framework I've chosen. Flexibility is
key.</li>
<li>Stable API. I don't want to have to change my code every few weeks or
months until the code is stable.</li>
<li>I should be able to understand the internals quickly.</li>
</ul>
<p>
So what did I choose? To reinvent the wheel, of course!
</p>
<p>
To that end, I've opened a new PEAR channel that I'm calling
<a href="http://weierophinney.net/phly/">PHLY, the PHp LibrarY</a>, named
after my blog. The name implies soaring, freedom, and perhaps a little
silliness.
</p>
<p>
It is designed with the following intentions:
</p>
<ul>
<li>Loosely coupled; dependencies should be few, and no base class should be necessary.</li>
<li>Extendible; all classes should be easily extendible. This may be via observers, interfaces, adapters, etc.. The base class should solve 80% of usage, and allow extensions to the class to fill in the remainder.</li>
<li>Designed for PHP5 and up; all classes should make use of PHP5's features.</li>
<li>Documented; all classes should minimally have excellent API-level documentation, with use cases in the class docblock.</li>
<li>Tested; all classes should have unit tests accompanying them.</li>
<li>Open source and commercial friendly; all classes should use a commercial-friendly open source license. The BSD license is one such example.</li>
</ul>
<p>
Please feel free to use this code however you will. Comments, feedback, and
submissions are always welcome.
</p><div class="social-media">
<a href="https://twitter.com/share" class="twitter-share-button" data-via="weierophinney">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</div>
<div class="social-media">
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-like" data-send="true" data-width="450" data-show-faces="true"></div>
</div>
<div class="social-media">
<div class="g-plusone" data-size="medium" data-annotation="inline"></div>
</div>
<!-- Place this render call where appropriate -->
<script type="text/javascript">
dojo.ready(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
});
</script>
<div class="social-media">
<a href="http://www.reddit.com/submit" onclick="window.location = 'http://www.reddit.com/submit?url=' + encodeURIComponent(window.location); return false"> <img src="http://www.reddit.com/static/spreddit1.gif" alt="submit to reddit" border="0" /> </a>
</div>
<div id="disqus_thread"></div>
<script type="text/javascript">
var disqus_developer = 0;
var disqus_shortname = 'phlyboyphly';
var disqus_identifier = '110-PHP-Library-Channel';
var disqus_url = 'http://mwop.net/blog/110-PHP-Library-Channel.html';
var disqus_title = 'PHP Library Channel';
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a></article>
<aside class="four columns offset-by-one omega sidebar blog">
<div class="metadata">
<ul>
<li>Posted on <b>2006-05-16 00:01:00</b>.</li>
<li>Last updated on <b>2006-05-16 08:46:33</b>.</li>
</ul>
</div>
<div class="metadata">
<h4>Tags for this entry</h4>
<p class="tags"><a href="/blog/tag/php.html">php</a></p>
</div>
<div class="metadata">
<h4>Blogroll</h4>
<ul>
<li><a href="http://sebastian-bergmann.de/">Sebastian Bergmann</a></li>
<li><a href="http://blog.calevans.com/">Cal Evans</a></li>
<li><a href="http://prematureoptimization.org/blog/">Shahar Evron</a></li>
<li><a href="http://paul-m-jones.com/blog/">Paul M. Jones</a></li>
<li><a href="http://karwin.blogspot.com/">Bill Karwin</a></li>
<li><a href="http://mikenaberezny.com/">Mike Naberezny</a></li>
<li><a href="http://fabien.potencier.org/">Fabien Potencier</a></li>
<li><a href="http://benramsey.com/">Ben Ramsey</a></li>
<li><a href="http://derickrethans.nl/">Derick Rethans</a></li>
<li><a href="http://ralphschindler.com/">Ralph Schindler</a></li>
<li><a href="http://www.zimuel.it/blog/">Enrico Zimuel</a></li>
</ul>
</div>
</aside>
</div>
<footer class="sixteen columns footer">
<div class="column one-third alpha about">
<h4>About</h4>
<p>
I'm a husband, father of two, plaything of a Basset puppy, and web
architect by day.
</p>
<ul class="resume">
<li><a href="/resume">Resume</a></li>
<li><a href="http://twitter.com/weierophinney">Twitter</a></li>
<li><a href="http://www.linkedin.com/in/mweierophinney">LinkedIn</a></li>
<li><a href="http://www.ohloh.net/accounts/weierophinney">OhLoh</a></li>
<li><a href="http://resume.github.com/?weierophinney">GitHub</a></li>
</ul>
</div>
<div class="column one-third projects">
<h4>Projects</h4>
<ul class="projects">
<li><a href="http://framework.zend.com/">Zend Framework (Project Lead)</a></li>
<li><a href="http://www.the-pastry-box-project.net/baker/matthew-weier-ophinney/">The Pastry Box Project</a> (as a Baker)</li>
<li><a href="http://github.com/weierophinney/phly_mustache">Phly_Mustache</a></li>
<li><a href="http://github.com/weierophinney/phlyty">phlyty</a> (ZF2-based microframework)</li>
<li>ZF2 Modules
<ul>
<li><a href="https://github.com/weierophinney/PhlyBlog">PhlyBlog</a></li>
<li><a href="https://github.com/weierophinney/PhlyComic">PhlyComic</a></li>
<li><a href="https://github.com/weierophinney/PhlyCommon">PhlyCommon</a></li>
<li><a href="https://github.com/weierophinney/PhlyContact">PhlyContact</a></li>
<li><a href="https://github.com/weierophinney/PhlyMongo">PhlyMongo</a></li>
<li><a href="https://github.com/weierophinney/PhlyPaste">PhlyPaste</a></li>
<li><a href="https://github.com/weierophinney/PhlyPeep">PhlyPeep</a> (demo purposes only)</li>
<li><a href="https://github.com/weierophinney/SkeletonCssModule">SkeletonCssModule</a></li>
</ul>
</li>
<li>Tools
<ul>
<li><a href="http://p.mwop.net">PhlyPaste</a> (pastebin)</li>
</ul>
</li>
</ul>
</div>
<div class="column one-third omega tags">
<div id="search" style="width:100%;">Loading...</div>
<h4>Tag Cloud</h4>
<div class="cloud">
<ul class="Zend\Tag\Cloud"><li><a href="/blog/tag/php.html" style="font-size: 20px;">php</a></li> <li><a href="/blog/tag/zend+framework.html" style="font-size: 15px;">zend framework</a></li> <li><a href="/blog/tag/zf2.html" style="font-size: 11px;">zf2</a></li> <li><a href="/blog/tag/vim.html" style="font-size: 11px;">vim</a></li> <li><a href="/blog/tag/family.html" style="font-size: 11px;">family</a></li> <li><a href="/blog/tag/programming.html" style="font-size: 12px;">programming</a></li> <li><a href="/blog/tag/personal.html" style="font-size: 13px;">personal</a></li> <li><a href="/blog/tag/phpconcom.html" style="font-size: 10px;">phpconcom</a></li> <li><a href="/blog/tag/mvc.html" style="font-size: 11px;">mvc</a></li> <li><a href="/blog/tag/oop.html" style="font-size: 11px;">oop</a></li> <li><a href="/blog/tag/testing.html" style="font-size: 10px;">testing</a></li> <li><a href="/blog/tag/rest.html" style="font-size: 11px;">rest</a></li> <li><a href="/blog/tag/linux.html" style="font-size: 12px;">linux</a></li> <li><a href="/blog/tag/zendcon08.html" style="font-size: 11px;">zendcon08</a></li> <li><a href="/blog/tag/file_fortune.html" style="font-size: 10px;">file_fortune</a></li> <li><a href="/blog/tag/pear.html" style="font-size: 11px;">pear</a></li> <li><a href="/blog/tag/zendcon.html" style="font-size: 11px;">zendcon</a></li> <li><a href="/blog/tag/perl.html" style="font-size: 12px;">perl</a></li> <li><a href="/blog/tag/fastcgi.html" style="font-size: 10px;">fastcgi</a></li> <li><a href="/blog/tag/ubuntu.html" style="font-size: 11px;">ubuntu</a></li> <li><a href="/blog/tag/tekx.html" style="font-size: 10px;">tekx</a></li> <li><a href="/blog/tag/zendcon10.html" style="font-size: 10px;">zendcon10</a></li> <li><a href="/blog/tag/dojo.html" style="font-size: 11px;">dojo</a></li> <li><a href="/blog/tag/symfony.html" style="font-size: 11px;">symfony</a></li> <li><a href="/blog/tag/zeta+components.html" style="font-size: 10px;">zeta components</a></li> <li><a href="/blog/tag/tek09.html" style="font-size: 10px;">tek09</a></li> <li><a href="/blog/tag/spl.html" style="font-size: 11px;">spl</a></li> <li><a href="/blog/tag/subversion.html" style="font-size: 11px;">subversion</a></li> <li><a href="/blog/tag/zend+framewor.html" style="font-size: 10px;">zend framewor</a></li> <li><a href="/blog/tag/rails.html" style="font-size: 10px;">rails</a></li> <li><a href="/blog/tag/conferences.html" style="font-size: 11px;">conferences</a></li> <li><a href="/blog/tag/dpc08.html" style="font-size: 11px;">dpc08</a></li> <li><a href="/blog/tag/phpworks08.html" style="font-size: 11px;">phpworks08</a></li> <li><a href="/blog/tag/webinar.html" style="font-size: 11px;">webinar</a></li> <li><a href="/blog/tag/zencon08.html" style="font-size: 10px;">zencon08</a></li> <li><a href="/blog/tag/cw09.html" style="font-size: 11px;">cw09</a></li> <li><a href="/blog/tag/zend+server.html" style="font-size: 10px;">zend server</a></li> <li><a href="/blog/tag/dpc09.html" style="font-size: 10px;">dpc09</a></li> <li><a href="/blog/tag/sflive2010.html" style="font-size: 10px;">sflive2010</a></li> <li><a href="/blog/tag/security.html" style="font-size: 10px;">security</a></li> <li><a href="/blog/tag/wifi.html" style="font-size: 10px;">wifi</a></li> <li><a href="/blog/tag/aikido.html" style="font-size: 10px;">aikido</a></li> <li><a href="/blog/tag/books.html" style="font-size: 10px;">books</a></li> <li><a href="/blog/tag/dpc10.html" style="font-size: 10px;">dpc10</a></li> <li><a href="/blog/tag/zendcon09.html" style="font-size: 11px;">zendcon09</a></li> <li><a href="/blog/tag/git.html" style="font-size: 11px;">git</a></li> <li><a href="/blog/tag/phpwomen.html" style="font-size: 10px;">phpwomen</a></li> <li><a href="/blog/tag/virtualbox.html" style="font-size: 10px;">virtualbox</a></li> <li><a href="/blog/tag/screencast.html" style="font-size: 11px;">screencast</a></li> <li><a href="/blog/tag/advocacy.html" style="font-size: 10px;">advocacy</a></li> <li><a href="/blog/tag/politics.html" style="font-size: 10px;">politics</a></li> <li><a href="/blog/tag/internet.html" style="font-size: 10px;">internet</a></li> <li><a href="/blog/tag/microphp.html" style="font-size: 10px;">microphp</a></li> <li><a href="/blog/tag/cloud.html" style="font-size: 10px;">cloud</a></li> <li><a href="/blog/tag/composer.html" style="font-size: 10px;">composer</a></li> <li><a href="/blog/tag/doctrine.html" style="font-size: 10px;">doctrine</a></li></ul></div>
</div>
<br class="clear"/>
<div class="copyright">
Unless otherwise noted, © 2004 - 2012, Matthew Weier O'Phinney
</div>
</footer>
</div>
</body>
</html>