PHP 클래스 PKPUsageStatsPlugin, pkp-lib

상속: extends GenericPlugin
파일 보기 프로젝트 열기: pkp/pkp-lib 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$_currentUsageEvent array
$_dataPrivacyOn boolean
$_optedOut boolean
$_saltpath string

공개 메소드들

메소드 설명
__construct ( ) Constructor.
_downloadStatsCacheMiss ( $cache, $pubObjectId ) : array Callback to fill cache with data, if empty.
_getColor ( $num ) : string Return a color RGB code to be used in the graph.
_getDownloadStats ( $pubObjectId ) : array Get prepared download statistics from the DB
_hashIp ( $ip, $salt ) : string | boolean Hash (SHA256) the given IP using the given SALT.
_writeUsageEventInLogFile ( $usageEvent )
addJavascriptData ( $data, $pubObjectType, $pubObjectId, $contexts ) : null Add a data set to the script data output
callbackLoadCategory ( $hookName, $args )
callbackLoadHandler ( $hookName, $args )
callbackParseCronTab ( $hookName, $args )
getActions ( $request, $verb )
getAllDownloadsStats ( $pubObjectId, $stats = [] ) Retrieve the allDownloads dataset from the download stats
getDescription ( )
getDisplayName ( )
getFilesPath ( ) : string Get the plugin's files path.
getGeoLocationTool ( ) : mixed Get the geolocation tool to process geo localization data.
getInstallSchemaFile ( )
getInstallSitePluginSettingsFile ( )
getReportPlugin ( ) Get the report plugin object that implements the metric type details.
getSaltpath ( ) : string Get the path to the salt file.
getTemplate ( $args, $template, $smarty ) : string Fetch a template with the requested params
getTemplatePath ( $inCore = false )
getUsageEventCurrentDayLogName ( ) : string Get current day usage event log name.
getUsageEventLogsPath ( ) : string Get the plugin's usage event logs path.
isSitePlugin ( )
loadJavascript ( $contexts ) : null Load the JavaScript assets and pass data to the scripts
logUsageEvent ( $hookName, $args ) : boolean Log the usage event into a file.
manage ( $args, $request )
register ( $category, $path )
statisticsDisplayCallback ( $hookName, $params ) : boolean Adds/renders the submission level metrics markup, if any stats.
templateManagerCallback ( $hookName, $params ) Template manager hook callback.
validateSaltpath ( $saltpath ) : boolean Validate that the path of the salt file exists and is writable.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( )

_downloadStatsCacheMiss() 공개 메소드

Callback to fill cache with data, if empty.
public _downloadStatsCacheMiss ( $cache, $pubObjectId ) : array
$cache FileCache
$pubObjectId int
리턴 array

_getColor() 공개 메소드

Return a color RGB code to be used in the graph.
public _getColor ( $num ) : string
$num integer
리턴 string

_getDownloadStats() 공개 메소드

Get prepared download statistics from the DB
public _getDownloadStats ( $pubObjectId ) : array
$pubObjectId integer
리턴 array

_hashIp() 공개 메소드

NB: This implementation was taken from OA-S directly. See http://sourceforge.net/p/openaccessstati/code-0/3/tree/trunk/logfile-parser/lib/logutils.php We just do not implement the PHP4 part as OJS dropped PHP4 support.
public _hashIp ( $ip, $salt ) : string | boolean
$ip string
$salt string
리턴 string | boolean The hashed IP or boolean false if something went wrong.

_writeUsageEventInLogFile() 공개 메소드

public _writeUsageEventInLogFile ( $usageEvent )
$usageEvent array

addJavascriptData() 공개 메소드

Add a data set to the script data output
public addJavascriptData ( $data, $pubObjectType, $pubObjectId, $contexts ) : null
$data array JS data to pass to the scripts
$pubObjectType string The type of object this data is for
$pubObjectId string The id of the object this data is for
$contexts string|array Contexts in which to load the scripts.
리턴 null

callbackLoadCategory() 공개 메소드

