Пример #1
0
 /**
  * Returns a list of all available reports. Even not enabled reports will be returned. They will be already sorted
  * depending on the order and category of the report.
  * @return \Piwik\Plugin\Report[]
  * @api
  */
 public static function getAllReports()
 {
     $reports = PluginManager::getInstance()->findMultipleComponents('Reports', '\\Piwik\\Plugin\\Report');
     $cache = new LanguageAwareStaticCache('Reports' . implode('', $reports));
     if (!$cache->has()) {
         $instances = array();
         foreach ($reports as $report) {
             $instances[] = new $report();
         }
         usort($instances, array('self', 'sort'));
         $cache->set($instances);
     }
     return $cache->get();
 }
Пример #2
0
 public static function getDefaultProcessedMetrics()
 {
     $cache = new LanguageAwareStaticCache('DefaultProcessedMetrics');
     if ($cache->has()) {
         return $cache->get();
     }
     $translations = array('nb_actions_per_visit' => 'General_ColumnActionsPerVisit', 'avg_time_on_site' => 'General_ColumnAvgTimeOnSite', 'bounce_rate' => 'General_ColumnBounceRate', 'conversion_rate' => 'General_ColumnConversionRate');
     $translations = array_map(array('\\Piwik\\Piwik', 'translate'), $translations);
     $cache->set($translations);
     return $translations;
 }