Solar_Path_Stack::find()

public mixed Solar_Path_Stack::find ( string $file )

Finds a file in the path stack.

Parameters

  • (string) $file: The file to find using the directory stack and the include_path.

Returns

  • (mixed) The relative path to the file, or false if not found using the stack.

Description

Finds a file in the path stack.

Relative paths are honored as part of the include_path.

<?php
$stack = Solar::factory('Solar_Path_Stack');
$stack->add('path/1');
$stack->add('path/2');
$stack->add('path/3');

$file = $stack->find('file.php');
// $file is now the first instance of 'file.php' found from the         
// directory stack, looking first in 'path/3/file.php', then            
// 'path/2/file.php', then finally 'path/1/file.php'.


Local