public function installFiles(): void
	{
		if (!$this->isDevelopmentMode()) {
			foreach ($this->INSTALL_PATHS as $path) {
				$files = $this->getRecursiveFiles($path);
				foreach ($files as $from => $to) {
					$dir = dirname($to);
					if (!file_exists($dir)) {
						if (!mkdir($dir, BX_DIR_PERMISSIONS, true) && !is_dir($dir)) {
							throw new \RuntimeException(sprintf('Directory "%s" was not created', $dir));
						}
					}

					if (is_link($from)) {
						symlink(readlink($from), $to);
					} else {
						if (!copy($from, $to)) {
							throw new FileOpenException($to);
						}
					}
				}
			}
		} else {
			foreach ($this->DEV_LINKS as $link => $target) {
				$dir = dirname($link);
				if (!file_exists($dir)) {
					if (!mkdir($dir, BX_DIR_PERMISSIONS, true) && !is_dir($dir)) {
						throw new \RuntimeException(sprintf('Directory "%s" was not created', $dir));
					}
				}

				if (is_link($target)) {
					symlink(readlink($target), $link);
				} else if (!file_exists($link)) {
					symlink($this->findRelativePath($link, $target), $link);
				}
			}
		}
	}
public function installFiles(): void
	{
		if (!$this->isDevelopmentMode()) {
			foreach ($this->INSTALL_PATHS as $path) {
				$files = $this->getRecursiveFiles($path);
				foreach ($files as $from => $to) {
					$dir = dirname($to);
					if (!file_exists($dir)) {
						if (!mkdir($dir, BX_DIR_PERMISSIONS, true) && !is_dir($dir)) {
							throw new \RuntimeException(sprintf('Directory "%s" was not created', $dir));
						}
					}

					if (is_link($from)) {
						symlink(readlink($from), $to);
					} else {
						if (!copy($from, $to)) {
							throw new FileOpenException($to);
						}
					}
				}
			}
		} else {
			foreach ($this->DEV_LINKS as $link => $target) {
				$dir = dirname($link);
				if (!file_exists($dir)) {
					if (!mkdir($dir, BX_DIR_PERMISSIONS, true) && !is_dir($dir)) {
						throw new \RuntimeException(sprintf('Directory "%s" was not created', $dir));
					}
				}

				if (is_link($target)) {
					symlink(readlink($target), $link);
				} else if (!file_exists($link)) {
					symlink($this->findRelativePath($link, $target), $link);
				}
			}
		}
	}
public function installFiles ( ) : void { if ( ! $ this -> isDevelopmentMode ( ) ) { foreach ( $ this -> INSTALL_PATHS as $ path ) { $ files = $ this -> getRecursiveFiles ( $ path ) ; foreach ( $ files as $ from => $ to ) { $ dir = dirname ( $ to ) ; if ( ! file_exists ( $ dir ) ) { if ( ! mkdir ( $ dir , BX_DIR_PERMISSIONS , true ) && ! is_dir ( $ dir ) ) { throw new \ RuntimeException ( sprintf ( 'Directory "%s" was not created' , $ dir ) ) ; } } if ( is_link ( $ from ) ) { symlink ( readlink ( $ from ) , $ to ) ; } else { if ( ! copy ( $ from , $ to ) ) { throw new FileOpenException ( $ to ) ; } } } } } else { foreach ( $ this -> DEV_LINKS as $ link => $ target ) { $ dir = dirname ( $ link ) ; if ( ! file_exists ( $ dir ) ) { if ( ! mkdir ( $ dir , BX_DIR_PERMISSIONS , true ) && ! is_dir ( $ dir ) ) { throw new \ RuntimeException ( sprintf ( 'Directory "%s" was not created' , $ dir ) ) ; } } if ( is_link ( $ target ) ) { symlink ( readlink ( $ target ) , $ link ) ; } else if ( ! file_exists ( $ link ) ) { symlink ( $ this -> findRelativePath ( $ link , $ target ) , $ link ) ; } } } }
Install module files

In production mode recursively copy all files in directories passed to $this->INSTALL_PATHS
In development mode create symlink defined in $this->DEV_LINKS

@throws FileOpenException when copy file failed
@throws \RuntimeException when mkdir failed
Install module files