<?php
interface DirectoryBehaviorInterface {
}
/**
* X Autoload plugins are for:
* - More exotic autoload patterns that are incompatible with PSR-0 or PEAR
* - Situations where we don't want to register a ton of namespaces, and using
* a plugin instead gives us performance benefits.
*/
interface xautoload_FinderPlugin_Interface extends DirectoryBehaviorInterface {
/**
* Find the file for a class that in PSR-0 or PEAR would be in
* $psr_0_root . '/' . $path_fragment . $path_suffix
*
* E.g.:
* - The class we look for is Some\Namespace\Some\Class
* - The file is actually in "exotic/location.php". This is not following
* PSR-0 or PEAR standard, so we need a plugin.
* -> The class finder will transform the class name to
* "Some/Namespace/Some/Class.php"
* - The plugin was registered for the namespace "Some\Namespace". This is
* because all those exotic classes all begin with Some\Namespace\
* -> The arguments will be:
* ($api = the API object, see below)
* $path_fragment = "Some/Namespace/"
* $path_suffix = "Some/Class.php"
* $api->getClass() gives the original class name, if we still need it.
* -> We are supposed to:
* if ($api->suggestFile('exotic/location.php')) {
* return TRUE;
* }
*
* @param InjectedApiInterface $api
* An object with a suggestFile() method.
* We are supposed to suggest files until suggestFile() returns TRUE, or we
* have no more suggestions.
* @param string $path_fragment
* The key that this plugin was registered with.
* With trailing DIRECTORY_SEPARATOR.
* @param string $path_suffix
* Second part of the canonical path, ending with '.php'.
*
* @return bool|NULL
* TRUE, if the file was found.
* FALSE, otherwise.
*/
function findFile($api, $path_fragment, $path_suffix);
}
/**
* X Autoload plugins are for:
* - More exotic autoload patterns that are incompatible with PSR-0 or PEAR
* - Situations where we don't want to register a ton of namespaces, and using
* a plugin instead gives us performance benefits.
*/
interface FinderPluginInterface extends xautoload_FinderPlugin_Interface {
/**
* Find the file for a class that in PSR-0 or PEAR would be in
* $psr_0_root . '/' . $path_fragment . $path_suffix
*
* E.g.:
* - The class we look for is Some\Namespace\Some\Class
* - The file is actually in "exotic/location.php". This is not following
* PSR-0 or PEAR standard, so we need a plugin.
* -> The class finder will transform the class name to
* "Some/Namespace/Some/Class.php"
* - The plugin was registered for the namespace "Some\Namespace". This is
* because all those exotic classes all begin with Some\Namespace\
* -> The arguments will be:
* ($api = the API object, see below)
* $path_fragment = "Some/Namespace/"
* $path_suffix = "Some/Class.php"
* $api->getClass() gives the original class name, if we still need it.
* -> We are supposed to:
* if ($api->suggestFile('exotic/location.php')) {
* return TRUE;
* }
*
* @param InjectedApiInterface $api
* An object with a suggestFile() method.
* We are supposed to suggest files until suggestFile() returns TRUE, or we
* have no more suggestions.
* @param string $path_fragment
* The key that this plugin was registered with.
* With trailing DIRECTORY_SEPARATOR.
* @param string $path_suffix
* Second part of the canonical path, ending with '.php'.
* @param int|string $id
* Id under which the plugin was registered.
* This may be a numeric id, or a string key.
*
* @return bool|NULL
* TRUE, if the file was found.
* FALSE, otherwise.
*/
function findFile($api, $path_fragment, $path_suffix, $id = NULL);
}
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename: /in/HJG3Z
function name: (null)
number of ops: 3
compiled vars: none
line #* E I O op fetch ext return operands
-------------------------------------------------------------------------------------
16 0 E > DECLARE_CLASS 'xautoload_finderplugin_interface'
65 1 DECLARE_CLASS 'finderplugininterface'
107 2 > RETURN 1
Class DirectoryBehaviorInterface: [no user functions]
Class xautoload_FinderPlugin_Interface:
Function findfile:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename: /in/HJG3Z
function name: findFile
number of ops: 4
compiled vars: !0 = $api, !1 = $path_fragment, !2 = $path_suffix
line #* E I O op fetch ext return operands
-------------------------------------------------------------------------------------
54 0 E > RECV !0
1 RECV !1
2 RECV !2
3 > RETURN null
End of function findfile
End of class xautoload_FinderPlugin_Interface.
Class FinderPluginInterface:
Function findfile:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename: /in/HJG3Z
function name: findFile
number of ops: 5
compiled vars: !0 = $api, !1 = $path_fragment, !2 = $path_suffix, !3 = $id
line #* E I O op fetch ext return operands
-------------------------------------------------------------------------------------
106 0 E > RECV !0
1 RECV !1
2 RECV !2
3 RECV_INIT !3 null
4 > RETURN null
End of function findfile
End of class FinderPluginInterface.