Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Checks whether a file or directory exists
<?php file_exists(string $filename): bool
<?php {
$tmp = __DIR__ . '/_runtime_components.json';
file_exists($tmp) && unlink($tmp);
}
public function setUp(): void
<?php $this->tweakApplication(function () use ($isUsingAlpineV3) {
$tmp = __DIR__ . '/_runtime_components.json';
if (file_exists($tmp)) {
$components = json_decode(file_get_contents($tmp));
<?php $cacheDir = $root.'/cache';
$cacheDir = $root.'/cache';
$viewsDir = $cacheDir.'/views';
if (! file_exists($cacheDir)) mkdir($cacheDir);
if (! file_exists($viewsDir)) mkdir($viewsDir);
$packagesCache = $cacheDir.'/packages.php';
file_put_contents($packagesCache, '<?php return [];');
<?php $cacheDir = $root.'/cache';
$viewsDir = $cacheDir.'/views';
if (! file_exists($cacheDir)) mkdir($cacheDir);
if (! file_exists($viewsDir)) mkdir($viewsDir);
$packagesCache = $cacheDir.'/packages.php';
file_put_contents($packagesCache, '<?php return [];');
$servicesCache = $cacheDir.'/services.php';
<?php $tmp = __DIR__ . '/_runtime_components.json';
if (file_exists($tmp)) {
[$id, $testClass, $method] = json_decode(file_get_contents($tmp), associative: true);
<?php {
$tmp = __DIR__ . '/_runtime_components.json';
file_exists($tmp) && unlink($tmp);
}
function breakIntoATinkerShell($browsers, $e)
<?php $assetWarning = null;
if (! file_exists(public_path('vendor/livewire/manifest.json'))) {
return [$url, $assetWarning];
}
<?php protected function resolveStubPath($stub)
{
return file_exists($customPath = $this->laravel->basePath(trim($stub, '/')))
? $customPath
: __DIR__.$stub;
}
<?php return $this->option('schema-path');
}
if (file_exists($path = database_path('schema/'.$connection->getName().'-schema.dump'))) {
return $path;
}
<?php public function exists($path)
{
return file_exists($path);
}
<?php protected function ensureDirectoryExists($path)
{
if (! file_exists(dirname($path))) {
@mkdir(dirname($path), 0777, true);
}
}
<?php if (file_exists($cached = $app->getCachedConfigPath())) {
$items = require $cached;
$app->instance('config_loaded_from_cache', $loadedFromCache = true);
<?php protected function mergeAdditionalProviders(Application $app)
{
if (static::$bootstrapProviderPath &&
file_exists(static::$bootstrapProviderPath)) {
$packageProviders = require static::$bootstrapProviderPath;
foreach ($packageProviders as $index => $provider) {
<?php $this->app->booted(function () use ($channels, $attributes) {
Broadcast::routes(! empty($attributes) ? $attributes : null);
if (file_exists($channels)) {
require $channels;
}
});
<?php $this->installSanctum();
}
if (file_exists($apiRoutesPath = $this->laravel->basePath('routes/api.php')) &&
! $this->option('force')) {
$this->components->error('API routes file already exists.');
} else {