Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit 0e890dc

Browse files
committed
Init 6.5.3 files
1 parent 034bc4f commit 0e890dc

File tree

6 files changed

+348
-0
lines changed

6 files changed

+348
-0
lines changed
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
<?php
2+
/*
3+
* Copyright 2007-2016 Abstrium <contact (at) pydio.com>
4+
* This file is part of Pydio.
5+
*
6+
* Pydio is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU Affero General Public License as published by
8+
* the Free Software Foundation, either version 3 of the License, or
9+
* (at your option) any later version.
10+
*
11+
* Pydio is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU Affero General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU Affero General Public License
17+
* along with Pydio. If not, see <http://www.gnu.org/licenses/>.
18+
*
19+
* The latest code can be found at <https://pydio.com/>.
20+
*/
21+
22+
/**
23+
* @param string $version
24+
* @throws Exception
25+
*/
26+
function checkPhpVersion($version){
27+
if(version_compare(PHP_VERSION, $version) < 0){
28+
throw new Exception("For Pydio 7, PHP version must be greater or equal to $version, detected version is ".PHP_VERSION." - Upgrade aborted.");
29+
}else{
30+
echo "Checking Php Version (".PHP_VERSION.") : OK\n";
31+
}
32+
}
33+
34+
/**
35+
* @param string $type
36+
* @param string $name
37+
* @throws Exception
38+
*/
39+
function checkPluginUsed($type, $name){
40+
41+
if($type === "conf"){
42+
$p = ConfService::getConfStorageImpl();
43+
if($p->getName() === $name){
44+
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");
45+
}else{
46+
echo "Checking plugin $type ($name) : OK\n";
47+
}
48+
}else if($type === "auth") {
49+
$p = ConfService::getAuthDriverImpl();
50+
if ($p->getName() === $name) {
51+
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");
52+
} else {
53+
if ($p->getName() === "multi") {
54+
$drivers = $p->drivers;
55+
if (isSet($drivers[$name])) {
56+
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");
57+
} else {
58+
echo "Checking plugin $type (" . implode(", ", array_keys($drivers)) . ") : OK\n";
59+
}
60+
}
61+
echo "Checking plugin $type ($name) : OK\n";
62+
}
63+
}else if($type === "access"){
64+
65+
// Check if a workspace is currently using this plugin
66+
echo "Should check usage of plugin $type ($name) in active workspaces : TODO\n";
67+
68+
69+
}else{
70+
$plugs = AJXP_PluginsService::getInstance()->getActivePluginsForType($type);
71+
if(isSet($plugs[$name])){
72+
throw new Exception("You are currently using plugin $type.$name. This is removed in Pydio7. Please disable it before running upgrade. Aborting upgrade");
73+
}
74+
echo "Checking plugin $type ($name) : OK\n";
75+
}
76+
77+
}
78+
79+
/**
80+
* @param string $themeName
81+
* @throws Exception
82+
*/
83+
function checkThemeUsed($themeName){
84+
85+
$p = AJXP_PluginsService::getInstance()->findPlugin("gui", "ajax");
86+
$options = $p->getConfigs();
87+
if(isSet($options["GUI_THEME"]) && $options["GUI_THEME"] === $themeName){
88+
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.");
89+
}else{
90+
echo "Checking usage of remove theme ($themeName): OK\n";
91+
}
92+
93+
}
94+
95+
checkPhpVersion('5.5.9');
96+
if(AJXP_VERSION === '6.4.2'){
97+
checkPluginUsed("conf", "serial");
98+
checkPluginUsed("auth", "serial");
99+
checkPluginUsed("auth", "cmsms");
100+
checkPluginUsed("access", "remote_fs");
101+
checkThemeUsed("vision");
102+
checkThemeUsed("umbra");
103+
}

dist/php/6.5.3.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<div style='font-family: "Open sans", "HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",Helvetica,Arial,"Lucida Grande",sans-serif; font-size: 13px;line-height: 1.5em;'
2+
xmlns="http://www.w3.org/1999/html">
3+
4+
<h2>Pydio Core 6.5.3 - Beta3 for Pydio 7</h2>
5+
6+
This is the third beta for next major release.
7+
<p style="font-size: 14px;color: red;">
8+
<b>Please update at your own risks!! Do not update servers that are live in production!</b>
9+
</p>
10+
11+
If you want to participate to the beta program and get access to dedicated resources, please fill in <a target="_blank" href="https://pydio.typeform.com/to/hf6K4O">this small form</a>, we will be in contact soon.
12+
13+
</div>

