File tree Expand file tree Collapse file tree 4 files changed +26
-16
lines changed
Expand file tree Collapse file tree 4 files changed +26
-16
lines changed Original file line number Diff line number Diff line change 3535use Cake \Core \Configure ;
3636use Cake \Core \Configure \Engine \PhpConfig ;
3737use Cake \Datasource \ConnectionManager ;
38- use Cake \Error \ConsoleErrorHandler ;
39- use Cake \Error \ErrorHandler ;
38+ use Cake \Error \ErrorTrap ;
39+ use Cake \Error \ExceptionTrap ;
4040use Cake \Http \ServerRequest ;
4141use Cake \Log \Log ;
4242use Cake \Mailer \Mailer ;
8989 Configure::load ('app_local ' , 'default ' );
9090}
9191
92+ /**
93+ * This try catch can be removed after install
94+ */
95+ try {
96+ Configure::load ('swagger_bake ' , 'default ' , false );
97+ } catch (\Exception $ e ) {
98+ triggerWarning ($ e ->getMessage () . '. Run `bin/cake mixerapi install` to clear this warning ' );
99+ }
100+
92101/*
93102 * When debug = true the metadata cache should only last
94103 * for a short time.
120129/*
121130 * Register application error and exception handlers.
122131 */
123- $ isCli = PHP_SAPI === 'cli ' ;
124- if ($ isCli ) {
125- (new ConsoleErrorHandler (Configure::read ('Error ' )))->register ();
126- } else {
127- (new ErrorHandler (Configure::read ('Error ' )))->register ();
128- }
132+ (new ErrorTrap (Configure::read ('Error ' )))->register ();
133+ (new ExceptionTrap (Configure::read ('Error ' )))->register ();
129134
130135/*
131136 * Include the CLI bootstrap overrides.
132137 */
133- if ($ isCli ) {
138+ if (PHP_SAPI === ' cli ' ) {
134139 require __DIR__ . '/bootstrap_cli.php ' ;
135140}
136141
Original file line number Diff line number Diff line change @@ -16,20 +16,20 @@ if [ "$1" = 'php-fpm' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/cakephp' ]; then
1616 fi
1717
1818 COMPOSER_MEMORY_LIMIT=-1
19- composer create-project --prefer-dist --no-interaction cakephp/app:^4.2 .
19+ composer create-project --prefer-dist --no-interaction cakephp/app:^4.4 .
2020 rm -rf .github
2121 cp config/.env.example config/.env
2222 cp config/app_local.example.php config/app_local.php
2323 cp ../.assets/bootstrap.php config/bootstrap.php
2424
2525 sed -i ' /export APP_NAME/c\export APP_NAME="cakephp"' config/.env
2626
27- salt=$( cat /dev/urandom | LC_CTYPE=C tr -dc ' a-zA-Z0-9 ' | fold -w 32 | head -n 1 )
27+ salt=$( openssl rand -base64 32 )
2828 sed -i ' /export SECURITY_SALT/c\export SECURITY_SALT="' $salt ' "' config/.env
2929
3030 touch .gitkeep
3131
32- composer require mixerapi/mixerapi
32+ composer require mixerapi/mixerapi -W
3333
3434 # optional:
3535 composer require mixerapi/crud
@@ -50,6 +50,7 @@ if [ "$1" = 'php-fpm' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/cakephp' ]; then
5050
5151 mkdir -p logs tmp
5252
53+ # Set ACLs for Linux users
5354 echo " HOST OS: $HOST_OS "
5455 if [[ $HOST_OS == * " Linux" * ]]; then
5556 echo " Setting ACLs..."
Original file line number Diff line number Diff line change 2020 - name : Start
2121 run : docker-compose up -d
2222 - name : Wait for services
23- run : sleep 5
24- - name : HTTP Check
25- run : curl -v -o /dev/null http://localhost:8080
23+ run : sleep 10
24+ - name : Check CakePHP Welcome Page
25+ run : curl -f -v -o /dev/null http://localhost:8080
26+ - name : Check NGINX Files
27+ run : curl -f -v -o /dev/null http://localhost:8080/css/home.css
Original file line number Diff line number Diff line change @@ -35,8 +35,10 @@ COPY .assets /srv/.assets
3535
3636WORKDIR /srv/app
3737
38- RUN addgroup -g 101 nginx
3938RUN adduser --disabled-password --gecos '' -u $UID cakephp;
39+ RUN addgroup -g 101 nginx
40+ RUN addgroup cakephp nginx
41+ RUN addgroup cakephp www-data
4042
4143COPY --from=composer /usr/bin/composer /usr/bin/composer
4244
You can’t perform that action at this time.
0 commit comments