Solar_File::exists()

static public mixed Solar_File::exists ( string $file )

Hack for » file_exists() that checks the include_path.

Parameters

  • (string) $file: Check for this file in the include_path.

Returns

  • (mixed) If the file exists and is readble in the include_path, returns the path and filename; if not, returns boolean false.

Description

Hack for » file_exists() that checks the include_path.

Use this to see if a file exists anywhere in the include_path.

<?php
$file = 'path/to/file.php';
if (Solar_File::exists('path/to/file.php')) {
    include $file;
}


Local