User loginNavigation |
PHP DeveloperSocialGeek.be: Clean urls through readable slugs in PHPOn the SocialGeek blog there's a recent post that looks at making stubs for your URLs, making them easier to read and remember. This is where the fun begins of course. How many times have you been confronted with someone sending you an indecipherable, thus untrustworthy link? Right, so we agree that for a user, it is important to have a clean URL that is readable and includes the title of the page or (at least) some description related to the content. Slug time!They explain what slugs are (and how they're useful for users) as well as how to convert a title into a "slugged" string by replacing anything that's not an A-Z or 0-9 character to remove the less URL friendly characters. Categories: php
FliquidStudios.com: Introduction to using Google's search APIThe Fliquid Studios site has posted their introduction to using the Google Search API via a cURL interface in PHP. A lot of people these days use 3rd party sites or services to gain SEO data about their site or service. A lot of these people simply do not realize just how simple it is to build some tools to gain statistics from the big search engines. In this post I plan to give you a very basic introduction on how to go about getting some search engine statistics from Google using their API.They show how to create the connection (including the URL to search on) and a form that can be used to submit the terms back to the script. A demo and downloadable code are included. Categories: php
php|architect's C7Y: Schedule and Free Webcast SeriesThe php|architect crew have officially posted their schedule for this year's php|tek conference (May 2009) and have announced a free webcast series on a range of PHP subjects. We're happy to finally announce the schedule for php|tek 2009'"a bit late, we know, but with 250 proposals to sort and rank, it was tough work! In addition, we are also introducing a series of free webcasts on a wide range of topics relevant to the PHP world to keep all of us busy while we wait for the conference, culminating with Marco Tabini's opening keynote, live from Chicago at 9:00 on May 22.You can find out more about the conference from its website and more on the webcasts (and to sign up) here. Categories: php
DevShed: Polishing the Visual Presentation of a Blogger with the Code Igniter PHP FrameworkDevShed has posted the fifth part of their series looking at CodeIgniter and its use to make a simple blogging application. The focus this time is on the output, working with the views to "pretty up" the resulting pages. Although in its current state, the blogger works well, its visual presentation looks pretty primitive. Therefore, in this fifth part of the series I'll be adding some CSS styles to the view files that comprise this blog application to improve its look and feel.They start with a review of the code so far - a simple blogging app with the ability to let users comment on each entry. The HTML and CSS you'll need to add to the views to make the output look more like this. Categories: php
Johannes Schluter's Blog: Goto your Christmas presents with PHP 5.3Johannes Schluter recently looked at one of the new features coming with PHP 5.3 - the goto functionality: Over the last few days I already mentioned a few hidden gems from PHP 5.3. Now at Christmas I wanted to take a look at some new language feature of the upcoming PHP version: Added "jump label" operator (limited "goto"). (Dmitry, Sara)No, its not the sort of "goto" you're thinking of - its a bit more limited than that. Johannes mentions that it only allows you to jump within the same execution unit and you can't jump into loops. Used incorrectly, it can be bad but he points out two useful instances - one being a code generator and the other an instance where you might need to drop out of code but not kill off the script in the process (sample code is included for this second one). Categories: php
Doug Brown's Blog: Difference between ASP and PHPIn this recent post to his blog Doug Brown spends a little time comparing (at a high-level) some of the differences between ASP and PHP. The difference between PHP and ASP is that ASP is a Microsoft product based on visual basic syntax whereas PHP has C and Java based syntax. ASP works better on Microsoft servers.He describes the target audience for each language and talks about the environments that they work best in as well as some general statements about their speed and flexibility. Basing his judgment on the facts he noted, he suggests PHP as the best alternative of the two for being more flexible, running in more places and being a bit faster overall. Categories: php
Johan Mares' Blog: Running PHP CLI shell scriptsJohan Mares has a recent post about using PHP on the command line: I already knew how to run PHP scripts from the command line (CLI), although I never really used it. What was new to me was that there are 2 ways of doing this. The first one is by using the php command and the second, and new for me, is by adding a shebang on the first line of your script.His first way is to run the PHP file through the interpreter directly (via a command line call to something like "php myfile.php"). The second it to actually include the path to the interpreter inside the PHP file itself and use the shell to execute the contents based on that (adding something like "#!/path/to/php" at the top). Then you just make the file executable and you can run it like any other binary file. Categories: php
Dave Marshall's Blog: Competition: PHP Job Hunters Handbook up for grabsDave Marshall is having a contest to give away a few copies of the "Job Hunter's Handbook" (by Michael Kimsal) - all you need to do is sign up: I've got a couple of copies of Php|architect's PHP Job Hunter's Handbook to give away, the only catch is you have to sign up to PHPPositions' feed via email. It's managed by Feedburner, so it can be trusted and you wont get any spam, just super smashing great php jobs in the UK.If you'd like to find out more about the book (or to order your own copy), head over to the book's page on the php|architect website. Normal price is $27 CAD for Print/PDF and just $23 CAD for the PDF. Categories: php
Robert Basic's Blog: Login example with Zend_AuthRobert Basic has posted an example of the use of the Zend_Auth component of the Zend Framework inside of an example controller. So, here's what I'm going to do: authenticate an user against a database table using Zend Framework's Zend_Auth component. It's really a piece of cake. You can see a working example here: http://robertbasic.com/dev/login/.He sets up a registry instance, a database table for the logins and the sample controller with both login and logout functionality. Complete code (and links to Zend Framework documentation are included). Categories: php
Jani Hartikainen's Blog: Decoupling models from the database: Data Access Object pattern in PHPIn this new post to his blog Jani Hartikainen looks at implementing the Data Access Object pattern in your PHP applications. The advantage of this is that you can easily implement different methods to persist objects without having to rewrite parts of your code. I'm again going to use the programming language quiz game I wrote as an example. Since I initially wrote it to use Doctrine ORM directly, and both the old and new code are available, you can easily see how the code was improved.He starts off with a look at the pattern itself (including a diagram of how an example would work with Doctrine) followed by the creation of the models for his Questions example. Add in the factory to create an instance and an exmaple of it in action and you're there. Categories: php
Community News: Eli White is Zend's New "Community Guy"According to this new post on his blog, Eli White has taken over the post of "community guy" at Zend (a post previously held by Cal Evans). I've been offered a position at Zend, and accepted it. The official (lengthy) job title is Zend Community Manager/Leader & DevZone Editor-In-Chief. The short form to many people would be: "The job formerly held by Cal Evans" I'm extremely excited about this opportunity to work with Zend and to have the focus of my daily job to be working with the PHP community which I dearly love. I know that any attempt to fill Cal's shoes will be met with failure, so I hope instead to come up with my own twist on the position and to give it my best.He'll be acting as the liason between the PHP company and the rest of the community including writing articles, doing some podcasting and all around getting in the middle of whatever's going on in the PHP community. Congrats Eli! Categories: php
eZ Components: Version 2008.2 ReleasedThe eZ Components project has release their latest stable version - 2008.2 - for public consumption today: The development team is happy to announce the release of the seventh major version of eZ Components: version 2008.2. The main new development of this release is focused on the MvcTools (and accompanying) components.The MvcTools component implements the tools for a framework, providing a dispatcher, request parsers, routing, view support and a response writer. Examples of its use can be found in the subversion repository for the project. You can see the full Changlog for the release here and you can download the latest release here. Categories: php
Derick Rethans' Blog: Five reasons why the shut-op operator (@) should be avoidedDerick Rethans has posted just a few of the reasons why the "shut-up operator" (the @ symbol) should be avoided at all costs in your PHP applications. The @-operator is often used to silence errors in noisy PHP functions'"functions that generate warnings that can not be easily prevented. [...] In those cases, there is no way how to check up-front whether the function call will not issue a warning when being called.There are side effects to using the operator, however, including hiding legitimate errors and making debugging that much more difficult. To back up his point, he includes four other reasons to avoid the operator's use (besides the debugging issues):
Categories: php
Michelangelo van Dam's Blog: Mapping Seven ThingsSince the Seven Things meme has been charging its way through the members of the PHP community (and some outside it), it's hard to keep track of who is tagging who and if those people have posted their "seven things" and tagged others. Michelangelo van Dam has tried to make things easier with his "Who Tagged Who" map mini-application that crawls through the posts looking for others who were tagged. Trying to get a bit of overview of all people who have put up their "Seven Things" list, I created a little map that shows who tagged who with an overview of the most tagged persons.You can also grab the XML source file if you'd like to manipulate it yourself. Categories: php
Ian Selby's Blog: Dynamically Add Functions to PHP ClassesIan Selby has posted a new tutorial today looking at something that can be very handy in the right situations - dynamically adding new functions to an already defined PHP class. I've gotten a lot of great suggestions for features [for PHP Thumbnailer], and have wanted to add them, but at the same time don't as I would prefer not to bloat the class with all sorts of functionality. So I started thinking about how I could provide certain functionality for people that want it, without either simply making it a part of the class (and making it more bloated as a result), or coming up with all sorts of extended classes to maintain and distribute.His solution was to add functionality dynamically to the class as plugins. Each plugin is defined as its own class (to keep things standardized) and will be included/executed by a base controller class. He includes some sample code showing how to create a basic user object that can store the first and last names of the user in question. Categories: php
Sameer Borate's Blog: Refactoring 1: Consolidating Conditional ExpressionsSameer has posted the first article in his "Refactoring" series today - a look at boiling down conditional expressions to only the logic that are really needed (and maybe replacing it all together). Many times you see a group of conditionals where the returned values are the same. To make the code cleaner you can group the conditionals together using the '&&' or the '||' operators and then extract the code into a separate function. This also has the added benefit that you can reuse the extracted method in other places where the required conditional goes.He shows how abstracting out a file upload permissions check to another function makes it easier to reuse and simpler to understand (an "if" versus multiple "return" statements). Categories: php
Chris Hartjes' Blog: CakePHP Mythbusters!In an effort to dispel some of the rumors and myths around the CakePHP framework (as presented most recently by a different blogger) Chris Hartjes has made a new "mythbuster" post to his blog today with a rebuttal to the points from the other article. I ran across an article comparing CakePHP and Symfony and found that the writer had a number of preconceived ideas about CakePHP. These same ideas keep popping up everywhere, used by people looking to get their hate on about CakePHP. I sent a very well-reasoned email to the writer clearing up some of those misconceptions [...] So, in the interest of clarifying things about CakePHP I thought I would share that email, slightly rewritten for this blog posting, but the content is roughly the same.The post/email covers a few different topics some might have misconceptions about concerning the framework:
Categories: php
PHPImpact Blog: Running PHP with Quercus in Jetty Web ServerThe PHP::Impact blog has a new post looking at how to run PHP on a Jetty (Java) web server using Quercus. Tomcat and Jetty are very similar. Jetty can be invoked and installed as a stand alone application server. It has a flexible component based architecture that allows it to be easily deployed and integrated in a diverse range of instances. The project is supported by a growing community. The Jetty team has a history of being responsive to innovations and changing requirements.They walk you through the "quick install" version of Jetty, getting it running, installing Quercus and configuring the Jetty web server to work with it. Categories: php
|