Ulf Wendel

2007/07/30
by admin
2 Comments

PHP: mysqlnd and its tests

You want to run the mysqlnd tests, because you never trust anybody else test results? In particular you are getting sceptical if anybody claims to have reached a certain level of stability? Read on, here’s a step-by-step for faking your own test results.

New tests …

PHP extensions can test their userland (PHP) functionality using so called “phpt Tests”. phpt Tests consist of several parts with their main part being regular PHP code to test PHP. On the website of the PHP Quality Assurance Team you can find a documentation of the phpt Tests syntax on the page Writing Tests, if your are interested in the details. Most extensions contain a tests/ subdirectory in the PHP source code to ship the tests together with C code of the extensions. So do ext/mysql and ext/mysqli.


nixnutz@linux-eu6p:~/tmp/php6/ext/mysqli> tree
.
|-- CREDITS
|-- CVS
| |-- Entries
| |-- Repository
| `-- Root
|-- TODO
|-- config.m4
[...]
|-- php_mysqli_structs.h
`-- tests
|-- 001.phpt
|-- 002.phpt
|-- 003.phpt
|-- 004.phpt
[...]

Let’s see how the number of test has changed since the mysqlnd development has started. I do know that quantity does not say anything about quality in the Quality Assurance (QA) world but I cannot resist to present a table which shows how many new tests have been created.

Before mysqlnd Today
ext/mysql ext/mysqli ext/mysql ext/mysqli
# of tests loc # of tests loc # of tests loc # of tests loc
3 162 92 3.799 53 4.198 282 25.739

Take the above figures as what they are: an indicator how much time some people spend writing test code and trying to test mysqlnd properly.
Once again: quantity says nothing about quality, but the figures proof how hard we tried to prevent your test runs of mysqlnd to become a nightmare.

Continue Reading →

2007/07/29
by admin
1 Comment

PHP: What is mysqlnd, do I need it?

A blog comment from Ian makes me wonder if I failed to state clearly what mysqlnd is. See below for his comment. Ian, I am thankful for your blog comment and question! Probably you are not the only reader who needs a little more background knowledge about mysqlnd. Please allow me to answer your question in public and in depth. FAQ: What is mysqlnd, do I need it?.

The acronym “mysqlnd” stands for “MySQL native driver for PHP”. This pretty much says nothing to most people, I guess.

  • “native”: Is it written in PHP? No, that would be two slow. As you probably know, PHP itself is a program written in C. Therefore native means C and tightly integrated into PHP on the level of C. This is for sure a good thing as the driver can try to squeeze out the optimum of PHP.
  • “driver”: Is it a new programming API, a new PHP extension? No, there are already three (ext/mysql, ext/mysqli, PDO/MySQL) APIs and three extensions, there is no need for a new API or a new extension! mysqlnd is kind of a library that implements the MySQL low-level communication protocol. This library can be used by the existing extensions. Currently ext/mysql and ext/mysqli have been adopted to run both with libmysql and mysqlnd.
  • “for PHP”: This is not really new! You are correct. However, mysqlnd is published under the terms of the PHP license . Therefore, unlike with libmysql, there is no need for the FLOSS License Exception to make the license compatible with that of PHP. Some might recall the – partly heated – discussions about the exception and will love to hear about this.

So, what is mysql? For every old-time and hardcore PHP user a single sentence should explain it: mysqlnd is a replacement for libmysql, distributed under the terms of the PHP license and tightly integrated into PHP on the C-level.

Those of you who would not call themselves C-level PHP hackers, should read on.

Continue Reading →

2007/07/27
by admin
4 Comments

PHP: mysqlnd checked in to PHP 6 (HEAD)

Recently mysqlnd, the MySQL native driver for PHP, has been checked in to the PHP 6 (HEAD) development tree on cvs.php.net. This blog posting gives a quick overview how you can build PHP 5 and PHP 6 with mysqlnd support.

