Example #1
0
 public function props()
 {
     if ($this->format() == 'v1') {
         return unyaml(data_directory() . '/' . $this->pth);
     } elseif ($this->format() == 'md') {
         $parser = new Mni\FrontYAML\Parser();
         $document = $parser->parse(file_get_contents(data_directory() . '/' . $this->pth));
         $yaml = $document->getYAML();
         $html = $document->getContent();
         return $yaml;
     }
 }
Example #2
0
 public static function setUpBeforeClass()
 {
     data_directory(__DIR__ . '/data');
 }
Example #3
0
 public function testOrderedExamplesWithMeta()
 {
     $t = ordered_exampls('ordered_examples/2');
     $fn = function ($itm) {
         return data_directory() . '/ordered_examples/2/' . $itm;
     };
     $this->assertEquals($t, array_map($fn, [2, 3, 1]));
 }
Example #4
0
 /**
  * Вернуть отсортированный список объектов-подкаталогов по пути
  */
 public static function getSub($path = '')
 {
     if ($path) {
         $path .= '/';
     }
     $dirs = glob(data_directory() . '/' . $path . '*', GLOB_ONLYDIR);
     if (!$dirs) {
         return [];
     }
     return sortByName(array_map(function ($pth) {
         return new Category(str_replace(data_directory() . '/', '', $pth));
     }, $dirs));
 }
Example #5
0
function strip_data_direcotry($pth)
{
    return str_replace(data_directory() . '/', '', $pth);
}
Example #6
0
$available5 = $df_array5[1];
$gb5 = $available5 / 1000000;
$gb5_display = round($gb5, 0);
$available5 = preg_replace('/(?<=\\d)(?=(\\d\\d\\d)+$)/', ',', $available5);
$data_directory5 = data_directory($path5);
// list entire directory contents as a string
$mount5 = $df_array5[2];
#$location5=($filesys4==$filesys1)?"Internal":"External";
$path6 = $inputDirRoot;
$df_array6 = df_available($path6);
$filesys6 = $df_array6[0];
$available6 = $df_array6[1];
$gb6 = $available6 / 1000000;
$gb6_display = round($gb6, 0);
$available6 = preg_replace('/(?<=\\d)(?=(\\d\\d\\d)+$)/', ',', $available6);
$data_directory6 = data_directory($path6);
// list entire directory contents as a string
$mount6 = $df_array6[2];
#$location6=($filesys6==$filesys1)?"Internal":"External";
## Validate volumes
$validate_mysql = validate_dir("/xGDBvm/data/", "mysql", "mysql directory", "present", "missing");
$mysql_valid = $validate_mysql[0];
$mysql_class = $validate_mysql[1];
$validate_scratch = validate_dir("/xGDBvm/data/", "scratch", "scratch directory", "present", "missing");
$scratch_valid = $validate_scratch[0];
$scratch_class = $validate_scratch[1];
$validate_tmp = validate_dir("/xGDBvm/data/", "tmp", "tmp directory", "present", "missing");
$tmp_valid = $validate_tmp[0];
$tmp_class = $validate_tmp[1];
if (file_exists("/xGDBvm/admin/iplant")) {
    // xGDBvm-iPlant only