2017 © Pedro Peláez
 

library slim-skeleton

Slim 3 Skeleton Fork - InsanityMeetsHH

image

insanitymeetshh/slim-skeleton

Slim 3 Skeleton Fork - InsanityMeetsHH

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 291 Forks
  • 0 Open issues
  • 40 Versions
  • 50 % Grown

The README.md

Slim Skeleton - CodelineRed

This git is for slim3.codelinered.net. Take a look at screenshots., (*1)

Table of contents

Included

Install Skeleton

Required

  • PHP 8.0
  • MySQL 5.7 (pdo_mysql)

Open console on your OS and navigate to your project folder. Download zip if you don't have git or composer on your OS., (*2)

+++++ ZIP VERSION +++++
$ (unix) wget -O slim-prod.zip https://github.com/CodelineRed/slim-skeleton/archive/production.zip
$ (unix) unzip slim-prod.zip
$ (win10) curl -L -o slim-prod.zip https://github.com/CodelineRed/slim-skeleton/archive/production.zip
$ (win10) tar -xf slim-prod.zip
$ cd slim-skeleton-production
$ (optional) cp config\additional-settings.dist.php config\additional-settings.php
$ ---- Open "config\additional-settings.php" and change everything you have to change ----
$ php composer insall --no-dev
$ php doctrine dbal:run-sql "CREATE DATABASE slim_skeleton"
$ php doctrine orm:schema-tool:update --force
$ php doctrine dbal:import sql/all-records.sql
+++++ GIT VERSION +++++
$ git clone https://github.com/CodelineRed/slim-skeleton.git
$ cd slim-skeleton
$ git checkout production
$ (optional on unix)  rm -rf .git
$ (optional on win10) rmdir .git /s
$ (optional) cp config\additional-settings.dist.php config\additional-settings.php
$ ---- Open "config\additional-settings.php" and change everything you have to change ----
$ php composer insall --no-dev
$ php doctrine dbal:run-sql "CREATE DATABASE slim_skeleton"
$ php doctrine orm:schema-tool:update --force
$ php doctrine dbal:import sql/all-records.sql
+++++ COMPOSER VERSION +++++
$ php composer create-project codelinered/slim-skeleton slim-skeleton "dev-production" --no-dev
$ cd slim-skeleton
$ php doctrine dbal:run-sql "CREATE DATABASE slim_skeleton"
$ php doctrine orm:schema-tool:update --force
$ php doctrine dbal:import sql/all-records.sql

Default Website login: user = user, pass = password If you need PHP, MySQL, Composer and Adminer, see below ⇓., (*3)

Install PHP, MySQL, Composer and Adminer (optional)

Required

Open console on your OS and navigate to the unziped/ cloned app folder., (*4)

$ (unix)    systemctl docker start
$ (windows) "c:\path\to\Docker Desktop.exe"
$ docker-compose build
$ docker-compose up -d
$ docker-compose run composer install --no-dev
$ (unix)    docker inspect slim-db | grep "IPAddress"
$ (windows) docker inspect slim-db | findstr "IPAddress"
$ ---- Add IPAddress as Doctrine "host" in "config\additional-settings.php" ----

Open localhost:7705 for Website or localhost:7707 for Adminer., (*5)

DB Login Adminer
Server IP from IPAddress
Username root
Password rootdockerpw
Database

Path generation with Locale code and Generic locale code

  • Mode 1 - example.com/de/ = 'process' => \App\Utility\LanguageUtility::LOCALE_URL | \App\Utility\LanguageUtility::DOMAIN_DISABLED,
  • Mode 2 - example.de = 'process' => \App\Utility\LanguageUtility::LOCALE_URL | \App\Utility\LanguageUtility::DOMAIN_ENABLED,
  • Mode 3 - example.com (de-DE session) = 'process' => \App\Utility\LanguageUtility::LOCALE_SESSION | \App\Utility\LanguageUtility::DOMAIN_DISABLED, (default)

It depends on your configuration what will be returned., (*6)

Mode 1 Mode 2 Mode 3
locale code de-DE de-DE xx-XX
generic locale code de-DE xx-XX xx-XX
Twig PHP Twig Example PHP Example
locale code {{ lc }} LanguageUtility::getLocale() {{ path_for('user-register-' ~ lc) }} $this->router->pathFor('user-register-' . LanguageUtility::getLocale())
generic locale code {{ glc }} LanguageUtility::getGenericLocale() {{ path_for('user-login-' ~ glc) }} $this->router->pathFor('user-login-' . LanguageUtility::getGenericLocale())

