| @@ 62-81 (lines=20) @@ | ||
| 59 | * |
|
| 60 | * @return object The table from the config |
|
| 61 | */ |
|
| 62 | public function getTable() |
|
| 63 | { |
|
| 64 | // get our table name from the constructor |
|
| 65 | $tableName = $this->args[0]; |
|
| 66 | ||
| 67 | // what are we doing? |
|
| 68 | $log = usingLog()->startAction("get '{$tableName}' table from runtime config"); |
|
| 69 | ||
| 70 | // get the table config |
|
| 71 | $tables = $this->getAllTables(); |
|
| 72 | ||
| 73 | // make sure we have a table |
|
| 74 | if (!isset($tables->$tableName)){ |
|
| 75 | $tables->$tableName = new BaseObject(); |
|
| 76 | } |
|
| 77 | ||
| 78 | // all done |
|
| 79 | $log->endAction(); |
|
| 80 | return $tables->$tableName; |
|
| 81 | } |
|
| 82 | ||
| 83 | public function getGroupFromTable($group) |
|
| 84 | { |
|
| @@ 509-528 (lines=20) @@ | ||
| 506 | * |
|
| 507 | * @return string |
|
| 508 | */ |
|
| 509 | public function getLocalFolder() |
|
| 510 | { |
|
| 511 | // what are we doing? |
|
| 512 | $log = usingLog()->startAction("get local folder for host '{$this->args[0]}'"); |
|
| 513 | ||
| 514 | // make sure we have valid host details |
|
| 515 | $hostDetails = $this->getHostDetails(); |
|
| 516 | ||
| 517 | // does it have a folder defined? |
|
| 518 | if (isset($hostDetails->dir)) { |
|
| 519 | $retval = $hostDetails->dir; |
|
| 520 | } |
|
| 521 | else { |
|
| 522 | $retval = getcwd(); |
|
| 523 | } |
|
| 524 | ||
| 525 | // all done |
|
| 526 | $log->endAction($retval); |
|
| 527 | return $retval; |
|
| 528 | } |
|
| 529 | } |
|
| 530 | ||