request = $request; $this->readFactory = $readFactory; } /** * Returns true if doc root is pub/ and not BP * * @return bool */ public function isPub() { $rootBasePath = $this->request->getServer('DOCUMENT_ROOT'); $readDirectory = $this->readFactory->create(DirectoryList::ROOT); return (substr($rootBasePath, -strlen('/pub')) === '/pub') && !$readDirectory->isExist($rootBasePath . 'setup'); } }