Brian Moon/dev/hell Podcast Episode #5 (3.2.2012, 18:12 UTC)
I was privileged to be invited to be a part of the /dev/hell podcast this week. Thanks to Chris and Ed for having me on. Check it out. And subscribe to their podcast.
Link
Mayflower Blog - PHPZend Framework application.ini Cheat-Sheet (3.2.2012, 09:01 UTC)

With the release of Zend Framework 1.8 came the long awaited component for bootstrapping a Zend Framework application. Many different bootstrapping-solutions became obsolete with Zend_Application.


In the beginning of the framework most developers didn‘t give much thought on bootstrapping. Most of the initialisation work was done directly in index.php, the central starting point of the application. Teams often moved that bootstrapping code to a separate configuration script. The solution worked, but many people wanted a more standardised process for application initialisation.



Continue reading "Zend Framework application.ini Cheat-Sheet"
Link
PHP ClassesAnother Serious Security Bug on PHP 5.3.9 (3.2.2012, 05:59 UTC)
By Manuel Lemos
PHP 5.3.9 release was mostly meant to fix a security bug, but it introduced a new more serious bug. PHP 5.3.10 was just released to fix this issue.

Meanwhile Debian Linux maintainers decided to stop enabling the Suhosin extension by default. This extension is used by several Linux distributions to provide protection against present and future security bugs of PHP.

Read this article to learn more about the just fixed bug what you should do to avoid these security issues. You can also learn more what is the current PHP security status and the importance of the Suhosin extension to prevent PHP security problems.
Link
Sebastian BergmannPHP Summit in München (3.2.2012, 04:15 UTC)
PHP Summit

This blog posting is in German as the event it relates to is German-only.
Sorry for the inconvenience.

Bei allen PHP-Themen zählt nichts mehr als die Praxis. Deshalb bieten wir unsere Power-Workshops interaktiv und mit intensivem Praxisbezug an. Über die behandelten Themen entscheiden die Teilnehmer mit ihren konkreten Fragen. Anstelle von Frontalunterricht erleben sie die Entwicklung von neuem Code unmittelbar. Mit Augenzwinkern und Spaß erläutern Sebastian Bergmann, Arne Blankerts und Stefan Priebsch Entwicklungsmethoden und Tools und stellen Trends und Konzepte vor.

Der nächste PHP Summit findet im März in München statt. Und das sind die Workshops:

Update PHP: Neue Features und Technologien nutzen

Workshop von Sebastian Bergmann

PHP 5.3 und PHP 5.4 überzeugen im Programmieralltag durch eine Fülle relevanter Vereinfachungen. Lernen Sie die innovativen Features und geschickte Einsatzmöglichkeiten der neuen Versionen kennen. Entdecken Sie das Lösungspotenzial aktueller Technologien aus dem PHP-Umfeld (memcached, ZeroMQ …) für Ihre Fragestellungen.

Weg mit Strubbelcode: identifizieren – verbessern – vermeiden

Workshop von Sebastian Bergmann

Früher oder später wird unsauber geschriebener Code zum Ärgernis. Nicht nur für den, der ihn warten muss. Änderungen und Erweiterungen können im Extremfall den Code unwirtschaftlich machen. Lernen Sie schlechten Code durch statische Codeanalyse aufzufinden und in test- und wartbaren Code umzuschreiben. Lernen Sie mithilfe der SOLID-Prinzipien, nachhaltig wartbaren Code zu schreiben.

Best Practices – aus dem Alltag für den Alltag

Workshop von Arne Blankerts

Natürlich könnte man das Rad jeden Tag neu erfinden. Meist fehlt dafür die Zeit, Spaß macht es auch nicht und Fehler können sich so immer wieder an denselben Stellen einschleichen. Für die vielen alltäglichen Probleme, die nur geringfügig von schon vorhandenen Lösungen abweichen, gibt es clevere Ansätze, die das Leben leichter machen. In einer komplett vom Auditorium gesteuerten Live Session zeigt der Workshop dafür programmatische Konzepte und lädt zur Diskussion über Tools und klassische Fragestellungen ein.

Auf Fehler sicher vorbereitet sein

Workshop von Arne Blankerts

