├── .coveralls.yml ├── .eslintrc ├── .gitignore ├── .scrutinizer.yml ├── .stylelintrc ├── .travis.yml ├── LICENSE.md ├── README.md ├── application ├── _functions.php ├── _loader.php ├── configs │ ├── default │ │ ├── auth.php │ │ ├── cache.php │ │ ├── db.php │ │ ├── debug.php │ │ ├── layout.php │ │ ├── logger.php │ │ ├── mailer.php │ │ ├── php.php │ │ ├── registry.php │ │ ├── request.php │ │ ├── router.php │ │ ├── session.php │ │ ├── swagger.php │ │ └── translator.php │ ├── dev │ │ ├── debug.php │ │ └── logger.php │ ├── phinx.php │ ├── production │ │ ├── debug.php │ │ └── php.php │ └── testing │ │ ├── cache.php │ │ └── debug.php ├── layouts │ ├── dashboard.phtml │ ├── helpers │ │ ├── ProfileLinkByEmail.php │ │ └── Username.php │ ├── index.phtml │ ├── partial │ │ ├── breadcrumbs-dashboard.phtml │ │ ├── breadcrumbs.phtml │ │ ├── crud │ │ │ └── errors.phtml │ │ ├── footer-bar.phtml │ │ ├── footer.phtml │ │ ├── grid │ │ │ ├── empty-rows.phtml │ │ │ ├── filter-search-advanced.phtml │ │ │ ├── filter-search.phtml │ │ │ ├── limit.phtml │ │ │ ├── pagination.phtml │ │ │ └── total.phtml │ │ ├── header.phtml │ │ ├── navbar.phtml │ │ └── sidebar.phtml │ ├── small.phtml │ └── welcome.phtml ├── library │ ├── Application │ │ ├── Bootstrap.php │ │ ├── CliBootstrap.php │ │ └── Exception.php │ └── Image │ │ ├── Exception.php │ │ ├── Gd.php │ │ └── Thumbnail.php ├── models │ ├── Auth │ │ ├── Model.php │ │ ├── Provider │ │ │ ├── AbstractProvider.php │ │ │ ├── AbstractToken.php │ │ │ ├── Cookie.php │ │ │ ├── Equals.php │ │ │ └── Token.php │ │ ├── Row.php │ │ └── Table.php │ ├── Events │ │ ├── Crud.php │ │ ├── Grid.php │ │ ├── Row.php │ │ ├── Service.php │ │ └── Table.php │ ├── Pages │ │ ├── Crud.php │ │ ├── Grid.php │ │ ├── Row.php │ │ └── Table.php │ ├── Privileges │ │ ├── Row.php │ │ └── Table.php │ ├── Roles │ │ ├── Crud.php │ │ ├── Row.php │ │ └── Table.php │ ├── Users │ │ ├── Crud.php │ │ ├── Grid.php │ │ ├── Mail.php │ │ ├── Row.php │ │ └── Table.php │ ├── UsersActions │ │ ├── Row.php │ │ └── Table.php │ └── UsersRoles │ │ ├── Row.php │ │ └── Table.php └── modules │ ├── acl │ ├── controllers │ │ ├── index.php │ │ ├── roles.php │ │ ├── save.php │ │ └── user.php │ └── views │ │ ├── index.phtml │ │ ├── roles.phtml │ │ └── user.phtml │ ├── api │ └── controllers │ │ ├── events.php │ │ ├── login.php │ │ ├── pages.php │ │ ├── profile.php │ │ └── users.php │ ├── cache │ ├── controllers │ │ ├── clean.php │ │ ├── flush.php │ │ └── widgets │ │ │ └── index.php │ └── views │ │ └── widgets │ │ └── index.phtml │ ├── dashboard │ ├── controllers │ │ └── index.php │ └── views │ │ └── index.phtml │ ├── error │ ├── controllers │ │ └── index.php │ └── views │ │ └── index.phtml │ ├── events │ ├── controllers │ │ ├── crud.php │ │ └── grid.php │ └── views │ │ ├── crud.phtml │ │ └── grid.phtml │ ├── index │ ├── controllers │ │ └── index.php │ └── views │ │ └── index.phtml │ ├── logs │ ├── controllers │ │ ├── download.php │ │ ├── grid.php │ │ └── log.php │ └── views │ │ ├── grid.phtml │ │ └── log.phtml │ ├── pages │ ├── controllers │ │ ├── crud.php │ │ ├── grid.php │ │ └── index.php │ └── views │ │ ├── crud.phtml │ │ ├── grid.phtml │ │ └── index.phtml │ ├── system │ ├── controllers │ │ ├── api.php │ │ ├── bookmarks.php │ │ ├── crud │ │ │ ├── delete.php │ │ │ ├── get.php │ │ │ ├── post.php │ │ │ └── put.php │ │ ├── index.php │ │ ├── info.php │ │ ├── phpinfo.php │ │ ├── rest │ │ │ ├── delete.php │ │ │ ├── get.php │ │ │ ├── head.php │ │ │ ├── options.php │ │ │ ├── post.php │ │ │ └── put.php │ │ ├── routers.php │ │ └── widgets │ │ │ └── load.php │ └── views │ │ ├── bookmarks.phtml │ │ ├── index.phtml │ │ ├── info.phtml │ │ ├── routers.phtml │ │ └── widgets │ │ └── load.phtml │ └── users │ ├── controllers │ ├── activation.php │ ├── change-email.php │ ├── change-password.php │ ├── crud.php │ ├── crud │ │ └── post.php │ ├── grid.php │ ├── mail │ │ └── template.php │ ├── profile.php │ ├── recovery-reset.php │ ├── recovery.php │ ├── search.php │ ├── signin.php │ ├── signout.php │ ├── signup.php │ └── widgets │ │ ├── card.php │ │ ├── info.php │ │ └── stats.php │ └── views │ ├── change-email.phtml │ ├── change-password.phtml │ ├── crud.phtml │ ├── grid.phtml │ ├── mail │ ├── change-email.phtml │ ├── recovery.phtml │ └── registration.phtml │ ├── partial │ └── card-header.phtml │ ├── profile.phtml │ ├── recovery-reset.phtml │ ├── recovery.phtml │ ├── signin.phtml │ ├── signup.phtml │ └── widgets │ ├── card.phtml │ ├── info.phtml │ └── stats.phtml ├── bin └── install.php ├── codeception.dist.yml ├── composer.json ├── data ├── cache │ └── .keep ├── locale │ ├── default.pot │ └── ru_RU │ │ └── LC_MESSAGES │ │ ├── messages.mo │ │ └── messages.po ├── logs │ └── .keep ├── migrations │ ├── 20170316120432_users.php │ ├── 20170316120433_users_data.php │ ├── 20170316122256_acl.php │ ├── 20170316122257_acl_data.php │ ├── 20170316134406_pages.php │ ├── 20170316134407_pages_data.php │ ├── 20211213161141_events.php │ ├── 20211213184006_events_permissions.php │ └── 20211213184106_logs_permissions.php ├── seeds │ └── .keep ├── sessions │ └── .keep ├── styles │ └── .keep └── uploads │ └── .keep ├── docker ├── .gitignore ├── README.md ├── bin │ ├── cli │ └── setup_permissions ├── docker-compose.yml.dist ├── mysql │ ├── Dockerfile │ └── db.env ├── nginx │ ├── Dockerfile │ └── default.conf.template └── php │ ├── Dockerfile │ ├── bluz.env │ ├── xdebug.env │ └── xdebug.ini ├── docs ├── db.png └── db.schemaxml ├── public ├── .htaccess.dev.sample ├── .htaccess.sample ├── api │ └── .keep ├── crossdomain.xml ├── css │ ├── dashboard.css │ ├── print.css │ └── styles.css ├── error.php ├── fonts │ └── .keep ├── img │ ├── apple-touch-icon.png │ ├── browserconfig.xml │ ├── favicon.ico │ ├── icon-150x150.png │ ├── icon-192x192.png │ ├── icon-512x512.png │ ├── icon.svg │ ├── loading.gif │ └── manifest.json ├── index.php ├── js │ ├── bluz.ajax.js │ ├── bluz.autocomplete.js │ ├── bluz.console.js │ ├── bluz.form.js │ ├── bluz.grid.js │ ├── bluz.js │ ├── bluz.modal.js │ ├── bluz.notify.js │ ├── bluz.storage.js │ ├── bluz.tools.js │ └── bluz.tooltip.js ├── routing.php ├── uploads │ └── .keep └── vendor │ └── .keep └── tests ├── _bootstrap.php ├── _data └── dump.sql ├── _support ├── AcceptanceTester.php ├── ApiTester.php ├── FunctionalTester.php ├── Helper │ ├── Acceptance.php │ ├── Api.php │ ├── Functional.php │ └── Unit.php ├── UnitTester.php └── _generated │ ├── AcceptanceTesterActions.php │ ├── ApiTesterActions.php │ ├── FunctionalTesterActions.php │ └── UnitTesterActions.php ├── acceptance.suite.yml ├── acceptance ├── _bootstrap.php ├── acl │ └── OpenAclDashboardCept.php ├── cache │ ├── RunCacheCleanCept.php │ └── RunCacheFlushCept.php ├── dashboard │ ├── OpenDashboardAsAdminCept.php │ ├── OpenDashboardAsGuestCept.php │ └── OpenDashboardAsMemberCept.php ├── index │ └── OpenHomepageCept.php ├── pages │ ├── OpenAboutPageCept.php │ ├── OpenLegalPageCept.php │ └── OpenTermsPageCept.php └── users │ ├── OpenAdministratorProfileAsAdminCept.php │ ├── OpenAdministratorProfileAsMemberCept.php │ ├── OpenMemberProfileAsAdminCept.php │ ├── OpenMemberProfileAsGuestCept.php │ ├── OpenMemberProfileAsMemberCept.php │ ├── OpenSystemProfileAsAdminCept.php │ └── SignInCept.php ├── api.suite.yml ├── api ├── _bootstrap.php └── pages │ ├── PagesGetOneCept.php │ └── PagesGetSetCept.php ├── files └── test.jpg ├── functional.suite.yml ├── functional └── _bootstrap.php ├── postman ├── collection.json └── environment.json ├── src ├── ControllerTestCase.php ├── Fixtures │ └── Users │ │ ├── UserFixtureContainer.php │ │ └── UserHasPermission.php ├── SkeletonTestCase.php └── Tools │ └── Cleaner.php ├── unit.suite.yml └── unit ├── _bootstrap.php ├── models └── .keep └── modules ├── acl └── controllers │ ├── IndexTest.php │ ├── RolesTest.php │ ├── SaveTest.php │ └── UserTest.php ├── api └── controllers │ └── ApiTest.php ├── cache └── controllers │ ├── CleanTest.php │ └── FlushTest.php ├── dashboard └── controllers │ └── IndexTest.php ├── error └── controllers │ └── IndexTest.php ├── index └── controllers │ └── IndexTest.php ├── pages └── controllers │ ├── CrudTest.php │ ├── GridTest.php │ └── IndexTest.php ├── system └── controllers │ ├── BookmarksTest.php │ ├── IndexTest.php │ ├── InfoTest.php │ └── RoutersTest.php └── users └── controller ├── CrudTest.php ├── GridTest.php ├── ProfileTest.php ├── SigninTest.php └── SignoutTest.php /.coveralls.yml: -------------------------------------------------------------------------------- 1 | service_name: travis-ci 2 | coverage_clover: .reports/clover.xml 3 | json_path: .reports/coveralls-upload.json 4 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "airbnb-es5" 3 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Local environment 2 | .DS_Store 3 | .idea 4 | # Don't commit lock file for skeleton 5 | # But commit it for any other project 6 | composer.lock 7 | # Tools 8 | composer.phar 9 | codecept.phar 10 | codeception.yml 11 | # Dev environment configuration 12 | /application/configs/dev 13 | # Artifacts 14 | /data/cache 15 | /data/logs 16 | /data/queues 17 | /data/sessions 18 | /data/uploads 19 | # Environment configuration 20 | /public/.htaccess 21 | # Vendors 22 | /public/vendor 23 | /vendor -------------------------------------------------------------------------------- /.stylelintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "stylelint-config-standard" 3 | } -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | php: 3 | - 7.4 4 | - 8.0 5 | - 8.1 6 | matrix: 7 | allow_failures: 8 | - php: 8.0 9 | - php: 8.1 10 | env: 11 | global: 12 | - XDEBUG_MODE=coverage 13 | services: 14 | - mysql 15 | before_install: 16 | - nvm install stable 17 | - npm update -g npm 18 | install: 19 | # Newman 20 | - npm install -g newman 21 | # Composer 22 | - composer self-update 23 | - COMPOSER_ROOT_VERSION=dev-master composer install 24 | # Scrutinizer 25 | - wget https://scrutinizer-ci.com/ocular.phar 26 | before_script: 27 | # Database 28 | - mysql -e 'CREATE DATABASE bluz;' 29 | # Migrations 30 | - php vendor/bin/bluzman db:migrate -e testing 31 | - php vendor/bin/bluzman db:seed:run -e testing 32 | # Make directory for reports 33 | - mkdir .reports 34 | script: 35 | # Check code style 36 | - php vendor/bin/phpcs ./application --standard=PSR12 --encoding=utf-8 --ignore=./application/_loader.php 37 | # Run built-in web-server 38 | - php vendor/bin/bluzman server:start --host 127.0.0.1 -b -e testing 39 | # Run CodeCeption tests 40 | - php vendor/bin/codecept run --coverage --coverage-xml -v 41 | # Run postman/newman tests 42 | - newman run tests/postman/collection.json -e tests/postman/environment.json 43 | after_success: 44 | - php vendor/bin/coveralls -v 45 | - php ocular.phar code-coverage:upload --format=php-clover tests/_output/coverage.xml 46 | notifications: 47 | email: false 48 | webhooks: 49 | urls: 50 | - https://webhooks.gitter.im/e/b84e6a583d6eea87d0eb 51 | - https://webhooks.gitter.im/e/c4fa557829c5bd992271 52 | on_success: change # options: [always|never|change] default: always 53 | on_failure: always # options: [always|never|change] default: always 54 | on_start: false # default: false 55 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) by Bluz PHP Team 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /application/_functions.php: -------------------------------------------------------------------------------- 1 | getFile() . ':' . $exception->getLine() 24 | . ': ' 25 | . trim($exception->getMessage()) 26 | . "\n"; 27 | 28 | // write log 29 | file_put_contents( 30 | PATH_DATA . '/logs/' . date('Y-m-d') . '.log', 31 | $message, 32 | FILE_APPEND | LOCK_EX 33 | ); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /application/_loader.php: -------------------------------------------------------------------------------- 1 | function ($password) { 12 | return password_hash($password, PASSWORD_DEFAULT); 13 | }, 14 | 'verify' => function ($password, $hash) { 15 | return password_verify($password, $hash); 16 | }, 17 | 'cookie' => [ 18 | 'ttl' => 86400 19 | ], 20 | 'token' => [ 21 | 'ttl' => 3600 22 | ], 23 | // hybrid auth 24 | 'hybrid' => [ 25 | 'providers' => [ 26 | 'facebook' => [ 27 | 'enabled' => false, 28 | 'keys' => [ // 'id' is your facebook application id 29 | 'id' => '', 30 | 'secret' => '' 31 | ], 32 | 'scope' => 'email, public_profile', // optional 33 | ], 34 | 'google' => [ 35 | 'enabled' => false, 36 | 'keys' => [ // 'id' is your google client id 37 | 'id' => '', 38 | 'secret' => '' 39 | ], 40 | ], 41 | 'twitter' => [ 42 | 'enabled' => false, 43 | 'keys' => [ // OAuth1 uses 'key' not 'id' 44 | 'key' => '', 45 | 'secret' => '' 46 | ] 47 | ] 48 | ] 49 | ] 50 | ]; 51 | -------------------------------------------------------------------------------- /application/configs/default/cache.php: -------------------------------------------------------------------------------- 1 | true, 12 | 'adapter' => 'filesystem', 13 | 'pools' => [ 14 | /** 15 | * @link https://symfony.com/doc/current/components/cache/adapters/apcu_adapter.html 16 | */ 17 | 'apcu' => function () { 18 | return new Symfony\Component\Cache\Adapter\ApcuAdapter('bluz'); 19 | }, 20 | /** 21 | * @link https://symfony.com/doc/current/components/cache/adapters/filesystem_adapter.html 22 | */ 23 | 'filesystem' => function () { 24 | return new Symfony\Component\Cache\Adapter\FilesystemTagAwareAdapter('bluz', 0, PATH_DATA . '/cache'); 25 | }, 26 | /** 27 | * @link https://symfony.com/doc/current/components/cache/adapters/redis_adapter.html 28 | * @link https://github.com/nrk/predis/wiki/Connection-Parameters 29 | * @link https://github.com/nrk/predis/wiki/Client-Options 30 | */ 31 | 'predis' => function () { 32 | $client = new \Predis\Client('tcp:/127.0.0.1:6379'); 33 | return new Symfony\Component\Cache\Adapter\RedisTagAwareAdapter($client, 'bluz'); 34 | } 35 | ] 36 | ]; 37 | -------------------------------------------------------------------------------- /application/configs/default/db.php: -------------------------------------------------------------------------------- 1 | [ 12 | 'type' => 'mysql', 13 | 'host' => getenv('MYSQL_HOST') ?: 'localhost', 14 | 'name' => getenv('MYSQL_DATABASE') ?: 'bluz', 15 | 'user' => getenv('MYSQL_USER') ?: 'root', 16 | 'pass' => getenv('MYSQL_PASSWORD') ?: '', 17 | 'options' => [ 18 | \PDO::ATTR_PERSISTENT => true, 19 | \PDO::MYSQL_ATTR_INIT_COMMAND => 'SET CHARACTER SET utf8' 20 | ] 21 | ] 22 | ]; 23 | -------------------------------------------------------------------------------- /application/configs/default/debug.php: -------------------------------------------------------------------------------- 1 | PATH_APPLICATION . '/layouts', 12 | 'template' => 'index.phtml', 13 | 'helpersPath' => [PATH_APPLICATION . '/layouts/helpers'] 14 | ]; 15 | -------------------------------------------------------------------------------- /application/configs/default/logger.php: -------------------------------------------------------------------------------- 1 | 'Bluz - %s', 13 | 'from' => [ 14 | 'email' => 'no-reply@example.com', 15 | 'name' => 'Bluz' 16 | ], 17 | 'settings' => [ 18 | 'CharSet' => 'UTF-8' 19 | ], 20 | ]; 21 | -------------------------------------------------------------------------------- /application/configs/default/php.php: -------------------------------------------------------------------------------- 1 | '/', 12 | ]; 13 | -------------------------------------------------------------------------------- /application/configs/default/session.php: -------------------------------------------------------------------------------- 1 | 'files', 12 | 'settings' => [ 13 | 'cache' => [], 14 | 'files' => [ 15 | 'save_path' => PATH_DATA . '/sessions' 16 | ], 17 | 'redis' => [ 18 | 'host' => 'localhost', 19 | 'port' => 6379, 20 | 'timeout' => 0, 21 | 'persistence' => false 22 | ] 23 | ] 24 | ]; 25 | -------------------------------------------------------------------------------- /application/configs/default/swagger.php: -------------------------------------------------------------------------------- 1 | 'messages', 12 | 'locale' => 'en_US', 13 | 'path' => PATH_DATA . '/locale' 14 | ]; 15 | -------------------------------------------------------------------------------- /application/configs/dev/debug.php: -------------------------------------------------------------------------------- 1 | [ 15 | 'migrations' => PATH_DATA . '/migrations', 16 | 'seeds' => PATH_DATA . '/seeds' 17 | ], 18 | 'environments' => [ 19 | 'default_migration_table' => 'migrations', 20 | 'default' => (function () { 21 | $data = \Bluz\Proxy\Config::get('db', 'connect'); 22 | $data['adapter'] = $data['type']; 23 | $data['charset'] = 'utf8'; 24 | return $data; 25 | })() 26 | ] 27 | ]; 28 | -------------------------------------------------------------------------------- /application/configs/production/debug.php: -------------------------------------------------------------------------------- 1 | '180', // 180 is default value 13 | ]; 14 | -------------------------------------------------------------------------------- /application/configs/testing/cache.php: -------------------------------------------------------------------------------- 1 | false 12 | ]; 13 | -------------------------------------------------------------------------------- /application/configs/testing/debug.php: -------------------------------------------------------------------------------- 1 | 3 | headStyle($this->baseUrl('css/dashboard.css')); ?> 5 | 7 | 9 |