GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( c5bb66...d445c4 )
by Alexey
11:04
created

connector.minimal.php ➔ access()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 3
eloc 4
nc 4
nop 4
dl 0
loc 5
rs 9.4285
1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 23 and the first side effect is on line 3.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
3
error_reporting(0); // Set E_ALL for debuging
4
5
include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderConnector.class.php';
6
include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinder.class.php';
7
include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeDriver.class.php';
8
include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeLocalFileSystem.class.php';
9
// Required for MySQL storage connector
10
// include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeMySQL.class.php';
11
// Required for FTP connector support
12
// include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeFTP.class.php';
13
14
15
/**
16
 * Simple function to demonstrate how to control file access using "accessControl" callback.
17
 * This method will disable accessing files/folders starting from '.' (dot)
18
 *
19
 * @param  string  $attr  attribute name (read|write|locked|hidden)
20
 * @param  string  $path  file path relative to volume root directory started with directory separator
21
 * @return bool|null
22
 **/
23
function access($attr, $path, $data, $volume) {
0 ignored issues
show
Unused Code introduced by
The parameter $data is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $volume is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
24
	return strpos(basename($path), '.') === 0       // if file/folder begins with '.' (dot)
25
		? !($attr == 'read' || $attr == 'write')    // set read+write to false, other (locked+hidden) set to true
26
		:  null;                                    // else elFinder decide it itself
27
}
28
29
30
// Documentation for connector options:
31
// https://github.com/Studio-42/elFinder/wiki/Connector-configuration-options
32
$opts = array(
33
	// 'debug' => true,
34
	'roots' => array(
35
		array(
36
			'driver'        => 'LocalFileSystem',   // driver for accessing file system (REQUIRED)
37
			'path'          => '../files/',         // path to files (REQUIRED)
38
			'URL'           => dirname($_SERVER['PHP_SELF']) . '/../files/', // URL to files (REQUIRED)
39
			'accessControl' => 'access'             // disable and hide dot starting files (OPTIONAL)
40
		)
41
	)
42
);
43
44
// run elFinder
45
$connector = new elFinderConnector(new elFinder($opts));
46
$connector->run();
47
48