Commit 2c7856adf5a976555f028ff32c8c246c27699e51

Authored by Yarik
2 parents 2efbdec5 0bdfedea

Merge remote-tracking branch 'origin/master'

backend/controllers/SiteController.php
... ... @@ -26,9 +26,13 @@ class SiteController extends Controller
26 26 'allow' => true,
27 27 ],
28 28 [
29   - 'actions' => ['logout', 'index'],
30   - 'allow' => true,
31   - 'roles' => ['@'],
  29 + 'actions' => [
  30 + 'logout',
  31 + 'index',
  32 + 'analytic',
  33 + ],
  34 + 'allow' => true,
  35 + 'roles' => ['@'],
32 36 ],
33 37 ],
34 38 ],
... ... @@ -95,4 +99,9 @@ class SiteController extends Controller
95 99  
96 100 return $this->goHome();
97 101 }
  102 +
  103 + public function actionAnalytic()
  104 + {
  105 + return $this->renderPartial('analytic');
  106 + }
98 107 }
... ...
backend/views/site/analytic.php 0 → 100644
  1 +<?php
  2 + use yii\helpers\VarDumper;
  3 +
  4 + $client = new Google_Client();
  5 +
  6 + $client->setAuthConfig(\Yii::getAlias('@common/config/Artbox-85b8559147bc.json'));
  7 + $client->addScope(Google_Service_Analytics::ANALYTICS_READONLY);
  8 +
  9 + $analytics = new Google_Service_AnalyticsReporting($client);
  10 +
  11 + $profile_id = "119240817";
  12 +
  13 + $dateRange = new Google_Service_AnalyticsReporting_DateRange();
  14 + $dateRange->setStartDate("30daysAgo");
  15 + $dateRange->setEndDate("today");
  16 +
  17 + $sessions = new Google_Service_AnalyticsReporting_Metric();
  18 + $sessions->setExpression('ga:users');
  19 + $sessions->setAlias('Пользователи');
  20 +
  21 + $request = new Google_Service_AnalyticsReporting_ReportRequest();
  22 + $request->setViewId($profile_id);
  23 + $request->setDateRanges($dateRange);
  24 + $request->setMetrics([ $sessions ]);
  25 +
  26 + $body = new Google_Service_AnalyticsReporting_GetReportsRequest();
  27 + $body->setReportRequests([ $request ]);
  28 + $response = $analytics->reports->batchGet($body);
  29 +
  30 + VarDumper::dump($response, 10, true);
0 31 \ No newline at end of file
... ...
common/config/Artbox-85b8559147bc.json 0 → 100644
  1 +{
  2 + "type": "service_account",
  3 + "project_id": "artbox-162314",
  4 + "private_key_id": "85b8559147bc8f40112c57500f6c7fdbac864cc4",
  5 + "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC+oKDeNHMbBLSr\n/t9Uzt1Xrx9biqn7IXCtaoeky/O6wGJwzAAByT6RGgm8qsidas03qpzFuCefK416\n1N+vXNn3PTw4Rr9inpIF8Jd40Xa3hEHBokQWvgUByHax9puH7pXH5jfkUAc4NfEY\nzOBIii5i3g0CFmaQiIsMI2gKXqhbCs4c3zIaJSU8ZqKdxC5WdVnqXj9YoJPDQ+63\nMeJLl8gF8yDfokv5pvqwZs2QJTZXufPEsR7VQzFY04r8ORmNUzGfli4LHyyZxSGA\nYT63VI/c6MoQVPIownv4G3azb9K7xay6Yhm+956Trxj1iGv0g6mSJ4eSIy1F3P/U\n6xRiJW35AgMBAAECggEBAJa22tkz8Lmw28OMjDg6IagczhcLJ99kjfid3Ea/9aB2\nUJ5Lu8mtuajxRDeFc316HmxfmPl94t2mioJN4dh8+dvO71izHsezBVJq6Odd/JWV\nnIOibmDotX62ZpnHlyo+yO82JoR9fWfExizMdpsDnS8PzosS+N5XBlB/gdeJBWSM\nZPSLzEySPSSk9qAYbvxg1hax61SEcrwwQtWPji5x9szqsdPFNtXvufAPPZouijku\nIdYot79aa6WTJbEei/eaVNSMhZXlT1arRsA3X9QW3IG+92UIdm7Ak18x2LeurkeQ\nY8KkFv34f+NEZMHtgi6CUufBdPwUUlNZ3nX49sgGJf0CgYEA77EQEUP0eN1FU2Tf\n07m15KpNt9wpkgrVQSmz42j8HD9uRgZDo98EAt6+p8cGCVKnqibdk1cYHtCqEMMT\nw7oToZf2nACnT4NWnGi0IuBCmDl5yg6vd1BJvI/LE+UqpAMaZq/6VLe8uOoAOk3Y\nAI6yNsEtUkhwnWr6VRYTU43gu+MCgYEAy5j3x95VqRTqgF8fXBr1MLS344sSDtrA\nCRvdddJRaqxNKP+BpzvXB0Evr61dTrnxLNsDfAnCuxAEJkPvX30Fw8OS7n5IWSM+\npxtAq8nqLWPFW2YOV8un05nfZMT+opVcHOKFKxjPuaNHUsnY9kUBOPsKUidKDiKD\nmY7HKy6HjXMCgYEArui2oOLF860EeeaSrx5F7aeZLyIp87iUBgk4jCqATty6y76m\nfV6wvqds2WIStZrrXu8dofdcUqBSegjg02NmD/WksBKKBSwCeACv8wNTlWHbzecJ\nhDfClycXOl1w0F6zVVv1gPzTatzXbbSAe2emBO7S88iI5Va7dnu1frN526ECgYBh\nOjax8wJTUZK/JS3zrUgEL3lVp7dC8sIcV3tF5d9NouTiPEptU41XgJDGQ3M4wmFj\nO2AJnxuoe3iP0YeBwVG8cCw9yn7AWq1z3fbfUviLHodEI5Ob57zIt0XQeKble5BW\nlvJjZ2Dj1Q6dgZkj2kZAMNp36x1ZbLAN5/pDK+A98wKBgQCek7vW3LY6aUtLdkr4\n2UsU8jhdOVecxqqdL0dehPSacJLA+n1uznrlQ3rSDCEDgTrbBwN+lBvEiuWVbSwE\nY8NLLzZLUPKZHcY2V8v5BNfT5gcJe/ehVwE1i7duQeyfw8CY/PSdiv0mSIVETp4S\nBeaQBdluW7V+HMr0rNdopwnptA==\n-----END PRIVATE KEY-----\n",
  6 + "client_email": "artbox@artbox-162314.iam.gserviceaccount.com",
  7 + "client_id": "103445887473700242649",
  8 + "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  9 + "token_uri": "https://accounts.google.com/o/oauth2/token",
  10 + "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
  11 + "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/artbox%40artbox-162314.iam.gserviceaccount.com"
  12 +}
