-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor Docker setup and Bitrix24Account entity
Removed custom Docker configurations for nginx, PHP-FPM, and PostgreSQL to streamline the Docker environment. Introduced a centralized environment configuration using .env and Symfony Dotenv. Additionally, refactored the Bitrix24Account entity and its repository to enhance code maintainability and align with best practices. Signed-off-by: mesilov <[email protected]>
- Loading branch information
Showing
18 changed files
with
379 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# In all environments, the following files are loaded if they exist, | ||
# the latter taking precedence over the former: | ||
# | ||
# * .env contains default values for the environment variables needed by the app | ||
# * .env.local uncommitted file with local overrides | ||
# * .env.$APP_ENV committed environment-specific defaults | ||
# * .env.$APP_ENV.local uncommitted environment-specific overrides | ||
# | ||
# Real environment variables win over .env files. | ||
# | ||
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES. | ||
# | ||
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2). | ||
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration | ||
DATABASE_HOST=bitrix24-php-lib-test-database | ||
DATABASE_USER= | ||
DATABASE_PASSWORD= | ||
DATABASE_NAME= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
|
||
use Bitrix24\SDK\Lib\Tests\EntityManagerFactory; | ||
use Doctrine\ORM\Tools\Console\ConsoleRunner; | ||
use Doctrine\ORM\Tools\Console\EntityManagerProvider\SingleManagerProvider; | ||
|
||
require_once 'tests/bootstrap.php'; | ||
|
||
ConsoleRunner::run( | ||
new SingleManagerProvider(EntityManagerFactory::get()), | ||
[] | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
require 'vendor/autoload.php'; | ||
|
||
use Doctrine\DBAL\DriverManager; | ||
use Doctrine\Migrations\Configuration\Connection\ExistingConnection; | ||
use Doctrine\Migrations\Configuration\Migration\PhpFile; | ||
use Doctrine\Migrations\DependencyFactory; | ||
|
||
$config = new PhpFile('migrations.php'); | ||
|
||
$conn = DriverManager::getConnection( | ||
[ | ||
'driver' => 'pdo_pgsql', | ||
'memory' => true, | ||
'dbname' => 'b24AccountTest', | ||
]); | ||
|
||
return DependencyFactory::fromConnection($config, new ExistingConnection($conn)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
return [ | ||
'table_storage' => [ | ||
'table_name' => 'b24AccountsDoctrineMigrationVersions', | ||
'version_column_name' => 'version', | ||
'version_column_length' => 1024, | ||
'executed_at_column_name' => 'executed_at', | ||
'execution_time_column_name' => 'execution_time', | ||
], | ||
'migrations_paths' => [ | ||
'B24io\Core\Bitrix24\Account\Migrations' => '/migrations/', | ||
], | ||
'all_or_nothing' => true, | ||
'transactional' => true, | ||
'check_database_platform' => true, | ||
'organize_migrations' => 'none', | ||
'connection' => null, | ||
'em' => null, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.