當前位置: 首頁>>代碼示例>>PHP>>正文


PHP FileSystem::move方法代碼示例

本文整理匯總了PHP中Cx\Lib\FileSystem\FileSystem::move方法的典型用法代碼示例。如果您正苦於以下問題:PHP FileSystem::move方法的具體用法?PHP FileSystem::move怎麽用?PHP FileSystem::move使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Cx\Lib\FileSystem\FileSystem的用法示例。


在下文中一共展示了FileSystem::move方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: 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';
}
開發者ID:Cloudrexx,項目名稱:cloudrexx,代碼行數:30,代碼來源:FileSharing.php

示例2: 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';
}
開發者ID:Niggu,項目名稱:cloudrexx,代碼行數:28,代碼來源:Gallery.php

示例3: 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.';
}
開發者ID:Niggu,項目名稱:cloudrexx,代碼行數:29,代碼來源:Market.php

示例4: 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';
}
開發者ID:Niggu,項目名稱:cloudrexx,代碼行數:30,代碼來源:Calendar.php

示例5: 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';
}
開發者ID:Cloudrexx,項目名稱:cloudrexx,代碼行數:32,代碼來源:Downloads.php

示例6: 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.';
}
開發者ID:Cloudrexx,項目名稱:cloudrexx,代碼行數:30,代碼來源:Forum.php

示例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.';
}
開發者ID:Cloudrexx,項目名稱:cloudrexx,代碼行數:32,代碼來源:Access.php

示例8: 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();
    }
}
開發者ID:Cloudrexx,項目名稱:cloudrexx,代碼行數:49,代碼來源:Ecard.php

示例9: handleRequest

 /**
  * @override
  */
 public function handleRequest()
 {
     global $_FILES;
     //get a writable directory
     $targetDir = '/upload_' . $this->uploadId;
     $tempPath = $_SESSION->getTempPath();
     $webTempPath = $_SESSION->getWebTempPath();
     //make sure target directory exists
     if (!file_exists($tempPath . $targetDir)) {
         \Cx\Lib\FileSystem\FileSystem::make_folder($webTempPath . $targetDir);
     }
     //move all uploaded file to this upload's temp directory
     foreach ($_FILES["uploaderFiles"]["error"] as $key => $error) {
         if ($error == UPLOAD_ERR_OK) {
             $tmpName = $_FILES["uploaderFiles"]["tmp_name"][$key];
             $name = $_FILES["uploaderFiles"]["name"][$key];
             if (!\FWValidator::is_file_ending_harmless($name)) {
                 die('Error:' . sprintf('The file %s was refused due to its file extension which is not allowed!', htmlentities($name, ENT_QUOTES, CONTREXX_CHARSET)));
             }
             //TODO: Uploader::addChunk does this also -> centralize in function
             // remember the "raw" file name, we want to store all original
             // file names in the session.
             $originalFileName = $name;
             // Clean the fileName for security reasons
             $name = preg_replace('/[^\\w\\._]+/', '', $name);
             $originalFileNames = array();
             if (isset($_SESSION['upload']['handlers'][$this->uploadId]['originalFileNames'])) {
                 $originalFileNames = $_SESSION['upload']['handlers'][$this->uploadId]['originalFileNames'];
             }
             $originalFileNames[$name] = $originalFileName;
             $_SESSION['upload']['handlers'][$this->uploadId]['originalFileNames'] = $originalFileNames;
             //end of TODO-region
             //move file somewhere we know both the web- and normal path...
             @move_uploaded_file($tmpName, ASCMS_TEMP_PATH . '/' . $name);
             //...then do a safe-mode-safe (yeah) move operation
             \Cx\Lib\FileSystem\FileSystem::move(ASCMS_TEMP_WEB_PATH . '/' . $name, $webTempPath . $targetDir . '/' . $name, true);
         }
     }
     //and call back.
     $this->notifyCallback();
     //redirect the user where he belongs
     $this->redirect();
 }
開發者ID:nahakiole,項目名稱:cloudrexx,代碼行數:46,代碼來源:FormUploader.class.php

示例10: 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.';
}
開發者ID:Cloudrexx,項目名稱:cloudrexx,代碼行數:42,代碼來源:Crm.php

示例11: 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.';
}
開發者ID:nahakiole,項目名稱:cloudrexx,代碼行數:41,代碼來源:Shop.php

示例12: 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';
}
開發者ID:nahakiole,項目名稱:cloudrexx,代碼行數:41,代碼來源:MediaDir.php

示例13: 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.';
}
開發者ID:Niggu,項目名稱:cloudrexx,代碼行數:38,代碼來源:Blog.php

示例14: podcastUpdate

