New explorer branch #92

Open
marcdeb1 wants to merge 5 commits from marcdeb1/new-explorer into master
590 changed files with 125912 additions and 152997 deletions
Showing only changes of commit 3bb0fb9b19 - Show all commits

7
.dockerignore Normal file
View file

@ -0,0 +1,7 @@
.git
.idea
.env
node_modules
storage/framework/cache/**
storage/framework/sessions/**
storage/framework/views/**

View file

@ -1,18 +1,15 @@
; This file is for unifying the coding style for different editors and IDEs.
; More information at http://editorconfig.org
root = true root = true
[*] [*]
indent_style = space charset = utf-8
indent_size = 4
end_of_line = lf end_of_line = lf
insert_final_newline = true insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true trim_trailing_whitespace = true
[*.bat] [*.md]
end_of_line = crlf trim_trailing_whitespace = false
[*.yml] [*.yml]
indent_style = space
indent_size = 2 indent_size = 2

29
.env.example Normal file
View file

@ -0,0 +1,29 @@
APP_NAME='LBRY Explorer'
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
LOG_CHANNEL=stack
DB_CONNECTION=mysql
DB_HOST=chainquery.lbry.io
DB_PORT=3306
DB_DATABASE=chainquery
DB_USERNAME=user
DB_PASSWORD=secret
BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=

45
.gitattributes vendored
View file

@ -1,42 +1,5 @@
# Define the line ending behavior of the different file extensions
# Set default behaviour, in case users don't have core.autocrlf set.
* text=auto * text=auto
* text eol=lf *.css linguist-vendored
*.scss linguist-vendored
# Explicitly declare text files we want to always be normalized and converted *.js linguist-vendored
# to native line endings on checkout. CHANGELOG.md export-ignore
*.php text
*.default text
*.ctp text
*.sql text
*.md text
*.po text
*.js text
*.css text
*.ini text
*.properties text
*.txt text
*.xml text
*.svg text
*.yml text
.htaccess text
# Declare files that will always have CRLF line endings on checkout.
*.bat eol=crlf
# Declare files that will always have LF line endings on checkout.
*.pem eol=lf
# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
*.gif binary
*.ico binary
*.mo binary
*.pdf binary
*.phar binary
*.woff binary
*.woff2 binary
*.ttf binary
*.otf binary
*.eot binary

19
.gitignore vendored
View file

@ -1,8 +1,11 @@
/vendor/* /node_modules
/config/app.php /public/hot
/config/lbry.php /public/storage
/logs/* /storage/*.key
lbryexplorer.zip /vendor
lbryexplorer.komodoproject .env
.komodotools .phpunit.result.cache
/.gtm/ Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log

View file

@ -1,11 +0,0 @@
# Uncomment the following to prevent the httpoxy vulnerability
# See: https://httpoxy.org/
#<IfModule mod_headers.c>
# RequestHeader unset Proxy
#</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>

8
.idea/.gitignore vendored Normal file
View file

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Datasource local storage ignored files
/../../../../../../../../:\Users\Henry\Documents\Projets\LBRY\LBRYEXPLORER\.idea/dataSources/
/dataSources.local.xml
# Editor-based HTTP Client requests
/httpRequests/

122
.idea/LBRYEXPLORER.iml Normal file
View file

@ -0,0 +1,122 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/app" isTestSource="false" packagePrefix="App\" />
<sourceFolder url="file://$MODULE_DIR$/src/tests" isTestSource="true" packagePrefix="Tests\" />
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/barryvdh/laravel-debugbar" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/theseer/tokenizer" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/symfony/var-dumper" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/symfony/translation-contracts" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/symfony/translation" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/symfony/service-contracts" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/symfony/routing" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/symfony/polyfill-php80" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/symfony/polyfill-php73" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/symfony/polyfill-php72" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/symfony/polyfill-mbstring" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/symfony/polyfill-intl-normalizer" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/symfony/polyfill-intl-idn" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/symfony/polyfill-iconv" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/symfony/polyfill-ctype" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/symfony/mime" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/symfony/http-kernel" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/symfony/http-foundation" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/symfony/http-client-contracts" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/symfony/finder" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/symfony/event-dispatcher-contracts" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/symfony/event-dispatcher" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/symfony/error-handler" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/symfony/deprecation-contracts" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/symfony/debug" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/symfony/css-selector" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/symfony/console" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/phpdocumentor/type-resolver" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/phpunit/phpunit" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/phpdocumentor/reflection-docblock" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/phpdocumentor/reflection-common" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/phpunit/php-timer" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/phpunit/php-text-template" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/phpunit/php-file-iterator" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/dragonmantank/cron-expression" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/phpunit/php-code-coverage" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/tijsverkoyen/css-to-inline-styles" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/phpspec/prophecy" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/swiftmailer/swiftmailer" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/phar-io/version" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/nunomaduro/collision" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/phar-io/manifest" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/myclabs/deep-copy" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/beyondcode/laravel-dump-server" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/monolog/monolog" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/webmozart/assert" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/mockery/mockery" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/sebastian/version" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/laravel/tinker" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/sebastian/resource-operations" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/laravel/framework" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/sebastian/recursion-context" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/egulias/email-validator" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/sebastian/object-reflector" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/dnoegel/php-xdg-base-dir" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/sebastian/object-enumerator" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/vlucas/phpdotenv" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/sebastian/global-state" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/ramsey/uuid" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/sebastian/exporter" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/nesbot/carbon" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/sebastian/environment" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/league/mime-type-detection" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/sebastian/diff" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/league/flysystem" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/sebastian/comparator" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/krlove/eloquent-model-generator" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/sebastian/code-unit-reverse-lookup" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/krlove/code-generator" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/phpoption/phpoption" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/nikic/php-parser" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/fideloper/proxy" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/opis/closure" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/maximebf/debugbar" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/filp/whoops" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/hamcrest/hamcrest-php" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/psy/psysh" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/doctrine/lexer" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/psr/simple-cache" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/doctrine/instantiator" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/psr/log" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/psr/container" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/doctrine/event-manager" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/doctrine/dbal" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/doctrine/cache" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/composer" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/symfony/process" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/phpunit/php-invoker" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/league/commonmark" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/graham-campbell/result-type" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/facade/ignition-contracts" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/brick/math" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/voku/portable-ascii" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/symfony/string" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/symfony/polyfill-intl-grapheme" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/sebastian/code-unit" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/sebastian/cli-parser" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/sebastian/complexity" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/sebastian/type" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/sebastian/lines-of-code" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/ramsey/collection" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/psr/event-dispatcher" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/doctrine/inflector" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/ralouphie/getallheaders" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/psr/http-client" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/psr/http-message" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/guzzlehttp/guzzle" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/guzzlehttp/promises" />
<excludeFolder url="file://$MODULE_DIR$/src/vendor/guzzlehttp/psr7" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

8
.idea/modules.xml Normal file
View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/LBRYEXPLORER.iml" filepath="$PROJECT_DIR$/.idea/LBRYEXPLORER.iml" />
</modules>
</component>
</project>

124
.idea/php.xml Normal file
View file

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PhpIncludePathManager">
<include_path>
<path value="$PROJECT_DIR$/src/vendor/barryvdh/laravel-debugbar" />
<path value="$PROJECT_DIR$/src/vendor/theseer/tokenizer" />
<path value="$PROJECT_DIR$/src/vendor/symfony/var-dumper" />
<path value="$PROJECT_DIR$/src/vendor/symfony/translation-contracts" />
<path value="$PROJECT_DIR$/src/vendor/symfony/translation" />
<path value="$PROJECT_DIR$/src/vendor/symfony/service-contracts" />
<path value="$PROJECT_DIR$/src/vendor/symfony/routing" />
<path value="$PROJECT_DIR$/src/vendor/symfony/polyfill-php80" />
<path value="$PROJECT_DIR$/src/vendor/symfony/polyfill-php73" />
<path value="$PROJECT_DIR$/src/vendor/symfony/polyfill-php72" />
<path value="$PROJECT_DIR$/src/vendor/symfony/polyfill-mbstring" />
<path value="$PROJECT_DIR$/src/vendor/symfony/polyfill-intl-normalizer" />
<path value="$PROJECT_DIR$/src/vendor/symfony/polyfill-intl-idn" />
<path value="$PROJECT_DIR$/src/vendor/symfony/polyfill-iconv" />
<path value="$PROJECT_DIR$/src/vendor/symfony/polyfill-ctype" />
<path value="$PROJECT_DIR$/src/vendor/symfony/mime" />
<path value="$PROJECT_DIR$/src/vendor/symfony/http-kernel" />
<path value="$PROJECT_DIR$/src/vendor/symfony/http-foundation" />
<path value="$PROJECT_DIR$/src/vendor/symfony/http-client-contracts" />
<path value="$PROJECT_DIR$/src/vendor/symfony/finder" />
<path value="$PROJECT_DIR$/src/vendor/symfony/event-dispatcher-contracts" />
<path value="$PROJECT_DIR$/src/vendor/symfony/event-dispatcher" />
<path value="$PROJECT_DIR$/src/vendor/symfony/error-handler" />
<path value="$PROJECT_DIR$/src/vendor/symfony/deprecation-contracts" />
<path value="$PROJECT_DIR$/src/vendor/symfony/debug" />
<path value="$PROJECT_DIR$/src/vendor/symfony/css-selector" />
<path value="$PROJECT_DIR$/src/vendor/symfony/console" />
<path value="$PROJECT_DIR$/src/vendor/phpdocumentor/type-resolver" />
<path value="$PROJECT_DIR$/src/vendor/phpunit/phpunit" />
<path value="$PROJECT_DIR$/src/vendor/phpdocumentor/reflection-docblock" />
<path value="$PROJECT_DIR$/src/vendor/phpdocumentor/reflection-common" />
<path value="$PROJECT_DIR$/src/vendor/phpunit/php-timer" />
<path value="$PROJECT_DIR$/src/vendor/phpunit/php-text-template" />
<path value="$PROJECT_DIR$/src/vendor/phpunit/php-file-iterator" />
<path value="$PROJECT_DIR$/src/vendor/dragonmantank/cron-expression" />
<path value="$PROJECT_DIR$/src/vendor/phpunit/php-code-coverage" />
<path value="$PROJECT_DIR$/src/vendor/tijsverkoyen/css-to-inline-styles" />
<path value="$PROJECT_DIR$/src/vendor/phpspec/prophecy" />
<path value="$PROJECT_DIR$/src/vendor/swiftmailer/swiftmailer" />
<path value="$PROJECT_DIR$/src/vendor/phar-io/version" />
<path value="$PROJECT_DIR$/src/vendor/nunomaduro/collision" />
<path value="$PROJECT_DIR$/src/vendor/phar-io/manifest" />
<path value="$PROJECT_DIR$/src/vendor/myclabs/deep-copy" />
<path value="$PROJECT_DIR$/src/vendor/beyondcode/laravel-dump-server" />
<path value="$PROJECT_DIR$/src/vendor/monolog/monolog" />
<path value="$PROJECT_DIR$/src/vendor/webmozart/assert" />
<path value="$PROJECT_DIR$/src/vendor/mockery/mockery" />
<path value="$PROJECT_DIR$/src/vendor/sebastian/version" />
<path value="$PROJECT_DIR$/src/vendor/laravel/tinker" />
<path value="$PROJECT_DIR$/src/vendor/sebastian/resource-operations" />
<path value="$PROJECT_DIR$/src/vendor/laravel/framework" />
<path value="$PROJECT_DIR$/src/vendor/sebastian/recursion-context" />
<path value="$PROJECT_DIR$/src/vendor/egulias/email-validator" />
<path value="$PROJECT_DIR$/src/vendor/sebastian/object-reflector" />
<path value="$PROJECT_DIR$/src/vendor/dnoegel/php-xdg-base-dir" />
<path value="$PROJECT_DIR$/src/vendor/sebastian/object-enumerator" />
<path value="$PROJECT_DIR$/src/vendor/vlucas/phpdotenv" />
<path value="$PROJECT_DIR$/src/vendor/sebastian/global-state" />
<path value="$PROJECT_DIR$/src/vendor/ramsey/uuid" />
<path value="$PROJECT_DIR$/src/vendor/sebastian/exporter" />
<path value="$PROJECT_DIR$/src/vendor/nesbot/carbon" />
<path value="$PROJECT_DIR$/src/vendor/sebastian/environment" />
<path value="$PROJECT_DIR$/src/vendor/league/mime-type-detection" />
<path value="$PROJECT_DIR$/src/vendor/sebastian/diff" />
<path value="$PROJECT_DIR$/src/vendor/league/flysystem" />
<path value="$PROJECT_DIR$/src/vendor/sebastian/comparator" />
<path value="$PROJECT_DIR$/src/vendor/krlove/eloquent-model-generator" />
<path value="$PROJECT_DIR$/src/vendor/sebastian/code-unit-reverse-lookup" />
<path value="$PROJECT_DIR$/src/vendor/krlove/code-generator" />
<path value="$PROJECT_DIR$/src/vendor/phpoption/phpoption" />
<path value="$PROJECT_DIR$/src/vendor/nikic/php-parser" />
<path value="$PROJECT_DIR$/src/vendor/fideloper/proxy" />
<path value="$PROJECT_DIR$/src/vendor/opis/closure" />
<path value="$PROJECT_DIR$/src/vendor/maximebf/debugbar" />
<path value="$PROJECT_DIR$/src/vendor/filp/whoops" />
<path value="$PROJECT_DIR$/src/vendor/hamcrest/hamcrest-php" />
<path value="$PROJECT_DIR$/src/vendor/psy/psysh" />
<path value="$PROJECT_DIR$/src/vendor/doctrine/lexer" />
<path value="$PROJECT_DIR$/src/vendor/psr/simple-cache" />
<path value="$PROJECT_DIR$/src/vendor/doctrine/instantiator" />
<path value="$PROJECT_DIR$/src/vendor/psr/log" />
<path value="$PROJECT_DIR$/src/vendor/psr/container" />
<path value="$PROJECT_DIR$/src/vendor/doctrine/event-manager" />
<path value="$PROJECT_DIR$/src/vendor/doctrine/dbal" />
<path value="$PROJECT_DIR$/src/vendor/doctrine/cache" />
<path value="$PROJECT_DIR$/src/vendor/composer" />
<path value="$PROJECT_DIR$/src/vendor/symfony/process" />
<path value="$PROJECT_DIR$/src/vendor/phpunit/php-invoker" />
<path value="$PROJECT_DIR$/src/vendor/league/commonmark" />
<path value="$PROJECT_DIR$/src/vendor/graham-campbell/result-type" />
<path value="$PROJECT_DIR$/src/vendor/facade/ignition-contracts" />
<path value="$PROJECT_DIR$/src/vendor/brick/math" />
<path value="$PROJECT_DIR$/src/vendor/voku/portable-ascii" />
<path value="$PROJECT_DIR$/src/vendor/symfony/string" />
<path value="$PROJECT_DIR$/src/vendor/symfony/polyfill-intl-grapheme" />
<path value="$PROJECT_DIR$/src/vendor/sebastian/code-unit" />
<path value="$PROJECT_DIR$/src/vendor/sebastian/cli-parser" />
<path value="$PROJECT_DIR$/src/vendor/sebastian/complexity" />
<path value="$PROJECT_DIR$/src/vendor/sebastian/type" />
<path value="$PROJECT_DIR$/src/vendor/sebastian/lines-of-code" />
<path value="$PROJECT_DIR$/src/vendor/ramsey/collection" />
<path value="$PROJECT_DIR$/src/vendor/psr/event-dispatcher" />
<path value="$PROJECT_DIR$/src/vendor/doctrine/inflector" />
<path value="$PROJECT_DIR$/src/vendor/ralouphie/getallheaders" />
<path value="$PROJECT_DIR$/src/vendor/psr/http-client" />
<path value="$PROJECT_DIR$/src/vendor/psr/http-message" />
<path value="$PROJECT_DIR$/src/vendor/guzzlehttp/guzzle" />
<path value="$PROJECT_DIR$/src/vendor/guzzlehttp/promises" />
<path value="$PROJECT_DIR$/src/vendor/guzzlehttp/psr7" />
</include_path>
</component>
<component name="PhpProjectSharedConfiguration" php_language_level="8.0">
<option name="suggestChangeDefaultLanguageLevel" value="false" />
</component>
<component name="PhpUnit">
<phpunit_settings>
<PhpUnitSettings custom_loader_path="$PROJECT_DIR$/src/vendor/autoload.php" />
</phpunit_settings>
</component>
</project>

6
.idea/vcs.xml Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

13
.styleci.yml Normal file
View file

@ -0,0 +1,13 @@
php:
preset: laravel
disabled:
- unused_use
finder:
not-name:
- index.php
- server.php
js:
finder:
not-name:
- webpack.mix.js
css: true

View file

@ -1,29 +0,0 @@
language: php
dist: trusty
sudo: false
php:
- 7.0
- 7.1
matrix:
fast_finish: true
include:
- php: 7.0
env: PHPCS=1
before_script:
- if [[ $PHPCS = 1 ]]; then composer require cakephp/cakephp-codesniffer:~2.1; fi
- if [[ $PHPCS != 1 ]]; then composer install; fi
- if [[ $PHPCS != 1 ]]; then composer require phpunit/phpunit:"^5.7|^6.0"; fi
- if [[ $PHPCS != 1 ]]; then composer run-script post-install-cmd --no-interaction; fi
script:
- if [[ $PHPCS != 1 ]]; then vendor/bin/phpunit; fi
- if [[ $PHPCS = 1 ]]; then vendor/bin/phpcs -p --extensions=php --standard=vendor/cakephp/cakephp-codesniffer/CakePHP ./src ./tests ./config ./webroot; fi
notifications:
email: false

18
.workflows/dockerhub.yml Normal file
View file

@ -0,0 +1,18 @@
name: Publish Docker image
on:
release:
types: [published]
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Push to Docker Hub
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: my-docker-hub-namespace/my-docker-hub-repository
tag_with_ref: true

0
Bootstrapping Normal file
View file

0
Building Normal file
View file

21
Dockerfile Normal file
View file

@ -0,0 +1,21 @@
FROM php:7.4-fpm
ENV PORT 80
COPY composer.lock composer.json /var/www/
WORKDIR /var/www
RUN apt-get update && apt-get install -y curl libxml2-dev libpng-dev libonig-dev zip unzip && rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
COPY . /var/www
RUN chown -R www-data:www-data /var/www
RUN php ./artisan optimize
EXPOSE 9000
CMD ["php-fpm"]

0
Installing Normal file
View file

675
LICENSE
View file

@ -1,9 +1,674 @@
The MIT License (MIT) GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (c) 2017-2018 LBRY Inc. Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
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: Preamble
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. The GNU General Public License is a free, copyleft license for
software and other kinds of works.
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. The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

0
PHP Normal file
View file

1
Procfile Normal file
View file

@ -0,0 +1 @@
web: vendor/bin/heroku-php-apache2 public/

102
README.md
View file

@ -1,90 +1,30 @@
# LBRY Block Explorer # LBRYexplorer
A [LBRY](https://lbry.com) block explorer based on Laravel.
A simple PHP block explorer for browsing transactions and claims on the [LBRY](https://lbry.com) blockchain. The explorer was developed using CakePHP which is a model-view-controller (MVC) PHP framework. #### Dependencies:
* [PHP 7.4.11]
* [Laravel v8.16.1](https://laravel.com/docs/8.x)
## Installation ### Install
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
* 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 * `git clone https://github.com/marcdeb1/LBRYEXPLORER.git`
* Clone the Github repository. `git clone https://github.com/lbryio/block-explorer` * Install dependencies with `composer update`
* Create a MariaDB database using the DDL found in `block-explorer/sql/lbryexplorer.ddl.sql` * Create .env file from .env.example and edit variables according to your environment
* 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 `<path to>/block-explorer/webroot` where `<path to>` 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; ### Run
index index.php;
location / { #### Run with artisan
try_files $uri $uri/ /index.php?$args; * Launch server with `php artisan serve`
} * Open your browser at http://localhost:8000
# pass the PHP scripts to FastCGI server listening on the php-fpm socket #### Run with Docker
location ~ \.php$ { * `docker build -t lbry-explorer .`
try_files $uri =404; * `docker-compose up`
include /etc/nginx/fastcgi_params; * Open your browser at http://localhost
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.
#### Database:
The LBRY Explorer is using [LBRY Chainquery v1.8.1](https://github.com/lbryio/chainquery/releases/tag/v1.8.1) as a remote database.
### Cron jobs Current model schema reflects chainquery [schema](https://github.com/lbryio/chainquery/blob/master/db/chainquery_schema.sql)
There are a few scripts which can be set up as cron jobs or scheduled tasks.
#### blocks.sh ![Model Schema](https://spee.ch/@SK3LA:3/chainqueryschema2.svg)
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.tech/contribute
## 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.com)

50
app/AbnormalClaim.php Normal file
View file

@ -0,0 +1,50 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
/**
* @property integer $id
* @property integer $output_id
* @property string $name
* @property string $claim_id
* @property boolean $is_update
* @property string $block_hash
* @property string $transaction_hash
* @property int $vout
* @property string $value_as_hex
* @property string $value_as_json
* @property string $created_at
* @property string $modified_at
* @property Output $output
*/
class AbnormalClaim extends Model
{
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'abnormal_claim';
/**
* The "type" of the auto-incrementing ID.
*
* @var string
*/
protected $keyType = 'integer';
/**
* @var array
*/
protected $fillable = ['output_id', 'name', 'claim_id', 'is_update', 'block_hash', 'transaction_hash', 'vout', 'value_as_hex', 'value_as_json', 'created_at', 'modified_at'];
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function output()
{
return $this->belongsTo('App\Output');
}
}

