1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 11:14:04 +00:00

fix path prefixing

This commit is contained in:
Samuel Štancl 2022-03-23 20:48:55 +01:00
parent 49ebb75f00
commit 5026f54a6d
6 changed files with 23 additions and 3 deletions

View file

@ -9,3 +9,16 @@ StyleCI will flag code style violations in your pull requests.
Run `docker-compose up -d` to start the containers. Then run `./test` to run the tests. Run `docker-compose up -d` to start the containers. Then run `./test` to run the tests.
When you're done testing, run `docker-compose down` to shut down the containers. When you're done testing, run `docker-compose down` to shut down the containers.
### Docker on M1
You can add:
```yaml
services:
mysql:
platform: linux/amd64
mysql2:
platform: linux/amd64
```
to `docker-compose.override.yml` to make `docker-compose up-d` work on M1.

View file

@ -30,7 +30,7 @@ RUN docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql \
# && if [ "${PHP_VERSION}" = "7.4" ]; then docker-php-ext-configure gd --with-freetype --with-jpeg; else docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/; fi \ # && if [ "${PHP_VERSION}" = "7.4" ]; then docker-php-ext-configure gd --with-freetype --with-jpeg; else docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/; fi \
&& docker-php-ext-install -j$(nproc) gd pdo pdo_mysql pdo_pgsql pdo_sqlite pgsql zip gmp bcmath pcntl ldap sysvmsg exif \ && docker-php-ext-install -j$(nproc) gd pdo pdo_mysql pdo_pgsql pdo_sqlite pgsql zip gmp bcmath pcntl ldap sysvmsg exif \
# install the redis php extension # install the redis php extension
&& pecl install redis-5.3.2 \ && pecl install redis-5.3.7 \
&& docker-php-ext-enable redis \ && docker-php-ext-enable redis \
# install the pcov extention # install the pcov extention
&& pecl install pcov \ && pecl install pcov \

View file

@ -0,0 +1,5 @@
services:
mysql:
platform: linux/amd64
mysql2:
platform: linux/amd64

View file

@ -67,7 +67,9 @@ class FilesystemTenancyBootstrapper implements TenancyBootstrapper
); );
if (! $finalPrefix) { if (! $finalPrefix) {
$finalPrefix = $originalRoot . '/'. $suffix; $finalPrefix = $originalRoot
? $originalRoot . '/'. $suffix
: $suffix;
} }
$this->app['config']["filesystems.disks.{$disk}.root"] = $finalPrefix; $this->app['config']["filesystems.disks.{$disk}.root"] = $finalPrefix;

View file

@ -194,7 +194,7 @@ class BootstrapperTest extends TestCase
// Check that disk prefixes respect the root_override logic // Check that disk prefixes respect the root_override logic
$this->assertSame($expected_storage_path . '/app/', $this->getDiskPrefix('local')); $this->assertSame($expected_storage_path . '/app/', $this->getDiskPrefix('local'));
$this->assertSame($expected_storage_path . '/app/public/', $this->getDiskPrefix('public')); $this->assertSame($expected_storage_path . '/app/public/', $this->getDiskPrefix('public'));
$this->assertSame('tenant' . tenant('id') . '/', ltrim($this->getDiskPrefix('s3'), '/')); $this->assertSame('tenant' . tenant('id') . '/', $this->getDiskPrefix('s3'), '/');
// Check suffixing logic // Check suffixing logic
$new_storage_path = storage_path(); $new_storage_path = storage_path();