Initial commit
This commit is contained in:
4
common/config/.gitignore
vendored
Normal file
4
common/config/.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
codeception-local.php
|
||||
main-local.php
|
||||
params-local.php
|
||||
test-local.php
|
||||
37
common/config/__autocomplete.php
Normal file
37
common/config/__autocomplete.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This class only exists here for IDE (PHPStorm/Netbeans/...) autocompletion.
|
||||
* This file is never included anywhere.
|
||||
* Adjust this file to match classes configured in your application config, to enable IDE autocompletion for custom components.
|
||||
* Example: A property phpdoc can be added in `__Application` class as `@property \vendor\package\Rollbar|__Rollbar $rollbar` and adding a class in this file
|
||||
* ```php
|
||||
* // @property of \vendor\package\Rollbar goes here
|
||||
* class __Rollbar {
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
class Yii {
|
||||
/**
|
||||
* @var \yii\web\Application|\yii\console\Application|__Application
|
||||
*/
|
||||
public static $app;
|
||||
}
|
||||
|
||||
/**
|
||||
* @property yii\rbac\DbManager $authManager
|
||||
* @property \Da\User\Model\User $user
|
||||
* @property \common\components\SonarApiComponent $sonar
|
||||
* @property \common\components\HubspotApiComponent $hubspot
|
||||
* @property \common\components\PostmarkComponent $postmark
|
||||
* @property \yii\queue\db\Queue $queue
|
||||
*
|
||||
*/
|
||||
class __Application {
|
||||
}
|
||||
|
||||
/**
|
||||
* @property app\models\User $identity
|
||||
*/
|
||||
class __WebUser {
|
||||
}
|
||||
5
common/config/bootstrap.php
Normal file
5
common/config/bootstrap.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
Yii::setAlias('@common', dirname(__DIR__));
|
||||
Yii::setAlias('@frontend', dirname(dirname(__DIR__)) . '/frontend');
|
||||
Yii::setAlias('@backend', dirname(dirname(__DIR__)) . '/api');
|
||||
Yii::setAlias('@console', dirname(dirname(__DIR__)) . '/console');
|
||||
44
common/config/main.php
Normal file
44
common/config/main.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use common\components\PostmarkComponent;
|
||||
use common\components\SonarApiComponent;
|
||||
use common\components\HubspotApiComponent;
|
||||
use yii\caching\FileCache;
|
||||
use yii\queue\db\Queue;
|
||||
|
||||
$params = array_merge(
|
||||
require __DIR__ . '/params.php',
|
||||
require __DIR__ . '/params-local.php'
|
||||
);
|
||||
|
||||
return [
|
||||
'name' => $params['company_name'] . ' - ' . $params['product_name'],
|
||||
'aliases' => [
|
||||
'@bower' => '@vendor/bower-asset',
|
||||
'@npm' => '@vendor/npm-asset',
|
||||
],
|
||||
'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
|
||||
'components' => [
|
||||
'cache' => [
|
||||
'class' => FileCache::class,
|
||||
],
|
||||
'sonar' => [
|
||||
'class' => SonarApiComponent::class,
|
||||
'baseUrl' => $params['sonar.url'] . '/api/graphql',
|
||||
'bearerToken' => $params['sonar.bearerToken'],
|
||||
],
|
||||
'postmark' => [
|
||||
'class' => PostmarkComponent::class,
|
||||
'serverToken' => $params['postmark.serverToken'],
|
||||
],
|
||||
'authManager' => [
|
||||
'class' => 'yii\rbac\DbManager',
|
||||
],
|
||||
'urlManager' => [
|
||||
'enablePrettyUrl' => true,
|
||||
'showScriptName' => false,
|
||||
'rules' => [
|
||||
],
|
||||
]
|
||||
],
|
||||
];
|
||||
14
common/config/params.php
Normal file
14
common/config/params.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
return [
|
||||
'adminEmail' => 'admin@example.com',
|
||||
'supportEmail' => 'support@example.com',
|
||||
'senderEmail' => 'noreply@example.com',
|
||||
'senderName' => 'Example.com mailer',
|
||||
'user.passwordResetTokenExpire' => 3600,
|
||||
'user.passwordMinLength' => 8,
|
||||
'sonar.url' => 'https://yourname.sonar.software',
|
||||
'sonar.bearerToken' => '',
|
||||
'postmark.serverToken' => 'postmark-server-key',
|
||||
'postmark.messageStream' => 'outbound',
|
||||
'sentry.dsn' => 'https://asdf@o4507934844780544.ingest.us.sentry.io/4508006893158400',
|
||||
];
|
||||
11
common/config/test.php
Normal file
11
common/config/test.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
return [
|
||||
'id' => 'app-common-tests',
|
||||
'basePath' => dirname(__DIR__),
|
||||
'components' => [
|
||||
'user' => [
|
||||
'class' => \yii\web\User::class,
|
||||
'identityClass' => 'common\models\User',
|
||||
],
|
||||
],
|
||||
];
|
||||
Reference in New Issue
Block a user