예제 #1
0
 /**
  * Initiate the class properties.
  * @access public
  */
 public function __construct()
 {
     $this->dir = $this->current_dir();
     $this->options = Revisr::get_options();
     $this->branch = $this->current_branch();
     $this->remote = $this->current_remote();
     $this->hash = $this->current_commit();
 }
예제 #2
0
파일: test-revisr.php 프로젝트: E-2/Revisr
 /**
  * Tests the get_options() method.
  */
 function test_get_options()
 {
     $options = Revisr::get_options();
     if (is_array($options)) {
         $result = true;
     } else {
         $result = false;
     }
     $this->assertTrue($result);
 }
예제 #3
0
 /**
  * Initiates the class and it's properties.
  * @access public
  */
 public function __construct()
 {
     // Necessary for execution of Revisr.
     $this->current_dir = getcwd();
     $this->is_repo = true;
     $this->options = Revisr::get_options();
     $this->git_path = $this->get_git_path();
     $this->git_dir = $this->get_git_dir();
     // Load up information about the current repository.
     if ($this->is_repo) {
         $this->branch = $this->current_branch();
         $this->remote = $this->current_remote();
         $this->current_commit = $this->current_commit();
     }
 }
예제 #4
0
 /**
  * Initiate the class.
  * @access public
  * @param  string $path Optional, overrides the saved setting (for testing).
  */
 public function __construct($path = '')
 {
     global $wpdb;
     $this->wpdb = $wpdb;
     $this->git = new Revisr_Git();
     $this->current_dir = getcwd();
     $this->upload_dir = wp_upload_dir();
     $this->options = Revisr::get_options();
     $get_path = $this->git->config_revisr_path('mysql');
     if (is_array($get_path)) {
         $this->path = $get_path[0];
     } else {
         $this->path = '';
     }
     $this->setup_env();
 }
예제 #5
0
 /**
  * Notifies the admin if notifications are enabled.
  * @access private
  * @param  string $subject The subject line of the email.
  * @param  string $message The message for the email.
  */
 public static function notify($subject, $message)
 {
     $options = Revisr::get_options();
     $url = get_admin_url() . 'admin.php?page=revisr';
     if (isset($options['notifications'])) {
         $email = $options['email'];
         $message .= '<br><br>';
         $message .= sprintf(__('<a href="%s">Click here</a> for more details.', 'revisr'), $url);
         $headers = "Content-Type: text/html; charset=ISO-8859-1\r\n";
         wp_mail($email, $subject, $message, $headers);
     }
 }
 /**
  * Initialize the class.
  * @access public
  */
 public function __construct()
 {
     $this->git = new Revisr_Git();
     $this->options = Revisr::get_options();
 }