要获取这些常量,以便您可以反向查找所有整数的含义,请执行以下操作
<?php
$constants = array_flip($this->getSvnConstants('SVN_WC_STATUS'));
$status = svn_status();
foreach($status as &$v)
{
$v['text_status'] = $constants[$v['text_status']];
$v['repos_text_status'] = $constants[$v['repos_text_status']];
$v['prop_status'] = $constants[$v['prop_status']];
$v['repos_prop_status'] = $constants[$v['repos_prop_status']];
}
public function getSvnConstants($filter='SVN_')
{
$constants = array();
foreach (get_defined_constants() as $key => $value)
if (substr($key, 0, strlen($filter)) == $filter)
$constants[$key] = $value;
return $constants;
}
?>