How to create further localisations

  • Duplicate one existing file in folder locale/ (e.g. copy de-DE.php to fr-FR.php)
  • (if you use Mode 1 or 2) Duplicate one existing file in folder config/routes/ (e.g. copy de-DE.php to fr-FR.php)
  • (if you use Mode 1 or 2) Change route prefix from /de/ to /fr/ in config/routes/fr-FR.php
  • You can also define paths like /fr-be/ (locale/fr-BE.php/ config/routes/fr-BE.php) for example
  • If you want to show language in langswitch, add fr-FR and domain in locale => active (config/additional-settings.php)
  • (if you use Mode 1 or 2) Add case for fr/ in src/localisation.php

How to switch between different url modes

Mode 1

Example: example.com/de/ - EN is default language and DE is alternative language for this steps - Got to locale in config/additional-settings.php - Set 'process' => \App\Utility\LanguageUtility::LOCALE_URL | \App\Utility\LanguageUtility::DOMAIN_DISABLED, - Set up english routes with or without /en prefix in config/routes/en-US.php - Set up german routes with /de prefix in config/routes/de-DE.php - config/routes/xx-XX.php can be leave untouched, (*7)

Mode 2

Example: de.example.com or example.de - EN is default language and DE is alternative language for this steps - Got to locale in config/additional-settings.php - Set 'process' => \App\Utility\LanguageUtility::LOCALE_URL | \App\Utility\LanguageUtility::DOMAIN_ENABLED, - Enter your domains in active - Go to config/routes/de-DE.php - Remove /de prefix from every route - Go to config/routes/xx-XX.php - Insert all routes where the config is equal between config/routes/en-US.php and config/routes/de-DE.php - Remove these equal routes in config/routes/en-US.php and config/routes/de-DE.php, (*8)

Mode 3 (default)

Example: example.com - EN is default language and DE is alternative language for this steps - Got to locale in config/additional-settings.php - Set 'process' => \App\Utility\LanguageUtility::LOCALE_SESSION | \App\Utility\LanguageUtility::DOMAIN_DISABLED, - Set up all routes in config/routes/xx-XX.php - config/routes/en-US.php can be leave untouched - config/routes/de-DE.php can be leave untouched, (*9)

ACL settings

With Geggleto ACL, routes are protected by role the current user has. By default every new route is not accessable until you give the route roles. Routes are defined in the route files (e.g. config/routes/de-DE.php). Any other resource is defined in config/settings.php. Inside the Twig templates you can use ACL functions has_role and is_allowed. Inside controllers you can also use this ACL functions and many more (e.g. isAllowed())., (*10)

Troubleshooting

Error 1

In some cases you'll get the error message "Internal Server Error"., (*11)

If this happened, go to public/.htaccess and enable RewriteBase /., (*12)

If project is in sub directory then RewriteBase /project/public/., (*13)

Error 2

Message: is not resolvable File: /var/www/vendor/slim/slim/Slim/CallableResolver.php, (*14)

If this happened, your Doctrine host in config\additional-settings.php is wrong., (*15)

The Versions

29/07 2018

dev-demo-page

dev-demo-page http://slim3.insanitymeetshh.net

Slim 3 Skeleton Fork - InsanityMeetsHH

  Sources   Download

MIT

The Requires

 

The Development Requires

twig acl rest psr7 doctrine login 2fa microframework csrf router localisation

29/07 2018

dev-master

9999999-dev http://slim3.insanitymeetshh.net

Slim 3 Skeleton Fork - InsanityMeetsHH

  Sources   Download

MIT

The Requires

 

The Development Requires

twig acl rest psr7 doctrine login 2fa microframework csrf router localisation

29/07 2018

4.x-dev

4.9999999.9999999.9999999-dev http://slim3.insanitymeetshh.net

Slim 3 Skeleton Fork - InsanityMeetsHH

  Sources   Download

MIT

The Requires

 

The Development Requires

twig acl rest psr7 doctrine login 2fa microframework csrf router localisation

29/07 2018

dev-develop

dev-develop http://slim3.insanitymeetshh.net

Slim 3 Skeleton Fork - InsanityMeetsHH

  Sources   Download

MIT

The Requires

 

The Development Requires

twig acl rest psr7 doctrine login 2fa microframework csrf router localisation

29/07 2018

4.3.1

4.3.1.0 http://slim3.insanitymeetshh.net

Slim 3 Skeleton Fork - InsanityMeetsHH

  Sources   Download

MIT

The Requires

 

The Development Requires

twig acl rest psr7 doctrine login 2fa microframework csrf router localisation

17/07 2018

4.3.0

4.3.0.0 http://slim3.insanitymeetshh.net

Slim 3 Skeleton Fork - InsanityMeetsHH

  Sources   Download

MIT

The Requires

 

The Development Requires

