Tag: PEAR
About
PEAR is short for "PHP Extension and Application Repository" and is pronounced just like the fruit. The purpose of PEAR is to provide:
- A structured library of open-source code for PHP users
- A system for code distribution and package maintenance
- A standard style for code written in PHP, specified here
- The PHP Extension Community Library (PECL), see more below
- A web site, mailing lists and download mirrors to support the PHP/PEAR community
PEAR is a community-driven project governed by its developers. PEAR's governing bodies are subdivided into the PEAR Group, Collectives, and a President. PEAR's constitution (adopted in March 2007) defining these groups is documented here. The PEAR project was founded in 1999 by Stig S. Bakken and quite a lot of people have joined the project.
From pear.php.net/manual/en/introduction.php
Today I've moved all of my SVN repositories over to GitHub. 5 private reps and 4 public ones. Two of which you may know: PHP.JS and System_Daemon.
If you've written a PEAR package, it's probably a good idea to submit some end user documentation. Here's how to do it.
Everyone knows PHP can be used to create websites. But it can also be used
to create desktop applications and commandline tools. And now with a class
called System_Daemon, you can even create daemons using nothing but PHP.
And did I mention it was easy?
In another article I've told you about how I would like to see one rule removed from the PEAR Coding Standards. This rule would allow developers a bit more flexibility, while staying true to the convention.
Since a couple of months now, I've been involved with PEAR as a contributor. Contributing to PEAR means adhering to the PEAR Coding Standards. Their standards have actually been thought over, and using them for projects (also outside of PEAR), leads to consistency, and makes it easier for many developers to understand each other's code.
Code can be scanned and checked for conformity using the PHP CodeSniffer package.
It took me a while to get rid of my old cod...
If you're like me and you're interested in the stats of your website or blog, you might also want to know how many Diggs all of your articles have received. But that can become quite a pain when you have more and more articles, pages or blog posts. So why not let PHP retrieve the Digg count of your articles so you can use it in graphs or other statistic tools?
It's always a good idea to backup important data. Your files and settings can easily be archived. But how can you backup & restore all applications that you've installed over the last couple of years? Here's an easy trick that works for both desktops & servers, and that can also be used to synchronize installed packages in a web cluster, making all the servers run the same software.
Recently two of my articles reached the Digg frontpage at the same day. My web server isn't state of the art and it had to handle gigantic amounts of traffic. But still it served pages to visitors swiftly thanks to a lot of optimizations. This is how you can prevent heavy traffic from killing your server.
Not everyone knows about PHP's capabilities of making SSH connections and executing remote commands, but it can be very useful. I've been using it a lot in PHP CLI applications that I run from cronjobs, but initially it was a pain to get it to work. The PHP manual on Secure Shell2 Functions is not very practicle or thorough for that matter, so I would like to share my knowledge in this how to, to make it a little less time consuming setting this up.
You want your website to be as safe as possible. So you'll typically want Open Basedir and Safe Mode to be on. When you're in a shared hosting environment, you'll find that any server administrator with a good sense of security will also have these restrictions in place. However security pretty much always limits functionality and this case is no different. Because what if you are caged in a restricted environment, and you would still like to use shared libraries like the ones provided by PEAR?