 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Stuart Herbert's Blog: Getting PEAR Working On Windows 7
by Chris Cornutt May 10, 2012 @ 10:43:49
Stuart Herbert has a new post today showing how to get the well-established PEAR package management system working on Windows 7 so you can easily call "pear install" on whatever your needs might be.
So that I don't forget how to do this next time around. Worked for me, your mileage may vary. First step is to get a working install of PHP. [...] At this point, you should be able to open up a Command Prompt, and type 'php -v', and see the response 'PHP v5.4.latest …' appear as expected. Now for PEAR itself.
He gives step-by-step instructions on how to get PEAR up and running - downloading and configuring it with the correct Windows-based paths and using the PEAR_ENV.reg file to update your registry.
voice your opinion now!
pear windows7 install tutorial registry
PHPMaster.com: An Introduction to Services
by Chris Cornutt April 03, 2012 @ 13:12:16
On PHPMaster.com today there's a new article from Alejandro Gervasio introducing you to the concept of "services", a layer put on top of your models to make a common API that's easier to reuse.
Don't let the definition freak you out, as if you've been using MVC for a while the chances are you've used a service already. Controllers are often called services, as they carry out application logic and additionally are capable of interfacing to several client layers, namely views. Of course in a more demanding environment, plain controllers fail short in handling several clients without the aforementioned duplicating, so that's why the construction of a standalone layer is more suitable in such cases.
He explains the process behind creating a simple domain model (image here) and shows how the Service layer wraps it up into a simpler interface, leaving the model to handle the business logic. He uses the example of an "EncoderInterface" that's implemented in a "JsonEncoder" and "Serializer" to both provide a "setData" method.
voice your opinion now!
services tutorial model wrapper layer
Phil Sturgeon's Blog: Packages The Way Forward for PHP
by Chris Cornutt March 07, 2012 @ 08:29:57
In this new post to his blog Phil Sturgeon talks about what he (and apparently several others) think is the "way forward for PHP" to make it a better language and ecosystem - packages.
What is a package? A package is a piece of reusable code that can be dropped into any application and be used without any tinkering to add functionality to that code. [...] Most package systems also allow for something called dependencies. [...] This is how most modern programming languages work, but to make a generalisation: PHP developers hate packages. Why? Well while other languages have great systems like CPAN for Perl, Gems for Ruby, PIP, PHP has had a terrible history with package management going back years.
He talks about one of the main current packaging systems, PEAR, and how, despite its attempts, it just hasn't seen the adoption the package management of other languages has. Phil makes a recommendation that is slowly becoming more and more popular in the PHP community - building "unframeworks". These sets of reusable components (similar to the ideas behind Aura, Symfony and Zend Framework 2) are designed to be dropped in and used without the dependencies of the frameworks they live in. He points to the Composer/Packagist dynamic duo as a way through all of the current packaging issues - a simple way to make any project an installable package just by adding a configuration file.
voice your opinion now!
packages composer packagist pear community support unframework
Sameer Borate's Blog: Building a adjacency matrix of a graph
by Chris Cornutt February 17, 2012 @ 09:19:12
Building on the graphing tutorial in his last post Sameer continues on looking at graphs in PHP with this new post showing how to create an "agency matrix" of a currently built graph.
Building a graph is not enough; we also need the ability to search through it. To make it easier to build search algorithms, it is useful if we can represent the graph and its connections in a different way; adjacency matrix being one such representation. An adjacency matrix is a means of representing which vertices (or nodes) of a graph are adjacent to which other vertices.
He includes some sample code to extract the data from a graph (built with the PEAR Structures_Graph package) and create a basic "table" of information about each nodes' connections.
voice your opinion now!
agency matrix tutorial graph structuregraph pear
Sameer Borate's Blog: Building a Graph data structure in PHP
by Chris Cornutt February 15, 2012 @ 09:35:15
In the latest post to his blog Sameer Borate takes a look at using the Structures_Graph package from PEAR to create data structures in PHP with linked nodes for directed and undirected graphs.
The Pear Structures_Graph package allows creating and manipulating graph data structures. It allows building of either directed or undirected graphs, with data and metadata stored in nodes. The library provides functions for graph traversing as well as for characteristic extraction from the graph topology.
After sharing the one-line install, he shows how to create some instances of the package's Nodes and how to connect them to a graph and link them to other nodes. He includes a few examples - a simpler one with multiple nodes joined in a directed graph, another showing how to associate data with a node and how to query the graph for node connections and testing to see if the graph is acyclic.
voice your opinion now!
graph node structure structuregraph pear package tutorial
Mike Wallner's Blog: Dropping server load with HTTP caching
by Chris Cornutt January 27, 2012 @ 09:43:04
Mike Wallner has shared a quick and easy HTTP caching technique in a new post to his blog today. The key is in using the PEAR HTTP_Header package.
Ever watched youself browsing e.g. a web forum? Noticed that you viewed the same page several times? Well, this means extraordinary and useless load for your server if there's no caching mechanism implemented in the web application. Even if there is some file or db cache you can still improve performance with implementing some http cache.
With a few simple lines of code using HTTP_Header, you can tell your scripts how long to set the "expires" header to on your requests. This increment (in seconds) is relayed to the browser to tell it when to next fetch the page and not reload from cache.
voice your opinion now!
http cache pear package httpheader tutorial
Mike Purcell's Blog: Use PHPUnit without PEAR
by Chris Cornutt January 26, 2012 @ 09:48:00
Mike Purcell has a new post to his blog showing a method he's followed to be able to use the popular PHPUnit unit testing software without having to go through the PEAR installer to get there.
PHPUnit is a great tool to protect us developers from introducing new defects when adding new features or re-factoring code. However there is one HUGE downside to PHPUnit; it must be installed using PEAR. Personally, I don't like 'auto-installers', I'd prefer to know what exactly is happening behind the scenes with regards to which libraries are required and how they are being called. [...] After breaking down the PHPUnit source code, I realized it could be installed without going through PEAR, and without too much headache.
He walks you through the directories you'll need to set up (test/vendor), the commands you'll need to get the latest version and unpack it, changes to set up some symlinks and updating the PHPUnit source to modify the autoloader, bootstrap and phpunit executable.
voice your opinion now!
pear phpunit without installer autoinstall package management
PEAR Blog: What would you do with 5 million lines of code?
by Chris Cornutt January 24, 2012 @ 12:18:07
On the PEAR blog today there's an update about the migration over to github that 5 million lines of code has already made:
Since October 2011, 5 million lines of the PEAR codebase has shifted to github. Hand in hand with this shift has been the tireless work of Daniel C - someone who brazenly said "I will fix the failing packages!" in the tail end of last year.
As a result of his efforts a list has been created of known good packages to use with PHP 5.4. Other results include:
- All test infrastructure upgrading to PHP 5.4 release candidates
- All database driven test suites executing properly, catching a variety of simple bugs
- Hitting a point of "near zero" patches to be applied to unmaintained packages
- Increasingly, the PEAR QA team is delivering PHP 5.3+ friendly forks of existing packages
voice your opinion now!
pear migrate github package library update
|
Community Events
Don't see your event here? Let us know!
|