本文整理汇总了PHP中Actions::obj方法的典型用法代码示例。如果您正苦于以下问题:PHP Actions::obj方法的具体用法?PHP Actions::obj怎么用?PHP Actions::obj使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Actions
的用法示例。
在下文中一共展示了Actions::obj方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getInstance
public static function getInstance($path)
{
global $plugin;
$plugin = $path;
if (!self::$obj instanceof self) {
self::$obj = new self();
$dom = new DOMDocument();
$dom->load(dirname(__FILE__) . "/{$path}/actions.xml");
if (@$dom->validate()) {
$packages = $dom->getElementsByTagName("package");
foreach ($packages as $package) {
$actions = $package->getElementsByTagName('action');
$action_tem = array();
foreach ($actions as $action) {
$action_tem['file'] = $action->getAttributeNode('file')->value;
unset($action_tem['class']);
if ($action->hasAttribute('class')) {
$action_tem['class'] = $action->getAttributeNode('class')->value;
}
$action_tem['method'] = $action->getAttributeNode('method')->value;
$returns = $action->getElementsByTagName('return');
$return_tem = array();
foreach ($returns as $return) {
$return_tem[$return->getAttributeNode('name')->value] = $return->nodeValue;
}
$action_tem['returns'] = $return_tem;
self::$action_info[$package->getAttributeNode('name')->value . '_' . $action->getAttributeNode('name')->value] = $action_tem;
}
// var_dump( self::$action_info);
}
} else {
echo "此XML文件不符合规范!";
exit;
}
}
return self::$obj;
}