Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FOUR-20506 Update project dependencies #7848

Open
wants to merge 5 commits into
base: feature/FOUR-20332
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions ProcessMaker/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
*/
class Application extends IlluminateApplication
{
// ProcessMaker Version
public const VERSION = '4.0.0';

/**
* Sets the timezone for the application and for php with the specified timezone.
*
Expand Down
10 changes: 8 additions & 2 deletions ProcessMaker/Console/Commands/CreateDataLakeViews.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,20 @@ protected function getTableColumns(string $tableName): array
*/
protected function getTables(): array
{
return DB::connection()->getDoctrineSchemaManager()->listTableNames();
$tables = array_map(function ($item) {
return $item['name'];
}, Schema::getTables());
return $tables;
}

/**
* @return \Doctrine\DBAL\Schema\View[]
*/
protected function getViews(): array
{
return DB::connection()->getDoctrineSchemaManager()->listViews();
$views = array_map(function ($item) {
return $item['name'];
}, Schema::getViews());
return $views;
}
}
31 changes: 31 additions & 0 deletions ProcessMaker/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

namespace ProcessMaker\Providers;

use Illuminate\Support\ServiceProvider;
use Illuminate\Database\Migrations\MigrationRepositoryInterface;
use Illuminate\Database\Migrations\DatabaseMigrationRepository;
use Illuminate\Database\ConnectionResolverInterface;

class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
$resolver = $this->app->make(ConnectionResolverInterface::class);
$table = $this->app['config']['database.migrations'];
$this->app->bind(MigrationRepositoryInterface::class, function ($app) use ($resolver, $table) {
return new DatabaseMigrationRepository($resolver, $table);
});
}

/**
* Bootstrap any application services.
*/
public function boot(): void
{
//
}
}
2 changes: 1 addition & 1 deletion ProcessMaker/Providers/ProcessMakerServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ protected static function configureVendors(): void
});

// we are using custom passport migrations
Passport::ignoreMigrations();
//Passport::ignoreMigrations();
}

