Initial commit

This commit is contained in:
Chris Smith
2025-02-19 14:51:16 +01:00
commit d82a6cad96
198 changed files with 13819 additions and 0 deletions

4
common/config/.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
codeception-local.php
main-local.php
params-local.php
test-local.php

View 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 {
}

View 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
View 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
View 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
View 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',
],
],
];