44
app/Address.php Normal file
View file

@ -0,0 +1,44 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
/**
* @property integer $id
* @property string $address
* @property string $first_seen
* @property string $created_at
* @property string $modified_at
* @property float $balance
* @property TransactionAddress[] $transactionAddresses
*/
class Address extends Model
{
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'address';
/**
* The "type" of the auto-incrementing ID.
*
* @var string
*/
protected $keyType = 'integer';
/**
* @var array
*/
protected $fillable = ['address', 'first_seen', 'created_at', 'modified_at', 'balance'];
/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function transactionAddresses()
{
return $this->hasMany('App\TransactionAddress');
}
}

59
app/Block.php Normal file
View file

@ -0,0 +1,59 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
/**
* @property integer $id
* @property string $bits
* @property string $chainwork
* @property int $confirmations
* @property float $difficulty
* @property string $hash
* @property integer $height
* @property string $merkle_root
* @property string $name_claim_root
* @property integer $nonce
* @property string $previous_block_hash
* @property string $next_block_hash
* @property integer $block_size
* @property integer $block_time
* @property integer $version
* @property string $version_hex
* @property string $transaction_hashes
* @property boolean $transactions_processed
* @property string $created_at
* @property string $modified_at
* @property Transaction[] $transactions
*/
class Block extends Model
{
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'block';
/**
* The "type" of the auto-incrementing ID.
*
* @var string
*/
protected $keyType = 'integer';
/**
* @var array
*/
protected $fillable = ['bits', 'chainwork', 'confirmations', 'difficulty', 'hash', 'height', 'merkle_root', 'name_claim_root', 'nonce', 'previous_block_hash', 'next_block_hash', 'block_size', 'block_time', 'version', 'version_hex', 'transaction_hashes', 'transactions_processed', 'created_at', 'modified_at'];
/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function transactions()
{
return $this->hasMany('App\Transaction', 'block_hash_id', 'hash');
}
}

144
app/Claim.php Normal file
View file

@ -0,0 +1,144 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
/**
* @property integer $id
* @property string $transaction_hash_id
* @property int $vout
* @property string $name
* @property string $claim_id
* @property boolean $claim_type
* @property string $publisher_id
* @property string $publisher_sig
* @property string $certificate
* @property string $sd_hash
* @property integer $transaction_time
* @property string $version
* @property string $value_as_hex
* @property string $value_as_json
* @property int $valid_at_height
* @property int $height
* @property integer $effective_amount
* @property string $author
* @property string $description
* @property string $content_type
* @property boolean $is_nsfw
* @property string $language
* @property string $thumbnail_url
* @property string $title
* @property float $fee
* @property string $fee_currency
* @property string $fee_address
* @property boolean $is_filtered
* @property string $bid_state
* @property string $created_at
* @property string $modified_at
* @property string $claim_address
* @property boolean $is_cert_valid
* @property boolean $is_cert_processed
* @property string $license
* @property string $license_url
* @property string $preview
* @property string $type
* @property integer $release_time
* @property string $source_hash
* @property string $source_name
* @property integer $source_size
* @property string $source_media_type
* @property string $source_url
* @property integer $frame_width
* @property integer $frame_height
* @property integer $duration
* @property integer $audio_duration
* @property string $os
* @property string $email
* @property string $website_url
* @property boolean $has_claim_list
* @property string $claim_reference
* @property integer $list_type
* @property mixed $claim_id_list
* @property string $country
* @property string $state
* @property string $city
* @property string $code
* @property integer $latitude
* @property integer $longitude
* @property Transaction $transaction
* @property ClaimInList[] $claimInLists
* @property ClaimTag[] $claimTags
*/
class Claim extends Model
{
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'claim';
/**
* The "type" of the auto-incrementing ID.
*
* @var string
*/
protected $keyType = 'integer';
/**
* @var array
*/
protected $fillable = ['transaction_hash_id', 'vout', 'name', 'claim_id', 'claim_type', 'publisher_id', 'publisher_sig', 'certificate', 'sd_hash', 'transaction_time', 'version', 'value_as_hex', 'value_as_json', 'valid_at_height', 'height', 'effective_amount', 'author', 'description', 'content_type', 'is_nsfw', 'language', 'thumbnail_url', 'title', 'fee', 'fee_currency', 'fee_address', 'is_filtered', 'bid_state', 'created_at', 'modified_at', 'claim_address', 'is_cert_valid', 'is_cert_processed', 'license', 'license_url', 'preview', 'type', 'release_time', 'source_hash', 'source_name', 'source_size', 'source_media_type', 'source_url', 'frame_width', 'frame_height', 'duration', 'audio_duration', 'os', 'email', 'website_url', 'has_claim_list', 'claim_reference', 'list_type', 'claim_id_list', 'country', 'state', 'city', 'code', 'latitude', 'longitude'];
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function transaction()
{
return $this->belongsTo('App\Transaction', 'transaction_hash_id', 'hash');
}
/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function claimInLists()
{
return $this->hasMany('App\ClaimInList', 'list_claim_id', 'claim_id');
}
/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function claimTags()
{
return $this->hasMany('App\ClaimTag', null, 'claim_id');
}
/**
* Get claim content tag from content type
* @return string
*/
public function getContentTag() {
$contentTag = null;
if ($this->type == "channel") {
return 'channel';
} elseif ($this->type == "claimreference") {
return 'support';
} elseif ($this->type == "claimlist") {
return 'list';
} else {
if (substr($this->content_type, 0, 5) === 'audio') {
return 'audio';
} else if (substr($this->content_type, 0, 5) === 'video') {
return 'video';
} else if (substr($this->content_type, 0, 5) === 'image') {
return 'image';
} else if ($this->content_type === 'application/pdf') {
return 'pdf';
} else {
return 'document';
}
}
}
}

43
app/ClaimInList.php Normal file
View file

@ -0,0 +1,43 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
/**
* @property integer $id
* @property string $list_claim_id
* @property string $claim_id
* @property string $created_at
* @property string $modified_at
* @property Claim $claim
*/
class ClaimInList extends Model
{
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'claim_in_list';
/**
* The "type" of the auto-incrementing ID.
*
* @var string
*/
protected $keyType = 'integer';
/**
* @var array
*/
protected $fillable = ['list_claim_id', 'claim_id', 'created_at', 'modified_at'];
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function claim()
{
return $this->belongsTo('App\Claim', 'list_claim_id', 'claim_id');
}
}

52
app/ClaimTag.php Normal file
View file

@ -0,0 +1,52 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
/**
* @property integer $id
* @property integer $tag_id
* @property string $claim_id
* @property string $created_at
* @property string $modified_at
* @property Claim $claim
* @property Tag $tag
*/
class ClaimTag extends Model
{
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'claim_tag';
/**
* The "type" of the auto-incrementing ID.
*
* @var string
*/
protected $keyType = 'integer';
/**
* @var array
*/
protected $fillable = ['tag_id', 'claim_id', 'created_at', 'modified_at'];
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function claim()
{
return $this->belongsTo('App\Claim', null, 'claim_id');
}
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function tag()
{
return $this->belongsTo('App\Tag');
}
}

42
app/Console/Kernel.php Normal file
View file

@ -0,0 +1,42 @@
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
//
];
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
// $schedule->command('inspire')
// ->hourly();
}
/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
}

View file

@ -0,0 +1,51 @@
<?php
namespace App\Exceptions;
use Exception;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
class Handler extends ExceptionHandler
{
/**
* A list of the exception types that are not reported.
*
* @var array
*/
protected $dontReport = [
//
];
/**
* A list of the inputs that are never flashed for validation exceptions.
*
* @var array
*/
protected $dontFlash = [
'password',
'password_confirmation',
];
/**
* Report or log an exception.
*
* @param \Throwable $exception
* @return void
*/
public function report(\Throwable $exception)
{
parent::report($exception);
}
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Throwable $exception
* @return \Illuminate\Http\Response
*/
public function render($request, \Throwable $exception)
{
return parent::render($request, $exception);
}
}

View file

@ -0,0 +1,76 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Carbon\Carbon;
use App\Block;
use Illuminate\Support\Facades\Cache;
class APIController extends Controller
{
public function difficulty($last_n_hours) {
$time = Carbon::now()->sub('hour', $last_n_hours)->timestamp;
$diff = Block::where('block_time', '>', $time)
->orderBy('block_time', 'asc')
->select('height', 'block_time', 'difficulty')
->get();
return response()->json($diff);
}
public function blockSize($last_n_hours) {
$time = Carbon::now()->sub('hour', $last_n_hours)->timestamp;
$diff = Block::where('block_time', '>', $time)
->orderBy('block_time', 'asc')
->select('height', 'block_time', 'block_size')
->get();
return response()->json($diff);
}
public function blocksStats($time_range) {
if (Cache::has('blocksStats'.$time_range)) {
return response()->json([
'success' => true,
'data' => Cache::get('blocksStats'.$time_range),
]);
} else {
$time = Carbon::now()->sub('hour', $time_range)->timestamp;
$blocks = Block::where('block_time', '>', $time)
->orderBy('block_time', 'asc')
->select('height', 'block_time', 'block_size', 'difficulty')
->get();
Cache::put('blocksStats'.$time_range, $blocks, $seconds = 600);
return response()->json([
'success' => true,
'data' => $blocks,
]);
}
}
public function miningStats() {
if (Cache::has('miningStats')) {
return response()->json([
'success' => true,
'data' => Cache::get('miningStats'),
]);
} else {
$blocks = Block::select('height', 'block_time')
->where('confirmations', '>', '0')
->whereRaw('(id-1) MOD 1000 = 0')
->orderBy('height', 'asc')
->get();
Cache::put('miningStats', $blocks, $seconds = 3600);
return response()->json([
'success' => true,
'data' => $blocks,
]);
}
}
}

View file