... ...
common/config/main.php
1 1 <?php
  2 + use artbox\core\components\SeoComponent;
  3 +
2 4 return [
3 5 'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
4 6 'components' => [
... ... @@ -17,5 +19,8 @@
17 19 'class' => 'yii2tech\filedb\Connection',
18 20 'path' => '@common/config',
19 21 ],
  22 + 'seo' => [
  23 + 'class' => SeoComponent::className(),
  24 + ],
20 25 ],
21 26 ];
... ...
composer.json
... ... @@ -30,7 +30,8 @@
30 30 "yii2tech/filedb": "^1.0",
31 31 "hiqdev/yii2-asset-pnotify": "^2.1",
32 32 "yiisoft/yii2-imagine": "*",
33   - "2amigos/yii2-tinymce-widget": "*"
  33 + "2amigos/yii2-tinymce-widget": "*",
  34 + "google/apiclient": "^2.0"
34 35 },
35 36 "require-dev": {
36 37 "yiisoft/yii2-debug": "~2.0.0",
... ...
composer.lock
... ... @@ -4,8 +4,8 @@
4 4 "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
5 5 "This file is @generated automatically"
6 6 ],
7   - "hash": "8edc03031d05841e190f26a89923f16a",
8   - "content-hash": "a4388a61af3f169567e804b653d72990",
  7 + "hash": "7024a3493d0dd61f5018018e8987f846",
  8 + "content-hash": "f3f1ac35100ae05210344f07161221a4",
