Skip to content

Commit

Permalink
fix path prefixing
Browse files Browse the repository at this point in the history
  • Loading branch information
stancl committed Mar 23, 2022
1 parent 49ebb75 commit 5026f54
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 3 deletions.
13 changes: 13 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

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.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
&& 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
&& pecl install redis-5.3.2 \
&& pecl install redis-5.3.7 \
&& docker-php-ext-enable redis \
# install the pcov extention
&& pecl install pcov \
Expand Down
5 changes: 5 additions & 0 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
services:
mysql:
platform: linux/amd64
mysql2:
platform: linux/amd64
4 changes: 3 additions & 1 deletion src/Bootstrappers/FilesystemTenancyBootstrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ public function bootstrap(Tenant $tenant)
);

if (! $finalPrefix) {
$finalPrefix = $originalRoot . '/'. $suffix;
$finalPrefix = $originalRoot
? $originalRoot . '/'. $suffix
: $suffix;
}

$this->app['config']["filesystems.disks.{$disk}.root"] = $finalPrefix;
Expand Down
2 changes: 1 addition & 1 deletion tests/BootstrapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public function filesystem_data_is_separated()
// Check that disk prefixes respect the root_override logic
$this->assertSame($expected_storage_path . '/app/', $this->getDiskPrefix('local'));
$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
$new_storage_path = storage_path();
Expand Down
Empty file removed tests/Etc/tmp/queuetest.json
Empty file.

0 comments on commit 5026f54

Please sign in to comment.