@ -0,0 +1,78 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Carbon\Carbon;
use App\Address;
use App\TransactionAddress;
class AddressController extends Controller
{
public function getAddresses() {
$genesisBlockAddress = 'bHW58d37s1hBjj3wPBkn5zpCX3F8ZW3uWf';
$addresses = Address::where('address', '<>', $genesisBlockAddress)
->orderBy('balance', 'desc')
->simplePaginate(100);
$addresses->transform(function ($item, $key) {
// Addresses owned by LBRY
$lbryAddresses = array('rEqocTgdPdoD8NEbrECTUPfpquJ4zPVCJ8', 'rKaAUDxr24hHNNTQuNtRvNt8SGYJMdLXo3', 'r7hj61jdbGXcsccxw8UmEFCReZoCWLRr7t', 'bRo4FEeqqxY7nWFANsZsuKEWByEgkvz8Qt', 'bU2XUzckfpdEuQNemKvhPT1gexQ3GG3SC2', 'bay3VA6YTQBL4WLobbG7CthmoGeUKXuXkD', 'bLPbiXBp6Vr3NSnsHzDsLNzoy5o36re9Cz', 'bVUrbCK8hcZ5XWti7b9eNxKEBxzc1rr393', 'bZja2VyhAC84a9hMwT8dwTU6rDRXowrjxH', 'bMgqQqYfwzWWYBk5o5dBMXtCndVAoeqy6h', 'bMvUBo1h5WS46ThHtmfmXftz3z33VHL7wc', 'bX6napXtY2nVTBRc8PwULBuGWn2i3SCtrN');
// Max LBC token supply
$maxSupply = 1083202000;
$item->first_seen = Carbon::parse($item->first_seen)->format('d M Y H:i:s');
$item->isLbryAddress = in_array($item->address, $lbryAddresses);
$item->percentageSupply = bcdiv($item->balance, $maxSupply, 8) * 100;
return $item;
});
return view('addresses', [
'addresses' => $addresses
]);
}
public function getAddress($address) {
$address = Address::where('address', $address)->firstOrFail();
$txs = TransactionAddress::where('address_id', $address->id)
->leftJoin('transaction', 'transaction_address.transaction_id', 'transaction.id')
->leftJoin('block', 'transaction.block_hash_id', 'block.hash')
->select('transaction_address.credit_amount', 'transaction_address.debit_amount', 'transaction.transaction_time', 'transaction.transaction_size', 'transaction.hash', 'transaction.input_count', 'transaction.output_count', 'block.height')
->orderBy('height', 'desc')
->simplePaginate(25);
$transaction_amounts = TransactionAddress::where('address_id', $address->id)
->leftJoin('transaction', 'transaction_address.transaction_id', 'transaction.id')
->select('transaction_address.credit_amount', 'transaction_address.debit_amount')
->get();
$address->total_received = 0;
$address->total_sent = 0;
foreach($transaction_amounts as $amount) {
$transaction_amount = $amount->credit_amount - $amount->debit_amount;
if($transaction_amount > 0) {
$address->total_received += $transaction_amount;
} else {
$address->total_sent += abs($transaction_amount);
}
}
$txs->transform(function ($item, $key) use (& $address) {
$item->transaction_time = Carbon::createFromTimestamp($item->transaction_time)->format('d M Y H:i:s');
$item->transaction_size /= 1000;
$item->transaction_amount = $item->credit_amount - $item->debit_amount;
return $item;
});
return view('address', [
'address' => $address,
'transactions' => $txs
]);
}
}

View file

@ -0,0 +1,32 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
class ForgotPasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
| Password Reset Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password reset emails and
| includes a trait which assists in sending these notifications from
| your application to your users. Feel free to explore this trait.
|
*/
use SendsPasswordResetEmails;
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest');
}
}

View file

@ -0,0 +1,39 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
class LoginController extends Controller
{
/*
|--------------------------------------------------------------------------
| Login Controller
|--------------------------------------------------------------------------
|
| This controller handles authenticating users for the application and
| redirecting them to your home screen. The controller uses a trait
| to conveniently provide its functionality to your applications.
|
*/
use AuthenticatesUsers;
/**
* Where to redirect users after login.
*
* @var string
*/
protected $redirectTo = '/home';
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest')->except('logout');
}
}

View file

@ -0,0 +1,72 @@
<?php
namespace App\Http\Controllers\Auth;
use App\User;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
use Illuminate\Foundation\Auth\RegistersUsers;
class RegisterController extends Controller
{
/*
|--------------------------------------------------------------------------
| Register Controller
|--------------------------------------------------------------------------
|
| This controller handles the registration of new users as well as their
| validation and creation. By default this controller uses a trait to
| provide this functionality without requiring any additional code.
|
*/
use RegistersUsers;
/**
* Where to redirect users after registration.
*
* @var string
*/
protected $redirectTo = '/home';
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest');
}
/**
* Get a validator for an incoming registration request.
*
* @param array $data
* @return \Illuminate\Contracts\Validation\Validator
*/
protected function validator(array $data)
{
return Validator::make($data, [
'name' => ['required', 'string', 'max:255'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
'password' => ['required', 'string', 'min:8', 'confirmed'],
]);
}
/**
* Create a new user instance after a valid registration.
*
* @param array $data
* @return \App\User
*/
protected function create(array $data)
{
return User::create([
'name' => $data['name'],
'email' => $data['email'],
'password' => Hash::make($data['password']),
]);
}
}

View file

@ -0,0 +1,39 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ResetsPasswords;
class ResetPasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
| Password Reset Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password reset requests
| and uses a simple trait to include this behavior. You're free to
| explore this trait and override any methods you wish to tweak.
|
*/
use ResetsPasswords;
/**
* Where to redirect users after resetting their password.
*
* @var string
*/
protected $redirectTo = '/home';
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest');
}
}

View file

@ -0,0 +1,41 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\VerifiesEmails;
class VerificationController extends Controller
{
/*
|--------------------------------------------------------------------------
| Email Verification Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling email verification for any
| user that recently registered with the application. Emails may also
| be re-sent if the user didn't receive the original email message.
|
*/
use VerifiesEmails;
/**
* Where to redirect users after verification.
*
* @var string
*/
protected $redirectTo = '/home';
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
$this->middleware('signed')->only('verify');
$this->middleware('throttle:6,1')->only('verify', 'resend');
}
}

View file

@ -0,0 +1,66 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Carbon\Carbon;
use App\Block;
use App\Transaction;
class BlockController extends Controller
{
public function getBlocks() {
$blocks = Block::select('height', 'block_time', 'transaction_hashes', 'block_size', 'difficulty', 'nonce')->orderBy('id', 'desc')->simplePaginate(25);
$previous_block_difficulty = 0; // used to calculate difficulty variation from the previous and current block
//reversing done because need to access block in chronological order in order to calculate difficulty diff
$blocks->reverse()->transform(function ($item, $key) use (& $previous_block_difficulty) {
$item->block_time = Carbon::parse($item->block_time)->diffForHumans(null, false, false, 2);
$item->block_size /= 1000;
$item->transactions = count(explode(',', $item->transaction_hashes));
if($previous_block_difficulty != 0) { //if here : this is not the oldest block in the page
//calculating difficulty diff percentage between previous and current block
$item->difficulty_diff_percent = number_format((($item->difficulty - $previous_block_difficulty) / $previous_block_difficulty * 100), 1);
}
$previous_block_difficulty = $item->difficulty;
return $item;
});
return view('blocks', [
'blocks' => $blocks
]);
}
public function getBlock($height = null) {
if($height) {
$block = Block::where('height', $height)->firstOrFail();
$transactions = $block->transactions()->get(['hash', 'value', 'input_count', 'output_count', 'fee', 'transaction_size']);
$block->small_hash = substr($block->hash, 0, 10).'...'.substr($block->hash, -10);
$block->block_size /= 1000;
$block->block_time = Carbon::createFromTimestamp($block->block_time)->format('d M Y H:i:s');
$block->block_timestamp = Carbon::parse($block->block_time)->diffForHumans(null, false, false, 2);
$block->confirmations = Block::latest()->take(1)->value('height') - $block->height;
$transactions->transform(function ($item, $key) {
$item->transaction_size /= 1000;
return $item;
});
return view('block', [
'block' => $block,
'transactions' => $transactions
]);
} else {
return redirect('/blocks');
}
}
}

View file

@ -0,0 +1,61 @@
<?php
namespace App\Http\Controllers;
use App\Claim;
use Carbon\Carbon;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
class ClaimController extends Controller
{
public function getClaims() {
$claims = Claim::orderBy('id', 'desc')
->simplePaginate(25);
return view('claims', [
'claims' => $claims
]);
}
public function getClaim($claim = null) {
if($claim) {
$claim = DB::table('claim as C')
->select('C.*', 'P.name as publisher_name')
->where('C.claim_id', $claim)
->leftJoin('claim AS P', 'P.claim_id', '=', 'C.publisher_id')
->first();
$claim->first_seen_time_ago = Carbon::parse($claim->created_at)->diffForHumans(null, false, false, 2);
$claim->claim_time = Carbon::createFromTimestamp($claim->transaction_time)->format('d M Y H:i:s');
$claim->claim_timestamp = Carbon::parse($claim->transaction_time)->diffForHumans(null, false, false, 2);
$claim->source_size = $this->formatBytes($claim->source_size);
return view('claim', [
'claim' => $claim
]);
} else {
return redirect(route('claims'));
}
}
/**
* Format bytes to kb, mb, gb, tb
*
* @param integer $size
* @param integer $precision
* @return integer
*/
public function formatBytes($size, $precision = 2)
{
if ($size > 0) {
$size = (int) $size;
$base = log($size) / log(1024);
$suffixes = array(' bytes', ' KB', ' MB', ' GB', ' TB');
return round(pow(1024, $base - floor($base)), $precision) . $suffixes[floor($base)];
} else {
return $size;
}
}
}

View file

@ -0,0 +1,13 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
}

View file

@ -0,0 +1,76 @@
<?php
namespace App\Http\Controllers;
use App\Claim;
use Illuminate\Http\Request;
use Carbon\Carbon;
use App\Block;
use App\Transaction;
class HomeController extends Controller
{
/**
* Handle the incoming request.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function __invoke(Request $request)
{
$blocks = Block::orderBy('id', 'desc')->take(15)->get(['height', 'block_time', 'transaction_hashes', 'block_size', 'difficulty']);
$transactions = Transaction::select('id', 'hash', 'transaction_time', 'value')
->where('block_hash_id', '<>' , 'MEMPOOL')
->orderBy('id', 'desc')
->take(15)
->with(['inputs', 'outputs'])
->get();
$total_claims = Claim::where('bid_state', '<>', 'Expired')
->where("created_at", ">", Carbon::now()->subDay())
->count();
$claims = Claim::where('bid_state', '<>', 'Expired')
->orderBy('id', 'desc')
->take(6)
->get();
$now = Carbon::now();
$blocks->transform(function ($item, $key) use ($now) {
$item->age = Carbon::createFromTimestamp($item->block_time)->diffForHumans();
$item->block_size /= 1000;
$item->transactions = count(explode(',', $item->transaction_hashes));
return $item;
});
$transactions->transform(function ($item, $key) use ($now) {
$item->age = Carbon::createFromTimestamp($item->transaction_time)->diffForHumans();
//lets calculate fees!
$item->fee = 0;
if($item->inputs[0]->is_coinbase) {
return $item;
}
foreach($item->inputs as $input) {
$item->fee += $input->value;
}
foreach($item->outputs as $output) {
$item->fee -= $output->value;
}
$item->fee = sprintf("%.f", $item->fee);
return $item;
});
return view('home', [
'blocks' => $blocks,
'transactions' => $transactions,
'claims' => $claims,
'total_claims' => $total_claims
]);
}
}

View file

@ -0,0 +1,42 @@
<?php
namespace App\Http\Controllers;
use App\Claim;
use Illuminate\Http\Request;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use App\Block;
use App\Transaction;
class SearchController extends Controller
{
public function __invoke(Request $request)
{
$input = trim($request->get('q'));
if(preg_match("/^[a-zA-Z0-9]{34}$/",$input)) {
return redirect(route('address', $input));
}
if(preg_match("/^[a-zA-Z0-9]{64}$/",$input)) {
return redirect(route('transaction', $input));
}
if(preg_match("/^[a-zA-Z0-9]{40}$/",$input)) {
return redirect(route('claim', $input));
}
if(preg_match("/^[0-9]{0,10}$/",$input)) {
return redirect(route('block', $input));
}
if(preg_match("/^[0-9A-Za-z \-]{0,100}$/",$input)) {
$claims = Claim::where('name', '=', $input)
->orderBy('effective_amount', 'desc')
->simplePaginate(25);
return view('search_claims', [
'claims' => $claims,
'query' => $input
]);
}
}
}

View file

@ -0,0 +1,31 @@
<?php
namespace App\Http\Controllers;
use App\Claim;
class StatisticsController extends Controller
{
public function getMiningStats() {
return view('statistics_mining', [
]);
}
public function getContentStats() {
$top_claims = Claim::select('name', 'effective_amount', 'claim_id')
->where('claim_type', '=', '1')
->take(10)
->get();
$top_channels = Claim::select('name', 'effective_amount', 'claim_id')
->where('claim_type', '=', '2')
->take(10)
->get();
return view('statistics_content', [
'top_claims' => $top_claims,
'top_channels' => $top_channels
]);
}
}

View file

@ -0,0 +1,149 @@
<?php
namespace App\Http\Controllers;
use App\Claim;
use Illuminate\Http\Request;
use Carbon\Carbon;
use App\Transaction;
use App\Input;
use App\Output;
use App\Block;
use App\Address;
class TransactionController extends Controller
{
public function getTransactions() {
$transactions = Transaction::select('id', 'hash', 'transaction_time', 'value', 'input_count', 'output_count', 'transaction_size', 'block_hash_id')
->where('block_hash_id', '<>', 'MEMPOOL')
->orderBy('transaction_time', 'desc')
->with(['inputs', 'outputs'])
->simplePaginate(25);
$transactions->transform(function ($item, $key) {
$item->block_height = Block::where('hash', $item->block_hash_id)->value('height');
$item->transaction_time = Carbon::parse($item->transaction_time)->diffForHumans(null, false, false, 2);
$item->transaction_size /= 1000;
//lets calculate fees!
$item->fee = 0;
if($item->inputs[0]->is_coinbase) {
return $item;
}
foreach($item->inputs as $input) {
$item->fee += $input->value;
}
foreach($item->outputs as $output) {
$item->fee -= $output->value;
}
$item->fee = sprintf("%.f", $item->fee);
return $item;
});
return view('transactions', [
'transactions' => $transactions
]);
}
public function getTransaction($tx = null) {
if($tx) {
$tx = Transaction::where('hash', $tx)->firstOrFail();
$tx->small_hash = substr($tx->hash, 0, 10).'...'.substr($tx->hash, -10);
$inputs = $tx->inputs()
->leftJoin('address', 'input.input_address_id', 'address.id')
->select('input.prevout_hash', 'input.is_coinbase', 'input.value', 'input.script_sig_hex', 'address.address')
->orderBy('vin')
->get();
$outputs = $tx->outputs()
->leftJoin('input', 'output.spent_by_input_id', 'input.id')
->select('output.value', 'output.vout', 'output.type', 'output.script_pub_key_asm', 'output.script_pub_key_hex', 'output.address_list', 'output.is_spent','input.transaction_hash as spent_hash')
->orderBy('vout')
->get();
$tx->first_seen_time_ago = Carbon::parse($tx->created_at)->diffForHumans(null, false, false, 2);
$tx->transaction_size /= 1000;
if($tx->block_hash_id != 'MEMPOOL') {
$tx->transaction_time = Carbon::parse($tx->created_time)->format('d M Y H:i:s');
$tx->block_height = Block::where('hash', $tx->block_hash_id)->value('height');
$tx->confirmations = Block::latest()->take(1)->value('height') - $tx->block_height;
$tx->confirmation_difference = Carbon::parse($tx->created_at)->diffForHumans(Carbon::parse($tx->transaction_time), true, true, 2);
// calculate transaction fee by inputs and outputs
$tx->fee = 0;
if(!$tx->inputs[0]->is_coinbase) {
foreach($inputs as $input) {
$tx->fee += $input->value;
}
foreach($outputs as $output) {
$tx->fee -= $output->value;
}
$tx->fee = sprintf("%.f", $tx->fee);
}
}
foreach ($outputs as $output) {
//output.address_list is an array of address, lets parse
$output->address_list = ltrim($output->address_list, "[");
$output->address_list = rtrim($output->address_list, "]");
$output->address_list = str_replace('"', '', $output->address_list);
$output->address_list = explode(',', $output->address_list);
$claim = Claim::where(['transaction_hash_id' => $tx->hash, 'vout' => $output->vout])
->select(['claim_id', 'vout', 'transaction_hash_id'])
->first();
if($claim !== null) {
$output->claim_id = $claim->claim_id;
}
//check transaction opcode {OP_DUP | OP_CLAIM_NAME | OP_UPDATE_CLAIM | OP_SUPPORT_CLAIM}
$output->opcode_friendly = explode(' ', $output->script_pub_key_asm)[0];
switch($output->opcode_friendly) {
case 'OP_DUP':
// if standard transaction (type: pubkeyhash) then pass blank opcode to view
$output->opcode_friendly = " ";
break;
case 'OP_CLAIM_NAME':
$output->opcode_friendly = "NEW CLAIM";
break;
case 'OP_UPDATE_CLAIM':
$output->opcode_friendly = "UPDATE CLAIM";
break;
case 'OP_SUPPORT_CLAIM':
$output->opcode_friendly = "SUPPORT CLAIM";
break;
}
}
return view('transaction', [
'transaction' => $tx,
'inputs' => $inputs,
'outputs' => $outputs
]);
} else {
return redirect(route('transactions'));
}
}
public function getMempoolTransactions() {
$transactions = Transaction::select('hash', 'value', 'created_at', 'input_count', 'output_count', 'transaction_size')
->where('block_hash_id', 'MEMPOOL')
->orderBy('id', 'desc')
->simplePaginate(25);
$transactions->transform(function ($item, $key) {
$item->transaction_size /= 1000;
$item->transaction_time = Carbon::parse($item->created_at)->diffForHumans(null, false, false, 2);
return $item;
});
return view('transactions_mempool', [
'transactions' => $transactions
]);
}
}

82
app/Http/Kernel.php Normal file
View file

@ -0,0 +1,82 @@
<?php
namespace App\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel
{
/**
* The application's global HTTP middleware stack.
*
* These middleware are run during every request to your application.
*
* @var array
*/
protected $middleware = [
\App\Http\Middleware\CheckForMaintenanceMode::class,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
\App\Http\Middleware\TrustProxies::class,
];
/**
* The application's route middleware groups.
*
* @var array
*/
protected $middlewareGroups = [
'web' => [
\App\Http\Middleware\EncryptCookies::class,
\App\Http\Middleware\Cors::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
// \Illuminate\Session\Middleware\AuthenticateSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
\App\Http\Middleware\Price::class,
],
'api' => [
'throttle:60,1',
'bindings',
],
];
/**
* The application's route middleware.
*
* These middleware may be assigned to groups or used individually.
*
* @var array
*/
protected $routeMiddleware = [
'auth' => \App\Http\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
'can' => \Illuminate\Auth\Middleware\Authorize::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
];
/**
* The priority-sorted list of middleware.
*
* This forces non-global middleware to always be in the given order.
*
* @var array
*/
protected $middlewarePriority = [
\Illuminate\Session\Middleware\StartSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\Authenticate::class,
\Illuminate\Session\Middleware\AuthenticateSession::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
\Illuminate\Auth\Middleware\Authorize::class,
];
}

