WTF mysqli_stmt::bind_param aliasing violation

16. Januar 2013

1 Kommentar

I was searching for a class which supports multiple calls to mysqli_stmt::bind_param, because I have scenarios where I build huge SQL statements over different functions with variable numbers of parameters. But I didn’t found one. So I have just written up this little piece of code I would like to share with you. And for me it works. In doBindParam() it seems to depend from the PHP version if referenceValues() must be used or if $params can be used directly. Please note that reference is required for PHP 5.3 an higher. If won`t work using type-safe executing, than see here (http://bugs.mysql.com/bug.php?id=48284) for fixing your PHP and MySQL version. In my case I have to use it. Den ganzen Beitrag lesen.

¬ geschrieben von gjerokrsteski in PHP Tricks und Tipps

Contributing to PIMF via command-line

26. Oktober 2012

2 Kommentare

This tutorial explains the basics of contributing to a project on GitHub via the command-line. The workflow can apply to most projects on GitHub, but in this case, we will be focused on the PIMF project. This tutorial is applicable to OSX, Linux and Windows. This tutorial assumes you have installed Git and you have created a GitHub account. If you haven’t already, look at the PIMF on GitHub documentation in order to familiarize yourself with PIMF’s repositories and branches. Den ganzen Beitrag lesen.

¬ geschrieben von gjerokrsteski in PIMF

Enums in PHP

6. Juli 2012

4 Kommentare

Im PHP verwenden wir oft Konstanten, mehr als es uns lieb ist. Das ist aber ein Thema für einen anderen Artikel. Hier geht es eigentlich um definieren von Konstanten in einer Klasse und ums Prüfen dessen Gültigkeit. Ich habe diverse Artikel im Internet gefunden die dasselbe Thema bearbeiten und diverse Lösungen anbieten. Dabei habe ich Enum-Generatoren, Enum-Emulatoren so wie Micro-Frameworks für Enums gefunden und ausprobiert. Mal Ehrlich – das war mir viel zu kompliziert! Keine Frage – alle funktionieren ganz gut. Jedoch muss es doch viel einfacher gehen und auch mit viel weniger Code-Logic. Hier habe ich vier Lösungs-Beispiele aufgelistet – bin gespannt was ihr davon haltet. Wie implementiert ihr Enums? Den ganzen Beitrag lesen.

¬ geschrieben von gjerokrsteski in PHP Tricks und Tipps

Objekte abrufen und mehrere Instanzen vermeiden

18. November 2011

13 Kommentare

Auf Englisch würde das etwa als „Retrieve objects avoiding multiple instances” geschrieben werden. Den Artikel habe ich auf Englisch verfasst, da ich von phpclasses.org gebeten wurde paar Zeilen Dokumentation zum Projekt „Building an Identity Map in PHP” zu schreiben. Das Projekt zeigt auf wie eine Identity-Map im PHP Projekt implementiert wird und was für Vorteile das Ganze mit sich bringt. So, ab heir ist der Artikel auf Englisch verfasst: The „Building an Identity Map in PHP” package can store and retrieve objects in persistent storage containers avoiding to have multiple instances of the same object in memory. It can use a mapper class to store objects of a class in a container like for instance a database table. It can also retrieve the objects from the container assuring that only one instance of the same object is retrieved into memory. Den ganzen Beitrag lesen.

¬ geschrieben von gjerokrsteski in PHP Tricks und Tipps

Powered by Wordpress • Abonniere den RSS Feed