本文整理汇总了PHP中Cx\Lib\FileSystem\FileSystem::makeWritable方法的典型用法代码示例。如果您正苦于以下问题:PHP FileSystem::makeWritable方法的具体用法?PHP FileSystem::makeWritable怎么用?PHP FileSystem::makeWritable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cx\Lib\FileSystem\FileSystem
的用法示例。
在下文中一共展示了FileSystem::makeWritable方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: calendarUpdate
function calendarUpdate()
{
try {
//update module name
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "modules` SET `name` = 'Calendar' WHERE `id` = 21");
//update navigation url
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "backend_areas` SET `uri` = 'index.php?cmd=Calendar' WHERE `area_id` = 16");
//Insert component entry
\Cx\Lib\UpdateUtil::sql("INSERT INTO `" . DBPREFIX . "component` (`id`, `name`, `type`) VALUES ('21', 'Calendar', 'module')");
//update module name for frontend pages
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "content_page` SET `module` = 'Calendar' WHERE `module` = 'calendar'");
//following queries for changing the path from images/calendar into images/Calendar
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "module_calendar_event` SET `pic` = REPLACE(`pic`, 'images/calendar', 'images/Calendar'),\n `attach` = REPLACE(`attach`, 'images/calendar', 'images/Calendar'),\n `place_map` = REPLACE(`place_map`, 'images/calendar', 'images/Calendar')\n WHERE `pic` LIKE ('" . ASCMS_PATH_OFFSET . "/images/calendar%') ");
} catch (\Cx\Lib\UpdateException $e) {
return "Error: {$e->sql}";
}
$sourcePath = ASCMS_DOCUMENT_ROOT . '/images/calendar';
$targetPath = ASCMS_DOCUMENT_ROOT . '/images/Calendar';
try {
if (file_exists($sourcePath) && !file_exists($targetPath)) {
\Cx\Lib\FileSystem\FileSystem::makeWritable($sourcePath);
if (!\Cx\Lib\FileSystem\FileSystem::move($sourcePath, $targetPath)) {
return 'Failed to Moved the files from ' . $sourcePath . ' to ' . $targetPath . '.<br>';
}
}
} catch (\Cx\Lib\FileSystem\FileSystemException $e) {
return $e->getMessage();
}
return 'Calendar Component Updated Successfully';
}
示例2: downloadsUpdate
function downloadsUpdate()
{
try {
//update module name
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "modules` SET `name` = 'Downloads' WHERE `id` = 53");
//update navigation url
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "backend_areas` SET `uri` = 'index.php?cmd=Downloads' WHERE `area_id` = 132");
//Insert component entry
\Cx\Lib\UpdateUtil::sql("INSERT INTO `" . DBPREFIX . "component` (`id`, `name`, `type`) VALUES ('53', 'Downloads', 'module')");
//update module name for frontend pages
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "content_page` SET `module` = 'Downloads' WHERE `module` = 'downloads'");
//following queries for changing the path from images/downloads into images/Downloads
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "module_downloads_download`\n SET `image` = REPLACE(`image`, 'images/downloads', 'images/Downloads')\n WHERE `image` LIKE ('" . ASCMS_PATH_OFFSET . "/images/downloads%')");
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "module_downloads_category`\n SET `image` = REPLACE(`image`, 'images/downloads', 'images/Downloads')\n WHERE `image` LIKE ('" . ASCMS_PATH_OFFSET . "/images/downloads%')");
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "module_downloads_download_locale`\n SET `source` = REPLACE(`source`, 'images/downloads', 'images/Downloads')\n WHERE `source` LIKE ('" . ASCMS_PATH_OFFSET . "/images/downloads%')");
} catch (\Cx\Lib\UpdateException $e) {
return "Error: {$e->sql}";
}
$sourcePath = ASCMS_DOCUMENT_ROOT . '/images/downloads';
$targetPath = ASCMS_DOCUMENT_ROOT . '/images/Downloads';
try {
if (file_exists($sourcePath) && !file_exists($targetPath)) {
\Cx\Lib\FileSystem\FileSystem::makeWritable($sourcePath);
if (!\Cx\Lib\FileSystem\FileSystem::move($sourcePath, $targetPath)) {
return 'Failed to Moved the files from ' . $sourcePath . ' to ' . $targetPath . '.<br>';
}
}
} catch (\Cx\Lib\FileSystem\FileSystemException $e) {
return $e->getMessage();
}
return 'Downloads Updated successfully';
}
示例3: galleryUpdate
function galleryUpdate()
{
try {
//update module name
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "modules` SET `name` = 'Gallery' WHERE `id` = 3");
//update navigation url
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "backend_areas` SET `uri` = 'index.php?cmd=Gallery' WHERE `area_id` = 12");
//Insert component entry
\Cx\Lib\UpdateUtil::sql("INSERT INTO `" . DBPREFIX . "component` (`id`, `name`, `type`) VALUES ('3', 'Gallery', 'module')");
//update module name for frontend pages
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "content_page` SET `module` = 'Gallery' WHERE `module` = 'gallery'");
} catch (\Cx\Lib\UpdateException $e) {
return "Error: {$e->sql}";
}
$sourcePath = ASCMS_DOCUMENT_ROOT . '/images/gallery';
$targetPath = ASCMS_DOCUMENT_ROOT . '/images/Gallery';
try {
if (file_exists($sourcePath) && !file_exists($targetPath)) {
\Cx\Lib\FileSystem\FileSystem::makeWritable($sourcePath);
if (!\Cx\Lib\FileSystem\FileSystem::move($sourcePath, $targetPath)) {
return 'Failed to Moved the files from ' . $sourcePath . ' to ' . $targetPath . '.<br>';
}
}
} catch (\Cx\Lib\FileSystem\FileSystemException $e) {
return $e->getMessage();
}
return 'Gallery Component Updated Successfully';
}
示例4: forumUpdates
function forumUpdates()
{
//Update the database changes
try {
//update module name
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "modules` SET `name` = 'Forum' WHERE `id` = 20");
//update navigation url
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "backend_areas` SET `uri` = 'index.php?cmd=Forum' WHERE `area_id` = 106");
//Insert component entry
\Cx\Lib\UpdateUtil::sql("INSERT INTO `" . DBPREFIX . "component` (`id`, `name`, `type`) VALUES ('20', 'Forum', 'module')");
//update module name for frontend pages
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "content_page` SET `module` = 'Forum' WHERE `module` = 'forum'");
} catch (\Cx\Lib\UpdateException $e) {
return "Error: {$e->sql}";
}
//Update script for moving the folder
$sourcePath = ASCMS_DOCUMENT_ROOT . '/media/forum';
$destinationPath = ASCMS_DOCUMENT_ROOT . '/media/Forum';
try {
if (file_exists($sourcePath) && !file_exists($destinationPath)) {
\Cx\Lib\FileSystem\FileSystem::makeWritable($sourcePath);
if (!\Cx\Lib\FileSystem\FileSystem::move($sourcePath, $destinationPath)) {
return 'Failed to move the folder from ' . $sourcePath . ' to ' . $destinationPath . '.';
}
}
} catch (\Cx\Lib\FileSystem\FileSystemException $e) {
return $e->getMessage();
}
return 'Forum updated successfully.';
}
示例5: fileSharingUpdate
function fileSharingUpdate()
{
try {
//update module name
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "modules` SET `name` = 'FileSharing' WHERE `id` = 68");
//update navigation url
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "backend_areas` SET `uri` = 'index.php?cmd=media&archive=FileSharing' WHERE `area_id` = 187");
//Insert component entry
\Cx\Lib\UpdateUtil::sql("INSERT INTO `" . DBPREFIX . "component` (`id`, `name`, `type`) VALUES ('68', 'FileSharing', 'module')");
//update module name for frontend pages
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "content_page` SET `module` = 'FileSharing' WHERE `module` = 'filesharing'");
//update section
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "core_setting` SET `section` = 'FileSharing',`value` = 'on' WHERE\n `section` = 'filesharing' AND `name` = 'permission' AND `group` = 'config'");
} catch (\Cx\Lib\UpdateException $e) {
return "Error: {$e->sql}";
}
$sourcePath = ASCMS_DOCUMENT_ROOT . '/media/filesharing';
$targetPath = ASCMS_DOCUMENT_ROOT . '/media/FileSharing';
try {
if (file_exists($sourcePath) && !file_exists($targetPath)) {
\Cx\Lib\FileSystem\FileSystem::makeWritable($sourcePath);
if (!\Cx\Lib\FileSystem\FileSystem::move($sourcePath, $targetPath)) {
return 'Failed to Moved the files from ' . $sourcePath . ' to ' . $targetPath . '.<br>';
}
}
} catch (\Cx\Lib\FileSystem\FileSystemException $e) {
return $e->getMessage();
}
return 'FileSharing updated successfully';
}
示例6: marketUpdates
function marketUpdates()
{
//Update the database changes
try {
//update module name
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "modules` SET `name` = 'Market' WHERE `id` = 33");
//update navigation url
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "backend_areas` SET `uri` = 'index.php?cmd=Market' WHERE `area_id` = 98");
//Insert component entry
\Cx\Lib\UpdateUtil::sql("INSERT INTO `" . DBPREFIX . "component` (`id`, `name`, `type`) VALUES ('33', 'Market', 'module')");
//update module name for frontend pages
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "content_page` SET `module` = 'Market' WHERE `module` = 'market'");
} catch (\Cx\Lib\UpdateException $e) {
return "Error: {$e->sql}";
}
//Update script for moving the folder
$marketMediaPath = ASCMS_DOCUMENT_ROOT . '/media';
try {
if (file_exists($marketMediaPath . '/market') && !file_exists($marketMediaPath . '/Market')) {
\Cx\Lib\FileSystem\FileSystem::makeWritable($marketMediaPath . '/market');
if (!\Cx\Lib\FileSystem\FileSystem::move($marketMediaPath . '/market', $marketMediaPath . '/Market')) {
return 'Failed to move the folder from ' . $marketMediaPath . '/market to ' . $marketMediaPath . '/Market.';
}
}
} catch (\Cx\Lib\FileSystem\FileSystemException $e) {
return $e->getMessage();
}
return 'Market updated successfully.';
}
示例7: accessUpdates
function accessUpdates()
{
//Update the database changes
try {
//update module name
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "modules` SET `name` = 'Access' WHERE `id` = 23");
//update navigation url
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "backend_areas` SET `uri` = 'index.php?cmd=Access', `module_id` = '23' WHERE `area_id` = 18");
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "backend_areas` SET `uri` = 'index.php?cmd=Access' WHERE `area_id` = 208");
//Insert component entry
\Cx\Lib\UpdateUtil::sql("INSERT INTO `" . DBPREFIX . "component` (`id`, `name`, `type`) VALUES ('23', 'Access', 'core_module')");
//update module name for frontend pages
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "content_page` SET `module` = 'Access' WHERE `module` = 'access'");
//update module name for crm core settings
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "core_setting` SET `section` = 'Access' WHERE `section` = 'access' AND `name` = 'providers' AND `group` = 'sociallogin'");
} catch (\Cx\Lib\UpdateException $e) {
return "Error: {$e->sql}";
}
//Update script for moving the folder
$accessImgPath = ASCMS_DOCUMENT_ROOT . '/images';
try {
if (file_exists($accessImgPath . '/access') && !file_exists($accessImgPath . '/Access')) {
\Cx\Lib\FileSystem\FileSystem::makeWritable($accessImgPath . '/access');
if (!\Cx\Lib\FileSystem\FileSystem::move($accessImgPath . '/access', $accessImgPath . '/Access')) {
return 'Failed to move the folder from ' . $accessImgPath . '/access to ' . $accessImgPath . '/Access.';
}
}
} catch (\Cx\Lib\FileSystem\FileSystemException $e) {
return $e->getMessage();
}
return 'Access updated successfully.';
}
示例8: _podcastUpdate
function _podcastUpdate()
{
global $objDatabase, $_ARRAYLANG, $objUpdate, $_CONFIG;
//move podcast images directory
$path = ASCMS_DOCUMENT_ROOT . '/images';
$oldImagesPath = '/content/podcast';
$newImagesPath = '/podcast';
if ($objUpdate->_isNewerVersion($_CONFIG['coreCmsVersion'], '1.2.1')) {
if (!file_exists($path . $newImagesPath) && file_exists($path . $oldImagesPath)) {
\Cx\Lib\FileSystem\FileSystem::makeWritable($path . $oldImagesPath);
if (!\Cx\Lib\FileSystem\FileSystem::copy_folder($path . $oldImagesPath, $path . $newImagesPath)) {
setUpdateMsg(sprintf($_ARRAYLANG['TXT_UNABLE_TO_MOVE_DIRECTORY'], $path . $oldImagesPath, $path . $newImagesPath));
return false;
}
}
\Cx\Lib\FileSystem\FileSystem::makeWritable($path . $newImagesPath);
\Cx\Lib\FileSystem\FileSystem::makeWritable($path . $newImagesPath . '/youtube_thumbnails');
//change thumbnail paths
$query = "UPDATE `" . DBPREFIX . "module_podcast_medium` SET `thumbnail` = REPLACE(`thumbnail`, '/images/content/podcast/', '/images/podcast/')";
if ($objDatabase->Execute($query) === false) {
return _databaseError($query, $objDatabase->ErrorMsg());
}
}
//set new default settings
$query = "UPDATE `" . DBPREFIX . "module_podcast_settings` SET `setvalue` = '50' WHERE `setname` = 'thumb_max_size' AND `setvalue` = ''";
if ($objDatabase->Execute($query) === false) {
return _databaseError($query, $objDatabase->ErrorMsg());
}
$query = "UPDATE `" . DBPREFIX . "module_podcast_settings` SET `setvalue` = '85' WHERE `setname` = 'thumb_max_size_homecontent' AND `setvalue` = ''";
if ($objDatabase->Execute($query) === false) {
return _databaseError($query, $objDatabase->ErrorMsg());
}
// only update if installed version is at least a version 2.0.0
// older versions < 2.0 have a complete other structure of the content page and must therefore completely be reinstalled
if (!$objUpdate->_isNewerVersion($_CONFIG['coreCmsVersion'], '2.0.0')) {
try {
// migrate content page to version 3.0.1
$search = array('/(.*)/ms');
$callback = function ($matches) {
$content = $matches[1];
if (empty($content)) {
return $content;
}
// add missing placeholder {PODCAST_JAVASCRIPT}
if (strpos($content, '{PODCAST_JAVASCRIPT}') === false) {
$content .= "\n{PODCAST_JAVASCRIPT}";
}
// add missing placeholder {PODCAST_PAGING}
if (strpos($content, '{PODCAST_PAGING}') === false) {
$content = preg_replace('/(\\s+)(<!--\\s+END\\s+podcast_media\\s+-->)/ms', '$1$2$1<div class="noMedium">$1 {PODCAST_PAGING}$1</div>', $content);
}
return $content;
};
\Cx\Lib\UpdateUtil::migrateContentPageUsingRegexCallback(array('module' => 'podcast'), $search, $callback, array('content'), '3.0.1');
} catch (\Cx\Lib\UpdateException $e) {
return \Cx\Lib\UpdateUtil::DefaultActionHandler($e);
}
}
return true;
}
示例9: ecardUpdates
function ecardUpdates()
{
//Update database changes
try {
//update module name
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "modules` SET `name` = 'Ecard' WHERE `id` = 49");
//update navigation url
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "backend_areas` SET `uri` = 'index.php?cmd=Ecard' WHERE `area_id` = 130");
//Insert component entry
\Cx\Lib\UpdateUtil::sql("INSERT INTO `" . DBPREFIX . "component` (`id`, `name`, `type`) VALUES ('49', 'Ecard', 'module')");
//update module name for frontend pages
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "content_page` SET `module` = 'Ecard' WHERE `module` = 'ecard'");
} catch (\Cx\Lib\UpdateException $e) {
return "Error: {$e->sql}";
}
//Update script for moving the folders
$imgModulesfolderPath = ASCMS_DOCUMENT_ROOT . '/images/modules/ecard';
$mediafolderPath = ASCMS_DOCUMENT_ROOT . '/media/Ecard';
try {
if (!file_exists($mediafolderPath)) {
\Cx\Lib\FileSystem\FileSystem::make_folder($mediafolderPath);
\Cx\Lib\FileSystem\FileSystem::makeWritable($mediafolderPath);
}
//move the folder from '/images/modules/ecard/ecards_optimized' to '/media/Ecard/ecards_optimized'
if (file_exists($imgModulesfolderPath . '/ecards_optimized') && !file_exists($mediafolderPath . '/ecards_optimized')) {
\Cx\Lib\FileSystem\FileSystem::makeWritable($imgModulesfolderPath . '/ecards_optimized');
if (!\Cx\Lib\FileSystem\FileSystem::move($imgModulesfolderPath . '/ecards_optimized', $mediafolderPath . '/ecards_optimized')) {
return 'Failed to Move the folders from ' . $imgModulesfolderPath . '/ecards_optimized to ' . $mediafolderPath . '/ecards_optimized.';
}
}
//move the folder from '/images/modules/ecard/send_ecards' to '/media/Ecard/send_ecards'
if (file_exists($imgModulesfolderPath . '/send_ecards') && !file_exists($mediafolderPath . '/send_ecards')) {
\Cx\Lib\FileSystem\FileSystem::makeWritable($imgModulesfolderPath . '/send_ecards');
if (!\Cx\Lib\FileSystem\FileSystem::move($imgModulesfolderPath . '/send_ecards', $mediafolderPath . '/send_ecards')) {
return 'Failed to Move the folders from ' . $imgModulesfolderPath . '/send_ecards to ' . $mediafolderPath . '/send_ecards.';
}
}
//move the folder from '/images/modules/ecard/thumbnails' to '/media/Ecard/thumbnails'
if (file_exists($imgModulesfolderPath . '/thumbnails') && !file_exists($mediafolderPath . '/thumbnails')) {
\Cx\Lib\FileSystem\FileSystem::makeWritable($imgModulesfolderPath . '/thumbnails');
if (!\Cx\Lib\FileSystem\FileSystem::move($imgModulesfolderPath . '/thumbnails', $mediafolderPath . '/thumbnails')) {
return 'Failed to Move the folders from ' . $imgModulesfolderPath . '/thumbnails to ' . $mediafolderPath . '/thumbnails.';
}
}
return 'Successfully updated.';
} catch (\Cx\Lib\FileSystem\FileSystemException $e) {
return $e->getMessage();
}
}
示例10: initContrexxCaching
protected function initContrexxCaching()
{
global $_CONFIG;
// in case the request's origin is from a mobile devie
// and this is the first request (the InitCMS object wasn't yet
// able to determine of the mobile device wishes to be served
// with the system's mobile view), we shall deactivate the caching system
if (\InitCMS::_is_mobile_phone() && !\InitCMS::_is_tablet() && !isset($_REQUEST['smallscreen'])) {
$this->boolIsEnabled = false;
return;
}
if ($_CONFIG['cacheEnabled'] == 'off') {
$this->boolIsEnabled = false;
return;
}
if (isset($_REQUEST['caching']) && $_REQUEST['caching'] == '0') {
$this->boolIsEnabled = false;
return;
}
// TODO: Reimplement - see #1205
/*if ($this->isException()) {
$this->boolIsEnabled = false;
return;
}*/
$this->boolIsEnabled = true;
// check the cache directory
if (!is_dir(ASCMS_CACHE_PATH)) {
\Cx\Lib\FileSystem\FileSystem::make_folder(ASCMS_CACHE_PATH);
}
if (!is_writable(ASCMS_CACHE_PATH)) {
\Cx\Lib\FileSystem\FileSystem::makeWritable(ASCMS_CACHE_PATH);
}
$this->strCachePath = ASCMS_CACHE_PATH . '/';
$this->intCachingTime = intval($_CONFIG['cacheExpiration']);
// Use data of $_GET and $_POST to uniquely identify a request.
// Important: You must not use $_REQUEST instead. $_REQUEST also contains
// the data of $_COOKIE. Whereas the cookie information might
// change in each request, which might break the caching-
// system.
$request = array_merge_recursive($_GET, $_POST);
ksort($request);
$this->arrPageContent = array('url' => $_SERVER['REQUEST_URI'], 'request' => $request);
$this->strCacheFilename = md5(serialize($this->arrPageContent));
}
示例11: _ecardUpdate
function _ecardUpdate()
{
global $objDatabase, $_ARRAYLANG, $_CORELANG;
try {
\Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_ecard_ecards', array('code' => array('type' => 'VARCHAR(35)', 'notnull' => true, 'default' => '', 'primary' => true), 'date' => array('type' => 'INT(10)', 'notnull' => true, 'default' => 0, 'unsigned' => true), 'TTL' => array('type' => 'INT(10)', 'notnull' => true, 'default' => 0, 'unsigned' => true), 'salutation' => array('type' => 'VARCHAR(100)', 'notnull' => true, 'default' => ''), 'senderName' => array('type' => 'VARCHAR(100)', 'notnull' => true, 'default' => ''), 'senderEmail' => array('type' => 'VARCHAR(100)', 'notnull' => true, 'default' => ''), 'recipientName' => array('type' => 'VARCHAR(100)', 'notnull' => true, 'default' => ''), 'recipientEmail' => array('type' => 'VARCHAR(100)', 'notnull' => true, 'default' => ''), 'message' => array('type' => 'TEXT', 'notnull' => true)));
\Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_ecard_settings', array('setting_name' => array('type' => 'VARCHAR(100)', 'notnull' => true, 'default' => '', 'primary' => true), 'setting_value' => array('type' => 'TEXT', 'notnull' => true, 'default' => 0)));
} catch (\Cx\Lib\UpdateException $e) {
return \Cx\Lib\UpdateUtil::DefaultActionHandler($e);
}
$ins_tpl = "\n INSERT INTO " . DBPREFIX . "module_ecard_settings (setting_name, setting_value)\n VALUES ('%s', '%s')\n ON DUPLICATE KEY UPDATE `setting_name` = `setting_name`\n ";
$insert_values = array(array('maxCharacters', '100'), array('maxLines', '50'), array('motive_0', 'Bild_001.jpg'), array('motive_1', 'Bild_002.jpg'), array('motive_2', ''), array('motive_3', ''), array('motive_4', ''), array('motive_5', ''), array('motive_6', ''), array('motive_7', ''), array('motive_8', ''), array('maxHeight', '300'), array('validdays', '30'), array('maxWidth', '300'), array('maxHeightThumb', '80'), array('maxWidthThumb', '80'), array('subject', 'Sie haben eine E-Card erhalten!'), array('emailText', "[[ECARD_SENDER_NAME]] hat Ihnen eine E-Card geschickt.<br />\n Sie können diese während den nächsten [[ECARD_VALID_DAYS]] Tagen unter [[ECARD_URL]] abrufen."));
foreach ($insert_values as $setting) {
$query = sprintf($ins_tpl, addslashes($setting[0]), addslashes($setting[1]));
if (!$objDatabase->Execute($query)) {
return _databaseError($query, $objDatabase->ErrorMsg());
}
}
/* * **********************************************
* BUGFIX: Set write access to the image dir *
* ********************************************** */
$arrImagePaths = array(array(ASCMS_DOCUMENT_ROOT . '/images/modules/ecard', ASCMS_PATH_OFFSET . '/images/modules/ecard'), array(ASCMS_ECARD_OPTIMIZED_PATH, ASCMS_ECARD_OPTIMIZED_WEB_PATH), array(ASCMS_ECARD_SEND_ECARDS_PATH, ASCMS_ECARD_SEND_ECARDS_WEB_PATH), array(ASCMS_ECARD_THUMBNAIL_PATH, ASCMS_ECARD_THUMBNAIL_WEB_PATH));
foreach ($arrImagePaths as $arrImagePath) {
if (\Cx\Lib\FileSystem\FileSystem::makeWritable($arrImagePath[0])) {
if ($mediaDir = @opendir($arrImagePath[0])) {
while ($file = readdir($mediaDir)) {
if ($file != '.' && $file != '..') {
if (!\Cx\Lib\FileSystem\FileSystem::makeWritable($arrImagePath[0] . '/' . $file)) {
setUpdateMsg(sprintf($_ARRAYLANG['TXT_SET_WRITE_PERMISSON_TO_FILE'], $arrImagePath[0] . '/' . $file, $_CORELANG['TXT_UPDATE_TRY_AGAIN']), 'msg');
return false;
}
}
}
} else {
setUpdateMsg(sprintf($_ARRAYLANG['TXT_SET_WRITE_PERMISSON_TO_DIR_AND_CONTENT'], $arrImagePath[0] . '/', $_CORELANG['TXT_UPDATE_TRY_AGAIN']), 'msg');
return false;
}
} else {
setUpdateMsg(sprintf($_ARRAYLANG['TXT_SET_WRITE_PERMISSON_TO_DIR_AND_CONTENT'], $arrImagePath[0] . '/', $_CORELANG['TXT_UPDATE_TRY_AGAIN']), 'msg');
return false;
}
}
return true;
}
示例12: crmUpdates
function crmUpdates()
{
//Update the database changes
try {
//update module name
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "modules` SET `name` = 'Crm' WHERE `id` = 69");
//update navigation url
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "backend_areas` SET `uri` = 'index.php?cmd=Crm&act=customers' WHERE `area_id` = 191");
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "backend_areas` SET `uri` = 'index.php?cmd=Crm&act=task' WHERE `area_id` = 192");
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "backend_areas` SET `uri` = 'index.php?cmd=Crm&act=deals' WHERE `area_id` = 193");
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "backend_areas` SET `uri` = 'index.php?cmd=Crm&act=settings' WHERE `area_id` = 195");
//Insert component entry
\Cx\Lib\UpdateUtil::sql("INSERT INTO `" . DBPREFIX . "component` (`id`, `name`, `type`) VALUES ('69', 'Crm', 'module')");
//update module name for email templates
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "core_mail_template` SET `section` = 'Crm' WHERE `section` = 'crm'");
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "core_text` SET `section` = 'Crm' WHERE `section` = 'crm'");
//update module name for crm core settings
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "core_setting` SET `section` = 'Crm' WHERE `section` = 'crm'");
} catch (\Cx\Lib\UpdateException $e) {
return "Error: {$e->sql}";
}
//Update script for moving the folder
$crmImgPath = ASCMS_DOCUMENT_ROOT . '/images';
$crmMediaPath = ASCMS_DOCUMENT_ROOT . '/media';
try {
if (file_exists($crmImgPath . '/crm') && !file_exists($crmImgPath . '/Crm')) {
\Cx\Lib\FileSystem\FileSystem::makeWritable($crmImgPath . '/crm');
if (!\Cx\Lib\FileSystem\FileSystem::move($crmImgPath . '/crm', $crmImgPath . '/Crm')) {
return 'Failed to move the folder from ' . $crmImgPath . '/crm to ' . $crmImgPath . '/Crm.';
}
}
if (file_exists($crmMediaPath . '/crm') && !file_exists($crmMediaPath . '/Crm')) {
\Cx\Lib\FileSystem\FileSystem::makeWritable($crmMediaPath . '/crm');
if (!\Cx\Lib\FileSystem\FileSystem::move($crmMediaPath . '/crm', $crmMediaPath . '/Crm')) {
return 'Failed to move the folder from ' . $crmMediaPath . '/crm to ' . $crmMediaPath . '/Crm.';
}
}
} catch (\Cx\Lib\FileSystem\FileSystemException $e) {
return $e->getMessage();
}
return 'Crm updated successfully.';
}
示例13: shopUpdates
function shopUpdates()
{
//Update the database changes
try {
//update module name
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "modules` SET `name` = 'Shop' WHERE `id` = 16");
//update navigation url
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "backend_areas` SET `uri` = 'index.php?cmd=Shop' WHERE `area_id` = 13");
//Insert component entry
\Cx\Lib\UpdateUtil::sql("INSERT INTO `" . DBPREFIX . "component` (`id`, `name`, `type`) VALUES ('16', 'Shop', 'module')");
//update module name for frontend pages
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "content_page` SET `module` = 'Shop' WHERE `module` = 'shop'");
//update module name for crm core settings
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "core_setting` SET `section` = 'Shop' WHERE `section` = 'shop'");
//update module name for email templates
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "core_mail_template` SET `section` = 'Shop' WHERE `section` = 'shop'");
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "core_text` SET `section` = 'Shop' WHERE `section` = 'shop'");
} catch (\Cx\Lib\UpdateException $e) {
return "Error: {$e->sql}";
}
//Update script for moving the folder
$shopImgPath = ASCMS_DOCUMENT_ROOT . '/images';
$shopMediaPath = ASCMS_DOCUMENT_ROOT . '/media';
try {
if (file_exists($shopImgPath . '/shop') && !file_exists($shopImgPath . '/Shop')) {
\Cx\Lib\FileSystem\FileSystem::makeWritable($shopImgPath . '/shop');
if (!\Cx\Lib\FileSystem\FileSystem::move($shopImgPath . '/shop', $shopImgPath . '/Shop')) {
return 'Failed to move the folder from ' . $shopImgPath . '/shop to ' . $shopImgPath . '/Shop.';
}
}
if (file_exists($shopMediaPath . '/shop') && !file_exists($shopMediaPath . '/Shop')) {
\Cx\Lib\FileSystem\FileSystem::makeWritable($shopMediaPath . '/shop');
if (!\Cx\Lib\FileSystem\FileSystem::move($shopMediaPath . '/shop', $shopMediaPath . '/Shop')) {
return 'Failed to move the folder from ' . $shopMediaPath . '/shop to ' . $shopMediaPath . '/Shop.';
}
}
} catch (\Cx\Lib\FileSystem\FileSystemException $e) {
return $e->getMessage();
}
return 'Shop updated successfully.';
}
示例14: mediaDirUpdate
function mediaDirUpdate()
{
try {
//update module name
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "modules` SET `name` = 'MediaDir' WHERE `id` = 60");
//update navigation url
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "backend_areas` SET `uri` = 'index.php?cmd=MediaDir' WHERE `area_id` = 153");
//Insert component entry
\Cx\Lib\UpdateUtil::sql("INSERT INTO `" . DBPREFIX . "component` (`id`, `name`, `type`) VALUES ('60', 'MediaDir', 'module')");
//update module name for frontend pages
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "content_page` SET `module` = 'MediaDir' WHERE `module` = 'mediadir'");
//update class name
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "module_mediadir_inputfield_types` SET `name` = 'linkGroup' WHERE `name` = 'link_group'");
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "module_mediadir_inputfield_types` SET `name` = 'googleMap' WHERE `name` = 'google_map'");
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "module_mediadir_inputfield_types` SET `name` = 'addStep' WHERE `name` = 'add_step'");
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "module_mediadir_inputfield_types` SET `name` = 'fieldGroup' WHERE `name` = 'field_group'");
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "module_mediadir_inputfield_types` SET `name` = 'productAttributes' WHERE `name` = 'product_attributes'");
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "module_mediadir_inputfield_types` SET `name` = 'googleWeather' WHERE `name` = 'google_weather'");
//following queries for changing the path from images/mediadir into images/MediaDir
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "module_mediadir_categories` \n SET `picture` = REPLACE(`picture`, 'images/mediadir', 'images/MediaDir')\n WHERE `picture` LIKE ('" . ASCMS_PATH_OFFSET . "/images/mediadir%')");
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "module_mediadir_forms` \n SET `picture` = REPLACE(`picture`, 'images/mediadir', 'images/MediaDir')\n WHERE `picture` LIKE ('" . ASCMS_PATH_OFFSET . "/images/mediadir%')");
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "module_mediadir_levels` \n SET `picture` = REPLACE(`picture`, 'images/mediadir', 'images/MediaDir')\n WHERE `picture` LIKE ('" . ASCMS_PATH_OFFSET . "/images/mediadir%')");
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "module_mediadir_rel_entry_inputfields` \n SET `value` = REPLACE(`value`, 'images/mediadir', 'images/MediaDir')\n WHERE `value` LIKE ('" . ASCMS_PATH_OFFSET . "/images/mediadir%')");
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "module_mediadir_rel_entry_inputfields_clean1` \n SET `value` = REPLACE(`value`, 'images/mediadir', 'images/MediaDir')\n WHERE `value` LIKE ('" . ASCMS_PATH_OFFSET . "/images/mediadir%')");
} catch (\Cx\Lib\UpdateException $e) {
return "Error: {$e->sql}";
}
$sourcePath = ASCMS_DOCUMENT_ROOT . '/images/mediadir';
$targetPath = ASCMS_DOCUMENT_ROOT . '/images/MediaDir';
try {
if (file_exists($sourcePath) && !file_exists($targetPath)) {
\Cx\Lib\FileSystem\FileSystem::makeWritable($sourcePath);
if (!\Cx\Lib\FileSystem\FileSystem::move($sourcePath, $targetPath)) {
return 'Failed to Moved the files from ' . $sourcePath . ' to ' . $targetPath . '.<br>';
}
}
} catch (\Cx\Lib\FileSystem\FileSystemException $e) {
return $e->getMessage();
}
return 'Media Directory Updated Successfully';
}
示例15: blogUpdates
function blogUpdates()
{
//Update the database changes
try {
//update module name
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "modules` SET `name` = 'Blog' WHERE `id` = 47");
//update navigation url
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "backend_areas` SET `uri` = 'index.php?cmd=Blog' WHERE `area_id` = 119");
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "backend_areas` SET `uri` = 'index.php?cmd=Blog&act=manageEntry' WHERE `area_id` = 120");
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "backend_areas` SET `uri` = 'index.php?cmd=Blog&act=addEntry' WHERE `area_id` = 121");
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "backend_areas` SET `uri` = 'index.php?cmd=Blog&act=manageCategory' WHERE `area_id` = 122");
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "backend_areas` SET `uri` = 'index.php?cmd=Blog&act=addCategory' WHERE `area_id` = 123");
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "backend_areas` SET `uri` = 'index.php?cmd=Blog&act=settings' WHERE `area_id` = 124");
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "backend_areas` SET `uri` = 'index.php?cmd=Blog&act=networks' WHERE `area_id` = 125");
//Insert component entry
\Cx\Lib\UpdateUtil::sql("INSERT INTO `" . DBPREFIX . "component` (`id`, `name`, `type`) VALUES ('47', 'Blog', 'module')");
//update module name for frontend pages
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "content_page` SET `module` = 'Blog' WHERE `module` = 'blog'");
//following queries for changing the path from images/blog into images/Blog
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "module_blog_messages_lang` \n SET `image` = REPLACE(`image`, 'images/blog', 'images/Blog')\n WHERE `image` LIKE ('" . ASCMS_PATH_OFFSET . "/images/blog%')");
\Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "module_blog_networks` \n SET `icon` = REPLACE(`icon`, 'images/blog', 'images/Blog')\n WHERE `icon` LIKE ('" . ASCMS_PATH_OFFSET . "/images/blog%')");
} catch (\Cx\Lib\UpdateException $e) {
return "Error: {$e->sql}";
}
//Update script for moving the folder
$blogImgPath = ASCMS_DOCUMENT_ROOT . '/images';
try {
if (file_exists($blogImgPath . '/blog') && !file_exists($blogImgPath . '/Blog')) {
\Cx\Lib\FileSystem\FileSystem::makeWritable($blogImgPath . '/blog');
if (!\Cx\Lib\FileSystem\FileSystem::move($blogImgPath . '/blog', $blogImgPath . '/Blog')) {
return 'Failed to move the folder from ' . $blogImgPath . '/blog to ' . $blogImgPath . '/Blog.';
}
}
} catch (\Cx\Lib\FileSystem\FileSystemException $e) {
return $e->getMessage();
}
return 'Blog updated successfully.';
}