dist/php/6.5.3.mysql

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/* SEPARATOR */
2+
DROP TABLE IF EXISTS ajxp_tasks;
3+
/* SEPARATOR */
4+
CREATE TABLE IF NOT EXISTS ajxp_tasks (
5+
uid VARCHAR(255) NOT NULL ,
6+
type INTEGER NOT NULL,
7+
parent_uid VARCHAR(255) DEFAULT NULL,
8+
flags INTEGER NOT NULL,
9+
label VARCHAR(255) NOT NULL,
10+
user_id VARCHAR(255) NOT NULL,
11+
ws_id VARCHAR(32) NOT NULL,
12+
status INTEGER NOT NULL,
13+
status_msg VARCHAR(500) NOT NULL,
14+
progress INTEGER NOT NULL,
15+
schedule INTEGER NOT NULL,
16+
schedule_value VARCHAR(255) DEFAULT NULL,
17+
action VARCHAR(255) NOT NULL,
18+
parameters VARCHAR(500) NOT NULL,
19+
nodes VARCHAR(500) NOT NULL,
20+
creation_date INTEGER NOT NULL DEFAULT 0,
21+
status_update INTEGER NOT NULL DEFAULT 0,
22+
23+
PRIMARY KEY (uid)
24+
) DEFAULT CHARSET=utf8;
25+
/* SEPARATOR */
26+
CREATE INDEX ajxp_task_usr_idx ON ajxp_tasks (user_id);
27+
/* SEPARATOR */
28+
CREATE INDEX ajxp_task_status_idx ON ajxp_tasks (status);
29+
/* SEPARATOR */
30+
CREATE INDEX ajxp_task_type ON ajxp_tasks (type);
31+
/* SEPARATOR */
32+
CREATE INDEX ajxp_task_schedule ON ajxp_tasks (schedule);
33+
/* SEPARATOR */
34+
CREATE INDEX ajxp_task_nodes_idx ON ajxp_tasks (nodes);
35+
/* SEPARATOR */
36+
CREATE TABLE IF NOT EXISTS `ajxp_mq_queues` (
37+
`channel_name` varchar(255) NOT NULL,
38+
`content` text NOT NULL,
39+
PRIMARY KEY (`channel_name`)
40+
) DEFAULT CHARSET=utf8;
41+
/* SEPARATOR */
42+
DROP TRIGGER IF EXISTS `LOG_UPDATE`;
43+
/* SEPARATOR */
44+
CREATE TRIGGER `LOG_UPDATE` AFTER UPDATE ON `ajxp_index`
45+
FOR EACH ROW INSERT INTO ajxp_changes (repository_identifier, node_id,source,target,type)
46+
VALUES (new.repository_identifier, new.node_id, old.node_path, new.node_path, CASE old.node_path COLLATE utf8_bin = new.node_path COLLATE utf8_bin WHEN true THEN 'content' ELSE 'path' END);

