Customize ResultPrinter in PHPUnit
En: php
1 abr 2013There 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> |
- Sin comentarios
- Tags: phpunit
PHP: close connection and continue the execution
En: php
23 mar 2013In 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: Automated branch name in commit messages
En: git
13 feb 2013
There 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 »
- Sin comentarios
- Tags: git, hooks
Rendimiento y optimización de MySQL
En: mysql
25 oct 2012Una presentación con solo 34 diapositivas, pero con mucho jugo.
Serverstats: sistema de monitorizar servidores en PHP
En: php
21 oct 2012
Hací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.
- (1) Comentario
- Tags: server, Serverstats, servidor web
Optimización del rendimiento con MySQL
En: mysql
18 jun 2012Charla 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 »
- (1) Comentario
- Tags: mysql, optimización, performance
Cómo retornar un 410 en WordPress
En: wordpress
29 may 2012
Buscando 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 »
- Sin comentarios
- Tags: .htaccess, apache, http, wordpress
Git: vincular rama con repositorio remoto
En: git
26 abr 2012A 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 |
- Sin comentarios
- Tags: git
