Package Data | |
---|---|
Maintainer Username: | SamKitano |
Maintainer Contact: | sam.kitano@gmail.com (Sam Kitano) |
Package Create Date: | 2015-02-01 |
Package Last Update: | 2017-01-04 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-12-16 15:00:30 |
Package Statistics | |
---|---|
Total Downloads: | 15 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 3 |
Total Watchers: | 3 |
Total Forks: | 3 |
Total Open Issues: | 1 |
AWstats is a well known open source application, designed to record and parse visitor statistics on your web site host. This Package makes those stats available for your Laravel application.
You should NOT use this package if you don't know what AWstats is, how it works, and how to configure it. You MUST, at the very least, know the location of your AWstats log files in your host.
Since AWstats provides a quite extensive set of data, I would recommend a visit to AWstats web page in order to get acquainted with it's features, setup and documentation.
- PHP >= 5.4
- Laravel 4.2+.
Add the following to the require section in your composer.json file
{
"require": {
"samkitano/stats": "dev-master"
}
}
Update your dependencies
$ php composer.phar update
Open app/config/app.php
, and add a new item to the providers array:
'Samkitano\Stats\StatsServiceProvider',
Publish configuration file:
$ php artisan config:publish samkitano/stats
You must also Publish the assets files:
$ php artisan asset:publish samkitano/stats
Assets like AWstats native icons will be then available on your public/packages/Samkitano/Stats/assets
folder.
Package Settings are available in your app/config/packages/Samkitano/Stats/config.php
file.
AWstats log files path
You must specify the path for the AWstats log files in your host. Usually something like /home/USER/tmp/awstats/
where USER should be your host's username.
'AWstats_path' => '/home/USER/tmp/awstats/',
Path to Icon images folder
Set to null
if you don't intend to display AWstats native icons.
'icon_path' => 'packages/Samkitano/Stats/assets/images/icon/',
Icon Format
Set to 'url'
if you want an url pointing to the icon files, or 'tag'
(default) if you prefer an html tag. The html tag will include the base64 encoded icon.
'icon_format' => 'tag',
Units
Set to true if you want human readable units for bandwidths. Set to false (default) if you intend to perform further calculations based on this results.
'units' => false,
To obtain a list of available log files:
<?php
// Example
$available_logs = Stats::AWlist();
Results will contain existing AWstats log files structured this way:
\domain
\year
\month => file
Retrieve all available data on a given Log File
Access trough provided array list:
// Facade Example
$file = $available_logs['myhost.com']['2015']['January'];
$data = Stats::Read($file);
// Instantiation Example
$data = App::make('stats');
$data->Read($available_logs['myhost.com']['2015']['January']);
Manually, if you know which file to provide (do not include .txt extension):
// Facade Example
$file = '012015.myhost.com';
$data = Stats::Read($file);
// Instantiation Example
$data = App::make('stats');
$data->Read('awstats012015.myhost.com');
Retrieve Current month stats
// Facade Example
$data = Stats::Current()
##Methods
###General
// Retrieve General Section Data
$general = Stats::General($file);
Outputs
###Misc
// Retrieve Misc Section Data
$misc = Stats::Misc($file);
Outputs
###Time
// Retrieve Time Section Data
$time = Stats::Time($file);
Outputs
###Domain
// Retrieve Domain Section Data
$domain = Stats::Domain($file);
Outputs
###Cluster
// Retrieve Cluster Section Data
// Visit AWstats documentation page for instructions on how to configure and enalble this section
$cluster = Stats::Cluster($file);
Outputs
###Login
// Retrieve Login Section Data
$login = Stats::Login($file);
Outputs
###Robot
// Retrieve Robot Section Data
$robot = Stats::Robot($file);
Outputs
###Worms
// Retrieve Worms Section Data
$worm = Stats::Worm($file);
Outputs
###Emailsender
// Retrieve Email Sender Section Data
// Visit AWstats documentation page for instructions on how to configure and enalble this section
$emailsender = Stats::Emailsender($file);
Outputs
###Emailreceiver
// Retrieve Email Receiver Section Data
// Visit AWstats documentation page for instructions on how to configure and enalble this section
$emailreceiver = Stats::Emailreceiver($file);
Outputs
###File Types
// Retrieve File Types Section Data
$file_types = Stats::Filetype($file);
Outputs
##Downloads
// Retrieve Downloads Section Data
$downloads = Stats::Download($file);
Outputs
###Operative Systems
// Retrieve Os Section Data
$os = Stats::Os($file);
Outputs
###Browsers
// Retrieve Browsers Section Data
$browsers = Stats::Browser($file);
Outputs
###Screen Size
// Retrieve Screen Size Section Data
// Visit AWstats documentation page for instructions on how to configure and enalble this section
$screensize = Stats::ScreenSize($file);
Outputs
###Unknown Referer Os
// Retrieve Unknown Referer Section Data
$unknown_referer = Stats::UnknownReferer($file);
Outputs
###Unknown Referer Browser
// Retrieve Unknown Referer Browser Section Data
$unknown_referer_browser = Stats::UnknownRefererBrowser($file);
Outputs
###Origin
// Retrieve Origin Section Data
$origin = Stats::Origin($file);
Outputs
###Search Engine Referrals
// Retrieve Search Engine Referrals Section Data
$sereferrals = Stats::Sereferrals($file);
Outputs
###External Page Referers
// Retrieve External Page Referers Section Data
$external_page_referers = Stats::Pagerefs($file);
Outputs
###Search Keyphrases
// Retrieve Search Keyphrases Section Data
$search_keyphrases = Stats::Searchwords($file);
Outputs
###Search Keywords
// Retrieve Search Keywords Section Data
$search_keywords = Stats::Keywords($file);
Outputs
###Errors
// Retrieve Errors Section Data
$errors = Stats::Errors($file);
Outputs
###Sider 404 Errors
// Retrieve 404 Errors Section Data
$page_not_found_errors = Stats::Sider404($file);
Outputs
##Visitor
// Retrieve Visitor Section Data
$visitors = Stats::Visitor($file);
Outputs
##Day
// Retrieve Day Section Data
$days = Stats::Day($file);
Outputs
###Session
// Retrieve Session Section Data
$sessions = Stats::Session($file);
Outputs
###Sider (Internal links)
// Retrieve Sider Section Data
$internal_links = Stats::Sider($file);
Outputs
###Best Day
// Retrieve Best day of month (by hits)
$best_day = Stats::Bestday($file);
Outputs
#License Open Source software under MIT License