There are one class that prints the results of the tests when you execute PHPUnit with a testsuite.

If you want, you can customize the way that you print it, setting the colors, the characters, the width, …

You have to create a class that extends “PHPUnit_TextUI_ResultPrinter”, and set that class in your phpunit.xml.

< ?xml version="1.0" encoding="UTF-8"?>
 
<phpunit ...
    printerClass = "MyResultPrinter"
    ...
>
 
    <testsuite name="Application">
        ...
    </testsuite>
</phpunit>

Leer el resto de la entrada »

In HTTP/1.1 definition, it exists a header called “Connection” that, if you define “close”, you are sending that the connection will be closed after completion of the response. The client will know that the response is complete if it know the response length.

The next code calculates the response length, and send the two headers needed to close the connection and continue the execution in the PHP script:

<?php
 
startOutputBuffer();
 
echo ('Text the user will see');
 
flushOutputBuffer();
 
sleep(30);
echo('Text user will never see');
 
function startOutputBuffer()
{
    ob_end_clean();
    ignore_user_abort();
    ob_start();
}
 
function flushOutputBuffer()
{
    $size = ob_get_length();
    header("Connection: close");
    header("Content-Length: $size");
 
    ob_end_flush();
    flush();
}

git logo 150x150 Git: Automated branch name in commit messagesThere are two hooks that maybe we will be interested to work in: prepare-commit-msg and commit-msg. In the Git directory, there is a “hooks” directory where you have to create the scripts that you want to execute in the hooks.
Leer el resto de la entrada »

Una presentación con solo 34 diapositivas, pero con mucho jugo.

servers 168x150 Serverstats: sistema de monitorizar servidores en PHPHacía tiempo que buscaba un sistema para monitorizar servidores y por fin he encontrado algo decente: Serverstats. El código fuente lo podéis ver en GitHub.

Leer el resto de la entrada »

Charla sobre la correcta configuración del servidor MySQL, como solucionar problemas comunes, explicación del funcionamiento interno, … Muy didáctico.
Leer el resto de la entrada »

wordpress error 150x150 Cómo retornar un 410 en WordPressBuscando por internet, he intentado encontrar una manera de devolver una cabecera 410 para algunas URLs en WordPress. Encontré 2 formas que no me han interesado: Leer el resto de la entrada »

A veces, se crea una rama en local y se sube a un repositorio remoto, pero no se crea el vínculo en el fichero .git/config.

Cuando se hace git pull, se muestra un mensaje como el siguiente:

[use@localhost project]$ git pull
You asked me to pull without telling me which branch you
want to merge with, and 'branch.f2572.merge' in
your configuration file does not tell me, either. Please
specify which branch you want to use on the command line and
try again (e.g. 'git pull  ').
See git-pull(1) for details.
 
If you often merge with the same branch, you may want to
use something like the following in your configuration file:
 
    [branch "f2572"]
    remote =
    merge = 
 
    [remote ""]
    url =
    fetch = 
 
See git-config(1) for details.

Para solucionar el problema, se puede editar el fichero .git/config y añadir los valores necesarios, o ejecutar el siguiente comando

git branch --set-upstream f2572 origin/f2572
Página 1 de 20123456...101520...Última »