또한 보기: PluginRegistry::loadCategory()
public callbackLoadCategory ( $hookName, $args )

callbackLoadHandler() 공개 메소드

또한 보기: PKPPageRouter::route()
public callbackLoadHandler ( $hookName, $args )

callbackParseCronTab() 공개 메소드

또한 보기: AcronPlugin::parseCronTab()
public callbackParseCronTab ( $hookName, $args )

getActions() 공개 메소드

또한 보기: Plugin::getActions()
public getActions ( $request, $verb )

getAllDownloadsStats() 공개 메소드

Retrieve the allDownloads dataset from the download stats
public getAllDownloadsStats ( $pubObjectId, $stats = [] )
$pubObjectId int ID of the object to get stats for
$stats array Optionally pass in stats that have already been fetched from _getDownloadStats().

getDescription() 공개 메소드

또한 보기: PKPPlugin::getDescription()
public getDescription ( )

getDisplayName() 공개 메소드

또한 보기: PKPPlugin::getDisplayName()
public getDisplayName ( )

getFilesPath() 공개 메소드

Get the plugin's files path.
public getFilesPath ( ) : string
리턴 string

getGeoLocationTool() 공개 메소드

Get the geolocation tool to process geo localization data.
public getGeoLocationTool ( ) : mixed
리턴 mixed GeoLocationTool object or null

getInstallSchemaFile() 공개 메소드

getInstallSitePluginSettingsFile() 공개 메소드

또한 보기: PKPPlugin::getInstallSitePluginSettingsFile()

getReportPlugin() 공개 메소드

Get the report plugin object that implements the metric type details.
public getReportPlugin ( )

getSaltpath() 공개 메소드

Get the path to the salt file.
public getSaltpath ( ) : string
리턴 string

getTemplate() 공개 메소드

Fetch a template with the requested params
public getTemplate ( $args, $template, $smarty ) : string
$args array Variables to assign to the template
$template array Template file name
$smarty object Smarty template object
리턴 string

getTemplatePath() 공개 메소드

public getTemplatePath ( $inCore = false )

getUsageEventCurrentDayLogName() 공개 메소드

Get current day usage event log name.

getUsageEventLogsPath() 공개 메소드

Get the plugin's usage event logs path.
public getUsageEventLogsPath ( ) : string
리턴 string

isSitePlugin() 공개 메소드

또한 보기: PKPPlugin::isSitePlugin()
public isSitePlugin ( )

loadJavascript() 공개 메소드

Load the JavaScript assets and pass data to the scripts
public loadJavascript ( $contexts ) : null
$contexts string|array Contexts in which to load the scripts.
리턴 null

logUsageEvent() 공개 메소드

Log the usage event into a file.
public logUsageEvent ( $hookName, $args ) : boolean
$hookName string
$args array
리턴 boolean

manage() 공개 메소드

또한 보기: PKPPlugin::manage()
public manage ( $args, $request )

register() 공개 메소드

또한 보기: LazyLoadPlugin::register()
public register ( $category, $path )

statisticsDisplayCallback() 공개 메소드

This is temporarily unused. When backend display of statistics is implemented it may be useful.
public statisticsDisplayCallback ( $hookName, $params ) : boolean
$hookName string
$params
리턴 boolean

templateManagerCallback() 공개 메소드

Add ditional header data: JS and CSS for statistics display This is temporarily unused. When backend display of statistics is implemented in my be of use.
public templateManagerCallback ( $hookName, $params )
$hookName string
$params array

validateSaltpath() 공개 메소드

Validate that the path of the salt file exists and is writable.
public validateSaltpath ( $saltpath ) : boolean
$saltpath string
리턴 boolean

프로퍼티 상세

$_currentUsageEvent 공개적으로 프로퍼티

array
public $_currentUsageEvent

$_dataPrivacyOn 공개적으로 프로퍼티

boolean
public $_dataPrivacyOn

$_optedOut 공개적으로 프로퍼티

boolean
public $_optedOut

$_saltpath 공개적으로 프로퍼티

string
public $_saltpath