Programme und Webseiten enthalten Fehler. Immer. Sie werden sichtbar, wenn Benutzer falsche, ungültige oder unerwartete Eingaben machen, der Zugriff auf die Datenbank plötzlich unmöglich ist oder die Festplatte überläuft. Um solche und andere Probleme sicher abzufangen, gibt es verschiedene Ansätze, die hier vorgestellt und diskutiert werden. Wie man Exceptions richtig anwendet, warum ein eigener Error Handler hilfreich ist und dass Debugging viel mit Sicherheit zu tun hat, vermittelt der Workshop lebendig und anschaulich.

Objektorientierte Programmierung (OOP) in PHP I: Basiswissen

Workshop von Stefan Priebsch

Der Workshop klärt die Frage, was es mit der objektorientierten Programmierung eigentlich auf sich hat. Jenseits der bekannten Standardbeispiele führt er praktisch in die OOP mit PHP ein. Dabei werden neben den Grundlagen und zentralen Prinzipien der OOP interessante Features beispielsweise aus der Standard PHP Library (SPL) vorgestellt und ihr sinnvoller Praxiseinsatz vorgeführt. Neben Faktenwissen wird eine Denkweise vermittelt, die es erlaubt, unnötig komplizierte Ansätze von vornherein zu umgehen.

Objektorientierte Programmierung (OOP) in PHP II: Aufbauwissen

Workshop von Stefan Priebsch

Der Workshop zeigt Teilnehmern, die mit den Grundlagen der OOP vertraut sind, fortgeschrittene Techniken wie Dependency Injection, abstrakte Klassen, Interfaces und Best Practices für erfolgreiche OOP. Eine Live-Coding-Session macht den Einsatz der vorgestellten Techniken in der Praxis erfahrbar. Außer Faktenwissen zeigt der Workshop, dass gute Lösungen einfache Lösungen sind: Einfache Objekte sind leichter wieder zu verwenden und vermeiden Fehler.

PHP-Anwendungen testen: Basiswissen

Workshop von Sebastian Bergmann

Der Workshop vermittelt grundlegende Kenntnisse und Fähigkeiten im Einsatz von PHPUnit bei Unit Tests, Datenbank-Interaktionstests, Edge-to-Edge- Tests und End-to-End-Tests. Sie lernen alles, was Sie über das Schreiben, Ausführen und Organisieren von Unit Tests mit PHPUnit beherrschen müssen.

PHP-Anwendungen testen: Aufbauwissen

Workshop von Sebastian Bergmann

PHPUnit clever einsetzen: Die Teilnehmer lernen die besten Praktiken beim Einsatz von PHPUnit und erprobte Strategien bei der Einführung von Testmaßnahmen an vorhandener So

Truncated by Planet PHP, read more at the original (another 6664 bytes)

Link
Brandon SavageExcited About PHP Again (3.2.2012, 03:23 UTC)
Ten months ago when I started at Mozilla, I began transitioning away from PHP and into Python and Django. This was inevitable: the Mozilla Webdev team favors Python over PHP in almost every webapp (Socorro is the critical exception). However, over time I had become disillusioned with the direction that PHP was taking. The project [...]
Link
Rafael DohmsDMS\Filter Library 1.0.1 and Bundle (2.2.2012, 22:08 UTC)

The past weeks I finally had some time to invest in the DMS library again, so i got busy with a few things. I also had to fix a big problem which had gone unnoticed to me, so i have to thank Mr. Guilherme Blanco for pointing it out.

Sadly this means a BC break, so please follow and make adjustments.

The BC break: ->filter() becomes ->filterEntity()

The reasoning here is simple, PHP still supports legacy from PHP4 meaning a function with the same name as the class is understood as a constructor. This generates a few nasty notices, and it made enough sense to rename the function, making it clear like the other ones.

The DMSFilterBundle

Along with this i had time to work on building a Bundle so you can plug filtering into Symfony 2 just as you would with validation.

Composer support

This bundle is also available on Packagist, making it easy to install, i'll also add the DMS and Filter library as standalones to this soon.

Tags

I finally tagged the releases as 1.0, or rather 1.0.1 as i quickly found a few fixes to put in.

The rest remains, here are the links:

DMS Library: github

DMS Filter Library (sub-tree split): github

DMS Filter Bundle (sub-tree split): github | packagist/composer | knpbundles page (please recommend it if you like it)


© Rafael Dohms for Rafael Dohms, 2012. | Permalink | No comments
Want more on these topics ? Browse the archive of posts filed under PHP.