private function setupFactories(): void
Expand Down
102 changes: 52 additions & 50 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,73 +11,74 @@
"prefer-stable": true,
"require": {
"php": "^8.2",
"babenkoivan/elastic-scout-driver": "^3.0",
"babenkoivan/elastic-scout-driver": "^4.0",
"bacon/bacon-qr-code": "^2.0",
"codegreencreative/laravel-samlidp": "^5.2",
"composer/semver": "^3.3",
"darkaonline/l5-swagger": "^8.3",
"doctrine/dbal": "^3.5",
"fakerphp/faker": "^1.9.1",
"google/apiclient": "^2.12",
"guzzlehttp/guzzle": "^7.4",
"igaster/laravel-theme": "2.0.*",
"composer/semver": "^3.4",
"darkaonline/l5-swagger": "^8.6",
"doctrine/dbal": "^4.2",
"fakerphp/faker": "^1.24",
"google/apiclient": "^2.18",
"guzzlehttp/guzzle": "^7.9",
"igaster/laravel-theme": "^2.0",
"jenssegers/agent": "^2.6",
"laravel/framework": "^10.19",
"laravel/horizon": "^5.12",
"laravel/pail": "*",
"laravel/passport": "^11.5",
"laravel/scout": "^9.8",
"laravel/telescope": "^4.12",
"laravel/tinker": "^2.8",
"laravel/ui": "^4.2",
"laravelcollective/html": "^6.4",
"laravel/framework": "^11.0",
"laravel/horizon": "^5.30",
"laravel/pail": "^1.2",
"laravel/passport": "^12.3",
"laravel/scout": "^10.11",
"laravel/telescope": "^5.2",
"laravel/tinker": "^2.10",
"laravel/ui": "^4.6",

"lavary/laravel-menu": "^1.8",
"lcobucci/jwt": "^4.2",
"league/flysystem-aws-s3-v3": "^3.15",
"mateusjunges/laravel-kafka": "^1.11",
"microsoft/microsoft-graph": "^1.77",
"lcobucci/jwt": "^5.4",
"league/flysystem-aws-s3-v3": "^3.29",
"mateusjunges/laravel-kafka": "^2.4",
"microsoft/microsoft-graph": "^2.8",
"mittwald/vault-php": "^2.1",
"moontoast/math": "^1.2",
"mustache/mustache": "^2.14",
"openai-php/client": "^0.5.2",
"openai-php/laravel": "^0.5.3",
"phing/phing": "^2.17",
"php-amqplib/php-amqplib": "^3.5",
"openai-php/client": "^0.10.3",
"openai-php/laravel": "^0.10.2",
"phing/phing": "^3.0",
"php-amqplib/php-amqplib": "^3.7",
"pion/laravel-chunk-upload": "^1.5",
"predis/predis": "^2.0",
"predis/predis": "^2.3",
"processmaker/docker-executor-lua": "^1.0",
"processmaker/docker-executor-node": "1.1.0",
"processmaker/docker-executor-php": "1.2.0",
"processmaker/laravel-i18next": "dev-master",
"processmaker/nayra": "1.12.0",
"processmaker/pmql": "1.12.1",
"psr/http-message": "^1.1",
"psr/log": "^2.0",
"psr/simple-cache": "^2.0",
"pusher/pusher-php-server": "^7.0",
"psr/http-message": "^2.0",
"psr/log": "^3.0",
"psr/simple-cache": "^3.0",
"pusher/pusher-php-server": "^7.2",
"ralouphie/getallheaders": "^3.0",
"simplesoftwareio/simple-qrcode": "~4",
"spatie/laravel-fractal": "^6.0",
"spatie/laravel-medialibrary": "^10.7",
"spomky-labs/otphp": "^11.2",
"symfony/expression-language": "^6.2",
"teamtnt/laravel-scout-tntsearch-driver": "^12.2",
"twilio/sdk": "^7.13",
"typo3/class-alias-loader": "^1.0",
"simplesoftwareio/simple-qrcode": "*",
"spatie/laravel-fractal": "^6.3",
"spatie/laravel-html": "*",
"spatie/laravel-medialibrary": "^11.11",
"spomky-labs/otphp": "^11.3",
"symfony/expression-language": "^7.2",
"teamtnt/laravel-scout-tntsearch-driver": "^14.0",
"twilio/sdk": "^8.3",
"typo3/class-alias-loader": "^1.2",
"whichbrowser/parser": "^2.1"
},
"require-dev": {
"brianium/paratest": "^6.6",
"dms/phpunit-arraysubset-asserts": "^0.5",
"filp/whoops": "^2.14",
"laravel/dusk": "^7.4",
"laravel/homestead": "^13.2",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^6.3",
"phpunit/phpunit": "^9.5.13",
"squizlabs/php_codesniffer": "^3.7",
"symfony/dom-crawler": "^6.2",
"spatie/laravel-ignition": "^2.0"
"brianium/paratest": "^7.7",
"dms/phpunit-arraysubset-asserts": "*",
"filp/whoops": "^2.16",
"laravel/dusk": "^8.2",
"laravel/homestead": "^15.0",
"mockery/mockery": "^1.6",
"nunomaduro/collision": "^8.5",
"phpunit/phpunit": "^11.5",
"squizlabs/php_codesniffer": "^3.11",
"symfony/dom-crawler": "^7.2",
"spatie/laravel-ignition": "^2.9"
},
"autoload": {
"files": [
Expand Down Expand Up @@ -223,7 +224,8 @@
"allow-plugins": {
"typo3/class-alias-loader": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"php-http/discovery": true
"php-http/discovery": true,
"tbachert/spi": true
}
}
}
4 changes: 1 addition & 3 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,13 @@
*/
Laravel\Passport\PassportServiceProvider::class,
Laravel\Scout\ScoutServiceProvider::class,
Collective\Html\HtmlServiceProvider::class,
TeamTNT\Scout\TNTSearchScoutServiceProvider::class,
Jenssegers\Agent\AgentServiceProvider::class,

