GithubHelp home page GithubHelp logo

akiraz2 / yii2-app Goto Github PK

View Code? Open in Web Editor NEW
51.0 12.0 20.0 118 KB

All you need for Rapid Development is My Advanced Template (Docker, DB||Redis Cache, Gentelella Admin, Dektrium-User, log-db, queue-db, i18n, EmailForm, postcss, Gii Ant) ~~~FREE WITH GREAT SUPPORT!~~~

License: Other

PHP 92.34% CSS 2.81% Batchfile 0.71% JavaScript 0.20% Shell 3.88% Dockerfile 0.04%
yii2-application-template gentelella-theme dektrium yii2-user ready-to-use postcss logging i18n gii yii2-queue

yii2-app's Introduction

Yii2 Fast Simple Advanced App Packagist Version Total Downloads

Yii2-app is Fast and Ready-to-production advanced project template.

Dockerized, for development (mysql, nginx, php-fpm)

Please, enable php intl extension for better work.

Default, the template includes three tiers: frontend, backend, and console, each of which is a separate Yii application.

NOTE: Template is in initial development. Anything may change at any time.

Features

  • Gentelella Admin template is beautiful and simple bootstrap, compatible with yii2 assets: yiister/yii2-gentelella, Demo
  • Yii2 User is strong and proved user-module with many features: dektrium/yii2-user (login adminus, password adminus)
  • Frontend and Backend User Controllers are filtered (by dektrium/yii2-user)
  • File or DB cache, but I recommend Redis Cache - it is really fast
  • Yii2 queue (DB table queue), but you can use Redis-queue or other yii2-queue docs
  • Queue Manager with backend (/queuemanager/default/index) using ignatenkovnikita/yii2-queuemanager
  • Log DB Target with backend (/log/index) - simply view log messages
  • .htaccess - config for pretty urls (rewrite index.php), may be later add nginx config
  • UrlManagerFrontend for backend app (all url rules in file frontend/config/urls.php, hostInfo in common/config/params.php)
  • i18n translations in common/messages with config (current only English and Russian, language translation are welcome!)
  • ContactForm in frontend app is improved: himiklab/yii2-recaptcha-widget, all email are saved to DB (common/models/EmailForm Model), optionally send message to Viber messenger via bot (install requirements Bogdaan/viber-bot-php and config, uncomment code in Model)
  • Gii generator:
  1. added yii2-queue Jobs generator
  2. yii2 migration generator (from existing table) Insolita/yii2-migrik
  3. schmunk42/yii2-giiant - really steroid, but in development with bugs

Available modules

These modules can be easy installed to Yii2-App using Composer:

Installation

Yii2-app template can be installed using composer. Run following command to download and install Yii2-app:

composer create-project --prefer-dist akiraz2/yii2-app my-site

After installation run init

Docker

Install yii2-app using Docker:

  1. run command to create project
docker run --rm --interactive --tty \
  --volume $PWD:/app \
  --volume ${COMPOSER_HOME:-$HOME/.composer}:/tmp \
  composer create-project --prefer-dist akiraz2/yii2-app my-site
  1. copy .env-dist to .env, configure if needed. You can change DB from mysql to postgresql - just change docker-compose.yml (and common/config/main-local.php after init)
  2. copy /mysql/docker-entrypoint-initdb.d/createdb.sql.example to createdb.sql if you have ready DB (so dont run migrations)
  3. docker-compose build (you can configure Docker PHP in /php/Dockerfile-debian before building, for example, add mongodb)
  4. docker-compose up -d
  5. docker-compose exec php bash, in terminal run composer install, then php init, then run other migrations (see next)
  6. open http://localhost:8100 to test frontend (backend is on http://localhost:8200)

Access to Console App: docker-compose exec php bash and php yii mycommand/action

Migrations

NOTE: Make sure that you have properly configured db application component and run the following command

php yii migrate/up --migrationPath=@vendor/dektrium/yii2-user/migrations
php yii migrate --migrationPath=@yii/log/migrations/
php yii migrate --migrationPath=vendor/ignatenkovnikita/yii2-queuemanager/migrations/
php yii migrate/up

Default User Credentials

login: adminus password: adminus

Web server config

