diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c1c44c0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,34 @@ +# hidev internals +.hidev/composer.json +.hidev/composer.lock +.hidev/config-local.yml +.hidev/vendor + +# IDE & OS files +.*.swp +.DS_Store +.buildpath +.idea +.project +.settings +Thumbs.db +nbproject + +# vendor dirs +vendor + +# composer lock files +composer.lock + +# php-cs-fixer cache +.php_cs.cache + +# phpunit generated files +coverage.clover + +# Binaries +chkipper.phar +composer.phar +php-cs-fixer.phar +phpunit-skelgen.phar +phpunit.phar diff --git a/.hidev/config.yml b/.hidev/config.yml new file mode 100644 index 0000000..6183644 --- /dev/null +++ b/.hidev/config.yml @@ -0,0 +1,6 @@ +package: + type: yii2-extension + name: yii2-yandex-metrika + title: Yandex.Metrika counter for Yii2 applications + headline: Yii2 Yandex.Metrika + keywords: yii2, yandex, metrika diff --git a/.scrutinizer.yml b/.scrutinizer.yml new file mode 100644 index 0000000..4d60661 --- /dev/null +++ b/.scrutinizer.yml @@ -0,0 +1,9 @@ +checks: + php: + code_rating: true + duplication: true +tools: + php_code_coverage: + enabled: true + external_code_coverage: + timeout: 600 diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..dbe10d1 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,27 @@ +language: php +php: + - 5.6 + - 7 + - 7.1 + - hhvm +sudo: false +dist: trusty +matrix: + allow_failures: + - + php: hhvm +cache: + directories: + - $HOME/.composer/cache +before_install: + - 'composer self-update' + - 'composer --version' + - 'wget http://hiqdev.com/hidev/hidev.phar -O hidev.phar && chmod a+x hidev.phar' + - './hidev.phar --version' + - './hidev.phar travis/before_install' +install: + - './hidev.phar travis/install' +script: + - './hidev.phar travis/script' +after_script: + - './hidev.phar travis/after_script' diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..5674e15 --- /dev/null +++ b/LICENSE @@ -0,0 +1,29 @@ +Copyright © 2014-2017, HiQDev (http://hiqdev.com/) +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of HiQDev nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..d8cb054 --- /dev/null +++ b/README.md @@ -0,0 +1,34 @@ +# Yii2 Yandex.Metrika + +**Yandex.Metrika counter for Yii2 applications** + +[![Latest Stable Version](https://poser.pugx.org/hiqdev/yii2-yandex-metrika/v/stable)](https://packagist.org/packages/hiqdev/yii2-yandex-metrika) +[![Total Downloads](https://poser.pugx.org/hiqdev/yii2-yandex-metrika/downloads)](https://packagist.org/packages/hiqdev/yii2-yandex-metrika) +[![Build Status](https://img.shields.io/travis/hiqdev/yii2-yandex-metrika.svg)](https://travis-ci.org/hiqdev/yii2-yandex-metrika) +[![Scrutinizer Code Coverage](https://img.shields.io/scrutinizer/coverage/g/hiqdev/yii2-yandex-metrika.svg)](https://scrutinizer-ci.com/g/hiqdev/yii2-yandex-metrika/) +[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/hiqdev/yii2-yandex-metrika.svg)](https://scrutinizer-ci.com/g/hiqdev/yii2-yandex-metrika/) + +## Installation + +The preferred way to install this yii2-extension is through [composer](http://getcomposer.org/download/). + +Either run + +```sh +php composer.phar require "hiqdev/yii2-yandex-metrika" +``` + +or add + +```json +"hiqdev/yii2-yandex-metrika": "*" +``` + +to the require section of your composer.json. + +## License + +This project is released under the terms of the BSD-3-Clause [license](LICENSE). +Read more [here](http://choosealicense.com/licenses/bsd-3-clause). + +Copyright © 2014-2017, HiQDev (http://hiqdev.com/) diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..ab004a7 --- /dev/null +++ b/composer.json @@ -0,0 +1,57 @@ +{ + "name": "hiqdev/yii2-yandex-metrika", + "type": "yii2-extension", + "description": "Yandex.Metrika counter for Yii2 applications", + "keywords": [ + "yii2", + "yandex", + "metrika" + ], + "homepage": "https://github.com/hiqdev/yii2-yandex-metrika", + "license": "BSD-3-Clause", + "support": { + "email": "support@hiqdev.com", + "source": "https://github.com/hiqdev/yii2-yandex-metrika", + "issues": "https://github.com/hiqdev/yii2-yandex-metrika/issues", + "wiki": "https://github.com/hiqdev/yii2-yandex-metrika/wiki", + "forum": "http://forum.hiqdev.com/" + }, + "authors": [ + { + "name": "Andrii Vasyliev", + "role": "Project lead", + "email": "sol@hiqdev.com", + "homepage": "http://hipanel.com/" + }, + { + "name": "Dmitry Naumenko", + "role": "Lead backend developer", + "email": "d.naumenko.a@gmail.com", + "homepage": "http://silverfire.me/" + }, + { + "name": "Andrey Klochok", + "role": "Lead frontend developer", + "email": "andreyklochok@gmail.com", + "homepage": "http://hiqdev.com/" + }, + { + "name": "Yuriy Myronchuk", + "role": "QA Lead", + "email": "bladeroot@gmail.com", + "homepage": "http://hiqdev.com/" + } + ], + "require": { + "yiisoft/yii2": "~2.0.0" + }, + "require-dev": { + "hiqdev/hidev-php": "<2.0", + "hiqdev/hidev-hiqdev": "<2.0" + }, + "autoload": { + "psr-4": { + "hiqdev\\yii2\\YandexMetrika\\": "src" + } + } +} diff --git a/src/Component.php b/src/Component.php new file mode 100644 index 0000000..ab99421 --- /dev/null +++ b/src/Component.php @@ -0,0 +1,17 @@ + [ + 'yandexMetrika' => 'yandexMetrika', + ], + 'components' => [ + 'yandexMetrika' => [ + 'class' => \hiqdev\yii2\YandexMetrika\Component::class, + 'id' => $params['yandexMetrika.id'], + 'params' => $params['yandexMetrika.params'], + ], + ], +]; diff --git a/src/config/params.php b/src/config/params.php new file mode 100644 index 0000000..0f31429 --- /dev/null +++ b/src/config/params.php @@ -0,0 +1,20 @@ + null, + 'yandexMetrika.params' => [ + 'webvisor' => null, + 'trackHash' => null, + 'clickmap' => null, + 'trackLinks' => null, + 'accurateTrackBounce' => null, + ], +];