/**
* ProcessMaker Service Providers
*/
ProcessMaker\Providers\AppServiceProvider::class,
ProcessMaker\Providers\ProcessMakerServiceProvider::class,
ProcessMaker\Providers\RecommendationsServiceProvider::class,
ProcessMaker\Providers\SettingServiceProvider::class,
Expand All @@ -194,9 +194,7 @@
'Agent' => Jenssegers\Agent\Facades\Agent::class,
'Docker' => ProcessMaker\Facades\Docker::class,
'ElasticScoutDriver\Factories\SearchRequestFactory' => ProcessMaker\Factories\SearchRequestFactory::class,
'Form' => Collective\Html\FormFacade::class,
'GlobalScripts' => ProcessMaker\Facades\GlobalScripts::class,
'Html' => Collective\Html\HtmlFacade::class,
'Menu' => Lavary\Menu\Facade::class,
'Redis' => Illuminate\Support\Facades\Redis::class,
'RequestDevice' => ProcessMaker\Facades\RequestDevice::class,
Expand Down
2 changes: 1 addition & 1 deletion config/mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'timeout' => null,
'local_domain' => env('MAIL_EHLO_DOMAIN', parse_url(env('APP_URL'))['host']),
'local_domain' => env('MAIL_EHLO_DOMAIN', parse_url(env('APP_URL', 'http://localhost'))['host']),
'auth_mode' => null,
'verify_peer' => env('VERIFY_PEER', false),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
return new class extends Migration {
public function __construct()
{
// I guess this is still a bug in laravel 5.7 and doctrine
// https://stackoverflow.com/questions/33140860/laravel-5-1-unknown-database-type-enum-requested
DB::getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string');

}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ public function up()
{
$model = new Comment();
$schema = Schema::connection($model->getConnectionName());
$schema->getConnection()->getDoctrineSchemaManager()
->getDatabasePlatform()
->registerDoctrineTypeMapping('enum', 'string');

$schema->table('comments', function (Blueprint $table) {
$table->string('type')->default('LOG')->change();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
*/
public function up()
{
$dbPlatform = DB::connection()->getDoctrineSchemaManager()->getDatabasePlatform();
if (!$dbPlatform->hasDoctrineTypeMappingFor('enum')) {
$dbPlatform->registerDoctrineTypeMapping('enum', 'string');
}
Schema::table('users', function (Blueprint $table) {
$table->unsignedInteger('delegation_user_id')->nullable();
$table->unsignedInteger('manager_id')->nullable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,14 @@

public function __construct()
{
DB::getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('enum', Types::STRING);

}

public function up()
{
Schema::table($this->table, function (Blueprint $table) {
$sm = Schema::getConnection()->getDoctrineSchemaManager();
$doctrineTable = $sm->listTableDetails($this->table);

if (!$doctrineTable->hasIndex($this->indexName)) {
if (!Schema::hasIndex($this->table, $this->indexName)) {
$table->index($this->column, $this->indexName);
} else {
}
});
}
Expand All @@ -44,10 +40,7 @@ public function up()
public function down()
{
Schema::table('process_request_tokens', function (Blueprint $table) {
$sm = Schema::getConnection()->getDoctrineSchemaManager();
$doctrineTable = $sm->listTableDetails($this->table);

if ($doctrineTable->hasIndex($this->indexName)) {
if (Schema::hasIndex($this->table, $this->indexName)) {
$table->dropIndex($this->indexName);
}
});
Expand Down
5 changes: 4 additions & 1 deletion tests/Feature/Api/PerformanceModelsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Illuminate\Database\Eloquent\Factory as EloquentFactory;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use ProcessMaker\Models\Group;
use ProcessMaker\Models\ScriptExecutor;
use ReflectionObject;
Expand Down Expand Up @@ -121,7 +122,9 @@ private function getTotalRecords()
$tables = [];
foreach (config('database.connections') as $name => $config) {
$connection = DB::connection($name);
$list = $connection->getDoctrineSchemaManager()->listTableNames();
$list = array_map(function ($item) {
return $item['name'];
}, Schema::getTables());
foreach ($list as $table) {
if (!isset($tables[$table])) {
$tables[$table] = $connection->table($table)->count();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class TaskSchedulerManagerTest extends TestCase

protected function setUp(): void
{
parent::__construct();
parent::setUp();
$this->manager = new TaskSchedulerManager;
}

Expand Down
6 changes: 2 additions & 4 deletions tests/unit/ProcessMaker/MediaOrderColumnIndexTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ public function it_has_order_column_index_on_media_table()
$this->artisan('migrate');

// Check if the index exists
$indexExists = Schema::getConnection()
->getDoctrineSchemaManager()
->listTableIndexes('media');
$indexExists = Schema::getIndexListing('media');

$this->assertArrayHasKey('media_order_column_index', $indexExists);
$this->assertContains('media_order_column_index', $indexExists);
}
}
6 changes: 2 additions & 4 deletions tests/unit/ProcessMaker/RecommendationEngineTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ class RecommendationEngineTest extends TestCase

private SyncRecommendations $syncRecommendations;

public function __construct()
public function setUp(): void
{
parent::__construct();
parent::setUp();

$this->syncRecommendations = app(SyncRecommendations::class);
}
Expand Down Expand Up @@ -179,8 +179,6 @@ public function testRecommendationsSync(): void
/**
* Use a factory to generate a Recommendation model's data
* without persisting it to use as mock JSON responses
*
* @return array
*/
protected function generateModelData(): array
{
Expand Down
Loading