What mysqlnd is and what not

If you do not know what mysqlnd is or not is, read up the details on http://dev.mysql.com/downloads/connector/php-mysqlnd/. In short: mysqlnd is is a replacement for the libmysql, the MySQL Client Library. It it closely integrated into PHP and it is distributed under the terms of the PHP license. You can now compile ext/mysql and ext/mysqli to use the libmysql – just like in the past – or to use the new mysqlnd driver. Once again, note that mysqlnd is not a new programming API, but an alternative to libmysql which is used “under the hood”, on the C-level, to connect from PHP to the MySQL Server.

As explained earlier in the post PHP: Is mysqlnd stable? the versions of ext/mysql and ext/mysqli checked in to HEAD fail on considerable less test cases than the versions that have been in HEAD before. We encourage all users to try out mysqlnd. However, to be able to try it out, you obviously need to know how to compile it.

Compiling PHP 6 with mysqlnd enabled

Compiling PHP 6 with ext/mysql and ext/mysqli using mysqlnd on Unix is easy.

Continue Reading →

2007/07/23
by admin
Comments Off on PHP: Is mysqlnd stable?

PHP: Is mysqlnd stable?

Is mysqlnd stable, is mysqlnd ready for wider consumption? Judging from the latest set of tests: yes!

During the development of mysqlnd, the MySQL native driver for PHP – an alternative to libmysql, a good number of new tests have been written. Let’s see how ext/mysql and ext/mysqli perform when running the test suite. Please note that this is a snapshot and figures might be slightly different when you repeat the test runs: mysqlnd is under constant development and your setup is likely to differ from mine.

PHP 6 , MySQL 5.1.15-beta

ext/mysql
  Number of Tests Warned Failed Passed Code Coverage
HEAD @ libmysql 102 (+4 skipped) 0 0.0% 16 15.7 % 86 84.3 % 83.5 %
SVN @ libmysql 102 (+4 skipped) 0 0.0% 1 1.0 % 101 99 % 87.8 %
SVN @ mysqlnd 102 (+4 skipped) 0 0.0% 1 1.0 % 101 99 % 88.0 %
ext/mysqli
  Number of Tests Warned Failed Passed Code Coverage
HEAD @ libmysql 520 (+46 skipped) 2 0.4% 127 24.4 % 391 75.2 % 91.9 %
SVN @ libmysql 475 (+91 skipped) 2 0.4% 26 5.5 % 447 94.1 % 88.9 %
SVN @ mysqlnd 502 (+64 skipped ) 2 0.4% 16 3.2 % 484 96.4 % 91.6 %

Continue Reading →

2007/05/11
by admin
Comments Off on Autos verderben den Charakter und die Linie

Autos verderben den Charakter und die Linie

Früher hatte ich eine Mofa. Die fuhr 36 km/h Spitze, ungetunt. Ich war schlank und glücklich. Dann nahmen mir zwei der auf 25 km/h ausgelegten Fliehkraftkupplungen die 36 km/h übel und mir gingen die Ersatzteile aus. Die Kombination aus Zug und Schultaxi erreichte in der Spitze 170 km/h beim Ausliefern der Schulkinder. Diese Art des Transports benötigte aber etwa vier mal so lang wie die Mofa für die Wegstrecke zur Schule, da an jeder Milchkanne gewartet wurde.

Danach entdeckte ich, daß ein Fahrrad auch ohne spezielles Training eine Höchstgeschwindigkeit von 70 km/h und bequem 30 km/h pro Stunde schafft. Man mußte nur 12.000 km pro Jahr fahren, um in Form zu bleiben. Ich war schlank und glücklich.

  Jahreskilometer (km) Vmax (km/h) Typische Avg (km/h) Maximale Avg (km/h)
Mofa 6.000 36 32 36
Bikomane 12.000 70 28 45
Aktuell 593 53 22 25
Moped 20.000 180 80 120
Popel 32.000 179.999 80 140
Mietwagen 20.000 247 80 195