dist/php/6.5.3.pgsql

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/* SEPARATOR */
2+
DROP TABLE IF EXISTS ajxp_tasks;
3+
/* SEPARATOR */
4+
CREATE TABLE IF NOT EXISTS ajxp_tasks (
5+
uid VARCHAR(255) NOT NULL ,
6+
type INTEGER NOT NULL,
7+
parent_uid VARCHAR(255) DEFAULT NULL,
8+
flags INTEGER NOT NULL,
9+
label VARCHAR(255) NOT NULL,
10+
user_id VARCHAR(255) NOT NULL,
11+
ws_id VARCHAR(32) NOT NULL,
12+
status INTEGER NOT NULL,
13+
status_msg VARCHAR(500) NOT NULL,
14+
progress INTEGER NOT NULL,
15+
schedule INTEGER NOT NULL,
16+
schedule_value VARCHAR(255) DEFAULT NULL,
17+
action VARCHAR(255) NOT NULL,
18+
parameters VARCHAR(500) NOT NULL,
19+
nodes VARCHAR(500) NOT NULL,
20+
creation_date INTEGER NOT NULL DEFAULT 0,
21+
status_update INTEGER NOT NULL DEFAULT 0,
22+
PRIMARY KEY (uid)
23+
);
24+
/* SEPARATOR */
25+
CREATE INDEX ajxp_task_usr_idx ON ajxp_tasks (user_id);
26+
/* SEPARATOR */
27+
CREATE INDEX ajxp_task_status_idx ON ajxp_tasks (status);
28+
/* SEPARATOR */
29+
CREATE INDEX ajxp_task_type ON ajxp_tasks (type);
30+
/* SEPARATOR */
31+
CREATE INDEX ajxp_task_schedule ON ajxp_tasks (schedule);
32+
/* SEPARATOR */
33+
CREATE INDEX ajxp_task_nodes_idx ON ajxp_tasks (nodes);
34+
/* SEPARATOR */
35+
CREATE TABLE IF NOT EXISTS ajxp_mq_queues (
36+
channel_name varchar(255) NOT NULL,
37+
content text NOT NULL,
38+
PRIMARY KEY (channel_name)
39+
);

