本文整理匯總了PHP中Cx\Lib\FileSystem\FileSystem::init方法的典型用法代碼示例。如果您正苦於以下問題:PHP FileSystem::init方法的具體用法?PHP FileSystem::init怎麽用?PHP FileSystem::init使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Cx\Lib\FileSystem\FileSystem
的用法示例。
在下文中一共展示了FileSystem::init方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: checkFtpAccess
/**
* Check whether the configuration in the configurations file is correct or not
* This method displays a warning message on top of the page when the ftp connection failed or the configuration
* is disabled
*/
protected function checkFtpAccess()
{
global $_ARRAYLANG;
// Only check FTP access if SystemInfo has been licensed.
// SystemInfo is a component that allows access to the webserver.
// SystemInfo should only be licensed if the website is run on a self-hosted environment
if (!in_array('SystemInfo', \Env::get('cx')->getLicense()->getLegalComponentsList())) {
return;
}
// if ftp access is not activated or not possible to connect (not correct credentials)
if (!\Cx\Lib\FileSystem\FileSystem::init()) {
\Message::add(sprintf($_ARRAYLANG['TXT_SETTING_FTP_CONFIG_WARNING'], \Env::get('cx')->getWebsiteDocumentRootPath() . '/config/configuration.php'), \Message::CLASS_ERROR);
}
}