diff --git a/dist/php/6.5.1-extractArchive-post.php b/dist/php/6.5.1-extractArchive-post.php new file mode 100644 index 0000000000..41cfb27764 --- /dev/null +++ b/dist/php/6.5.1-extractArchive-post.php @@ -0,0 +1,92 @@ + + * This file is part of Pydio. + * + * Pydio is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Pydio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Pydio. If not, see . + * + * The latest code can be found at . + */ + +/** + * @param string $version + * @throws Exception + */ +function checkPhpVersion($version){ + if(version_compare(PHP_VERSION, $version) < 0){ + throw new Exception("For Pydio 7, PHP version must be greater or equal to $version, detected version is ".PHP_VERSION." - Upgrade aborted."); + }else{ + echo "Checking Php Version (".PHP_VERSION.") : OK"; + } +} + +/** + * @param string $type + * @param string $name + * @throws Exception + */ +function checkPluginUsed($type, $name){ + + if($type === "conf"){ + $p = ConfService::getConfStorageImpl(); + if($p->getName() === $name){ + throw new Exception("You are currently using $type.$name as configuration storage. This was deprecated in Pydio 6 and is now removed in Pydio7. Aborting upgrade"); + }else{ + echo "Checking plugin $type ($name) : OK"; + } + }else if($type === "auth") { + $p = ConfService::getAuthDriverImpl(); + if ($p->getName() === $name) { + throw new Exception("You are currently using $type.$name for authentication backend. This was deprecated in Pydio 6 and is now removed in Pydio7. Aborting upgrade"); + } else { + if ($p->getName() === "multi") { + $drivers = $p->drivers; + if (isSet($drivers[$name])) { + throw new Exception("You are currently using $type.$name for authentication backend. This was deprecated in Pydio 6 and is nowremoved in Pydio7. Aborting upgrade"); + } else { + echo "Checking plugin $type (" . implode(", ", array_keys($drivers)) . ") : OK"; + } + } + echo "Checking plugin $type ($name) : OK"; + } + }else if($type === "access"){ + + // Check if a workspace is currently using this plugin + + + }else{ + $plugs = AJXP_PluginsService::getInstance()->getActivePluginsForType($type); + if(isSet($plugs[$name])){ + throw new Exception("You are currently using plugin $type.$name. This is removed in Pydio7. Please disable it before running upgrade. Aborting upgrade"); + } + echo "Checking plugin $type ($name) : OK"; + } + +} + +/** + * @param string $themeName + * @throws Exception + */ +function checkThemeUsed($themeName){ + + $p = AJXP_PluginsService::getInstance()->findPlugin("gui", "ajax"); + $options = $p->getConfigs(); + if(isSet($options["GUI_THEME"]) && $options["GUI_THEME"] === $themeName){ + throw new Exception("You are currently using theme ".$options["GUI_THEME"]." which was removed from Pydio 7. If you want to be able to upgrade, you have to switch to Orbit theme. Aborting upgrade."); + }else{ + echo "Checking usage of remove theme ($themeName): OK"; + } + +} \ No newline at end of file diff --git a/dist/php/6.5.1.html b/dist/php/6.5.1.html new file mode 100644 index 0000000000..9155119279 --- /dev/null +++ b/dist/php/6.5.1.html @@ -0,0 +1,9 @@ +
+ +

Pydio Core 6.5.1 - Beta1 for Pydio 7

+ + This is a beta for next major upgrade Pydio 7. + Please update at your own risks. + +
\ No newline at end of file diff --git a/dist/php/6.5.1.php b/dist/php/6.5.1.php new file mode 100644 index 0000000000..cd190d1560 --- /dev/null +++ b/dist/php/6.5.1.php @@ -0,0 +1,80 @@ + + * This file is part of Pydio. + * + * Pydio is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Pydio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Pydio. If not, see . + * + * The latest code can be found at . + */ + +function updateSharePhpContent($installPath, $publicFolder){ + + $sharePhpPath = $installPath."/".trim($publicFolder, "/")."/"."share.php"; + if(!is_file($sharePhpPath)){ + echo "No share.php file was found in public folder. If it does exist, you may have to manually upgrade its content."; + } + $folders = array_map(function($value){ + return ".."; + }, explode("/", trim($publicFolder, "/"))); + $baseConfPath = implode("/", $folders); + + $content = ' + $_GET["hash"]]); + '; + file_put_contents($sharePhpPath, $content); + +} + +function updateHtAccessContent($htAccessPath){ + + if(!is_file($htAccessPath)){ + echo "No htaccess file found. Skipping Htaccess update."; + } + $lines = file($htAccessPath); + $startRemoving = false; + // Remove unnecessary lines + foreach($lines as $index => $line){ + if(!$startRemoving && strpos($line, "RewriteRule ") !== 0){ + continue; + } + if(trim($line) === 'RewriteRule (.*) index.php [L]'){ + break; + }else{ + unset($lines[$index]); + } + } + $contents = implode("\n", $lines); + if(is_writable($htAccessPath)){ + file_put_contents($htAccessPath, $contents); + }else{ + echo "ERROR: Htaccess file could not be written. Update it manually to the following content:
$contents
"; + } + +} + +function awsSdkVersion(){ + + $s3Options = \Pydio\Core\Services\ConfService::getConfStorageImpl()->loadPluginConfig("access", "s3"); + if($s3Options["SDK_VERSION"] === "v2"){ + $s3Options["SDK_VERSION"] = "v3"; + \Pydio\Core\Services\ConfService::getConfStorageImpl()->savePluginConfig("access.s3", $s3Options); + } + +} \ No newline at end of file diff --git a/dist/php/6.5.1.sql b/dist/php/6.5.1.sql new file mode 100644 index 0000000000..b534bfac73 --- /dev/null +++ b/dist/php/6.5.1.sql @@ -0,0 +1,37 @@ + + + +ALTER TABLE `ajxp_log` CHANGE `dirname` `dirname` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL , +CHANGE `basename` `basename` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ; + +ALTER TABLE `ajxp_log` DROP INDEX `basename`; +ALTER TABLE `ajxp_log` DROP INDEX `dirname`; + +ALTER TABLE `ajxp_log` ADD INDEX ( `user` ) ; +ALTER TABLE `ajxp_log` ADD INDEX ( `dirname`, `basename` ) ; + + +CREATE TABLE IF NOT EXISTS `ajxp_tasks` ( + `uid` varchar(255) NOT NULL, + `type` int(11) NOT NULL, + `parent_uid` varchar(255) DEFAULT NULL, + `flags` int(11) NOT NULL, + `label` varchar(255) NOT NULL, + `userId` varchar(255) NOT NULL, + `wsId` varchar(32) NOT NULL, + `status` int(11) NOT NULL, + `status_msg` mediumtext NOT NULL, + `progress` int(11) NOT NULL, + `schedule` int(11) NOT NULL, + `schedule_value` varchar(255) DEFAULT NULL, + `action` text NOT NULL, + `parameters` mediumtext NOT NULL, + `nodes` text NOT NULL, + `creation_date` int(11) NOT NULL DEFAULT '0' COMMENT 'Date of creation of the job', + `status_update` int(11) NOT NULL DEFAULT '0' COMMENT 'Last time the status was updated', + PRIMARY KEY (`uid`), + KEY `userId` (`userId`,`status`), + KEY `type` (`type`), + FULLTEXT KEY `nodes` (`nodes`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Task persistence layer'; +