dev-master
9999999-devAWstats Parser for Laravel
MIT
The Requires
- php >=5.6.4
- illuminate/support 5.3.*
by Sam Kitano
laravel awstats
Wallogit.com
2017 © Pedro Peláez
AWstats Parser for Laravel
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., (*1)
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., (*2)
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., (*3)
- PHP >= 5.4 - Laravel 4.2+.
Add the following to the require section in your composer.json file, (*4)
{
"require": {
"samkitano/stats": "dev-master"
}
}
Update your dependencies, (*5)
$ php composer.phar update
Open app/config/app.php, and add a new item to the providers array:, (*6)
'Samkitano\Stats\StatsServiceProvider',
Publish configuration file:, (*7)
$ php artisan config:publish samkitano/stats
You must also Publish the assets files:, (*8)
$ php artisan asset:publish samkitano/stats
Assets like AWstats native icons will be then available on your public/packages/Samkitano/Stats/assets folder., (*9)
Package Settings are available in your app/config/packages/Samkitano/Stats/config.php file., (*10)
AWstats log files path, (*11)
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., (*12)
'AWstats_path' => '/home/USER/tmp/awstats/',
Path to Icon images folder, (*13)
Set to null if you don't intend to display AWstats native icons., (*14)
'icon_path' => 'packages/Samkitano/Stats/assets/images/icon/',
Icon Format, (*15)
Set to 'url' if you want an url pointing to the icon files, or 'tag' (default) if you prefer an img/ html tag. The html img/ tag will include the base64 encoded icon., (*16)
'icon_format' => 'tag',
Units, (*17)
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., (*18)
'units' => false,
To obtain a list of available log files:, (*19)
<?php
// Example
$available_logs = Stats::AWlist();
Results will contain existing AWstats log files structured this way:, (*20)
\domain
\year
\month => file
Retrieve all available data on a given Log File, (*21)
Access trough provided array list:, (*22)
// 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):, (*23)
// 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, (*24)
// Facade Example $data = Stats::Current()
// Retrieve General Section Data $general = Stats::General($file);
Outputs, (*25)
// Retrieve Misc Section Data $misc = Stats::Misc($file);
Outputs, (*26)
// Retrieve Time Section Data $time = Stats::Time($file);
Outputs, (*27)
// Retrieve Domain Section Data $domain = Stats::Domain($file);
Outputs, (*28)
// Retrieve Cluster Section Data // Visit AWstats documentation page for instructions on how to configure and enalble this section $cluster = Stats::Cluster($file);
Outputs, (*29)
// Retrieve Login Section Data $login = Stats::Login($file);
Outputs, (*30)
// Retrieve Robot Section Data $robot = Stats::Robot($file);
Outputs, (*31)
// Retrieve Worms Section Data $worm = Stats::Worm($file);
Outputs, (*32)
// Retrieve Email Sender Section Data // Visit AWstats documentation page for instructions on how to configure and enalble this section $emailsender = Stats::Emailsender($file);
Outputs, (*33)
// Retrieve Email Receiver Section Data // Visit AWstats documentation page for instructions on how to configure and enalble this section $emailreceiver = Stats::Emailreceiver($file);
Outputs, (*34)
// Retrieve File Types Section Data $file_types = Stats::Filetype($file);
Outputs, (*35)
// Retrieve Downloads Section Data $downloads = Stats::Download($file);
Outputs, (*36)
// Retrieve Os Section Data $os = Stats::Os($file);
Outputs, (*37)
// Retrieve Browsers Section Data $browsers = Stats::Browser($file);
Outputs, (*38)
// Retrieve Screen Size Section Data // Visit AWstats documentation page for instructions on how to configure and enalble this section $screensize = Stats::ScreenSize($file);
Outputs, (*39)
// Retrieve Unknown Referer Section Data $unknown_referer = Stats::UnknownReferer($file);
Outputs, (*40)
// Retrieve Unknown Referer Browser Section Data $unknown_referer_browser = Stats::UnknownRefererBrowser($file);
Outputs, (*41)
// Retrieve Origin Section Data $origin = Stats::Origin($file);
Outputs, (*42)
// Retrieve Search Engine Referrals Section Data $sereferrals = Stats::Sereferrals($file);
Outputs, (*43)
// Retrieve External Page Referers Section Data $external_page_referers = Stats::Pagerefs($file);
Outputs, (*44)
// Retrieve Search Keyphrases Section Data $search_keyphrases = Stats::Searchwords($file);
Outputs, (*45)
// Retrieve Search Keywords Section Data $search_keywords = Stats::Keywords($file);
Outputs, (*46)
// Retrieve Errors Section Data $errors = Stats::Errors($file);
Outputs, (*47)
// Retrieve 404 Errors Section Data $page_not_found_errors = Stats::Sider404($file);
Outputs, (*48)
// Retrieve Visitor Section Data $visitors = Stats::Visitor($file);
Outputs, (*49)
// Retrieve Day Section Data $days = Stats::Day($file);
Outputs, (*50)
// Retrieve Session Section Data $sessions = Stats::Session($file);
Outputs, (*51)
// Retrieve Sider Section Data $internal_links = Stats::Sider($file);
Outputs, (*52)
// Retrieve Best day of month (by hits) $best_day = Stats::Bestday($file);
Outputs, (*53)
Open Source software under MIT License, (*54)
AWstats Parser for Laravel
MIT
laravel awstats