<commit_before>include_recipe 'nginx'

package 'php5-fpm' do
  action :install
end

service 'php-fpm' do
  service_name node['php-fpm']['service_name']
  supports :status => true, :restart => true, :reload => true
  action [:enable, :start]
end

include_recipe 'php-fpm::default'

service node['php-fpm']['service_name'] do
  action :start
end

node['deploy'].each do |application, deploy|

  if deploy[:application_type] != 'php'
    Chef::Log.debug("Skipping web application #{application} as it is not a PHP app")
    next
  end

  nginx_web_app application do
    template 'php-fpm-site.erb'
    cookbook 'npf'
    application deploy
    docroot deploy[:absolute_document_root]
    server_name deploy[:domains].first
    php_fpm_service_name node['php-fpm']['service_name']
    php_fpm_pools node['php-fpm']['pools']
    domain_pools deploy[:domain_pools]
    unless deploy[:domains][1, deploy[:domains].size].empty?
      server_aliases deploy[:domains][1, deploy[:domains].size]
    end
    ssl_certificate_ca deploy[:ssl_certificate_ca]<commit_msg>Get php5-fpm service name right<commit_after>include_recipe 'nginx'

package 'php5-fpm' do
  action :install
end

include_recipe 'php-fpm::default'

service node['php-fpm']['service_name'] do
  supports :status => true, :restart => true, :reload => true
  action [:enable, :start]
end

node['deploy'].each do |application, deploy|

  if deploy[:application_type] != 'php'
    Chef::Log.debug("Skipping web application #{application} as it is not a PHP app")
    next
  end

  nginx_web_app application do
    template 'php-fpm-site.erb'
    cookbook 'npf'
    application deploy
    docroot deploy[:absolute_document_root]
    server_name deploy[:domains].first
    php_fpm_service_name node['php-fpm']['service_name']
    php_fpm_pools node['php-fpm']['pools']
    domain_pools deploy[:domain_pools]
    unless deploy[:domains][1, deploy[:domains].size].empty?
      server_aliases deploy[:domains][1, deploy[:domains].size]
    end
    ssl_certificate_ca deploy[:ssl_certificate_ca]
{'fraction_non_alphanumeric': 0.12849435998038253, 'fraction_numerical': 0.0034330554193231977, 'mean_word_length': 4.811965811965812, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '2084975', 'n_tokens_mistral': 696, 'n_tokens_neox': 674, 'n_words': 155}