Continue Reading →

2007/05/08
by admin
Comments Off on Turbo-PHP oder Elektrosmok-Detektor

Turbo-PHP oder Elektrosmok-Detektor

Wer mal wissen möchte wie schnell sein Rechner mit PHP ist, der sollte sich einen drahtlosen Fahrradcomputer zulegen. Dieses Exemplar beweist: PHP 5.2.2RC3-dev schafft mühelos 79 km/h auf einem Notebook. Höchstgeschwindigkeiten bis 199,99 km/h wurden bereits beobachtet.

Trelock FC900 als Elektrosmok-Detektor

2007/05/08
by admin
Comments Off on PHP-Unconference in Hamburg: Gratulation!

PHP-Unconference in Hamburg: Gratulation!

Was die Norweger von eZ rund um Zak Greant können mit dem PHP-Vikinger, können wir allemal sagte sich die PHP-Usergroup Hamburg und veranstaltete eine PHP-Unconference vom 5.-6. Mai 2007 im Informatikum der Universität Hamburg, die dem letztjährigen PHP-Vikinger das Wasser reichen konnte. Gratulation an alle Helfer: das war Spitze!

Bewertungen der Teilnehmer

Cutting-Edge-Infos bei minimalen Kosten

Mit rund 50 Teilnehmern war die ausdrücklich als kleinere, lokale ausgelegte Veranstaltung so gut besucht wie die erste Ausgabe des internationalen PHP-Vikinger. Bedenkt man, daß der Vikinger im Anschluss an eine Firmenkonferenz veranstaltet wurde und sich einige Teilnehmer der Firmenkonferenz auch auf dem PHP-Vikinger wiederfanden, ist die Teilnehmerzahl um so bemerkenswerter.

Für eine Kostenumlage von gerade einmal 10,– Euro ohne Mittagessen bzw. 20,– inklusiv Mittagessen pro Tag ist es gelungen, eine erschwingliches Community-Veranstaltung zu organisieren, die sich nicht hinter einer kommerziellen Konferenz zu verstecken braucht. Dabei liegen die Teilnahmegebühren einer kommerziellen Konferenz mit oft 400,– Euro pro Tag um ein Vielfaches höher als bei einer Unconference. Ein Grund für die dramatischen Einsparungen besteht in der Schlankheit einer Unconference: statt im Konferenzhotel trifft man sich in einer öffentlichen Einrichtung, statt eines üppigen Hotelbuffets gibt es einfaches Essen aus einer Kantine wie es viele von uns an normalen Arbeitstagen gewohnt sind, statt eine Tourismusveranstaltung mit Freibier am Abend zu konsumieren ist Eigeninitiative gefragt.

Continue Reading →

2007/04/05
by admin
1 Comment

MySQL native driver for PHP: mysqlnd-5.0.1-beta available

Dear Developers,

we are proud to announce the beta version of the MySQL native driver for PHP: mysqlnd 5.0.1-beta. The software is available for download on http://dev.mysql.com/downloads/connector/php-mysqlnd.

The MySQL native driver for PHP is an additional, alternative way to connect from PHP 5 and PHP 6 to the MySQL Server 4.1 or newer. It is a replacement for libmysql, the MySQL Client Library. From now on you can use ext/mysqli either together with libmysql as you did in the past or with mysqlnd. The MySQL native driver for PHP can connect to MySQL Servers 4.1 or newer.

As stated before, we have no plans to remove libmysql support from ext/mysqli, which would break existing applications.

Changes

The 5.0.1-beta release covers the functionality of the libmysql beside some functions that are marked as experimental in the ext/mysqli documentation. The following additions have been implemented since the release of 5.0.0-alpha:

  • Support for Prepared Statements
  • Support for Unicode
  • Support for PHP 5
  • Performance statistics: mysqli_get_client_stats(), mysqli_get_connection_stats()