View file

@ -0,0 +1,21 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Auth\Middleware\Authenticate as Middleware;
class Authenticate extends Middleware
{
/**
* Get the path the user should be redirected to when they are not authenticated.
*
* @param \Illuminate\Http\Request $request
* @return string
*/
protected function redirectTo($request)
{
if (! $request->expectsJson()) {
return route('login');
}
}
}

View file

@ -0,0 +1,17 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode as Middleware;
class CheckForMaintenanceMode extends Middleware
{
/**
* The URIs that should be reachable while maintenance mode is enabled.
*
* @var array
*/
protected $except = [
//
];
}

View file

@ -0,0 +1,23 @@
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
class Cors
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
return $next($request)
->header('Access-Control-Allow-Origin', '*')
->header('Access-Control-Allow-Methods', 'GET, POST, PUT, OPTIONS');
}
}

View file

@ -0,0 +1,17 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;
class EncryptCookies extends Middleware
{
/**
* The names of the cookies that should not be encrypted.
*
* @var array
*/
protected $except = [
//
];
}

View file

@ -0,0 +1,87 @@
<?php
namespace App\Http\Middleware;
use CLosure;
use DateTime;
use DateTimeZone;
use Exception;
use GuzzleHttp\Client;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\View;
class Price
{
private $bittrexApiUrl = 'https://api.bittrex.com';
private $bittrexApiClient;
function __construct() {
$this->bittrexApiClient = new Client([
'base_uri' => $this->bittrexApiUrl,
'timeout' => 2.0,
'http_errors' => false
]);
}
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if (Cache::has('priceInfo')) {
$priceInfo = Cache::get('priceInfo');
} else {
$priceInfo = $this->getPrice();
Cache::put('priceInfo', $priceInfo, $seconds = 60);
}
$request->attributes->add(['priceInfo' => $priceInfo]);
View::share('priceInfo', $priceInfo);
return $next($request);
}
private function getPrice() {
$bittrexBtcTicker = 'v3/markets/LBC-BTC/ticker';
$bittrexUsdTicker = 'v3/markets/LBC-USDT/ticker';
$bittrexUsdSummary = 'v3/markets/LBC-BTC/summary';
$btcResponse = json_decode($this->get($bittrexBtcTicker));
$usdResponse= json_decode($this->get($bittrexUsdTicker));
$usdSummaryResponse= json_decode($this->get($bittrexUsdSummary));
if ($btcResponse->symbol) {
$last_price_btc = $btcResponse->lastTradeRate;
$now = new DateTime('now', new DateTimeZone('UTC'));
if ($usdResponse->symbol) {
$last_price_usd = $usdResponse->lastTradeRate;
$percentChangeUsd = $usdSummaryResponse->percentChange;
$priceInfo = new \stdClass();
$priceInfo->priceUsd = number_format($last_price_usd, 4, '.', '');
$priceInfo->percentChangeUsd = $percentChangeUsd;
$priceInfo->priceBtc = number_format($last_price_btc, 9, '.', '');
$priceInfo->time = $now->format('c');
if ($priceInfo) {
return $priceInfo;
} else {
echo "Could not insert price history item. USD: $last_price_usd, BTC: $last_price_btc.\n";
}
}
} else {
echo "Bittrex request returned an invalid result.\n";
}
}
private function get($url) {
$response = $this->bittrexApiClient->request('GET', $url);
if ($response->getStatusCode() != 200) {
return false;
}
return (string) $response->getBody();
}
}

View file

@ -0,0 +1,26 @@
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Support\Facades\Auth;
class RedirectIfAuthenticated
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param string|null $guard
* @return mixed
*/
public function handle($request, Closure $next, $guard = null)
{
if (Auth::guard($guard)->check()) {
return redirect('/home');
}
return $next($request);
}
}

View file

@ -0,0 +1,18 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
class TrimStrings extends Middleware
{
/**
* The names of the attributes that should not be trimmed.
*
* @var array
*/
protected $except = [
'password',
'password_confirmation',
];
}

View file

@ -0,0 +1,23 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Http\Request;
use Fideloper\Proxy\TrustProxies as Middleware;
class TrustProxies extends Middleware
{
/**
* The trusted proxies for this application.
*
* @var array|string
*/
protected $proxies;
/**
* The headers that should be used to detect proxies.
*
* @var int
*/
protected $headers = Request::HEADER_X_FORWARDED_ALL;
}

View file

@ -0,0 +1,24 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
class VerifyCsrfToken extends Middleware
{
/**
* Indicates whether the XSRF-TOKEN cookie should be set on the response.
*
* @var bool
*/
protected $addHttpCookie = true;
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array
*/
protected $except = [
//
];
}

54
app/Input.php Normal file
View file

@ -0,0 +1,54 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
/**
* @property integer $id
* @property integer $transaction_id
* @property string $transaction_hash
* @property integer $input_address_id
* @property boolean $is_coinbase
* @property string $coinbase
* @property string $prevout_hash
* @property int $prevout_n
* @property boolean $prevout_spend_updated
* @property int $sequence
* @property float $value
* @property string $script_sig_asm
* @property string $script_sig_hex
* @property string $created
* @property string $modified
* @property int $vin
* @property Transaction $transaction
*/
class Input extends Model
{
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'input';
/**
* The "type" of the auto-incrementing ID.
*
* @var string
*/
protected $keyType = 'integer';
/**
* @var array
*/
protected $fillable = ['transaction_id', 'transaction_hash', 'input_address_id', 'is_coinbase', 'coinbase', 'prevout_hash', 'prevout_n', 'prevout_spend_updated', 'sequence', 'value', 'script_sig_asm', 'script_sig_hex', 'created', 'modified', 'vin'];
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function transaction()
{
return $this->belongsTo('App\Transaction');
}
}

62
app/Output.php Normal file
View file

@ -0,0 +1,62 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
/**
* @property integer $id
* @property integer $transaction_id
* @property string $transaction_hash
* @property float $value
* @property int $vout
* @property string $type
* @property string $script_pub_key_asm
* @property string $script_pub_key_hex
* @property int $required_signatures
* @property string $address_list
* @property boolean $is_spent
* @property integer $spent_by_input_id
* @property string $created_at
* @property string $modified_at
* @property string $claim_id
* @property Transaction $transaction
* @property AbnormalClaim[] $abnormalClaims
*/
class Output extends Model
{
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'output';
/**
* The "type" of the auto-incrementing ID.
*
* @var string
*/
protected $keyType = 'integer';
/**
* @var array
*/
protected $fillable = ['transaction_id', 'transaction_hash', 'value', 'vout', 'type', 'script_pub_key_asm', 'script_pub_key_hex', 'required_signatures', 'address_list', 'is_spent', 'spent_by_input_id', 'created_at', 'modified_at', 'claim_id'];
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function transaction()
{
return $this->belongsTo('App\Transaction');
}
/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function abnormalClaims()
{
return $this->hasMany('App\AbnormalClaim');
}
}

View file

@ -0,0 +1,28 @@
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
//
}
}

View file

@ -0,0 +1,30 @@
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Gate;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
class AuthServiceProvider extends ServiceProvider
{
/**
* The policy mappings for the application.
*
* @var array
*/
protected $policies = [
// 'App\Model' => 'App\Policies\ModelPolicy',
];
/**
* Register any authentication / authorization services.
*
* @return void
*/
public function boot()
{
$this->registerPolicies();
//
}
}

View file

@ -0,0 +1,21 @@
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Broadcast;
class BroadcastServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Broadcast::routes();
require base_path('routes/channels.php');
}
}

View file

@ -0,0 +1,34 @@
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Event;
use Illuminate\Auth\Events\Registered;
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
class EventServiceProvider extends ServiceProvider
{
/**
* The event listener mappings for the application.
*
* @var array
*/
protected $listen = [
Registered::class => [
SendEmailVerificationNotification::class,
],
];
/**
* Register any events for your application.
*
* @return void
*/
public function boot()
{
parent::boot();
//
}
}

View file

@ -0,0 +1,73 @@
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
/**
* This namespace is applied to your controller routes.
*
* In addition, it is set as the URL generator's root namespace.
*
* @var string
*/
protected $namespace = 'App\Http\Controllers';
/**
* Define your route model bindings, pattern filters, etc.
*
* @return void
*/
public function boot()
{
//
parent::boot();
}
/**
* Define the routes for the application.
*
* @return void
*/
public function map()
{
$this->mapApiRoutes();
$this->mapWebRoutes();
//
}
/**
* Define the "web" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapWebRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/web.php'));
}
/**
* Define the "api" routes for the application.
*
* These routes are typically stateless.
*
* @return void
*/
protected function mapApiRoutes()
{
Route::prefix('api')
->middleware('api')
->namespace($this->namespace)
->group(base_path('routes/api.php'));
}
}

46
app/Support.php Normal file
View file

@ -0,0 +1,46 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
/**
* @property integer $id
* @property string $transaction_hash_id
* @property string $supported_claim_id
* @property float $support_amount
* @property string $bid_state
* @property int $vout
* @property string $created_at
* @property string $modified_at
* @property Transaction $transaction
*/
class Support extends Model
{
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'support';
/**
* The "type" of the auto-incrementing ID.
*
* @var string
*/
protected $keyType = 'integer';
/**
* @var array
*/
protected $fillable = ['transaction_hash_id', 'supported_claim_id', 'support_amount', 'bid_state', 'vout', 'created_at', 'modified_at'];
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function transaction()
{
return $this->belongsTo('App\Transaction', 'transaction_hash_id', 'hash');
}
}

42
app/Tag.php Normal file
View file

@ -0,0 +1,42 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
/**
* @property integer $id
* @property string $tag
* @property string $created_at
* @property string $modified_at
* @property ClaimTag[] $claimTags
*/
class Tag extends Model
{
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'tag';
/**
* The "type" of the auto-incrementing ID.
*
* @var string
*/
protected $keyType = 'integer';
/**
* @var array
*/
protected $fillable = ['tag', 'created_at', 'modified_at'];
/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function claimTags()
{
return $this->hasMany('App\ClaimTag');
}
}

98
app/Transaction.php Normal file
View file

@ -0,0 +1,98 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
/**
* @property integer $id
* @property string $block_hash_id
* @property int $input_count
* @property int $output_count
* @property float $fee
* @property integer $transaction_time
* @property integer $transaction_size
* @property string $hash
* @property int $version
* @property int $lock_time
* @property string $raw
* @property string $created_at
* @property string $modified_at
* @property string $created_time
* @property float $value
* @property Block $block
* @property Claim[] $claims
* @property Input[] $inputs
* @property Output[] $outputs
* @property Support[] $supports
* @property TransactionAddress[] $transactionAddresses
*/
class Transaction extends Model
{
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'transaction';
/**
* The "type" of the auto-incrementing ID.
*
* @var string
*/
protected $keyType = 'integer';
/**
* @var array
*/
protected $fillable = ['block_hash_id', 'input_count', 'output_count', 'fee', 'transaction_time', 'transaction_size', 'hash', 'version', 'lock_time', 'raw', 'created_at', 'modified_at', 'created_time', 'value'];
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function block()
{
return $this->belongsTo('App\Block', 'block_hash_id', 'hash');
}
/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function claims()
{
return $this->hasMany('App\Claim', 'transaction_hash_id', 'hash');
}
/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function inputs()
{
return $this->hasMany('App\Input');
}
/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function outputs()
{
return $this->hasMany('App\Output');
}
/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function supports()
{
return $this->hasMany('App\Support', 'transaction_hash_id', 'hash');
}
/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function transactionAddresses()
{
return $this->hasMany('App\TransactionAddress');
}
}

View file

@ -0,0 +1,44 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
/**
* @property integer $transaction_id
* @property integer $address_id
* @property float $debit_amount
* @property float $credit_amount
* @property Transaction $transaction
* @property Address $address
*/
class TransactionAddress extends Model
{
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'transaction_address';
/**
* @var array
*/
protected $fillable = ['debit_amount', 'credit_amount'];
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function transaction()
{
return $this->belongsTo('App\Transaction');
}
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function address()
{
return $this->belongsTo('App\Address');
}
}

