Install PHPunit on Ubuntu

Install the package

sudo apt-get install phpunit

Upgrade PEAR

sudo pear upgrade pear

Install all the dependencies

sudo pear channel-discover pear.phpunit.de
sudo pear channel-discover components.ez.no
sudo pear channel-discover pear.symfony-project.com
sudo pear install --alldeps phpunit/PHPunit

Test

phpunit --version

update
If you have any problem you can try this:
http://stackoverflow.com/questions/9186000/call-to-undefined-method-php-codecoverage-filtergetinstance

Install MySQL Workbench on Ubuntu 12.04

download MySQL Workbench on http://www.mysql.com/downloads/mirror.php?id=406525#mirrors

wget https://launchpad.net/ubuntu/+archive/primary/+files/libzip1_0.9.3-1_i386.deb
sudo dpkg -i libzip1_0.9.3-1_i386.deb

64bits => https://launchpad.net/ubuntu/+source/libzip/0.9.3-1/+build/1728114/+files/libzip1_0.9.3-1_amd64.deb

This package (libmysqlclient16) was removed from 12.04 repos, so you need to grab the old one.

wget http://launchpadlibrarian.net/94563300/libmysqlclient16_5.1.58-1ubuntu5_i386.deb
sudo dpkg -i libmysqlclient16_5.1.58-1ubuntu5_i386.deb

64bits => http://launchpadlibrarian.net/94808408/libmysqlclient16_5.1.58-1ubuntu5_amd64.deb

sudo apt-get install python-paramiko python-pysqlite2 mysql-client mysql-common libctemplate0 libgtkmm-2.4-1c2a

now install MySQL Workbench

sudo dpkg -i mysql-workbench-gpl-5.2.38-1ubu1104-i386.deb

Output while running (PHP)

ob_start();
for($i=0; $i<3; $i++)
{
   echo 'printing...';
   echo str_repeat(' ', 65536); // set a minimum output
 
   ob_flush();
   flush();
   usleep(300000);
}

Reverse Engineer (Workbench, Doctrine, Symfony2) with annotation

Hi guys!!

First of all you need to create a data model on workbench and update your database

After your database is populated, run this:

php app/console doctrine:mapping:convert xml ./src/[YOUR/BUNDLE]/Resources/config/doctrine/metadata/orm --from-database --force

so run this:

php app/console doctrine:mapping:import [YourBundle] annotation

and this:

php app/console doctrine:generate:entities [YourBundle]

Schema update (Symfony2 + Doctrine)

php app/console doctrine:schema:update --force [--env="[ENV]"]

Generate Entities (Symfony2 + Doctrine)

php app/console doctrine:generate:entities [BUNDLE]/Entity/[ENTITY]

list assume-changed files on git

git ls-files -v | grep "^[[:lower:]]"

routine to backup / restore mysql database

mysqldump -u root --password=[PASSWORD] [DATABASE] --compact -R --skip-lock-tables --default-character-set=utf8 | gzip -c > /path/to/your/$(date +%Y-%m-%d_%H-%M-%S)backup.gz
gunzip -c /path/to/your/backup.gz | mysql -u [USER] --password=[PASSWORD] [-h HOST] [DATABASE] --default-character-set=utf8

FIX Symfony2 vendor management GIT clone error

rror: RPC failed; result=18, HTTP code = 200MiB | 20 KiB/sfatal: The remote end hung up unexpectedlyfatal: early EOFfatal: index-pack failedwarning: http unexpectedly said: ’0000′

edit ‘deps’ file

change http to https

i.e.:

[symfony]
git=http: ….

[symfony]
git=https: ….

adduser ubuntu

useradd -s /bin/bash -m -d /home/[USER] [USER]
Page 5 of 10« First...34567...10...Last »