Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

exp:expviewcountupdate

Count the page views of the web server's access logs into the view counter (ezview_counter), for one siteaccess or several.

Download as PDF

Address: https://doc.exponential.earth/learninminutes/exphelp/viewer/examples/commands/expviewcountupdate.md

On this page

exp:expviewcountupdate

Count the page views of the web server's access logs into the view counter (ezview_counter), for one siteaccess or several.

Script bin/php/expviewcountupdate.php, code in kernel/private/classes/commands/expviewcountupdate.php. Run it from the installation root, as the user the web server runs as:

./console exp:expviewcountupdate --help
./console exp:viewcount:update --help
php bin/php/expviewcountupdate.php --help

Help text

Count the page views of the web server's access logs into the view counter (ezview_counter)
Reads each siteaccess's access log (logfile.ini [AccessLogFileSettings]) from where the last run
stopped, keeps the page views (logfile.ini [ViewCountSettings]) and adds them to the nodes they
showed. Several siteaccesses sharing one log are told apart by the kernel's siteaccess matching.

./console exp:viewcount:update --dry-run --top=20          what a run would count, nothing written
./console exp:viewcount:update                              count (as the cronjob updateviewcount.php)
./console exp:viewcount:update --all-siteaccesses           every siteaccess with a log, not the administrations
./console exp:viewcount:update --siteaccess-list=site,bold  these siteaccesses
./console exp:viewcount:update --dry-run --from-start       the whole log again, as a preview only
./console exp:viewcount:update --skip-to-end                start counting from now: mark the logs as read
./console exp:viewcount:update --reset-state                forget where the runs stopped (the next run reads
                                                            the logs from their first line)
./console exp:viewcount:update --dry-run --format=json      the report as JSON (exp-viewcount/1)
./console exp:viewcount:update --all-siteaccesses --dry-run --log-file=/var/log/httpd/access_log.1 \
      --state-dir=var/tmp/viewcount-trial                    a trial on another log, with a state of its own

Exit code: 0 fine, 1 an error (a log missing, the database refused the counts), 2 usage error,
3 another run held the lock of a log.

Options

OptionValueHelp
--dry-runRead and report, write neither the counts nor the resume state
--all-siteaccessesEvery siteaccess of AvailableSiteAccessList with an access log, except the administrations
--siteaccess-listrequiredThese siteaccesses, comma separated (default: logfile.ini [ViewCountSettings] SiteAccessList[], else the siteaccess of -s)
--log-filerequiredRead this access log for every counted siteaccess, in place of logfile.ini [AccessLogFileSettings]
--state-dirrequiredKeep the resume state here, in place of logfile.ini [ViewCountSettings] StateDir
--from-startWith --dry-run: read the logs from their first line, ignoring the resume state
--skip-to-endCount nothing; set the resume state to the end of the logs, so the next run counts only newer lines
--reset-stateCount nothing; remove the resume state of the siteaccesses, so the next run reads the logs from their first line
--toprequiredList the most viewed nodes of the run (default 0, none)
--formatrequiredtext (default) or json

Read from the option definitions in the code (startup(), getOptions(), options() or ezcConsoleOption). Every script also takes the standard options of the script framework (--help, --siteaccess, --debug, --quiet, --allow-root-user ...).


Generated by ./console exp:help:examples from bin/php/expviewcountupdate.php, kernel/private/classes/commands/expviewcountupdate.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x