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

Commit 5b02c82

Browse files
committed
Merge branch 'develop' of https://github.com/pydio/pydio-core into fragementOnAccessDriver
2 parents 705dd4a + 8129433 commit 5b02c82

File tree

181 files changed

+2424
-1123
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

181 files changed

+2424
-1123
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22

33
[Homepage](https://pyd.io/) |
44
[GitHub-Repository](https://github.com/pydio/pydio-core) |
5-
[Issue-Tracker](https://github.com/pydio/pydio-core/issues)
5+
[Issue-Tracker](https://github.com/pydio/pydio-core/issues) |
6+
[![Codacy Badge](https://api.codacy.com/project/badge/3b5cafea44e949e789d1928687e04032)](https://www.codacy.com/app/charles_3085/pydio-core)
67

78
This is the main source code repository of Pydio (formerly AjaXplorer), containing all the PHP server and HTML5 Web GUI.
89

9-
* Latest Stable release : 6.0.5
10+
* Latest Stable release : 6.0.8
1011
* Latest Dev release : 5.3.4 (was RC4 for Pydio 6.0.0)
1112
* License: [AGPLv3](https://www.gnu.org/licenses/agpl.html)
1213
* Lead developer : Charles du Jeu (cdujeu): [Github](https://github.com/cdujeu) | [Twitter](https://twitter.com/Pydio)
1314

15+
1416
### Getting support
1517

1618
Please DO NOT send emails to Charles, but use the forum located on http://pyd.io/f/ instead. Once your problem is qualified, if it's a bug, you will be asked to enter it in the GitHub issue tracker.

core/src/conf/RELEASE_NOTE

Lines changed: 289 additions & 0 deletions
Large diffs are not rendered by default.

core/src/conf/bootstrap_context.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070

7171
// KEY-VALUE-CACHE
7272
define("AJXP_KVCACHE_PREFIX", "pydio-unique-id");
73-
define("AJXP_KVCACHE_IGNORE", false);
73+
define("AJXP_KVCACHE_IGNORE", true);
7474

7575
// DEBUG OPTIONS
7676
define("AJXP_CLIENT_DEBUG" , false);

core/src/core/classes/class.AJXP_AbstractMetaSource.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
*/
2121
defined('AJXP_EXEC') or die( 'Access not allowed');
2222

23+
/**
24+
* Class AJXP_AbstractMetaSource
25+
* Abstract class from which all meta.* plugins must extend.
26+
*/
2327
abstract class AJXP_AbstractMetaSource extends AJXP_Plugin {
2428

2529
/**

core/src/core/classes/class.AJXP_Cache.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
*/
2828
class AJXP_Cache
2929
{
30-
private static $instance;
31-
3230
protected $cacheDir;
3331
protected $cacheId;
3432
protected $masterFile;
@@ -39,7 +37,7 @@ class AJXP_Cache
3937
* Create an AJXP_Cache instance
4038
* @param string $pluginId
4139
* @param string $filepath
42-
* @param Function $dataCallback A function to generate the data cache. If no callback provided, will simply use the content of the master item as the cache data
40+
* @param callable $dataCallback A function to generate the data cache. If no callback provided, will simply use the content of the master item as the cache data
4341
* @param string $idComputerCallback A function to generate the ID of the cache. If not provided, will generate a random hash
4442
* @return AJXP_Cache
4543
*/

core/src/core/classes/class.AJXP_Controller.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ public static function findRestActionAndApply($actionName, $path)
8383
}
8484
$restPath = $restPathList->item(0)->nodeValue;
8585
$paramNames = explode("/", trim($restPath, "/"));
86-
$path = array_shift(explode("?", $path));
86+
$exploded = explode("?", $path);
87+
$path = array_shift($exploded);
8788
$paramValues = array_map("urldecode", explode("/", trim($path, "/"), count($paramNames)));
8889
foreach ($paramNames as $i => $pName) {
8990
if (strpos($pName, "+") !== false) {
@@ -344,6 +345,7 @@ public static function runCommandInBackground($cmd, $logFile)
344345
file_put_contents($tmpBat, $cmd);
345346
pclose(popen('start /b "CLI" "'.$tmpBat.'"', 'r'));
346347
}
348+
return null;
347349
} else {
348350
$process = new UnixProcess($cmd, (AJXP_SERVER_DEBUG?$logFile:null));
349351
AJXP_Logger::debug("Starting process and sending output dev null");
@@ -361,7 +363,7 @@ public static function runCommandInBackground($cmd, $logFile)
361363
* @param array $httpVars
362364
* @param array $fileVars
363365
* @param bool $multiple
364-
* @return DOMElement|bool
366+
* @return DOMElement|bool|DOMElement[]
365367
*/
366368
private static function getCallbackNode($xPath, $actionNode, $query ,$actionName, $httpVars, $fileVars, $multiple = true)
367369
{
@@ -387,7 +389,7 @@ private static function getCallbackNode($xPath, $actionNode, $query ,$actionName
387389
* Check in the callback node if an applyCondition XML attribute exists, and eval its content.
388390
* The content must set an $apply boolean as result
389391
* @static
390-
* @param DOMElement $callback
392+
* @param DOMElement|DOMNode $callback
391393
* @param string $actionName
392394
* @param array $httpVars
393395
* @param array $fileVars
@@ -441,6 +443,7 @@ private static function applyCallback($callback, &$actionName, &$httpVars, &$fil
441443
} else {
442444
throw new AJXP_Exception("Cannot find method $methodName for plugin $plugId!");
443445
}
446+
return null;
444447
}
445448

446449
/**
@@ -471,6 +474,9 @@ public static function applyHook($hookName, $args, $forceNonDefer = false)
471474
$callbacks = $xPath->query("hooks/serverCallback[@hookName='$hookName']");
472475
if(!$callbacks->length) return ;
473476
self::$hooksCache[$hookName] = array();
477+
/**
478+
* @var $callback DOMElement
479+
*/
474480
foreach ($callbacks as $callback) {
475481
$defer = ($callback->getAttribute("defer") === "true");
476482
$applyCondition = $callback->getAttribute("applyCondition");

core/src/core/classes/class.AJXP_Exception.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*/
2727
class AJXP_Exception extends Exception
2828
{
29-
public function AJXP_Exception($messageString, $messageId = false)
29+
public function __construct($messageString, $messageId = false)
3030
{
3131
if ($messageId !== false && class_exists("ConfService")) {
3232
$messages = ConfService::getMessages();

core/src/core/classes/class.AJXP_JSPacker.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ class AJXP_JSPacker
3131
* Static function for packing all js and css into big files
3232
* Auto detect /js/*_list.txt files and /css/*_list.txt files and pack them.
3333
*/
34-
public function pack()
34+
public static function pack()
3535
{
3636
// Make sure that the gui.* plugin is loaded
37-
$plug = AJXP_PluginsService::getInstance()->getPluginsByType("gui");
37+
AJXP_PluginsService::getInstance()->getPluginsByType("gui");
3838

3939
$sList = glob(CLIENT_RESOURCES_FOLDER."/js/*_list.txt");
4040
foreach ($sList as $list) {

core/src/core/classes/class.AJXP_MetaStreamWrapper.php

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,17 @@
2121

2222
defined('AJXP_EXEC') or die('Access not allowed');
2323

24-
24+
/**
25+
* Class AJXP_MetaStreamWrapper
26+
*
27+
* Global streamWrapper that encapsulates all wrappers to access a driver's resource.
28+
* Registered under the "pydio" protocol, it should replace all the old ajxp.XX direct calls.
29+
* The static "appendMetaWrapper" method allows to add additional wrapper that will be sequentially called until
30+
* reaching the driver ajxp.XX wrapper.
31+
*
32+
* @package Pydio
33+
* @subpackage Core
34+
*/
2535
class AJXP_MetaStreamWrapper implements AjxpWrapper
2636
{
2737
/**
@@ -40,6 +50,10 @@ class AJXP_MetaStreamWrapper implements AjxpWrapper
4050

4151
protected static $cachedRepositoriesWrappers = array();
4252

53+
/**
54+
* Register the stack of protocols/wrappers.
55+
* @param null $registered_wrappers
56+
*/
4357
public static function register($registered_wrappers = null){
4458
if($registered_wrappers == null){
4559
$registered_wrappers = stream_get_wrappers();
@@ -51,6 +65,11 @@ public static function register($registered_wrappers = null){
5165
}
5266
}
5367

68+
/**
69+
* Register an addition protocol/wrapper in the stack
70+
* @param $name string
71+
* @param $className string
72+
*/
5473
public static function appendMetaWrapper($name, $className){
5574
self::$metaWrappers[$name] = $className;
5675
self::register();
@@ -105,6 +124,12 @@ protected static function actualRepositoryWrapperData($repositoryId){
105124
}
106125
}
107126

127+
/**
128+
* Return the final ajxp.XX wrapper class name.
129+
* @param $repositoryId
130+
* @return string mixed
131+
* @throws Exception
132+
*/
108133
public static function actualRepositoryWrapperClass($repositoryId){
109134
$data = self::actualRepositoryWrapperData($repositoryId);
110135
return $data["classname"];

core/src/core/classes/class.AJXP_Node.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ public function __get($varName)
533533
* Magic setter for metadata
534534
* @param $metaName
535535
* @param $metaValue
536-
* @return
536+
* @return void
537537
*/
538538
public function __set($metaName, $metaValue)
539539
{

core/src/core/classes/class.AJXP_Permission.php

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,15 @@
2121

2222
defined('AJXP_EXEC') or die('Access not allowed');
2323

24-
24+
/**
25+
* Class AJXP_Permission
26+
*
27+
* Atomic permission associated to a folder path. Can be initialized either with an integer
28+
* value (use MASK constants) or with a string value like "r", "rw", etc.
29+
*
30+
* @package Pydio
31+
* @subpackage Core
32+
*/
2533
class AJXP_Permission implements JsonSerializable
2634
{
2735
/**
@@ -55,25 +63,32 @@ function __construct($value = null){
5563
}
5664
}
5765

66+
/**
67+
* Replicate this permission.
68+
* @return AJXP_Permission
69+
*/
5870
function getCopy(){
5971
return new AJXP_Permission($this->value);
6072
}
6173

6274
/**
75+
* Test if the permission is readable
6376
* @return bool
6477
*/
6578
function canRead(){
6679
return ($this->value & self::READ) === self::READ;
6780
}
6881

6982
/**
83+
* Test if the permission is writeable
7084
* @return bool
7185
*/
7286
function canWrite(){
7387
return ($this->value & self::WRITE) === self::WRITE;
7488
}
7589

7690
/**
91+
* Test if the permission denies access, whatever happens.
7792
* @return bool
7893
*/
7994
function denies(){
@@ -82,10 +97,20 @@ function denies(){
8297
return false;
8398
}
8499

100+
/**
101+
* Test if the permission is just empty
102+
* @return bool
103+
*/
85104
function isEmpty(){
86105
return $this->value === 0;
87106
}
88107

108+
/**
109+
* Test permission against an integer value
110+
* @param int $numPerm
111+
* @return bool
112+
* @throws Exception
113+
*/
89114
function testPermission($numPerm){
90115
if(is_integer($numPerm) && ($numPerm < self::MASK)){
91116
$numPerm = $numPerm & self::MASK;
@@ -99,20 +124,34 @@ function testPermission($numPerm){
99124
}
100125
}
101126

127+
/**
128+
* Set this permission as readable
129+
* @param bool|true $value
130+
*/
102131
function setRead($value = true){
103132
if($value)
104133
$this->value = $this->value | self::READ;
105134
else{
106135
$this->value = $this->value & (self::READ ^ self::MASK);
107136
}
108137
}
138+
139+
/**
140+
* Set this permission as writeable
141+
* @param bool|true $value
142+
*/
109143
function setWrite($value = true){
110144
if($value)
111145
$this->value = $this->value | self::WRITE;
112146
else{
113147
$this->value = $this->value & (self::WRITE ^ self::MASK);
114148
}
115149
}
150+
151+
/**
152+
* Set this permission as denied
153+
* @param bool|true $value
154+
*/
116155
function setDeny($value = true){
117156
if($value)
118157
$this->value = self::DENY;
@@ -122,6 +161,7 @@ function setDeny($value = true){
122161
}
123162

124163
/**
164+
* Override this permission value with the one passed in parameter
125165
* @param AJXP_Permission $perm
126166
* @return AJXP_Permission
127167
*/

0 commit comments

Comments
 (0)