Download the PHP package wikibase-solutions/w-s-stats without Composer

On this page you can find all versions of the php package wikibase-solutions/w-s-stats. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package w-s-stats

WSStats

This MediaWiki 1.39.x extension counts pageviews by user

Installation

Create a folder called WSStats in the MediaWiki extensions folder. Copy the content from bitbucket inside this new folder.

Add following to LocalSettings.php `

Run the update script which will automatically create the necessary database tables that this extension needs.

Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Upgrading

If you are upgrading from a version before 2.0, then you must visit the Special Page : Special:WSStats. If the database tables need updating, it will show you there and you can update the tables. You will have to update the tables for statistics to be accurate. This is because we now allow to get statistics based on page titles, while the previous version of WSStats did not store titles.

Configuration

By default Anonymous users and sysops are skipped from stats recording. To change this add following to LocalSettings.php..

Start with Allow statistics for anonymous users:

By default Special Pages are counted as well. To omit Special pages set the following : `

To skip users in certain groups, just add the groupname to "skip_user_groups" : `

Skip page with certain text in their referer url. Default action=edit and veaction=edit are ignored. This configuration option is case sensitive: `

Using the parser function

To retrieve statistics you can use the following parser functions :

Ask number of hits for page id : 9868

This returns a number

You can also ask for statistics based on title, instead of Page Id's.

Ask number of hits for page with title : Main Page

This returns a number

About dates. Dates are in a format of YYYY-MM-DD. Internally WSStats works with Date and Time. This means a date of 2023-10-30 will internally become 2023-10-30 00:00:00. You can also search by date and time. See the example about this.

Ask number of hits for page id : 714 since start date 2018-02-01

This returns a number

Ask number of hits for page id : 714 since start date 2018-02-01 and end date 2018-02-14

This returns a number

You can also get statistics based on date and time Get number of hits for page id : 714 from start date 2023-10-30 14:00:00 and end date 2023-10-30 16:00:00

This returns a number

Filter results on registered users or anonymous users

This returns a number

Get the top ten pages sorted by hits

This returns a table

Get the top ten pages sorted by hits in a date range

This returns a table from 2018-02-01 00:00:00 up to 2018-02-08 00:00:00 ( so not including 2018-02-08 )

Get the top ten pages sorted by hits and show as csv

This returns a csv

Get the top ten pages sorted by hits and insert in a WSArrays variable

This returns nothing but only sets WSArray key. Nothing happens when the WSArrays extension is not installed

Get statistics of one page during a time period and limit to 100 results

New since version 1.0.7

This returns a table

For all queries you can add a unique identifier to only return unique views

This returns a table

This returns a table

For all top ten stats queries you can add limit to get less or more than ten results

This returns a table

Using the lua functions

New in version 2.0

There are two Lua function you can use.

For the parser function that returns a table ( {{#wsstats:stats.. ) you can use wsstats.stats().

For the parser function that returns a number ( {{wsstats:... ) you can use wsstats.stat();

All the arguments are the same as for the parser functions, except :

Example

If you create a Module called WSStats and you add the following content :

You can then do calls like :


All versions of w-s-stats with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
ext-zip Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package wikibase-solutions/w-s-stats contains the following files

Loading the files please wait ....