ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilWikiStat Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilWikiStat:

Static Public Member Functions

static handleEvent (int $a_event, ilWikiPage $a_page_obj, ?int $a_user_id=null, array $a_additional_data=null)
 Handle wiki page event. More...
 
static handlePageCreated (ilWikiPage $a_page_obj, int $a_user_id)
 Handle wiki page creation. More...
 
static handlePageUpdated (ilWikiPage $a_page_obj, int $a_user_id, array $a_page_data=null)
 Handle wiki page update. More...
 
static handlePageRead (ilWikiPage $a_page_obj, int $a_user_id)
 
static handlePageDeletion (ilWikiPage $a_page_obj, int $a_user_id)
 
static handlePageRating (ilWikiPage $a_page_obj, int $a_user_id)
 
static getAvailableMonths (int $a_wiki_id)
 
static getFigures ()
 
static getFiguresPage ()
 
static getFigureTitle (int $a_figure)
 
static getFigureData (int $a_wiki_id, int $a_figure, string $a_from, string $a_to)
 
static getFigureDataPage (int $a_wiki_id, int $a_page_id, int $a_figure, string $a_from, string $a_to)
 
static getFigureOptions ()
 
static getFigureOptionsPage ()
 

Data Fields

const EVENT_PAGE_CREATED = 1
 
const EVENT_PAGE_UPDATED = 2
 
const EVENT_PAGE_READ = 3
 
const EVENT_PAGE_DELETED = 4
 
const EVENT_PAGE_RATING = 5
 
const KEY_FIGURE_WIKI_NUM_PAGES = 1
 
const KEY_FIGURE_WIKI_NEW_PAGES = 2
 
const KEY_FIGURE_WIKI_NEW_PAGES_AVG = 3
 
const KEY_FIGURE_WIKI_EDIT_PAGES = 4
 
const KEY_FIGURE_WIKI_EDIT_PAGES_AVG = 5
 
const KEY_FIGURE_WIKI_DELETED_PAGES = 6
 
const KEY_FIGURE_WIKI_READ_PAGES = 7
 
const KEY_FIGURE_WIKI_USER_EDIT_PAGES = 8
 
const KEY_FIGURE_WIKI_USER_EDIT_PAGES_AVG = 9
 
const KEY_FIGURE_WIKI_NUM_RATING = 10
 
const KEY_FIGURE_WIKI_NUM_RATING_AVG = 11
 
const KEY_FIGURE_WIKI_RATING_AVG = 12
 
const KEY_FIGURE_WIKI_INTERNAL_LINKS = 13
 
const KEY_FIGURE_WIKI_INTERNAL_LINKS_AVG = 14
 
const KEY_FIGURE_WIKI_EXTERNAL_LINKS = 15
 
const KEY_FIGURE_WIKI_EXTERNAL_LINKS_AVG = 16
 
const KEY_FIGURE_WIKI_WORDS = 17
 
const KEY_FIGURE_WIKI_WORDS_AVG = 18
 
const KEY_FIGURE_WIKI_CHARS = 19
 
const KEY_FIGURE_WIKI_CHARS_AVG = 20
 
const KEY_FIGURE_WIKI_FOOTNOTES = 21
 
const KEY_FIGURE_WIKI_FOOTNOTES_AVG = 22
 
const KEY_FIGURE_WIKI_PAGE_CHANGES = 23
 
const KEY_FIGURE_WIKI_PAGE_CHANGES_AVG = 24
 
const KEY_FIGURE_WIKI_PAGE_USER_EDIT = 25
 
const KEY_FIGURE_WIKI_PAGE_READ = 26
 
const KEY_FIGURE_WIKI_PAGE_INTERNAL_LINKS = 27
 
const KEY_FIGURE_WIKI_PAGE_EXTERNAL_LINKS = 28
 
const KEY_FIGURE_WIKI_PAGE_WORDS = 29
 
const KEY_FIGURE_WIKI_PAGE_CHARS = 30
 
const KEY_FIGURE_WIKI_PAGE_FOOTNOTES = 31
 
const KEY_FIGURE_WIKI_PAGE_RATINGS = 32
 

Static Protected Member Functions

static getTimestamp ()
 Get current time frame (hourly) More...
 
static writeData (string $a_table, array $a_primary, array $a_values)
 Write data to DB. More...
 
static writeStat (string $a_wiki_id, array $a_values)
 Write data to wiki_stat. More...
 
static writeStatPage (int $a_wiki_id, int $a_page_id, array $a_values)
 Write data to wiki_stat_page. More...
 
static writeStatPageUser (int $a_wiki_id, int $a_page_id, int $a_user_id, array $a_values)
 Write data to wiki_stat_page_user. More...
 
static writeStatUser (int $a_wiki_id, int $a_user_id, array $a_values)
 Write to wiki_stat_user. More...
 
static countPages (int $a_wiki_id)
 Count pages in wiki. More...
 
static getAverageRating (int $a_wiki_id, ?int $a_page_id=null)
 Get average rating for wiki or wiki page. More...
 
static getWikiAggr (int $a_wiki_id, string $a_day_from, string $a_day_to, string $a_table, string $a_field, string $a_aggr_value, ?string $a_sub_field=null, ?int $a_sub_id=null, bool $a_build_full_period=false)
 
static getWikiLast (int $a_wiki_id, string $a_day_from, string $a_table, string $a_field, ?string $a_sub_field=null, ?int $a_sub_id=null)
 
static getWikiAggrSub (int $a_wiki_id, string $a_day_from, string $a_day_to, string $a_table, string $a_field, string $a_aggr_by, string $a_aggr_value, string $a_aggr_sub, ?string $a_sub_field=null, ?int $a_sub_id=null, bool $a_build_full_period=false)
 
static buildFullPeriodData (array &$a_res, string $a_day_from, string $a_day_to, ?int $a_last_before_period=null, bool $a_allow_zero=false)
 
static getWikiNumPages (int $a_wiki_id, string $a_day_from, string $a_day_to)
 
static getWikiNewPagesSum (int $a_wiki_id, string $a_day_from, string $a_day_to)
 
static getWikiNewPagesAvg (int $a_wiki_id, string $a_day_from, string $a_day_to)
 
static getWikiDeletedPages (int $a_wiki_id, string $a_day_from, string $a_day_to)
 
static getWikiReadPages (int $a_wiki_id, string $a_day_from, string $a_day_to)
 
static getWikiEditPagesSum (int $a_wiki_id, string $a_day_from, string $a_day_to)
 
static getWikiEditPagesAvg (int $a_wiki_id, string $a_day_from, string $a_day_to)
 
static getWikiUserEditPages (int $a_wiki_id, string $a_day_from, string $a_day_to, ?string $a_sub_field=null, ?int $a_sub_id=null)
 
static getWikiUserEditPagesAvg (int $a_wiki_id, string $a_day_from, string $a_day_to)
 
static getWikiNumRating (int $a_wiki_id, string $a_day_from, string $a_day_to)
 
static getWikiNumRatingAvg (int $a_wiki_id, string $a_day_from, string $a_day_to)
 
static getWikiRatingAvg (int $a_wiki_id, string $a_day_from, string $a_day_to)
 
static getWikiInternalLinks (int $a_wiki_id, string $a_day_from, string $a_day_to)
 
static getWikiInternalLinksAvg (int $a_wiki_id, string $a_day_from, string $a_day_to)
 
static getWikiExternalLinks (int $a_wiki_id, string $a_day_from, string $a_day_to)
 
static getWikiExternalLinksAvg (int $a_wiki_id, string $a_day_from, string $a_day_to)
 
static getWikiWords (int $a_wiki_id, string $a_day_from, string $a_day_to)
 
static getWikiWordsAvg (int $a_wiki_id, string $a_day_from, string $a_day_to)
 
static getWikiCharacters (int $a_wiki_id, string $a_day_from, string $a_day_to)
 
static getWikiCharactersAvg (int $a_wiki_id, string $a_day_from, string $a_day_to)
 
static getWikiFootnotes (int $a_wiki_id, string $a_day_from, string $a_day_to)
 
static getWikiFootnotesAvg (int $a_wiki_id, string $a_day_from, string $a_day_to)
 
static getWikiPageChanges (int $a_wiki_id, int $a_page_id, string $a_day_from, string $a_day_to)
 
static getWikiPageChangesAvg (int $a_wiki_id, int $a_page_id, string $a_day_from, string $a_day_to)
 
static getWikiPageUserEdit (int $a_wiki_id, int $a_page_id, string $a_day_from, string $a_day_to)
 
static getWikiPageRead (int $a_wiki_id, int $a_page_id, string $a_day_from, string $a_day_to)
 
static getWikiPageInternalLinks (int $a_wiki_id, int $a_page_id, string $a_day_from, string $a_day_to)
 
static getWikiPageExternalLinks (int $a_wiki_id, int $a_page_id, string $a_day_from, string $a_day_to)
 
static getWikiPageWords (int $a_wiki_id, int $a_page_id, string $a_day_from, string $a_day_to)
 
static getWikiPageCharacters (int $a_wiki_id, int $a_page_id, string $a_day_from, string $a_day_to)
 
static getWikiPageFootnotes (int $a_wiki_id, int $a_page_id, string $a_day_from, string $a_day_to)
 
static getWikiPageRatings (int $a_wiki_id, int $a_page_id, string $a_day_from, string $a_day_to)
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Wiki statistics class

Timestamp / Current Record

  • If an event occurs the current timestamp is calculated, for not this is the timestamp without minuts/seconds 2014-01-14 07:34:45 -> 2014-01-14 07:00:00 (i.e. we count "per hour" and the numbers represent 07:00:00 to 07:59:59)

Table / Primary Key / Stats / Events

  • wiki_stat pk: wiki_id, timestamp
              (1) number of pages             ev: page created, page deleted
                                                              action: count pages of wiki and replace number in current record
    
              (2) deleted pages               ev: page deleted
                                                              action: increment number in current record +1
    
              (3) average rating              ev: rating saved
                                                              [action: do (10), then for current records in wiki_stat_page: sum average rating / number of records where average rating is > 0]
                                                      REVISION action: do (10), then build average rating from wiki page rating records NOT wiki_stat_page
    
  • wiki_stat_page pk: wiki_id, page_id, timestamp
              (4) internal links              ev: page saved
                                                              action: count internal links and replace number in current record
    
              (5) external links              see internal links
    
              (6) footnotes                   see internal links
    
              (7) ratings                             ev: rating saved
                                                              action: count ratings and replace number in current record
    
              (8)     words                           see internal links
    
              (9) characters                  see internal links
    
              (10) average rating             ev: rating saved
                                                              sum ratings / number of ratings (0 if no rating given)
    
  • wiki_stat_user pk: wiki_id, user_id, timestamp
              (11) new pages                  ev: page created
                                                              action: increment number of user in current record + 1
    
  • wiki_stat_page_user pk: wiki_id, page_id, user_id, timestamp
      (12) changes                    ev: page saved
                                                      action: increment number of user/page in current record + 1
    
      (13) read                               ev: page read
                                                      action: increment number of user/page in current record + 1
    

