skip to main content.

posts about php.

it’s not the first time i’m annoyed by php, and surely not the last one. i’ve often called php an ad-hoc language, which is changed a lot and contains many inconsistencies. and often tends to break backwards compatibility. for example, i recently upgraded to php 5.3 (while upgrading the server; before, it was running 5.2 if i recall correctly). this instantly broke the openid server i’m using to login to mathoverflow. this was easy to fix, apparently some behaviour changed and i had to replace two or three lines of codes by almost identical ones to make it work again. now i stumbled about something else, while posting something new on blackness. namely, the member function setdate of the datetime object changed a little bit: on success, it no longer returns null, but the object itself. (in case of an error, it still returns false.) well, the blackness editor was expecting null to indicate success, and complained that the data was invalid. great.
i mean, its nicer to return the object (to allow cascadation, at least if one is sure no error occurs – otherwise one is screwed), but why just change this between two versions?! such changes make upgrading php a russian roulette: it might break your programs. and in many cases (like this), it might take you a long time to find out that your program is broken. and when you found out it’s broken, you have to search for the problem, identify it, only to find out that php just changed the rules a little bit. this is just bad. and yet another reason not to use php for anything serious.
(and a programming language not useable for anything serious is, well, to be bluntly: a big pile of crap.)

posted in: computer www
tags:
places:

as you might have noticed, musikwiese has its categories displayed as a tree. i did this using the wp-dtree plugin. this is pretty nice, and i thought that i might also be able to use it for spielwiese‘s archives list – after all, that list contains like 40 entries. so it would be nice to have a tree with the years as top-level nodes, which can be expanded to get a list of months. unfortunately, wp-dtree doesn’t do this. so i started programming myself, creating a small plugin which outputs the code wp-dtree should create to display such an archive. and, it seems to work fine! i also included a noscript fallback for people with disabled javascript; in that case, the “classical” archives will be displayed.
if you are interested in my plugin, ask me, and i will send it to you or maybe also upload it somewhere here.

while i was searching for a plug-in which allows access control to posts based on users and/or user groups, i stumbled about many different plug-ins, some of them very promising, but either dead, not updated for a long time, or simply not exactly usable by producing a long list of php error messages already in the admin screen after activating them. grrreat. well, of course, i could also try to do it myself, as usual. but hey, that sucks: i’d be better of writing my own blog software.
well, i talked about the problem a bit with kornel, and we concluded that an optimal blog system would be a very slim piece of software, just providing the very basic features, i.e. managing posts, comments and pages, users and user groups/roles/whatever, and access privileges, while everything else—such as galleries, embedding videos, gadgets, comfortable post editors, …—is implemented as plugins.
anyone want’s to do this, and produce a well-documented, slim, bug-free blog system with a good plugin interface, together with a few standard plugins? :)

just upgraded to newest ubuntu. upgrading went pretty smooth, smoother than i expected after last time’s experience. i tried the new visual effects (seeing this screenshot, i’m wondering why i didn’t had this custom choice), and disabled them after a few minutes. for me, most of them are too annoying (i’m switching between windows and desktops all the time). well. the user interface feels slower than before (even after deactivating the visual effects), but it’s still ok. the tracker is annoying, eating up system performance and it’s ignoring the preferences (which say: don’t run), but after deinstalling it, everything’s fine. for now.
now i have to find out how to install a local version of apache with php, and of mysql, to make working on my project a bit easier…

posted in: computer
tags:
places:

every time i plan to start a new project, let it be a web project, a programming job, a latex document (or a combination of those), i’m thinking hard on whether to use something already existing as a base or whether to do everything myself, from the scratch. for latex documents, i usually reuse macros i’ve written myself. for programs, i use libraries like opengl and zlib (two random names coming to my mind, there are of course a lot more), i reuse my own code, and write the rest from scratch. for this blog, i used wordpress, for usage statistics i use phpopentracker. and, of course, i use php and mysql as backends. even though i could implement the whole stuff myself. if i just would have enough time… but i don’t, and so i have to cope with all the restrictions, specialities, whatever these programs and libraries are throwing at me.
the reason why i’m thinking about this at the moment is a new project of mine i’m thinking about, which i’m planning to code more or less from the scratch (using, of course, some backend stuff like php, mysql, phpopentracker, you name it). i just started drawing some sketches, like its logical structure with hints on the physical implementation. sometimes i wonder whether i should spend more time on such things. despite there probably already exists a system which does exactly what i want, making one yourself is way more fun. although its also way more work.
let’s see if i manage to pull this one through… wish me luck.