Skip to content
This repository has been archived by the owner on Aug 30, 2020. It is now read-only.

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
rossaddison authored Dec 28, 2019
1 parent 95efd75 commit eef163f
Show file tree
Hide file tree
Showing 22 changed files with 346 additions and 0 deletions.
20 changes: 20 additions & 0 deletions environments/dev/common/config/main-local.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
return [
'components' => [
'db' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=localhost;dbname=ra_windowcleaning_co_uk',
'username' => 'ra_windowcleaning_co_uk',
'password' => 'jump22it',
'charset' => 'utf8',
],
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
'viewPath' => '@common/mail',
// send all mails to a file by default. You have to set
// 'useFileTransport' to false and configure a transport
// for the mailer to send real emails.
'useFileTransport' => true,
],
],
];
3 changes: 3 additions & 0 deletions environments/dev/common/config/params-local.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php
return [
];
13 changes: 13 additions & 0 deletions environments/dev/common/config/test-local.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
return yii\helpers\ArrayHelper::merge(
require(__DIR__ . '/main.php'),
require(__DIR__ . '/main-local.php'),
require(__DIR__ . '/test.php'),
[
'components' => [
'db' => [
'dsn' => 'mysql:host=localhost;dbname=yii2advanced_test',
]
],
]
);
7 changes: 7 additions & 0 deletions environments/dev/console/config/main-local.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php
return [
'bootstrap' => ['gii'],
'modules' => [
'gii' => 'yii\gii\Module',
],
];
3 changes: 3 additions & 0 deletions environments/dev/console/config/params-local.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php
return [
];
25 changes: 25 additions & 0 deletions environments/dev/frontend/config/main-local.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

$config = [
'components' => [
'request' => [
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
'cookieValidationKey' => '7AZZRnYdd0mU67tW8OKaWZXHs2O10-I1',
],
],
];

if (!YII_ENV_TEST) {
// configuration adjustments for 'dev' environment
$config['bootstrap'][] = 'debug';
$config['modules']['debug'] = [
'class' => 'yii\debug\Module',
];

$config['bootstrap'][] = 'gii';
$config['modules']['gii'] = [
'class' => 'yii\gii\Module',
];
}

return $config;
3 changes: 3 additions & 0 deletions environments/dev/frontend/config/params-local.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php
return [
];
9 changes: 9 additions & 0 deletions environments/dev/frontend/config/test-local.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php
return yii\helpers\ArrayHelper::merge(
require(__DIR__ . '/../../common/config/test-local.php'),
require(__DIR__ . '/main.php'),
require(__DIR__ . '/main-local.php'),
require(__DIR__ . '/test.php'),
[
]
);
18 changes: 18 additions & 0 deletions environments/dev/frontend/web/index-test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

// NOTE: Make sure this file is not accessible when deployed to production
if (!in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1'])) {
die('You are not allowed to access this file.');
}

defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'test');

require(__DIR__ . '/../../vendor/autoload.php');
require(__DIR__ . '/../../vendor/yiisoft/yii2/Yii.php');
require(__DIR__ . '/../../common/config/bootstrap.php');
require(__DIR__ . '/../config/bootstrap.php');

$config = require(__DIR__ . '/../config/test-local.php');

(new yii\web\Application($config))->run();
17 changes: 17 additions & 0 deletions environments/dev/frontend/web/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev');

require(__DIR__ . '/../../vendor/autoload.php');
require(__DIR__ . '/../../vendor/yiisoft/yii2/Yii.php');
require(__DIR__ . '/../../common/config/bootstrap.php');
require(__DIR__ . '/../config/bootstrap.php');

$config = yii\helpers\ArrayHelper::merge(
require(__DIR__ . '/../../common/config/main.php'),
require(__DIR__ . '/../../common/config/main-local.php'),
require(__DIR__ . '/../config/main.php'),
require(__DIR__ . '/../config/main-local.php')
);