twig acl rest psr7 doctrine login 2fa microframework csrf router localisation

12/07 2018

4.2.2

4.2.2.0 http://slim3.insanitymeetshh.net

Slim 3 Skeleton Fork - InsanityMeetsHH

  Sources   Download

MIT

The Requires

 

The Development Requires

twig acl rest psr7 doctrine login 2fa microframework csrf router localisation

11/07 2018

4.2.1

4.2.1.0 http://slim3.insanitymeetshh.net

Slim 3 Skeleton Fork - InsanityMeetsHH

  Sources   Download

MIT

The Requires

 

The Development Requires

twig acl rest psr7 doctrine login 2fa microframework csrf router localisation

11/07 2018

4.2.0

4.2.0.0 http://slim3.insanitymeetshh.net

Slim 3 Skeleton Fork - InsanityMeetsHH

  Sources   Download

MIT

The Requires

 

The Development Requires

twig acl rest psr7 doctrine login 2fa microframework csrf router localisation

11/07 2018

4.1.0

4.1.0.0 https://github.com/InsanityMeetsHH/Slim-Skeleton

Slim 3 Skeleton Fork - InsanityMeetsHH

  Sources   Download

MIT

The Requires

 

The Development Requires

twig acl rest psr7 doctrine login microframework csrf router localisation

11/07 2018

dev-feature/google-auth

dev-feature/google-auth https://github.com/InsanityMeetsHH/Slim-Skeleton

Slim 3 Skeleton Fork - InsanityMeetsHH

  Sources   Download

MIT

The Requires

 

The Development Requires

twig acl rest psr7 doctrine login microframework csrf router localisation

02/07 2018

4.0.3

4.0.3.0 https://github.com/InsanityMeetsHH/Slim-Skeleton

Slim 3 Skeleton Fork - InsanityMeetsHH

  Sources   Download

MIT

The Requires

 

The Development Requires

twig acl rest psr7 doctrine login microframework csrf router localisation

27/05 2018

4.0.2

4.0.2.0 https://github.com/InsanityMeetsHH/Slim-Skeleton

Slim 3 Skeleton Fork - InsanityMeetsHH

  Sources   Download

MIT

The Requires

 

The Development Requires

twig acl rest psr7 doctrine login microframework csrf router localisation

21/05 2018

4.0.1

4.0.1.0 https://github.com/InsanityMeetsHH/Slim-Skeleton

Slim 3 Skeleton Fork - InsanityMeetsHH

  Sources   Download

MIT

The Requires

 

The Development Requires

twig acl rest psr7 doctrine login microframework csrf router localisation

21/05 2018

4.0.0

4.0.0.0 https://github.com/InsanityMeetsHH/Slim-Skeleton

Slim 3 Skeleton Fork - InsanityMeetsHH

  Sources   Download

MIT

The Requires

 

The Development Requires

twig acl rest psr7 doctrine login microframework csrf router localisation

19/05 2018

3.x-dev

3.9999999.9999999.9999999-dev https://github.com/InsanityMeetsHH/Slim-Skeleton

Slim Framework 3 Skeleton + Twig + Doctrine + Localisation

  Sources   Download

MIT

The Requires

 

The Development Requires

twig rest psr7 doctrine microframework router localisation

16/05 2018

3.5.0

3.5.0.0 https://github.com/InsanityMeetsHH/Slim-Skeleton

Slim Framework 3 Skeleton + Twig + Doctrine + Localisation

  Sources   Download

MIT

The Requires

 

The Development Requires

twig rest psr7 doctrine microframework router localisation

16/05 2018

dev-feature/acl

dev-feature/acl https://github.com/InsanityMeetsHH/Slim-Skeleton

Slim Framework 3 Skeleton + Twig + Doctrine + Localisation

  Sources   Download

MIT

The Requires

 

The Development Requires

twig rest psr7 doctrine microframework router localisation

16/05 2018

3.4.0

3.4.0.0 https://github.com/InsanityMeetsHH/Slim-Skeleton

Slim Framework 3 Skeleton + Twig + Doctrine + Localisation

  Sources   Download

MIT

The Requires

 

The Development Requires

twig rest psr7 doctrine microframework router localisation

14/05 2018

3.3.0

3.3.0.0 https://github.com/InsanityMeetsHH/Slim-Skeleton

Slim Framework 3 Skeleton + Twig + Doctrine + Localisation

  Sources   Download

MIT

The Requires

 

The Development Requires

twig rest psr7 doctrine microframework router localisation

10/02 2018

3.2.2

3.2.2.0 https://github.com/InsanityMeetsHH/Slim-Skeleton

Slim Framework 3 Skeleton + Twig + Doctrine + Localisation

  Sources   Download

MIT

The Requires

 

The Development Requires

twig rest psr7 doctrine microframework router localisation

20/01 2018

v3.2.1

3.2.1.0 https://github.com/InsanityMeetsHH/Slim-Skeleton

Slim Framework 3 Skeleton + Twig + Doctrine + Localisation

  Sources   Download

MIT

The Requires

 

The Development Requires

twig rest psr7 doctrine microframework router localisation

20/01 2018

v3.2.0

3.2.0.0 https://github.com/InsanityMeetsHH/Slim-Skeleton

Slim Framework skeleton + Doctrine + Twig + Localisation

  Sources   Download

MIT

The Requires

 

The Development Requires

twig rest psr7 doctrine microframework router localisation

20/01 2018

1.x-dev

1.9999999.9999999.9999999-dev https://github.com/InsanityMeetsHH/Slim-Skeleton

Slim Framework skeleton + Doctrine + Twig + Localisation

  Sources   Download

MIT

The Requires

 

The Development Requires

twig rest psr7 doctrine microframework router localisation

20/09 2017

3.1.4

3.1.4.0 http://github.com/slimphp/Slim-Skeleton

A Slim Framework skeleton application for rapid development

  Sources   Download

MIT

The Requires

 

The Development Requires

rest psr7 microframework router

04/09 2016

3.1.2

3.1.2.0 http://github.com/slimphp/Slim-Skeleton

A Slim Framework skeleton application for rapid development

  Sources   Download

MIT

The Requires

 

The Development Requires

rest psr7 microframework router

13/08 2016

3.1.1

3.1.1.0 http://github.com/slimphp/Slim-Skeleton

A Slim Framework skeleton application for rapid development

  Sources   Download

MIT

The Requires

 

The Development Requires

rest psr7 microframework router

12/08 2016

3.1.0

3.1.0.0 http://github.com/slimphp/Slim-Skeleton

A Slim Framework skeleton application for rapid development

  Sources   Download

MIT

The Requires

 

The Development Requires

rest psr7 microframework router

29/06 2016

3.0.3

3.0.3.0 http://github.com/slimphp/Slim-Skeleton

A Slim Framework skeleton application for rapid development

  Sources   Download

MIT

The Requires

 

rest psr7 microframework router

06/06 2016

3.0.2

3.0.2.0 http://github.com/slimphp/Slim-Skeleton

A Slim Framework skeleton application for rapid development

  Sources   Download

MIT

The Requires

 

rest psr7 microframework router

04/02 2016

3.0.1

3.0.1.0 http://github.com/slimphp/Slim-Skeleton

A Slim Framework skeleton application for rapid development

  Sources   Download

MIT

The Requires

 

rest psr7 microframework router

07/12 2015

3.0.0

3.0.0.0 http://github.com/slimphp/Slim-Skeleton

A Slim Framework skeleton application for rapid development

  Sources   Download

MIT

The Requires

 

rest psr7 microframework router

29/10 2015

2.x-dev

2.9999999.9999999.9999999-dev http://github.com/codeguy/Slim-Skeleton

A Slim Framework skeleton application for rapid development

  Sources   Download

MIT

The Requires

 

rest microframework router

11/12 2013

2.1.2

2.1.2.0 http://github.com/codeguy/Slim-Skeleton

A Slim Framework skeleton application for rapid development

  Sources   Download

MIT

The Requires

 

rest microframework router

01/10 2013

2.1.1

2.1.1.0 http://github.com/codeguy/Slim-Skeleton

A Slim Framework skeleton application for rapid development

  Sources   Download

MIT

The Requires

 

rest microframework router

30/09 2013

2.1.0

2.1.0.0 http://github.com/codeguy/Slim-Skeleton

A Slim Framework skeleton application for rapid development

  Sources   Download

MIT

The Requires

 

rest microframework router

23/08 2013

2.0.0

2.0.0.0 http://github.com/codeguy/Slim-Skeleton

A Slim Framework skeleton application for rapid development

  Sources   Download

MIT

The Requires

 

rest microframework router

30/09 2012

1.1.0

1.1.0.0 http://github.com/codeguy/Slim-Skeleton

A Slim Framework skeleton application for rapid development

  Sources   Download

MIT

The Requires

 

rest microframework router

04/07 2012

1.0.1

1.0.1.0 http://github.com/codeguy/Slim-Skeleton

A Slim Framework skeleton application for rapid development

  Sources   Download

MIT

The Requires

 

rest microframework router

04/07 2012

1.0.0

1.0.0.0 http://github.com/codeguy/Slim-Skeleton

A Slim Framework skeleton application for rapid development

  Sources   Download

MIT

The Requires

 

rest microframework router