39
app/User.php Normal file
View file

@ -0,0 +1,39 @@
<?php
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable
{
use Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'email', 'password',
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password', 'remember_token',
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'email_verified_at' => 'datetime',
];
}

53
artisan Normal file
View file

@ -0,0 +1,53 @@
#!/usr/bin/env php
<?php
define('LARAVEL_START', microtime(true));
/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader
| for our application. We just need to utilize it! We'll require it
| into the script here so that we do not have to worry about the
| loading of any our classes "manually". Feels great to relax.
|
*/
require __DIR__.'/vendor/autoload.php';
$app = require_once __DIR__.'/bootstrap/app.php';
/*
|--------------------------------------------------------------------------
| Run The Artisan Application
|--------------------------------------------------------------------------
|
| When we run the console application, the current CLI command will be
| executed in this console and the response sent back to a terminal
| or another output device for the developers. Here goes nothing!
|
*/
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
$status = $kernel->handle(
$input = new Symfony\Component\Console\Input\ArgvInput,
new Symfony\Component\Console\Output\ConsoleOutput
);
/*
|--------------------------------------------------------------------------
| Shutdown The Application
|--------------------------------------------------------------------------
|
| Once Artisan has finished running, we will fire off the shutdown events
| so that any final work may be done by the application before we shut
| down the process. This is the last thing to happen to the request.
|
*/
$kernel->terminate($input, $status);
exit($status);

View file

@ -1,46 +0,0 @@
#!/usr/bin/env sh
################################################################################
#
# Cake is a shell script for invoking CakePHP shell commands
#
# CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
# Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
#
# Licensed under The MIT License
# For full copyright and license information, please see the LICENSE.txt
# Redistributions of files must retain the above copyright notice.
#
# @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
# @link http://cakephp.org CakePHP(tm) Project
# @since 1.2.0
# @license http://www.opensource.org/licenses/mit-license.php MIT License
#
################################################################################
# Canonicalize by following every symlink of the given name recursively
canonicalize() {
NAME="$1"
if [ -f "$NAME" ]
then
DIR=$(dirname -- "$NAME")
NAME=$(cd -P "$DIR" > /dev/null && pwd -P)/$(basename -- "$NAME")
fi
while [ -h "$NAME" ]; do
DIR=$(dirname -- "$NAME")
SYM=$(readlink "$NAME")
NAME=$(cd "$DIR" > /dev/null && cd $(dirname -- "$SYM") > /dev/null && pwd)/$(basename -- "$SYM")
done
echo "$NAME"
}
CONSOLE=$(dirname -- "$(canonicalize "$0")")
APP=$(dirname "$CONSOLE")
if [ $(basename $0) != 'cake' ]
then
exec php "$CONSOLE"/cake.php $(basename $0) "$@"
else
exec php "$CONSOLE"/cake.php "$@"
fi
exit

View file

@ -1,27 +0,0 @@
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::
:: Cake is a Windows batch script for invoking CakePHP shell commands
::
:: CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
:: Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
::
:: Licensed under The MIT License
:: Redistributions of files must retain the above copyright notice.
::
:: @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
:: @link http://cakephp.org CakePHP(tm) Project
:: @since 2.0.0
:: @license http://www.opensource.org/licenses/mit-license.php MIT License
::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@echo off
SET app=%0
SET lib=%~dp0
php "%lib%cake.php" %*
echo.
exit /B %ERRORLEVEL%

View file

@ -1,34 +0,0 @@
#!/usr/bin/php -q
<?php
/**
* Command-line code generation utility to automate programmer chores.
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @since 2.0.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
$minVersion = '5.6.0';
if (file_exists('composer.json')) {
$composer = json_decode(file_get_contents('composer.json'));
if (isset($composer->require->php)) {
$minVersion = preg_replace('/([^0-9\.])/', '', $composer->require->php);
}
}
if (version_compare(phpversion(), $minVersion, '<')) {
fwrite(STDERR, sprintf("Minimum PHP version: %s. You are using: %s.\n", $minVersion, phpversion()));
exit(-1);
}
require dirname(__DIR__) . '/vendor/autoload.php';
include dirname(__DIR__) . '/config/bootstrap.php';
exit(Cake\Console\ShellDispatcher::run($argv));

55
bootstrap/app.php Normal file
View file

@ -0,0 +1,55 @@
<?php
/*
|--------------------------------------------------------------------------
| Create The Application
|--------------------------------------------------------------------------
|
| The first thing we will do is create a new Laravel application instance
| which serves as the "glue" for all the components of Laravel, and is
| the IoC container for the system binding all of the various parts.
|
*/
$app = new Illuminate\Foundation\Application(
$_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
);
/*
|--------------------------------------------------------------------------
| Bind Important Interfaces
|--------------------------------------------------------------------------
|
| Next, we need to bind some important interfaces into the container so
| we will be able to resolve them when needed. The kernels serve the
| incoming requests to this application from both the web and CLI.
|
*/
$app->singleton(
Illuminate\Contracts\Http\Kernel::class,
App\Http\Kernel::class
);
$app->singleton(
Illuminate\Contracts\Console\Kernel::class,
App\Console\Kernel::class
);
$app->singleton(
Illuminate\Contracts\Debug\ExceptionHandler::class,
App\Exceptions\Handler::class
);
/*
|--------------------------------------------------------------------------
| Return The Application
|--------------------------------------------------------------------------
|
| This script returns the application instance. The instance is given to
| the calling script so we can separate the building of the instances
| from the actual running of the application and sending responses.
|
*/
return $app;

2
bootstrap/cache/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
*
!.gitignore

View file

@ -1,54 +1,66 @@
{ {
"name": "cakephp/app", "name": "laravel/laravel",
"description": "CakePHP skeleton app",
"homepage": "http://cakephp.org",
"type": "project", "type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT", "license": "MIT",
"require": { "require": {
"php": ">=5.6", "php": "^7.4.11",
"cakephp/cakephp": "3.7.7", "fideloper/proxy": "^4.4.1",
"mobiledetect/mobiledetectlib": "2.*", "laravel/framework": "^8.21.0",
"cakephp/migrations": "~1.0", "laravel/tinker": "^v2.5.0",
"psr/simple-cache": "^1.0.0", "guzzlehttp/guzzle": "^7.2.0",
"cakephp/plugin-installer": "~1.0", "ext-json": "*",
"mdanter/ecc": "^0.5.0", "ext-bcmath": "*"
"nesbot/carbon": "~1.18",
"predis/predis": "^1.1.1",
"endroid/qr-code": "^3.5"
}, },
"require-dev": { "require-dev": {
"psy/psysh": "@stable", "barryvdh/laravel-debugbar": "^v3.5.2",
"cakephp/debug_kit": "~3.2", "beyondcode/laravel-dump-server": "^1.7.0",
"cakephp/bake": "~1.1" "filp/whoops": "^2.3.2",
"krlove/eloquent-model-generator": "^1.3.6",
"mockery/mockery": "^1.4.2",
"nunomaduro/collision": "^v5.1.0",
"phpunit/phpunit": "^9.1.0"
}, },
"suggest": { "config": {
"markstory/asset_compress": "An asset compression plugin which provides file concatenation and a flexible filter system for preprocessing and minification.", "optimize-autoloader": true,
"dereuromark/cakephp-ide-helper": "After baking your code, this keeps your annotations in sync with the code evolving from there on for maximum IDE and PHPStan compatibility.", "preferred-install": "dist",
"phpunit/phpunit": "Allows automated tests to be run without system-wide install.", "sort-packages": true
"cakephp/cakephp-codesniffer": "Allows to check the code against the coding standards used in CakePHP." },
"extra": {
"laravel": {
"dont-discover": []
}
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"App\\": "src" "App\\": "app/"
} },
"classmap": [
"database/seeds",
"database/factories"
]
}, },
"autoload-dev": { "autoload-dev": {
"psr-4": { "psr-4": {
"App\\Test\\": "tests", "Tests\\": "tests/"
"Cake\\Test\\": "./vendor/cakephp/cakephp/tests"
} }
}, },
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": { "scripts": {
"post-install-cmd": "App\\Console\\Installer::postInstall", "post-autoload-dump": [
"post-create-project-cmd": "App\\Console\\Installer::postInstall", "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"post-autoload-dump": "Cake\\Composer\\Installer\\PluginInstaller::postAutoloadDump", "@php artisan package:discover --ansi"
"check": [
"@test",
"@cs-check"
], ],
"cs-check": "phpcs --colors -p --standard=vendor/cakephp/cakephp-codesniffer/CakePHP ./src ./tests", "post-root-package-install": [
"cs-fix": "phpcbf --colors --standard=vendor/cakephp/cakephp-codesniffer/CakePHP ./src ./tests", "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
"test": "phpunit --colors=always" ],
}, "post-create-project-cmd": [
"prefer-stable": true "@php artisan key:generate --ansi"
]
}
} }

10067
composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,367 +0,0 @@
<?php
return [
/**
* Debug Level:
*
* Production Mode:
* false: No error messages, errors, or warnings shown.
*
* Development Mode:
* true: Errors and warnings shown.
*/
'debug' => filter_var(env('DEBUG', true), FILTER_VALIDATE_BOOLEAN),
/**
* Configure basic information about the application.
*
* - namespace - The namespace to find app classes under.
* - defaultLocale - The default locale for translation, formatting currencies and numbers, date and time.
* - encoding - The encoding used for HTML + database connections.
* - base - The base directory the app resides in. If false this
* will be auto detected.
* - dir - Name of app directory.
* - webroot - The webroot directory.
* - wwwRoot - The file path to webroot.
* - baseUrl - To configure CakePHP to *not* use mod_rewrite and to
* use CakePHP pretty URLs, remove these .htaccess
* files:
* /.htaccess
* /webroot/.htaccess
* And uncomment the baseUrl key below.
* - fullBaseUrl - A base URL to use for absolute links.
* - imageBaseUrl - Web path to the public images directory under webroot.
* - cssBaseUrl - Web path to the public css directory under webroot.
* - jsBaseUrl - Web path to the public js directory under webroot.
* - paths - Configure paths for non class based resources. Supports the
* `plugins`, `templates`, `locales` subkeys, which allow the definition of
* paths for plugins, view templates and locale files respectively.
*/
'App' => [
'namespace' => 'App',
'encoding' => env('APP_ENCODING', 'UTF-8'),
'defaultLocale' => env('APP_DEFAULT_LOCALE', 'en_US'),
'base' => false,
'dir' => 'src',
'webroot' => 'webroot',
'wwwRoot' => WWW_ROOT,
// 'baseUrl' => env('SCRIPT_NAME'),
'fullBaseUrl' => false,
'imageBaseUrl' => 'img/',
'cssBaseUrl' => 'css/',
'jsBaseUrl' => 'js/',
'paths' => [
'plugins' => [ROOT . DS . 'plugins' . DS],
'templates' => [APP . 'Template' . DS],
'locales' => [APP . 'Locale' . DS],
],
],
/**
* Security and encryption configuration
*
* - salt - A random string used in security hashing methods.
* The salt value is also used as the encryption key.
* You should treat it as extremely sensitive data.
*/
'Security' => [
'salt' => env('SECURITY_SALT', '__SALT__'),
],
/**
* Apply timestamps with the last modified time to static assets (js, css, images).
* Will append a querystring parameter containing the time the file was modified.
* This is useful for busting browser caches.
*
* Set to true to apply timestamps when debug is true. Set to 'force' to always
* enable timestamping regardless of debug value.
*/
'Asset' => [
// 'timestamp' => true,
],
/**
* Configure the cache adapters.
*/
'Cache' => [
'default' => [
'className' => 'File',
'path' => CACHE,
'url' => env('CACHE_DEFAULT_URL', null),
],
/**
* Configure the cache used for general framework caching.
* Translation cache files are stored with this configuration.
* Duration will be set to '+2 minutes' in bootstrap.php when debug = true
* If you set 'className' => 'Null' core cache will be disabled.
*/
'_cake_core_' => [
'className' => 'File',
'prefix' => 'myapp_cake_core_',
'path' => CACHE . 'persistent/',
'serialize' => true,
'duration' => '+1 years',
'url' => env('CACHE_CAKECORE_URL', null),
],
/**
* Configure the cache for model and datasource caches. This cache
* configuration is used to store schema descriptions, and table listings
* in connections.
* Duration will be set to '+2 minutes' in bootstrap.php when debug = true
*/
'_cake_model_' => [
'className' => 'File',
'prefix' => 'myapp_cake_model_',
'path' => CACHE . 'models/',
'serialize' => true,
'duration' => '+1 years',
'url' => env('CACHE_CAKEMODEL_URL', null),
],
],
/**
* Configure the Error and Exception handlers used by your application.
*
* By default errors are displayed using Debugger, when debug is true and logged
* by Cake\Log\Log when debug is false.
*
* In CLI environments exceptions will be printed to stderr with a backtrace.
* In web environments an HTML page will be displayed for the exception.
* With debug true, framework errors like Missing Controller will be displayed.
* When debug is false, framework errors will be coerced into generic HTTP errors.
*
* Options:
*
* - `errorLevel` - int - The level of errors you are interested in capturing.
* - `trace` - boolean - Whether or not backtraces should be included in
* logged errors/exceptions.
* - `log` - boolean - Whether or not you want exceptions logged.
* - `exceptionRenderer` - string - The class responsible for rendering
* uncaught exceptions. If you choose a custom class you should place
* the file for that class in src/Error. This class needs to implement a
* render method.
* - `skipLog` - array - List of exceptions to skip for logging. Exceptions that
* extend one of the listed exceptions will also be skipped for logging.
* E.g.:
* `'skipLog' => ['Cake\Network\Exception\NotFoundException', 'Cake\Network\Exception\UnauthorizedException']`
* - `extraFatalErrorMemory` - int - The number of megabytes to increase
* the memory limit by when a fatal error is encountered. This allows
* breathing room to complete logging or error handling.
*/
'Error' => [
'errorLevel' => E_ALL,
'exceptionRenderer' => 'Cake\Error\ExceptionRenderer',
'skipLog' => [],
'log' => true,
'trace' => true,
],
/**
* Email configuration.
*
* By defining transports separately from delivery profiles you can easily
* re-use transport configuration across multiple profiles.
*
* You can specify multiple configurations for production, development and
* testing.
*
* Each transport needs a `className`. Valid options are as follows:
*
* Mail - Send using PHP mail function
* Smtp - Send using SMTP
* Debug - Do not send the email, just return the result
*
* You can add custom transports (or override existing transports) by adding the
* appropriate file to src/Mailer/Transport. Transports should be named
* 'YourTransport.php', where 'Your' is the name of the transport.
*/
'EmailTransport' => [
'default' => [
'className' => 'Mail',
// The following keys are used in SMTP transports
'host' => 'localhost',
'port' => 25,
'timeout' => 30,
'username' => 'user',
'password' => 'secret',
'client' => null,
'tls' => null,
'url' => env('EMAIL_TRANSPORT_DEFAULT_URL', null),
],
],
/**
* Email delivery profiles
*
* Delivery profiles allow you to predefine various properties about email
* messages from your application and give the settings a name. This saves
* duplication across your application and makes maintenance and development
* easier. Each profile accepts a number of keys. See `Cake\Mailer\Email`
* for more information.
*/
'Email' => [
'default' => [
'transport' => 'default',
'from' => 'you@localhost',
//'charset' => 'utf-8',
//'headerCharset' => 'utf-8',
],
],
/**
* Connection information used by the ORM to connect
* to your application's datastores.
* Do not use periods in database name - it may lead to error.
* See https://github.com/cakephp/cakephp/issues/6471 for details.
* Drivers include Mysql Postgres Sqlite Sqlserver
* See vendor\cakephp\cakephp\src\Database\Driver for complete list
*/
'Datasources' => [
'default' => [ // Chainquery database connection
'className' => 'Cake\Database\Connection',
'driver' => 'Cake\Database\Driver\Mysql',
'persistent' => false,
'host' => 'chainquery.lbry.com',
/**
* CakePHP will use the default DB port based on the driver selected
* MySQL on MAMP uses port 8889, MAMP users will want to uncomment
* the following line and set the port accordingly
*/
//'port' => '3000',
'username' => 'username',
'password' => 'secret',
'database' => 'my_db',
'encoding' => 'utf8',
'timezone' => 'UTC',
'flags' => [],
'cacheMetadata' => true,
'log' => false,
/**
* Set identifier quoting to true if you are using reserved words or
* special characters in your table or column names. Enabling this
* setting will result in queries built using the Query Builder having
* identifiers quoted when creating SQL. It should be noted that this
* decreases performance because each query needs to be traversed and
* manipulated before being executed.
*/
'quoteIdentifiers' => false,
/**
* During development, if using MySQL < 5.6, uncommenting the
* following line could boost the speed at which schema metadata is
* fetched from the database. It can also be set directly with the
* mysql configuration directive 'innodb_stats_on_metadata = 0'
* which is the recommended value in production environments
*/
//'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'],
'url' => env('DATABASE_URL', 'chainquery.lbry.com:3600'),
],
'localdb' => [ // Local db for price history
'className' => 'Cake\Database\Connection',
'driver' => 'Cake\Database\Driver\Mysql',
'persistent' => false,
'host' => 'localhost',
/**
* CakePHP will use the default DB port based on the driver selected
* MySQL on MAMP uses port 8889, MAMP users will want to uncomment
* the following line and set the port accordingly
*/
//'port' => '3306',
'username' => 'username',
'password' => 'secret',
'database' => 'lbry',
'encoding' => 'utf8',
'timezone' => 'UTC',
'flags' => [],
'cacheMetadata' => true,
'log' => false,
],
/**
* The test connection is used during the test suite.
*/
'test' => [
'className' => 'Cake\Database\Connection',
'driver' => 'Cake\Database\Driver\Mysql',
'persistent' => false,
'host' => 'localhost',
//'port' => 'non_standard_port_number',
'username' => 'my_app',
'password' => 'secret',
'database' => 'test_myapp',
'encoding' => 'utf8',
'timezone' => 'UTC',
'cacheMetadata' => true,
'quoteIdentifiers' => false,
'log' => false,
//'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'],
'url' => env('DATABASE_TEST_URL', null),
],
],
/**
* Configures logging options
*/
'Log' => [
'debug' => [
'className' => 'Cake\Log\Engine\FileLog',
'path' => LOGS,
'file' => 'debug',
'levels' => ['notice', 'info', 'debug'],
'url' => env('LOG_DEBUG_URL', null),
],
'error' => [
'className' => 'Cake\Log\Engine\FileLog',
'path' => LOGS,
'file' => 'error',
'levels' => ['warning', 'error', 'critical', 'alert', 'emergency'],
'url' => env('LOG_ERROR_URL', null),
],
],
/**
* Session configuration.
*
* Contains an array of settings to use for session configuration. The
* `defaults` key is used to define a default preset to use for sessions, any
* settings declared here will override the settings of the default config.
*
* ## Options
*
* - `cookie` - The name of the cookie to use. Defaults to 'CAKEPHP'.
* - `cookiePath` - The url path for which session cookie is set. Maps to the
* `session.cookie_path` php.ini config. Defaults to base path of app.
* - `timeout` - The time in minutes the session should be valid for.
* Pass 0 to disable checking timeout.
* Please note that php.ini's session.gc_maxlifetime must be equal to or greater
* than the largest Session['timeout'] in all served websites for it to have the
* desired effect.
* - `defaults` - The default configuration set to use as a basis for your session.
* There are four built-in options: php, cake, cache, database.
* - `handler` - Can be used to enable a custom session handler. Expects an
* array with at least the `engine` key, being the name of the Session engine
* class to use for managing the session. CakePHP bundles the `CacheSession`
* and `DatabaseSession` engines.
* - `ini` - An associative array of additional ini values to set.
*
* The built-in `defaults` options are:
*
* - 'php' - Uses settings defined in your php.ini.
* - 'cake' - Saves session files in CakePHP's /tmp directory.
* - 'database' - Uses CakePHP's database sessions.
* - 'cache' - Use the Cache class to save sessions.
*
* To define a custom session handler, save it at src/Network/Session/<name>.php.
* Make sure the class implements PHP's `SessionHandlerInterface` and set
* Session.handler to <name>
*
* To use database sessions, load the SQL file located at config/Schema/sessions.sql
*/
'Session' => [
'defaults' => 'php',
],
];

