Changeset 2120
- Timestamp:
- 11/23/2015 09:28:30 PM (9 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-custom-stats
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-custom-stats/stats/discarded-warning.php
r2115 r2120 1 1 <?php 2 2 3 /** 3 4 * This plugin logs discared warnings into a database table. … … 5 6 * @author Dominik Schilling (ocean90) 6 7 */ 7 class GP_WPorg_Log_Discarded_Warnings extends GP_Plugin { 8 var $id = 'wporg-log-discarded-warnings'; 8 class WPorg_GP_Discarded_Warning_Stats { 9 9 10 10 /** … … 13 13 * @var string 14 14 */ 15 var$table_name = 'translate_dotorg_warnings';15 private $table_name = 'translate_dotorg_warnings'; 16 16 17 function __construct() { 18 parent::__construct(); 19 $this->add_action( 'warning_discarded', array( 'args' => 5 ) ); 17 public function __construct() { 18 add_action( 'warning_discarded', array( $this, 'log_discarded_warning' ), 10, 5 ); 20 19 } 21 20 … … 29 28 * @param int $user ID of the user. 30 29 */ 31 function warning_discarded( $project_id, $translation_set, $translation, $warning, $user ) {32 global $ gpdb;30 public function log_discarded_warning( $project_id, $translation_set, $translation, $warning, $user ) { 31 global $wpdb; 33 32 34 33 $warning = array( … … 41 40 ); 42 41 $format = array( '%d', '%d', '%d', '%s', '%d', '%s' ); 43 $ gpdb->insert(42 $wpdb->insert( 44 43 $this->table_name, 45 44 $warning, … … 48 47 } 49 48 } 50 GP::$plugins->wporg_log_discared_warnings = new GP_WPorg_Log_Discarded_Warnings;51 49 52 50 /* -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-custom-stats/wporg-gp-custom-stats.php
r2114 r2120 10 10 class WPorg_GP_Custom_Stats { 11 11 12 /** 13 * Holds the user stats instance. 14 * 15 * @var WPorg_GP_User_Stats 16 */ 12 17 public $user; 18 19 /** 20 * Holds the project stats instance. 21 * 22 * @var WPorg_GP_Project_Stats 23 */ 13 24 public $project; 25 26 /** 27 * Holds the discarded warning stats instance. 28 * 29 * @var WPorg_GP_Discarded_Warning_Stats 30 */ 31 public $discarded_warning; 14 32 15 33 public function __construct() { … … 17 35 } 18 36 37 /** 38 * Initializes custom stats classes. 39 */ 19 40 public function init_stats() { 20 21 41 $this->user = new WPorg_GP_User_Stats(); 22 42 $this->project = new WPorg_GP_Project_Stats(); 43 $this->discarded_warning = new WPorg_GP_Discarded_Warning_Stats(); 23 44 } 24 45 }
Note: See TracChangeset
for help on using the changeset viewer.