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

Commit 10ee151

Browse files
committed
PHPDocs
1 parent 1de3ac8 commit 10ee151

File tree

77 files changed

+1352
-28
lines changed

Some content is hidden

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

77 files changed

+1352
-28
lines changed

core/src/plugins/access.ajxp_home/HomePagePlugin.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@
3333
*/
3434
class HomePagePlugin extends AbstractAccessDriver
3535
{
36-
36+
37+
/**
38+
* @param ContextInterface $ctx
39+
* @param \DOMNode $contribNode
40+
*/
3741
public function parseSpecificContributions(ContextInterface $ctx, \DOMNode &$contribNode){
3842
parent::parseSpecificContributions($ctx, $contribNode);
3943
if($contribNode->nodeName == "client_configs"){

core/src/plugins/access.ajxp_user/UserDashboardDriver.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ protected function initRepository(ContextInterface $contextInterface)
5858
require_once AJXP_INSTALL_PATH . "/" . AJXP_PLUGINS_FOLDER . "/action.share/vendor/autoload.php";
5959
}
6060

61+
/**
62+
* @param ContextInterface $ctx
63+
* @param \DOMNode $contribNode
64+
*/
6165
public function parseSpecificContributions(ContextInterface $ctx, \DOMNode &$contribNode){
6266
$disableAddressBook = $this->getContextualOption($ctx, "DASH_DISABLE_ADDRESS_BOOK") === true;
6367
if($contribNode->nodeName == "client_configs" && $disableAddressBook){
@@ -70,6 +74,11 @@ public function parseSpecificContributions(ContextInterface $ctx, \DOMNode &$con
7074
parent::parseSpecificContributions($ctx, $contribNode);
7175
}
7276

77+
/**
78+
* @param ServerRequestInterface $requestInterface
79+
* @param ResponseInterface $responseInterface
80+
* @throws \Exception
81+
*/
7382
public function switchAction(ServerRequestInterface $requestInterface, ResponseInterface &$responseInterface)
7483
{
7584
parent::accessPreprocess($requestInterface);
@@ -196,6 +205,10 @@ public function listMinisites(ContextInterface $ctx)
196205
return $minisites;
197206
}
198207

208+
/**
209+
* @param $metaIcon
210+
* @return string
211+
*/
199212
private function metaIcon($metaIcon)
200213
{
201214
return "<span class='icon-".$metaIcon." meta-icon'></span> ";

core/src/plugins/access.demo/DemoAccessDriver.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ class DemoAccessDriver extends FsAccessDriver
4242
*/
4343
public $repository;
4444

45+
/**
46+
* @param ServerRequestInterface $request
47+
* @param ResponseInterface $response
48+
* @throws PydioException
49+
* @throws \Exception
50+
* @return array|void
51+
*/
4552
public function switchAction(ServerRequestInterface &$request, ResponseInterface &$response)
4653
{
4754
$errorMessage = "This is a demo, all 'write' actions are disabled!";

core/src/plugins/access.dropbox/src/Driver.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ protected function initRepository(ContextInterface $context)
8282
return true;
8383
}
8484

85+
/**
86+
* @param ServerRequestInterface $request
87+
* @param ResponseInterface $response
88+
* @throws \Exception
89+
* @throws \Pydio\Core\Exception\PydioException
90+
*/
8591
public function switchAction(ServerRequestInterface &$request, ResponseInterface &$response) {
8692
$httpVars = $request->getParsedBody();
8793

@@ -116,6 +122,11 @@ public static function convertPath(AJXP_Node $node) {
116122
return "";
117123
}
118124

125+
/**
126+
* @param $key
127+
* @param $value
128+
* @return string
129+
*/
119130
public static function convertToJSON($key, $value) {
120131
$key = '' . $key->getName();
121132
$value = '' . $value;

core/src/plugins/access.fs/FsAccessWrapper.php

Lines changed: 108 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,10 @@ public static function getResolvedOptionsForNode($node)
212212
];
213213
}
214214

215+
/**
216+
* @param string $tmpDir
217+
* @param string $tmpFile
218+
*/
215219
public static function removeTmpFile($tmpDir, $tmpFile)
216220
{
217221
if(is_file($tmpFile)) unlink($tmpFile);
@@ -229,34 +233,50 @@ protected static function closeWrapper()
229233
}
230234
}
231235

236+
/**
237+
* @param string $path
238+
* @param bool $persistent
239+
* @return mixed
240+
* @throws PydioException
241+
* @throws \Exception
242+
*/
232243
public static function getRealFSReference($path, $persistent = false)
233244
{
234-
$contextOpened =false;
235245
if (self::$crtZip != null) {
236-
$contextOpened = true;
237246
$crtZip = self::$crtZip;
238247
self::$crtZip = null;
239248
}
240249
$realPath = self::initPath($path, "file");
241-
if (!$contextOpened) {
242-
self::closeWrapper();
243-
} else {
250+
if (isSet($crtZip)) {
244251
self::$crtZip = $crtZip;
252+
} else {
253+
self::closeWrapper();
245254
}
246255
return $realPath;
247256
}
248257

258+
/**
259+
* @return bool
260+
*/
249261
public static function isRemote()
250262
{
251263
return false;
252264
}
253265

266+
/**
267+
* @param String $url
268+
* @return bool
269+
*/
254270
public static function isSeekable($url)
255271
{
256272
if(strpos($url, ".zip/") !== false) return false;
257273
return true;
258274
}
259275

276+
/**
277+
* @param string $path
278+
* @param resource $stream
279+
*/
260280
public static function copyFileInStream($path, $stream)
261281
{
262282
$fp = fopen(self::getRealFSReference($path), "rb");
@@ -269,6 +289,12 @@ public static function copyFileInStream($path, $stream)
269289
fclose($fp);
270290
}
271291

292+
/**
293+
* @param string $path
294+
* @param number $chmodValue
295+
* @throws PydioException
296+
* @throws \Exception
297+
*/
272298
public static function changeMode($path, $chmodValue)
273299
{
274300
$realPath = self::initPath($path, "file");
@@ -301,16 +327,27 @@ public function stream_open($path, $mode, $options, &$context)
301327
}
302328
}
303329

330+
/**
331+
* @param int $offset
332+
* @param int $whence
333+
* @return bool
334+
*/
304335
public function stream_seek($offset , $whence = SEEK_SET)
305336
{
306-
fseek($this->fp, $offset, $whence);
337+
return fseek($this->fp, $offset, $whence);
307338
}
308339

340+
/**
341+
* @return int
342+
*/
309343
public function stream_tell()
310344
{
311345
return ftell($this->fp);
312346
}
313347

348+
/**
349+
* @return array|mixed|null
350+
*/
314351
public function stream_stat()
315352
{
316353
$PROBE_REAL_SIZE = ConfService::getConf("PROBE_REAL_SIZE");
@@ -331,6 +368,13 @@ public function stream_stat()
331368
return null;
332369
}
333370

371+
/**
372+
* @param string $path
373+
* @param int $flags
374+
* @return array|null
375+
* @throws PydioException
376+
* @throws \Exception
377+
*/
334378
public function url_stat($path, $flags)
335379
{
336380
// File and zip case
@@ -384,22 +428,40 @@ public function url_stat($path, $flags)
384428
return null;
385429
}
386430

431+
/**
432+
* @param string $from
433+
* @param string $to
434+
* @return bool
435+
* @throws PydioException
436+
* @throws \Exception
437+
*/
387438
public function rename($from, $to)
388439
{
389440
return rename($this->initPath($from, "file", false, true), $this->initPath($to, "file", false, true));
390441
}
391442

443+
/**
444+
* @param int $count
445+
* @return string
446+
*/
392447
public function stream_read($count)
393448
{
394449
return fread($this->fp, $count);
395450
}
396451

452+
/**
453+
* @param string $data
454+
* @return int
455+
*/
397456
public function stream_write($data)
398457
{
399458
fwrite($this->fp, $data, strlen($data));
400459
return strlen($data);
401460
}
402461

462+
/**
463+
* @return bool
464+
*/
403465
public function stream_eof()
404466
{
405467
return feof($this->fp);
@@ -412,25 +474,49 @@ public function stream_close()
412474
}
413475
}
414476

477+
/**
478+
*
479+
*/
415480
public function stream_flush()
416481
{
417482
if (isSet($this->fp) && $this->fp!=-1 && $this->fp!==false) {
418483
fflush($this->fp);
419484
}
420485
}
421486

487+
/**
488+
* @param string $path
489+
* @return bool
490+
* @throws PydioException
491+
* @throws \Exception
492+
*/
422493
public function unlink($path)
423494
{
424495
$this->realPath = $this->initPath($path, "file", false, true);
425496
return unlink($this->realPath);
426497
}
427498

499+
/**
500+
* @param string $path
501+
* @param int $options
502+
* @return bool
503+
* @throws PydioException
504+
* @throws \Exception
505+
*/
428506
public function rmdir($path, $options)
429507
{
430508
$this->realPath = $this->initPath($path, "file", false, true);
431509
return rmdir($this->realPath);
432510
}
433511

512+
/**
513+
* @param string $path
514+
* @param int $mode
515+
* @param int $options
516+
* @return bool
517+
* @throws PydioException
518+
* @throws \Exception
519+
*/
434520
public function mkdir($path, $mode, $options)
435521
{
436522
return mkdir($this->initPath($path, "file"), $mode);
@@ -453,6 +539,10 @@ public function dir_opendir ($path , $options )
453539
}
454540
return $this->dH !== false;
455541
}
542+
543+
/**
544+
* Close dir handle
545+
*/
456546
public function dir_closedir ()
457547
{
458548
$this->closeWrapper();
@@ -462,6 +552,10 @@ public function dir_closedir ()
462552
closedir($this->dH);
463553
}
464554
}
555+
556+
/**
557+
* @return bool|string
558+
*/
465559
public function dir_readdir ()
466560
{
467561
if ($this->dH == -1) {
@@ -475,6 +569,10 @@ public function dir_readdir ()
475569
return readdir($this->dH);
476570
}
477571
}
572+
573+
/**
574+
*
575+
*/
478576
public function dir_rewinddir ()
479577
{
480578
if ($this->dH == -1) {
@@ -493,6 +591,10 @@ public static function getLastRealSize()
493591
return self::$lastRealSize;
494592
}
495593

594+
/**
595+
* @param $file
596+
* @return float|string
597+
*/
496598
protected function getTrueSizeOnFileSystem($file)
497599
{
498600
if (!(strtoupper(substr(PHP_OS, 0, 3)) == 'WIN')) {

core/src/plugins/access.fs/test.fsAccess.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
*/
3333
class fsAccessTest extends AbstractTest
3434
{
35+
/**
36+
* fsAccessTest constructor.
37+
*/
3538
public function __construct() { parent::__construct("Filesystem Plugin", ""); }
3639

3740
/**

0 commit comments

Comments
 (0)