Events

  • page created (empty) (1) (11)
  • page deleted (1) (2)
  • page saved (content) (4) (5) (6) (8) (9) (12)
  • page read (13)
  • rating saved (3) (10)

Deleted pages

All historic records are kept. A current wiki_stat_page record with all values 0 is replaced/created. (?)

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.d.nosp@m.e
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 93 of file class.ilWikiStat.php.

Member Function Documentation

◆ buildFullPeriodData()

static ilWikiStat::buildFullPeriodData ( array &  $a_res,
string  $a_day_from,
string  $a_day_to,
?int  $a_last_before_period = null,
bool  $a_allow_zero = false 
)
staticprotected

Definition at line 781 of file class.ilWikiStat.php.

787  : void {
788  // build full data for period
789  $safety = 0;
790  $last = null;
791  $today = date("Y-m-d");
792  $current = explode("-", $a_day_from);
793  $current = date("Y-m-d", mktime(0, 0, 1, $current[1], $current[2], $current[0]));
794  while ($current <= $a_day_to &&
795  ++$safety < 1000) {
796  if (!isset($a_res[$current])) {
797  if ($current <= $today) {
798  // last existing value in period
799  if ($last !== null) {
800  $a_res[$current] = $last;
801  }
802  // last existing value before period
803  elseif ($a_last_before_period || $a_allow_zero) {
804  $a_res[$current] = $a_last_before_period;
805  }
806  }
807  } else {
808  $last = $a_res[$current];
809  }
810 
811  $current = explode("-", $current);
812  $current = date("Y-m-d", mktime(0, 0, 1, $current[1], $current[2] + 1, $current[0]));
813  }
814  }

◆ countPages()

static ilWikiStat::countPages ( int  $a_wiki_id)
staticprotected

Count pages in wiki.

Definition at line 342 of file class.ilWikiStat.php.

References ilWikiPage\getAllWikiPages().

344  : int {
345  return count(ilWikiPage::getAllWikiPages($a_wiki_id));
346  }
static getAllWikiPages(int $a_wiki_id)
+ Here is the call graph for this function:

◆ getAvailableMonths()

static ilWikiStat::getAvailableMonths ( int  $a_wiki_id)
static

Definition at line 1199 of file class.ilWikiStat.php.

References $DIC, $ilDB, and $res.

Referenced by ilWikiStatGUI\viewToolbar().

1201  : array {
1202  global $DIC;
1203 
1204  $ilDB = $DIC->database();
1205 
1206  $res = array();
1207 
1208  // because of read_events this db table is updated most often
1209  $set = $ilDB->query("SELECT DISTINCT(SUBSTR(ts_day, 1, 7)) " . $ilDB->quoteIdentifier("month") .
1210  " FROM wiki_stat_page_user" .
1211  " WHERE wiki_id = " . $ilDB->quote($a_wiki_id, "integer") .
1212  " AND ts_day IS NOT NULL");
1213  while ($row = $ilDB->fetchAssoc($set)) {
1214  $res[] = $row["month"];
1215  }
1216 
1217  return $res;
1218  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ getAverageRating()

static ilWikiStat::getAverageRating ( int  $a_wiki_id,
?int  $a_page_id = null 
)
staticprotected

Get average rating for wiki or wiki page.

Definition at line 351 of file class.ilWikiStat.php.

References ilRating\getOverallRatingForObject().

354  : array {
355  if (!$a_page_id) {
357  $a_wiki_id,
358  "wiki"
359  );
360  } else {
362  $a_wiki_id,
363  "wiki",
364  $a_page_id,
365  "wpg"
366  );
367  }
368  }
static getOverallRatingForObject(int $a_obj_id, string $a_obj_type, int $a_sub_obj_id=null, string $a_sub_obj_type=null, int $a_category_id=null)
Get overall rating for an object.
+ Here is the call graph for this function:

◆ getFigureData()

static ilWikiStat::getFigureData ( int  $a_wiki_id,
int  $a_figure,
string  $a_from,
string  $a_to 
)
static

Definition at line 1311 of file class.ilWikiStat.php.

Referenced by ilWikiStatGUI\getChartData(), and ilWikiStatGUI\getListData().

1316  : array {
1317  switch ($a_figure) {
1318  case self::KEY_FIGURE_WIKI_NUM_PAGES:
1319  return self::getWikiNumPages($a_wiki_id, $a_from, $a_to);
1320 
1321  case self::KEY_FIGURE_WIKI_NEW_PAGES:
1322  return self::getWikiNewPagesSum($a_wiki_id, $a_from, $a_to);
1323 
1324  case self::KEY_FIGURE_WIKI_NEW_PAGES_AVG:
1325  return self::getWikiNewPagesAvg($a_wiki_id, $a_from, $a_to);
1326 
1327  case self::KEY_FIGURE_WIKI_EDIT_PAGES:
1328  return self::getWikiEditPagesSum($a_wiki_id, $a_from, $a_to);
1329 
1330  case self::KEY_FIGURE_WIKI_EDIT_PAGES_AVG:
1331  return self::getWikiEditPagesAvg($a_wiki_id, $a_from, $a_to);
1332 
1333  case self::KEY_FIGURE_WIKI_DELETED_PAGES:
1334  return self::getWikiDeletedPages($a_wiki_id, $a_from, $a_to);
1335 
1336  case self::KEY_FIGURE_WIKI_READ_PAGES:
1337  return self::getWikiReadPages($a_wiki_id, $a_from, $a_to);
1338 
1339  case self::KEY_FIGURE_WIKI_USER_EDIT_PAGES:
1340  return self::getWikiUserEditPages($a_wiki_id, $a_from, $a_to);
1341 
1342  case self::KEY_FIGURE_WIKI_USER_EDIT_PAGES_AVG:
1343  return self::getWikiUserEditPagesAvg($a_wiki_id, $a_from, $a_to);
1344 
1345  case self::KEY_FIGURE_WIKI_NUM_RATING:
1346  return self::getWikiNumRating($a_wiki_id, $a_from, $a_to);
1347 
1348  case self::KEY_FIGURE_WIKI_NUM_RATING_AVG:
1349  return self::getWikiNumRatingAvg($a_wiki_id, $a_from, $a_to);
1350 
1351  case self::KEY_FIGURE_WIKI_RATING_AVG:
1352  return self::getWikiRatingAvg($a_wiki_id, $a_from, $a_to);
1353 
1354  case self::KEY_FIGURE_WIKI_INTERNAL_LINKS:
1355  return self::getWikiInternalLinks($a_wiki_id, $a_from, $a_to);
1356 
1357  case self::KEY_FIGURE_WIKI_INTERNAL_LINKS_AVG:
1358  return self::getWikiInternalLinksAvg($a_wiki_id, $a_from, $a_to);
1359 
1360  case self::KEY_FIGURE_WIKI_EXTERNAL_LINKS:
1361  return self::getWikiExternalLinks($a_wiki_id, $a_from, $a_to);
1362 
1363  case self::KEY_FIGURE_WIKI_EXTERNAL_LINKS_AVG:
1364  return self::getWikiExternalLinksAvg($a_wiki_id, $a_from, $a_to);
1365 
1366  case self::KEY_FIGURE_WIKI_WORDS:
1367  return self::getWikiWords($a_wiki_id, $a_from, $a_to);
1368 
1369  case self::KEY_FIGURE_WIKI_WORDS_AVG:
1370  return self::getWikiWordsAvg($a_wiki_id, $a_from, $a_to);
1371 
1372  case self::KEY_FIGURE_WIKI_CHARS:
1373  return self::getWikiCharacters($a_wiki_id, $a_from, $a_to);
1374 
1375  case self::KEY_FIGURE_WIKI_CHARS_AVG:
1376  return self::getWikiCharactersAvg($a_wiki_id, $a_from, $a_to);
1377 
1378  case self::KEY_FIGURE_WIKI_FOOTNOTES:
1379  return self::getWikiFootnotes($a_wiki_id, $a_from, $a_to);
1380 
1381  case self::KEY_FIGURE_WIKI_FOOTNOTES_AVG:
1382  return self::getWikiFootnotesAvg($a_wiki_id, $a_from, $a_to);
1383  }
1384  return [];
1385  }
+ Here is the caller graph for this function:

◆ getFigureDataPage()

static ilWikiStat::getFigureDataPage ( int  $a_wiki_id,
int  $a_page_id,
int  $a_figure,
string  $a_from,
string  $a_to 
)
static

Definition at line 1387 of file class.ilWikiStat.php.

Referenced by ilWikiStatGUI\getChartData(), and ilWikiStatGUI\getListData().

1393  : array {
1394  switch ($a_figure) {
1395  case self::KEY_FIGURE_WIKI_PAGE_CHANGES:
1396  return self::getWikiPageChanges($a_wiki_id, $a_page_id, $a_from, $a_to);
1397 
1398  case self::KEY_FIGURE_WIKI_PAGE_CHANGES_AVG:
1399  return self::getWikiPageChangesAvg($a_wiki_id, $a_page_id, $a_from, $a_to);
1400 
1401  case self::KEY_FIGURE_WIKI_PAGE_USER_EDIT:
1402  return self::getWikiPageUserEdit($a_wiki_id, $a_page_id, $a_from, $a_to);
1403 
1404  case self::KEY_FIGURE_WIKI_PAGE_READ:
1405  return self::getWikiPageRead($a_wiki_id, $a_page_id, $a_from, $a_to);
1406 
1407  case self::KEY_FIGURE_WIKI_PAGE_INTERNAL_LINKS:
1408  return self::getWikiPageInternalLinks($a_wiki_id, $a_page_id, $a_from, $a_to);
1409 
1410  case self::KEY_FIGURE_WIKI_PAGE_EXTERNAL_LINKS:
1411  return self::getWikiPageExternalLinks($a_wiki_id, $a_page_id, $a_from, $a_to);
1412 
1413  case self::KEY_FIGURE_WIKI_PAGE_FOOTNOTES:
1414  return self::getWikiPageFootnotes($a_wiki_id, $a_page_id, $a_from, $a_to);
1415 
1416  case self::KEY_FIGURE_WIKI_PAGE_WORDS:
1417  return self::getWikiPageWords($a_wiki_id, $a_page_id, $a_from, $a_to);
1418 
1419  case self::KEY_FIGURE_WIKI_PAGE_CHARS:
1420  return self::getWikiPageCharacters($a_wiki_id, $a_page_id, $a_from, $a_to);
1421 
1422  case self::KEY_FIGURE_WIKI_PAGE_RATINGS:
1423  return self::getWikiPageRatings($a_wiki_id, $a_page_id, $a_from, $a_to);
1424  }
1425  return [];
1426  }
+ Here is the caller graph for this function:

