diff --git a/.gitignore b/.gitignore index 45cca5e..87b42b4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ /vendor/* /config/app.php -/config/lbry.php +/tmp/* /logs/* lbryexplorer.zip lbryexplorer.komodoproject diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 305136b..0000000 --- a/LICENSE +++ /dev/null @@ -1,9 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2017-2018 LBRY Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index 9d99c8b..e69de29 100644 --- a/README.md +++ b/README.md @@ -1,91 +0,0 @@ -# LBRY Block Explorer - -A simple PHP block explorer for browsing transactions and claims on the [LBRY](https://lbry.io) blockchain. The explorer was developed using CakePHP which is a model-view-controller (MVC) PHP framework. - -## Installation -There are some prerequisites that need to be installed before the explorer can be accessed. -* Web server - Apache, caddy or nginx -* [lbrycrd](https://github.com/lbryio/lbrycrd) with txindex turned on -* [Python claims decoder](https://github.com/cryptodevorg/lbry-decoder) -* MariaDB 10.2 or higher -* Redis Server (optional, only required for the CakePHP redis cache engine, or to run `forevermempool`) -* PHP 7.2 or higher - * php-fpm - * [igbinary extension](https://github.com/igbinary/igbinary) - * [phpredis extension](https://github.com/phpredis/phpredis) -* composer (PHP package manager) - -### Installation steps -* Clone the Github repository. `git clone https://github.com/lbryio/block-explorer` -* Create a MariaDB database using the DDL found in `block-explorer/sql/lbryexplorer.ddl.sql` -* Change the working directory to the cloned directory and run composer. -``` -cd block-explorer -composer update -``` -* Create the directories, `tmp` and `logs` in the `block-explorer` folder if they have not been created yet, and make sure that they are writable by the web server. -* Copy `config/app.default.php` to `config/app.php`. Edit the database connection values to correspond to your environment. -* Copy `config/lbry.default.php` to `config/lbry.php`. Update the values for LBRY RPC URL and the Redis URL to correspond to your environment. -* Configure your web server with the host root folder set to `/block-explorer/webroot` where `` is the absolute path to the configuration. Here is a sample nginx configuration. You can make changes to this configuration to correspond to your environment. -``` -server { - listen 80; - server_name my.explorer.com; - - root /var/www/block-explorer/webroot; - index index.php; - - location / { - try_files $uri $uri/ /index.php?$args; - } - - # pass the PHP scripts to FastCGI server listening on the php-fpm socket - location ~ \.php$ { - try_files $uri =404; - include /etc/nginx/fastcgi_params; - fastcgi_pass 127.0.0.1:9000; - fastcgi_index index.php; - fastcgi_ignore_client_abort on; - fastcgi_param PHP_AUTH_USER $remote_user; - fastcgi_param PHP_AUTH_PW $http_authorization; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - } -} -``` -* Restart your web server. - - -### Cron jobs -There are a few scripts which can be set up as cron jobs or scheduled tasks. - -#### blocks.sh -Detect new LBRY blocks. Can also be configured to be triggered using the lbrycrd `blocknotify` flag. This cron will create new blocks obtained from lbrycrd starting from the highest block number in the database, and then create the corresponding block transactions. If there are pending transactions created by the forevermempool script, they will be automatically associated with the respective blocks. - -#### claimindex.sh -Create claims found on the LBRY blockchain in the database. This requires the Python decoder to be running in the background. - -#### pricehistory.sh -Get the current LBC price in USD and store the value in the `PriceHistory` table. This also caches the most recent price in Redis. - -#### forever.sh -Run the `forevermempool` script, and restart if necessary. The `forevermempool` script checks the LBRY blockchain mempool every second and creates transactions found in the database. The script makes use of Redis for caching the pending transaction IDs. - - -## Usage -Launch the URL for the configured web server root in a browser. - - -## Contributing -Contributions to this project are welcome, encouraged, and compensated. For more details, see https://lbry.io/faq/contributing - - -## License -This project is MIT licensed. For the full license, see [LICENSE](LICENSE). - - -## Security -We take security seriously. Please contact security@lbry.io regarding any security issues. Our PGP key is [here](https://keybase.io/lbry/key.asc) if you need it. - - -## Contact -The primary contact for this project is [@akinwale](https://github.com/akinwale) (akinwale@lbry.io) diff --git a/composer.json b/composer.json index 5fd7b2d..79d60c9 100644 --- a/composer.json +++ b/composer.json @@ -10,10 +10,10 @@ "mobiledetect/mobiledetectlib": "2.*", "cakephp/migrations": "~1.0", "cakephp/plugin-installer": "~1.0", - "mdanter/ecc": "^0.5.0", + "mdanter/ecc": "^0.4.2", "nesbot/carbon": "~1.18", - "predis/predis": "^1.1.1", - "endroid/qr-code": "^3.5" + "endroid/qrcode": "^2.2.2", + "predis/predis": "^1.1.1" }, "require-dev": { "psy/psysh": "@stable", diff --git a/composer.lock b/composer.lock index 994e7b8..4634ac9 100644 --- a/composer.lock +++ b/composer.lock @@ -1,10 +1,10 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "e64d13561bc0e6896ed8629290b55669", + "content-hash": "8508af8cab1d6513078a10e84e5a8833", "packages": [ { "name": "aura/intl", @@ -54,35 +54,28 @@ }, { "name": "bacon/bacon-qr-code", - "version": "2.0.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/Bacon/BaconQrCode.git", - "reference": "eaac909da3ccc32b748a65b127acd8918f58d9b0" + "reference": "031a2ce68c5794064b49d11775b2daf45c96e21c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/eaac909da3ccc32b748a65b127acd8918f58d9b0", - "reference": "eaac909da3ccc32b748a65b127acd8918f58d9b0", + "url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/031a2ce68c5794064b49d11775b2daf45c96e21c", + "reference": "031a2ce68c5794064b49d11775b2daf45c96e21c", "shasum": "" }, "require": { - "dasprid/enum": "^1.0", - "ext-iconv": "*", - "php": "^7.1" - }, - "require-dev": { - "phly/keep-a-changelog": "^1.4", - "phpunit/phpunit": "^6.4", - "squizlabs/php_codesniffer": "^3.1" + "php": ">=5.3.3" }, "suggest": { - "ext-imagick": "to generate QR code images" + "ext-gd": "to generate QR code images" }, "type": "library", "autoload": { - "psr-4": { - "BaconQrCode\\": "src/" + "psr-0": { + "BaconQrCode": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -99,30 +92,30 @@ ], "description": "BaconQrCode is a QR code generator for PHP.", "homepage": "https://github.com/Bacon/BaconQrCode", - "time": "2018-04-25T17:53:56+00:00" + "time": "2016-01-09T22:55:35+00:00" }, { "name": "cakephp/cakephp", - "version": "3.4.14", + "version": "3.4.7", "source": { "type": "git", "url": "https://github.com/cakephp/cakephp.git", - "reference": "57fcdfcf9376670ca4f6f5bd39100ede762afb88" + "reference": "b1aaa094894c020cd49d093bf5d6111fe26f5c45" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/cakephp/zipball/57fcdfcf9376670ca4f6f5bd39100ede762afb88", - "reference": "57fcdfcf9376670ca4f6f5bd39100ede762afb88", + "url": "https://api.github.com/repos/cakephp/cakephp/zipball/b1aaa094894c020cd49d093bf5d6111fe26f5c45", + "reference": "b1aaa094894c020cd49d093bf5d6111fe26f5c45", "shasum": "" }, "require": { "aura/intl": "^3.0.0", - "cakephp/chronos": "^1.0.0", + "cakephp/chronos": "~1.0", "ext-intl": "*", "ext-mbstring": "*", "php": ">=5.6.0", - "psr/log": "^1.0.0", - "zendframework/zend-diactoros": "^1.4.0" + "psr/log": "^1.0", + "zendframework/zend-diactoros": "^1.4" }, "conflict": { "phpunit/phpunit": "<5.7" @@ -175,46 +168,38 @@ "description": "The CakePHP framework", "homepage": "https://cakephp.org", "keywords": [ - "conventions over configuration", - "dry", - "form", - "framework", - "mvc", - "orm", - "psr-7", - "rapid-development", - "validation" + "framework" ], - "time": "2018-05-21T01:19:34+00:00" + "time": "2017-05-20T03:32:05+00:00" }, { "name": "cakephp/chronos", - "version": "1.2.3", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/cakephp/chronos.git", - "reference": "395110125ff577f080fa064dca5c5608a4e77ee1" + "reference": "0621b191334d8dcb56907688986dd24eb8c38234" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/chronos/zipball/395110125ff577f080fa064dca5c5608a4e77ee1", - "reference": "395110125ff577f080fa064dca5c5608a4e77ee1", + "url": "https://api.github.com/repos/cakephp/chronos/zipball/0621b191334d8dcb56907688986dd24eb8c38234", + "reference": "0621b191334d8dcb56907688986dd24eb8c38234", "shasum": "" }, "require": { - "php": "^5.5.9|^7" + "php": ">=5.5.9" }, "require-dev": { "athletic/athletic": "~0.1", - "cakephp/cakephp-codesniffer": "^3.0", + "cakephp/cakephp-codesniffer": "~2.3", "phpbench/phpbench": "@dev", "phpstan/phpstan": "^0.6.4", - "phpunit/phpunit": "<6.0 || ^7.0" + "phpunit/phpunit": "<6.0" }, "type": "library", "autoload": { "psr-4": { - "Cake\\Chronos\\": "src/" + "Cake\\Chronos\\": "src" }, "files": [ "src/carbon_compat.php" @@ -242,33 +227,30 @@ "datetime", "time" ], - "time": "2018-10-18T22:02:21+00:00" + "time": "2017-04-27T01:27:49+00:00" }, { "name": "cakephp/migrations", - "version": "1.7.2", + "version": "1.6.7", "source": { "type": "git", "url": "https://github.com/cakephp/migrations.git", - "reference": "a5612adfd2efa8c90d29cb3b0c969de872a99eda" + "reference": "f2a5e2915f8924bd36979a1001edeef7cd455f89" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/migrations/zipball/a5612adfd2efa8c90d29cb3b0c969de872a99eda", - "reference": "a5612adfd2efa8c90d29cb3b0c969de872a99eda", + "url": "https://api.github.com/repos/cakephp/migrations/zipball/f2a5e2915f8924bd36979a1001edeef7cd455f89", + "reference": "f2a5e2915f8924bd36979a1001edeef7cd455f89", "shasum": "" }, "require": { - "cakephp/cache": "~3.2", - "cakephp/orm": "~3.2", - "php": ">=5.5.9", - "robmorgan/phinx": "0.8.1" + "cakephp/cakephp": "~3.1", + "php": ">=5.4", + "robmorgan/phinx": "0.6.5" }, "require-dev": { "cakephp/bake": "@stable", - "cakephp/cakephp": "~3.2", - "cakephp/cakephp-codesniffer": "^3.0", - "phpunit/phpunit": "~4.1" + "phpunit/phpunit": "*" }, "suggest": { "cakephp/bake": "Required if you want to generate migrations." @@ -295,20 +277,20 @@ "cakephp", "migrations" ], - "time": "2017-12-12T21:01:38+00:00" + "time": "2017-01-07T16:45:31+00:00" }, { "name": "cakephp/plugin-installer", - "version": "1.1.0", + "version": "1.0.0", "source": { "type": "git", "url": "https://github.com/cakephp/plugin-installer.git", - "reference": "41373d0678490502f45adc7be88aa22d24ac1843" + "reference": "3449cb3251e3e741b123237765e278005565d8de" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/plugin-installer/zipball/41373d0678490502f45adc7be88aa22d24ac1843", - "reference": "41373d0678490502f45adc7be88aa22d24ac1843", + "url": "https://api.github.com/repos/cakephp/plugin-installer/zipball/3449cb3251e3e741b123237765e278005565d8de", + "reference": "3449cb3251e3e741b123237765e278005565d8de", "shasum": "" }, "require-dev": { @@ -336,126 +318,47 @@ } ], "description": "A composer installer for CakePHP 3.0+ plugins.", - "time": "2017-12-24T21:09:29+00:00" + "time": "2017-03-21T13:48:47+00:00" }, { - "name": "dasprid/enum", - "version": "1.0.0", + "name": "endroid/qrcode", + "version": "2.2.2", "source": { "type": "git", - "url": "https://github.com/DASPRiD/Enum.git", - "reference": "631ef6e638e9494b0310837fa531bedd908fc22b" + "url": "https://github.com/endroid/QrCode.git", + "reference": "daa07e11249362e0fc0edf97f83719794d87726b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/DASPRiD/Enum/zipball/631ef6e638e9494b0310837fa531bedd908fc22b", - "reference": "631ef6e638e9494b0310837fa531bedd908fc22b", - "shasum": "" - }, - "require-dev": { - "phpunit/phpunit": "^6.4", - "squizlabs/php_codesniffer": "^3.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "DASPRiD\\Enum\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-2-Clause" - ], - "authors": [ - { - "name": "Ben Scholzen 'DASPRiD'", - "email": "mail@dasprids.de", - "homepage": "https://dasprids.de/" - } - ], - "description": "PHP 7.1 enum implementation", - "keywords": [ - "enum", - "map" - ], - "time": "2017-10-25T22:45:27+00:00" - }, - { - "name": "endroid/installer", - "version": "1.0.8", - "source": { - "type": "git", - "url": "https://github.com/endroid/installer.git", - "reference": "b41b44ae2e410609be3b7f080b626dfc9ff4822a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/endroid/installer/zipball/b41b44ae2e410609be3b7f080b626dfc9ff4822a", - "reference": "b41b44ae2e410609be3b7f080b626dfc9ff4822a", + "url": "https://api.github.com/repos/endroid/QrCode/zipball/daa07e11249362e0fc0edf97f83719794d87726b", + "reference": "daa07e11249362e0fc0edf97f83719794d87726b", "shasum": "" }, "require": { - "composer-plugin-api": "^1.1", - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "^5.7|^6.0" - }, - "type": "composer-plugin", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - }, - "class": "Endroid\\Installer\\Installer" - }, - "autoload": { - "psr-4": { - "Endroid\\Installer\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jeroen van den Enden", - "email": "info@endroid.nl" - } - ], - "time": "2018-11-30T13:00:41+00:00" - }, - { - "name": "endroid/qr-code", - "version": "3.5.0", - "source": { - "type": "git", - "url": "https://github.com/endroid/qr-code.git", - "reference": "0095706c3bf2389f15f6c097bab4a00a48fc5ff7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/endroid/qr-code/zipball/0095706c3bf2389f15f6c097bab4a00a48fc5ff7", - "reference": "0095706c3bf2389f15f6c097bab4a00a48fc5ff7", - "shasum": "" - }, - "require": { - "bacon/bacon-qr-code": "^2.0", - "endroid/installer": "^1.0.3", + "bacon/bacon-qr-code": "^1.0", "ext-gd": "*", - "khanamiryan/qrcode-detector-decoder": "^1.0.2", + "khanamiryan/qrcode-detector-decoder": "^0.0.1", "myclabs/php-enum": "^1.5", - "php": ">=7.1", - "symfony/options-resolver": "^2.7|^3.0|^4.0", - "symfony/property-access": "^2.7|^3.0|^4.0" + "php": ">=5.6", + "symfony/options-resolver": "^2.7|^3.0", + "symfony/property-access": "^2.7|^3.0" }, "require-dev": { - "phpunit/phpunit": "^5.7|^6.0" + "phpunit/phpunit": "^5.7|^6.0", + "sensio/framework-extra-bundle": "^3.0", + "symfony/asset": "^2.7|^3.0", + "symfony/browser-kit": "^2.7|^3.0", + "symfony/finder": "^2.7|^3.0", + "symfony/framework-bundle": "^2.7|^3.0", + "symfony/http-kernel": "^2.7|^3.0", + "symfony/templating": "^2.7|^3.0", + "symfony/twig-bundle": "^2.7|^3.0", + "symfony/yaml": "^2.7|^3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.x-dev" + "dev-master": "2.x-dev" } }, "autoload": { @@ -470,50 +373,51 @@ "authors": [ { "name": "Jeroen van den Enden", - "email": "info@endroid.nl" + "email": "info@endroid.nl", + "homepage": "http://endroid.nl/" } ], "description": "Endroid QR Code", - "homepage": "https://github.com/endroid/qr-code", + "homepage": "https://github.com/endroid/QrCode", "keywords": [ "bundle", "code", "endroid", - "php", "qr", - "qrcode" + "qrcode", + "symfony" ], - "time": "2018-12-01T12:34:40+00:00" + "time": "2017-05-30T13:53:47+00:00" }, { "name": "fgrosse/phpasn1", - "version": "v2.1.1", + "version": "1.5.2", "source": { "type": "git", "url": "https://github.com/fgrosse/PHPASN1.git", - "reference": "7ebf2a09084a7bbdb7b879c66fdf7ad80461bbe8" + "reference": "a18b162eca6aa70f8f15615f4ac8c852dffbc7dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fgrosse/PHPASN1/zipball/7ebf2a09084a7bbdb7b879c66fdf7ad80461bbe8", - "reference": "7ebf2a09084a7bbdb7b879c66fdf7ad80461bbe8", + "url": "https://api.github.com/repos/fgrosse/PHPASN1/zipball/a18b162eca6aa70f8f15615f4ac8c852dffbc7dd", + "reference": "a18b162eca6aa70f8f15615f4ac8c852dffbc7dd", "shasum": "" }, "require": { - "php": ">=7.0.0" + "ext-gmp": "*", + "php": ">=5.6.0" }, "require-dev": { - "phpunit/phpunit": "~6.3", - "satooshi/php-coveralls": "~2.0" + "phpunit/phpunit": "~4.5", + "satooshi/php-coveralls": "dev-master" }, "suggest": { - "ext-gmp": "GMP is the preferred extension for big integer calculations", "php-curl": "For loading OID information from the web if they have not bee defined statically" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "1.5.x-dev" } }, "autoload": { @@ -552,20 +456,20 @@ "x509", "x690" ], - "time": "2018-12-02T01:34:34+00:00" + "time": "2016-10-29T15:46:46+00:00" }, { "name": "khanamiryan/qrcode-detector-decoder", - "version": "1.0.2", + "version": "0.0.1", "source": { "type": "git", "url": "https://github.com/khanamiryan/php-qrcode-detector-decoder.git", - "reference": "a75482d3bc804e3f6702332bfda6cccbb0dfaa76" + "reference": "96d5f80680b04803c4f1b69d6e01735e876b80c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/khanamiryan/php-qrcode-detector-decoder/zipball/a75482d3bc804e3f6702332bfda6cccbb0dfaa76", - "reference": "a75482d3bc804e3f6702332bfda6cccbb0dfaa76", + "url": "https://api.github.com/repos/khanamiryan/php-qrcode-detector-decoder/zipball/96d5f80680b04803c4f1b69d6e01735e876b80c7", + "reference": "96d5f80680b04803c4f1b69d6e01735e876b80c7", "shasum": "" }, "require": { @@ -576,11 +480,11 @@ }, "type": "library", "autoload": { - "psr-4": { - "Zxing\\": "lib/" - }, + "classmap": [ + "lib/" + ], "files": [ - "lib/Common/customFunctions.php" + "lib/common/customFunctions.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -596,37 +500,38 @@ } ], "description": "QR code decoder / reader", - "homepage": "https://github.com/khanamiryan/php-qrcode-detector-decoder/", + "homepage": "https://github.com/khanamiryan/php-qrcode-detector-decoder", "keywords": [ "barcode", "qr", "zxing" ], - "time": "2018-04-26T11:41:33+00:00" + "time": "2017-01-13T09:11:46+00:00" }, { "name": "mdanter/ecc", - "version": "v0.5.2", + "version": "v0.4.2", "source": { "type": "git", "url": "https://github.com/phpecc/phpecc.git", - "reference": "b95f25cc1bacc83a9f0ccd375900b7cfd343029e" + "reference": "fdd1fa9be8184c9f319433437cb1d9f9d4294164" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpecc/phpecc/zipball/b95f25cc1bacc83a9f0ccd375900b7cfd343029e", - "reference": "b95f25cc1bacc83a9f0ccd375900b7cfd343029e", + "url": "https://api.github.com/repos/phpecc/phpecc/zipball/fdd1fa9be8184c9f319433437cb1d9f9d4294164", + "reference": "fdd1fa9be8184c9f319433437cb1d9f9d4294164", "shasum": "" }, "require": { "ext-gmp": "*", - "fgrosse/phpasn1": "^2.0", - "php": "^7.0" + "fgrosse/phpasn1": "~1.5", + "paragonie/random_compat": "^1|^2", + "php": ">=5.6.0" }, "require-dev": { - "phpunit/phpunit": "^6.0", - "squizlabs/php_codesniffer": "^2.0", - "symfony/yaml": "^2.6|^3.0" + "phpunit/phpunit": "~4.1|~5.0", + "squizlabs/php_codesniffer": "~2", + "symfony/yaml": "~2.6|~3.0" }, "type": "library", "autoload": { @@ -649,11 +554,6 @@ "email": "thibaud@aztech.io", "homepage": "http://aztech.io", "role": "Maintainer" - }, - { - "name": "Thomas Kerin", - "email": "afk11@users.noreply.github.com", - "role": "Maintainer" } ], "description": "PHP Elliptic Curve Cryptography library", @@ -668,33 +568,31 @@ "nistp192", "nistp224", "nistp256", - "nistp384", "nistp521", "phpecc", - "secp256k1", - "secp256r1" + "secp256k1" ], - "time": "2018-12-03T18:17:01+00:00" + "time": "2017-01-04T12:13:24+00:00" }, { "name": "mobiledetect/mobiledetectlib", - "version": "2.8.33", + "version": "2.8.25", "source": { "type": "git", "url": "https://github.com/serbanghita/Mobile-Detect.git", - "reference": "cd385290f9a0d609d2eddd165a1e44ec1bf12102" + "reference": "f0896b5c7274d1450023b0b376240be902c3251c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/serbanghita/Mobile-Detect/zipball/cd385290f9a0d609d2eddd165a1e44ec1bf12102", - "reference": "cd385290f9a0d609d2eddd165a1e44ec1bf12102", + "url": "https://api.github.com/repos/serbanghita/Mobile-Detect/zipball/f0896b5c7274d1450023b0b376240be902c3251c", + "reference": "f0896b5c7274d1450023b0b376240be902c3251c", "shasum": "" }, "require": { "php": ">=5.0.0" }, "require-dev": { - "phpunit/phpunit": "~4.8.35||~5.7" + "phpunit/phpunit": "*" }, "type": "library", "autoload": { @@ -726,27 +624,27 @@ "mobile detector", "php mobile detect" ], - "time": "2018-09-01T15:05:15+00:00" + "time": "2017-03-29T13:59:30+00:00" }, { "name": "myclabs/php-enum", - "version": "1.6.4", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/myclabs/php-enum.git", - "reference": "550d2334d77f91b0816a5cbd6965272fe20146b8" + "reference": "61f4a24da5be216301447f3278ea6562609d61f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/php-enum/zipball/550d2334d77f91b0816a5cbd6965272fe20146b8", - "reference": "550d2334d77f91b0816a5cbd6965272fe20146b8", + "url": "https://api.github.com/repos/myclabs/php-enum/zipball/61f4a24da5be216301447f3278ea6562609d61f5", + "reference": "61f4a24da5be216301447f3278ea6562609d61f5", "shasum": "" }, "require": { - "php": ">=5.4" + "php": ">=5.3" }, "require-dev": { - "phpunit/phpunit": "^4.8.35|^5.7|^6.0", + "phpunit/phpunit": "4.*", "squizlabs/php_codesniffer": "1.*" }, "type": "library", @@ -770,44 +668,39 @@ "keywords": [ "enum" ], - "time": "2018-10-30T14:36:18+00:00" + "time": "2017-03-26T10:24:21+00:00" }, { "name": "nesbot/carbon", - "version": "1.36.1", + "version": "1.22.1", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "63da8cdf89d7a5efe43aabc794365f6e7b7b8983" + "reference": "7cdf42c0b1cc763ab7e4c33c47a24e27c66bfccc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/63da8cdf89d7a5efe43aabc794365f6e7b7b8983", - "reference": "63da8cdf89d7a5efe43aabc794365f6e7b7b8983", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/7cdf42c0b1cc763ab7e4c33c47a24e27c66bfccc", + "reference": "7cdf42c0b1cc763ab7e4c33c47a24e27c66bfccc", "shasum": "" }, "require": { - "php": ">=5.3.9", - "symfony/translation": "~2.6 || ~3.0 || ~4.0" + "php": ">=5.3.0", + "symfony/translation": "~2.6 || ~3.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7" - }, - "suggest": { - "friendsofphp/php-cs-fixer": "Needed for the `composer phpcs` command. Allow to automatically fix code style.", - "phpstan/phpstan": "Needed for the `composer phpstan` command. Allow to detect potential errors." + "friendsofphp/php-cs-fixer": "~2", + "phpunit/phpunit": "~4.0 || ~5.0" }, "type": "library", "extra": { - "laravel": { - "providers": [ - "Carbon\\Laravel\\ServiceProvider" - ] + "branch-alias": { + "dev-master": "1.23-dev" } }, "autoload": { "psr-4": { - "": "src/" + "Carbon\\": "src/Carbon/" } }, "notification-url": "https://packagist.org/downloads/", @@ -828,7 +721,55 @@ "datetime", "time" ], - "time": "2018-11-22T18:23:02+00:00" + "time": "2017-01-16T07:55:07+00:00" + }, + { + "name": "paragonie/random_compat", + "version": "v2.0.10", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "634bae8e911eefa89c1abfbf1b66da679ac8f54d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/634bae8e911eefa89c1abfbf1b66da679ac8f54d", + "reference": "634bae8e911eefa89c1abfbf1b66da679ac8f54d", + "shasum": "" + }, + "require": { + "php": ">=5.2.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "type": "library", + "autoload": { + "files": [ + "lib/random.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "pseudorandom", + "random" + ], + "time": "2017-03-13T16:27:32+00:00" }, { "name": "predis/predis", @@ -932,16 +873,16 @@ }, { "name": "psr/log", - "version": "1.1.0", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", - "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", "shasum": "" }, "require": { @@ -975,20 +916,20 @@ "psr", "psr-3" ], - "time": "2018-11-20T15:27:04+00:00" + "time": "2016-10-10T12:19:37+00:00" }, { "name": "robmorgan/phinx", - "version": "v0.8.1", + "version": "v0.6.5", "source": { "type": "git", - "url": "https://github.com/cakephp/phinx.git", - "reference": "7a19de5bebc59321edd9613bc2a667e7f96224ec" + "url": "https://github.com/robmorgan/phinx.git", + "reference": "6943cb4bb78bf9d3964967a032220b7c793b97b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/phinx/zipball/7a19de5bebc59321edd9613bc2a667e7f96224ec", - "reference": "7a19de5bebc59321edd9613bc2a667e7f96224ec", + "url": "https://api.github.com/repos/robmorgan/phinx/zipball/6943cb4bb78bf9d3964967a032220b7c793b97b7", + "reference": "6943cb4bb78bf9d3964967a032220b7c793b97b7", "shasum": "" }, "require": { @@ -1041,36 +982,32 @@ "migrations", "phinx" ], - "time": "2017-06-05T13:30:19+00:00" + "time": "2016-10-27T10:16:12+00:00" }, { "name": "symfony/config", - "version": "v3.4.19", + "version": "v3.3.2", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "8a660daeb65dedbe0b099529f65e61866c055081" + "reference": "35716d4904e0506a7a5a9bcf23f854aeb5719bca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/8a660daeb65dedbe0b099529f65e61866c055081", - "reference": "8a660daeb65dedbe0b099529f65e61866c055081", + "url": "https://api.github.com/repos/symfony/config/zipball/35716d4904e0506a7a5a9bcf23f854aeb5719bca", + "reference": "35716d4904e0506a7a5a9bcf23f854aeb5719bca", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/filesystem": "~2.8|~3.0|~4.0", - "symfony/polyfill-ctype": "~1.8" + "php": ">=5.5.9", + "symfony/filesystem": "~2.8|~3.0" }, "conflict": { - "symfony/dependency-injection": "<3.3", - "symfony/finder": "<3.3" + "symfony/dependency-injection": "<3.3" }, "require-dev": { - "symfony/dependency-injection": "~3.3|~4.0", - "symfony/event-dispatcher": "~3.3|~4.0", - "symfony/finder": "~3.3|~4.0", - "symfony/yaml": "~3.0|~4.0" + "symfony/dependency-injection": "~3.3", + "symfony/yaml": "~3.0" }, "suggest": { "symfony/yaml": "To use the yaml reference dumper" @@ -1078,7 +1015,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -1105,49 +1042,49 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2018-11-26T10:17:44+00:00" + "time": "2017-06-02T18:07:20+00:00" }, { "name": "symfony/console", - "version": "v3.4.19", + "version": "v3.3.2", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "8f80fc39bbc3b7c47ee54ba7aa2653521ace94bb" + "reference": "70d2a29b2911cbdc91a7e268046c395278238b2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/8f80fc39bbc3b7c47ee54ba7aa2653521ace94bb", - "reference": "8f80fc39bbc3b7c47ee54ba7aa2653521ace94bb", + "url": "https://api.github.com/repos/symfony/console/zipball/70d2a29b2911cbdc91a7e268046c395278238b2e", + "reference": "70d2a29b2911cbdc91a7e268046c395278238b2e", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/debug": "~2.8|~3.0|~4.0", + "php": ">=5.5.9", + "symfony/debug": "~2.8|~3.0", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "symfony/dependency-injection": "<3.4", - "symfony/process": "<3.3" + "symfony/dependency-injection": "<3.3" }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~3.3|~4.0", - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/event-dispatcher": "~2.8|~3.0|~4.0", - "symfony/lock": "~3.4|~4.0", - "symfony/process": "~3.3|~4.0" + "symfony/config": "~3.3", + "symfony/dependency-injection": "~3.3", + "symfony/event-dispatcher": "~2.8|~3.0", + "symfony/filesystem": "~2.8|~3.0", + "symfony/http-kernel": "~2.8|~3.0", + "symfony/process": "~2.8|~3.0" }, "suggest": { - "psr/log-implementation": "For using the console logger", + "psr/log": "For using the console logger", "symfony/event-dispatcher": "", - "symfony/lock": "", + "symfony/filesystem": "", "symfony/process": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -1174,104 +1111,36 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-11-26T12:48:07+00:00" - }, - { - "name": "symfony/contracts", - "version": "v1.0.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/contracts.git", - "reference": "3edf0ab943d1985a356721952cba36ff31bd6e5f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/contracts/zipball/3edf0ab943d1985a356721952cba36ff31bd6e5f", - "reference": "3edf0ab943d1985a356721952cba36ff31bd6e5f", - "shasum": "" - }, - "require": { - "php": "^7.1.3" - }, - "require-dev": { - "psr/cache": "^1.0", - "psr/container": "^1.0" - }, - "suggest": { - "psr/cache": "When using the Cache contracts", - "psr/container": "When using the Service contracts", - "symfony/cache-contracts-implementation": "", - "symfony/service-contracts-implementation": "", - "symfony/translation-contracts-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\": "" - }, - "exclude-from-classmap": [ - "**/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A set of abstractions extracted out of the Symfony components", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "time": "2018-11-24T09:35:08+00:00" + "time": "2017-06-02T19:24:58+00:00" }, { "name": "symfony/debug", - "version": "v4.2.0", + "version": "v3.3.2", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "e0a2b92ee0b5b934f973d90c2f58e18af109d276" + "reference": "e9c50482841ef696e8fa1470d950a79c8921f45d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/e0a2b92ee0b5b934f973d90c2f58e18af109d276", - "reference": "e0a2b92ee0b5b934f973d90c2f58e18af109d276", + "url": "https://api.github.com/repos/symfony/debug/zipball/e9c50482841ef696e8fa1470d950a79c8921f45d", + "reference": "e9c50482841ef696e8fa1470d950a79c8921f45d", "shasum": "" }, "require": { - "php": "^7.1.3", + "php": ">=5.5.9", "psr/log": "~1.0" }, "conflict": { - "symfony/http-kernel": "<3.4" + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" }, "require-dev": { - "symfony/http-kernel": "~3.4|~4.0" + "symfony/http-kernel": "~2.8|~3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -1298,30 +1167,29 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2018-11-28T18:24:18+00:00" + "time": "2017-06-01T21:01:25+00:00" }, { "name": "symfony/filesystem", - "version": "v4.2.0", + "version": "v3.3.2", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "2f4c8b999b3b7cadb2a69390b01af70886753710" + "reference": "c709670bf64721202ddbe4162846f250735842c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/2f4c8b999b3b7cadb2a69390b01af70886753710", - "reference": "2f4c8b999b3b7cadb2a69390b01af70886753710", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/c709670bf64721202ddbe4162846f250735842c0", + "reference": "c709670bf64721202ddbe4162846f250735842c0", "shasum": "" }, "require": { - "php": "^7.1.3", - "symfony/polyfill-ctype": "~1.8" + "php": ">=5.5.9" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -1348,30 +1216,29 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2018-11-11T19:52:12+00:00" + "time": "2017-05-28T14:08:56+00:00" }, { "name": "symfony/inflector", - "version": "v4.2.0", + "version": "v3.3.2", "source": { "type": "git", "url": "https://github.com/symfony/inflector.git", - "reference": "f9a637c0359f74404d44cf0da0a3ce53bae0787e" + "reference": "aed5a0874a3bcfd8d0393a2d91b4cf828f29c7fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/inflector/zipball/f9a637c0359f74404d44cf0da0a3ce53bae0787e", - "reference": "f9a637c0359f74404d44cf0da0a3ce53bae0787e", + "url": "https://api.github.com/repos/symfony/inflector/zipball/aed5a0874a3bcfd8d0393a2d91b4cf828f29c7fb", + "reference": "aed5a0874a3bcfd8d0393a2d91b4cf828f29c7fb", "shasum": "" }, "require": { - "php": "^7.1.3", - "symfony/polyfill-ctype": "~1.8" + "php": ">=5.5.9" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -1406,29 +1273,29 @@ "symfony", "words" ], - "time": "2018-11-11T19:52:12+00:00" + "time": "2017-04-12T14:14:56+00:00" }, { "name": "symfony/options-resolver", - "version": "v4.2.0", + "version": "v3.3.2", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "a9c38e8a3da2c03b3e71fdffa6efb0bda51390ba" + "reference": "ff48982d295bcac1fd861f934f041ebc73ae40f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/a9c38e8a3da2c03b3e71fdffa6efb0bda51390ba", - "reference": "a9c38e8a3da2c03b3e71fdffa6efb0bda51390ba", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/ff48982d295bcac1fd861f934f041ebc73ae40f0", + "reference": "ff48982d295bcac1fd861f934f041ebc73ae40f0", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": ">=5.5.9" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -1460,78 +1327,20 @@ "configuration", "options" ], - "time": "2018-11-11T19:52:12+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.10.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", - "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.9-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - }, - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "time": "2018-08-06T14:22:27+00:00" + "time": "2017-04-12T14:14:56+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.10.0", + "version": "v1.4.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" + "reference": "f29dca382a6485c3cbe6379f0c61230167681937" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", - "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/f29dca382a6485c3cbe6379f0c61230167681937", + "reference": "f29dca382a6485c3cbe6379f0c61230167681937", "shasum": "" }, "require": { @@ -1543,7 +1352,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.9-dev" + "dev-master": "1.4-dev" } }, "autoload": { @@ -1577,28 +1386,88 @@ "portable", "shim" ], - "time": "2018-09-21T13:07:52+00:00" + "time": "2017-06-09T14:24:12+00:00" }, { - "name": "symfony/property-access", - "version": "v4.2.0", + "name": "symfony/polyfill-php70", + "version": "v1.4.0", "source": { "type": "git", - "url": "https://github.com/symfony/property-access.git", - "reference": "b6df4e1849f389468edb36e2e59877d4a8170723" + "url": "https://github.com/symfony/polyfill-php70.git", + "reference": "032fd647d5c11a9ceab8ee8747e13b5448e93874" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/property-access/zipball/b6df4e1849f389468edb36e2e59877d4a8170723", - "reference": "b6df4e1849f389468edb36e2e59877d4a8170723", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/032fd647d5c11a9ceab8ee8747e13b5448e93874", + "reference": "032fd647d5c11a9ceab8ee8747e13b5448e93874", "shasum": "" }, "require": { - "php": "^7.1.3", - "symfony/inflector": "~3.4|~4.0" + "paragonie/random_compat": "~1.0|~2.0", + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php70\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2017-06-09T14:24:12+00:00" + }, + { + "name": "symfony/property-access", + "version": "v3.3.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/property-access.git", + "reference": "70bbfe28f77070d41957495bc6fed34f139fe6f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/property-access/zipball/70bbfe28f77070d41957495bc6fed34f139fe6f7", + "reference": "70bbfe28f77070d41957495bc6fed34f139fe6f7", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "symfony/inflector": "~3.1", + "symfony/polyfill-php70": "~1.0" }, "require-dev": { - "symfony/cache": "~3.4|~4.0" + "symfony/cache": "~3.1" }, "suggest": { "psr/cache-implementation": "To cache access methods." @@ -1606,7 +1475,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -1644,53 +1513,45 @@ "property path", "reflection" ], - "time": "2018-11-29T14:48:32+00:00" + "time": "2017-06-02T09:51:43+00:00" }, { "name": "symfony/translation", - "version": "v4.2.0", + "version": "v3.3.2", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "ff9a878c9b8f8bcd4d9138e2d32f508c942773d9" + "reference": "dc3b2a0c6cfff60327ba1c043a82092735397543" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/ff9a878c9b8f8bcd4d9138e2d32f508c942773d9", - "reference": "ff9a878c9b8f8bcd4d9138e2d32f508c942773d9", + "url": "https://api.github.com/repos/symfony/translation/zipball/dc3b2a0c6cfff60327ba1c043a82092735397543", + "reference": "dc3b2a0c6cfff60327ba1c043a82092735397543", "shasum": "" }, "require": { - "php": "^7.1.3", - "symfony/contracts": "^1.0", + "php": ">=5.5.9", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "symfony/config": "<3.4", - "symfony/dependency-injection": "<3.4", - "symfony/yaml": "<3.4" - }, - "provide": { - "symfony/translation-contracts-implementation": "1.0" + "symfony/config": "<2.8", + "symfony/yaml": "<3.3" }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~3.4|~4.0", - "symfony/console": "~3.4|~4.0", - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/finder": "~2.8|~3.0|~4.0", - "symfony/intl": "~3.4|~4.0", - "symfony/yaml": "~3.4|~4.0" + "symfony/config": "~2.8|~3.0", + "symfony/intl": "^2.8.18|^3.2.5", + "symfony/yaml": "~3.3" }, "suggest": { - "psr/log-implementation": "To use logging capability in translator", + "psr/log": "To use logging capability in translator", "symfony/config": "", "symfony/yaml": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -1717,31 +1578,27 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2018-11-27T07:20:32+00:00" + "time": "2017-05-22T07:42:36+00:00" }, { "name": "symfony/yaml", - "version": "v3.4.19", + "version": "v3.3.2", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "291e13d808bec481eab83f301f7bff3e699ef603" + "reference": "9752a30000a8ca9f4b34b5227d15d0101b96b063" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/291e13d808bec481eab83f301f7bff3e699ef603", - "reference": "291e13d808bec481eab83f301f7bff3e699ef603", + "url": "https://api.github.com/repos/symfony/yaml/zipball/9752a30000a8ca9f4b34b5227d15d0101b96b063", + "reference": "9752a30000a8ca9f4b34b5227d15d0101b96b063", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/polyfill-ctype": "~1.8" - }, - "conflict": { - "symfony/console": "<3.4" + "php": ">=5.5.9" }, "require-dev": { - "symfony/console": "~3.4|~4.0" + "symfony/console": "~2.8|~3.0" }, "suggest": { "symfony/console": "For validating YAML files using the lint command" @@ -1749,7 +1606,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -1776,25 +1633,25 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2018-11-11T19:48:54+00:00" + "time": "2017-06-02T22:05:06+00:00" }, { "name": "zendframework/zend-diactoros", - "version": "1.8.6", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/zendframework/zend-diactoros.git", - "reference": "20da13beba0dde8fb648be3cc19765732790f46e" + "reference": "b03f285a333f51e58c95cce54109a4a9ed691436" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/20da13beba0dde8fb648be3cc19765732790f46e", - "reference": "20da13beba0dde8fb648be3cc19765732790f46e", + "url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/b03f285a333f51e58c95cce54109a4a9ed691436", + "reference": "b03f285a333f51e58c95cce54109a4a9ed691436", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0", - "psr/http-message": "^1.0" + "php": "^5.4 || ^7.0", + "psr/http-message": "~1.0" }, "provide": { "psr/http-message-implementation": "1.0" @@ -1802,29 +1659,17 @@ "require-dev": { "ext-dom": "*", "ext-libxml": "*", - "php-http/psr7-integration-tests": "dev-master", - "phpunit/phpunit": "^5.7.16 || ^6.0.8 || ^7.2.7", - "zendframework/zend-coding-standard": "~1.0" + "phpunit/phpunit": "^4.6 || ^5.5", + "zendframework/zend-coding-standard": "~1.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8.x-dev", - "dev-develop": "1.9.x-dev", - "dev-release-2.0": "2.0.x-dev" + "dev-master": "1.4-dev", + "dev-develop": "1.5-dev" } }, "autoload": { - "files": [ - "src/functions/create_uploaded_file.php", - "src/functions/marshal_headers_from_sapi.php", - "src/functions/marshal_method_from_sapi.php", - "src/functions/marshal_protocol_version_from_sapi.php", - "src/functions/marshal_uri_from_sapi.php", - "src/functions/normalize_server.php", - "src/functions/normalize_uploaded_files.php", - "src/functions/parse_cookie_header.php" - ], "psr-4": { "Zend\\Diactoros\\": "src/" } @@ -1840,22 +1685,22 @@ "psr", "psr-7" ], - "time": "2018-09-05T19:29:37+00:00" + "time": "2017-04-06T16:18:34+00:00" } ], "packages-dev": [ { "name": "cakephp/bake", - "version": "1.3.7", + "version": "1.3.5", "source": { "type": "git", "url": "https://github.com/cakephp/bake.git", - "reference": "4bbb541ee27d12fe63f15cf5acf70b94553de209" + "reference": "6fe5dc1bcdd321ffc35e847ae0e0ab1effde2278" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/bake/zipball/4bbb541ee27d12fe63f15cf5acf70b94553de209", - "reference": "4bbb541ee27d12fe63f15cf5acf70b94553de209", + "url": "https://api.github.com/repos/cakephp/bake/zipball/6fe5dc1bcdd321ffc35e847ae0e0ab1effde2278", + "reference": "6fe5dc1bcdd321ffc35e847ae0e0ab1effde2278", "shasum": "" }, "require": { @@ -1889,20 +1734,20 @@ "bake", "cakephp" ], - "time": "2017-07-01T15:59:12+00:00" + "time": "2017-06-05T23:32:05+00:00" }, { "name": "cakephp/debug_kit", - "version": "3.14.2", + "version": "3.10.2", "source": { "type": "git", "url": "https://github.com/cakephp/debug_kit.git", - "reference": "b5e11f386b9ff28694950f68ef3e0456c242051b" + "reference": "a0583e2cb58e80940fd4aeb026be48d5f0000ff2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/debug_kit/zipball/b5e11f386b9ff28694950f68ef3e0456c242051b", - "reference": "b5e11f386b9ff28694950f68ef3e0456c242051b", + "url": "https://api.github.com/repos/cakephp/debug_kit/zipball/a0583e2cb58e80940fd4aeb026be48d5f0000ff2", + "reference": "a0583e2cb58e80940fd4aeb026be48d5f0000ff2", "shasum": "" }, "require": { @@ -1910,12 +1755,11 @@ "cakephp/chronos": "^1.0.0", "cakephp/plugin-installer": "^1.0.0", "composer/composer": "^1.3.0", - "jdorn/sql-formatter": "^1.2.0", - "php": ">=5.6.0" + "jdorn/sql-formatter": "^1.2.0" }, "require-dev": { "cakephp/cakephp-codesniffer": "^3.0", - "phpunit/phpunit": "^5.7|^6.0" + "phpunit/phpunit": "<6.0" }, "suggest": { "ext-sqlite": "DebugKit needs to store panel data in a database. SQLite is simple and easy to use." @@ -1949,20 +1793,20 @@ "debug", "kit" ], - "time": "2018-03-08T18:21:10+00:00" + "time": "2017-05-12T16:10:13+00:00" }, { "name": "composer/ca-bundle", - "version": "1.1.3", + "version": "1.0.7", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "8afa52cd417f4ec417b4bfe86b68106538a87660" + "reference": "b17e6153cb7f33c7e44eb59578dc12eee5dc8e12" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/8afa52cd417f4ec417b4bfe86b68106538a87660", - "reference": "8afa52cd417f4ec417b4bfe86b68106538a87660", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/b17e6153cb7f33c7e44eb59578dc12eee5dc8e12", + "reference": "b17e6153cb7f33c7e44eb59578dc12eee5dc8e12", "shasum": "" }, "require": { @@ -1971,9 +1815,12 @@ "php": "^5.3.2 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5", + "phpunit/phpunit": "^4.5", "psr/log": "^1.0", - "symfony/process": "^2.5 || ^3.0 || ^4.0" + "symfony/process": "^2.5 || ^3.0" + }, + "suggest": { + "symfony/process": "This is necessary to reliably check whether openssl_x509_parse is vulnerable on older php versions, but can be ignored on PHP 5.5.6+" }, "type": "library", "extra": { @@ -2005,42 +1852,39 @@ "ssl", "tls" ], - "time": "2018-10-18T06:09:13+00:00" + "time": "2017-03-06T11:59:08+00:00" }, { "name": "composer/composer", - "version": "1.8.0", + "version": "1.4.2", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "d8aef3af866b28786ce9b8647e52c42496436669" + "reference": "489e09ee6c3ba431fbeeef9147afdaeb6f91b647" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/d8aef3af866b28786ce9b8647e52c42496436669", - "reference": "d8aef3af866b28786ce9b8647e52c42496436669", + "url": "https://api.github.com/repos/composer/composer/zipball/489e09ee6c3ba431fbeeef9147afdaeb6f91b647", + "reference": "489e09ee6c3ba431fbeeef9147afdaeb6f91b647", "shasum": "" }, "require": { "composer/ca-bundle": "^1.0", "composer/semver": "^1.0", - "composer/spdx-licenses": "^1.2", - "composer/xdebug-handler": "^1.1", + "composer/spdx-licenses": "^1.0", "justinrainbow/json-schema": "^3.0 || ^4.0 || ^5.0", "php": "^5.3.2 || ^7.0", "psr/log": "^1.0", + "seld/cli-prompt": "^1.0", "seld/jsonlint": "^1.4", "seld/phar-utils": "^1.0", - "symfony/console": "^2.7 || ^3.0 || ^4.0", - "symfony/filesystem": "^2.7 || ^3.0 || ^4.0", - "symfony/finder": "^2.7 || ^3.0 || ^4.0", - "symfony/process": "^2.7 || ^3.0 || ^4.0" - }, - "conflict": { - "symfony/console": "2.8.38" + "symfony/console": "^2.7 || ^3.0", + "symfony/filesystem": "^2.7 || ^3.0", + "symfony/finder": "^2.7 || ^3.0", + "symfony/process": "^2.7 || ^3.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7", + "phpunit/phpunit": "^4.5 || ^5.0.5", "phpunit/phpunit-mock-objects": "^2.3 || ^3.0" }, "suggest": { @@ -2054,7 +1898,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8-dev" + "dev-master": "1.4-dev" } }, "autoload": { @@ -2085,7 +1929,7 @@ "dependency", "package" ], - "time": "2018-12-03T09:31:16+00:00" + "time": "2017-05-17T06:17:53+00:00" }, { "name": "composer/semver", @@ -2151,23 +1995,23 @@ }, { "name": "composer/spdx-licenses", - "version": "1.5.0", + "version": "1.1.6", "source": { "type": "git", "url": "https://github.com/composer/spdx-licenses.git", - "reference": "7a9556b22bd9d4df7cad89876b00af58ef20d3a2" + "reference": "2603a0d7ddc00a015deb576fa5297ca43dee6b1c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/7a9556b22bd9d4df7cad89876b00af58ef20d3a2", - "reference": "7a9556b22bd9d4df7cad89876b00af58ef20d3a2", + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/2603a0d7ddc00a015deb576fa5297ca43dee6b1c", + "reference": "2603a0d7ddc00a015deb576fa5297ca43dee6b1c", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5", + "phpunit/phpunit": "^4.5 || ^5.0.5", "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0" }, "type": "library", @@ -2208,51 +2052,7 @@ "spdx", "validator" ], - "time": "2018-11-01T09:45:54+00:00" - }, - { - "name": "composer/xdebug-handler", - "version": "1.3.1", - "source": { - "type": "git", - "url": "https://github.com/composer/xdebug-handler.git", - "reference": "dc523135366eb68f22268d069ea7749486458562" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/dc523135366eb68f22268d069ea7749486458562", - "reference": "dc523135366eb68f22268d069ea7749486458562", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0", - "psr/log": "^1.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" - }, - "type": "library", - "autoload": { - "psr-4": { - "Composer\\XdebugHandler\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "John Stevenson", - "email": "john-stevenson@blueyonder.co.uk" - } - ], - "description": "Restarts a process without xdebug.", - "keywords": [ - "Xdebug", - "performance" - ], - "time": "2018-11-29T10:59:02+00:00" + "time": "2017-04-03T19:08:52+00:00" }, { "name": "dnoegel/php-xdg-base-dir", @@ -2289,32 +2089,32 @@ }, { "name": "jakub-onderka/php-console-color", - "version": "v0.2", + "version": "0.1", "source": { "type": "git", "url": "https://github.com/JakubOnderka/PHP-Console-Color.git", - "reference": "d5deaecff52a0d61ccb613bb3804088da0307191" + "reference": "e0b393dacf7703fc36a4efc3df1435485197e6c1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/JakubOnderka/PHP-Console-Color/zipball/d5deaecff52a0d61ccb613bb3804088da0307191", - "reference": "d5deaecff52a0d61ccb613bb3804088da0307191", + "url": "https://api.github.com/repos/JakubOnderka/PHP-Console-Color/zipball/e0b393dacf7703fc36a4efc3df1435485197e6c1", + "reference": "e0b393dacf7703fc36a4efc3df1435485197e6c1", "shasum": "" }, "require": { - "php": ">=5.4.0" + "php": ">=5.3.2" }, "require-dev": { "jakub-onderka/php-code-style": "1.0", - "jakub-onderka/php-parallel-lint": "1.0", + "jakub-onderka/php-parallel-lint": "0.*", "jakub-onderka/php-var-dump-check": "0.*", - "phpunit/phpunit": "~4.3", + "phpunit/phpunit": "3.7.*", "squizlabs/php_codesniffer": "1.*" }, "type": "library", "autoload": { - "psr-4": { - "JakubOnderka\\PhpConsoleColor\\": "src/" + "psr-0": { + "JakubOnderka\\PhpConsoleColor": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2324,41 +2124,41 @@ "authors": [ { "name": "Jakub Onderka", - "email": "jakub.onderka@gmail.com" + "email": "jakub.onderka@gmail.com", + "homepage": "http://www.acci.cz" } ], - "time": "2018-09-29T17:23:10+00:00" + "time": "2014-04-08T15:00:19+00:00" }, { "name": "jakub-onderka/php-console-highlighter", - "version": "v0.4", + "version": "v0.3.2", "source": { "type": "git", "url": "https://github.com/JakubOnderka/PHP-Console-Highlighter.git", - "reference": "9f7a229a69d52506914b4bc61bfdb199d90c5547" + "reference": "7daa75df45242c8d5b75a22c00a201e7954e4fb5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/JakubOnderka/PHP-Console-Highlighter/zipball/9f7a229a69d52506914b4bc61bfdb199d90c5547", - "reference": "9f7a229a69d52506914b4bc61bfdb199d90c5547", + "url": "https://api.github.com/repos/JakubOnderka/PHP-Console-Highlighter/zipball/7daa75df45242c8d5b75a22c00a201e7954e4fb5", + "reference": "7daa75df45242c8d5b75a22c00a201e7954e4fb5", "shasum": "" }, "require": { - "ext-tokenizer": "*", - "jakub-onderka/php-console-color": "~0.2", - "php": ">=5.4.0" + "jakub-onderka/php-console-color": "~0.1", + "php": ">=5.3.0" }, "require-dev": { "jakub-onderka/php-code-style": "~1.0", - "jakub-onderka/php-parallel-lint": "~1.0", + "jakub-onderka/php-parallel-lint": "~0.5", "jakub-onderka/php-var-dump-check": "~0.1", "phpunit/phpunit": "~4.0", "squizlabs/php_codesniffer": "~1.5" }, "type": "library", "autoload": { - "psr-4": { - "JakubOnderka\\PhpConsoleHighlighter\\": "src/" + "psr-0": { + "JakubOnderka\\PhpConsoleHighlighter": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2372,8 +2172,7 @@ "homepage": "http://www.acci.cz/" } ], - "description": "Highlight PHP code in terminal", - "time": "2018-09-29T18:48:56+00:00" + "time": "2015-04-20T18:58:01+00:00" }, { "name": "jdorn/sql-formatter", @@ -2427,16 +2226,16 @@ }, { "name": "justinrainbow/json-schema", - "version": "5.2.7", + "version": "5.2.1", "source": { "type": "git", "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "8560d4314577199ba51bf2032f02cd1315587c23" + "reference": "429be236f296ca249d61c65649cdf2652f4a5e80" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/8560d4314577199ba51bf2032f02cd1315587c23", - "reference": "8560d4314577199ba51bf2032f02cd1315587c23", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/429be236f296ca249d61c65649cdf2652f4a5e80", + "reference": "429be236f296ca249d61c65649cdf2652f4a5e80", "shasum": "" }, "require": { @@ -2445,7 +2244,8 @@ "require-dev": { "friendsofphp/php-cs-fixer": "^2.1", "json-schema/json-schema-test-suite": "1.2.0", - "phpunit/phpunit": "^4.8.35" + "phpdocumentor/phpdocumentor": "^2.7", + "phpunit/phpunit": "^4.8.22" }, "bin": [ "bin/validate-json" @@ -2489,28 +2289,28 @@ "json", "schema" ], - "time": "2018-02-14T22:26:30+00:00" + "time": "2017-05-16T21:06:09+00:00" }, { "name": "nikic/php-parser", - "version": "v4.1.0", + "version": "v3.0.5", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "d0230c5c77a7e3cfa69446febf340978540958c0" + "reference": "2b9e2f71b722f7c53918ab0c25f7646c2013f17d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/d0230c5c77a7e3cfa69446febf340978540958c0", - "reference": "d0230c5c77a7e3cfa69446febf340978540958c0", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/2b9e2f71b722f7c53918ab0c25f7646c2013f17d", + "reference": "2b9e2f71b722f7c53918ab0c25f7646c2013f17d", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": ">=7.0" + "php": ">=5.5" }, "require-dev": { - "phpunit/phpunit": "^6.5 || ^7.0" + "phpunit/phpunit": "~4.0|~5.0" }, "bin": [ "bin/php-parse" @@ -2518,7 +2318,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -2540,36 +2340,35 @@ "parser", "php" ], - "time": "2018-10-10T09:24:14+00:00" + "time": "2017-03-05T18:23:57+00:00" }, { "name": "psy/psysh", - "version": "v0.9.9", + "version": "v0.8.6", "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "9aaf29575bb8293206bb0420c1e1c87ff2ffa94e" + "reference": "7028d6d525fb183d50b249b7c07598e3d386b27d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/9aaf29575bb8293206bb0420c1e1c87ff2ffa94e", - "reference": "9aaf29575bb8293206bb0420c1e1c87ff2ffa94e", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/7028d6d525fb183d50b249b7c07598e3d386b27d", + "reference": "7028d6d525fb183d50b249b7c07598e3d386b27d", "shasum": "" }, "require": { "dnoegel/php-xdg-base-dir": "0.1", - "ext-json": "*", - "ext-tokenizer": "*", - "jakub-onderka/php-console-highlighter": "0.3.*|0.4.*", - "nikic/php-parser": "~1.3|~2.0|~3.0|~4.0", - "php": ">=5.4.0", - "symfony/console": "~2.3.10|^2.4.2|~3.0|~4.0", - "symfony/var-dumper": "~2.7|~3.0|~4.0" + "jakub-onderka/php-console-highlighter": "0.3.*", + "nikic/php-parser": "~1.3|~2.0|~3.0", + "php": ">=5.3.9", + "symfony/console": "~2.3.10|^2.4.2|~3.0", + "symfony/var-dumper": "~2.7|~3.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.2", - "hoa/console": "~2.15|~3.16", - "phpunit/phpunit": "~4.8.35|~5.0|~6.0|~7.0" + "friendsofphp/php-cs-fixer": "~1.11", + "hoa/console": "~3.16|~1.14", + "phpunit/phpunit": "~4.4|~5.0", + "symfony/finder": "~2.1|~3.0" }, "suggest": { "ext-pcntl": "Enabling the PCNTL extension makes PsySH a lot happier :)", @@ -2584,15 +2383,15 @@ "type": "library", "extra": { "branch-alias": { - "dev-develop": "0.9.x-dev" + "dev-develop": "0.8.x-dev" } }, "autoload": { "files": [ - "src/functions.php" + "src/Psy/functions.php" ], "psr-4": { - "Psy\\": "src/" + "Psy\\": "src/Psy/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2614,27 +2413,75 @@ "interactive", "shell" ], - "time": "2018-10-13T15:16:03+00:00" + "time": "2017-06-04T10:34:20+00:00" }, { - "name": "seld/jsonlint", - "version": "1.7.1", + "name": "seld/cli-prompt", + "version": "1.0.3", "source": { "type": "git", - "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "d15f59a67ff805a44c50ea0516d2341740f81a38" + "url": "https://github.com/Seldaek/cli-prompt.git", + "reference": "a19a7376a4689d4d94cab66ab4f3c816019ba8dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/d15f59a67ff805a44c50ea0516d2341740f81a38", - "reference": "d15f59a67ff805a44c50ea0516d2341740f81a38", + "url": "https://api.github.com/repos/Seldaek/cli-prompt/zipball/a19a7376a4689d4d94cab66ab4f3c816019ba8dd", + "reference": "a19a7376a4689d4d94cab66ab4f3c816019ba8dd", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Seld\\CliPrompt\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be" + } + ], + "description": "Allows you to prompt for user input on the command line, and optionally hide the characters they type", + "keywords": [ + "cli", + "console", + "hidden", + "input", + "prompt" + ], + "time": "2017-03-18T11:32:45+00:00" + }, + { + "name": "seld/jsonlint", + "version": "1.6.0", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/jsonlint.git", + "reference": "791f8c594f300d246cdf01c6b3e1e19611e301d8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/791f8c594f300d246cdf01c6b3e1e19611e301d8", + "reference": "791f8c594f300d246cdf01c6b3e1e19611e301d8", "shasum": "" }, "require": { "php": "^5.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "^4.5" }, "bin": [ "bin/jsonlint" @@ -2663,7 +2510,7 @@ "parser", "validator" ], - "time": "2018-01-24T12:46:19+00:00" + "time": "2017-03-06T16:42:24+00:00" }, { "name": "seld/phar-utils", @@ -2711,25 +2558,25 @@ }, { "name": "symfony/finder", - "version": "v4.2.0", + "version": "v3.3.2", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "e53d477d7b5c4982d0e1bfd2298dbee63d01441d" + "reference": "baea7f66d30854ad32988c11a09d7ffd485810c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/e53d477d7b5c4982d0e1bfd2298dbee63d01441d", - "reference": "e53d477d7b5c4982d0e1bfd2298dbee63d01441d", + "url": "https://api.github.com/repos/symfony/finder/zipball/baea7f66d30854ad32988c11a09d7ffd485810c4", + "reference": "baea7f66d30854ad32988c11a09d7ffd485810c4", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": ">=5.5.9" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -2756,84 +2603,29 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-11-11T19:52:12+00:00" - }, - { - "name": "symfony/polyfill-php72", - "version": "v1.10.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "9050816e2ca34a8e916c3a0ae8b9c2fccf68b631" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9050816e2ca34a8e916c3a0ae8b9c2fccf68b631", - "reference": "9050816e2ca34a8e916c3a0ae8b9c2fccf68b631", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.9-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "time": "2018-09-21T13:07:52+00:00" + "time": "2017-06-01T21:01:25+00:00" }, { "name": "symfony/process", - "version": "v4.2.0", + "version": "v3.3.2", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "2b341009ccec76837a7f46f59641b431e4d4c2b0" + "reference": "8e30690c67aafb6c7992d6d8eb0d707807dd3eaf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/2b341009ccec76837a7f46f59641b431e4d4c2b0", - "reference": "2b341009ccec76837a7f46f59641b431e4d4c2b0", + "url": "https://api.github.com/repos/symfony/process/zipball/8e30690c67aafb6c7992d6d8eb0d707807dd3eaf", + "reference": "8e30690c67aafb6c7992d6d8eb0d707807dd3eaf", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": ">=5.5.9" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -2860,48 +2652,41 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-11-20T16:22:05+00:00" + "time": "2017-05-22T12:32:03+00:00" }, { "name": "symfony/var-dumper", - "version": "v4.2.0", + "version": "v3.3.2", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "db61258540350725f4beb6b84006e32398acd120" + "reference": "347c4247a3e40018810b476fcd5dec36d46d08dc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/db61258540350725f4beb6b84006e32398acd120", - "reference": "db61258540350725f4beb6b84006e32398acd120", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/347c4247a3e40018810b476fcd5dec36d46d08dc", + "reference": "347c4247a3e40018810b476fcd5dec36d46d08dc", "shasum": "" }, "require": { - "php": "^7.1.3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php72": "~1.5" + "php": ">=5.5.9", + "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0", - "symfony/console": "<3.4" + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0" }, "require-dev": { "ext-iconv": "*", - "symfony/process": "~3.4|~4.0", "twig/twig": "~1.34|~2.4" }, "suggest": { "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", - "ext-intl": "To show region name in time zone dump", - "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" + "ext-symfony_debug": "" }, - "bin": [ - "Resources/bin/var-dump-server" - ], "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -2935,7 +2720,7 @@ "debug", "dump" ], - "time": "2018-11-25T12:50:42+00:00" + "time": "2017-06-02T09:10:29+00:00" } ], "aliases": [], diff --git a/config/bootstrap.php b/config/bootstrap.php index 938d3c2..a3ac0d0 100644 --- a/config/bootstrap.php +++ b/config/bootstrap.php @@ -220,6 +220,3 @@ Type::build('timestamp') if (Configure::read('debug')) { Plugin::load('DebugKit', ['bootstrap' => true]); } - -Configure::load('lbry'); - diff --git a/config/lbry.default.php b/config/lbry.default.php deleted file mode 100644 index f1a5a2b..0000000 --- a/config/lbry.default.php +++ /dev/null @@ -1,11 +0,0 @@ - [ - 'RpcUrl' => 'http://user:password@127.0.0.1:9245', - ], - - 'Redis' => [ - 'Url' => 'tcp://127.0.0.1:6379', - ] -]; diff --git a/cron/addrtx.sh b/cron/addrtx.sh index 52b501a..b3c02e9 100755 --- a/cron/addrtx.sh +++ b/cron/addrtx.sh @@ -1,4 +1,4 @@ #!/bin/sh -cd /home/lbry/explorer.lbry.io +cd /var/www/lbry.block.ng bin/cake block addrtxamounts diff --git a/cron/blocks.sh b/cron/blocks.sh index 9c9764d..dc5c788 100755 --- a/cron/blocks.sh +++ b/cron/blocks.sh @@ -1,7 +1,4 @@ #!/bin/sh -cd /home/lbry/explorer.lbry.io +cd /var/www/lbry.block.ng bin/cake block parsenewblocks -rm tmp/lock/parsenewblocks 2>/dev/null -bin/cake block parsetxs -rm tmp/lock/parsetxs 2>/dev/null diff --git a/cron/blockstuff.php b/cron/blockstuff.php new file mode 100644 index 0000000..a2b9f38 --- /dev/null +++ b/cron/blockstuff.php @@ -0,0 +1,137 @@ +_startHeight = $startBlock; + $this->_endHeight = $endBlock; + $this->_maxHeight = $maxHeight; + } + + public function run() { + $conn = new \PDO("mysql:host=localhost;dbname=lbry", 'lbry-admin', '46D861aX#!yQ'); + $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + $data_error = false; + $conn->beginTransaction(); + + // TODO: Batch block synchronisation from memory to DB + + for ($curr_height = $this->_startHeight; $curr_height <= $this->_endHeight; $curr_height++) { + $idx_str = str_pad($curr_height, strlen($this->_maxHeight), '0', STR_PAD_LEFT); + + // get the block hash + $req = ['method' => 'getblockhash', 'params' => [$curr_height]]; + $response = BlockStuff::curl_json_post(BlockStuff::rpcurl, json_encode($req)); + $json = json_decode($response); + $curr_block_hash = $json->result; + + $req = ['method' => 'getblock', 'params' => [$curr_block_hash]]; + $response = BlockStuff::curl_json_post(BlockStuff::rpcurl, json_encode($req)); + $json = json_decode($response); + $curr_block = $json->result; + + $stmt = $conn->prepare('UPDATE Blocks SET Confirmations = ? WHERE Height = ?'); + try { + $stmt->execute([$curr_block->confirmations, $curr_height]); + echo "[$idx_str/$this->_maxHeight] Updated block height: $curr_height with confirmations $curr_block->confirmations.\n"; + } catch (Exception $e) { + $data_error = true; + } + } + + if ($data_error) { + echo "Rolling back changes.\n"; + $conn->rollBack(); + return; + } + + echo "Committing data.\n"; + $conn->commit(); + } +} + +class BlockStuff { + const rpcurl = 'http://lrpc:lrpc@127.0.0.1:9245'; + public static function blocksync() { + self::lock('blocksync'); + + $conn = new \PDO("mysql:host=localhost;dbname=lbry", 'lbry-admin', '46D861aX#!yQ'); + + $stmt = $conn->prepare('SELECT Height FROM Blocks ORDER BY Height DESC LIMIT 1'); + $stmt->execute([]); + $max_block = $stmt->fetch(PDO::FETCH_OBJ); + if ($max_block) { + $chunk_limit = 2; + $curr_height = 0; + $chunks = floor($max_block->Height / $chunk_limit); + $threads = []; + for ($i = 0; $i < $chunk_limit; $i++) { + $start = $curr_height; + $end = ($i == ($chunk_limit - 1)) ? $max_block->Height : $start + $chunks; + $curr_height += $chunks + 1; + $thread = new BlockSyncThread($start, $end, $max_block->Height); + $threads[] = $thread; + + $thread->start(); + } + + for ($i = 0; $i < count($threads); $i++) { + $threads[$i]->join(); + } + } + + self::unlock('blocksync'); + } + + public static function curl_json_post($url, $data, $headers = []) { + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, $url); + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); + curl_setopt($ch, CURLOPT_POST, true); + curl_setopt($ch, CURLOPT_POSTFIELDS, $data); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + $response = curl_exec($ch); + //Log::debug('Request execution completed.'); + if ($response === false) { + $error = curl_error($ch); + $errno = curl_errno($ch); + curl_close($ch); + + throw new \Exception(sprintf('The request failed: %s', $error), $errno); + } else { + curl_close($ch); + } + + // Close any open file handle + return $response; + } + + public static function lock($process_name) { + if (!is_dir(TMP . 'lock')) { + mkdir(TMP . 'lock'); + } + $lock_file = TMP . 'lock' . DS . $process_name; + if (file_exists($lock_file)) { + echo "$process_name is already running.\n"; + exit(0); + } + file_put_contents($lock_file, '1'); + } + + public static function unlock($process_name) { + $lock_file = TMP . 'lock' . DS . $process_name; + if (file_exists($lock_file)) { + unlink($lock_file); + } + return true; + } +} + +BlockStuff::blocksync(); diff --git a/cron/blocktx.sh b/cron/blocktx.sh index 770aa89..0cead96 100755 --- a/cron/blocktx.sh +++ b/cron/blocktx.sh @@ -1,4 +1,4 @@ #!/bin/sh -cd /home/lbry/explorer.lbry.io +cd /var/www/lbry.block.ng bin/cake block parsetxs diff --git a/cron/claimindex.sh b/cron/claimindex.sh index a270a52..04b173f 100755 --- a/cron/claimindex.sh +++ b/cron/claimindex.sh @@ -1,4 +1,4 @@ #!/bin/sh -cd /home/lbry/explorer.lbry.io +cd /var/www/lbry.block.ng bin/cake block buildclaimindex diff --git a/cron/confirmations.sh b/cron/confirmations.sh new file mode 100755 index 0000000..7ff4ad4 --- /dev/null +++ b/cron/confirmations.sh @@ -0,0 +1,3 @@ +#!/bin/sh +cd /var/www/lbry.block.ng/cron +php -d extension=pthreads.so blockstuff.php diff --git a/cron/fixzero.sh b/cron/fixzero.sh index a11b6af..039fea1 100755 --- a/cron/fixzero.sh +++ b/cron/fixzero.sh @@ -1,4 +1,4 @@ #!/bin/sh -cd /home/lbry/explorer.lbry.io +cd /var/www/lbry.block.ng bin/cake block fixzerooutputs diff --git a/cron/forever.sh b/cron/forever.sh deleted file mode 100755 index 5b4063e..0000000 --- a/cron/forever.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -pkill -f forevermempool -rm -f /home/lbry/explorer.lbry.io/tmp/lock/forevermempool 2>/dev/null -cd /home/lbry/explorer.lbry.io -bin/cake block forevermempool & diff --git a/cron/forevermempool.sh b/cron/forevermempool.sh new file mode 100755 index 0000000..2eab3d7 --- /dev/null +++ b/cron/forevermempool.sh @@ -0,0 +1,4 @@ +#!/bin/sh +cd /var/www/lbry.block.ng +bin/cake block forevermempool & + diff --git a/cron/livetx.sh b/cron/livetx.sh index 4e67d55..18ac6bc 100755 --- a/cron/livetx.sh +++ b/cron/livetx.sh @@ -1,4 +1,4 @@ #!/bin/sh -cd /home/lbry/explorer.lbry.io +cd /var/www/lbry.block.ng bin/cake block parsemempool diff --git a/cron/pricehistory.sh b/cron/pricehistory.sh index 1884fcc..7a06adf 100755 --- a/cron/pricehistory.sh +++ b/cron/pricehistory.sh @@ -1,4 +1,4 @@ #!/bin/sh -cd /home/lbry/explorer.lbry.io +cd /var/www/lbry.block.ng bin/cake aux pricehistory diff --git a/cron/spends.sh b/cron/spends.sh index 540a12d..c5f5402 100755 --- a/cron/spends.sh +++ b/cron/spends.sh @@ -1,4 +1,4 @@ #!/bin/sh -cd /home/lbry/explorer.lbry.io +cd /var/www/lbry.block.ng bin/cake block updatespends diff --git a/cron/verifytags.sh b/cron/verifytags.sh index 1c74f74..653c468 100755 --- a/cron/verifytags.sh +++ b/cron/verifytags.sh @@ -1,4 +1,4 @@ #!/bin/sh -cd /home/lbry/explorer.lbry.io +cd /var/www/lbry.block.ng bin/cake aux verifytags diff --git a/sql/lbryexplorer.ddl.sql b/sql/lbryexplorer.ddl.sql index 24e9498..f624d4c 100644 --- a/sql/lbryexplorer.ddl.sql +++ b/sql/lbryexplorer.ddl.sql @@ -1,4 +1,4 @@ ---DROP DATABASE IF EXISTS lbry; +l--DROP DATABASE IF EXISTS lbry; CREATE DATABASE lbry DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci; USE lbry; @@ -74,7 +74,7 @@ CREATE TABLE `Addresses` `TotalReceived` DECIMAL(18,8) DEFAULT 0 NOT NULL, `TotalSent` DECIMAL(18,8) DEFAULT 0 NOT NULL, `Balance` DECIMAL(18,8) AS (`TotalReceived` - `TotalSent`) PERSISTENT, - `Tag` VARCHAR(30), + `Tag` VARCHAR(30) NOT NULL, `TagUrl` VARCHAR(200), `Created` DATETIME NOT NULL, `Modified` DATETIME NOT NULL, @@ -163,11 +163,11 @@ CREATE TABLE `TransactionsAddresses` `AddressId` BIGINT UNSIGNED NOT NULL, `DebitAmount` DECIMAL(18,8) DEFAULT 0 NOT NULL COMMENT 'Sum of the inputs to this address for the tx', `CreditAmount` DECIMAL(18,8) DEFAULT 0 NOT NULL COMMENT 'Sum of the outputs to this address for the tx', - `TransactionTime` DATETIME DEFAULT UTC_TIMESTAMP() NOT NULL, + `LatestTransactionTime` DATETIME DEFAULT UTC_TIMESTAMP() NOT NULL, PRIMARY KEY `PK_TransactionAddress` (`TransactionId`, `AddressId`), FOREIGN KEY `Idx_TransactionsAddressesTransaction` (`TransactionId`) REFERENCES `Transactions` (`Id`), FOREIGN KEY `Idx_TransactionsAddressesAddress` (`AddressId`) REFERENCES `Addresses` (`Id`), - INDEX `Idx_TransactionsAddressesTransactionTime` (`TransactionTime`), + INDEX `Idx_TransactionsAddressesLatestTransactionTime` (`LatestTransactionTime`), INDEX `Idx_TransactionsAddressesDebit` (`DebitAmount`), INDEX `Idx_TransactionsAddressesCredit` (`CreditAmount`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; @@ -233,3 +233,7 @@ CREATE TABLE `PriceHistory` PRIMARY KEY `PK_PriceHistory` (`Id`), UNIQUE KEY `Idx_PriceHistoryCreated` (`Created`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; + +ALTER TABLE Claims ADD UNIQUE KEY `Idx_ClaimUnique` (`TransactionHash`, `Vout`, `ClaimId`); +ALTER TABLE Addresses ADD COLUMN `Balance` DECIMAL(18,8) AS (`TotalReceived` - `TotalSent`) PERSISTENT AFTER `TotalSent`; +ALTER TABLE Addresses ADD INDEX `Idx_AddressBalance` (`Balance`); \ No newline at end of file diff --git a/src/Controller/MainController.php b/src/Controller/MainController.php index 0bbaacc..f68cd44 100644 --- a/src/Controller/MainController.php +++ b/src/Controller/MainController.php @@ -7,22 +7,18 @@ use Mdanter\Ecc\Crypto\Signature\Signer; use Mdanter\Ecc\Serializer\PublicKey\PemPublicKeySerializer; use Mdanter\Ecc\Serializer\PublicKey\DerPublicKeySerializer; use Mdanter\Ecc\Serializer\Signature\DerSignatureSerializer; -use Cake\Core\Configure; use Cake\Datasource\ConnectionManager; use Cake\Log\Log; use Endroid\QrCode\ErrorCorrectionLevel; use Endroid\QrCode\LabelAlignment; use Endroid\QrCode\QrCode; -use Endroid\QrCode\Response\QrCodeResponse; class MainController extends AppController { - public static $rpcurl; + const rpcurl = 'http://lrpc:lrpc@127.0.0.1:9245'; const lbcPriceKey = 'lbc.price'; - const txOutSetInfo = 'lbrcrd.tosi'; - const bittrexMarketUrl = 'https://bittrex.com/api/v1.1/public/getticker?market=BTC-LBC'; const blockchainTickerUrl = 'https://blockchain.info/ticker'; @@ -33,8 +29,7 @@ class MainController extends AppController { public function initialize() { parent::initialize(); - self::$rpcurl = Configure::read('Lbry.RpcUrl'); - $this->redis = new \Predis\Client(Configure::read('Redis.Url')); + $this->redis = new \Predis\Client('tcp://127.0.0.1:6379'); try { $this->redis->info('mem'); } catch (\Predis\Connection\ConnectionException $e) { @@ -332,6 +327,9 @@ class MainController extends AppController { public function find() { $criteria = $this->request->query('q'); + if ($criteria === null || strlen(trim($criteria)) == 0) { + return $this->redirect('/'); + } $this->loadModel('Blocks'); $this->loadModel('Claims'); @@ -354,7 +352,7 @@ class MainController extends AppController { // Claim ID $claim = $this->Claims->find()->select(['ClaimId'])->where(['ClaimId' => $criteria])->first(); if ($claim) { - return $this->redirect('/claims/' . $claim->ClaimId); + return $this->redirect('/claim/' . $claim->ClaimId); } } else if (strlen(trim($criteria)) === 64) { // block or tx hash // Try block hash first @@ -369,14 +367,14 @@ class MainController extends AppController { } } else { // finally, try exact claim name match - $claims = $this->Claims->find()->distinct(['Claims.ClaimId'])->where(['Name' => $criteria])->order(['Claims.Created' => 'DESC'])->limit(10)->toArray(); - if (count($claims) == 1) { - return $this->redirect('/claims/' . $claims[0]->ClaimId); - } - else { - $this->set('claims', $claims); + $claim = $this->Claims->find()->select(['ClaimId'])->where(['Name' => $criteria])->first(); + if ($claim) { + return $this->redirect('/claims/' . $claim->ClaimId); } } + + // Not found, redirect to index + return $this->redirect('/'); } public function blocks($height = null) { @@ -402,11 +400,7 @@ class MainController extends AppController { } $offset = ($page - 1) * $pageLimit; - $currentBlock = $this->Blocks->find()->select(['Height'])->order(['Height' => 'DESC'])->first(); - $blocks = $this->Blocks->find()->select( - ['Height', 'Difficulty', 'TransactionHashes', 'BlockSize', 'Nonce', 'BlockTime'] - )->offset($offset)->limit($pageLimit)->order(['Height' => 'DESC'])->toArray(); - $this->set('currentBlock', $currentBlock); + $blocks = $this->Blocks->find()->offset($offset)->limit($pageLimit)->order(['Height' => 'DESC'])->toArray(); $this->set('blocks', $blocks); $this->set('pageLimit', $pageLimit); $this->set('numPages', $numPages); @@ -427,7 +421,7 @@ class MainController extends AppController { try { // update the block confirmations $req = ['method' => 'getblock', 'params' => [$block->Hash]]; - $response = self::curl_json_post(self::$rpcurl, json_encode($req)); + $response = self::curl_json_post(self::rpcurl, json_encode($req)); $json = json_decode($response); $rpc_block = $json->result; if (isset($rpc_block->confirmations)) { @@ -452,8 +446,6 @@ class MainController extends AppController { $this->loadModel('Transactions'); $this->loadModel('Inputs'); $this->loadModel('Outputs'); - $this->loadModel('Claims'); - $sourceAddress = $this->request->query('address'); $tx = $this->Transactions->find()->select( @@ -468,17 +460,13 @@ class MainController extends AppController { $conn->execute('UPDATE Transactions SET TransactionSize = ? WHERE Id = ?', [$tx->TransactionSize, $tx->Id]); } - $maxBlock = $this->Blocks->find()->select(['Height'])->order(['Height' => 'desc'])->first(); $block = $this->Blocks->find()->select(['Confirmations', 'Height'])->where(['Hash' => $tx->BlockHash])->first(); - $confirmations = $block ? (($maxBlock->Height - $block->Height) + 1) : '0'; $inputs = $this->Inputs->find()->contain(['InputAddresses'])->where(['TransactionId' => $tx->Id])->order(['PrevoutN' => 'asc'])->toArray(); $outputs = $this->Outputs->find()->contain(['OutputAddresses', 'SpendInput' => ['fields' => ['Id', 'TransactionHash', 'PrevoutN', 'PrevoutHash']]])->where(['Outputs.TransactionId' => $tx->Id])->order(['Vout' => 'asc'])->toArray(); for ($i = 0; $i < count($outputs); $i++) { $outputs[$i]->IsClaim = (strpos($outputs[$i]->ScriptPubKeyAsm, 'CLAIM') > -1); $outputs[$i]->IsSupportClaim = (strpos($outputs[$i]->ScriptPubKeyAsm, 'SUPPORT_CLAIM') > -1); $outputs[$i]->IsUpdateClaim = (strpos($outputs[$i]->ScriptPubKeyAsm, 'UPDATE_CLAIM') > -1); - $claim = $this->Claims->find()->where(['TransactionHash' => $tx->Hash, 'Vout' => $outputs[$i]->Vout])->first(); - $outputs[$i]->Claim = $claim; } $totalIn = 0; @@ -494,7 +482,7 @@ class MainController extends AppController { $this->set('tx', $tx); $this->set('block', $block); - $this->set('confirmations', $confirmations); + $this->set('confirmations', $block ? number_format($block->Confirmations, 0, '', ',') : '0'); $this->set('fee', $fee); $this->set('inputs', $inputs); $this->set('outputs', $outputs); @@ -508,13 +496,12 @@ class MainController extends AppController { $richList = $this->Addresses->find()->where(['Address <>' => 'bHW58d37s1hBjj3wPBkn5zpCX3F8ZW3uWf'])->order(['Balance' => 'DESC'])->limit(500)->toArray(); $priceRate = 0; - //$priceInfo = json_decode($this->redis->get(self::lbcPriceKey)); - $priceInfo->price = 0.05; + $priceInfo = json_decode($this->redis->get(self::lbcPriceKey)); if (isset($priceInfo->price)) { $priceRate = $priceInfo->price; } - $lbryAddresses = ['rFLUohPG4tP3gZHYoyhvADCtrDMiaYb7Qd', 'r9PGXsejVJb9ZfMf3QVdDEJCzxkd9JLxzL', 'r9srwX7DEN7Mex3a8oR1mKSqQmLBizoJvi', 'bRo4FEeqqxY7nWFANsZsuKEWByEgkvz8Qt', 'bU2XUzckfpdEuQNemKvhPT1gexQ3GG3SC2', 'bay3VA6YTQBL4WLobbG7CthmoGeUKXuXkD', 'bLPbiXBp6Vr3NSnsHzDsLNzoy5o36re9Cz', 'bMvUBo1h5WS46ThHtmfmXftz3z33VHL7wc', 'bVUrbCK8hcZ5XWti7b9eNxKEBxzc1rr393', 'bZja2VyhAC84a9hMwT8dwTU6rDRXowrjxH', 'bMvUBo1h5WS46ThHtmfmXftz3z33VHL7wc', 'bMgqQqYfwzWWYBk5o5dBMXtCndVAoeqy6h', 'bMvUBo1h5WS46ThHtmfmXftz3z33VHL7wc']; + // calculate percentages $totalBalance = 0; $maxBalance = 0; $minBalance = 0; @@ -532,13 +519,11 @@ class MainController extends AppController { $this->set('richList', $richList); $this->set('rate', $priceRate); - $this->set('lbryAddresses', $lbryAddresses); } public function address($addr = null) { set_time_limit(0); - $this->loadModel('Blocks'); $this->loadModel('Addresses'); $this->loadModel('Transactions'); $this->loadModel('Inputs'); @@ -560,6 +545,13 @@ class MainController extends AppController { $recentTxs = []; $tagRequestAmount = 0; + // Check for pending tag request + $this->loadModel('TagAddressRequests'); + $pending = $this->TagAddressRequests->find()->where(['Address' => $addr, 'IsVerified <>' => 1])->first(); + if (!$pending) { + $tagRequestAmount = '25.' . rand(11111111, 99999999); + } + $address = $this->Addresses->find()->where(['Address' => $addr])->first(); if (!$address) { @@ -599,18 +591,13 @@ class MainController extends AppController { $stmt = $conn->execute('SELECT A.TotalReceived, A.TotalSent, A.Balance FROM Addresses A WHERE A.Id = ?', [$address->Id]); $totals = $stmt->fetch(\PDO::FETCH_OBJ); - $currentBlock = $this->Blocks->find()->select(['Height'])->order(['Height' => 'desc'])->first(); - $currentHeight = $currentBlock ? intval($currentBlock->Height) : 0; - - $stmt = $conn->execute(sprintf( - 'SELECT T.Id, T.Hash, T.InputCount, T.OutputCount, T.Value, ' . - ' TA.DebitAmount, TA.CreditAmount, ' . - ' B.Height, (CASE WHEN B.Height IS NOT NULL THEN ((' . $currentHeight . ' - B.Height) + 1) ELSE NULL END) AS Confirmations, ' . - ' IFNULL(T.TransactionTime, T.CreatedTime) AS TxTime ' . - 'FROM Transactions T ' . - 'LEFT JOIN Blocks B ON T.BlockHash = B.Hash ' . - 'RIGHT JOIN (SELECT TransactionId, DebitAmount, CreditAmount FROM TransactionsAddresses ' . - ' WHERE AddressId = ? ORDER BY TransactionTime DESC LIMIT %d, %d) TA ON TA.TransactionId = T.Id', $offset, $pageLimit), [$addressId]); + $stmt = $conn->execute(sprintf('SELECT T.Id, T.Hash, T.InputCount, T.OutputCount, T.Value, ' . + 'TA.DebitAmount, TA.CreditAmount, ' . + 'B.Height, B.Confirmations, IFNULL(T.TransactionTime, T.CreatedTime) AS TxTime ' . + 'FROM Transactions T ' . + 'LEFT JOIN Blocks B ON T.BlockHash = B.Hash ' . + 'RIGHT JOIN (SELECT TransactionId, DebitAmount, CreditAmount FROM TransactionsAddresses ' . + ' WHERE AddressId = ? ORDER BY TransactionTime DESC LIMIT %d, %d) TA ON TA.TransactionId = T.Id', $offset, $pageLimit), [$addressId]); $recentTxs = $stmt->fetchAll(\PDO::FETCH_OBJ); $totalRecvAmount = $totals->TotalReceived == 0 ? '0' : $totals->TotalReceived + 0; @@ -620,6 +607,8 @@ class MainController extends AppController { $this->set('offset', $offset); $this->set('canTag', $canTag); + $this->set('pending', $pending); + $this->set('tagRequestAmount', $tagRequestAmount); $this->set('address', $address); $this->set('totalReceived', $totalRecvAmount); $this->set('totalSent', $totalSentAmount); @@ -642,15 +631,15 @@ class MainController extends AppController { $qrCode->setSize(300); // Set advanced options - $qrCode->setWriterByName('png'); - $qrCode->setMargin(10); - $qrCode->setEncoding('UTF-8'); - $qrCode->setErrorCorrectionLevel(new ErrorCorrectionLevel(ErrorCorrectionLevel::LOW)); - $qrCode->setForegroundColor(['r' => 0, 'g' => 0, 'b' => 0, 'a' => 0]); - $qrCode->setBackgroundColor(['r' => 255, 'g' => 255, 'b' => 255, 'a' => 0]); - $qrCode->setLogoWidth(150); - $qrCode->setValidateResult(false); - + $qrCode + ->setWriterByName('png') + ->setMargin(10) + ->setEncoding('UTF-8') + ->setErrorCorrectionLevel(ErrorCorrectionLevel::LOW) + ->setForegroundColor(['r' => 0, 'g' => 0, 'b' => 0]) + ->setBackgroundColor(['r' => 255, 'g' => 255, 'b' => 255]) + ->setLogoWidth(150) + ->setValidateResult(false); header('Content-Type: '.$qrCode->getContentType()); echo $qrCode->writeString(); @@ -682,7 +671,7 @@ class MainController extends AppController { private function _gethashrate() { $req = ['method' => 'getnetworkhashps', 'params' => []]; try { - $res = json_decode(self::curl_json_post(self::$rpcurl, json_encode($req))); + $res = json_decode(self::curl_json_post(self::rpcurl, json_encode($req))); if (!isset($res->result)) { return 0; } @@ -691,50 +680,18 @@ class MainController extends AppController { return 'N/A'; } } - - protected function _gettxoutsetinfo() { - $now = new \DateTime('now', new \DateTimeZone('UTC')); - $txOutSetInfo = new \stdClass(); - $txOutSetInfo->time = $now->format('c'); - - $shouldRefreshSet = false; - if (!$this->redis) { - $shouldRefreshSet = true; - } else { - if (!$this->redis->exists(self::txOutSetInfo)) { - $shouldRefreshSet = true; - } else { - $txOutSetInfo = json_decode($this->redis->get(self::txOutSetInfo)); - $lastTOSIDt = new \DateTime($txOutSetInfo->time); - $diff = $now->diff($lastTOSIDt); - $diffMinutes = $diff->i; - if ($diffMinutes >= 15 || $txOutSetInfo->set == 'N/A') { - $shouldRefreshSet = true; - } + private function _gettxoutsetinfo() { + $req = ['method' => 'gettxoutsetinfo', 'params' => []]; + try { + $res = json_decode(self::curl_json_post(self::rpcurl, json_encode($req))); + if (!isset($res->result)) { + return 0; } + return $res->result; + } catch (\Exception $e) { + return 'N/A'; } - - if ($shouldRefreshSet) { - - $req = ['method' => 'gettxoutsetinfo', 'params' => []]; - try { - $res = json_decode(self::curl_json_post(self::$rpcurl, json_encode($req))); - if (!isset($res->result)) { - $txOutSetInfo->tosi = 'N/A'; - } - $txOutSetInfo->tosi = $res->result; - } catch (\Exception $e) { - $txOutSetInfo->tosi = 'N/A'; - } - $txOutSetInfo->time = $now->format('c'); - if ($this->redis) { - $this->redis->set(self::txOutSetInfo, json_encode($txOutSetInfo)); - } - } - - return (isset($txOutSetInfo->tosi)) ? $txOutSetInfo->tosi : 'N/A'; } - public function apistatus() { $this->autoRender = false; $this->loadModel('Blocks'); @@ -907,14 +864,14 @@ class MainController extends AppController { public function apiutxosupply() { $this->autoRender = false; $this->loadModel('Addresses'); - + $circulating = 0; $reservedcommunity = 0; $reservedoperational = 0; $reservedinstitutional = 0; $reservedtotal = 0; $circulating = 0; - + $txoutsetinfo = $this->_gettxoutsetinfo(); $reservedcommunity = $this->Addresses->find()->select(['Balance'])->where(['Address =' => 'rFLUohPG4tP3gZHYoyhvADCtrDMiaYb7Qd'])->first(); $reservedoperational = $this->Addresses->find()->select(['Balance'])->where(['Address =' => 'r9PGXsejVJb9ZfMf3QVdDEJCzxkd9JLxzL'])->first(); @@ -925,20 +882,16 @@ class MainController extends AppController { $this->Addresses->find()->select(['Balance'])->where(['Address =' => 'bay3VA6YTQBL4WLobbG7CthmoGeUKXuXkD'])->first() + $this->Addresses->find()->select(['Balance'])->where(['Address =' => 'bLPbiXBp6Vr3NSnsHzDsLNzoy5o36re9Cz'])->first() + $this->Addresses->find()->select(['Balance'])->where(['Address =' => 'bMvUBo1h5WS46ThHtmfmXftz3z33VHL7wc'])->first() + - $this->Addresses->find()->select(['Balance'])->where(['Address =' => 'bVUrbCK8hcZ5XWti7b9eNxKEBxzc1rr393'])->first() + - $this->Addresses->find()->select(['Balance'])->where(['Address =' => 'bZja2VyhAC84a9hMwT8dwTU6rDRXowrjxH'])->first() + - $this->Addresses->find()->select(['Balance'])->where(['Address =' => 'bMvUBo1h5WS46ThHtmfmXftz3z33VHL7wc'])->first() + - $this->Addresses->find()->select(['Balance'])->where(['Address =' => 'bCrboXVztuSbZzVToCWSsu1pEr2oxKHu9v'])->first() + - $this->Addresses->find()->select(['Balance'])->where(['Address =' => 'bMgqQqYfwzWWYBk5o5dBMXtCndVAoeqy6h'])->first(); - + $this->Addresses->find()->select(['Balance'])->where(['Address =' => 'bVUrbCK8hcZ5XWti7b9eNxKEBxzc1rr393'])->first(); + $reservedtotal = $reservedcommunity->Balance + $reservedoperational->Balance + $reservedinstitutional->Balance + $reservedaux->Balance; - - + + $circulating = $txoutsetinfo->total_amount - $reservedtotal; - + return $this->_jsonResponse(['success' => true, 'utxosupply' => ['total' => $txoutsetinfo->total_amount, 'circulating' => $circulating]]); } - + private static function curl_json_post($url, $data, $headers = []) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); @@ -961,4 +914,6 @@ class MainController extends AppController { // Close any open file handle return $response; } -} \ No newline at end of file +} + +?> diff --git a/src/Model/Entity/Claim.php b/src/Model/Entity/Claim.php index 18a5734..8faa889 100644 --- a/src/Model/Entity/Claim.php +++ b/src/Model/Entity/Claim.php @@ -5,46 +5,7 @@ namespace App\Model\Entity; use Cake\ORM\Entity; class Claim extends Entity { - function getLbryLink() { - $link = $this->Name; - if (isset($this->Publisher->Name)) { - $link = $this->Publisher->Name . '/' . $link; - } - $link = 'lbry://' . $link; - return $link; - } - function getExplorerLink() { - $link = '/claims/' . $this->ClaimId; - return $link; - } - - function getContentTag() { - $ctTag = null; - if (substr($this->ContentType, 0, 5) === 'audio') { - $ctTag = 'audio'; - } else if (substr($this->ContentType, 0, 5) === 'video') { - $ctTag = 'video'; - } else if (substr($this->ContentType, 0, 5) === 'image') { - $ctTag = 'image'; - } - - if (!$ctTag && $this->ClaimType == 1) { - $ctTag = 'identity'; - } - return $ctTag; - } - - function getAutoThumbText() { - $autoThumbText = ''; - if ($this->ClaimType == 1) { - $autoThumbText = strtoupper(substr($this->Name, 1, min( strlen($this->Name), 3 ))); - } else { - $str = (strlen(trim($this->Title)) > 0) ? $this->Title : $this->Name; - $autoThumbText = strtoupper(substr($str, 0, min (strlen($str), 2 ))); - } - return $autoThumbText; - } } -?> +?> \ No newline at end of file diff --git a/src/Shell/AuxShell.php b/src/Shell/AuxShell.php index 2495a9c..692127f 100644 --- a/src/Shell/AuxShell.php +++ b/src/Shell/AuxShell.php @@ -4,15 +4,12 @@ namespace App\Shell; use Cake\Console\ConsoleOutput; use Cake\Console\Shell; -use Cake\Core\Configure; use Cake\Datasource\ConnectionManager; use Cake\Log\Log; use Mdanter\Ecc\EccFactory; class AuxShell extends Shell { - public static $rpcurl; - const bittrex = 'https://bittrex.com/api/v1.1/public/getticker?market=BTC-LBC'; const blockchainticker = 'https://blockchain.info/ticker'; @@ -23,11 +20,12 @@ class AuxShell extends Shell { const scriptAddress = [5, 122]; + const rpcurl = 'http://lrpc:lrpc@127.0.0.1:9245'; + const tagrcptaddress = 'bLockNgmfvnnnZw7bM6SPz6hk5BVzhevEp'; public function initialize() { parent::initialize(); - self::$rpcurl = Configure::read('Lbry.RpcUrl'); $this->loadModel('Addresses'); $this->loadModel('Inputs'); $this->loadModel('Outputs'); @@ -128,7 +126,7 @@ class AuxShell extends Shell { self::lock('pricehistory'); $conn = ConnectionManager::get('default'); - $redis = new \Predis\Client(Configure::read('Redis.Url')); + $redis = new \Predis\Client('tcp://127.0.0.1:6379'); try { // Only allow 5-minute update intervals diff --git a/src/Shell/BlockShell.php b/src/Shell/BlockShell.php index 21793ee..2c933de 100644 --- a/src/Shell/BlockShell.php +++ b/src/Shell/BlockShell.php @@ -4,27 +4,24 @@ namespace App\Shell; use Cake\Console\ConsoleOutput; use Cake\Console\Shell; -use Cake\Core\Configure; use Cake\Datasource\ConnectionManager; use Cake\Log\Log; use Mdanter\Ecc\EccFactory; class BlockShell extends Shell { - public static $rpcurl; - - public static $redisurl; - const mempooltxkey = 'lbc.mempooltx'; const pubKeyAddress = [0, 85]; const scriptAddress = [5, 122]; + const rpcurl = 'http://lrpc:lrpc@127.0.0.1:9245'; + + const redisurl = 'tcp://127.0.0.1:6379'; + public function initialize() { parent::initialize(); - self::$rpcurl = Configure::read('Lbry.RpcUrl'); - self::$redisurl = Configure::read('Redis.Url'); $this->loadModel('Blocks'); $this->loadModel('Addresses'); $this->loadModel('Claims'); @@ -38,6 +35,11 @@ class BlockShell extends Shell { $this->out('No arguments specified'); } + public function testtx() { + $raw = '0100000001e4801fa8c9621753410e6c576c73168cc551624e08e4cc56e9a9189e8ebabcc3010000006b483045022100dcc5ae5564353e05cd8415936cdb534a26049a80a9866dbcab5dbb6ab16abbc702203af681fb5fbba5c78af887778aa32f27bc653312322b44c2a78e883e322921790121031c38def6b103b58481818d7d8aba39f9f51798f686ec3332bac23726a23366adffffffff0200e1f50500000000fd3a01b512626c6f636b6578706c6f7265722d686f6d654d0801080110011aa3010801125c080410011a1c4c42525920426c6f636b204578706c6f72657220486f6d6570616765222c574950204c42525920426c6f636b204578706c6f72657220686f6d6520706167652073637265656e73686f742a00320038004a0052005a001a41080110011a3038c6bf4a310d5b172aaae03cffb93e5a27c47f3946f58af0a4b9f99d7be42998f7dcec9b0fb0c124a6477bdb4c5311db2209696d6167652f706e672a5c080110031a401eb69f65768ba2cc347067dfb1317131137f7d685a5e804a4aeedd2385332c70f3ec7632fcebfbc073e37a58dbfbf4e6641853bbfc188b0d8bf27435b540801d22146b2a1d378efcdb7db7a03baa7dfedb86b976bc4a6d7576a914b7182b0f7c896ab240d233f81cb891e3f25e739988ac8085e811000000001976a9146fde27b4dac0b79a9ea06756562a52b019da7a8e88ac00000000'; + $decoded = self::decode_tx($raw); + } + public function fixscripthashtx() { $conn = ConnectionManager::get('default'); $otxs = $this->Outputs->find()->select(['TransactionId'])->distinct(['TransactionId'])->where(['Type' => 'scripthash'])->toArray(); @@ -45,7 +47,7 @@ class BlockShell extends Shell { $txid = $otx->TransactionId; $tx = $this->Transactions->find()->select(['Hash'])->where(['Id' => $txid])->first(); $req = ['method' => 'getrawtransaction', 'params' => [$tx->Hash]]; - $response = self::curl_json_post(self::$rpcurl, json_encode($req)); + $response = self::curl_json_post(self::rpcurl, json_encode($req)); $json = json_decode($response); $tx_result = $json->result; $raw_tx = $tx_result; @@ -163,7 +165,7 @@ class BlockShell extends Shell { $req = ['method' => 'getvalueforname', 'params' => [$claim_name]]; $json = null; try { - $json = json_decode(self::curl_json_post(self::$rpcurl, json_encode($req))); + $json = json_decode(self::curl_json_post(self::rpcurl, json_encode($req))); if (!$json) { echo "[$idx_str/$count] getvalueforname failed for [$out->Hash:$vout]. Skipping.\n"; continue; @@ -274,7 +276,6 @@ class BlockShell extends Shell { self::unlock('buildindex'); } - // TODO: Refactor for unique claim identification by claim_id instead of using the claim name. protected function _getclaimfortxout($pubkeyasm, $tx_hash, $vout, $tx_time = null) { $claim_data = null; $claim_stream_data = null; @@ -296,14 +297,10 @@ class BlockShell extends Shell { if ($json) { $claim = json_decode($json); if ($claim) { - if (strpos($claim_name, '#') !== false) { - $claim_name = substr($claim_name, 0, strpos($claim_name, '#')); - } - $req = ['method' => 'getvalueforname', 'params' => [$claim_name]]; $json = null; try { - $json = json_decode(self::curl_json_post(self::$rpcurl, json_encode($req))); + $json = json_decode(self::curl_json_post(self::rpcurl, json_encode($req))); if ($json) { $claim_data = []; $claim_id = $json->result->claimId; @@ -399,7 +396,7 @@ class BlockShell extends Shell { // getraw $req = ['method' => 'getrawtransaction', 'params' => [$tx->Hash]]; $start_ms = round(microtime(true) * 1000); - $response = self::curl_json_post(self::$rpcurl, json_encode($req)); + $response = self::curl_json_post(self::rpcurl, json_encode($req)); $diff_ms = (round(microtime(true) * 1000)) - $start_ms; $total_diff += $diff_ms; echo "getrawtx took {$diff_ms}ms. "; @@ -681,7 +678,7 @@ class BlockShell extends Shell { private function processtx($tx_hash, $block_ts, $block_data, &$data_error) { // Get the raw transaction (Use getrawtx daemon instead (for speed!!!) $req = ['method' => 'getrawtransaction', 'params' => [$tx_hash]]; - $response = self::curl_json_post(self::$rpcurl, json_encode($req)); + $response = self::curl_json_post(self::rpcurl, json_encode($req)); $json = json_decode($response); $tx_result = $json->result; $raw_tx = $tx_result; @@ -1083,13 +1080,12 @@ class BlockShell extends Shell { try { // Get the best block hash $req = ['method' => 'getbestblockhash', 'params' => []]; - $response = self::curl_json_post(self::$rpcurl, json_encode($req)); + $response = self::curl_json_post(self::rpcurl, json_encode($req)); $json = json_decode($response); -print_r($response); print_r($json); $best_hash = $json->result; $req = ['method' => 'getblock', 'params' => [$best_hash]]; - $response = self::curl_json_post(self::$rpcurl, json_encode($req)); + $response = self::curl_json_post(self::rpcurl, json_encode($req)); $json = json_decode($response); $best_block = $json->result; @@ -1112,20 +1108,20 @@ print_r($response); print_r($json); for ($curr_height = $min_height; $curr_height <= $max_height; $curr_height++) { // get the block hash $req = ['method' => 'getblockhash', 'params' => [$curr_height]]; - $response = self::curl_json_post(self::$rpcurl, json_encode($req)); + $response = self::curl_json_post(self::rpcurl, json_encode($req)); $json = json_decode($response); $curr_block_hash = $json->result; $next_block_hash = null; if ($curr_height < $max_height) { $req = ['method' => 'getblockhash', 'params' => [$curr_height + 1]]; - $response = self::curl_json_post(self::$rpcurl, json_encode($req)); + $response = self::curl_json_post(self::rpcurl, json_encode($req)); $json = json_decode($response); $next_block_hash = $json->result; } $req = ['method' => 'getblock', 'params' => [$curr_block_hash]]; - $response = self::curl_json_post(self::$rpcurl, json_encode($req)); + $response = self::curl_json_post(self::rpcurl, json_encode($req)); $json = json_decode($response); $curr_block = $json->result; @@ -1136,7 +1132,7 @@ print_r($response); print_r($json); $next_block = null; if ($next_block_hash != null) { $req = ['method' => 'getblock', 'params' => [$next_block_hash]]; - $response = self::curl_json_post(self::$rpcurl, json_encode($req)); + $response = self::curl_json_post(self::rpcurl, json_encode($req)); $json = json_decode($response); $next_block = $json->result; } @@ -1252,7 +1248,7 @@ print_r($response); print_r($json); while (true) { try { $data = ['method' => 'getrawmempool', 'params' => []]; - $res = self::curl_json_post(self::$rpcurl, json_encode($data)); + $res = self::curl_json_post(self::rpcurl, json_encode($data)); $json = json_decode($res); $txs = $json->result; $now = new \DateTime('now', new \DateTimeZone('UTC')); @@ -1302,16 +1298,7 @@ print_r($response); print_r($json); } } } catch (\Exception $e) { - echo "Mempool database error. Attempting to reconnect.\n"; - - // Final fix for MySQL server has gone away (hopefully) - try { - $conn->disconnect(); - } catch (\Exception $e) { - // ignore possible disconnect errors - } - - $conn->connect(); + echo "Error occurred processing mempool: " . $e->getMessage() . "\n"; } echo "*******************\n"; @@ -1861,7 +1848,7 @@ print_r($response); print_r($json); // Other standard: pay to pubkey hash $define['p2pk'] = array('type' => 'pubkeyhash', 'reqSigs' => 1, - 'data_index_for_hash' => 0); + 'data_index_for_hash' => 1); $rule['p2pk'] = [ '0' => '/^[0-9a-f]+$/i', '1' => '/^OP_CHECKSIG/' @@ -2079,7 +2066,7 @@ print_r($response); print_r($json); } public static function _init_redis() { - $redis = new \Predis\Client(self::$redisurl); + $redis = new \Predis\Client(self::redisurl); try { $redis->info('mem'); } catch (\Predis\Connection\ConnectionException $e) { @@ -2209,4 +2196,4 @@ print_r($response); print_r($json); */ } -?> +?> \ No newline at end of file diff --git a/src/Template/Element/header.ctp b/src/Template/Element/header.ctp index d248714..1a561f1 100644 --- a/src/Template/Element/header.ctp +++ b/src/Template/Element/header.ctp @@ -9,6 +9,6 @@ - + \ No newline at end of file diff --git a/src/Template/Layout/default.ctp b/src/Template/Layout/default.ctp index bcaeac9..9ee1ab7 100644 --- a/src/Template/Layout/default.ctp +++ b/src/Template/Layout/default.ctp @@ -16,16 +16,22 @@ + - - - - + - + end(); ?>
@@ -183,7 +412,7 @@ Height ?> Difficulty, 8, '.', '') ?> - Height - $block->Height) + 1), 0, '', ',') ?> + Confirmations, 0, '', ',') ?> TransactionHashes)) ?> BlockSize / 1024, 2) . 'KB' ?> Nonce ?> diff --git a/src/Template/Main/claims.ctp b/src/Template/Main/claims.ctp index 0d4bfad..67a3327 100644 --- a/src/Template/Main/claims.ctp +++ b/src/Template/Main/claims.ctp @@ -39,7 +39,20 @@ getAutoThumbText(); +$autoThumbText = ''; +$link = $claim->Name; +$rawLink = $claim->Name; +if (isset($claim->Publisher->Name)) { + $link = urlencode($claim->Publisher->Name) . '/' . $link; + $rawLink = $claim->Publisher->Name . '/' . $rawLink; +} +$link = 'lbry://' . $link; +$rawLink = 'lbry://' . $rawLink; +if ($claim->ClaimType == 1) { $autoThumbText = strtoupper(substr($claim->Name, 1, min( strlen($claim->Name), 10 ))); } else { + $str = str_replace(' ', '', (strlen(trim($claim->Title)) > 0) ? $claim->Title : $claim->Name); + $autoThumbText = strtoupper(mb_substr($str, 0, min( strlen($str), 10 ))); +} + $cost = 'Free'; if (isset($claim->Price) && $claim->Price > 0) { $cost = $this->Amount->formatCurrency($claim->Price) . ' LBC'; @@ -68,7 +81,7 @@ if (strlen(trim($desc)) == 0) {
IsNSFW && strlen(trim($claim->ThumbnailUrl)) > 0): ?> - +
@@ -76,7 +89,7 @@ if (strlen(trim($desc)) == 0) {
ClaimType == 2): ?> -
Published By
+
Published by
Publisher)): ?> Publisher->Name ?> @@ -86,15 +99,15 @@ if (strlen(trim($desc)) == 0) {
-
Created On
+
Created
TransactionTime > 0 ? $claim->TransactionTime : $claim->Created->format('U'))->format('j M Y H:i:s') ?> UTC
-
Transaction ID
+
Transaction
ClaimType == 2): ?>
Cost
-
Safe for Work
+
Safe for work
IsNSFW ? 'No' : 'Yes' ?>
@@ -131,7 +144,7 @@ if (strlen(trim($desc)) == 0) {
Language)) > 0 ? ($claim->Language == 'en' ? 'English' : '') : 'Unspecified' ?>
- Open in LBRY + Open in LBRY
@@ -151,7 +164,15 @@ if (strlen(trim($desc)) == 0) { $row++; } - $autoThumbText = $claim->getAutoThumbText(); + $autoThumbText = ''; + $link = $claim->Name; + $rawLink = $claim->Name; + if (isset($claim->Publisher->Name)) { + $link = urlencode($claim->Publisher->Name) . '/' . $link; + $rawLink = $claim->Publisher->Name . '/' . $rawLink; + } + $link = 'lbry://' . $link; + $rawLink = 'lbry://' . $rawLink; $cost = ''; if (isset($claim->Price) && $claim->Price > 0) { $cost = $this->Amount->formatCurrency($claim->Price) . ' LBC'; @@ -160,7 +181,24 @@ if (strlen(trim($desc)) == 0) { } // content type - $ctTag = $claim->getContentTag(); + $ctTag = null; + if (substr($claim->ContentType, 0, 5) === 'audio') { + $ctTag = 'audio'; + } else if (substr($claim->ContentType, 0, 5) === 'video') { + $ctTag = 'video'; + } else if (substr($claim->ContentType, 0, 5) === 'image') { + $ctTag = 'image'; + } + + if (!$ctTag && $claim->ClaimType == 1) { + $ctTag = 'identity'; + } + + if ($claim->ClaimType == 1) { $autoThumbText = strtoupper(substr($claim->Name, 1, min( strlen($claim->Name), 10 ))); } else { + $str = str_replace(' ', '', (strlen(trim($claim->Title)) > 0) ? $claim->Title : $claim->Name); + $autoThumbText = strtoupper(mb_substr($str, 0, min( strlen($str), 10 ))); + } + ?>
0): ?> @@ -178,7 +216,7 @@ if (strlen(trim($desc)) == 0) {
IsNSFW && strlen(trim($claim->ThumbnailUrl)) > 0): ?> - +
@@ -186,7 +224,7 @@ if (strlen(trim($desc)) == 0) {