file_exists

Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Checks whether a file or directory exists
<?php file_exists(string $filename): bool
<?php             $filePath

        );



        if (file_exists($downloadPath)) {

            unlink($downloadPath);

        }
<?php         $zip = new ZipArchive();

        $resource = $zip->open($filePath);



        if (!file_exists($unzipPath)) {

            mkdir($unzipPath, 0755, true);

        }
<?php             $filePath

        );



        if (file_exists($downloadPath)) {

            unlink($downloadPath);

        }
<?php         $zip = new ZipArchive();

        $resource = $zip->open($filePath);



        if (!file_exists($unzipPath)) {

            mkdir($unzipPath, 0755, true);

        }
<?php $appRoot = getenv('LAMBDA_TASK_ROOT');



if (getenv('BREF_DOWNLOAD_VENDOR')) {

    if(! file_exists('/tmp/vendor') || ! file_exists('/tmp/vendor/autoload.php')) {

        require_once '/opt/bref/breftoolbox.php';



        \Bref\ToolBox\BrefToolBox::downloadAndConfigureVendor();
<?php             $filePath

        );



        if (file_exists($downloadPath)) {

            unlink($downloadPath);

        }
<?php         $zip = new ZipArchive();

        $resource = $zip->open($filePath);



        if (!file_exists($unzipPath)) {

            mkdir($unzipPath, 0755, true);

        }
<?php ];

foreach ($layers as $layer => $layerDescription) {

    $file = __DIR__ . "/../export/$layer.zip";

    if (! file_exists($file)) {

        echo "File $file does not exist: generate the archives first\n";

        exit(1);

    }
<?php             $profile = getenv('AWS_PROFILE') ?: 'default';

        }



        if (! file_exists('serverless.yml')) {

            $io->error('No `serverless.yml` file found.');



            return 1;
<?php             return 1;

        }



        if (file_exists('serverless.yml') || file_exists('index.php')) {

            $io->error('The directory already contains a `serverless.yml` and/or `index.php` file.');



            return 1;
<?php             throw new Exception('You cannot provide both a function name and the --handler= option.');

        }



        if ($config !== null && ! file_exists($config)) {

            throw new Exception("The serverless file '$config' does not exist.");

        }
<?php         }



        if ($file) {

            if (! file_exists($file)) {

                throw new Exception("The file '$file' does not exist.");

            }

            $data = file_get_contents($file);
<?php     private function handlerFromServerlessYml(string $function, ?string $config): string

    {

        $file = $config ?? 'serverless.yml';

        if (! file_exists($file)) {

            throw new Exception("No `serverless.yml` file was found to resolve function $function.\nIf you do not use serverless.yml, pass the handler via the `--handler` option: vendor/bin/bref local --handler=file.php\nIf your serverless.yml file is stored elsewhere, use the `--config` option: vendor/bin/bref local --config=foo/serverless.yml");

        }
<?php     {

        clearstatcache(false, self::SOCKET);



        return file_exists(self::SOCKET);

    }



    private function eventToFastCgiRequest(HttpRequestEvent $event, Context $context): ProvidesRequestData
<?php     private function killExistingFpm(): void

    {


        if (! file_exists(self::PID_FILE)) {

            unlink(self::SOCKET);

            return;

        }