dist/php/6.5.3.php

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
<?php
2+
/*
3+
* Copyright 2007-2016 Abstrium <contact (at) pydio.com>
4+
* This file is part of Pydio.
5+
*
6+
* Pydio is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU Affero General Public License as published by
8+
* the Free Software Foundation, either version 3 of the License, or
9+
* (at your option) any later version.
10+
*
11+
* Pydio is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU Affero General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU Affero General Public License
17+
* along with Pydio. If not, see <http://www.gnu.org/licenses/>.
18+
*
19+
* The latest code can be found at <https://pydio.com/>.
20+
*/
21+
22+
function updateSharePhpContent($installPath, $publicFolder){
23+
24+
$publicFolder = preg_replace("/^".str_replace(array("\\","/"), array("\\\\", "\/"), $installPath)."/", "", $publicFolder);
25+
$sharePhpPath = $installPath."/".trim($publicFolder, "/")."/"."share.php";
26+
if(!is_file($sharePhpPath)){
27+
echo "No share.php file was found in public folder. If it does exist, you may have to manually upgrade its content.\n";
28+
return;
29+
}
30+
echo "Upgrading content of $sharePhpPath file\n";
31+
$folders = array_map(function($value){
32+
return "..";
33+
}, explode("/", trim($publicFolder, "/")));
34+
$baseConfPath = implode("/", $folders);
35+
36+
$content = '<?php
37+
include_once("'.$baseConfPath.'/base.conf.php");
38+
define(\'AJXP_EXEC\', true);
39+
require_once AJXP_INSTALL_PATH."/".AJXP_PLUGINS_FOLDER."/action.share/vendor/autoload.php";
40+
$base = rtrim(dirname($_SERVER["SCRIPT_NAME"]), "/");
41+
\Pydio\Share\ShareCenter::publicRoute($base, "/proxy", ["hash" => $_GET["hash"]]);';
42+
file_put_contents($sharePhpPath, $content);
43+
44+
}
45+
46+
function updateHtAccessContent($htAccessPath){
47+
48+
if(!is_file($htAccessPath)){
49+
echo "No htaccess file found. Skipping Htaccess update.\n";
50+
return;
51+
}
52+
echo "Upgrading content of Htaccess file\n";
53+
$lines = file($htAccessPath, FILE_IGNORE_NEW_LINES);
54+
$removeFlag = false;
55+
$newLines = [];
56+
// Remove unnecessary lines
57+
foreach($lines as $index => $line){
58+
if(!$removeFlag){
59+
$newLines[] = $line;
60+
if(trim($line) === "RewriteCond %{REQUEST_FILENAME} !-d"){
61+
$removeFlag = true;
62+
}
63+
}else{
64+
if(trim($line) === 'RewriteRule (.*) index.php [L]'){
65+
$newLines[] = $line;
66+
$removeFlag = false;
67+
}
68+
}
69+
}
70+
$contents = implode("\n", $newLines);
71+
if(is_writable($htAccessPath)){
72+
file_put_contents($htAccessPath, $contents);
73+
}else{
74+
echo "ERROR: Htaccess file could not be written. Update it manually to the following content: <pre>$contents</pre>";
75+
}
76+
77+
}
78+
79+
function awsSdkVersion(){
80+
81+
$s3Options = ConfService::getConfStorageImpl()->loadPluginConfig("access", "s3");
82+
if($s3Options["SDK_VERSION"] === "v2"){
83+
$s3Options["SDK_VERSION"] = "v3";
84+
ConfService::getConfStorageImpl()->savePluginConfig("access.s3", $s3Options);
85+
}
86+
87+
}
88+
89+
function forceRenameConfFile($prefix){
90+
91+
// FORCE bootstrap_repositories copy
92+
if (is_file(AJXP_INSTALL_PATH."/conf/$prefix.php".".new-".date("Ymd"))) {
93+
rename(AJXP_INSTALL_PATH."/conf/$prefix.php", AJXP_INSTALL_PATH."/conf/$prefix.php.pre-update");
94+
rename(AJXP_INSTALL_PATH."/conf/$prefix.php".".new-".date("Ymd"), AJXP_INSTALL_PATH."/conf/$prefix.php");
95+
}
96+
97+
98+
}
99+
100+
if(AJXP_VERSION === '6.4.2'){
101+
awsSdkVersion();
102+
updateHtAccessContent(AJXP_INSTALL_PATH."/.htaccess");
103+
updateSharePhpContent(AJXP_INSTALL_PATH, ConfService::getCoreConf("PUBLIC_DOWNLOAD_FOLDER"));
104+
forceRenameConfFile("bootstrap_conf");
105+
forceRenameConfFile("bootstrap_context");
106+
forceRenameConfFile("extensions.conf");
107+
}else if(AJXP_VERSION === '6.5.1' || AJXP_VERSION === '6.5.2'){
108+
forceRenameConfFile("bootstrap_context");
109+
}

dist/php/6.5.3.sqlite

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
DROP TABLE IF EXISTS ajxp_tasks;
2+
/* SEPARATOR */
3+
CREATE TABLE IF NOT EXISTS ajxp_tasks (
4+
uid VARCHAR(255) NOT NULL ,
5+
type INTEGER NOT NULL,
6+
parent_uid VARCHAR(255) DEFAULT NULL,
7+
flags INTEGER NOT NULL,
8+
label VARCHAR(255) NOT NULL,
9+
user_id VARCHAR(255) NOT NULL,
10+
ws_id VARCHAR(32) NOT NULL,
11+
status INTEGER NOT NULL,
12+
status_msg VARCHAR(500) NOT NULL,
13+
progress INTEGER NOT NULL,
14+
schedule INTEGER NOT NULL,
15+
schedule_value VARCHAR(255) DEFAULT NULL,
16+
action VARCHAR(255) NOT NULL,
17+
parameters VARCHAR(500) NOT NULL,
18+
nodes VARCHAR(500) NOT NULL,
19+
creation_date INTEGER NOT NULL DEFAULT 0,
20+
status_update INTEGER NOT NULL DEFAULT 0,
21+
PRIMARY KEY (uid)
22+
);
23+
/* SEPARATOR */
24+
CREATE INDEX ajxp_task_usr_idx ON ajxp_tasks (user_id);
25+
/* SEPARATOR */
26+
CREATE INDEX ajxp_task_status_idx ON ajxp_tasks (status);
27+
/* SEPARATOR */
28+
CREATE INDEX ajxp_task_type ON ajxp_tasks (type);
29+
/* SEPARATOR */
30+
CREATE INDEX ajxp_task_schedule ON ajxp_tasks (schedule);
31+
/* SEPARATOR */
32+
CREATE INDEX ajxp_task_nodes_idx ON ajxp_tasks (nodes);
33+
/* SEPARATOR */
34+
CREATE TABLE IF NOT EXISTS ajxp_mq_queues (
35+
channel_name varchar(255) NOT NULL,
36+
content text NOT NULL,
37+
PRIMARY KEY (`channel_name`)
38+
);

0 commit comments

Comments
 (0)