231
config/app.php Normal file
View file

@ -0,0 +1,231 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Application Name
|--------------------------------------------------------------------------
|
| This value is the name of your application. This value is used when the
| framework needs to place the application's name in a notification or
| any other location as required by the application or its packages.
|
*/
'name' => env('APP_NAME', 'LBRY Explorer'),
/*
|--------------------------------------------------------------------------
| Application Environment
|--------------------------------------------------------------------------
|
| This value determines the "environment" your application is currently
| running in. This may determine how you prefer to configure various
| services the application utilizes. Set this in your ".env" file.
|
*/
'env' => env('APP_ENV', 'production'),
/*
|--------------------------------------------------------------------------
| Application Debug Mode
|--------------------------------------------------------------------------
|
| When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown.
|
*/
'debug' => env('APP_DEBUG', false),
/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| your application so that it is used when running Artisan tasks.
|
*/
'url' => env('APP_URL', 'http://localhost'),
'asset_url' => env('ASSET_URL', null),
/*
|--------------------------------------------------------------------------
| Application Timezone
|--------------------------------------------------------------------------
|
| Here you may specify the default timezone for your application, which
| will be used by the PHP date and date-time functions. We have gone
| ahead and set this to a sensible default for you out of the box.
|
*/
'timezone' => 'UTC',
/*
|--------------------------------------------------------------------------
| Application Locale Configuration
|--------------------------------------------------------------------------
|
| The application locale determines the default locale that will be used
| by the translation service provider. You are free to set this value
| to any of the locales which will be supported by the application.
|
*/
'locale' => 'en',
/*
|--------------------------------------------------------------------------
| Application Fallback Locale
|--------------------------------------------------------------------------
|
| The fallback locale determines the locale to use when the current one
| is not available. You may change the value to correspond to any of
| the language folders that are provided through your application.
|
*/
'fallback_locale' => 'en',
/*
|--------------------------------------------------------------------------
| Faker Locale
|--------------------------------------------------------------------------
|
| This locale will be used by the Faker PHP library when generating fake
| data for your database seeds. For example, this will be used to get
| localized telephone numbers, street address information and more.
|
*/
'faker_locale' => 'en_US',
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is used by the Illuminate encrypter service and should be set
| to a random, 32 character string, otherwise these encrypted strings
| will not be safe. Please do this before deploying an application!
|
*/
'key' => env('APP_KEY'),
'cipher' => 'AES-256-CBC',
/*
|--------------------------------------------------------------------------
| Autoloaded Service Providers
|--------------------------------------------------------------------------
|
| The service providers listed here will be automatically loaded on the
| request to your application. Feel free to add your own services to
| this array to grant expanded functionality to your applications.
|
*/
'providers' => [
/*
* Laravel Framework Service Providers...
*/
//Illuminate\Auth\AuthServiceProvider::class,
//Illuminate\Broadcasting\BroadcastServiceProvider::class,
Illuminate\Bus\BusServiceProvider::class,
Illuminate\Cache\CacheServiceProvider::class,
Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
Illuminate\Cookie\CookieServiceProvider::class,
Illuminate\Database\DatabaseServiceProvider::class,
Illuminate\Encryption\EncryptionServiceProvider::class,
Illuminate\Filesystem\FilesystemServiceProvider::class,
//Illuminate\Foundation\Providers\FoundationServiceProvider::class,
//Illuminate\Hashing\HashServiceProvider::class,
//Illuminate\Mail\MailServiceProvider::class,
//Illuminate\Notifications\NotificationServiceProvider::class,
Illuminate\Pagination\PaginationServiceProvider::class,
//Illuminate\Pipeline\PipelineServiceProvider::class,
Illuminate\Queue\QueueServiceProvider::class,
Illuminate\Redis\RedisServiceProvider::class,
//Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
Illuminate\Session\SessionServiceProvider::class,
Illuminate\Translation\TranslationServiceProvider::class,
//Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class,
/*
* Package Service Providers...
*/
/*
* Application Service Providers...
*/
App\Providers\AppServiceProvider::class,
//App\Providers\AuthServiceProvider::class,
// App\Providers\BroadcastServiceProvider::class,
//App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
],
/*
|--------------------------------------------------------------------------
| Class Aliases
|--------------------------------------------------------------------------
|
| This array of class aliases will be registered when this application
| is started. However, feel free to register as many as you wish as
| the aliases are "lazy" loaded so they don't hinder performance.
|
*/
'aliases' => [
'App' => Illuminate\Support\Facades\App::class,
'Arr' => Illuminate\Support\Arr::class,
'Artisan' => Illuminate\Support\Facades\Artisan::class,
'Auth' => Illuminate\Support\Facades\Auth::class,
'Blade' => Illuminate\Support\Facades\Blade::class,
'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
'Bus' => Illuminate\Support\Facades\Bus::class,
'Cache' => Illuminate\Support\Facades\Cache::class,
'Config' => Illuminate\Support\Facades\Config::class,
'Cookie' => Illuminate\Support\Facades\Cookie::class,
'Crypt' => Illuminate\Support\Facades\Crypt::class,
'DB' => Illuminate\Support\Facades\DB::class,
'Eloquent' => Illuminate\Database\Eloquent\Model::class,
'Event' => Illuminate\Support\Facades\Event::class,
'File' => Illuminate\Support\Facades\File::class,
'Gate' => Illuminate\Support\Facades\Gate::class,
'Hash' => Illuminate\Support\Facades\Hash::class,
'Lang' => Illuminate\Support\Facades\Lang::class,
'Log' => Illuminate\Support\Facades\Log::class,
'Mail' => Illuminate\Support\Facades\Mail::class,
'Notification' => Illuminate\Support\Facades\Notification::class,
'Password' => Illuminate\Support\Facades\Password::class,
'Queue' => Illuminate\Support\Facades\Queue::class,
'Redirect' => Illuminate\Support\Facades\Redirect::class,
'Redis' => Illuminate\Support\Facades\Redis::class,
'Request' => Illuminate\Support\Facades\Request::class,
'Response' => Illuminate\Support\Facades\Response::class,
'Route' => Illuminate\Support\Facades\Route::class,
'Schema' => Illuminate\Support\Facades\Schema::class,
'Session' => Illuminate\Support\Facades\Session::class,
'Storage' => Illuminate\Support\Facades\Storage::class,
'Str' => Illuminate\Support\Str::class,
'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
],
];

103
config/auth.php Normal file
View file

@ -0,0 +1,103 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Authentication Defaults
|--------------------------------------------------------------------------
|
| This option controls the default authentication "guard" and password
| reset options for your application. You may change these defaults
| as required, but they're a perfect start for most applications.
|
*/
'defaults' => [
'guard' => 'web',
'passwords' => 'users',
],
/*
|--------------------------------------------------------------------------
| Authentication Guards
|--------------------------------------------------------------------------
|
| Next, you may define every authentication guard for your application.
| Of course, a great default configuration has been defined for you
| here which uses session storage and the Eloquent user provider.
|
| All authentication drivers have a user provider. This defines how the
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
| Supported: "session", "token"
|
*/
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
'api' => [
'driver' => 'token',
'provider' => 'users',
'hash' => false,
],
],
/*
|--------------------------------------------------------------------------
| User Providers
|--------------------------------------------------------------------------
|
| All authentication drivers have a user provider. This defines how the
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
| If you have multiple user tables or models you may configure multiple
| sources which represent each model / table. These sources may then
| be assigned to any extra authentication guards you have defined.
|
| Supported: "database", "eloquent"
|
*/
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => App\User::class,
],
// 'users' => [
// 'driver' => 'database',
// 'table' => 'users',
// ],
],
/*
|--------------------------------------------------------------------------
| Resetting Passwords
|--------------------------------------------------------------------------
|
| You may specify multiple password reset configurations if you have more
| than one user table or model in the application and you want to have
| separate password reset settings based on the specific user types.
|
| The expire time is the number of minutes that the reset token should be
| considered valid. This security feature keeps tokens short-lived so
| they have less time to be guessed. You may change this as needed.
|
*/
'passwords' => [
'users' => [
'provider' => 'users',
'table' => 'password_resets',
'expire' => 60,
],
],
];

View file

