package MyWebsite 0.000001; use Carp; use Moose; use Modern::Perl; use Drupal; use WordPress; extends 'WebServerRemote'; with 'MyOpenSSH'; use namespace::autoclean; has 'db' => (is => 'rw', isa => 'Str', required => 0, lazy => 1, default => '', ); has 'ver' => (is => 'rw', isa => 'Str', required => 0, lazy => 1, default => '', ); has 'type' => (is => 'ro', isa => 'Str', required => 0, lazy => 1, builder => '_set_type'); has 'domain' => (is => 'rw', isa => 'Str', required => 0, lazy => 1, default => '', ); has 'aliases' => (is => 'rw', isa => 'Str', required => 0, lazy => 1, default => '', ); has 'docroot' => (is => 'rw', isa => 'Str', required => 1, lazy => 0 ); has 'db_user' => (is => 'ro', isa => 'Str', required => 0, lazy => 1, default => '', writer => '_set_dbuser', ); has 'db_pass' => (is => 'rw', isa => 'Str', required => 0, lazy => 1, default => '', ); has 'root_dir' => (is => 'rw', isa => 'Str', required => 0, lazy => 1, default => '', ); has 'error_log' => (is => 'rw', isa => 'Str', required => 0, lazy => 1, default => '', ); has 'site_config' => (is => 'rw', isa => 'Str', required => 0, lazy => 1, default => '', ); has 'suexecgroup' => (is => 'rw', isa => 'Str', required => 0, lazy => 1, default => '', ); has 'apache_config' => (is => 'rw', isa => 'Str', required => 0, lazy => 1, default => '', ); has 'site_config_path' => (is => 'rw', isa => 'Str', required => 0, lazy => 1, default => '', ); has 'apache_config_path' => (is => 'rw', isa => 'Str', required => 0, lazy => 1, default => '', ); sub _set_type { my $self = shift; # check for drupal multi site if ($self->check_dir_for_files($self->docroot, ['sites', 'includes', 'modules'])) { $self = Drupal->meta->rebless_instance($self); return 'drupal'; } if ($self->check_dir_for_files($self->docroot, 'wp-config.php')) { $self = WordPress->meta->rebless_instance($self); return 'wordpress'; } if ($self->check_dir_for_files($self->docroot, 'settings.php')) { $self = Drupal->meta->rebless_instance($self); return 'drupal'; } } ##############################################