Skip to content
Merged
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
15 changes: 9 additions & 6 deletions ProcessMaker/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
namespace ProcessMaker;

use Igaster\LaravelTheme\Facades\Theme;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Foundation\Application as IlluminateApplication;
use Illuminate\Foundation\PackageManifest;
use Illuminate\Support\Facades\Auth;

/**
Expand Down Expand Up @@ -78,13 +80,14 @@ public function path($path = '')
return $this->basePath . DIRECTORY_SEPARATOR . 'ProcessMaker' . ($path ? DIRECTORY_SEPARATOR . $path : $path);
}

public function setStoragePath($path)
public function registerConfiguredProviders()
{
$this->storagePath = $path;
}
// Must be rebound before registerConfiguredProviders() runs but after bootstrapping is done
// so we can access storage and cache facades.
$this->singleton(PackageManifest::class, fn () => new LicensedPackageManifest(
new Filesystem, $this->basePath(), $this->getCachedPackagesPath()
));

public function getStoragePath()
{
return $this->storagePath;
parent::registerConfiguredProviders();
}
}
4 changes: 4 additions & 0 deletions ProcessMaker/Console/Commands/TenantsList.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ public function handle()
$formattedTenants = $tenants->map(function ($tenant) {
$config = $tenant->config;

if (isset($config['app.key'])) {
$config['app.key'] = substr($config['app.key'], 0, 30);
}

// Json encode, pretty print without slashes
$config = json_encode($config, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);

Expand Down
14 changes: 14 additions & 0 deletions ProcessMaker/LicensedPackageManifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,20 @@ class LicensedPackageManifest extends PackageManifest

const LAST_PACKAGE_DISCOVERY = 0;

/**
* Consider this the beginning of licenesing refactor for multitenancy.
*
* For now, this will just move the Spatie MultitenancyServiceProvider to the beginning of the service providers.
*/
protected function getManifest()
{
$manifest = parent::getManifest();
$multitenancyKey = 'spatie/laravel-multitenancy';

// Make sure the MultitenancyServiceProvider is at the beginning of the manifest
return [$multitenancyKey => $manifest[$multitenancyKey]] + $manifest;
}

protected function packagesToIgnore()
{
$packagesToIgnore = $this->loadPackagesToIgnore()->all();
Expand Down
2 changes: 1 addition & 1 deletion ProcessMaker/Multitenancy/SwitchTenant.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function makeCurrent(IsTenant $tenant): void
$tenantStoragePath = base_path('storage/tenant_' . $tenant->id);

$app = app();
$app->setStoragePath($tenantStoragePath);
$app->useStoragePath($tenantStoragePath);

// Create the tenant storage directory if it doesn't exist
// TODO: Move these to somewhere else - should not be run on every request
Expand Down
6 changes: 6 additions & 0 deletions ProcessMaker/Providers/AuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ public function boot()

public function defineGates()
{
// No need to run this in console and it generates
// errors in multitenancy mode
if (!app()->environment('testing') && app()->runningInConsole()) {
return;
}

try {
// Cache the permissions for a day to improve performance
$permissions = Cache::remember('permissions', 86400, function () {
Expand Down
7 changes: 0 additions & 7 deletions ProcessMaker/Providers/LicenseServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,4 @@ public function boot(): void
LicensedPackageManifest::discoverPackagesOnce();
}
}

public function register(): void
{
$this->app->singleton(PackageManifest::class, fn () => new LicensedPackageManifest(
new Filesystem, $this->app->basePath(), $this->app->getCachedPackagesPath()
));
}
}
4 changes: 0 additions & 4 deletions ProcessMaker/Providers/ProcessMakerServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,6 @@ public function register(): void
// Miscellaneous vendor customization
static::configureVendors();

$this->app->singleton(PackageManifest::class, fn () => new LicensedPackageManifest(
new Filesystem, $this->app->basePath(), $this->app->getCachedPackagesPath()
));

$this->app->extend(MigrateCommand::class, function () {
return new ExtendedMigrateCommand(
app('migrator'),
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "processmaker/processmaker",
"version": "4.15.7+beta-1",
"version": "4.15.7+beta-2",
"description": "BPM PHP Software",
"keywords": [
"php bpm processmaker"
Expand Down Expand Up @@ -106,7 +106,7 @@
"Gmail"
],
"processmaker": {
"build": "8c08f440",
"build": "fd8586e5",
"cicd-enabled": true,
"custom": {
"package-ellucian-ethos": "1.19.7",
Expand Down Expand Up @@ -160,7 +160,7 @@
"package-data-sources": "1.34.1",
"package-decision-engine": "1.16.1",
"package-dynamic-ui": "1.28.2",
"package-email-start-event": "1.0.3",
"package-email-start-event": "1.0.4",
"package-files": "1.23.0",
"package-googleplaces": "1.12.0",
"package-photo-video": "1.6.1",
Expand Down Expand Up @@ -229,4 +229,4 @@
"tbachert/spi": true
}
}
}
}
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
@input="onInput"
@paste="onPaste"
>
<small class="tw-text-gray-500 tw-text-xs">
{{ localName.length }}/200 {{ t('characters') }}
</small>
</template>
<template v-else>
<div
Expand Down