rand(Ø)

> beautiful code & photos

about <

Posts tagged: php

cURL: forward POST over HTTP redirections

Recently, I've been stuck on a Web service call that wouldn't be called as supposed to be. When having troubles with WS, it's very important to dump client request and server response.

Using cURL withing PHP, I couldn't understand why my code was building a POST request and cURL returned me a GET request instead when the URI was getting a 301 redirection.

Turned out that it was a configuration issue because the URI wasn't the right one. Thanks to the config team!

What cURL says

When curl follows a redirect and the request is not a plain GET (for

> Continue Reading

Wordpress to Ghost

Today For the past 2 weeks, I've been trying to move out from my beloved Wordpress blog to this new, shiny and hipsterish blog plateform called Ghost.

So, two big moves:

The longest part wasn't to have Ghost up and running but to import all my Wordpress shit into this baby's DB. Ha, a long story that involved automated and manual work.

Import WP data into Ghost

At first, I tried the Ghost Wordpress Plugin which exported well my WP data but I

> Continue Reading

PHP: Compile a PECL extension in 64 bits when your compiler runs 32 bits

At my job, I use a Solaris distribution as a development server and the package manager doesn't propose the Xdebug package so I need to use the PECL command, which is fine. But, the PECL manager uses the system compiler which compiles binaries with 32 bits flags although my LAMP stack is 64 bits linked.

No other choice to compile manually my extension and after a few hours of hell (yes, I'm not a C pro :cwy:), I found how to compile correctly my extension.

So, if one day you need to compile a PHP extension in a different architecture,

> Continue Reading

PHP: Utiliser l'autoloader de Composer avec Atoum

Chers amis Français, en ce temps de Forum PHP (que j'ai suivi de très loin — outre Atlantique), je suis en train de rédiger une documentation technique (et aussi un peu philosophique) sur l'implémentation de l'intégration continue au sein de ma boîte.

Comme je n'avais encore jamais utilisé Composer, ici l'occasion se présente bien et comme je souhaite apporter une French touch au boulot grâce à Atoum, j'ai décidé qu'on l'utilisera pour tester nos modules Magento :).

Le but de cet article est très simple : utiliser Atoum avec le loader de Composer en prenant compte d'une code source namespacé ou pas.

Composer

> Continue Reading

PHP: Projet Silex – Templating

Oula, si vous aviez cru que le projet était tombé à l'eau, et bien non. Très très occupé ces derniers mois car je vis maintenant à New York et j'ai pas vraiment eu le temps de rédiger. Ni de trop avancer d'ailleurs.
Mais me revoilà, j'ai pas mal bossé ces dernières semaines et le projet a beaucoup changé depuis la dernière fois mais il est maintenant abouti (enfin). Pour les fidèles (si il en a encore), on retrouve encore et toujours notre road map habituelle :

Road map du projet

  1. Pré-requis et architecture
  2. Configuration de Silex
  3. Jouons avec Silex
  4. Ecriture de
> Continue Reading

PHP: Wordpress Popular Posts for the current category

Hi folks!
For my work, I luckily had to hack a client Wordpress instance... I'm glad to reached 6 years of studies after my A-Level to finally be a Wordpress hacker.

Anyway, today, my client Wordpress uses the popular plugin Wordpress Popular Posts to display various popular posts on his website. The plugin allows to exclude certain categories if you want but doesn't allow to filter for only one specific category. I read in the plugin forum that the plugin developer has this feature in his to-do list...

If you need this feature by the current version (2.2.1)

> Continue Reading