<commit_before>module Travis
  module Build
    class Script
      class Php < Script
        DEFAULTS = {
          php:      '5.5',
          composer: '--no-interaction --prefer-source'
        }

        def export
          super
          sh.export 'TRAVIS_PHP_VERSION', version, echo: false
        end

        def setup
          super
          sh.cmd "phpenv global #{version}", assert: true
        end

        def announce
          super
          sh.cmd 'php --version', timing: true
          # sh.cmd 'composer --version', timing: true unless version == '5.2'
          sh.cmd 'composer --version', timing: true unless config[:php] == '5.2'
        end

        def before_install
          # sh.if '-f composer.json' do
          #   sh.cmd 'composer self-update', fold: 'before_install.update_composer'
          # end
        end

        def install
          # sh.if '-f composer.json' do
          #   directory_cache.add('~/.composer') if data.cache?(:composer)
          #   sh.cmd "composer install #{composer_args}".strip, fold: 'install.composer'
          # end
        end

        def script
          sh.cmd 'phpunit'
        end

        def configure
          super
          if config[:php] == 'hhvm'
            echo 'Modifying HHVM init file', ansi: :yellow
            ini_file_path = '/etc/hhvm/php.ini'
            ini_file_addition = <<-EOF
date.timezone = "UTC"
hhvm.libxml.ext_entity_whitelist=file,http,https
            EOF
            raw "sudo mkdir -p $(dirname #{ini_file_path}); echo '#{ini_file_addition}' | sudo tee -a #{ini_file_path} > /dev/null"
          end
        end

        def cache_slug
          super << "--php-" << version
        end
<commit_msg>hhvm init fix was missing some sh<commit_after>module Travis
  module Build
    class Script
      class Php < Script
        DEFAULTS = {
          php:      '5.5',
          composer: '--no-interaction --prefer-source'
        }

        def export
          super
          sh.export 'TRAVIS_PHP_VERSION', version, echo: false
        end

        def setup
          super
          sh.cmd "phpenv global #{version}", assert: true
        end

        def announce
          super
          sh.cmd 'php --version', timing: true
          # sh.cmd 'composer --version', timing: true unless version == '5.2'
          sh.cmd 'composer --version', timing: true unless config[:php] == '5.2'
        end

        def before_install
          # sh.if '-f composer.json' do
          #   sh.cmd 'composer self-update', fold: 'before_install.update_composer'
          # end
        end

        def install
          # sh.if '-f composer.json' do
          #   directory_cache.add('~/.composer') if data.cache?(:composer)
          #   sh.cmd "composer install #{composer_args}".strip, fold: 'install.composer'
          # end
        end

        def script
          sh.cmd 'phpunit'
        end

        def configure
          super
          if config[:php] == 'hhvm'
            sh.echo 'Modifying HHVM init file', ansi: :yellow
            ini_file_path = '/etc/hhvm/php.ini'
            ini_file_addition = <<-EOF
date.timezone = "UTC"
hhvm.libxml.ext_entity_whitelist=file,http,https
            EOF
            sh.raw "sudo mkdir -p $(dirname #{ini_file_path}); echo '#{ini_file_addition}' | sudo tee -a #{ini_file_path} > /dev/null"
          end
        end

        def cache_slug
          super << "--php-" << version
        end

{'fraction_non_alphanumeric': 0.10931174089068826, 'fraction_numerical': 0.003470213996529786, 'mean_word_length': 1.5832710978342046, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4487659', 'n_tokens_mistral': 1046, 'n_tokens_neox': 1009, 'n_words': 278}