当前位置: 首页>>代码示例>>PHP>>正文


PHP FileSystem\FileSystem类代码示例

本文整理汇总了PHP中Cx\Lib\FileSystem\FileSystem的典型用法代码示例。如果您正苦于以下问题:PHP FileSystem类的具体用法?PHP FileSystem怎么用?PHP FileSystem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了FileSystem类的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: 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

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: showNewsRefresh

 function showNewsRefresh($id, $time, $path)
 {
     global $objDatabase;
     //delete old #01
     $query = "SELECT link,\n                           filename\n                      FROM " . DBPREFIX . "module_feed_news\n                     WHERE id = '" . $id . "'";
     $objResult = $objDatabase->Execute($query);
     $old_link = $objResult->fields['link'];
     $old_filename = $objResult->fields['filename'];
     if ($old_link != '') {
         $filename = 'feed_' . $time . '_' . \Cx\Lib\FileSystem\FileSystem::replaceCharacters(basename($old_link));
         @copy($old_link, $path . $filename);
         //rss class
         $rss = new \XML_RSS($path . $filename);
         $rss->parse();
         $content = '';
         foreach ($rss->getStructure() as $array) {
             $content .= $array;
         }
     }
     if ($old_link == '') {
         $filename = $old_filename;
     }
     $query = "UPDATE " . DBPREFIX . "module_feed_news\n                       SET filename = '" . $filename . "',\n                           time = '" . $time . "'\n                     WHERE id = '" . $id . "'";
     $objDatabase->Execute($query);
     //delete old #02
     if ($old_link != '') {
         @unlink($path . $old_filename);
     }
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:29,代码来源:FeedLibrary.class.php

示例9: _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;
}
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:60,代码来源:podcast.php

示例10: Create

 function Create()
 {
     $this->content = utf8_decode($this->_ParseHTML($this->content));
     $pdf = new HTML2FPDF();
     $pdf->ShowNOIMG_GIF();
     $pdf->DisplayPreferences('HideWindowUI');
     $pdf->AddPage();
     $pdf->WriteHTML($this->content);
     $pdf->Output(\Cx\Lib\FileSystem\FileSystem::replaceCharacters($this->title));
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:10,代码来源:pdf.class.php

示例11: __construct

 /**
  * Constructor
  */
 public function __construct()
 {
     $cx = \Cx\Core\Core\Controller\Cx::instanciate();
     $folderPath = $cx->getWebsiteTempPath() . '/Update';
     if (!file_exists($folderPath)) {
         \Cx\Lib\FileSystem\FileSystem::make_folder($folderPath);
     }
     if (!file_exists($folderPath . '/' . self::PENDING_DB_UPDATES_YML)) {
         \Cx\Lib\FileSystem\FileSystem::copy_file($cx->getCodeBaseCoreModulePath() . '/Update/Data/' . self::PENDING_DB_UPDATES_YML, $folderPath . '/' . self::PENDING_DB_UPDATES_YML);
     }
     parent::__construct($folderPath . '/' . self::PENDING_DB_UPDATES_YML);
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:15,代码来源:DeltaRepository.class.php

示例12: 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

示例13: createThumbnail

 /**
  * Create all the thumbnails for a picture.
  *
  * @param string        $path Path to the file. This can be a virtual path or a absolute path.
  * @param string        $fileNamePlain Plain file name without extension
  * @param string        $fileExtension Extension of the file
  * @param \ImageManager $imageManager
  *
  * <code>
  * <?php
  * \Cx\Core_Modules\MediaBrowser\Model\FileSystem::createThumbnail(
  *      'files/',
  *      'Django,
  *      'jpg',
  *      new ImageManager() // Please recycle the instance and don't create a new anonymous instance for each call.
  *                         // This is just a simple example.
  * );
  * ?>
  * </code>
  *
  * @return array With all thumbnail types and if they were generated successfully.
  */
 public static function createThumbnail($path, $fileNamePlain, $fileExtension, \ImageManager $imageManager, $generateThumbnailByRatio = false)
 {
     $success = array();
     foreach (UploaderConfiguration::getInstance()->getThumbnails() as $thumbnail) {
         if (\Cx\Lib\FileSystem\FileSystem::exists(MediaSourceManager::getAbsolutePath($path) . $fileNamePlain . $thumbnail['value'] . '.' . $fileExtension)) {
             $success[$thumbnail['value']] = self::THUMBNAIL_GENERATOR_NEUTRAL;
             continue;
         }
         if ($imageManager->_createThumb(MediaSourceManager::getAbsolutePath($path) . '/', '', $fileNamePlain . '.' . $fileExtension, $thumbnail['size'], $thumbnail['quality'], $fileNamePlain . $thumbnail['value'] . '.' . $fileExtension, $generateThumbnailByRatio)) {
             $success[$thumbnail['value']] = self::THUMBNAIL_GENERATOR_SUCCESS;
             continue;
         }
         $success[$thumbnail['value']] = self::THUMBNAIL_GENERATOR_FAIL;
     }
     return $success;
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:38,代码来源:ThumbnailGenerator.class.php

示例14: execute

 /**
  * Execute this command
  * @param array $arguments Array of commandline arguments
  */
 public function execute(array $arguments)
 {
     if (!$this->interface->yesNo('Removing workbench requires re-installing workbench to use it again. Are you sure?')) {
         return;
     }
     // Remove component from Db and FileSystem
     $component = new \Cx\Core\Core\Model\Entity\ReflectionComponent('Workbench', 'core_module');
     $component->remove();
     // Remove additional files (config, command line script)
     foreach ($this->interface->getWorkbench()->getFileList() as $file) {
         if (is_dir($file)) {
             \Cx\Lib\FileSystem\FileSystem::delete_folder(ASCMS_DOCUMENT_ROOT . $file, true);
         } else {
             \Cx\Lib\FileSystem\FileSystem::delete_file(ASCMS_DOCUMENT_ROOT . $file);
         }
     }
     $this->interface->show('Done');
 }
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:22,代码来源:RemoveCommand.class.php

示例15: 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));
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:44,代码来源:Cache.class.php


注:本文中的Cx\Lib\FileSystem\FileSystem类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。