Last active
September 12, 2016 05:37
-
-
Save textarcana/4679293 to your computer and use it in GitHub Desktop.
Sonar for PHP installation steps for CentOS 6. See also http://docs.codehaus.org/display/SONAR/Installing+PHP+Environment as well as my Pinboard bookmarks for Sonar installation: https://pinboard.in/u:noahsussman/t:sonar+install
This file contains hidden or 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
| #!/bin/sh | |
| # | |
| # rc file for Sonar | |
| # | |
| # chkconfig: 345 96 10 | |
| # description: Sonar system (www.sonarsource.org) | |
| # | |
| ### BEGIN INIT INFO | |
| # Provides: sonar | |
| # Required-Start: $network | |
| # Required-Stop: $network | |
| # Default-Start: 3 4 5 | |
| # Default-Stop: 0 1 2 6 | |
| # Short-Description: Sonar system (www.sonarsource.org) | |
| # Description: Sonar system (www.sonarsource.org) | |
| ### END INIT INFO | |
| /usr/bin/sonar $* |
This file contains hidden or 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
| # Sonar for PHP installation for CentOS 6 | |
| # See http://docs.codehaus.org/display/SONAR/Installing+PHP+Environment | |
| mkdir /var/sonar | |
| wget http://repository.codehaus.org/org/codehaus/sonar-plugins/sonar-runner/2.0/sonar-runner-2.0.zip | |
| unzip sonar-runner-2.0.zip | |
| export SONAR_RUNNER_HOME=/var/sonar/sonar-runner-2.0 | |
| /sbin/service mysqld start | |
| sudo /usr/bin/mysql_secure_installation | |
| # for non-production instances, choose not to create a root password | |
| wget --no-check-certificate https://raw.github.com/SonarSource/sonar/master/sonar-application/src/main/assembly/extras/database/mysql/create_database.sql | |
| mysql -u root -p < create_database.sql | |
| # edit /var/sonar/sonar-runner-2.0/conf/sonar-runner.properties | |
| # and uncomment the lines pertaining to mysql | |
| pear channel-discover pear.phpunit.de | |
| pear channel-discover pear.symfony-project.com | |
| pear install phpunit/PHPUnit-3.5.5 | |
| yum -y install php-devel | |
| pecl install xdebug | |
| # edit /etc/php.ini and add this line: | |
| # zend_extension="FULL_PATH_TO/xdebug.so" | |
| pear channel-discover pear.pdepend.org | |
| pear install pdepend/PHP_Depend-1.0.3 | |
| pear channel-discover pear.phpmd.org | |
| pear install --alldeps phpmd/PHP_PMD-1.3.2 | |
| pear install PHP_CodeSniffer-1.3.2 | |
| # Installing Sonar as a service. | |
| # See http://docs.codehaus.org/display/SONAR/Running+Sonar+as+a+Service+on+Linux | |
| # | |
| # copy the etc_init_d_sonar file from this repo, to /etc/init.d/sonar | |
| ln -s /var/sonar/sonar-runner-2.0/bin/sonar-runner /usr/bin/sonar | |
| chmod 755 /etc/init.d/sonar | |
| chkconfig --add sonar | |
| # check out a PHP project and copy the sonar-project.properties file | |
| # from this repo into the root of the php project directory. | |
| # | |
| # See https://github.com/SonarSource/sonar-examples/tree/master/projects/languages/php/php-sonar-runner |
This file contains hidden or 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
| # Required metadata | |
| sonar.projectKey=org.codehaus.sonar:php-sonar-runner | |
| sonar.projectName=PHP project analyzed with the Sonar Runner | |
| sonar.projectVersion=1.0 | |
| # Comma-separated paths to directories with sources (required) | |
| sonar.sources=. | |
| # Language | |
| sonar.language=php | |
| # To deactivate features related to unit tests execution and coverage | |
| sonar.dynamicAnalysis=false | |
| # Encoding of the source files | |
| sonar.sourceEncoding=UTF-8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment