public function __construct(CLIScripts_LockFile $lock_file)
 {
     parent::__construct();
     $tism_cm = Configuration_ConfigManagerHelper::get_config_manager('plug-ins', 'trackit-stock-management');
     #$email_to = '*****@*****.**';
     #$email_to = '*****@*****.**';
     $email_to = $tism_cm->get_dlfre_to();
     $this->set_to($email_to);
     #$subject_template = "Lock file removed";
     $subject_template = $tism_cm->get_dlfre_subject_template();
     $this->set_subject_template($subject_template);
     $this->add_template_variable('process_id', $lock_file->get_process_id());
     $this->add_template_variable('lock_file_ctime', date('c', $lock_file->ctime()));
     $this->add_template_variable('current_time', date('c'));
     $this->add_template_variable('lock_file_name', $lock_file->get_name());
     $this->add_template_variable('hostname', Environment_MachineHelper::get_real_host_name());
     #		$body_template =
     #'A dead lock file called:
     #
     #${lock_file_name}
     #
     #on
     #
     #${hostname}
     #
     #which had been created at:
     #
     #${lock_file_ctime}
     #
     #was removed at
     #
     #${current_time}
     #
     #The lock file had been for the process with PID:
     #
     #${process_id}
     #
     #';
     $body_template = $tism_cm->get_dlfre_body_template();
     $this->set_body_template($body_template);
     #$from_address = '*****@*****.**';
     #$from_address = get_current_user() . '@' . $_ENV['HOSTNAME'];
     #
     #$this->set_from($from_address);
     #echo 'print_r($this):' . "\n";
     #print_r($this);
 }
 public static function test_all_classes_compile_without_writing_to_stdout()
 {
     $project_directory = HaddockProjectOrganisation_ProjectDirectoryHelper::get_project_directory();
     $php_class_files = $project_directory->get_php_class_files();
     $php_cli_interpreter = CLIScripts_InterpreterProgramHelper::get_php_cli_interpreter();
     $temp_dir = Environment_MachineHelper::get_temporary_directory();
     #print_r($temp_dir); exit;
     $tmp_out_file = $temp_dir->get_name() . '/haddock-compilations-tests-out.txt';
     $tmp_err_file = $temp_dir->get_name() . '/haddock-compilations-tests-err.txt';
     $define_debug_constants_file = PROJECT_ROOT . '/haddock/public-html/public-html/' . 'define-debug-constants.inc.php';
     $autoload_inc_file_name = PROJECT_ROOT . '/haddock/haddock-project-organisation/includes/' . 'autoload.inc.php';
     $total_out_length = 0;
     foreach ($php_class_files as $php_class_file) {
         $out_length = 0;
         self::conditionally_unlink_tmp_files($tmp_out_file, $tmp_err_file);
         $tmp_class_file_name = $temp_dir->get_name() . '/haddock-compilations-tests-tmp-' . $php_class_file->get_php_class_name() . '-class.php';
         $fh = fopen($tmp_class_file_name, 'w');
         if ($fh) {
             fwrite($fh, '<?php define(\'PROJECT_ROOT\', \'' . PROJECT_ROOT . '\'); ?>');
             fwrite($fh, file_get_contents($define_debug_constants_file));
             fwrite($fh, file_get_contents($autoload_inc_file_name));
             fwrite($fh, file_get_contents($php_class_file->get_name()));
             fclose($fh);
             $cmd = "{$php_cli_interpreter} -f \"{$tmp_class_file_name}\" >> \"{$tmp_out_file}\" 2>> \"{$tmp_err_file}\"";
             #echo $cmd . PHP_EOL;
             system($cmd);
             $out_length = strlen(file_get_contents($tmp_out_file)) + strlen(file_get_contents($tmp_err_file));
             if ($out_length == 0) {
                 unlink($tmp_class_file_name);
             }
         }
         $total_out_length += $out_length;
         self::conditionally_unlink_tmp_files($tmp_out_file, $tmp_err_file);
     }
     return $total_out_length == 0;
 }
 public function get_from()
 {
     if (!isset($this->from)) {
         #throw new Exception(
         #	'The \'from\' field must be set in an EmailDelivery_Email!'
         #);
         $this->from = get_current_user() . '@' . Environment_MachineHelper::get_real_host_name();
     }
     return $this->from;
 }
 private static function get_table_specification_directory_name()
 {
     $temporary_directory = Environment_MachineHelper::get_temporary_directory();
     return $temporary_directory->get_name() . DIRECTORY_SEPARATOR . 'database-describing-tests';
 }