Link
PHP: Hypertext PreprocessorPHP 5.3.10 Released! (1.2.2012, 23:00 UTC)
The PHP development team would like to announce the immediate availability of PHP 5.3.10. This release delivers a critical security fix.Security Fixes in PHP 5.3.10:Fixed arbitrary remote code execution vulnerability reported by Stefan Esser, CVE-2012-0830.All users are strongly encouraged to upgrade to PHP 5.3.10.For source downloads please visit our downloads page, Windows binaries can be found on windows.php.net/download/.
Link
John MerticHey Delta, is it this hard to find an iPad? (1.2.2012, 21:14 UTC)

So this post is a bit of a rant more than anything, so for the three regular readers of this blog feel free to skip over this post. I promise to make this foray a brief one.

I made a blunder on my flight home from Atlanta to Akron/Canton Airport a few weeks ago; I left my lovely, SugarCRM logo and my name engraved iPad safely in it’s case in the seat pocket of seat 3A. D’oh!

I realized this the moment I got home, and being a bit of a snow storm decided it not prudent to risk life and limb to return to the airport. Calling the airport informing them of this, they took my name and number as said they would ask the Delta desk about this. Being my self driven self, I started tracing the plane, and saw it was doing a CAK-ATL-CAK-ATL-OMA run that day, so figured it would end up in one of CAK, ATL, or OMA ( Omaha for those who aren’t as familiar with airport codes ).

So I went back to the airport at CAK, and they didn’t have it ( but had another iPad someone lost on a plane ), and called OMA, which didn’t see it either. My guess is that it’s in ATL, but low and behold, THERE IS NO NUMBER TO CALL ABOUT DELTA LOST AND FOUND AT ATLANTA. That’s right, nobody to call and ask, nor anyone I could be transfered to that will call there and ask. What do they want you to do? Fill out a web form and hope for the best. Which I did, and all I am left with is hope :-( .

So my call to the blogosphere and twittersphere is this: short of going down to Atlanta and stalking the Lost and Found desk, who can I call to help me.


Link
PHP ClassesMicroPHP vs Complicated PHP - Lately in PHP podcast episode 20 (1.2.2012, 10:54 UTC)
By Manuel Lemos
Earlier in January Ed Finkler announced the MicroPHP manifesto. It seems to be a rant about against the practices of developers that make PHP development more complicated than it should be. This is one of the main topics discussed by Manuel Lemos and Ernani Joppert in the episode 20 of the Lately in PHP podcast.

They also discuss the final release of PHP 5.4.0 and whether you should upgrade it or not, the repercussion of the PHP Hash Collision Vulnerability, as well the trends of PHP world based on the analysis of the PHP Zeitgeist 2011 initiative.

Listen to the podcast or read the transcript now to learn more in detail about these interesting PHP topics.
Link
Lorna MitchellBuilding a RESTful PHP Server: Output Handlers (1.2.2012, 08:15 UTC)

This is the third installment in my series about writing a RESTful web service in PHP (the previous entries are about understanding the request and routing it. It is probably the last one but there are a few other things I'd like to cover such as error handling, so I might keep adding to it, especially if I get any particular requests or interesting questions in the comments. So far we've covered parsing requests to determine exactly what the user is asking for, and also looked at routing to a controller to obtain the data or perform the action required. This post gives examples of how to return the data to the client in a good way.

Output Handlers Instead of Views

We'll have as many output handlers as we have supported output formats. The joy of having all the controllers return the data to index.php is that we can then add common output handling to all the data. In our example system, we can remove that ugly print_r from index.php and instead detect which output format is needed and load the relevant view. My code looks like this:

    $view_name = ucfirst($request->format) . 'View';
    if(class_exists($view_name)) {
        $view = new $view_name();
        $view->render($result);
    }

The most simple example is a JsonView which looks like this:

 
class JsonView extends ApiView {
    public function render($content) {
        header('Content-Type: application/json; charset=utf8');
        echo json_encode($content);
        return true;
    }
}

As you can see here, it's pretty simple! We send the Content-Type header first to let the consumer know what's in the response, then we just encode the JSON and echo it out.
To support other formats, you might loop over your array (remember it might be nested – things usually get recursive at this point for something like an XML format) and transform it into the new format. Between two PHP systems, it might be simpler to support s

Truncated by Planet PHP, read more at the original (another 2815 bytes)

Link
LinksRSS 0.92   RDF 1.
Atom Feed   100% Popoon
PHP5 powered   PEAR
ButtonsPlanet PHP   Planet PHP
Planet PHP