◆ getFigureOptions()

static ilWikiStat::getFigureOptions ( )
static

Definition at line 1428 of file class.ilWikiStat.php.

References $res.

Referenced by ilWikiStatGUI\getListData(), and ilWikiStatGUI\viewToolbar().

1428  : array
1429  {
1430  $res = array();
1431 
1432  foreach (self::getFigures() as $figure) {
1433  $res[$figure] = self::getFigureTitle($figure);
1434  }
1435 
1436  return $res;
1437  }
$res
Definition: ltiservices.php:69
+ Here is the caller graph for this function:

◆ getFigureOptionsPage()

static ilWikiStat::getFigureOptionsPage ( )
static

Definition at line 1439 of file class.ilWikiStat.php.

References $res.

Referenced by ilWikiStatGUI\getListData(), and ilWikiStatGUI\viewToolbar().

1439  : array
1440  {
1441  $res = array();
1442 
1443  foreach (self::getFiguresPage() as $figure) {
1444  $res[$figure] = self::getFigureTitle($figure);
1445  }
1446 
1447  return $res;
1448  }
$res
Definition: ltiservices.php:69
+ Here is the caller graph for this function:

◆ getFigures()

static ilWikiStat::getFigures ( )
static

Definition at line 1220 of file class.ilWikiStat.php.

1220  : array
1221  {
1222  return array(
1223  self::KEY_FIGURE_WIKI_NUM_PAGES
1224  ,self::KEY_FIGURE_WIKI_NEW_PAGES
1225  ,self::KEY_FIGURE_WIKI_NEW_PAGES_AVG
1226  ,self::KEY_FIGURE_WIKI_EDIT_PAGES
1227  ,self::KEY_FIGURE_WIKI_EDIT_PAGES_AVG
1228  ,self::KEY_FIGURE_WIKI_DELETED_PAGES
1229  ,self::KEY_FIGURE_WIKI_READ_PAGES
1230  ,self::KEY_FIGURE_WIKI_USER_EDIT_PAGES
1231  ,self::KEY_FIGURE_WIKI_USER_EDIT_PAGES_AVG
1232  ,self::KEY_FIGURE_WIKI_NUM_RATING
1233  ,self::KEY_FIGURE_WIKI_NUM_RATING_AVG
1234  ,self::KEY_FIGURE_WIKI_RATING_AVG
1235  ,self::KEY_FIGURE_WIKI_INTERNAL_LINKS
1236  ,self::KEY_FIGURE_WIKI_INTERNAL_LINKS_AVG
1237  ,self::KEY_FIGURE_WIKI_EXTERNAL_LINKS
1238  ,self::KEY_FIGURE_WIKI_EXTERNAL_LINKS_AVG
1239  ,self::KEY_FIGURE_WIKI_WORDS
1240  ,self::KEY_FIGURE_WIKI_WORDS_AVG
1241  ,self::KEY_FIGURE_WIKI_CHARS
1242  ,self::KEY_FIGURE_WIKI_CHARS_AVG
1243  ,self::KEY_FIGURE_WIKI_FOOTNOTES
1244  ,self::KEY_FIGURE_WIKI_FOOTNOTES_AVG
1245  );
1246  }

◆ getFiguresPage()

static ilWikiStat::getFiguresPage ( )
static

Definition at line 1248 of file class.ilWikiStat.php.

1248  : array
1249  {
1250  return array(
1251  self::KEY_FIGURE_WIKI_PAGE_CHANGES
1252  ,self::KEY_FIGURE_WIKI_PAGE_CHANGES_AVG
1253  ,self::KEY_FIGURE_WIKI_PAGE_USER_EDIT
1254  ,self::KEY_FIGURE_WIKI_PAGE_READ
1255  ,self::KEY_FIGURE_WIKI_PAGE_INTERNAL_LINKS
1256  ,self::KEY_FIGURE_WIKI_PAGE_EXTERNAL_LINKS
1257  ,self::KEY_FIGURE_WIKI_PAGE_WORDS
1258  ,self::KEY_FIGURE_WIKI_PAGE_CHARS
1259  ,self::KEY_FIGURE_WIKI_PAGE_FOOTNOTES
1260  ,self::KEY_FIGURE_WIKI_PAGE_RATINGS
1261  );
1262  }

◆ getFigureTitle()

static ilWikiStat::getFigureTitle ( int  $a_figure)
static

Definition at line 1264 of file class.ilWikiStat.php.

References $DIC, and $lng.

Referenced by ilWikiStatGUI\export(), and ilWikiStatGUI\renderGraph().

1266  : string {
1267  global $DIC;
1268 
1269  $lng = $DIC->language();
1270 
1271  $map = array(
1272  // wiki
1273  self::KEY_FIGURE_WIKI_NUM_PAGES => $lng->txt("wiki_stat_num_pages")
1274  ,self::KEY_FIGURE_WIKI_NEW_PAGES => $lng->txt("wiki_stat_new_pages")
1275  ,self::KEY_FIGURE_WIKI_NEW_PAGES_AVG => $lng->txt("wiki_stat_new_pages_avg")
1276  ,self::KEY_FIGURE_WIKI_EDIT_PAGES => $lng->txt("wiki_stat_edit_pages")
1277  ,self::KEY_FIGURE_WIKI_EDIT_PAGES_AVG => $lng->txt("wiki_stat_edit_pages_avg")
1278  ,self::KEY_FIGURE_WIKI_DELETED_PAGES => $lng->txt("wiki_stat_deleted_pages")
1279  ,self::KEY_FIGURE_WIKI_READ_PAGES => $lng->txt("wiki_stat_read_pages")
1280  ,self::KEY_FIGURE_WIKI_USER_EDIT_PAGES => $lng->txt("wiki_stat_user_edit_pages")
1281  ,self::KEY_FIGURE_WIKI_USER_EDIT_PAGES_AVG => $lng->txt("wiki_stat_user_edit_pages_avg")
1282  ,self::KEY_FIGURE_WIKI_NUM_RATING => $lng->txt("wiki_stat_num_rating")
1283  ,self::KEY_FIGURE_WIKI_NUM_RATING_AVG => $lng->txt("wiki_stat_num_rating_avg")
1284  ,self::KEY_FIGURE_WIKI_RATING_AVG => $lng->txt("wiki_stat_rating_avg")
1285  ,self::KEY_FIGURE_WIKI_INTERNAL_LINKS => $lng->txt("wiki_stat_internal_links")
1286  ,self::KEY_FIGURE_WIKI_INTERNAL_LINKS_AVG => $lng->txt("wiki_stat_internal_links_avg")
1287  ,self::KEY_FIGURE_WIKI_EXTERNAL_LINKS => $lng->txt("wiki_stat_external_links")
1288  ,self::KEY_FIGURE_WIKI_EXTERNAL_LINKS_AVG => $lng->txt("wiki_stat_external_links_avg")
1289  ,self::KEY_FIGURE_WIKI_WORDS => $lng->txt("wiki_stat_words")
1290  ,self::KEY_FIGURE_WIKI_WORDS_AVG => $lng->txt("wiki_stat_words_avg")
1291  ,self::KEY_FIGURE_WIKI_CHARS => $lng->txt("wiki_stat_chars")
1292  ,self::KEY_FIGURE_WIKI_CHARS_AVG => $lng->txt("wiki_stat_chars_avg")
1293  ,self::KEY_FIGURE_WIKI_FOOTNOTES => $lng->txt("wiki_stat_footnotes")
1294  ,self::KEY_FIGURE_WIKI_FOOTNOTES_AVG => $lng->txt("wiki_stat_footnotes_avg")
1295  // page
1296  ,self::KEY_FIGURE_WIKI_PAGE_CHANGES => $lng->txt("wiki_stat_page_changes")
1297  ,self::KEY_FIGURE_WIKI_PAGE_CHANGES_AVG => $lng->txt("wiki_stat_page_changes_avg")
1298  ,self::KEY_FIGURE_WIKI_PAGE_USER_EDIT => $lng->txt("wiki_stat_page_user_edit")
1299  ,self::KEY_FIGURE_WIKI_PAGE_READ => $lng->txt("wiki_stat_page_read")
1300  ,self::KEY_FIGURE_WIKI_PAGE_INTERNAL_LINKS => $lng->txt("wiki_stat_page_internal_links")
1301  ,self::KEY_FIGURE_WIKI_PAGE_EXTERNAL_LINKS => $lng->txt("wiki_stat_page_external_links")
1302  ,self::KEY_FIGURE_WIKI_PAGE_WORDS => $lng->txt("wiki_stat_page_words")
1303  ,self::KEY_FIGURE_WIKI_PAGE_CHARS => $lng->txt("wiki_stat_page_characters")
1304  ,self::KEY_FIGURE_WIKI_PAGE_FOOTNOTES => $lng->txt("wiki_stat_page_footnotes")
1305  ,self::KEY_FIGURE_WIKI_PAGE_RATINGS => $lng->txt("wiki_stat_page_ratings")
1306  );
1307 
1308  return $map[$a_figure];
1309  }
$lng
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ getTimestamp()

static ilWikiStat::getTimestamp ( )
staticprotected

Get current time frame (hourly)

Definition at line 187 of file class.ilWikiStat.php.

187  : string
188  {
189  return date("Y-m-d H:00:00");
190  }

◆ getWikiAggr()

static ilWikiStat::getWikiAggr ( int  $a_wiki_id,
string  $a_day_from,
string  $a_day_to,
string  $a_table,
string  $a_field,
string  $a_aggr_value,
?string  $a_sub_field = null,
?int  $a_sub_id = null,
bool  $a_build_full_period = false 
)
staticprotected

Definition at line 538 of file class.ilWikiStat.php.

References $DIC, $ilDB, and $res.

