Download the PHP package esi/simple_counter without Composer
On this page you can find all versions of the php package esi/simple_counter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download esi/simple_counter
More information about esi/simple_counter
Files in esi/simple_counter
Informations about the package simple_counter
Simple Counter - A simple web hit counter.
Simple Counter is a simple PHP counter that counts your website visitors. It has the ability to either show the count as plain text or images; and whether to count only unique hits, or all hits. (IP Based)
Important Note
- As of v6.0.0, Simple Counter is no longer licensed under the GNU LGPLv3 license.
- v6.0.0 is a complete rewrite of the library, and no GNU LGPLv3 licensed code remains.
- v5.0.1 and previous are still licensed under the GNU LGPLv3 license.
With that being said, it is important to read the Upgrading section below if you are coming from an older version.
Acknowledgements
The icons used for the default image set (0-9 'png' images found in counter/images/) are licensed under the CC BY 4.0 DEED license, and were designed by StreamlineHQ.
Upgrading
Pre-v6 -> v6 is not a simple upgrade. Several things have changed in this rewrite, and there are breaking changes.
Please read UPGRADING.md first before attempting an upgrade.
Installation
To install Simple Counter, first install via composer:
There are several options defined by default, however you will likely run into issues if you do not change some of them. More information can be found in Usage below.
- Copy the
counterdirectory fromvendor/esi/simple_counterto your webroot- The
counterdirectory contains thelogsandimagesdirectory. - You can change the name of either directory if you wish, or skip using the
counterdirectory all together and just movelogsandimagesto your webroot. - However:
- The ip file and counter file must remain
ips.jsonandcounter.json - The images must be named 0-9.
- The ip file and counter file must remain
- The
- Make sure the
ips.jsonandcounter.jsonfiles within your logs directory are writable.
Usage
More detailed documentation is a work in progress.
Usage is fairly simple once installed. There is currently one option for the type of counter you wish to use, and that is the FlatfileStorage. A DatabaseStorage is slated for an upcoming release.
Simply add the following code to the page where you want the counter to be shown:
Handling Errors
Simple Counter uses Exceptions for various issues that may arise throughout its process.
Currently, most exceptions fall under \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException.
These exceptions can be thrown if:
- You pass an option that is not defined.
- A given option's value type does not match the allowed types.
- When reading/writing to a file encounters an error, since it is likely due to a file name/location issue.
- For invalid directories or files, in terms of
logDir,imageDir,countFile,ipFile
About
Requirements
- PHP >= 8.2
Credits
Contributing
See CONTRIBUTING.
Bugs and feature requests are tracked on GitHub.
Contributor Covenant Code of Conduct
See CODE_OF_CONDUCT.md
Backward Compatibility Promise
See backward-compatibility.md for more information on Backwards Compatibility.
Changelog
See the CHANGELOG for more information on what has changed recently.
License
See the LICENSE for more information on the license that applies to this project.
Important Note
Simple Counter switched to the MIT license as of v6.0.
Version 5.0.1 and older is licensed under the GNU LGPL v3 License. See the <= 5.x LICENSE.md file for details.
Security
See SECURITY for more information on the security disclosure process.
All versions of simple_counter with dependencies
ext-json Version *
esi/utility Version ^2.2
symfony/options-resolver Version ^7.4 || ^8.0


