Class: PoolParty::Resources::Php

Inherits:
PoolParty::Resource show all
Defined in:
lib/poolparty/plugins/apache2/php5.rb

Overview

Usage:

enable_php5 do

extras :cli, :pspell, :mysql

end

Instance Attribute Summary

Attributes inherited from PoolParty::Resource

#exists, #graph_index, #meta_not_if, #meta_notifies, #meta_only_if, #meta_subscribes

Attributes inherited from Base

#base_name, #init_opts

Instance Method Summary collapse

Methods inherited from PoolParty::Resource

#after_compile, #after_loaded_requires_parent, #before_compile, #case_of, #cloud, #compile, define_resource, define_resource_methods, defined, defined_resources, #does_not_exist!, #exists!, #has_method_name, has_method_name, inherited, #initialize, is_base_resource_class?, method_defined!, method_defined?, #not_if, #notifies, #only_if, #pool, #print_to_chef, #print_variable, #requires, #subscribes

Methods inherited from Base

#add_ordered_resources_to_result, #after_loaded, #all_resources, #before_load, clouds_dot_rb_dir, #clouds_dot_rb_dir, clouds_dot_rb_file, #clouds_dot_rb_file, #compile_opts, #create_graph, #dependencies, #get_resource, #has_searchable_paths, #initialize, #method_missing, #ordered_resources, #output_resources_graph, #resources, #resources_graph, #run_in_context, #run_with_callbacks, #to_s, #valid?, #validations

Methods included from Delayed

included

Methods included from Callbacks

included

Methods included from SearchablePaths

included

Constructor Details

This class inherits a constructor from PoolParty::Resource

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class PoolParty::Base

Instance Method Details

#extras(*names) ⇒ Object



31
32
33
34
35
# File 'lib/poolparty/plugins/apache2/php5.rb', line 31

def extras(*names)
  names.each do |name|
   has_package(:name => "php5-#{name}")
  end
end

#loaded(opts = {}, parent = self) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/poolparty/plugins/apache2/php5.rb', line 9

def loaded(opts={}, parent=self)
  has_package(:name => "php5")
  has_package(:name => "libapache2-mod-php5")
  present_apache_module("php5")
  has_file( "/etc/php5/apache2/php.ini",
          :template => "apache2/php.ini.erb",
          :mode => 755,
          :requires => get_package("libapache2-mod-php5")) do
            notifies get_exec("reload-apache2"), :run
          end

  has_file("/etc/apache2/conf.d/enable-php.conf", 
           :mode => 755,                 
           :content => <<-eos 
           AddHandler php5-script php
           AddType text/html       php
           eos
           ) do
            notifies get_exec("reload-apache2"), :run
           end
end