Exemple #1
0
    public function createIgnoreFile($working_directory)
    {
        $file_system = new FileSystem();
        $ignore_file = $working_directory . '/' . self::IGNORE_FILE;
        if (!$file_system->checkFile($ignore_file)) {
            $contents = <<<IGNORE
      # Ignore these files from the Git repository
      # Content taken from https://github.com/github/gitignore
      # You may adapt these to your needs
      #
      # Generated by Rum https://github.com/netsensei/Rum
      #
      sites/default/files
      sites/default/private
      sites/default/settings.php
      cache/
      files/
      /README.txt
      /CHANGELOG.txt
      /COPYRIGHT.txt
      /INSTALL*.txt
      /LICENSE.txt
      /MAINTAINERS.txt
      /UPGRADE.txt
      robots.txt
      sites/all/README.txt
      sites/all/modules/README.txt
      sites/all/themes/README.txt
      .htaccess
IGNORE;
            $file_system->createFile($ignore_file, $contents);
        }
    }
Exemple #2
0
 public function __construct($project_name, $project_dir)
 {
     drush_log(dt('Initializing Rum ...'), 'status');
     // Set a few defaults in .drushrc.php. We can overrule these through the cli
     $this->settings_map = array('rum-workspace', 'rum-host', 'rum-os', 'rum-environment', 'rum-docroot', 'rum-project-db-dir');
     foreach ($this->settings_map as $setting) {
         $this->checkSetting($setting);
     }
     // Set the current time once.
     date_default_timezone_set(drush_get_option('rum-timezone', 'Europe/Brussels'));
     $this->date = date("Y-m-d_H-i-s", $_SERVER['REQUEST_TIME']);
     // Set the workspace
     $this->workspace = drush_get_option('rum-workspace', '');
     // Set the hostname of your machine (i.e. netsensei, stalski, swentel, atlas,...)
     $this->host_name = drush_get_option('rum-host', '');
     // Set the type of OS you're using. Rum is not OS aware.
     $this->os = drush_get_option('rum-os', '');
     // Set the environment
     $this->environment = drush_get_option('rum-environment', '');
     // Set the project name
     $this->project_name = $project_name;
     // Set the project_dir for the action on this particular project
     $project_dir = FileSystem::sanitize($project_dir);
     $this->project_dir = $this->workspace . '/' . $project_dir;
     // Generate a domain name. Will be hostname.project_name (i.e. netsensei.foobar)
     $this->project_domain = $this->host_name . '.' . $project_name;
     // Set the default document root of your project i.e. 'www'
     $this->project_docroot = drush_get_option('rum-docroot', '');
     // Set the default db dir where your project db dumps reside i.e. 'db'
     $this->project_db_dir = drush_get_option('rum-project-db-dir', '');
 }