(new yii\web\Application($config))->run();
28 changes: 28 additions & 0 deletions environments/dev/yii
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env php
<?php
/**
* Yii console bootstrap file.
*
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/

defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev');

require(__DIR__ . '/vendor/autoload.php');
require(__DIR__ . '/vendor/yiisoft/yii2/Yii.php');
require(__DIR__ . '/common/config/bootstrap.php');
require(__DIR__ . '/console/config/bootstrap.php');

$config = yii\helpers\ArrayHelper::merge(
require(__DIR__ . '/common/config/main.php'),
require(__DIR__ . '/common/config/main-local.php'),
require(__DIR__ . '/console/config/main.php'),
require(__DIR__ . '/console/config/main-local.php')
);

$application = new yii\console\Application($config);
$exitCode = $application->run();
exit($exitCode);
27 changes: 27 additions & 0 deletions environments/dev/yii_test
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env php
<?php
/**
* Yii console bootstrap file.
*
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/

defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'test');

require(__DIR__ . '/vendor/autoload.php');
require(__DIR__ . '/vendor/yiisoft/yii2/Yii.php');
require(__DIR__ . '/common/config/bootstrap.php');
require(__DIR__ . '/console/config/bootstrap.php');

$config = yii\helpers\ArrayHelper::merge(
require(__DIR__ . '/common/config/test-local.php'),
require(__DIR__ . '/console/config/main.php'),
require(__DIR__ . '/console/config/main-local.php')
);

$application = new yii\console\Application($config);
$exitCode = $application->run();
exit($exitCode);
20 changes: 20 additions & 0 deletions environments/dev/yii_test.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@echo off

rem -------------------------------------------------------------
rem Yii command line bootstrap script for Windows.
rem
rem @author Qiang Xue <[email protected]>
rem @link http://www.yiiframework.com/
rem @copyright Copyright (c) 2008 Yii Software LLC
rem @license http://www.yiiframework.com/license/
rem -------------------------------------------------------------

@setlocal

set YII_PATH=%~dp0

if "%PHP_COMMAND%" == "" set PHP_COMMAND=php.exe

"%PHP_COMMAND%" "%YII_PATH%yii_test" %*

@endlocal
71 changes: 71 additions & 0 deletions environments/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?php
/**
* The manifest of files that are local to specific environment.
* This file returns a list of environments that the application
* may be installed under. The returned data must be in the following
* format:
*
* ```php
* return [
* 'environment name' => [
* 'path' => 'directory storing the local files',
* 'skipFiles' => [
* // list of files that should only copied once and skipped if they already exist
* ],
* 'setWritable' => [
* // list of directories that should be set writable
* ],
* 'setExecutable' => [
* // list of files that should be set executable
* ],
* 'setCookieValidationKey' => [
* // list of config files that need to be inserted with automatically generated cookie validation keys
* ],
* 'createSymlink' => [
* // list of symlinks to be created. Keys are symlinks, and values are the targets.
* ],
* ],
* ];
* ```
*/
return [
'Development' => [
'path' => 'dev',
'setWritable' => [
'backend/runtime',
'backend/web/assets',
'frontend/runtime',
'frontend/web/assets',
'carty/runtime',
'carty/web/assets',
],
'setExecutable' => [
'yii',
'yii_test',
],
'setCookieValidationKey' => [
'backend/config/main-local.php',
'frontend/config/main-local.php',
'carty/config/main-local.php',
],
],
'Production' => [
'path' => 'prod',
'setWritable' => [
'backend/runtime',
'backend/web/assets',
'frontend/runtime',
'frontend/web/assets',
'carty/runtime',
'carty/web/assets',
],
'setExecutable' => [
'yii',
],
'setCookieValidationKey' => [
'backend/config/main-local.php',
'frontend/config/main-local.php',
'carty/config/main-local.php',
],
],
];
16 changes: 16 additions & 0 deletions environments/prod/common/config/main-local.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
return [
'components' => [
'db' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=localhost;dbname=ra_windowcleaning_co_uk',
'username' => 'ra_windowcleaning_co_uk',
'password' => 'jump22it',
'charset' => 'utf8',
],
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
'viewPath' => '@common/mail',
],
],
];
3 changes: 3 additions & 0 deletions environments/prod/common/config/params-local.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php
return [
];
3 changes: 3 additions & 0 deletions environments/prod/console/config/main-local.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php
return [
];
3 changes: 3 additions & 0 deletions environments/prod/console/config/params-local.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php
return [
];
9 changes: 9 additions & 0 deletions environments/prod/frontend/config/main-local.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php
return [
'components' => [
'request' => [
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
'cookieValidationKey' => 'rtywrtwerqwerqwerqwex',
],
],
];
3 changes: 3 additions & 0 deletions environments/prod/frontend/config/params-local.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php
return [
];
17 changes: 17 additions & 0 deletions environments/prod/frontend/web/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
defined('YII_DEBUG') or define('YII_DEBUG', false);
defined('YII_ENV') or define('YII_ENV', 'prod');

require(__DIR__ . '/../../vendor/autoload.php');
require(__DIR__ . '/../../vendor/yiisoft/yii2/Yii.php');
require(__DIR__ . '/../../common/config/bootstrap.php');
require(__DIR__ . '/../config/bootstrap.php');

$config = yii\helpers\ArrayHelper::merge(
require(__DIR__ . '/../../common/config/main.php'),
require(__DIR__ . '/../../common/config/main-local.php'),
require(__DIR__ . '/../config/main.php'),
require(__DIR__ . '/../config/main-local.php')
);

(new yii\web\Application($config))->run();
28 changes: 28 additions & 0 deletions environments/prod/yii
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env php
<?php
/**
* Yii console bootstrap file.
*
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/

defined('YII_DEBUG') or define('YII_DEBUG', false);
defined('YII_ENV') or define('YII_ENV', 'prod');

require(__DIR__ . '/vendor/autoload.php');
require(__DIR__ . '/vendor/yiisoft/yii2/Yii.php');
require(__DIR__ . '/common/config/bootstrap.php');
require(__DIR__ . '/console/config/bootstrap.php');

$config = yii\helpers\ArrayHelper::merge(
require(__DIR__ . '/common/config/main.php'),
require(__DIR__ . '/common/config/main-local.php'),
require(__DIR__ . '/console/config/main.php'),
require(__DIR__ . '/console/config/main-local.php')
);

$application = new yii\console\Application($config);
$exitCode = $application->run();
exit($exitCode);

0 comments on commit eef163f

Please sign in to comment.