For newbies, I will recommend reading these instructions yiisoft/yii2-app-advanced/start-installation.md (apache, nginx, etc\hosts

Development

Messages

Change in common/config/main.php

'language' => 'ru-RU',
'sourceLanguage' => 'en-US',

Add your language in common/messages/config.php

    'languages' => [
        'ru-RU',
    ],

In shell

php yii message/extract common/messages/config.php

Support

If you have any questions or problems with Yii2-App you can ask them directly by using following email address: [email protected].

Contributing

If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome. +PSR-2 style coding.

I can apply patch, PR in 2-3 days! If not, please write me [email protected]

Licensing

Yii2-App is released under the BSD License. See the bundled LICENSE.md for details.

yii2-app's People

Contributors

akiraz2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yii2-app's Issues

Uncaught Error: Class 'NumberFormatter' not found in main.php in 19 line

Call Stack

1 | 0.0004 | 358160 | {main}( ) | ...\index.php:0
2 | 0.0199 | 1171160 | require( 'C:\Ampps\www\test\common\config\main.php' ) | ...\index.php:11

( ! ) Fatal error: Uncaught Error: Class 'NumberFormatter' not found in C:\Ampps\www\test\common\config\main.php on line 19

1 | 0.0004 | 358160 | {main}( ) | ...\index.php:0
2 | 0.0199 | 1171160 | require( 'C:\Ampps\www\test\common\config\main.php' ) | ...\index.php:11

contact form not work with view file

exception 'yii\base\UnknownPropertyException' with message 'Getting unknown property: frontend\models\ContactForm::name' in C:\Bodegonexpress\Bodegaonline\vendor\yiisoft\yii2\base\Component.php:155
Stack trace:
#0 C:\Bodegonexpress\Bodegaonline\vendor\yiisoft\yii2\helpers\BaseHtml.php(2244): yii\base\Component->__get('name')
#1 C:\Bodegonexpress\Bodegaonline\vendor\yiisoft\yii2\helpers\BaseHtml.php(1363): yii\helpers\BaseHtml::getAttributeValue(Object(frontend\models\ContactForm), 'name')
#2 C:\Bodegonexpress\Bodegaonline\vendor\yiisoft\yii2\helpers\BaseHtml.php(1417): yii\helpers\BaseHtml::activeInput('text', Object(frontend\models\ContactForm), 'name', Array)
#3 C:\Bodegonexpress\Bodegaonline\vendor\yiisoft\yii2\widgets\ActiveField.php(407): yii\helpers\BaseHtml::activeTextInput(Object(frontend\models\ContactForm), 'name', Array)
#4 C:\Bodegonexpress\Bodegaonline\frontend\views\site\contact.php(25): yii\widgets\ActiveField->textInput(Array)
#5 C:\Bodegonexpress\Bodegaonline\vendor\yiisoft\yii2\base\View.php(348): require('C:\Bodegonexpre...')
#6 C:\Bodegonexpress\Bodegaonline\vendor\yiisoft\yii2\base\View.php(257): yii\base\View->renderPhpFile('C:\Bodegonexpre...', Array)
#7 C:\Bodegonexpress\Bodegaonline\vendor\yiisoft\yii2\base\View.php(156): yii\base\View->renderFile('C:\Bodegonexpre...', Array, Object(frontend\controllers\SiteController))
#8 C:\Bodegonexpress\Bodegaonline\vendor\yiisoft\yii2\base\Controller.php(410): yii\base\View->render('contact', Array, Object(frontend\controllers\SiteController))
#9 C:\Bodegonexpress\Bodegaonline\frontend\controllers\SiteController.php(119): yii\base\Controller->render('contact', Array)
#10 [internal function]: frontend\controllers\SiteController->actionContact()
#11 C:\Bodegonexpress\Bodegaonline\vendor\yiisoft\yii2\base\InlineAction.php(57): call_user_func_array(Array, Array)
#12 C:\Bodegonexpress\Bodegaonline\vendor\yiisoft\yii2\base\Controller.php(181): yii\base\InlineAction->runWithParams(Array)
#13 C:\Bodegonexpress\Bodegaonline\vendor\yiisoft\yii2\base\Module.php(534): yii\base\Controller->runAction('contact', Array)
#14 C:\Bodegonexpress\Bodegaonline\vendor\yiisoft\yii2\web\Application.php(104): yii\base\Module->runAction('site/contact', Array)
#15 C:\Bodegonexpress\Bodegaonline\vendor\yiisoft\yii2\base\Application.php(392): yii\web\Application->handleRequest(Object(yii\web\Request))
#16 C:\Bodegonexpress\Bodegaonline\frontend\web\index.php(17): yii\base\Application->run()
#17 {main}

can not install package

Could not find package akiraz2/yii2-app with stability stable in a version installable using y
our PHP version 5.6.10.

composer.lock file is causing dependency errors regarding php version

A clean attempt to create project following your install steps on a php 5.6.36 env still were throwing the following errors.

  Problem 1
    - Installation request for doctrine/annotations v1.6.0 -> satisfiable by doctrine/annotations[v1.6.0].
    - doctrine/annotations v1.6.0 requires php ^7.1 -> your PHP version (5.6.36) does not satisfy that requirement.
  Problem 2
    - Installation request for swiftmailer/swiftmailer v6.0.2 -> satisfiable by swiftmailer/swiftmailer[v6.0.2].
    - swiftmailer/swiftmailer v6.0.2 requires php >=7.0.0 -> your PHP version (5.6.36) does not satisfy that requirement.
  Problem 3
    - Installation request for symfony/console v4.0.8 -> satisfiable by symfony/console[v4.0.8].
    - symfony/console v4.0.8 requires php ^7.1.3 -> your PHP version (5.6.36) does not satisfy that requirement.
  Problem 4
    - Installation request for symfony/event-dispatcher v4.0.8 -> satisfiable by symfony/event-dispatcher[v4.0.8].
    - symfony/event-dispatcher v4.0.8 requires php ^7.1.3 -> your PHP version (5.6.36) does not satisfy that requirement.
  Problem 5
    - Installation request for symfony/filesystem v4.0.8 -> satisfiable by symfony/filesystem[v4.0.8].
    - symfony/filesystem v4.0.8 requires php ^7.1.3 -> your PHP version (5.6.36) does not satisfy that requirement.
  Problem 6
    - Installation request for symfony/finder v4.0.8 -> satisfiable by symfony/finder[v4.0.8].
    - symfony/finder v4.0.8 requires php ^7.1.3 -> your PHP version (5.6.36) does not satisfy that requirement.
  Problem 7
    - Installation request for symfony/options-resolver v4.0.8 -> satisfiable by symfony/options-resolver[v4.0.8].
    - symfony/options-resolver v4.0.8 requires php ^7.1.3 -> your PHP version (5.6.36) does not satisfy that requirement.
  Problem 8
    - Installation request for symfony/process v4.0.8 -> satisfiable by symfony/process[v4.0.8].
    - symfony/process v4.0.8 requires php ^7.1.3 -> your PHP version (5.6.36) does not satisfy that requirement.
  Problem 9
    - Installation request for symfony/stopwatch v4.0.8 -> satisfiable by symfony/stopwatch[v4.0.8].
    - symfony/stopwatch v4.0.8 requires php ^7.1.3 -> your PHP version (5.6.36) does not satisfy that requirement.
  Problem 10
    - Installation request for doctrine/instantiator 1.1.0 -> satisfiable by doctrine/instantiator[1.1.0].
    - doctrine/instantiator 1.1.0 requires php ^7.1 -> your PHP version (5.6.36) does not satisfy that requirement.
  Problem 11
    - Installation request for phpdocumentor/reflection-docblock 4.3.0 -> satisfiable by phpdocumentor/reflection-docblock[4.3.0].
    - phpdocumentor/reflection-docblock 4.3.0 requires php ^7.0 -> your PHP version (5.6.36) does not satisfy that requirement.
  Problem 12
    - Installation request for phpunit/php-code-coverage 6.0.4 -> satisfiable by phpunit/php-code-coverage[6.0.4].
    - phpunit/php-code-coverage 6.0.4 requires php ^7.1 -> your PHP version (5.6.36) does not satisfy that requirement.
  Problem 13
    - Installation request for phpunit/php-timer 2.0.0 -> satisfiable by phpunit/php-timer[2.0.0].
    - phpunit/php-timer 2.0.0 requires php ^7.1 -> your PHP version (5.6.36) does not satisfy that requirement.
  Problem 14
    - Installation request for phpunit/php-token-stream 3.0.0 -> satisfiable by phpunit/php-token-stream[3.0.0].
    - phpunit/php-token-stream 3.0.0 requires php ^7.1 -> your PHP version (5.6.36) does not satisfy that requirement.
  Problem 15
    - Installation request for phpunit/phpunit 7.1.4 -> satisfiable by phpunit/phpunit[7.1.4].
    - phpunit/phpunit 7.1.4 requires php ^7.1 -> your PHP version (5.6.36) does not satisfy that requirement.
  Problem 16
    - Installation request for phpunit/phpunit-mock-objects 6.1.1 -> satisfiable by phpunit/phpunit-mock-objects[6.1.1].
    - phpunit/phpunit-mock-objects 6.1.1 requires php ^7.1 -> your PHP version (5.6.36) does not satisfy that requirement.
  Problem 17
    - Installation request for sebastian/comparator 2.1.3 -> satisfiable by sebastian/comparator[2.1.3].
    - sebastian/comparator 2.1.3 requires php ^7.0 -> your PHP version (5.6.36) does not satisfy that requirement.
  Problem 18
    - Installation request for sebastian/diff 3.0.0 -> satisfiable by sebastian/diff[3.0.0].
    - sebastian/diff 3.0.0 requires php ^7.1 -> your PHP version (5.6.36) does not satisfy that requirement.
  Problem 19
    - Installation request for sebastian/environment 3.1.0 -> satisfiable by sebastian/environment[3.1.0].
    - sebastian/environment 3.1.0 requires php ^7.0 -> your PHP version (5.6.36) does not satisfy that requirement.
  Problem 20
    - Installation request for sebastian/exporter 3.1.0 -> satisfiable by sebastian/exporter[3.1.0].
    - sebastian/exporter 3.1.0 requires php ^7.0 -> your PHP version (5.6.36) does not satisfy that requirement.
  Problem 21
    - Installation request for sebastian/global-state 2.0.0 -> satisfiable by sebastian/global-state[2.0.0].
    - sebastian/global-state 2.0.0 requires php ^7.0 -> your PHP version (5.6.36) does not satisfy that requirement.
  Problem 22
    - Installation request for sebastian/object-enumerator 3.0.3 -> satisfiable by sebastian/object-enumerator[3.0.3].
    - sebastian/object-enumerator 3.0.3 requires php ^7.0 -> your PHP version (5.6.36) does not satisfy that requirement.
  Problem 23
    - Installation request for sebastian/object-reflector 1.1.1 -> satisfiable by sebastian/object-reflector[1.1.1].
    - sebastian/object-reflector 1.1.1 requires php ^7.0 -> your PHP version (5.6.36) does not satisfy that requirement.
  Problem 24
    - Installation request for sebastian/recursion-context 3.0.0 -> satisfiable by sebastian/recursion-context[3.0.0].
    - sebastian/recursion-context 3.0.0 requires php ^7.0 -> your PHP version (5.6.36) does not satisfy that requirement.
  Problem 25
    - Installation request for symfony/browser-kit v4.0.8 -> satisfiable by symfony/browser-kit[v4.0.8].
    - symfony/browser-kit v4.0.8 requires php ^7.1.3 -> your PHP version (5.6.36) does not satisfy that requirement.
  Problem 26
    - Installation request for symfony/css-selector v4.0.8 -> satisfiable by symfony/css-selector[v4.0.8].
    - symfony/css-selector v4.0.8 requires php ^7.1.3 -> your PHP version (5.6.36) does not satisfy that requirement.
  Problem 27
    - Installation request for symfony/dom-crawler v4.0.8 -> satisfiable by symfony/dom-crawler[v4.0.8].
    - symfony/dom-crawler v4.0.8 requires php ^7.1.3 -> your PHP version (5.6.36) does not satisfy that requirement.
  Problem 28
    - Installation request for symfony/yaml v4.0.8 -> satisfiable by symfony/yaml[v4.0.8].
    - symfony/yaml v4.0.8 requires php ^7.1.3 -> your PHP version (5.6.36) does not satisfy that requirement.
  Problem 29
    - Installation request for theseer/tokenizer 1.1.0 -> satisfiable by theseer/tokenizer[1.1.0].
    - theseer/tokenizer 1.1.0 requires php ^7.0 -> your PHP version (5.6.36) does not satisfy that requirement.
  Problem 30
    - swiftmailer/swiftmailer v6.0.2 requires php >=7.0.0 -> your PHP version (5.6.36) does not satisfy that requirement.
    - yiisoft/yii2-swiftmailer 2.1.1 requires swiftmailer/swiftmailer ~6.0 -> satisfiable by swiftmailer/swiftmailer[v6.0.2].
    - Installation request for yiisoft/yii2-swiftmailer 2.1.1 -> satisfiable by yiisoft/yii2-swiftmailer[2.1.1].

After attempting in verbose mode to determine the source, I found it was coming from the lock file.

Reading ./composer.lock
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Reading ./composer.lock
Resolving dependencies through SAT
Dependency resolution completed in 0.001 seconds
Your requirements could not be resolved to an installable set of packages.

I renamed the lock file to test, and was able to then complete a composer install.

So there is something in the lock file that is still forcing the php version, just a heads up.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.