548  : array {
549  global $DIC;
550 
551  $ilDB = $DIC->database();
552 
553  $res = array();
554  $deleted = null;
555 
556  $sql = "SELECT ts_day, " . sprintf($a_aggr_value, $a_field) . " " . $a_field;
557  if ($a_table === "wiki_stat_page" && $a_sub_field) {
558  $sql .= ", MAX(deleted) deleted";
559  }
560  $sql .= " FROM " . $a_table .
561  " WHERE wiki_id = " . $ilDB->quote($a_wiki_id, "integer") .
562  " AND ts_day >= " . $ilDB->quote($a_day_from, "text") .
563  " AND ts_day <= " . $ilDB->quote($a_day_to, "text");
564  if (!$a_build_full_period) {
565  // to build full period data we need all values in DB
566  $sql .= " AND " . $a_field . " > " . $ilDB->quote(0, "integer") .
567  " AND " . $a_field . " IS NOT NULL";
568  }
569  if ($a_sub_field) {
570  $sql .= " AND " . $a_sub_field . " = " . $ilDB->quote($a_sub_id, "integer");
571  }
572  $sql .= " GROUP BY ts_day" .
573  " ORDER BY ts_day";
574  $set = $ilDB->query($sql);
575  while ($row = $ilDB->fetchAssoc($set)) {
576  $res[$row["ts_day"]] = $row[$a_field];
577 
578  $deleted = max(($row["deleted"] ?? 0), $deleted);
579  }
580 
581  if ($a_build_full_period) {
582  $period_first = $a_day_from;
583  $period_last = $a_day_to;
584 
585  // check if sub was deleted in period
586  if ($a_table === "wiki_stat_page" && $a_sub_field && $deleted) {
587  $sql = "SELECT MAX(ts_day) last_day, MIN(ts_day) first_day" .
588  " FROM " . $a_table .
589  " WHERE wiki_id = " . $ilDB->quote($a_wiki_id, "integer") .
590  " AND " . $a_sub_field . " = " . $ilDB->quote($a_sub_id, "integer");
591  $set = $ilDB->query($sql);
592  $row = $ilDB->fetchAssoc($set);
593  $last_day = $row["last_day"];
594  if ($last_day < $period_last) {
595  $period_last = $last_day;
596  }
597  $first_day = $row["first_day"];
598  if ($first_day > $period_first) {
599  $period_first = $first_day;
600  }
601  }
602 
603  $last_before_period = null;
604  if (!($res[$a_day_from] ?? false)) {
605  $last_before_period = self::getWikiLast($a_wiki_id, $a_day_from, $a_table, $a_field, $a_sub_field, $a_sub_id);
606  }
607 
608  // no need to allow zero here as we are not building averages
609  self::buildFullPeriodData($res, $period_first, $period_last, $last_before_period);
610  }
611 
612  return $res;
613  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28

◆ getWikiAggrSub()

static ilWikiStat::getWikiAggrSub ( int  $a_wiki_id,
string  $a_day_from,
string  $a_day_to,
string  $a_table,
string  $a_field,
string  $a_aggr_by,
string  $a_aggr_value,
string  $a_aggr_sub,
?string  $a_sub_field = null,
?int  $a_sub_id = null,
bool  $a_build_full_period = false 
)
staticprotected

Definition at line 643 of file class.ilWikiStat.php.

References $DIC, $ilDB, $res, and exit.

655  : array {
656  global $DIC;
657 
658  $ilDB = $DIC->database();
659 
660  $res = array();
661 
662  if (!$a_build_full_period) {
663  $sql = "SELECT ts_day, " . sprintf($a_aggr_value, $a_field) . " " . $a_field .
664  " FROM (" .
665  // subquery to build average per $a_aggr_by
666  " SELECT ts_day, " . sprintf($a_aggr_sub, $a_field) . " " . $a_field .
667  " FROM " . $a_table .
668  " WHERE wiki_id = " . $ilDB->quote($a_wiki_id, "integer") .
669  " AND ts_day >= " . $ilDB->quote($a_day_from, "text") .
670  " AND ts_day <= " . $ilDB->quote($a_day_to, "text") .
671  " AND " . $a_field . " > " . $ilDB->quote(0, "integer") .
672  " AND " . $a_field . " IS NOT NULL";
673  if ($a_sub_field) {
674  $sql .= " AND " . $a_sub_field . " = " . $ilDB->quote($a_sub_id, "integer");
675  }
676  $sql .= " GROUP BY ts_day, " . $a_aggr_by .
677  ") aggr_sub" .
678  " GROUP BY ts_day" .
679  " ORDER BY ts_day";
680  $set = $ilDB->query($sql);
681  while ($row = $ilDB->fetchAssoc($set)) {
682  $res[$row["ts_day"]] = $row[$a_field];
683  }
684  } else {
685  $tmp = $all_aggr_ids = $deleted_in_period = $first_day_in_period = array();
686 
687  if ($a_table !== "wiki_stat_page") {
688  echo "can only build full period averages for wiki_stat_page";
689  exit();
690  }
691 
692  // as current period can be totally empty, gather existing subs
693  $sql = " SELECT *" .
694  " FROM (" .
695  " SELECT " . $a_aggr_by . ", MAX(deleted) deleted, MAX(ts_day) last_day, MIN(ts_day) first_day" .
696  " FROM " . $a_table .
697  " WHERE wiki_id = " . $ilDB->quote($a_wiki_id, "integer") .
698  " GROUP BY " . $a_aggr_by .
699  ") aggr_sub" .
700  " WHERE first_day <= " . $ilDB->quote($a_day_to, "text") . // not created after period
701  " AND (last_day >= " . $ilDB->quote($a_day_from, "text") . // (deleted in/after period
702  " OR deleted = " . $ilDB->quote(0, "integer") . ")"; // or still existing)
703  $set = $ilDB->query($sql);
704  while ($row = $ilDB->fetchAssoc($set)) {
705  $all_aggr_ids[] = $row[$a_aggr_by];
706 
707  // if deleted in period we need the last day
708  if ($row["deleted"] && $row["last_day"] < $a_day_to) {
709  $deleted_in_period[$row[$a_aggr_by]] = $row["last_day"];
710  }
711  // if created in period we need the first day
712  if ($row["first_day"] > $a_day_from) {
713  $first_day_in_period[$row[$a_aggr_by]] = $row["first_day"];
714  }
715  }
716 
717  // we need to build average manually after completing period data (zero is valid)
718  $sql = " SELECT ts_day, " . $a_aggr_by . ", " . sprintf($a_aggr_sub, $a_field) . " " . $a_field .
719  " FROM " . $a_table .
720  " WHERE wiki_id = " . $ilDB->quote($a_wiki_id, "integer") .
721  " AND ts_day >= " . $ilDB->quote($a_day_from, "text") .
722  " AND ts_day <= " . $ilDB->quote($a_day_to, "text");
723  $sql .= " GROUP BY ts_day, " . $a_aggr_by;
724  $set = $ilDB->query($sql);
725  while ($row = $ilDB->fetchAssoc($set)) {
726  if (!in_array($row[$a_aggr_by], $all_aggr_ids)) {
727  throw new ilWikiException("Unexpected wiki_stat_page_entry: " . print_r($row, true));
728  }
729  $tmp[$row[$a_aggr_by]][$row["ts_day"]] = $row[$a_field];
730  }
731 
732  // build full period for each sub
733  foreach ($all_aggr_ids as $aggr_by_id) {
734  // last of entry of sub is before period
735  if (!isset($tmp[$aggr_by_id])) {
736  $tmp[$aggr_by_id] = array();
737  }
738 
739  // get last value before period to add missing entries in period
740  $last_before_period = null;
741  if (!($tmp[$aggr_by_id][$a_day_from] ?? false)) {
742  $last_before_period = self::getWikiLast($a_wiki_id, $a_day_from, $a_table, $a_field, $a_aggr_by, $aggr_by_id);
743  }
744 
745  // if sub was created in period (see above), shorten period accordingly
746  $first_period_day = $first_day_in_period[$aggr_by_id] ?? $a_day_from;
747 
748  // if sub was deleted in period (see above), shorten period accordingly
749  $last_period_day = $deleted_in_period[$aggr_by_id] ?? $a_day_to;
750 
751  // allow zero as we need to correct number of valid subs per day (see below - AVG)
752  self::buildFullPeriodData($tmp[$aggr_by_id], $first_period_day, $last_period_day, $last_before_period, true);
753 
754  // distribute sub to days
755  foreach ($tmp[$aggr_by_id] as $day => $value) {
756  $res[$day][$aggr_by_id] = $value;
757  }
758  }
759 
760  // build average over subs
761  foreach ($res as $day => $values) {
762  switch ($a_aggr_value) {
763  case "AVG(%s)":
764  $res[$day] = array_sum($values) / count($values);
765  break;
766 
767  case "SUM(%s)":
768  $res[$day] = array_sum($values);
769  break;
770 
771  default:
772  throw new ilWikiException("Wiki: unsupport aggr " . $a_aggr_value);
773  break;
774  }
775  }
776  }
777 
778  return $res;
779  }
$res
Definition: ltiservices.php:69
exit
Definition: login.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28

◆ getWikiCharacters()

static ilWikiStat::getWikiCharacters ( int  $a_wiki_id,
string  $a_day_from,
string  $a_day_to 
)
staticprotected

Definition at line 1067 of file class.ilWikiStat.php.

1071  : array {
1072  return self::getWikiAggrSub($a_wiki_id, $a_day_from, $a_day_to, "wiki_stat_page", "num_chars", "page_id", "SUM(%s)", "MAX(%s)", null, null, true);
1073  }

◆ getWikiCharactersAvg()

static ilWikiStat::getWikiCharactersAvg ( int  $a_wiki_id,
string  $a_day_from,
string  $a_day_to 
)
staticprotected

Definition at line 1075 of file class.ilWikiStat.php.

1079  : array {
1080  return self::getWikiAggrSub($a_wiki_id, $a_day_from, $a_day_to, "wiki_stat_page", "num_chars", "page_id", "AVG(%s)", "MAX(%s)", null, null, true);
1081  }

◆ getWikiDeletedPages()

static ilWikiStat::getWikiDeletedPages ( int  $a_wiki_id,
string  $a_day_from,
string  $a_day_to 
)
staticprotected

Definition at line 845 of file class.ilWikiStat.php.

849  : array {
850  return self::getWikiAggr($a_wiki_id, $a_day_from, $a_day_to, "wiki_stat", "del_pages", "SUM(%s)");
851  }

◆ getWikiEditPagesAvg()

static ilWikiStat::getWikiEditPagesAvg ( int  $a_wiki_id,
string  $a_day_from,
string  $a_day_to 
)
staticprotected

Definition at line 889 of file class.ilWikiStat.php.

References $DIC, $ilDB, and $res.

893  : array {
894  global $DIC;
895 
896  $ilDB = $DIC->database();
897 
898  $res = array();
899 
900  $sql = "SELECT ts_day, AVG(num_changed_pages) num_changed_pages" .
901  " FROM (" .
902  // subquery to build average per user
903  " SELECT ts_day, COUNT(DISTINCT(page_id)) num_changed_pages" .
904  " FROM wiki_stat_page_user" .
905  " WHERE wiki_id = " . $ilDB->quote($a_wiki_id, "integer") .
906  " AND ts_day >= " . $ilDB->quote($a_day_from, "text") .
907  " AND ts_day <= " . $ilDB->quote($a_day_to, "text") .
908  " AND changes > " . $ilDB->quote(0, "integer") .
909  " AND changes IS NOT NULL" .
910  " GROUP BY ts_day, user_id" .
911  ") aggr_user" .
912  " GROUP BY ts_day" .
913  " ORDER BY ts_day";
914  $set = $ilDB->query($sql);
915  while ($row = $ilDB->fetchAssoc($set)) {
916  $res[$row["ts_day"]] = $row["num_changed_pages"];
917  }
918 
919  return $res;
920  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28

◆ getWikiEditPagesSum()

static ilWikiStat::getWikiEditPagesSum ( int  $a_wiki_id,
string  $a_day_from,
string  $a_day_to 
)
staticprotected

Definition at line 861 of file class.ilWikiStat.php.

References $DIC, $ilDB, and $res.

865  : array {
866  global $DIC;
867 
868  $ilDB = $DIC->database();
869 
870  $res = array();
871 
872  $sql = "SELECT ts_day, COUNT(DISTINCT(page_id)) num_changed_pages" .
873  " FROM wiki_stat_page_user" .
874  " WHERE wiki_id = " . $ilDB->quote($a_wiki_id, "integer") .
875  " AND ts_day >= " . $ilDB->quote($a_day_from, "text") .
876  " AND ts_day <= " . $ilDB->quote($a_day_to, "text") .
877  " AND changes > " . $ilDB->quote(0, "integer") .
878  " AND changes IS NOT NULL" .
879  " GROUP BY ts_day" .
880  " ORDER BY ts_day";
881  $set = $ilDB->query($sql);
882  while ($row = $ilDB->fetchAssoc($set)) {
883  $res[$row["ts_day"]] = $row["num_changed_pages"];
884  }
885 
886  return $res;
887  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28

◆ getWikiExternalLinks()

static ilWikiStat::getWikiExternalLinks ( int  $a_wiki_id,
string  $a_day_from,
string  $a_day_to 
)
staticprotected

Definition at line 1035 of file class.ilWikiStat.php.

1039  : array {
1040  return self::getWikiAggrSub($a_wiki_id, $a_day_from, $a_day_to, "wiki_stat_page", "ext_links", "page_id", "SUM(%s)", "MAX(%s)", null, null, true);
1041  }

◆ getWikiExternalLinksAvg()

static ilWikiStat::getWikiExternalLinksAvg ( int  $a_wiki_id,
string  $a_day_from,
string  $a_day_to 
)
staticprotected

Definition at line 1043 of file class.ilWikiStat.php.

1047  : array {
1048  return self::getWikiAggrSub($a_wiki_id, $a_day_from, $a_day_to, "wiki_stat_page", "ext_links", "page_id", "AVG(%s)", "MAX(%s)", null, null, true);
1049  }

◆ getWikiFootnotes()

static ilWikiStat::getWikiFootnotes ( int  $a_wiki_id,
string  $a_day_from,
string  $a_day_to 
)
staticprotected

Definition at line 1083 of file class.ilWikiStat.php.

1087  : array {
1088  return self::getWikiAggrSub($a_wiki_id, $a_day_from, $a_day_to, "wiki_stat_page", "footnotes", "page_id", "SUM(%s)", "MAX(%s)", null, null, true);
1089  }

◆ getWikiFootnotesAvg()

static ilWikiStat::getWikiFootnotesAvg ( int  $a_wiki_id,
string  $a_day_from,
string  $a_day_to 
)
staticprotected

Definition at line 1091 of file class.ilWikiStat.php.

1095  : array {
1096  return self::getWikiAggrSub($a_wiki_id, $a_day_from, $a_day_to, "wiki_stat_page", "footnotes", "page_id", "AVG(%s)", "MAX(%s)", null, null, true);
1097  }

◆ getWikiInternalLinks()

static ilWikiStat::getWikiInternalLinks ( int  $a_wiki_id,
string  $a_day_from,
string  $a_day_to 
)
staticprotected

Definition at line 1019 of file class.ilWikiStat.php.

1023  : array {
1024  return self::getWikiAggrSub($a_wiki_id, $a_day_from, $a_day_to, "wiki_stat_page", "int_links", "page_id", "SUM(%s)", "MAX(%s)", null, null, true);
1025  }

◆ getWikiInternalLinksAvg()

static ilWikiStat::getWikiInternalLinksAvg ( int  $a_wiki_id,
string  $a_day_from,
string  $a_day_to 
)
staticprotected

Definition at line 1027 of file class.ilWikiStat.php.

1031  : array {
1032  return self::getWikiAggrSub($a_wiki_id, $a_day_from, $a_day_to, "wiki_stat_page", "int_links", "page_id", "AVG(%s)", "MAX(%s)", null, null, true);
1033  }

◆ getWikiLast()

static ilWikiStat::getWikiLast ( int  $a_wiki_id,
string  $a_day_from,
string  $a_table,
string  $a_field,
?string  $a_sub_field = null,
?int  $a_sub_id = null 
)
staticprotected

Definition at line 615 of file class.ilWikiStat.php.

References $DIC, and $ilDB.

622  : int {
623  global $DIC;
624 
625  $ilDB = $DIC->database();
626 
627  // get last existing value before period (zero is valid)
628  $sql = "SELECT MAX(" . $a_field . ") latest" .
629  " FROM " . $a_table .
630  " WHERE wiki_id = " . $ilDB->quote($a_wiki_id, "integer") .
631  " AND ts_day < " . $ilDB->quote($a_day_from, "text");
632  if ($a_sub_field) {
633  $sql .= " AND " . $a_sub_field . " = " . $ilDB->quote($a_sub_id, "integer");
634  }
635  $sql .= " GROUP BY ts_day" .
636  " ORDER BY ts_day DESC";
637  $ilDB->setLimit(1, 0);
638  $set = $ilDB->query($sql);
639  $last_before_period = $ilDB->fetchAssoc($set);
640  return (int) ($last_before_period["latest"] ?? 0);
641  }
global $DIC
Definition: feed.php:28

◆ getWikiNewPagesAvg()

static ilWikiStat::getWikiNewPagesAvg ( int  $a_wiki_id,
string  $a_day_from,
string  $a_day_to 
)
staticprotected

Definition at line 837 of file class.ilWikiStat.php.

841  : array {
842  return self::getWikiAggrSub($a_wiki_id, $a_day_from, $a_day_to, "wiki_stat_user", "new_pages", "user_id", "AVG(%s)", "SUM(%s)");
843  }

◆ getWikiNewPagesSum()

static ilWikiStat::getWikiNewPagesSum ( int  $a_wiki_id,
string  $a_day_from,
string  $a_day_to 
)
staticprotected

Definition at line 829 of file class.ilWikiStat.php.

833  : array {
834  return self::getWikiAggr($a_wiki_id, $a_day_from, $a_day_to, "wiki_stat_user", "new_pages", "SUM(%s)");
835  }

◆ getWikiNumPages()

static ilWikiStat::getWikiNumPages ( int  $a_wiki_id,
string  $a_day_from,
string  $a_day_to 
)
staticprotected

Definition at line 821 of file class.ilWikiStat.php.

825  : array {
826  return self::getWikiAggr($a_wiki_id, $a_day_from, $a_day_to, "wiki_stat", "num_pages", "MAX(%s)", null, null, true);
827  }

◆ getWikiNumRating()

static ilWikiStat::getWikiNumRating ( int  $a_wiki_id,
string  $a_day_from,
string  $a_day_to 
)
staticprotected

Definition at line 988 of file class.ilWikiStat.php.

992  : array {
993  return self::getWikiAggr($a_wiki_id, $a_day_from, $a_day_to, "wiki_stat_page", "num_ratings", "SUM(%s)");
994  }

◆ getWikiNumRatingAvg()

static ilWikiStat::getWikiNumRatingAvg ( int  $a_wiki_id,
string  $a_day_from,
string  $a_day_to 
)
staticprotected

Definition at line 996 of file class.ilWikiStat.php.

1000  : array {
1001  return self::getWikiAggrSub($a_wiki_id, $a_day_from, $a_day_to, "wiki_stat_page", "num_ratings", "page_id", "AVG(%s)", "SUM(%s)");
1002  }

◆ getWikiPageChanges()

static ilWikiStat::getWikiPageChanges ( int  $a_wiki_id,
int  $a_page_id,
string  $a_day_from,
string  $a_day_to 
)
staticprotected

Definition at line 1104 of file class.ilWikiStat.php.

1109  : array {
1110  return self::getWikiAggr($a_wiki_id, $a_day_from, $a_day_to, "wiki_stat_page_user", "changes", "SUM(%s)", "page_id", $a_page_id);
1111  }

◆ getWikiPageChangesAvg()

static ilWikiStat::getWikiPageChangesAvg ( int  $a_wiki_id,
int  $a_page_id,
string  $a_day_from,
string  $a_day_to 
)
staticprotected

Definition at line 1113 of file class.ilWikiStat.php.

1118  : array {
1119  return self::getWikiAggrSub($a_wiki_id, $a_day_from, $a_day_to, "wiki_stat_page_user", "changes", "user_id", "AVG(%s)", "SUM(%s)", "page_id", $a_page_id);
1120  }

◆ getWikiPageCharacters()

static ilWikiStat::getWikiPageCharacters ( int  $a_wiki_id,
int  $a_page_id,
string  $a_day_from,
string  $a_day_to 
)
staticprotected

Definition at line 1167 of file class.ilWikiStat.php.

1172  : array {
1173  return self::getWikiAggr($a_wiki_id, $a_day_from, $a_day_to, "wiki_stat_page", "num_chars", "MAX(%s)", "page_id", $a_page_id, true);
1174  }

◆ getWikiPageExternalLinks()

static ilWikiStat::getWikiPageExternalLinks ( int  $a_wiki_id,
int  $a_page_id,
string  $a_day_from,
string  $a_day_to 
)
staticprotected

Definition at line 1149 of file class.ilWikiStat.php.

1154  : array {
1155  return self::getWikiAggr($a_wiki_id, $a_day_from, $a_day_to, "wiki_stat_page", "ext_links", "MAX(%s)", "page_id", $a_page_id, true);
1156  }

◆ getWikiPageFootnotes()

static ilWikiStat::getWikiPageFootnotes ( int  $a_wiki_id,
int  $a_page_id,
string  $a_day_from,
string  $a_day_to 
)
staticprotected

Definition at line 1176 of file class.ilWikiStat.php.

1181  : array {
1182  return self::getWikiAggr($a_wiki_id, $a_day_from, $a_day_to, "wiki_stat_page", "footnotes", "MAX(%s)", "page_id", $a_page_id, true);
1183  }

◆ getWikiPageInternalLinks()

static ilWikiStat::getWikiPageInternalLinks ( int  $a_wiki_id,
int  $a_page_id,
string  $a_day_from,
string  $a_day_to 
)
staticprotected

Definition at line 1140 of file class.ilWikiStat.php.

1145  : array {
1146  return self::getWikiAggr($a_wiki_id, $a_day_from, $a_day_to, "wiki_stat_page", "int_links", "MAX(%s)", "page_id", $a_page_id, true);
1147  }

◆ getWikiPageRatings()

static ilWikiStat::getWikiPageRatings ( int  $a_wiki_id,
int  $a_page_id,
string  $a_day_from,
string  $a_day_to 
)
staticprotected

Definition at line 1185 of file class.ilWikiStat.php.

1190  : array {
1191  return self::getWikiAggr($a_wiki_id, $a_day_from, $a_day_to, "wiki_stat_page", "num_ratings", "SUM(%s)", "page_id", $a_page_id);
1192  }

◆ getWikiPageRead()

static ilWikiStat::getWikiPageRead ( int  $a_wiki_id,
int  $a_page_id,
string  $a_day_from,
string  $a_day_to 
)
staticprotected

Definition at line 1131 of file class.ilWikiStat.php.

1136  : array {
1137  return self::getWikiAggr($a_wiki_id, $a_day_from, $a_day_to, "wiki_stat_page_user", "read_events", "SUM(%s)", "page_id", $a_page_id);
1138  }

◆ getWikiPageUserEdit()

static ilWikiStat::getWikiPageUserEdit ( int  $a_wiki_id,
int  $a_page_id,
string  $a_day_from,
string  $a_day_to 
)
staticprotected

Definition at line 1122 of file class.ilWikiStat.php.

1127  : array {
1128  return self::getWikiUserEditPages($a_wiki_id, $a_day_from, $a_day_to, "page_id", $a_page_id);
1129  }

◆ getWikiPageWords()

static ilWikiStat::getWikiPageWords ( int  $a_wiki_id,
int  $a_page_id,
string  $a_day_from,
string  $a_day_to 
)
staticprotected

Definition at line 1158 of file class.ilWikiStat.php.

1163  : array {
1164  return self::getWikiAggr($a_wiki_id, $a_day_from, $a_day_to, "wiki_stat_page", "num_words", "MAX(%s)", "page_id", $a_page_id, true);
1165  }

◆ getWikiRatingAvg()

static ilWikiStat::getWikiRatingAvg ( int  $a_wiki_id,
string  $a_day_from,
string  $a_day_to 
)
staticprotected

Definition at line 1004 of file class.ilWikiStat.php.

References $res.

1008  : array {
1009  $res = self::getWikiAggr($a_wiki_id, $a_day_from, $a_day_to, "wiki_stat", "avg_rating", "AVG(%s)");
1010 
1011  foreach (array_keys($res) as $day) {
1012  // int-to-float
1013  $res[$day] /= 100;
1014  }
1015 
1016  return $res;
1017  }
$res
Definition: ltiservices.php:69

◆ getWikiReadPages()

static ilWikiStat::getWikiReadPages ( int  $a_wiki_id,
string  $a_day_from,
string  $a_day_to 
)
staticprotected

Definition at line 853 of file class.ilWikiStat.php.

857  : array {
858  return self::getWikiAggr($a_wiki_id, $a_day_from, $a_day_to, "wiki_stat_page_user", "read_events", "SUM(%s)");
859  }

◆ getWikiUserEditPages()

static ilWikiStat::getWikiUserEditPages ( int  $a_wiki_id,
string  $a_day_from,
string  $a_day_to,
?string  $a_sub_field = null,
?int  $a_sub_id = null 
)
staticprotected

Definition at line 922 of file class.ilWikiStat.php.

References $DIC, $ilDB, and $res.

928  : array {
929  global $DIC;
930 
931  $ilDB = $DIC->database();
932 
933  $res = array();
934 
935  $sql = "SELECT ts_day, COUNT(DISTINCT(user_id)) num_changed_users" .
936  " FROM wiki_stat_page_user" .
937  " WHERE wiki_id = " . $ilDB->quote($a_wiki_id, "integer") .
938  " AND ts_day >= " . $ilDB->quote($a_day_from, "text") .
939  " AND ts_day <= " . $ilDB->quote($a_day_to, "text") .
940  " AND changes > " . $ilDB->quote(0, "integer") .
941  " AND changes IS NOT NULL";
942  if ($a_sub_field) {
943  $sql .= " AND " . $a_sub_field . " = " . $ilDB->quote($a_sub_id, "integer");
944  }
945  $sql .= " GROUP BY ts_day" .
946  " ORDER BY ts_day";
947  $set = $ilDB->query($sql);
948  while ($row = $ilDB->fetchAssoc($set)) {
949  $res[$row["ts_day"]] = $row["num_changed_users"];
950  }
951 
952  return $res;
953  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28

◆ getWikiUserEditPagesAvg()

static ilWikiStat::getWikiUserEditPagesAvg ( int  $a_wiki_id,
string  $a_day_from,
string  $a_day_to 
)
staticprotected

Definition at line 955 of file class.ilWikiStat.php.

References $DIC, $ilDB, and $res.

959  : array {
960  global $DIC;
961 
962  $ilDB = $DIC->database();
963 
964  $res = array();
965 
966  $sql = "SELECT ts_day, AVG(num_changed_users) num_changed_users" .
967  " FROM (" .
968  // subquery to build average per page
969  " SELECT ts_day, COUNT(DISTINCT(user_id)) num_changed_users" .
970  " FROM wiki_stat_page_user" .
971  " WHERE wiki_id = " . $ilDB->quote($a_wiki_id, "integer") .
972  " AND ts_day >= " . $ilDB->quote($a_day_from, "text") .
973  " AND ts_day <= " . $ilDB->quote($a_day_to, "text") .
974  " AND changes > " . $ilDB->quote(0, "integer") .
975  " AND changes IS NOT NULL" .
976  " GROUP BY ts_day, page_id" .
977  ") aggr_user" .
978  " GROUP BY ts_day" .
979  " ORDER BY ts_day";
980  $set = $ilDB->query($sql);
981  while ($row = $ilDB->fetchAssoc($set)) {
982  $res[$row["ts_day"]] = $row["num_changed_users"];
983  }
984 
985  return $res;
986  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28

◆ getWikiWords()

static ilWikiStat::getWikiWords ( int  $a_wiki_id,
string  $a_day_from,
string  $a_day_to 
)
staticprotected

Definition at line 1051 of file class.ilWikiStat.php.

1055  : array {
1056  return self::getWikiAggrSub($a_wiki_id, $a_day_from, $a_day_to, "wiki_stat_page", "num_words", "page_id", "SUM(%s)", "MAX(%s)", null, null, true);
1057  }

◆ getWikiWordsAvg()

static ilWikiStat::getWikiWordsAvg ( int  $a_wiki_id,
string  $a_day_from,
string  $a_day_to 
)
staticprotected

Definition at line 1059 of file class.ilWikiStat.php.

1063  : array {
1064  return self::getWikiAggrSub($a_wiki_id, $a_day_from, $a_day_to, "wiki_stat_page", "num_words", "page_id", "AVG(%s)", "MAX(%s)", null, null, true);
1065  }

◆ handleEvent()

static ilWikiStat::handleEvent ( int  $a_event,
ilWikiPage  $a_page_obj,
?int  $a_user_id = null,
array  $a_additional_data = null 
)
static

Handle wiki page event.

Definition at line 142 of file class.ilWikiStat.php.

References $DIC, $ilUser, and ANONYMOUS_USER_ID.

Referenced by ilWikiPage\afterUpdate(), ilWikiPage\create(), ilWikiPage\delete(), ilWikiPageGUI\increaseViewCount(), and ilWikiPageGUI\updateStatsRating().

147  : void {
148  global $DIC;
149 
150  $ilUser = $DIC->user();
151 
152  if (!$a_user_id) {
153  $a_user_id = $ilUser->getId();
154  }
155  if (!$a_user_id || $a_user_id === ANONYMOUS_USER_ID) {
156  return;
157  }
158 
159  switch ($a_event) {
160  case self::EVENT_PAGE_CREATED:
161  self::handlePageCreated($a_page_obj, $a_user_id);
162  break;
163 
164  case self::EVENT_PAGE_UPDATED:
165  self::handlePageUpdated($a_page_obj, $a_user_id, $a_additional_data);
166  break;
167 
168  case self::EVENT_PAGE_READ:
169  self::handlePageRead($a_page_obj, $a_user_id);
170  break;
171 
172  case self::EVENT_PAGE_DELETED:
173  self::handlePageDeletion($a_page_obj, $a_user_id);
174  break;
175 
176  case self::EVENT_PAGE_RATING:
177  self::handlePageRating($a_page_obj, $a_user_id);
178  break;
179 
180  default:
181  }
182  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
global $DIC
Definition: feed.php:28
$ilUser
Definition: imgupload.php:34
+ Here is the caller graph for this function:

◆ handlePageCreated()

static ilWikiStat::handlePageCreated ( ilWikiPage  $a_page_obj,
int  $a_user_id 
)
static

Handle wiki page creation.

Definition at line 373 of file class.ilWikiStat.php.

References ilWikiPage\getWikiId().

376  : void {
377  // wiki: num_pages (count)
378  self::writeStat(
379  $a_page_obj->getWikiId(),
380  array(
381  "num_pages" => array("integer", self::countPages($a_page_obj->getWikiId())),
382  "del_pages" => array("integer", 0),
383  "avg_rating" => array("integer", 0)
384  )
385  );
386 
387  // user: new_pages+1
388  self::writeStatUser(
389  $a_page_obj->getWikiId(),
390  $a_user_id,
391  array(
392  "new_pages" => array("increment", 1)
393  )
394  );
395  }
+ Here is the call graph for this function:

◆ handlePageDeletion()

static ilWikiStat::handlePageDeletion ( ilWikiPage  $a_page_obj,
int  $a_user_id 
)
static

Definition at line 443 of file class.ilWikiStat.php.

References $data, $DIC, $ilDB, ilPageObject\getId(), and ilWikiPage\getWikiId().

446  : void {
447  global $DIC;
448 
449  $ilDB = $DIC->database();
450 
451  // copy last entry to have deletion timestamp
452  $sql = "SELECT * " .
453  " FROM wiki_stat_page" .
454  " WHERE wiki_id = " . $ilDB->quote($a_page_obj->getWikiId(), "integer") .
455  " AND page_id = " . $ilDB->quote($a_page_obj->getId(), "integer") .
456  " ORDER BY ts DESC";
457  $ilDB->setLimit(1, 0);
458  $set = $ilDB->query($sql);
459 
460  // #15748
461  if ($ilDB->numRows($set)) {
462  $data = $ilDB->fetchAssoc($set);
463 
464  // see self::handlePageUpdated()
465  $values = array(
466  "int_links" => array("integer", $data["int_links"]),
467  "ext_links" => array("integer", $data["ext_links"]),
468  "footnotes" => array("integer", $data["footnotes"]),
469  "num_words" => array("integer", $data["num_words"]),
470  "num_chars" => array("integer", $data["num_chars"]),
471  "num_ratings" => array("integer", $data["num_ratings"]),
472  "avg_rating" => array("integer", $data["avg_rating"]),
473  );
474  self::writeStatPage($a_page_obj->getWikiId(), $a_page_obj->getId(), $values);
475  }
476 
477  // mark all page entries as deleted
478  $ilDB->manipulate("UPDATE wiki_stat_page" .
479  " SET deleted = " . $ilDB->quote(1, "integer") .
480  " WHERE page_id = " . $ilDB->quote($a_page_obj->getId(), "integer") .
481  " AND wiki_id = " . $ilDB->quote($a_page_obj->getWikiId(), "integer"));
482 
483  // wiki: del_pages+1, num_pages (count), avg_rating
484  $rating = self::getAverageRating($a_page_obj->getWikiId());
485  self::writeStat(
486  $a_page_obj->getWikiId(),
487  array(
488  "del_pages" => array("increment", 1),
489  "num_pages" => array("integer", self::countPages($a_page_obj->getWikiId())),
490  "avg_rating" => array("integer", $rating["avg"] * 100)
491  )
492  );
493  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

◆ handlePageRating()

static ilWikiStat::handlePageRating ( ilWikiPage  $a_page_obj,
int  $a_user_id 
)
static

Definition at line 495 of file class.ilWikiStat.php.

References ilPageObject\getId(), and ilWikiPage\getWikiId().

498  : void {
499  // do page first!
500  $rating = self::getAverageRating($a_page_obj->getWikiId(), $a_page_obj->getId());
501 
502  // wiki_stat_page: num_ratings, avg_rating
503  self::writeStatPage(
504  $a_page_obj->getWikiId(),
505  $a_page_obj->getId(),
506  array(
507  "num_ratings" => array("integer", $rating["cnt"]),
508  "avg_rating" => array("integer", $rating["avg"] * 100),
509  )
510  );
511 
512  $rating = self::getAverageRating($a_page_obj->getWikiId());
513 
514  // wiki_stat: avg_rating
515  $is_update = self::writeStat(
516  $a_page_obj->getWikiId(),
517  array(
518  "avg_rating" => array("integer", $rating["avg"] * 100)
519  )
520  );
521 
522  if (!$is_update) {
523  // wiki: num_pages (count)
524  self::writeStat(
525  $a_page_obj->getWikiId(),
526  array(
527  "num_pages" => array("integer", self::countPages($a_page_obj->getWikiId()))
528  )
529  );
530  }
531  }
+ Here is the call graph for this function:

◆ handlePageRead()

static ilWikiStat::handlePageRead ( ilWikiPage  $a_page_obj,
int  $a_user_id 
)
static

Definition at line 428 of file class.ilWikiStat.php.

References ilPageObject\getId(), and ilWikiPage\getWikiId().

431  : void {
432  // page_user: read_events+1
433  self::writeStatPageUser(
434  $a_page_obj->getWikiId(),
435  $a_page_obj->getId(),
436  $a_user_id,
437  array(
438  "read_events" => array("increment", 1)
439  )
440  );
441  }
+ Here is the call graph for this function:

◆ handlePageUpdated()

static ilWikiStat::handlePageUpdated ( ilWikiPage  $a_page_obj,
int  $a_user_id,
array  $a_page_data = null 
)
static

Handle wiki page update.

Definition at line 400 of file class.ilWikiStat.php.

References ilPageObject\getId(), and ilWikiPage\getWikiId().

404  : void {
405  // page_user: changes+1
406  self::writeStatPageUser(
407  $a_page_obj->getWikiId(),
408  $a_page_obj->getId(),
409  $a_user_id,
410  array(
411  "changes" => array("increment", 1)
412  )
413  );
414 
415  // page: see ilWikiPage::afterUpdate()
416  $values = array(
417  "int_links" => array("integer", $a_page_data["int_links"]),
418  "ext_links" => array("integer", $a_page_data["ext_links"]),
419  "footnotes" => array("integer", $a_page_data["footnotes"]),
420  "num_words" => array("integer", $a_page_data["num_words"]),
421  "num_chars" => array("integer", $a_page_data["num_chars"]),
422  "num_ratings" => array("integer", 0),
423  "avg_rating" => array("integer", 0)
424  );
425  self::writeStatPage($a_page_obj->getWikiId(), $a_page_obj->getId(), $values);
426  }
+ Here is the call graph for this function:

◆ writeData()

static ilWikiStat::writeData ( string  $a_table,
array  $a_primary,
array  $a_values 
)
staticprotected

Write data to DB.

  • Handles update/insert depending on time frame
  • supports increment/decrement custom values

Definition at line 198 of file class.ilWikiStat.php.

References $DIC, $ilDB, ilDBInterface\manipulate(), ilDBInterface\numRows(), ilDBInterface\query(), and ilDBInterface\quote().

202  : bool {
203  global $DIC;
204 
205  $ilDB = $DIC->database();
206 
207  $tstamp = self::getTimestamp();
208  $a_primary["ts"] = array("timestamp", $tstamp);
209 
210  $ilAtomQuery = $ilDB->buildAtomQuery();
211  $ilAtomQuery->addTableLock($a_table);
212 
213  $ilAtomQuery->addQueryCallable(
214  function (ilDBInterface $ilDB) use ($a_table, $a_primary, $a_values, $tstamp, &$is_update) {
215  $primary = array();
216  foreach ($a_primary as $column => $value) {
217  $primary[] = $column . " = " . $ilDB->quote($value[1], $value[0]);
218  }
219  $primary = implode(" AND ", $primary);
220 
221  $set = $ilDB->query("SELECT ts FROM " . $a_table .
222  " WHERE " . $primary);
223 
224  $is_update = (bool) $ilDB->numRows($set);
225 
226  // update (current timeframe)
227  if ($is_update) {
228  $values = array();
229  foreach ($a_values as $column => $value) {
230  if ($value[0] === "increment") {
231  $values[] = $column . " = " . $column . "+1";
232  } elseif ($value[0] === "decrement") {
233  $values[] = $column . " = " . $column . "-1";
234  } else {
235  $values[] = $column . " = " . $ilDB->quote($value[1], $value[0]);
236  }
237  }
238  $values = implode(", ", $values);
239 
240  $sql = "UPDATE " . $a_table .
241  " SET " . $values .
242  " WHERE " . $primary;
243  }
244  // insert (no entry yet for current time frame)
245  else {
246  $a_values = array_merge($a_primary, $a_values);
247  $a_values["ts_day"] = array("text", substr($tstamp, 0, 10));
248  $a_values["ts_hour"] = array("integer", (int) substr($tstamp, 11, 2));
249 
250  $values = array();
251  foreach ($a_values as $column => $value) {
252  $columns[] = $column;
253  if ($value[0] === "increment") {
254  $value[0] = "integer";
255  } elseif ($value[0] === "decrement") {
256  $value[0] = "integer";
257  $value[1] = 0;
258  }
259  $values[] = $ilDB->quote($value[1], $value[0]);
260  }
261  $values = implode(", ", $values);
262  $columns = implode(", ", $columns);
263 
264  $sql = "INSERT INTO " . $a_table .
265  " (" . $columns . ")" .
266  " VALUES (" . $values . ")";
267  }
268  $ilDB->manipulate($sql);
269  }
270  );
271  $ilAtomQuery->run();
272 
273  return $is_update;
274  }
numRows(ilDBStatement $statement)
quote($value, string $type)
global $DIC
Definition: feed.php:28
query(string $query)
Run a (read-only) Query on the database.
manipulate(string $query)
Run a (write) Query on the database.
+ Here is the call graph for this function:

◆ writeStat()

static ilWikiStat::writeStat ( string  $a_wiki_id,
array  $a_values 
)
staticprotected

Write data to wiki_stat.

Definition at line 279 of file class.ilWikiStat.php.

282  : bool {
283  $primary = array(
284  "wiki_id" => array("integer", $a_wiki_id)
285  );
286  return self::writeData("wiki_stat", $primary, $a_values);
287  }

◆ writeStatPage()

static ilWikiStat::writeStatPage ( int  $a_wiki_id,
int  $a_page_id,
array  $a_values 
)
staticprotected

Write data to wiki_stat_page.

Parameters
int$a_wiki_id
int$a_page_id
array$a_values

Definition at line 295 of file class.ilWikiStat.php.

299  : void {
300  $primary = array(
301  "wiki_id" => array("integer", $a_wiki_id),
302  "page_id" => array("integer", $a_page_id),
303  );
304  self::writeData("wiki_stat_page", $primary, $a_values);
305  }

◆ writeStatPageUser()

static ilWikiStat::writeStatPageUser ( int  $a_wiki_id,
int  $a_page_id,
int  $a_user_id,
array  $a_values 
)
staticprotected

Write data to wiki_stat_page_user.

Definition at line 310 of file class.ilWikiStat.php.

315  : void {
316  $primary = array(
317  "wiki_id" => array("integer", $a_wiki_id),
318  "page_id" => array("integer", $a_page_id),
319  "user_id" => array("integer", $a_user_id)
320  );
321  self::writeData("wiki_stat_page_user", $primary, $a_values);
322  }

◆ writeStatUser()

static ilWikiStat::writeStatUser ( int  $a_wiki_id,
int  $a_user_id,
array  $a_values 
)
staticprotected

Write to wiki_stat_user.

Definition at line 327 of file class.ilWikiStat.php.

331  : void {
332  $primary = array(
333  "wiki_id" => array("integer", $a_wiki_id),
334  "user_id" => array("integer", $a_user_id)
335  );
336  self::writeData("wiki_stat_user", $primary, $a_values);
337  }

Field Documentation

◆ EVENT_PAGE_CREATED

const ilWikiStat::EVENT_PAGE_CREATED = 1

Definition at line 95 of file class.ilWikiStat.php.

Referenced by ilWikiPage\create().

◆ EVENT_PAGE_DELETED

const ilWikiStat::EVENT_PAGE_DELETED = 4

Definition at line 98 of file class.ilWikiStat.php.

Referenced by ilWikiPage\delete().

◆ EVENT_PAGE_RATING

const ilWikiStat::EVENT_PAGE_RATING = 5

Definition at line 99 of file class.ilWikiStat.php.

Referenced by ilWikiPageGUI\updateStatsRating().

◆ EVENT_PAGE_READ

const ilWikiStat::EVENT_PAGE_READ = 3

Definition at line 97 of file class.ilWikiStat.php.

Referenced by ilWikiPageGUI\increaseViewCount().

◆ EVENT_PAGE_UPDATED

const ilWikiStat::EVENT_PAGE_UPDATED = 2

Definition at line 96 of file class.ilWikiStat.php.

Referenced by ilWikiPage\afterUpdate().

◆ KEY_FIGURE_WIKI_CHARS

const ilWikiStat::KEY_FIGURE_WIKI_CHARS = 19

Definition at line 119 of file class.ilWikiStat.php.

Referenced by ilWikiStatGUI\renderGraph().

◆ KEY_FIGURE_WIKI_CHARS_AVG

const ilWikiStat::KEY_FIGURE_WIKI_CHARS_AVG = 20

Definition at line 120 of file class.ilWikiStat.php.

Referenced by ilWikiStatGUI\renderGraph().

◆ KEY_FIGURE_WIKI_DELETED_PAGES

const ilWikiStat::KEY_FIGURE_WIKI_DELETED_PAGES = 6

Definition at line 106 of file class.ilWikiStat.php.

Referenced by ilWikiStatGUI\renderGraph().

◆ KEY_FIGURE_WIKI_EDIT_PAGES

const ilWikiStat::KEY_FIGURE_WIKI_EDIT_PAGES = 4

Definition at line 104 of file class.ilWikiStat.php.

Referenced by ilWikiStatGUI\renderGraph().

◆ KEY_FIGURE_WIKI_EDIT_PAGES_AVG

const ilWikiStat::KEY_FIGURE_WIKI_EDIT_PAGES_AVG = 5

Definition at line 105 of file class.ilWikiStat.php.

◆ KEY_FIGURE_WIKI_EXTERNAL_LINKS

const ilWikiStat::KEY_FIGURE_WIKI_EXTERNAL_LINKS = 15

Definition at line 115 of file class.ilWikiStat.php.

Referenced by ilWikiStatGUI\renderGraph().

◆ KEY_FIGURE_WIKI_EXTERNAL_LINKS_AVG

const ilWikiStat::KEY_FIGURE_WIKI_EXTERNAL_LINKS_AVG = 16

Definition at line 116 of file class.ilWikiStat.php.

Referenced by ilWikiStatGUI\renderGraph().

◆ KEY_FIGURE_WIKI_FOOTNOTES

const ilWikiStat::KEY_FIGURE_WIKI_FOOTNOTES = 21

Definition at line 121 of file class.ilWikiStat.php.

Referenced by ilWikiStatGUI\renderGraph().

◆ KEY_FIGURE_WIKI_FOOTNOTES_AVG

const ilWikiStat::KEY_FIGURE_WIKI_FOOTNOTES_AVG = 22

Definition at line 122 of file class.ilWikiStat.php.

Referenced by ilWikiStatGUI\renderGraph().

◆ KEY_FIGURE_WIKI_INTERNAL_LINKS

const ilWikiStat::KEY_FIGURE_WIKI_INTERNAL_LINKS = 13

Definition at line 113 of file class.ilWikiStat.php.

Referenced by ilWikiStatGUI\renderGraph().

◆ KEY_FIGURE_WIKI_INTERNAL_LINKS_AVG

const ilWikiStat::KEY_FIGURE_WIKI_INTERNAL_LINKS_AVG = 14

Definition at line 114 of file class.ilWikiStat.php.

Referenced by ilWikiStatGUI\renderGraph().

◆ KEY_FIGURE_WIKI_NEW_PAGES

const ilWikiStat::KEY_FIGURE_WIKI_NEW_PAGES = 2

Definition at line 102 of file class.ilWikiStat.php.

Referenced by ilWikiStatGUI\renderGraph().

◆ KEY_FIGURE_WIKI_NEW_PAGES_AVG

const ilWikiStat::KEY_FIGURE_WIKI_NEW_PAGES_AVG = 3

Definition at line 103 of file class.ilWikiStat.php.

◆ KEY_FIGURE_WIKI_NUM_PAGES

const ilWikiStat::KEY_FIGURE_WIKI_NUM_PAGES = 1

Definition at line 101 of file class.ilWikiStat.php.

Referenced by ilWikiStatGUI\renderGraph(), and ilWikiStatGUI\viewToolbar().

◆ KEY_FIGURE_WIKI_NUM_RATING

const ilWikiStat::KEY_FIGURE_WIKI_NUM_RATING = 10

Definition at line 110 of file class.ilWikiStat.php.

Referenced by ilWikiStatGUI\renderGraph().

◆ KEY_FIGURE_WIKI_NUM_RATING_AVG

const ilWikiStat::KEY_FIGURE_WIKI_NUM_RATING_AVG = 11

Definition at line 111 of file class.ilWikiStat.php.

◆ KEY_FIGURE_WIKI_PAGE_CHANGES

const ilWikiStat::KEY_FIGURE_WIKI_PAGE_CHANGES = 23

Definition at line 124 of file class.ilWikiStat.php.

Referenced by ilWikiStatGUI\renderGraph(), and ilWikiStatGUI\viewToolbar().

◆ KEY_FIGURE_WIKI_PAGE_CHANGES_AVG

const ilWikiStat::KEY_FIGURE_WIKI_PAGE_CHANGES_AVG = 24

Definition at line 125 of file class.ilWikiStat.php.

◆ KEY_FIGURE_WIKI_PAGE_CHARS

const ilWikiStat::KEY_FIGURE_WIKI_PAGE_CHARS = 30

Definition at line 131 of file class.ilWikiStat.php.

Referenced by ilWikiStatGUI\renderGraph().

◆ KEY_FIGURE_WIKI_PAGE_EXTERNAL_LINKS

const ilWikiStat::KEY_FIGURE_WIKI_PAGE_EXTERNAL_LINKS = 28

Definition at line 129 of file class.ilWikiStat.php.

Referenced by ilWikiStatGUI\renderGraph().

◆ KEY_FIGURE_WIKI_PAGE_FOOTNOTES

const ilWikiStat::KEY_FIGURE_WIKI_PAGE_FOOTNOTES = 31

Definition at line 132 of file class.ilWikiStat.php.

Referenced by ilWikiStatGUI\renderGraph().

◆ KEY_FIGURE_WIKI_PAGE_INTERNAL_LINKS

const ilWikiStat::KEY_FIGURE_WIKI_PAGE_INTERNAL_LINKS = 27

Definition at line 128 of file class.ilWikiStat.php.

Referenced by ilWikiStatGUI\renderGraph().

◆ KEY_FIGURE_WIKI_PAGE_RATINGS

const ilWikiStat::KEY_FIGURE_WIKI_PAGE_RATINGS = 32

Definition at line 133 of file class.ilWikiStat.php.

Referenced by ilWikiStatGUI\renderGraph().

◆ KEY_FIGURE_WIKI_PAGE_READ

const ilWikiStat::KEY_FIGURE_WIKI_PAGE_READ = 26

Definition at line 127 of file class.ilWikiStat.php.

Referenced by ilWikiStatGUI\renderGraph().

◆ KEY_FIGURE_WIKI_PAGE_USER_EDIT

const ilWikiStat::KEY_FIGURE_WIKI_PAGE_USER_EDIT = 25

Definition at line 126 of file class.ilWikiStat.php.

Referenced by ilWikiStatGUI\renderGraph().

◆ KEY_FIGURE_WIKI_PAGE_WORDS

const ilWikiStat::KEY_FIGURE_WIKI_PAGE_WORDS = 29

Definition at line 130 of file class.ilWikiStat.php.

Referenced by ilWikiStatGUI\renderGraph().

◆ KEY_FIGURE_WIKI_RATING_AVG

const ilWikiStat::KEY_FIGURE_WIKI_RATING_AVG = 12

Definition at line 112 of file class.ilWikiStat.php.

Referenced by ilWikiStatGUI\renderGraph().

◆ KEY_FIGURE_WIKI_READ_PAGES

const ilWikiStat::KEY_FIGURE_WIKI_READ_PAGES = 7

Definition at line 107 of file class.ilWikiStat.php.

Referenced by ilWikiStatGUI\renderGraph().

◆ KEY_FIGURE_WIKI_USER_EDIT_PAGES

const ilWikiStat::KEY_FIGURE_WIKI_USER_EDIT_PAGES = 8

Definition at line 108 of file class.ilWikiStat.php.

Referenced by ilWikiStatGUI\renderGraph().

◆ KEY_FIGURE_WIKI_USER_EDIT_PAGES_AVG

const ilWikiStat::KEY_FIGURE_WIKI_USER_EDIT_PAGES_AVG = 9

Definition at line 109 of file class.ilWikiStat.php.

◆ KEY_FIGURE_WIKI_WORDS

const ilWikiStat::KEY_FIGURE_WIKI_WORDS = 17

Definition at line 117 of file class.ilWikiStat.php.

Referenced by ilWikiStatGUI\renderGraph().

◆ KEY_FIGURE_WIKI_WORDS_AVG

const ilWikiStat::KEY_FIGURE_WIKI_WORDS_AVG = 18

Definition at line 118 of file class.ilWikiStat.php.

Referenced by ilWikiStatGUI\renderGraph().


The documentation for this class was generated from the following file: