Using Global Variables in CakePHP Shell Scripts

Using CakePHP Shell Scripts I am having problems accessing the constants that I usually install in config / bootstrap.php.

Is it because, using shell scripts, I am not viewing the regular dispatcher procedure? What is the best practice for defining constants in shell scripts?

Thanks.

+4
source share
3 answers

You can define a constant in app / config / bootstrap.php as define ("ADMIN_TITLE", "Administrator");

+2
source

Just confirming that you are setting constants with the 'define' keyword

http://php.net/manual/en/function.define.php

0
source

It works for sure. Can you show us some code to understand what you are doing?

0
source

Source: https://habr.com/ru/post/1316514/


All Articles