diff --git a/composer.json b/composer.json index 8b4e497..2a9ee7c 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,7 @@ "yiisoft/yii2-composer": "2.0.4", "sizeg/yii2-jwt": "^2.0", "fxp/composer-asset-plugin": "dev-master", - "ext-http": "*" + "endroid/qr-code": "^2.5" }, "require-dev": { "yiisoft/yii2-codeception": "*", diff --git a/composer.lock b/composer.lock index f9ed977..287ea26 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "62617dd27b81a8c6428c875f01cf0dd8", + "content-hash": "d1d630cf85ac72b3cb7d161afee070fe", "packages": [ { "name": "2amigos/yii2-tinymce-widget", @@ -106,6 +106,52 @@ ], "time": "2015-10-23T14:50:49+00:00" }, + { + "name": "bacon/bacon-qr-code", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/Bacon/BaconQrCode.git", + "reference": "5a91b62b9d37cee635bbf8d553f4546057250bee" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/5a91b62b9d37cee635bbf8d553f4546057250bee", + "reference": "5a91b62b9d37cee635bbf8d553f4546057250bee", + "shasum": "" + }, + "require": { + "ext-iconv": "*", + "php": "^5.4|^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8" + }, + "suggest": { + "ext-gd": "to generate QR code images" + }, + "type": "library", + "autoload": { + "psr-0": { + "BaconQrCode": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Ben Scholzen 'DASPRiD'", + "email": "mail@dasprids.de", + "homepage": "http://www.dasprids.de", + "role": "Developer" + } + ], + "description": "BaconQrCode is a QR code generator for PHP.", + "homepage": "https://github.com/Bacon/BaconQrCode", + "time": "2017-10-17T09:59:25+00:00" + }, { "name": "bassjobsen/bootstrap-3-typeahead", "version": "v4.0.0", @@ -703,6 +749,75 @@ ], "time": "2015-11-06T10:35:36+00:00" }, + { + "name": "endroid/qr-code", + "version": "2.5.1", + "source": { + "type": "git", + "url": "https://github.com/endroid/qr-code.git", + "reference": "6062677d3404e0ded40647b8f62ec55ff9722eb7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/endroid/qr-code/zipball/6062677d3404e0ded40647b8f62ec55ff9722eb7", + "reference": "6062677d3404e0ded40647b8f62ec55ff9722eb7", + "shasum": "" + }, + "require": { + "bacon/bacon-qr-code": "^1.0.3", + "ext-gd": "*", + "khanamiryan/qrcode-detector-decoder": "1", + "myclabs/php-enum": "^1.5", + "php": ">=5.6", + "symfony/options-resolver": "^2.7", + "symfony/property-access": "^2.7" + }, + "require-dev": { + "phpunit/phpunit": "^5.7", + "symfony/asset": "^2.7", + "symfony/browser-kit": "^2.7", + "symfony/finder": "^2.7", + "symfony/framework-bundle": "^2.7", + "symfony/http-kernel": "^2.7", + "symfony/templating": "^2.7", + "symfony/twig-bundle": "^2.7", + "symfony/yaml": "^2.7" + }, + "type": "symfony-bundle", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Endroid\\QrCode\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jeroen van den Enden", + "email": "info@endroid.nl", + "homepage": "http://endroid.nl/" + } + ], + "description": "Endroid QR Code", + "homepage": "https://github.com/endroid/QrCode", + "keywords": [ + "bundle", + "code", + "endroid", + "flex", + "qr", + "qrcode", + "symfony" + ], + "time": "2018-05-09T20:26:30+00:00" + }, { "name": "ezyang/htmlpurifier", "version": "v4.11.0", @@ -1978,6 +2093,56 @@ ], "time": "2014-11-09T19:54:17+00:00" }, + { + "name": "khanamiryan/qrcode-detector-decoder", + "version": "1", + "source": { + "type": "git", + "url": "https://github.com/khanamiryan/php-qrcode-detector-decoder.git", + "reference": "96d5f80680b04803c4f1b69d6e01735e876b80c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/khanamiryan/php-qrcode-detector-decoder/zipball/96d5f80680b04803c4f1b69d6e01735e876b80c7", + "reference": "96d5f80680b04803c4f1b69d6e01735e876b80c7", + "shasum": "" + }, + "require": { + "php": "^5.6|^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7" + }, + "type": "library", + "autoload": { + "classmap": [ + "lib/" + ], + "files": [ + "lib/common/customFunctions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ashot Khanamiryan", + "email": "a.khanamiryan@gmail.com", + "homepage": "https://github.com/khanamiryan", + "role": "Developer" + } + ], + "description": "QR code decoder / reader", + "homepage": "https://github.com/khanamiryan/php-qrcode-detector-decoder", + "keywords": [ + "barcode", + "qr", + "zxing" + ], + "time": "2017-01-13T09:11:46+00:00" + }, { "name": "lcobucci/jwt", "version": "3.3.1", @@ -2121,6 +2286,51 @@ "homepage": "http://code.google.com/p/minify/", "time": "2016-03-08T11:49:57+00:00" }, + { + "name": "myclabs/php-enum", + "version": "1.6.6", + "source": { + "type": "git", + "url": "https://github.com/myclabs/php-enum.git", + "reference": "32c4202886c51fbe5cc3a7c34ec5c9a4a790345e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/php-enum/zipball/32c4202886c51fbe5cc3a7c34ec5c9a4a790345e", + "reference": "32c4202886c51fbe5cc3a7c34ec5c9a4a790345e", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": ">=5.4" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35|^5.7|^6.0", + "squizlabs/php_codesniffer": "1.*" + }, + "type": "library", + "autoload": { + "psr-4": { + "MyCLabs\\Enum\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP Enum contributors", + "homepage": "https://github.com/myclabs/php-enum/graphs/contributors" + } + ], + "description": "PHP Enum implementation", + "homepage": "http://github.com/myclabs/php-enum", + "keywords": [ + "enum" + ], + "time": "2019-02-04T21:18:49+00:00" + }, { "name": "natxet/CssMin", "version": "v3.0.4", @@ -2410,8 +2620,186 @@ "mail", "mailer" ], + "abandoned": "symfony/mailer", "time": "2015-06-06T14:19:39+00:00" }, + { + "name": "symfony/options-resolver", + "version": "v2.8.52", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "7aaab725bb58f0e18aa12c61bdadd4793ab4c32b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/7aaab725bb58f0e18aa12c61bdadd4793ab4c32b", + "reference": "7aaab725bb58f0e18aa12c61bdadd4793ab4c32b", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony OptionsResolver Component", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "time": "2018-11-11T11:18:13+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.19.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "aed596913b70fae57be53d86faa2e9ef85a2297b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/aed596913b70fae57be53d86faa2e9ef85a2297b", + "reference": "aed596913b70fae57be53d86faa2e9ef85a2297b", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.19-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2020-10-23T09:01:57+00:00" + }, + { + "name": "symfony/property-access", + "version": "v2.8.52", + "source": { + "type": "git", + "url": "https://github.com/symfony/property-access.git", + "reference": "c8f10191183be9bb0d5a1b8364d3891f1bde07b6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/property-access/zipball/c8f10191183be9bb0d5a1b8364d3891f1bde07b6", + "reference": "c8f10191183be9bb0d5a1b8364d3891f1bde07b6", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/polyfill-ctype": "~1.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\PropertyAccess\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony PropertyAccess Component", + "homepage": "https://symfony.com", + "keywords": [ + "access", + "array", + "extraction", + "index", + "injection", + "object", + "property", + "property path", + "reflection" + ], + "time": "2018-11-11T11:18:13+00:00" + }, { "name": "tedivm/jshrink", "version": "v1.1.0", diff --git a/composer_kiement1.txt b/composer_kiement1.txt deleted file mode 100644 index 6274c95..0000000 --- a/composer_kiement1.txt +++ /dev/null @@ -1,162 +0,0 @@ -sanya@sanyigep ~/public_html/fitness-web $ php composer.phar install -Loading composer repositories with package information -Installing dependencies (including require-dev) from lock file - - Installing yiisoft/yii2-composer (2.0.3) - Loading from cache - - - Installing bower-asset/accounting (v0.3.2) - Loading from cache - - - Installing bower-asset/jquery (2.1.4) - Loading from cache - - - Installing bower-asset/jquery.inputmask (3.1.63) - Loading from cache - - - Installing bower-asset/moment (2.10.6) - Loading from cache - - - Installing bower-asset/punycode (v1.3.2) - Loading from cache - - - Installing bower-asset/bootstrap (v3.3.5) - Loading from cache - - - Installing bower-asset/remarkable-bootstrap-notify (3.1.3) - Loading from cache - - - Installing bower-asset/yii2-pjax (v2.0.4) - Loading from cache - - - Installing cebe/markdown (1.1.0) - Loading from cache - - - Installing ezyang/htmlpurifier (v4.6.0) - Loading from cache - - - Installing yiisoft/yii2 (2.0.6) - Loading from cache - - - Installing yiisoft/yii2-bootstrap (2.0.5) - Loading from cache - - - Installing bower-asset/fontawesome (v4.4.0) - Loading from cache - - - Installing rmrevin/yii2-fontawesome (2.12.2) - Loading from cache - - - Installing cebe/yii2-gravatar (1.1) - Loading from cache - - - Installing almasaeed2010/adminlte (v2.3.2) - Loading from cache - - - Installing dmstr/yii2-adminlte-asset (2.2.4) - Loading from cache - - - Installing kartik-v/bootstrap-fileinput (v4.2.7) - Loading from cache - - - Installing kartik-v/bootstrap-star-rating (v3.5.4) - Loading from cache - - - Installing kartik-v/dependent-dropdown (v1.4.3) - Loading from cache - - - Installing kartik-v/yii2-krajee-base (v1.7.7) - Loading from cache - - - Installing kartik-v/yii2-widget-typeahead (v1.0.1) - Loading from cache - - - Installing kartik-v/yii2-widget-touchspin (v1.2.0) - Loading from cache - - - Installing kartik-v/yii2-widget-timepicker (v1.0.0) - Loading from cache - - - Installing kartik-v/yii2-widget-switchinput (v1.3.0) - Loading from cache - - - Installing kartik-v/yii2-widget-spinner (v1.0.0) - Loading from cache - - - Installing kartik-v/yii2-widget-sidenav (v1.0.0) - Loading from cache - - - Installing kartik-v/yii2-widget-select2 (v2.0.3) - Loading from cache - - - Installing kartik-v/yii2-widget-rating (v1.0.0) - Loading from cache - - - Installing kartik-v/yii2-widget-rangeinput (v1.0.0) - Loading from cache - - - Installing kartik-v/yii2-widget-growl (v1.1.1) - Loading from cache - - - Installing kartik-v/yii2-widget-fileinput (v1.0.3) - Loading from cache - - - Installing kartik-v/yii2-widget-depdrop (v1.0.2) - Loading from cache - - - Installing kartik-v/yii2-widget-datetimepicker (v1.4.0) - Loading from cache - - - Installing kartik-v/yii2-widget-datepicker (v1.3.3) - Loading from cache - - - Installing kartik-v/yii2-widget-colorinput (v1.0.0) - Loading from cache - - - Installing kartik-v/yii2-widget-alert (v1.1.0) - Loading from cache - - - Installing kartik-v/yii2-widget-affix (v1.0.0) - Loading from cache - - - Installing kartik-v/yii2-widget-activeform (v1.4.5) - Loading from cache - - - Installing kartik-v/yii2-widgets (v3.4.0) - Loading from cache - - - Installing bower-asset/jquery-ui (1.11.4) - Loading from cache - - - Installing yiisoft/yii2-jui (2.0.4) - Loading from cache - - - Installing swiftmailer/swiftmailer (v5.4.1) - Loading from cache - - - Installing yiisoft/yii2-swiftmailer (2.0.4) - Loading from cache - - - Installing yiisoft/yii2-codeception (2.0.4) - Loading from cache - - - Installing yiisoft/yii2-debug (2.0.5) - Loading from cache - - - Installing fzaninotto/faker (v1.5.0) - Loading from cache - - - Installing yiisoft/yii2-faker (2.0.3) - Loading from cache - - - Installing phpspec/php-diff (v1.0.2) - Loading from cache - - - Installing bower-asset/typeahead.js (v0.10.5) - Loading from cache - - - Installing yiisoft/yii2-gii (2.0.4) - Loading from cache - -fzaninotto/faker suggests installing ext-intl (*) -Generating autoload files - diff --git a/mobileapi/controllers/PingController.php b/mobileapi/controllers/PingController.php index 89d330b..8f2b2ed 100644 --- a/mobileapi/controllers/PingController.php +++ b/mobileapi/controllers/PingController.php @@ -9,6 +9,7 @@ namespace mobileapi\controllers; use common\components\HttpStatus; +use Endroid\QrCode\QrCode; use Yii; /** @noinspection PhpUnused */ @@ -24,5 +25,17 @@ class PingController extends RestController Yii::$app->response->setStatusCode( HttpStatus::NO_CONTENT ); } + /** @noinspection PhpUnused */ + public function actionQrcode( ) + { + $qrCode = new QrCode('abcd123456'); + $response = \Yii::$app->response; +// $response->sendContentAsFile($qrCode->writeString(),$qrCode->getContentType()); + return [ + 'qrcode' => $qrCode->writeDataUri(), + ]; +// Yii::$app->response->setStatusCode( HttpStatus::NO_CONTENT ); + } + } diff --git a/mobileapi/controllers/RestController.php b/mobileapi/controllers/RestController.php index 3416961..84b722e 100644 --- a/mobileapi/controllers/RestController.php +++ b/mobileapi/controllers/RestController.php @@ -17,11 +17,11 @@ class RestController extends Controller public function behaviors() { $behaviors = parent::behaviors(); - $behaviors['authenticator'] = [ - 'class' => JwtHttpBearerAuth::class, - 'auth' => [$this, 'auth'], - 'optional' => $this->getOptionalActions(), - ]; +// $behaviors['authenticator'] = [ +// 'class' => JwtHttpBearerAuth::class, +// 'auth' => [$this, 'auth'], +// 'optional' => $this->getOptionalActions(), +// ]; return $behaviors; } @@ -30,31 +30,31 @@ class RestController extends Controller * @param Token $token * @return Customer|null */ - public function auth($token) - { - if ( !isset($token ) ) { - return null; - } - try { - $uid = (string) $token->getClaim('uid'); - $customer = Customer::findOne(['id_customer' => $uid]); - if (isset($customer)) { - \Yii::$app->user->setIdentity($customer); - return $customer; - } - } catch (Exception $e) { - Yii::error('Failed to load customer: ' . $e->getMessage()); - } - return null; - } - - /** - * @see AuthMethod::$optional - * @return array - */ - protected function getOptionalActions(){ - return []; - } +// public function auth($token) +// { +// if ( !isset($token ) ) { +// return null; +// } +// try { +// $uid = (string) $token->getClaim('uid'); +// $customer = Customer::findOne(['id_customer' => $uid]); +// if (isset($customer)) { +// \Yii::$app->user->setIdentity($customer); +// return $customer; +// } +// } catch (Exception $e) { +// Yii::error('Failed to load customer: ' . $e->getMessage()); +// } +// return null; +// } +// +// /** +// * @see AuthMethod::$optional +// * @return array +// */ +// protected function getOptionalActions(){ +// return []; +// } } diff --git a/vendor.tar.gz b/vendor.tar.gz new file mode 100644 index 0000000..e89ac59 Binary files /dev/null and b/vendor.tar.gz differ