@ -1,229 +0,0 @@
<?php
/**
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @since 0.10.8
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
// You can remove this if you are confident that your PHP version is sufficient.
if (version_compare(PHP_VERSION, '5.6.0') < 0) {
trigger_error('Your PHP version must be equal or higher than 5.6.0 to use CakePHP.', E_USER_ERROR);
}
/*
* You can remove this if you are confident you have intl installed.
*/
if (!extension_loaded('intl')) {
trigger_error('You must enable the intl extension to use CakePHP.', E_USER_ERROR);
}
/*
* You can remove this if you are confident you have mbstring installed.
*/
if (!extension_loaded('mbstring')) {
trigger_error('You must enable the mbstring extension to use CakePHP.', E_USER_ERROR);
}
/*
* Configure paths required to find CakePHP + general filepath
* constants
*/
require __DIR__ . '/paths.php';
/*
* Bootstrap CakePHP.
*
* Does the various bits of setup that CakePHP needs to do.
* This includes:
*
* - Registering the CakePHP autoloader.
* - Setting the default application paths.
*/
require CORE_PATH . 'config' . DS . 'bootstrap.php';
use App\Application;
use Cake\Cache\Cache;
use Cake\Console\ConsoleErrorHandler;
use Cake\Core\App;
use Cake\Core\Configure;
use Cake\Core\Configure\Engine\PhpConfig;
use Cake\Core\Plugin;
use Cake\Database\Type;
use Cake\Datasource\ConnectionManager;
use Cake\Error\ErrorHandler;
use Cake\Log\Log;
use Cake\Mailer\Email;
use Cake\Mailer\TransportFactory;
use Cake\Http\ServerRequest;
use Cake\Utility\Inflector;
use Cake\Utility\Security;
/*
* Read configuration file and inject configuration into various
* CakePHP classes.
*
* By default there is only one configuration file. It is often a good
* idea to create multiple configuration files, and separate the configuration
* that changes from configuration that does not. This makes deployment simpler.
*/
try {
Configure::config('default', new PhpConfig());
Configure::load('app', 'default', false);
} catch (\Exception $e) {
exit($e->getMessage() . "\n");
}
/*
* Load an environment local configuration file.
* You can use a file like app_local.php to provide local overrides to your
* shared configuration.
*/
//Configure::load('app_local', 'default');
/*
* When debug = true the metadata cache should only last
* for a short time.
*/
if (Configure::read('debug')) {
Configure::write('Cache._cake_model_.duration', '+2 minutes');
Configure::write('Cache._cake_core_.duration', '+2 minutes');
}
/*
* Set server timezone to UTC. You can change it to another timezone of your
* choice but using UTC makes time calculations / conversions easier.
*/
date_default_timezone_set('UTC');
/*
* Configure the mbstring extension to use the correct encoding.
*/
mb_internal_encoding(Configure::read('App.encoding'));
/*
* Set the default locale. This controls how dates, number and currency is
* formatted and sets the default language to use for translations.
*/
ini_set('intl.default_locale', Configure::read('App.defaultLocale'));
/*
* Register application error and exception handlers.
*/
$isCli = PHP_SAPI === 'cli';
if ($isCli) {
(new ConsoleErrorHandler(Configure::read('Error')))->register();
} else {
(new ErrorHandler(Configure::read('Error')))->register();
}
/*
* Include the CLI bootstrap overrides.
*/
if ($isCli) {
require __DIR__ . '/bootstrap_cli.php';
}
/*
* Set the full base URL.
* This URL is used as the base of all absolute links.
*
* If you define fullBaseUrl in your config file you can remove this.
*/
if (!Configure::read('App.fullBaseUrl')) {
$s = null;
if (env('HTTPS')) {
$s = 's';
}
$httpHost = env('HTTP_HOST');
if (isset($httpHost)) {
Configure::write('App.fullBaseUrl', 'http' . $s . '://' . $httpHost);
}
unset($httpHost, $s);
}
Cache::setConfig(Configure::consume('Cache'));
ConnectionManager::setConfig(Configure::consume('Datasources'));
//Email::setConfigTransport(Configure::consume('EmailTransport'));
TransportFactory::setConfig(Configure::consume('EmailTransport'));
Email::setConfig(Configure::consume('Email'));
Log::setConfig(Configure::consume('Log'));
//Security::salt(Configure::consume('Security.salt'));
Security::setSalt(Configure::consume('Security.salt'));
/*
* The default crypto extension in 3.0 is OpenSSL.
* If you are migrating from 2.x uncomment this code to
* use a more compatible Mcrypt based implementation
*/
//Security::engine(new \Cake\Utility\Crypto\Mcrypt());
/*
* Setup detectors for mobile and tablet.
*/
ServerRequest::addDetector('mobile', function ($request) {
$detector = new \Detection\MobileDetect();
return $detector->isMobile();
});
ServerRequest::addDetector('tablet', function ($request) {
$detector = new \Detection\MobileDetect();
return $detector->isTablet();
});
/*
* Enable immutable time objects in the ORM.
*
* You can enable default locale format parsing by adding calls
* to `useLocaleParser()`. This enables the automatic conversion of
* locale specific date formats. For details see
* @link http://book.cakephp.org/3.0/en/core-libraries/internationalization-and-localization.html#parsing-localized-datetime-data
*/
Type::build('time')
->useImmutable();
Type::build('date')
->useImmutable();
Type::build('datetime')
->useImmutable();
Type::build('timestamp')
->useImmutable();
/*
* Custom Inflector rules, can be set to correctly pluralize or singularize
* table, model, controller names or whatever other string is passed to the
* inflection functions.
*/
//Inflector::rules('plural', ['/^(inflect)or$/i' => '\1ables']);
//Inflector::rules('irregular', ['red' => 'redlings']);
//Inflector::rules('uninflected', ['dontinflectme']);
//Inflector::rules('transliteration', ['/å/' => 'aa']);
/*
* Plugins need to be loaded manually, you can either load them one by one or all of them in a single call
* Uncomment one of the lines below, as you need. make sure you read the documentation on Plugin to use more
* advanced ways of loading plugins
*
* Plugin::loadAll(); // Loads all plugins at once
* Plugin::load('Migrations'); //Loads a single plugin named Migrations
*
*/
/*
* Only try to load DebugKit in development mode
* Debug Kit should not be installed on a production system
*/
if (Configure::read('debug')) {
//Plugin::load('DebugKit', ['bootstrap' => true]);
Application::addPlugin('DebugKit', ['bootstrap' => true]);
}
Configure::load('lbry', 'default');

View file

@ -1,38 +0,0 @@
<?php
/**
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @since 3.0.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
use Cake\Core\Configure;
use Cake\Core\Exception\MissingPluginException;
use Cake\Core\Plugin;
/**
* Additional bootstrapping and configuration for CLI environments should
* be put here.
*/
// Set the fullBaseUrl to allow URLs to be generated in shell tasks.
// This is useful when sending email from shells.
//Configure::write('App.fullBaseUrl', php_uname('n'));
// Set logs to different files so they don't have permission conflicts.
Configure::write('Log.debug.file', 'cli-debug');
Configure::write('Log.error.file', 'cli-error');
try {
Plugin::load('Bake');
} catch (MissingPluginException $e) {
// Do not halt if the plugin is missing
}
Plugin::load('Migrations');

59
config/broadcasting.php Normal file
View file

@ -0,0 +1,59 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Broadcaster
|--------------------------------------------------------------------------
|
| This option controls the default broadcaster that will be used by the
| framework when an event needs to be broadcast. You may set this to
| any of the connections defined in the "connections" array below.
|
| Supported: "pusher", "redis", "log", "null"
|
*/
'default' => env('BROADCAST_DRIVER', 'null'),
/*
|--------------------------------------------------------------------------
| Broadcast Connections
|--------------------------------------------------------------------------
|
| Here you may define all of the broadcast connections that will be used
| to broadcast events to other systems or over websockets. Samples of
| each available type of connection are provided inside this array.
|
*/
'connections' => [
'pusher' => [
'driver' => 'pusher',
'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'),
'options' => [
'cluster' => env('PUSHER_APP_CLUSTER'),
'encrypted' => true,
],
],
'redis' => [
'driver' => 'redis',
'connection' => 'default',
],
'log' => [
'driver' => 'log',
],
'null' => [
'driver' => 'null',
],
],
];

102
config/cache.php Normal file
View file

@ -0,0 +1,102 @@
<?php
use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Cache Store
|--------------------------------------------------------------------------
|
| This option controls the default cache connection that gets used while
| using this caching library. This connection is used when another is
| not explicitly specified when executing a given caching function.
|
| Supported: "apc", "array", "database", "file",
| "memcached", "redis", "dynamodb"
|
*/
'default' => env('CACHE_DRIVER', 'file'),
/*
|--------------------------------------------------------------------------
| Cache Stores
|--------------------------------------------------------------------------
|
| Here you may define all of the cache "stores" for your application as
| well as their drivers. You may even define multiple stores for the
| same cache driver to group types of items stored in your caches.
|
*/
'stores' => [
'apc' => [
'driver' => 'apc',
],
'array' => [
'driver' => 'array',
],
'database' => [
'driver' => 'database',
'table' => 'cache',
'connection' => null,
],
'file' => [
'driver' => 'file',
'path' => storage_path('framework/cache/data'),
],
'memcached' => [
'driver' => 'memcached',
'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
'sasl' => [
env('MEMCACHED_USERNAME'),
env('MEMCACHED_PASSWORD'),
],
'options' => [
// Memcached::OPT_CONNECT_TIMEOUT => 2000,
],
'servers' => [
[
'host' => env('MEMCACHED_HOST', '127.0.0.1'),
'port' => env('MEMCACHED_PORT', 11211),
'weight' => 100,
],
],
],
'redis' => [
'driver' => 'redis',
'connection' => 'cache',
],
'dynamodb' => [
'driver' => 'dynamodb',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
],
],
/*
|--------------------------------------------------------------------------
| Cache Key Prefix
|--------------------------------------------------------------------------
|
| When utilizing a RAM based store such as APC or Memcached, there might
| be other applications utilizing the same cache. So, we'll specify a
| value to get prefixed to all our keys so we can avoid collisions.
|
*/
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'),
];

145
config/database.php Normal file
View file

@ -0,0 +1,145 @@
<?php
use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for all database work. Of course
| you may use many connections at once using the Database library.
|
*/
'default' => env('DB_CONNECTION', 'mysql'),
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
*/
'connections' => [
'sqlite' => [
'driver' => 'sqlite',
'url' => env('DATABASE_URL'),
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => '',
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
],
'mysql' => [
'driver' => 'mysql',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
'pgsql' => [
'driver' => 'pgsql',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
'schema' => 'public',
'sslmode' => 'prefer',
],
'sqlsrv' => [
'driver' => 'sqlsrv',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '1433'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
],
],
/*
|--------------------------------------------------------------------------
| Migration Repository Table
|--------------------------------------------------------------------------
|
| This table keeps track of all the migrations that have already run for
| your application. Using this information, we can determine which of
| the migrations on disk haven't actually been run in the database.
|
*/
'migrations' => 'migrations',
/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer body of commands than a typical key-value system
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
*/
'redis' => [
'client' => env('REDIS_CLIENT', 'predis'),
'options' => [
'cluster' => env('REDIS_CLUSTER', 'predis'),
'prefix' => Str::slug(env('APP_NAME', 'laravel'), '_').'_database_',
],
'default' => [
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => env('REDIS_DB', 0),
],
'cache' => [
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => env('REDIS_CACHE_DB', 1),
],
],
];

69
config/filesystems.php Normal file
View file

@ -0,0 +1,69 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Filesystem Disk
|--------------------------------------------------------------------------
|
| Here you may specify the default filesystem disk that should be used
| by the framework. The "local" disk, as well as a variety of cloud
| based disks are available to your application. Just store away!
|
*/
'default' => env('FILESYSTEM_DRIVER', 'local'),
/*
|--------------------------------------------------------------------------
| Default Cloud Filesystem Disk
|--------------------------------------------------------------------------
|
| Many applications store files both locally and in the cloud. For this
| reason, you may specify a default "cloud" driver here. This driver
| will be bound as the Cloud disk implementation in the container.
|
*/
'cloud' => env('FILESYSTEM_CLOUD', 's3'),
/*
|--------------------------------------------------------------------------
| Filesystem Disks
|--------------------------------------------------------------------------
|
| Here you may configure as many filesystem "disks" as you wish, and you
| may even configure multiple disks of the same driver. Defaults have
| been setup for each driver as an example of the required options.
|
| Supported Drivers: "local", "ftp", "sftp", "s3", "rackspace"
|
*/
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
],
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
],
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
],
],
];

52
config/hashing.php Normal file
View file

@ -0,0 +1,52 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Hash Driver
|--------------------------------------------------------------------------
|
| This option controls the default hash driver that will be used to hash
| passwords for your application. By default, the bcrypt algorithm is
| used; however, you remain free to modify this option if you wish.
|
| Supported: "bcrypt", "argon", "argon2id"
|
*/
'driver' => 'bcrypt',
/*
|--------------------------------------------------------------------------
| Bcrypt Options
|--------------------------------------------------------------------------
|
| Here you may specify the configuration options that should be used when
| passwords are hashed using the Bcrypt algorithm. This will allow you
| to control the amount of time it takes to hash the given password.
|
*/
'bcrypt' => [
'rounds' => env('BCRYPT_ROUNDS', 10),
],
/*
|--------------------------------------------------------------------------
| Argon Options
|--------------------------------------------------------------------------
|
| Here you may specify the configuration options that should be used when
| passwords are hashed using the Argon algorithm. These will allow you
| to control the amount of time it takes to hash the given password.
|
*/
'argon' => [
'memory' => 1024,
'threads' => 2,
'time' => 2,
],
];

View file

@ -1,11 +0,0 @@
<?php
return [
'Lbry' => [
'RpcUrl' => 'http://user:password@127.0.0.1:9245',
],
'Redis' => [
'Url' => 'tcp://127.0.0.1:6379',
]
];

94
config/logging.php Normal file
View file

@ -0,0 +1,94 @@
<?php
use Monolog\Handler\StreamHandler;
use Monolog\Handler\SyslogUdpHandler;
return [
/*
|--------------------------------------------------------------------------
| Default Log Channel
|--------------------------------------------------------------------------
|
| This option defines the default log channel that gets used when writing
| messages to the logs. The name specified in this option should match
| one of the channels defined in the "channels" configuration array.
|
*/
'default' => env('LOG_CHANNEL', 'stack'),
/*
|--------------------------------------------------------------------------
| Log Channels
|--------------------------------------------------------------------------
|
| Here you may configure the log channels for your application. Out of
| the box, Laravel uses the Monolog PHP logging library. This gives
| you a variety of powerful log handlers / formatters to utilize.
|
| Available Drivers: "single", "daily", "slack", "syslog",
| "errorlog", "monolog",
| "custom", "stack"
|
*/
'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => ['daily'],
'ignore_exceptions' => false,
],
'single' => [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
'level' => 'debug',
],
'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/laravel.log'),
'level' => 'debug',
'days' => 14,
],
'slack' => [
'driver' => 'slack',
'url' => env('LOG_SLACK_WEBHOOK_URL'),
'username' => 'Laravel Log',
'emoji' => ':boom:',
'level' => 'critical',
],
'papertrail' => [
'driver' => 'monolog',
'level' => 'debug',
'handler' => SyslogUdpHandler::class,
'handler_with' => [
'host' => env('PAPERTRAIL_URL'),
'port' => env('PAPERTRAIL_PORT'),
],
],
'stderr' => [
'driver' => 'monolog',
'handler' => StreamHandler::class,
'formatter' => env('LOG_STDERR_FORMATTER'),
'with' => [
'stream' => 'php://stderr',
],
],
'syslog' => [
'driver' => 'syslog',
'level' => 'debug',
],
'errorlog' => [
'driver' => 'errorlog',
'level' => 'debug',
],
],
];

136
config/mail.php Normal file
View file

@ -0,0 +1,136 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Mail Driver
|--------------------------------------------------------------------------
|
| Laravel supports both SMTP and PHP's "mail" function as drivers for the
| sending of e-mail. You may specify which one you're using throughout
| your application here. By default, Laravel is setup for SMTP mail.
|
| Supported: "smtp", "sendmail", "mailgun", "mandrill", "ses",
| "sparkpost", "postmark", "log", "array"
|
*/
'driver' => env('MAIL_DRIVER', 'smtp'),
/*
|--------------------------------------------------------------------------
| SMTP Host Address
|--------------------------------------------------------------------------
|
| Here you may provide the host address of the SMTP server used by your
| applications. A default option is provided that is compatible with
| the Mailgun mail service which will provide reliable deliveries.
|
*/
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
/*
|--------------------------------------------------------------------------
| SMTP Host Port
|--------------------------------------------------------------------------
|
| This is the SMTP port used by your application to deliver e-mails to
| users of the application. Like the host we have set this value to
| stay compatible with the Mailgun e-mail application by default.
|
*/
'port' => env('MAIL_PORT', 587),
/*
|--------------------------------------------------------------------------
| Global "From" Address
|--------------------------------------------------------------------------
|
| You may wish for all e-mails sent by your application to be sent from
| the same address. Here, you may specify a name and address that is
| used globally for all e-mails that are sent by your application.
|
*/
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
'name' => env('MAIL_FROM_NAME', 'Example'),
],
/*
|--------------------------------------------------------------------------
| E-Mail Encryption Protocol
|--------------------------------------------------------------------------
|
| Here you may specify the encryption protocol that should be used when
| the application send e-mail messages. A sensible default using the
| transport layer security protocol should provide great security.
|
*/
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
/*
|--------------------------------------------------------------------------
| SMTP Server Username
|--------------------------------------------------------------------------
|
| If your SMTP server requires a username for authentication, you should
| set it here. This will get used to authenticate with your server on
| connection. You may also set the "password" value below this one.
|
*/
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
/*
|--------------------------------------------------------------------------
| Sendmail System Path
|--------------------------------------------------------------------------
|
| When using the "sendmail" driver to send e-mails, we will need to know
| the path to where Sendmail lives on this server. A default path has
| been provided here, which will work well on most of your systems.
|
*/
'sendmail' => '/usr/sbin/sendmail -bs',
/*
|--------------------------------------------------------------------------
| Markdown Mail Settings
|--------------------------------------------------------------------------
|
| If you are using Markdown based email rendering, you may configure your
| theme and component paths here, allowing you to customize the design
| of the emails. Or, you may simply stick with the Laravel defaults!
|
*/
'markdown' => [
'theme' => 'default',
'paths' => [
resource_path('views/vendor/mail'),
],
],
/*
|--------------------------------------------------------------------------
| Log Channel
|--------------------------------------------------------------------------
|
| If you are using the "log" driver, you may specify the logging channel
| if you prefer to keep mail messages separate from other log entries
| for simpler reading. Otherwise, the default channel will be used.
|
*/
'log_channel' => env('MAIL_LOG_CHANNEL'),
];

