ILIAS  release_8 Revision v8.23
RootFolderTest Class Reference

Class RootFolderTest. More...

+ Inheritance diagram for RootFolderTest:
+ Collaboration diagram for RootFolderTest:

Protected Member Functions

 setUp ()
 

Protected Attributes

array $ALLOWED_ROOT_FOLDER_DIRS = []
 
array $ALLOWED_ROOT_FOLDER_FILES = []
 

Private Member Functions

 getAppRootFolderOrFail ()
 

Private Attributes

const ALLOWED_ROOT_FOLDER_FILES
 
const ALLOWED_ROOT_FOLDER_DIRS
 

Detailed Description

Class RootFolderTest.

Author
Michael Jansen mjans.nosp@m.en@d.nosp@m.ataba.nosp@m.y.de

Definition at line 27 of file RootFolderTest.php.

Member Function Documentation

◆ getAppRootFolderOrFail()

RootFolderTest::getAppRootFolderOrFail ( )
private

Definition at line 121 of file RootFolderTest.php.

References $i, ALLOWED_ROOT_FOLDER_DIRS, and ALLOWED_ROOT_FOLDER_FILES.

121  : string
122  {
123  $app_root_folder = getcwd();
124 
125  for ($i = 0; $i < 20 && !is_file($app_root_folder . '/index.php'); $i++) {
126  $app_root_folder .= '/..';
127  }
128 
129  if (!is_file($app_root_folder . '/index.php')) {
130  $this->fail('Could not determine ILIAS root folder');
131  }
132 
133  return $app_root_folder;
134  }
$i
Definition: metadata.php:41

◆ setUp()

RootFolderTest::setUp ( )
protected

Definition at line 109 of file RootFolderTest.php.

References ALLOWED_ROOT_FOLDER_DIRS, and ALLOWED_ROOT_FOLDER_FILES.

109  : void
110  {
111  $this->ALLOWED_ROOT_FOLDER_DIRS = array_merge(
112  self::ALLOWED_ROOT_FOLDER_DIRS,
113  explode(",", (string) getenv('ALLOWED_ROOT_FOLDER_DIRS'))
114  );
115  $this->ALLOWED_ROOT_FOLDER_FILES = array_merge(
116  self::ALLOWED_ROOT_FOLDER_FILES,
117  explode(",", (string) getenv('ALLOWED_ROOT_FOLDER_FILES'))
118  );
119  }
const ALLOWED_ROOT_FOLDER_FILES
const ALLOWED_ROOT_FOLDER_DIRS

Field Documentation

◆ $ALLOWED_ROOT_FOLDER_DIRS

array RootFolderTest::$ALLOWED_ROOT_FOLDER_DIRS = []
protected

Definition at line 106 of file RootFolderTest.php.

◆ $ALLOWED_ROOT_FOLDER_FILES

array RootFolderTest::$ALLOWED_ROOT_FOLDER_FILES = []
protected

Definition at line 107 of file RootFolderTest.php.

◆ ALLOWED_ROOT_FOLDER_DIRS

const RootFolderTest::ALLOWED_ROOT_FOLDER_DIRS
private
Initial value:
= [
'.git',
'.github',
'.idea',
'CI',
'Customizing',
'Modules',
'Services',
'cron',
'data',
'dicto',
'docs',
'extern',
'include',
'lang',
'libs',
'node_modules',
'setup',
'src',
'sso',
'templates',
'test',
'tests',
'webservice',
'xml',
'.settings'
]

Definition at line 78 of file RootFolderTest.php.

Referenced by getAppRootFolderOrFail(), and setUp().

◆ ALLOWED_ROOT_FOLDER_FILES

const RootFolderTest::ALLOWED_ROOT_FOLDER_FILES
private

Definition at line 29 of file RootFolderTest.php.

Referenced by getAppRootFolderOrFail(), and setUp().


The documentation for this class was generated from the following file: