Solar_Dir::exists()

static public mixed Solar_Dir::exists ( string $dir )

Hack for » is_dir() that checks the include_path.

Parameters

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

Returns

  • (mixed) If the directory exists in the include_path, returns the absolute path; if not, returns boolean false.

Description

Hack for » is_dir() that checks the include_path.

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

<?php
$dir = Solar_Dir::exists('path/to/dir')
if ($dir) {
    $files = scandir($dir);
} else {
    echo "Not found in the include-path.";
}


Local