method history documentation in bbn\Ide\Directories
Returns all backup history of a file.
function($url)
{
( $dir = $this->dirFromUrl($url) ) &&
( $dir_cfg = $this->dir($dir) ) &&
\defined('BBN_USER_PATH')
){
$res = [];
$all = [];
// IDE backup path
$path = BBN_USER_PATH."ide/backup/$dir";
// Remove dir name from url
$file = substr($url, \strlen($dir), \strlen($url));
// MVC
if ( !empty($dir_cfg['tabs']) ){
foreach ( $dir_cfg['tabs'] as $t ){
if ( empty($t['fixed']) ){
// The file's backup path of the MVC's tab
$p = $path . $t['path'] . $file . '/';
// Get history
$all = self::getHistory($p, $t, $all, true);
}
}
}
else {
// The file's backup path of the MVC's tab
$p = $path . $file . '/';
// Get history
$all = self::getHistory($p, $dir_cfg, $all);
}
if ( !empty($all) ){
foreach ( $all as $i => $a ){
if ( !empty($dir_cfg['tabs']) ){
$tmp = [];
foreach ( $a as $k => $b ){
array_push($tmp, [
'text' => $k,
'items' => $b
]);
}
}
array_push($res, [
'text' => $i,
'items' => !empty($tmp) ? $tmp : $a
]);
}
}
return ['list' => $res];
}
}
Returns all backup history of a file. BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way
This website uses cookies to ensure you get the best experience on our website.
© 2011-2025
BBN Solutions