TYPO3 CMS  TYPO3_6-2
RootNode.php
Go to the documentation of this file.
1 <?php
3 
18 
22 class RootNode extends DirectoryNode implements RootNodeInterface {
23 
32  public function __construct(array $structure, NodeInterface $parent = NULL) {
33  if (!is_null($parent)) {
34  throw new \TYPO3\CMS\Install\FolderStructure\Exception\RootNodeException(
35  'Root node must not have parent',
36  1366140117
37  );
38  }
39 
40  if (!isset($structure['name'])
41  || ($this->isWindowsOs() && substr($structure['name'], 1, 2) !== ':/')
42  || (!$this->isWindowsOs() && $structure['name'][0] !== '/')
43  ) {
44  throw new \TYPO3\CMS\Install\FolderStructure\Exception\InvalidArgumentException(
45  'Root node expects absolute path as name',
46  1366141329
47  );
48  }
49  $this->name = $structure['name'];
50 
51  if (isset($structure['targetPermission'])) {
52  $this->setTargetPermission($structure['targetPermission']);
53  }
54 
55  if (array_key_exists('children', $structure)) {
56  $this->createChildren($structure['children']);
57  }
58  }
59 
65  public function getStatus() {
66  $result = array();
67  if (!$this->exists()) {
68  $status = new Status\ErrorStatus();
69  $status->setTitle($this->getAbsolutePath() . ' does not exist');
70  $result[] = $status;
71  } else {
72  $result = $this->getSelfStatus();
73  }
74  $result = array_merge($result, $this->getChildrenStatus());
75  return $result;
76  }
77 
83  public function getAbsolutePath() {
84  return $this->name;
85  }
86 }
__construct(array $structure, NodeInterface $parent=NULL)
Definition: RootNode.php:32
if($list_of_literals) if(!empty($literals)) if(!empty($literals)) $result
Analyse literals to prepend the N char to them if their contents aren&#39;t numeric.