PHP 8.5.0 Alpha 2 available for testing

Voting

: nine minus six?
(Example: nine)

The Note You're Voting On

daevid at daevid dot com
8 years ago
To get these constants so you can reverse lookup what all the integers mean, do this:

<?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;
}

?>

<< Back to user notes page

To Top