9 9 "packages": [
10 10 {
11 11 "name": "2amigos/yii2-tinymce-widget",
... ... @@ -576,6 +576,49 @@
576 576 "time": "2017-03-13 06:30:53"
577 577 },
578 578 {
  579 + "name": "firebase/php-jwt",
  580 + "version": "v4.0.0",
  581 + "source": {
  582 + "type": "git",
  583 + "url": "https://github.com/firebase/php-jwt.git",
  584 + "reference": "dccf163dc8ed7ed6a00afc06c51ee5186a428d35"
  585 + },
  586 + "dist": {
  587 + "type": "zip",
  588 + "url": "https://api.github.com/repos/firebase/php-jwt/zipball/dccf163dc8ed7ed6a00afc06c51ee5186a428d35",
  589 + "reference": "dccf163dc8ed7ed6a00afc06c51ee5186a428d35",
  590 + "shasum": ""
  591 + },
  592 + "require": {
  593 + "php": ">=5.3.0"
  594 + },
  595 + "type": "library",
  596 + "autoload": {
  597 + "psr-4": {
  598 + "Firebase\\JWT\\": "src"
  599 + }
  600 + },
  601 + "notification-url": "https://packagist.org/downloads/",
  602 + "license": [
  603 + "BSD-3-Clause"
  604 + ],
  605 + "authors": [
  606 + {
  607 + "name": "Neuman Vong",
  608 + "email": "neuman+pear@twilio.com",
  609 + "role": "Developer"
  610 + },
  611 + {
  612 + "name": "Anant Narayanan",
  613 + "email": "anant@php.net",
  614 + "role": "Developer"
  615 + }
  616 + ],
  617 + "description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.",
  618 + "homepage": "https://github.com/firebase/php-jwt",
  619 + "time": "2016-07-18 04:51:16"
  620 + },
  621 + {
579 622 "name": "fortawesome/font-awesome",
580 623 "version": "v4.7.0",
581 624 "source": {
... ... @@ -624,6 +667,325 @@
624 667 "time": "2016-10-24 15:52:54"
625 668 },
626 669 {
  670 + "name": "google/apiclient",
  671 + "version": "v2.1.2",
  672 + "source": {
  673 + "type": "git",
  674 + "url": "https://github.com/google/google-api-php-client.git",
  675 + "reference": "360e656f48c3262a6f7fefc0207521efa66caedf"
  676 + },
  677 + "dist": {
  678 + "type": "zip",
  679 + "url": "https://api.github.com/repos/google/google-api-php-client/zipball/360e656f48c3262a6f7fefc0207521efa66caedf",
  680 + "reference": "360e656f48c3262a6f7fefc0207521efa66caedf",
  681 + "shasum": ""
  682 + },
  683 + "require": {
  684 + "firebase/php-jwt": "~2.0|~3.0|~4.0",
  685 + "google/apiclient-services": "^0.9",
  686 + "google/auth": "^0.11",
  687 + "guzzlehttp/guzzle": "~5.2|~6.0",
  688 + "guzzlehttp/psr7": "^1.2",
  689 + "monolog/monolog": "^1.17",
  690 + "php": ">=5.4",
  691 + "phpseclib/phpseclib": "~0.3.10|~2.0"
  692 + },
  693 + "require-dev": {
  694 + "cache/filesystem-adapter": "^0.3.2",
  695 + "phpunit/phpunit": "~4",
  696 + "squizlabs/php_codesniffer": "~2.3",
  697 + "symfony/css-selector": "~2.1",
  698 + "symfony/dom-crawler": "~2.1"
  699 + },
  700 + "suggest": {
  701 + "cache/filesystem-adapter": "For caching certs and tokens (using Google_Client::setCache)"
  702 + },
  703 + "type": "library",
  704 + "extra": {
  705 + "branch-alias": {
  706 + "dev-master": "2.x-dev"
  707 + }
  708 + },
  709 + "autoload": {
  710 + "psr-0": {
  711 + "Google_": "src/"
  712 + },
  713 + "classmap": [
  714 + "src/Google/Service/"
  715 + ]
  716 + },
  717 + "notification-url": "https://packagist.org/downloads/",
  718 + "license": [
  719 + "Apache-2.0"
  720 + ],
  721 + "description": "Client library for Google APIs",
  722 + "homepage": "http://developers.google.com/api-client-library/php",
  723 + "keywords": [
  724 + "google"
  725 + ],
  726 + "time": "2017-01-11 19:44:46"
  727 + },
  728 + {
  729 + "name": "google/apiclient-services",
  730 + "version": "v0.9",
  731 + "source": {
  732 + "type": "git",
  733 + "url": "https://github.com/google/google-api-php-client-services.git",
  734 + "reference": "c400c655d1b7ca412ad4dd344e569c6865e74a83"
  735 + },
  736 + "dist": {
  737 + "type": "zip",
  738 + "url": "https://api.github.com/repos/google/google-api-php-client-services/zipball/c400c655d1b7ca412ad4dd344e569c6865e74a83",
  739 + "reference": "c400c655d1b7ca412ad4dd344e569c6865e74a83",
  740 + "shasum": ""
  741 + },
  742 + "require": {
  743 + "php": ">=5.4"
  744 + },
  745 + "type": "library",
  746 + "autoload": {
  747 + "psr-0": {
  748 + "Google_Service_": "src"
  749 + }
  750 + },
  751 + "notification-url": "https://packagist.org/downloads/",
  752 + "license": [
  753 + "Apache-2.0"
  754 + ],
  755 + "description": "Client library for Google APIs",
  756 + "homepage": "http://developers.google.com/api-client-library/php",
  757 + "keywords": [
  758 + "google"
  759 + ],
  760 + "time": "2017-01-11 18:53:21"
  761 + },
  762 + {
  763 + "name": "google/auth",
  764 + "version": "v0.11.1",
  765 + "source": {
  766 + "type": "git",
  767 + "url": "https://github.com/google/google-auth-library-php.git",
  768 + "reference": "a240674b08a09949fd5597f7590b3ed83663a12d"
  769 + },
  770 + "dist": {
  771 + "type": "zip",
  772 + "url": "https://api.github.com/repos/google/google-auth-library-php/zipball/a240674b08a09949fd5597f7590b3ed83663a12d",
  773 + "reference": "a240674b08a09949fd5597f7590b3ed83663a12d",
  774 + "shasum": ""
  775 + },
  776 + "require": {
  777 + "firebase/php-jwt": "~2.0|~3.0|~4.0",
  778 + "guzzlehttp/guzzle": "~5.3|~6.0",
  779 + "guzzlehttp/psr7": "~1.2",
  780 + "php": ">=5.4",
  781 + "psr/cache": "^1.0",
  782 + "psr/http-message": "^1.0"
  783 + },
  784 + "require-dev": {
  785 + "friendsofphp/php-cs-fixer": "^1.11",
  786 + "phpunit/phpunit": "3.7.*"
  787 + },
  788 + "type": "library",
  789 + "autoload": {
  790 + "classmap": [
  791 + "src/"
  792 + ],
  793 + "psr-4": {
  794 + "Google\\Auth\\": "src"
  795 + }
  796 + },
  797 + "notification-url": "https://packagist.org/downloads/",
  798 + "license": [
  799 + "Apache-2.0"
  800 + ],
  801 + "description": "Google Auth Library for PHP",
  802 + "homepage": "http://github.com/google/google-auth-library-php",
  803 + "keywords": [
  804 + "Authentication",
  805 + "google",
  806 + "oauth2"
  807 + ],
  808 + "time": "2016-11-02 14:59:14"
  809 + },
  810 + {
  811 + "name": "guzzlehttp/guzzle",
  812 + "version": "6.2.3",
  813 + "source": {
  814 + "type": "git",
  815 + "url": "https://github.com/guzzle/guzzle.git",
  816 + "reference": "8d6c6cc55186db87b7dc5009827429ba4e9dc006"
  817 + },
  818 + "dist": {
  819 + "type": "zip",
  820 + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/8d6c6cc55186db87b7dc5009827429ba4e9dc006",
  821 + "reference": "8d6c6cc55186db87b7dc5009827429ba4e9dc006",
  822 + "shasum": ""
  823 + },
  824 + "require": {
  825 + "guzzlehttp/promises": "^1.0",
  826 + "guzzlehttp/psr7": "^1.4",
  827 + "php": ">=5.5"
  828 + },
  829 + "require-dev": {
  830 + "ext-curl": "*",
  831 + "phpunit/phpunit": "^4.0",
  832 + "psr/log": "^1.0"
  833 + },
  834 + "type": "library",
  835 + "extra": {
  836 + "branch-alias": {
  837 + "dev-master": "6.2-dev"
  838 + }
  839 + },
  840 + "autoload": {
  841 + "files": [
  842 + "src/functions_include.php"
  843 + ],
  844 + "psr-4": {
  845 + "GuzzleHttp\\": "src/"
  846 + }
  847 + },
  848 + "notification-url": "https://packagist.org/downloads/",
  849 + "license": [
  850 + "MIT"
  851 + ],
  852 + "authors": [
  853 + {
  854 + "name": "Michael Dowling",
  855 + "email": "mtdowling@gmail.com",
  856 + "homepage": "https://github.com/mtdowling"
  857 + }
  858 + ],
  859 + "description": "Guzzle is a PHP HTTP client library",
  860 + "homepage": "http://guzzlephp.org/",
  861 + "keywords": [
  862 + "client",
  863 + "curl",
  864 + "framework",
  865 + "http",
  866 + "http client",
  867 + "rest",
  868 + "web service"
  869 + ],
  870 + "time": "2017-02-28 22:50:30"
  871 + },
  872 + {
  873 + "name": "guzzlehttp/promises",
  874 + "version": "v1.3.1",
  875 + "source": {
  876 + "type": "git",
  877 + "url": "https://github.com/guzzle/promises.git",
  878 + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646"
  879 + },
  880 + "dist": {
  881 + "type": "zip",
  882 + "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646",
  883 + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646",
  884 + "shasum": ""
  885 + },
  886 + "require": {
  887 + "php": ">=5.5.0"
  888 + },
  889 + "require-dev": {
  890 + "phpunit/phpunit": "^4.0"
  891 + },
  892 + "type": "library",
  893 + "extra": {
  894 + "branch-alias": {
  895 + "dev-master": "1.4-dev"
  896 + }
  897 + },
  898 + "autoload": {
  899 + "psr-4": {
  900 + "GuzzleHttp\\Promise\\": "src/"
  901 + },
  902 + "files": [
  903 + "src/functions_include.php"
  904 + ]
  905 + },
  906 + "notification-url": "https://packagist.org/downloads/",
  907 + "license": [
  908 + "MIT"
  909 + ],
  910 + "authors": [
  911 + {
  912 + "name": "Michael Dowling",
  913 + "email": "mtdowling@gmail.com",
  914 + "homepage": "https://github.com/mtdowling"
  915 + }
  916 + ],
  917 + "description": "Guzzle promises library",
  918 + "keywords": [
  919 + "promise"
  920 + ],
  921 + "time": "2016-12-20 10:07:11"
  922 + },
  923 + {
  924 + "name": "guzzlehttp/psr7",
  925 + "version": "1.4.2",
  926 + "source": {
  927 + "type": "git",
  928 + "url": "https://github.com/guzzle/psr7.git",
  929 + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c"
  930 + },
  931 + "dist": {
  932 + "type": "zip",
  933 + "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c",
  934 + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c",
  935 + "shasum": ""
  936 + },
  937 + "require": {
  938 + "php": ">=5.4.0",
  939 + "psr/http-message": "~1.0"
  940 + },
  941 + "provide": {
  942 + "psr/http-message-implementation": "1.0"
  943 + },
  944 + "require-dev": {
  945 + "phpunit/phpunit": "~4.0"
  946 + },
  947 + "type": "library",
  948 + "extra": {
  949 + "branch-alias": {
  950 + "dev-master": "1.4-dev"
  951 + }
  952 + },
  953 + "autoload": {
  954 + "psr-4": {
  955 + "GuzzleHttp\\Psr7\\": "src/"
  956 + },
  957 + "files": [
  958 + "src/functions_include.php"
  959 + ]
  960 + },
  961 + "notification-url": "https://packagist.org/downloads/",
  962 + "license": [
  963 + "MIT"
  964 + ],
  965 + "authors": [
  966 + {
  967 + "name": "Michael Dowling",
  968 + "email": "mtdowling@gmail.com",
  969 + "homepage": "https://github.com/mtdowling"
  970 + },
  971 + {
  972 + "name": "Tobias Schultze",
  973 + "homepage": "https://github.com/Tobion"
  974 + }
  975 + ],
  976 + "description": "PSR-7 message implementation that also provides common utility methods",
  977 + "keywords": [
  978 + "http",
  979 + "message",
  980 + "request",
  981 + "response",
  982 + "stream",
  983 + "uri",
  984 + "url"
  985 + ],
  986 + "time": "2017-03-20 17:10:46"
  987 + },
  988 + {
627 989 "name": "hiqdev/yii2-asset-icheck",
628 990 "version": "1.0.2.5",
629 991 "source": {
... ... @@ -1020,99 +1382,412 @@
1020 1382 "time": "2016-06-16 06:53:01"
1021 1383 },
1022 1384 {
  1385 + "name": "monolog/monolog",
  1386 + "version": "1.22.1",
  1387 + "source": {
  1388 + "type": "git",
  1389 + "url": "https://github.com/Seldaek/monolog.git",
  1390 + "reference": "1e044bc4b34e91743943479f1be7a1d5eb93add0"
  1391 + },
  1392 + "dist": {
  1393 + "type": "zip",
  1394 + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/1e044bc4b34e91743943479f1be7a1d5eb93add0",
  1395 + "reference": "1e044bc4b34e91743943479f1be7a1d5eb93add0",
  1396 + "shasum": ""
  1397 + },
  1398 + "require": {
  1399 + "php": ">=5.3.0",
  1400 + "psr/log": "~1.0"
  1401 + },
  1402 + "provide": {
  1403 + "psr/log-implementation": "1.0.0"
  1404 + },
  1405 + "require-dev": {
  1406 + "aws/aws-sdk-php": "^2.4.9 || ^3.0",
  1407 + "doctrine/couchdb": "~1.0@dev",
  1408 + "graylog2/gelf-php": "~1.0",
  1409 + "jakub-onderka/php-parallel-lint": "0.9",
  1410 + "php-amqplib/php-amqplib": "~2.4",
  1411 + "php-console/php-console": "^3.1.3",
  1412 + "phpunit/phpunit": "~4.5",
  1413 + "phpunit/phpunit-mock-objects": "2.3.0",
  1414 + "ruflin/elastica": ">=0.90 <3.0",
  1415 + "sentry/sentry": "^0.13",
  1416 + "swiftmailer/swiftmailer": "~5.3"
  1417 + },
  1418 + "suggest": {
  1419 + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB",
  1420 + "doctrine/couchdb": "Allow sending log messages to a CouchDB server",
  1421 + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)",
  1422 + "ext-mongo": "Allow sending log messages to a MongoDB server",
  1423 + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server",
  1424 + "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver",
  1425 + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib",
  1426 + "php-console/php-console": "Allow sending log messages to Google Chrome",
  1427 + "rollbar/rollbar": "Allow sending log messages to Rollbar",
  1428 + "ruflin/elastica": "Allow sending log messages to an Elastic Search server",
  1429 + "sentry/sentry": "Allow sending log messages to a Sentry server"
  1430 + },
  1431 + "type": "library",
  1432 + "extra": {
  1433 + "branch-alias": {
  1434 + "dev-master": "2.0.x-dev"
  1435 + }
  1436 + },
  1437 + "autoload": {
  1438 + "psr-4": {
  1439 + "Monolog\\": "src/Monolog"
  1440 + }
  1441 + },
  1442 + "notification-url": "https://packagist.org/downloads/",
  1443 + "license": [
  1444 + "MIT"
  1445 + ],
  1446 + "authors": [
  1447 + {
  1448 + "name": "Jordi Boggiano",
  1449 + "email": "j.boggiano@seld.be",
  1450 + "homepage": "http://seld.be"
  1451 + }
  1452 + ],
  1453 + "description": "Sends your logs to files, sockets, inboxes, databases and various web services",
  1454 + "homepage": "http://github.com/Seldaek/monolog",
  1455 + "keywords": [
  1456 + "log",
  1457 + "logging",
  1458 + "psr-3"
  1459 + ],
  1460 + "time": "2017-03-13 07:08:03"
  1461 + },
  1462 + {
1023 1463 "name": "noam148/yii2-image-manager",
1024 1464 "version": "1.2.1",
1025 1465 "source": {
1026 1466 "type": "git",
1027   - "url": "https://github.com/noam148/yii2-image-manager.git",
1028   - "reference": "fa1b8d9c405dec2404065d472105b77e783880ed"
  1467 + "url": "https://github.com/noam148/yii2-image-manager.git",
  1468 + "reference": "fa1b8d9c405dec2404065d472105b77e783880ed"
  1469 + },
  1470 + "dist": {
  1471 + "type": "zip",
  1472 + "url": "https://api.github.com/repos/noam148/yii2-image-manager/zipball/fa1b8d9c405dec2404065d472105b77e783880ed",
  1473 + "reference": "fa1b8d9c405dec2404065d472105b77e783880ed",
  1474 + "shasum": ""
  1475 + },
  1476 + "require": {
  1477 + "kartik-v/yii2-widget-fileinput": "@dev",
  1478 + "noam148/yii2-image-resize": "*",
  1479 + "yiisoft/yii2": "*"
  1480 + },
  1481 + "type": "yii2-extension",
  1482 + "autoload": {
  1483 + "psr-4": {
  1484 + "noam148\\imagemanager\\": ""
  1485 + }
  1486 + },
  1487 + "notification-url": "https://packagist.org/downloads/",
  1488 + "license": [
  1489 + "BSD-3-Clause"
  1490 + ],
  1491 + "authors": [
  1492 + {
  1493 + "name": "Noam148",
  1494 + "homepage": "https://github.com/noam148/"
  1495 + }
  1496 + ],
  1497 + "description": "A Yii2 module/widget for upload and cropping images",
  1498 + "homepage": "https://github.com/noam148/yii2-image-manager",
  1499 + "keywords": [
  1500 + "crop",
  1501 + "extension",
  1502 + "image",
  1503 + "manager",
  1504 + "module",
  1505 + "upload",
  1506 + "widget",
  1507 + "yii2"
  1508 + ],
  1509 + "time": "2017-02-23 14:49:07"
  1510 + },
  1511 + {
  1512 + "name": "noam148/yii2-image-resize",
  1513 + "version": "1.0.1",
  1514 + "source": {
  1515 + "type": "git",
  1516 + "url": "https://github.com/noam148/yii2-image-resize.git",
  1517 + "reference": "75796bdbe9bd66e23f8aff9d44ab431936a5a15e"
  1518 + },
  1519 + "dist": {
  1520 + "type": "zip",
  1521 + "url": "https://api.github.com/repos/noam148/yii2-image-resize/zipball/75796bdbe9bd66e23f8aff9d44ab431936a5a15e",
  1522 + "reference": "75796bdbe9bd66e23f8aff9d44ab431936a5a15e",
  1523 + "shasum": ""
  1524 + },
  1525 + "require": {
  1526 + "yiisoft/yii2": "*",
  1527 + "yiisoft/yii2-imagine": "*"
  1528 + },
  1529 + "type": "yii2-extension",
  1530 + "autoload": {
  1531 + "psr-4": {
  1532 + "noam148\\imageresize\\": ""
  1533 + }
  1534 + },
  1535 + "notification-url": "https://packagist.org/downloads/",
  1536 + "license": [
  1537 + "BSD-3-Clause"
  1538 + ],
  1539 + "authors": [
  1540 + {
  1541 + "name": "Noam148",
  1542 + "homepage": "https://github.com/noam148/"
  1543 + }
  1544 + ],
  1545 + "description": "A Yii2 component for resizing images (on the fly)",
  1546 + "homepage": "https://github.com/noam148/yii2-image-resize",
  1547 + "keywords": [
  1548 + "component",
  1549 + "extension",
  1550 + "image",
  1551 + "on-the-fly",
  1552 + "resize",
  1553 + "yii2"
  1554 + ],
  1555 + "time": "2016-11-29 18:17:37"
  1556 + },
  1557 + {
  1558 + "name": "phpseclib/phpseclib",
  1559 + "version": "2.0.4",
  1560 + "source": {
  1561 + "type": "git",
  1562 + "url": "https://github.com/phpseclib/phpseclib.git",
  1563 + "reference": "ab8028c93c03cc8d9c824efa75dc94f1db2369bf"
  1564 + },
  1565 + "dist": {
  1566 + "type": "zip",
  1567 + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/ab8028c93c03cc8d9c824efa75dc94f1db2369bf",
  1568 + "reference": "ab8028c93c03cc8d9c824efa75dc94f1db2369bf",
  1569 + "shasum": ""
  1570 + },
  1571 + "require": {
  1572 + "php": ">=5.3.3"
  1573 + },
  1574 + "require-dev": {
  1575 + "phing/phing": "~2.7",
  1576 + "phpunit/phpunit": "~4.0",
  1577 + "sami/sami": "~2.0",
  1578 + "squizlabs/php_codesniffer": "~2.0"
  1579 + },
  1580 + "suggest": {
  1581 + "ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.",
  1582 + "ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.",
  1583 + "ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.",
  1584 + "ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations."
  1585 + },
  1586 + "type": "library",
  1587 + "autoload": {
  1588 + "files": [
  1589 + "phpseclib/bootstrap.php"
  1590 + ],
  1591 + "psr-4": {
  1592 + "phpseclib\\": "phpseclib/"
  1593 + }
  1594 + },
  1595 + "notification-url": "https://packagist.org/downloads/",
  1596 + "license": [
  1597 + "MIT"
  1598 + ],
  1599 + "authors": [
  1600 + {
  1601 + "name": "Jim Wigginton",
  1602 + "email": "terrafrost@php.net",
  1603 + "role": "Lead Developer"
  1604 + },
  1605 + {
  1606 + "name": "Patrick Monnerat",
  1607 + "email": "pm@datasphere.ch",
  1608 + "role": "Developer"
  1609 + },
  1610 + {
  1611 + "name": "Andreas Fischer",
  1612 + "email": "bantu@phpbb.com",
  1613 + "role": "Developer"
  1614 + },
  1615 + {
  1616 + "name": "Hans-Jürgen Petrich",
  1617 + "email": "petrich@tronic-media.com",
  1618 + "role": "Developer"
  1619 + },
  1620 + {
  1621 + "name": "Graham Campbell",
  1622 + "email": "graham@alt-three.com",
  1623 + "role": "Developer"
  1624 + }
  1625 + ],
  1626 + "description": "PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.",
  1627 + "homepage": "http://phpseclib.sourceforge.net",
  1628 + "keywords": [
  1629 + "BigInteger",
  1630 + "aes",
  1631 + "asn.1",
  1632 + "asn1",
  1633 + "blowfish",
  1634 + "crypto",
  1635 + "cryptography",
  1636 + "encryption",
  1637 + "rsa",
  1638 + "security",
  1639 + "sftp",
  1640 + "signature",
  1641 + "signing",
  1642 + "ssh",
  1643 + "twofish",
  1644 + "x.509",
  1645 + "x509"
  1646 + ],
  1647 + "time": "2016-10-04 00:57:04"
  1648 + },
  1649 + {
  1650 + "name": "psr/cache",
  1651 + "version": "1.0.1",
  1652 + "source": {
  1653 + "type": "git",
  1654 + "url": "https://github.com/php-fig/cache.git",
  1655 + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8"
  1656 + },
  1657 + "dist": {
  1658 + "type": "zip",
  1659 + "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8",
  1660 + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8",
  1661 + "shasum": ""
  1662 + },
  1663 + "require": {
  1664 + "php": ">=5.3.0"
  1665 + },
  1666 + "type": "library",
  1667 + "extra": {
  1668 + "branch-alias": {
  1669 + "dev-master": "1.0.x-dev"
  1670 + }
  1671 + },
  1672 + "autoload": {
  1673 + "psr-4": {
  1674 + "Psr\\Cache\\": "src/"
  1675 + }
  1676 + },
  1677 + "notification-url": "https://packagist.org/downloads/",
  1678 + "license": [
  1679 + "MIT"
  1680 + ],
  1681 + "authors": [
  1682 + {
  1683 + "name": "PHP-FIG",
  1684 + "homepage": "http://www.php-fig.org/"
  1685 + }
  1686 + ],
  1687 + "description": "Common interface for caching libraries",
  1688 + "keywords": [
  1689 + "cache",
  1690 + "psr",
  1691 + "psr-6"
  1692 + ],
  1693 + "time": "2016-08-06 20:24:11"
  1694 + },
  1695 + {
  1696 + "name": "psr/http-message",
  1697 + "version": "1.0.1",
  1698 + "source": {
  1699 + "type": "git",
  1700 + "url": "https://github.com/php-fig/http-message.git",
  1701 + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
1029 1702 },
1030 1703 "dist": {
1031 1704 "type": "zip",
1032   - "url": "https://api.github.com/repos/noam148/yii2-image-manager/zipball/fa1b8d9c405dec2404065d472105b77e783880ed",
1033   - "reference": "fa1b8d9c405dec2404065d472105b77e783880ed",
  1705 + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
  1706 + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
1034 1707 "shasum": ""
1035 1708 },
1036 1709 "require": {
1037   - "kartik-v/yii2-widget-fileinput": "@dev",
1038   - "noam148/yii2-image-resize": "*",
1039   - "yiisoft/yii2": "*"
  1710 + "php": ">=5.3.0"
  1711 + },
  1712 + "type": "library",
  1713 + "extra": {
  1714 + "branch-alias": {
  1715 + "dev-master": "1.0.x-dev"
  1716 + }
1040 1717 },
1041   - "type": "yii2-extension",
1042 1718 "autoload": {
1043 1719 "psr-4": {
1044   - "noam148\\imagemanager\\": ""
  1720 + "Psr\\Http\\Message\\": "src/"
1045 1721 }
1046 1722 },
1047 1723 "notification-url": "https://packagist.org/downloads/",
1048 1724 "license": [
1049   - "BSD-3-Clause"
  1725 + "MIT"
1050 1726 ],
1051 1727 "authors": [
1052 1728 {
1053   - "name": "Noam148",
1054   - "homepage": "https://github.com/noam148/"
  1729 + "name": "PHP-FIG",
  1730 + "homepage": "http://www.php-fig.org/"
1055 1731 }
1056 1732 ],
1057   - "description": "A Yii2 module/widget for upload and cropping images",
1058   - "homepage": "https://github.com/noam148/yii2-image-manager",
  1733 + "description": "Common interface for HTTP messages",
  1734 + "homepage": "https://github.com/php-fig/http-message",
1059 1735 "keywords": [
1060   - "crop",
1061   - "extension",
1062   - "image",
1063   - "manager",
1064   - "module",
1065   - "upload",
1066   - "widget",
1067   - "yii2"
  1736 + "http",
  1737 + "http-message",
  1738 + "psr",
  1739 + "psr-7",
  1740 + "request",
  1741 + "response"
1068 1742 ],
1069   - "time": "2017-02-23 14:49:07"
  1743 + "time": "2016-08-06 14:39:51"
1070 1744 },
1071 1745 {
1072   - "name": "noam148/yii2-image-resize",
1073   - "version": "1.0.1",
  1746 + "name": "psr/log",
  1747 + "version": "1.0.2",
1074 1748 "source": {
1075 1749 "type": "git",
1076   - "url": "https://github.com/noam148/yii2-image-resize.git",
1077   - "reference": "75796bdbe9bd66e23f8aff9d44ab431936a5a15e"
  1750 + "url": "https://github.com/php-fig/log.git",
  1751 + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d"
1078 1752 },
1079 1753 "dist": {
1080 1754 "type": "zip",
1081   - "url": "https://api.github.com/repos/noam148/yii2-image-resize/zipball/75796bdbe9bd66e23f8aff9d44ab431936a5a15e",
1082   - "reference": "75796bdbe9bd66e23f8aff9d44ab431936a5a15e",
  1755 + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
  1756 + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
1083 1757 "shasum": ""
1084 1758 },
1085 1759 "require": {
1086   - "yiisoft/yii2": "*",
1087   - "yiisoft/yii2-imagine": "*"
  1760 + "php": ">=5.3.0"
  1761 + },
  1762 + "type": "library",
  1763 + "extra": {
  1764 + "branch-alias": {
  1765 + "dev-master": "1.0.x-dev"
  1766 + }
1088 1767 },
1089   - "type": "yii2-extension",
1090 1768 "autoload": {
1091 1769 "psr-4": {
1092   - "noam148\\imageresize\\": ""
  1770 + "Psr\\Log\\": "Psr/Log/"
1093 1771 }
1094 1772 },
1095 1773 "notification-url": "https://packagist.org/downloads/",
1096 1774 "license": [
1097   - "BSD-3-Clause"
  1775 + "MIT"
1098 1776 ],
1099 1777 "authors": [
1100 1778 {
1101   - "name": "Noam148",
1102   - "homepage": "https://github.com/noam148/"
  1779 + "name": "PHP-FIG",
  1780 + "homepage": "http://www.php-fig.org/"
1103 1781 }
1104 1782 ],
1105   - "description": "A Yii2 component for resizing images (on the fly)",
1106   - "homepage": "https://github.com/noam148/yii2-image-resize",
  1783 + "description": "Common interface for logging libraries",
  1784 + "homepage": "https://github.com/php-fig/log",
1107 1785 "keywords": [
1108   - "component",
1109   - "extension",
1110   - "image",
1111   - "on-the-fly",
1112   - "resize",
1113   - "yii2"
  1786 + "log",
  1787 + "psr",
  1788 + "psr-3"
1114 1789 ],
1115   - "time": "2016-11-29 18:17:37"
  1790 + "time": "2016-10-10 12:19:37"
1116 1791 },
1117 1792 {
1118 1793 "name": "rmrevin/yii2-fontawesome",
... ... @@ -1614,16 +2289,16 @@
1614 2289 },
1615 2290 {
1616 2291 "name": "yiister/yii2-gentelella",
1617   - "version": "1.2.0",
  2292 + "version": "1.2.1",
1618 2293 "source": {
1619 2294 "type": "git",
1620 2295 "url": "https://github.com/yiister/yii2-gentelella.git",
1621   - "reference": "a4b9b84ea928f3d3811910d7a372ba607293f630"
  2296 + "reference": "6b92d89dc43e5c310c9932e5369f7ef4b59f6ae1"
1622 2297 },
1623 2298 "dist": {
1624 2299 "type": "zip",
1625   - "url": "https://api.github.com/repos/yiister/yii2-gentelella/zipball/a4b9b84ea928f3d3811910d7a372ba607293f630",
1626   - "reference": "a4b9b84ea928f3d3811910d7a372ba607293f630",
  2300 + "url": "https://api.github.com/repos/yiister/yii2-gentelella/zipball/6b92d89dc43e5c310c9932e5369f7ef4b59f6ae1",
  2301 + "reference": "6b92d89dc43e5c310c9932e5369f7ef4b59f6ae1",
1627 2302 "shasum": ""
1628 2303 },
1629 2304 "require": {
... ... @@ -1668,7 +2343,7 @@
1668 2343 "theme",
1669 2344 "yii2"
1670 2345 ],
1671   - "time": "2016-08-01 03:18:02"
  2346 + "time": "2017-03-21 14:59:58"
1672 2347 }
1673 2348 ],
1674 2349 "packages-dev": [
... ... @@ -1987,71 +2662,6 @@
1987 2662 "time": "2016-04-29 12:21:54"
1988 2663 },
1989 2664 {
1990   - "name": "guzzlehttp/psr7",
1991   - "version": "1.4.2",
1992   - "source": {
1993   - "type": "git",
1994   - "url": "https://github.com/guzzle/psr7.git",
1995   - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c"
1996   - },
1997   - "dist": {
1998   - "type": "zip",
1999   - "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c",
2000   - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c",
2001   - "shasum": ""
2002   - },
2003   - "require": {
2004   - "php": ">=5.4.0",
2005   - "psr/http-message": "~1.0"
2006   - },
2007   - "provide": {
2008   - "psr/http-message-implementation": "1.0"
2009   - },
2010   - "require-dev": {
2011   - "phpunit/phpunit": "~4.0"
2012   - },
2013   - "type": "library",
2014   - "extra": {
2015   - "branch-alias": {
2016   - "dev-master": "1.4-dev"
2017   - }
2018   - },
2019   - "autoload": {
2020   - "psr-4": {
2021   - "GuzzleHttp\\Psr7\\": "src/"
2022   - },
2023   - "files": [
2024   - "src/functions_include.php"
2025   - ]
2026   - },
2027   - "notification-url": "https://packagist.org/downloads/",
2028   - "license": [
2029   - "MIT"
2030   - ],
2031   - "authors": [
2032   - {
2033   - "name": "Michael Dowling",
2034   - "email": "mtdowling@gmail.com",
2035   - "homepage": "https://github.com/mtdowling"
2036   - },
2037   - {
2038   - "name": "Tobias Schultze",
2039   - "homepage": "https://github.com/Tobion"
2040   - }
2041   - ],
2042   - "description": "PSR-7 message implementation that also provides common utility methods",
2043   - "keywords": [
2044   - "http",
2045   - "message",
2046   - "request",
2047   - "response",
2048   - "stream",
2049   - "uri",
2050   - "url"
2051   - ],
2052   - "time": "2017-03-20 17:10:46"
2053   - },
2054   - {
2055 2665 "name": "myclabs/deep-copy",
2056 2666 "version": "1.6.0",
2057 2667 "source": {
... ... @@ -2731,103 +3341,6 @@
2731 3341 "time": "2016-12-08 20:27:08"
2732 3342 },
2733 3343 {
2734   - "name": "psr/http-message",
2735   - "version": "1.0.1",
2736   - "source": {
2737   - "type": "git",
2738   - "url": "https://github.com/php-fig/http-message.git",
2739   - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
2740   - },
2741   - "dist": {
2742   - "type": "zip",
2743   - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
2744   - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
2745   - "shasum": ""
2746   - },
2747   - "require": {
2748   - "php": ">=5.3.0"
2749   - },
2750   - "type": "library",
2751   - "extra": {
2752   - "branch-alias": {
2753   - "dev-master": "1.0.x-dev"
2754   - }
2755   - },
2756   - "autoload": {
2757   - "psr-4": {
2758   - "Psr\\Http\\Message\\": "src/"
2759   - }
2760   - },
2761   - "notification-url": "https://packagist.org/downloads/",
2762   - "license": [
2763   - "MIT"
2764   - ],
2765   - "authors": [
2766   - {
2767   - "name": "PHP-FIG",
2768   - "homepage": "http://www.php-fig.org/"
2769   - }
2770   - ],
2771   - "description": "Common interface for HTTP messages",
2772   - "homepage": "https://github.com/php-fig/http-message",
2773   - "keywords": [
2774   - "http",
2775   - "http-message",
2776   - "psr",
2777   - "psr-7",
2778   - "request",
2779   - "response"
2780   - ],
2781   - "time": "2016-08-06 14:39:51"
2782   - },
2783   - {
2784   - "name": "psr/log",
2785   - "version": "1.0.2",
2786   - "source": {
2787   - "type": "git",
2788   - "url": "https://github.com/php-fig/log.git",
2789   - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d"
2790   - },
2791   - "dist": {
2792   - "type": "zip",
2793   - "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
2794   - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
2795   - "shasum": ""
2796   - },
2797   - "require": {
2798   - "php": ">=5.3.0"
2799   - },
2800   - "type": "library",
2801   - "extra": {
2802   - "branch-alias": {
2803   - "dev-master": "1.0.x-dev"
2804   - }
2805   - },
2806   - "autoload": {
2807   - "psr-4": {
2808   - "Psr\\Log\\": "Psr/Log/"
2809   - }
2810   - },
2811   - "notification-url": "https://packagist.org/downloads/",
2812   - "license": [
2813   - "MIT"
2814   - ],
2815   - "authors": [
2816   - {
2817   - "name": "PHP-FIG",
2818   - "homepage": "http://www.php-fig.org/"
2819   - }
2820   - ],
2821   - "description": "Common interface for logging libraries",
2822   - "homepage": "https://github.com/php-fig/log",
2823   - "keywords": [
2824   - "log",
2825   - "psr",
2826   - "psr-3"
2827   - ],
2828   - "time": "2016-10-10 12:19:37"
2829   - },
2830   - {
2831 3344 "name": "sebastian/code-unit-reverse-lookup",
2832 3345 "version": "1.0.1",
2833 3346 "source": {
... ...
frontend/config/main.php
1 1 <?php
2   -$params = array_merge(
  2 + use artbox\core\components\LanguageRequest;
  3 + use artbox\core\components\SeoUrlManager;
  4 +
  5 + $params = array_merge(
3 6 require(__DIR__ . '/../../common/config/params.php'),
4 7 require(__DIR__ . '/../../common/config/params-local.php'),
5 8 require(__DIR__ . '/params.php'),
... ... @@ -14,8 +17,9 @@ return [
14 17 'controllerNamespace' => 'frontend\controllers',
15 18 'components' => [
16 19 'request' => [
  20 + 'class' => LanguageRequest::className(),
17 21 'csrfParam' => '_csrf-frontend',
18   - 'baseUrl' => '',
  22 + 'baseUrl' => '',
19 23 ],
20 24 'user' => [
21 25 'identityClass' => 'common\models\User',
... ... @@ -39,9 +43,10 @@ return [
39 43 'errorAction' => 'site/error',
40 44 ],
41 45 'urlManager' => [
  46 + 'class' => SeoUrlManager::className(),
42 47 'enablePrettyUrl' => true,
43   - 'showScriptName' => false,
44   - 'rules' => [
  48 + 'showScriptName' => false,
  49 + 'rules' => [
45 50 ],
46 51 ],
47 52 ],
... ...
frontend/controllers/PageController.php 0 → 100644
  1 +<?php
  2 + namespace frontend\controllers;
  3 +
  4 + use artbox\core\components\SeoComponent;
  5 + use artbox\core\models\Page;
  6 + use yii\helpers\Json;
  7 + use yii\helpers\Url;
  8 + use yii\web\Controller;
  9 + use yii\web\NotFoundHttpException;
  10 + use Yii;
  11 +
  12 + /**
  13 + * Class PageController
  14 + *
  15 + * @package frontend\controllers
  16 + */
  17 + class PageController extends Controller
  18 + {
  19 + public function actionView($id)
  20 + {
  21 + $model = $this->findModel($id);
  22 +
  23 + /**
  24 + * @var SeoComponent $seo
  25 + */
  26 + $seo = Yii::$app->get('seo');
  27 + $seo->setModel($model->lang);
  28 +
  29 + var_dump(Url::to(Json::decode($model->lang->alias->route)));
  30 +
  31 + return $this->render(
  32 + 'view',
  33 + [
  34 + 'model' => $model,
  35 + ]
  36 + );
  37 + }
  38 +
  39 + protected function findModel($id)
  40 + {
  41 + /**
  42 + * @var Page $model
  43 + */
  44 + $model = Page::find()
  45 + ->where(
  46 + [
  47 + 'id' => $id,
  48 + ]
  49 + )
  50 + ->with('lang')
  51 + ->one();
  52 +
  53 + if (!empty($model)) {
  54 + if ($model->lang->alias_id !== Yii::$app->seo->aliasId) {
  55 + throw new NotFoundHttpException('Wrong language');
  56 + }
  57 + return $model;
  58 + } else {
  59 + throw new NotFoundHttpException('Model not found');
  60 + }
  61 + }
  62 + }
0 63 \ No newline at end of file
... ...
frontend/views/layouts/main.php
... ... @@ -3,6 +3,7 @@
3 3 /* @var $this \yii\web\View */
4 4 /* @var $content string */
5 5  
  6 + use artbox\core\components\SeoComponent;
6 7 use artbox\core\models\Settings;
7 8 use artbox\core\models\User;
8 9 use yii\helpers\Html;
... ... @@ -17,6 +18,11 @@
17 18 * @var User $user
18 19 */
19 20 $user = \Yii::$app->user->identity;
  21 +
  22 + /**
  23 + * @var SeoComponent $seo
  24 + */
  25 + $seo = Yii::$app->get('seo');
20 26 ?>
21 27 <?php $this->beginPage() ?>
22 28 <!DOCTYPE html>
... ... @@ -25,7 +31,7 @@
25 31 <meta charset="<?= Yii::$app->charset ?>">
26 32 <meta name="viewport" content="width=device-width, initial-scale=1">
27 33 <?= Html::csrfMetaTags() ?>
28   - <title><?= Html::encode($this->title) ?></title>
  34 + <title><?= Html::encode($seo->title) ?></title>
29 35 <?php $this->head() ?>
30 36 </head>
31 37 <body>
... ...
frontend/views/page/view.php 0 → 100644
  1 +<?php
  2 + use artbox\core\models\Language;
  3 + use artbox\core\models\Page;
  4 + use yii\helpers\Url;
  5 + use yii\web\View;
  6 +
  7 + /**
  8 + * @var View $this
  9 + * @var Page $model
  10 + */
  11 +?>
  12 +
  13 +<h1>
  14 + <?= $model->lang->title ?>
  15 +
  16 + <?= Url::to(
  17 + [
  18 + 'page/view',
  19 + 'id' => $model->id,
  20 + 'lang' => Language::getCurrent()->id,
  21 + ]
  22 + ) ?>
  23 +</h1>
0 24 \ No newline at end of file
... ...