View file

@ -1,85 +0,0 @@
<?php
/**
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @since 3.0.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**
* Use the DS to separate the directories in other defines
*/
if (!defined('DS')) {
define('DS', DIRECTORY_SEPARATOR);
}
/**
* These defines should only be edited if you have cake installed in
* a directory layout other than the way it is distributed.
* When using custom settings be sure to use the DS and do not add a trailing DS.
*/
/**
* The full path to the directory which holds "src", WITHOUT a trailing DS.
*/
define('ROOT', dirname(__DIR__));
/**
* The actual directory name for the application directory. Normally
* named 'src'.
*/
define('APP_DIR', 'src');
/**
* Path to the application's directory.
*/
define('APP', ROOT . DS . APP_DIR . DS);
/**
* Path to the config directory.
*/
define('CONFIG', ROOT . DS . 'config' . DS);
/**
* File path to the webroot directory.
*/
define('WWW_ROOT', ROOT . DS . 'webroot' . DS);
/**
* Path to the tests directory.
*/
define('TESTS', ROOT . DS . 'tests' . DS);
/**
* Path to the temporary files directory.
*/
define('TMP', ROOT . DS . 'tmp' . DS);
/**
* Path to the logs directory.
*/
define('LOGS', ROOT . DS . 'logs' . DS);
/**
* Path to the cache files directory. It can be shared between hosts in a multi-server setup.
*/
define('CACHE', TMP . 'cache' . DS);
/**
* The absolute path to the "cake" directory, WITHOUT a trailing DS.
*
* CakePHP should always be installed with composer, so look there.
*/
define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'vendor' . DS . 'cakephp' . DS . 'cakephp');
/**
* Path to the cake directory.
*/
define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
define('CAKE', CORE_PATH . 'src' . DS);

87
config/queue.php Normal file
View file

@ -0,0 +1,87 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Queue Connection Name
|--------------------------------------------------------------------------
|
| Laravel's queue API supports an assortment of back-ends via a single
| API, giving you convenient access to each back-end using the same
| syntax for every one. Here you may define a default connection.
|
*/
'default' => env('QUEUE_CONNECTION', 'sync'),
/*
|--------------------------------------------------------------------------
| Queue Connections
|--------------------------------------------------------------------------
|
| Here you may configure the connection information for each server that
| is used by your application. A default configuration has been added
| for each back-end shipped with Laravel. You are free to add more.
|
| Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
|
*/
'connections' => [
'sync' => [
'driver' => 'sync',
],
'database' => [
'driver' => 'database',
'table' => 'jobs',
'queue' => 'default',
'retry_after' => 90,
],
'beanstalkd' => [
'driver' => 'beanstalkd',
'host' => 'localhost',
'queue' => 'default',
'retry_after' => 90,
'block_for' => 0,
],
'sqs' => [
'driver' => 'sqs',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
'queue' => env('SQS_QUEUE', 'your-queue-name'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
],
'redis' => [
'driver' => 'redis',
'connection' => 'default',
'queue' => env('REDIS_QUEUE', 'default'),
'retry_after' => 90,
'block_for' => null,
],
],
/*
|--------------------------------------------------------------------------
| Failed Queue Jobs
|--------------------------------------------------------------------------
|
| These options configure the behavior of failed queue job logging so you
| can control which database and table are used to store the jobs that
| have failed. You may change them to any database / table you wish.
|
*/
'failed' => [
'database' => env('DB_CONNECTION', 'mysql'),
'table' => 'failed_jobs',
],
];

View file

@ -1,74 +0,0 @@
<?php
/**
* Routes configuration
*
* In this file, you set up routes to your controllers and their actions.
* Routes are very important mechanism that allows you to freely connect
* different URLs to chosen controllers and their actions (functions).
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
use Cake\Core\Plugin;
use Cake\Routing\RouteBuilder;
use Cake\Routing\Router;
use Cake\Routing\Route\DashedRoute;
/**
* The default class to use for all routes
*
* The following route classes are supplied with CakePHP and are appropriate
* to set as the default:
*
* - Route
* - InflectedRoute
* - DashedRoute
*
* If no call is made to `Router::defaultRouteClass()`, the class used is
* `Route` (`Cake\Routing\Route\Route`)
*
* Note that `Route` does not do any inflections on URLs which will result in
* inconsistently cased URLs when used with `:plugin`, `:controller` and
* `:action` markers.
*
*/
Router::defaultRouteClass(DashedRoute::class);
Router::scope('/', function (RouteBuilder $routes) {
$routes->connect('/', ['controller' => 'Main', 'action' => 'index']);
$routes->connect('/address/*', ['controller' => 'Main', 'action' => 'address']);
$routes->connect('/blocks/*', ['controller' => 'Main', 'action' => 'blocks']);
$routes->connect('/claims/*', ['controller' => 'Main', 'action' => 'claims']);
$routes->connect('/find', ['controller' => 'Main', 'action' => 'find']);
$routes->connect('/realtime', ['controller' => 'Main', 'action' => 'realtime']);
$routes->connect('/stats', ['controller' => 'Main', 'action' => 'stats']);
$routes->connect('/tx/*', ['controller' => 'Main', 'action' => 'tx']);
$routes->connect('/qr/*', ['controller' => 'Main', 'action' => 'qr']);
$routes->connect('/*', ['controller' => 'Main', 'action' => 'index']);
$routes->connect('/api/v1/address/:addr/tag', ['controller' => 'Main', 'action' => 'apiaddrtag'], ['addr' => '[A-Za-z0-9,]+', 'pass' => ['addr']]);
$routes->connect('/api/v1/address/:addr/utxo', ['controller' => 'Main', 'action' => 'apiaddrutxo'], ['addr' => '[A-Za-z0-9,]+', 'pass' => ['addr']]);
$routes->connect('/api/v1/address/:addr/balance', ['controller' => 'Main', 'action' => 'apiaddrbalance'], ['addr' => '[A-Za-z0-9]+', 'pass' => ['addr']]);
$routes->connect('/api/v1/address/:addr/transactions', ['controller' => 'Main', 'action' => 'apiaddrtx'], ['addr' => '[A-Za-z0-9,]+', 'pass' => ['addr']]);
$routes->connect('/api/v1/charts/blocksize/:period', ['controller' => 'Main', 'action' => 'apiblocksize'], ['period' => '[012346789dhy]+', 'pass' => ['period']]);
$routes->connect('/api/v1/realtime/blocks', ['controller' => 'Main', 'action' => 'apirealtimeblocks']);
$routes->connect('/api/v1/realtime/tx', ['controller' => 'Main', 'action' => 'apirealtimetx']);
$routes->connect('/api/v1/recentblocks', ['controller' => 'Main', 'action' => 'apirecentblocks']);
$routes->connect('/api/v1/status', ['controller' => 'Main', 'action' => 'apistatus']);
$routes->connect('/api/v1/supply', ['controller' => 'Main', 'action' => 'apiutxosupply']);
//$routes->connect('/api/v1/recenttxs', ['controller' => 'Main', 'action' => 'apirecenttxs']);
$routes->connect('/api/v1/claims/browse', ['controller' => 'Claims', 'action' => 'apibrowse']);
//$routes->fallbacks(DashedRoute::class);
});

View file

@ -1,18 +0,0 @@
# Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
#
# Licensed under The MIT License
# For full copyright and license information, please see the LICENSE.txt
# Redistributions of files must retain the above copyright notice.
# MIT License (http://www.opensource.org/licenses/mit-license.php)
CREATE TABLE i18n (
id int NOT NULL auto_increment,
locale varchar(6) NOT NULL,
model varchar(255) NOT NULL,
foreign_key int(10) NOT NULL,
field varchar(255) NOT NULL,
content text,
PRIMARY KEY (id),
UNIQUE INDEX I18N_LOCALE_FIELD(locale, model, foreign_key, field),
INDEX I18N_FIELD(model, foreign_key, field)
);

View file

@ -1,13 +0,0 @@
# Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
#
# Licensed under The MIT License
# For full copyright and license information, please see the LICENSE.txt
# Redistributions of files must retain the above copyright notice.
# MIT License (http://www.opensource.org/licenses/mit-license.php)
CREATE TABLE sessions (
id char(40) NOT NULL,
data text,
expires INT(11) NOT NULL,
PRIMARY KEY (id)
);

47
config/services.php Normal file
View file

@ -0,0 +1,47 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Third Party Services
|--------------------------------------------------------------------------
|
| This file is for storing the credentials for third party services such
| as Stripe, Mailgun, SparkPost and others. This file provides a sane
| default location for this type of information, allowing packages
| to have a conventional place to find your various credentials.
|
*/
'mailgun' => [
'domain' => env('MAILGUN_DOMAIN'),
'secret' => env('MAILGUN_SECRET'),
'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
],
'postmark' => [
'token' => env('POSTMARK_TOKEN'),
],
'ses' => [
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
],
'sparkpost' => [
'secret' => env('SPARKPOST_SECRET'),
],
'stripe' => [
'model' => App\User::class,
'key' => env('STRIPE_KEY'),
'secret' => env('STRIPE_SECRET'),
'webhook' => [
'secret' => env('STRIPE_WEBHOOK_SECRET'),
'tolerance' => env('STRIPE_WEBHOOK_TOLERANCE', 300),
],
],
];

199
config/session.php Normal file
View file

@ -0,0 +1,199 @@
<?php
use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Session Driver
|--------------------------------------------------------------------------
|
| This option controls the default session "driver" that will be used on
| requests. By default, we will use the lightweight native driver but
| you may specify any of the other wonderful drivers provided here.
|
| Supported: "file", "cookie", "database", "apc",
| "memcached", "redis", "dynamodb", "array"
|
*/
'driver' => env('SESSION_DRIVER', 'file'),
/*
|--------------------------------------------------------------------------
| Session Lifetime
|--------------------------------------------------------------------------
|
| Here you may specify the number of minutes that you wish the session
| to be allowed to remain idle before it expires. If you want them
| to immediately expire on the browser closing, set that option.
|
*/
'lifetime' => env('SESSION_LIFETIME', 120),
'expire_on_close' => false,
/*
|--------------------------------------------------------------------------
| Session Encryption
|--------------------------------------------------------------------------
|
| This option allows you to easily specify that all of your session data
| should be encrypted before it is stored. All encryption will be run
| automatically by Laravel and you can use the Session like normal.
|
*/
'encrypt' => false,
/*
|--------------------------------------------------------------------------
| Session File Location
|--------------------------------------------------------------------------
|
| When using the native session driver, we need a location where session
| files may be stored. A default has been set for you but a different
| location may be specified. This is only needed for file sessions.
|
*/
'files' => storage_path('framework/sessions'),
/*
|--------------------------------------------------------------------------
| Session Database Connection
|--------------------------------------------------------------------------
|
| When using the "database" or "redis" session drivers, you may specify a
| connection that should be used to manage these sessions. This should
| correspond to a connection in your database configuration options.
|
*/
'connection' => env('SESSION_CONNECTION', null),
/*
|--------------------------------------------------------------------------
| Session Database Table
|--------------------------------------------------------------------------
|
| When using the "database" session driver, you may specify the table we
| should use to manage the sessions. Of course, a sensible default is
| provided for you; however, you are free to change this as needed.
|
*/
'table' => 'sessions',
/*
|--------------------------------------------------------------------------
| Session Cache Store
|--------------------------------------------------------------------------
|
| When using the "apc", "memcached", or "dynamodb" session drivers you may
| list a cache store that should be used for these sessions. This value
| must match with one of the application's configured cache "stores".
|
*/
'store' => env('SESSION_STORE', null),
/*
|--------------------------------------------------------------------------
| Session Sweeping Lottery
|--------------------------------------------------------------------------
|
| Some session drivers must manually sweep their storage location to get
| rid of old sessions from storage. Here are the chances that it will
| happen on a given request. By default, the odds are 2 out of 100.
|
*/
'lottery' => [2, 100],
/*
|--------------------------------------------------------------------------
| Session Cookie Name
|--------------------------------------------------------------------------
|
| Here you may change the name of the cookie used to identify a session
| instance by ID. The name specified here will get used every time a
| new session cookie is created by the framework for every driver.
|
*/
'cookie' => env(
'SESSION_COOKIE',
Str::slug(env('APP_NAME', 'laravel'), '_').'_session'
),
/*
|--------------------------------------------------------------------------
| Session Cookie Path
|--------------------------------------------------------------------------
|
| The session cookie path determines the path for which the cookie will
| be regarded as available. Typically, this will be the root path of
| your application but you are free to change this when necessary.
|
*/
'path' => '/',
/*
|--------------------------------------------------------------------------
| Session Cookie Domain
|--------------------------------------------------------------------------
|
| Here you may change the domain of the cookie used to identify a session
| in your application. This will determine which domains the cookie is
| available to in your application. A sensible default has been set.
|
*/
'domain' => env('SESSION_DOMAIN', null),
/*
|--------------------------------------------------------------------------
| HTTPS Only Cookies
|--------------------------------------------------------------------------
|
| By setting this option to true, session cookies will only be sent back
| to the server if the browser has a HTTPS connection. This will keep
| the cookie from being sent to you if it can not be done securely.
|
*/
'secure' => env('SESSION_SECURE_COOKIE', false),
/*
|--------------------------------------------------------------------------
| HTTP Access Only
|--------------------------------------------------------------------------
|
| Setting this value to true will prevent JavaScript from accessing the
| value of the cookie and the cookie will only be accessible through
| the HTTP protocol. You are free to modify this option if needed.
|
*/
'http_only' => true,
/*
|--------------------------------------------------------------------------
| Same-Site Cookies
|--------------------------------------------------------------------------
|
| This option determines how your cookies behave when cross-site requests
| take place, and can be used to mitigate CSRF attacks. By default, we
| do not enable this as other CSRF protection services are in place.
|
| Supported: "lax", "strict"
|
*/
'same_site' => null,
];

36
config/view.php Normal file
View file

@ -0,0 +1,36 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| View Storage Paths
|--------------------------------------------------------------------------
|
| Most templating systems load templates from disk. Here you may specify
| an array of paths that should be checked for your views. Of course
| the usual Laravel view path has already been registered for you.
|
*/
'paths' => [
resource_path('views'),
],
/*
|--------------------------------------------------------------------------
| Compiled View Path
|--------------------------------------------------------------------------
|
| This option determines where all the compiled Blade templates will be
| stored for your application. Typically, this is within the storage
| directory. However, as usual, you are free to change this value.
|
*/
'compiled' => env(
'VIEW_COMPILED_PATH',
realpath(storage_path('framework/views'))
),
];

View file

@ -1,4 +0,0 @@
#!/bin/sh
cd /home/lbry/explorer.lbry.io
bin/cake block addrtxamounts

View file

@ -1,7 +0,0 @@
#!/bin/sh
cd /home/lbry/explorer.lbry.io
bin/cake block parsenewblocks
rm tmp/lock/parsenewblocks 2>/dev/null
bin/cake block parsetxs
rm tmp/lock/parsetxs 2>/dev/null

View file

@ -1,4 +0,0 @@
#!/bin/sh
cd /home/lbry/explorer.lbry.io
bin/cake block parsetxs

View file

@ -1,4 +0,0 @@
#!/bin/sh
cd /home/lbry/explorer.lbry.io
bin/cake block buildclaimindex

View file

@ -1,4 +0,0 @@
#!/bin/sh
cd /home/lbry/explorer.lbry.io
bin/cake block fixzerooutputs

Some files were not shown because too many files have changed in this diff Show more