mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 11:37:56 +08:00
![dependabot[bot]](/assets/img/avatar_default.png)
* chore(deps): bump glob-parent in /extensions/emoji/js Bumps [glob-parent](https://github.com/gulpjs/glob-parent) from 3.1.0 to 5.1.2. - [Release notes](https://github.com/gulpjs/glob-parent/releases) - [Changelog](https://github.com/gulpjs/glob-parent/blob/main/CHANGELOG.md) - [Commits](https://github.com/gulpjs/glob-parent/compare/v3.1.0...v5.1.2) --- updated-dependencies: - dependency-name: glob-parent dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * Apply fixes from StyleCI [ci skip] [skip ci] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: StyleCI Bot <bot@styleci.io>
54 lines
1.2 KiB
PHP
54 lines
1.2 KiB
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of Flarum.
|
|
*
|
|
* For detailed copyright and license information, please view the
|
|
* LICENSE file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Flarum\Testing\integration;
|
|
|
|
trait UsesTmpDir
|
|
{
|
|
public function tmpDir()
|
|
{
|
|
return getenv('FLARUM_TEST_TMP_DIR_LOCAL') ?: getenv('FLARUM_TEST_TMP_DIR') ?: __DIR__.'/tmp';
|
|
}
|
|
|
|
public function setupTmpDir()
|
|
{
|
|
$DIRS_NEEDED = [
|
|
'/',
|
|
'/public',
|
|
'/public/assets',
|
|
'/storage',
|
|
'/storage/formatter',
|
|
'/storage/sessions',
|
|
'/storage/views',
|
|
'/vendor',
|
|
'/vendor/composer'
|
|
];
|
|
|
|
$FILES_NEEDED = [
|
|
'/vendor/composer/installed.json' => '{}'
|
|
];
|
|
|
|
$tmpDir = $this->tmpDir();
|
|
|
|
foreach ($DIRS_NEEDED as $path) {
|
|
$fullPath = $tmpDir.$path;
|
|
if (! file_exists($fullPath)) {
|
|
mkdir($fullPath);
|
|
}
|
|
}
|
|
|
|
foreach ($FILES_NEEDED as $path => $contents) {
|
|
$fullPath = $tmpDir.$path;
|
|
if (! file_exists($fullPath)) {
|
|
file_put_contents($fullPath, $contents);
|
|
}
|
|
}
|
|
}
|
|
}
|