ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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 124 of file RootFolderTest.php.

References ALLOWED_ROOT_FOLDER_DIRS, and ALLOWED_ROOT_FOLDER_FILES.

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

◆ setUp()

RootFolderTest::setUp ( )
protected

Definition at line 112 of file RootFolderTest.php.

References ALLOWED_ROOT_FOLDER_DIRS, and ALLOWED_ROOT_FOLDER_FILES.

112  : void
113  {
114  $this->ALLOWED_ROOT_FOLDER_DIRS = array_merge(
115  self::ALLOWED_ROOT_FOLDER_DIRS,
116  explode(",", (string) getenv('ALLOWED_ROOT_FOLDER_DIRS'))
117  );
118  $this->ALLOWED_ROOT_FOLDER_FILES = array_merge(
119  self::ALLOWED_ROOT_FOLDER_FILES,
120  explode(",", (string) getenv('ALLOWED_ROOT_FOLDER_FILES'))
121  );
122  }
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 109 of file RootFolderTest.php.

◆ $ALLOWED_ROOT_FOLDER_FILES

array RootFolderTest::$ALLOWED_ROOT_FOLDER_FILES = []
protected

Definition at line 110 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',
'wopi',
'xml',
'.settings'
]

Definition at line 80 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: