<commit_before>include Chef::Provider::ApplicationPhpBase

def load_current_resource
  default_params = Mash.new(
    :database_driver => 'pdo_mysql',
    :database_host => 'localhost',
    :database_name => 'symfony',
    :database_user => 'symfony',
    :database_password => '<PASSWORD>',
    :mailer_transport => 'smtp',
    :mailer_host => 'localhost',
    :mailer_user => 'symfony',
    :mailer_password => '<PASSWORD>',
    :locale => 'en',
    :secret => 'CHANGEME'
  )
  new_resource.parameters Chef::Mixin::DeepMerge.merge(default_params, new_resource.parameters)
  new_resource.purge_before_symlink %w(app/cache app/logs app/sessions tmp)
  new_resource.symlinks.update(
    'cache' => 'app/cache',
    'logs' => 'app/logs',
    'sessions' => 'app/sessions',
    'tmp' => 'tmp'
  )
  new_resource.symlink_before_migrate.update(
    'parameters.yml' => 'app/config/parameters.yml'
  )
end

action :before_compile do
  %w(cache logs sessions tmp).each do |dir|
    directory ::File.join(new_resource.path, 'shared', dir) do
      owner new_resource.owner
      group new_resource.group
    end
  end
end

action :before_restart do
  
  execute "php app/console cache:clear" do
    cwd new_resource.release_path
    user new_resource.owner
  end
<commit_msg>Set recursive for directory creation<commit_after>include Chef::Provider::ApplicationPhpBase

def load_current_resource
  default_params = Mash.new(
    :database_driver => 'pdo_mysql',
    :database_host => 'localhost',
    :database_name => 'symfony',
    :database_user => 'symfony',
    :database_password => '<PASSWORD>',
    :mailer_transport => 'smtp',
    :mailer_host => 'localhost',
    :mailer_user => 'symfony',
    :mailer_password => '<PASSWORD>',
    :locale => 'en',
    :secret => 'CHANGEME'
  )
  new_resource.parameters Chef::Mixin::DeepMerge.merge(default_params, new_resource.parameters)
  new_resource.purge_before_symlink %w(app/cache app/logs app/sessions tmp)
  new_resource.symlinks.update(
    'cache' => 'app/cache',
    'logs' => 'app/logs',
    'sessions' => 'app/sessions',
    'tmp' => 'tmp'
  )
  new_resource.symlink_before_migrate.update(
    'parameters.yml' => 'app/config/parameters.yml'
  )
end

action :before_compile do
  %w(cache logs sessions tmp).each do |dir|
    directory ::File.join(new_resource.path, 'shared', dir) do
      owner new_resource.owner
      group new_resource.group
      recursive true
    end
  end
end

action :before_restart do
  
  execute "php app/console cache:clear" do
    cwd new_resource.release_path
    user new_resource.owner
  end

{'fraction_non_alphanumeric': 0.1327639751552795, 'fraction_numerical': 0.0, 'mean_word_length': 3.9845261121856868, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 39, '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': '7017605', 'n_tokens_mistral': 869, 'n_tokens_neox': 865, 'n_words': 172}