Created
August 11, 2011 18:59
-
-
Save pjkelly/1140447 to your computer and use it in GitHub Desktop.
Installing PHPUnit via Pear on Ubuntu Lucid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Uninstall any pre-existing packaged | |
# versions of phpunit | |
sudo apt-get remove phpunit | |
# Install pear via apt-get | |
sudo apt-get install php-pear | |
# Update existing pear channels | |
sudo pear channel-update pear.php.net | |
# Upgrade all existing pear elements | |
sudo pear upgrade-all | |
# Discover channels necessary to install | |
# PHPUnit and its dependencies | |
sudo pear channel-discover pear.phpunit.de | |
sudo pear channel-discover pear.symfony-project.com | |
sudo pear channel-discover components.ez.no | |
# Force install of HTTP_Request2 because it's | |
# currently in RC status and pear won't install | |
# those by default | |
sudo pear install -f HTTP_Request2-2.0.0RC1 | |
# Install PHPUnit | |
sudo pear install -a phpunit/PHPUnit-3.5.14 | |
# Check to see if everything's cool. | |
phpunit --version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def phpunit | |
package "phpunit", :ensure => :absent | |
package "php-pear", :require => package('php5') | |
exec "pear-channel-update", :command => "sudo pear channel-update pear.php.net", :require => package("php-pear") | |
exec "pear-upgrade-all", :command => "sudo pear upgrade-all", :require => exec("pear-channel-update") | |
required_channels = %w(pear.phpunit.de pear.symfony-project.com components.ez.no) | |
required_channels.each do |channel| | |
exec "pear-discover-#{channel}", :command => "sudo pear channel-discover #{channel}", :require => exec("pear-upgrade-all") | |
end | |
exec "pear-install-http-request2", :command => "sudo pear install -f HTTP_Request2-2.0.0RC1", :require => required_channels.collect { |channel| exec("pear-discover-#{channel}") } | |
exec "pear-install-phpunit", :command => "sudo pear install -a phpunit/PHPUnit-3.5.14" | |
end |
sudo pear install -a phpunit/PHPUnit-3.5.14
Duplicate package channel://pear.phpunit.de/File_Iterator-1.3.3 found
Duplicate package channel://pear.phpunit.de/File_Iterator-1.3.2 found
install failed
Any help?
sudo pear install -a phpunit/PHPUnit-3.5.14
Duplicate package channel://pear.symfony-project.com/YAML-1.0.6 found
Duplicate package channel://pear.symfony-project.com/YAML-1.0.2 found
install failed
Any suggestions..?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Now this is a lifesaver...