Please contribute to the development on the mailing list php@lists.mysql.com and share your ideas. See http://lists.mysql.com for details how to subscribe to the list.

Installation

Please check the download page on http://dev.mysql.com/downloads/connector/php-mysqlnd for Installation instructions.

2007/02/25
by admin
1 Comment

A smoldering pile of shit

Gibt es keine Notebooks mehr, die man noch kaufen kann, wenn Apple nicht in Frage kommt? Der berühmte Hersteller, den jeder Consultant lobt und dessen Geräte beinahe jeder Systemhändler als die führenden empfiehlt, hat keine andere Beschreibung verdient als “a smoldering pile of shit”. Hier ein kurzer Erfahrungsbericht zu von meinen bisherigen, privatem Compaq Evo N620c mit dem neuen Firmen-T60 nach zwei Tagen “Benutzung”.

  • Abmessungen (beide 14”): kein nennenswerter Fortschritt
  • Verarbeitung: kein nennenswerter Fortschritt
  • Akkuleistung: kein nennenswerter Fortschritt (2,5 Std.)
  • Tastatur: T60 fällt auf Dell Inspiron 4000 Niveau ab
  • Bildschirm: T60 ist kontrastreicher aber subjektiv auch blickwinkelabhängiger
  • Erstinstallation T60: keine Recovery-CDs, Tonnen von unnötigen Trialversionen (um die CPU-Power zu rechtfertigen), zwei Reklamationen (Bildschirm, WLAN)
  • Erstinstallation Compaq: überschaubare Menge Müll, Recovery-CDs
  • Händler T60: wer spart, darf später in Arbeitszeit für die Reklamationen/Neuinstallationen investieren
  • Händler Compaq: akzeptabel günstiger Händler um die Ecke, persönlich, hilfreich – am Ende soll ein Händler nur ausliefern und den 0-Pixelfehler Test machen, danach greift die Herstellergarantie
  • Service T60: am Ende der Computerfragen der kostenpflichtigen Hotline – Montag sind wir wieder da… – danke für den Business-Support
  • Service Compaq/HP: ein fremder Systemhändler in fremder Stadt wickelt kostenlos Reklamation der Sollbruchstelle am Netzteil für mich ab und hat Ersatz vorrätig. 2x Sollbruchstelle Netzteil – binnen 24h wird ein neues Netzteil zugesendet, 1x Plattentausch nach fast 3 Jahren binnen 1 Werktag – dank Backup keinerlei Datenverlust, bemerkenswert streßfreie Hotline

Mein nächstes privates Notebook wird kein Lenovo. Wenn HP dann wieder etwas wie das N620c in der Liste hat, warum nicht… – der “Compaq”-Service stimmte und das Gehäuse ist nicht schlechter als das der “IBM” T-Serie. Ansonsten frage ich mich ernsthaft wo man – selbst gegen Geld – noch ein gutes Notebook kaufen soll, wenn es kein Apfel sein soll. Dell fällt weg, weil es keine Händler gibt zu denen man im Notfall gehen kann, um nicht am nächsten Tag des Consultings wegen eines defekten Netzteils auszufallen: 1 Werktag Versandzeit kann verdammt lang sein. Was bleibt? Toshiba Tecra M?

2007/02/05
by admin
1 Comment

Future versions of mysqlnd to support PHP 5

Q: Will future versions of mysqlnd support PHP 5?
A: Yes, future versions of mysqlnd will support PHP 5.

However, currently we focus all our development efforts on implementing core functionality like Unicode support and support for Prepared Statements. The reason is that we do not want to be distracted by differences between PHP 5 and PHP 6 at the moment. Once the missing core functionality has been implemented, we will try to port mysqlnd to PHP 5. There is no time plan for PHP 5 support, but we see the need for it.

Thanks to both Ilia and Andi for pointing out that we had forgotten to explain our PHP 5 plans in the announcement of mysqlnd!