function podcastUpdate()
{
    try {
        // Update module name
        \Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "modules` SET `name` = 'Podcast' WHERE `id` = 35");
        // Update navigation url value
        \Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "backend_areas` SET `uri` = 'index.php?cmd=Podcast' WHERE `area_id` = 93");
        // Insert entry for component
        \Cx\Lib\UpdateUtil::sql("INSERT INTO `" . DBPREFIX . "component` (`id`, `name`, `type`) VALUES ('35', 'Podcast', 'module')");
        // Update module name for frontend pages
        \Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "content_page` SET `module` = 'Podcast' WHERE `module` = 'podcast'");
        // Update the thumbnail path from images/podcast into images/Podcast
        \Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "module_podcast_medium`\n                                        SET `thumbnail` = REPLACE(`thumbnail`, 'images/podcast', 'images/Podcast')\n                                        WHERE `thumbnail` LIKE ('" . ASCMS_PATH_OFFSET . "/images/podcast%')");
    } catch (\Cx\Lib\UpdateException $e) {
        return "Error: {$e->sql}";
    }
    //Update script for moving the folder
    $imgPath = ASCMS_DOCUMENT_ROOT . '/images';
    $mediaPath = ASCMS_DOCUMENT_ROOT . '/media';
    try {
        if (file_exists($imgPath . '/podcast') && !file_exists($imgPath . '/Podcast')) {
            \Cx\Lib\FileSystem\FileSystem::makeWritable($imgPath . '/podcast');
            if (!\Cx\Lib\FileSystem\FileSystem::move($imgPath . '/podcast', $imgPath . '/Podcast')) {
                return 'Failed to move the folder from ' . $imgPath . '/podcast to ' . $imgPath . '/Podcast.';
            }
        }
        if (file_exists($mediaPath . '/podcast') && !file_exists($mediaPath . '/Podcast')) {
            \Cx\Lib\FileSystem\FileSystem::makeWritable($mediaPath . '/podcast');
            if (!\Cx\Lib\FileSystem\FileSystem::move($mediaPath . '/podcast', $mediaPath . '/Podcast')) {
                return 'Failed to move the folder from ' . $mediaPath . '/podcast to ' . $mediaPath . '/Podcast.';
            }
        }
    } catch (\Cx\Lib\FileSystem\FileSystemException $e) {
        return $e->getMessage();
    }
    return 'Podcast Component database updated successfully';
}
開發者ID:Cloudrexx,項目名稱:cloudrexx,代碼行數:37,代碼來源:Podcast.php

示例15: uploadFinished

 /**
  * Upload the submitted images
  *
  * @global	ADONewConnection
  * @global  array
  * @global  array
  * @param   string		$tempPath
  * @param   array		$paths
  * @param   integer    	$uploadId
  */
 public static function uploadFinished($tempPath, $tempWebPath, $paths, $uploadId, $fileInfos, $response)
 {
     global $objDatabase, $_ARRAYLANG, $_CONFIG, $objInit;
     $lang = $objInit->loadLanguageData('Gallery');
     $objGallery = new GalleryManager();
     $path = $paths['path'];
     $webPath = $paths['webPath'];
     //we remember the names of the uploaded files here. they are stored in the session afterwards,
     //so we can later display them highlighted.
     $arrFiles = array();
     //get allowed file types
     $arrAllowedFileTypes = array();
     if (imagetypes() & IMG_GIF) {
         $arrAllowedFileTypes[] = 'gif';
     }
     if (imagetypes() & IMG_JPG) {
         $arrAllowedFileTypes[] = 'jpg';
         $arrAllowedFileTypes[] = 'jpeg';
     }
     if (imagetypes() & IMG_PNG) {
         $arrAllowedFileTypes[] = 'png';
     }
     //rename files, delete unwanted
     $arrFilesToRename = array();
     //used to remember the files we need to rename
     $file = str_replace($tempPath . '/', '', $fileInfos['path']);
     $info = pathinfo($file);
     //delete unwanted files
     if (!in_array(strtolower($info['extension']), $arrAllowedFileTypes)) {
         @unlink($tempPath . '/' . $file);
     }
     //width of the image is wider than the allowed value. Show Error.
     $arrImageSize = getimagesize($tempPath . '/' . $file);
     if (intval($arrImageSize[0]) > intval($objGallery->arrSettings['image_width'])) {
         $objGallery->strErrMessage = str_replace('{WIDTH}', $objGallery->arrSettings['image_width'], $lang['TXT_GALLERY_UPLOAD_ERROR_WIDTH']);
         @unlink($tempPath . '/' . $file);
     }
     //check if file needs to be renamed
     $newName = \Cx\Lib\FileSystem\FileSystem::replaceCharacters($file);
     if (self::fileExists($path . '/' . $newName, false)) {
         $info = pathinfo($newName);
         $exte = $info['extension'];
         $exte = !empty($exte) ? '.' . $exte : '';
         $part1 = $info['filename'];
         if (empty($_REQUEST['uploadForceOverwrite']) || !intval($_REQUEST['uploadForceOverwrite'] > 0)) {
             $newName = $part1 . '_' . time() . $exte;
         }
     }
     //if the name has changed, the file needs to be renamed afterwards
     if ($newName != $file) {
         $arrFilesToRename[$file] = $newName;
         array_push($arrFiles, $newName);
     }
     //create entry in the database for the uploaded image
     self::insertImage($objGallery, $newName, $newName);
     //rename files where needed
     foreach ($arrFilesToRename as $oldName => $newName) {
         rename($tempPath . '/' . $oldName, $tempPath . '/' . $newName);
     }
     FileSystem::move($tempPath . '/' . $newName, $path . '/' . $newName, true);
     /* unwanted files have been deleted, unallowed filenames corrected.
        we can now simply return the desired target path, as only valid
        files are present in $tempPath */
     return array($path, $webPath, $newName);
 }
開發者ID:nahakiole,項目名稱:cloudrexx,代碼行數:75,代碼來源:GalleryManager.class.php


注:本文中的Cx\Lib\FileSystem\FileSystem::move方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。