Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: php 8.2 #807

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ MINIO_MC = "minio/mc:RELEASE.2020-12-18T10-53-53Z"
OC_CI_ALPINE = "owncloudci/alpine:latest"
OC_CI_BAZEL_BUILDIFIER = "owncloudci/bazel-buildifier"
OC_CI_CEPH = "owncloudci/ceph:tag-build-master-jewel-ubuntu-16.04"
OC_CI_CORE = "owncloudci/core"
OC_CI_CORE = "owncloudci/core:php82"
OC_CI_DRONE_SKIP_PIPELINE = "owncloudci/drone-skip-pipeline"
OC_CI_NODEJS = "owncloudci/nodejs:%s"
OC_CI_ORACLE_XE = "owncloudci/oracle-xe:latest"
Expand All @@ -22,7 +22,7 @@ SELENIUM_STANDALONE_CHROME_DEBUG = "selenium/standalone-chrome-debug:3.141.59-ox
SELENIUM_STANDALONE_FIREFOX_DEBUG = "selenium/standalone-firefox-debug:3.8.1"
SONARSOURCE_SONAR_SCANNER_CLI = "sonarsource/sonar-scanner-cli"

DEFAULT_PHP_VERSION = "7.4"
DEFAULT_PHP_VERSION = "8.2"
DEFAULT_NODEJS_VERSION = "14"

# minio mc environment variables
Expand Down Expand Up @@ -60,14 +60,7 @@ config = {
],
"codestyle": True,
"phpstan": True,
"phan": {
"multipleVersions": {
"phpVersions": [
DEFAULT_PHP_VERSION,
"7.3",
],
},
},
"phan": False,
"javascript": False,
"phpunit": {
"allDatabases": {
Expand Down Expand Up @@ -2247,7 +2240,7 @@ def installCore(ctx, version, db, useBundledApp):
"name": "install-core",
"image": OC_CI_CORE,
"settings": {
"version": version,
"git_reference": "feat/php8",
"core_path": dir["server"],
"db_type": dbType,
"db_name": database,
Expand Down Expand Up @@ -2821,7 +2814,7 @@ def ldapIntegration(ctx):

default = {
"servers": ["daily-master-qa"],
"phpVersions": ["7.4"],
"phpVersions": ["8.2"],
"databases": ["mysql:8.0"],
"ldapNeeded": True,
"logLevel": "2",
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"config": {
"platform": {
"php": "7.3"
"php": "8.2"
},
"allow-plugins": {
"bamarni/composer-bin-plugin": true
Expand All @@ -12,7 +12,7 @@
"laminas/laminas-ldap": "^2.13"
},
"require": {
"php": ">=7.3",
"php": ">=8.2",
"ext-ldap": "*"
},
"extra": {
Expand Down
36 changes: 18 additions & 18 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions lib/Access.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ public function readAttribute($dn, $attr, $filter = 'objectClass=*') {
/**
* Runs an read operation against LDAP
*
* @param resource $cr the LDAP connection
* @param \LDAP\Connection $cr the LDAP connection
* @param string $dn
* @param string|array $attributes
* @param string $filter
Expand Down Expand Up @@ -769,7 +769,8 @@ public function countUsersByLoginName($loginName) {
*/
public function fetchListOfUsers($filter, $attr, $limit = null, $offset = null) {
$ldapRecords = $this->searchUsers($filter, $attr, $limit, $offset);
return $this->fetchList($ldapRecords, \count($attr) > 1);
$manyAttributes = \is_string($attr) ? false : \count($attr) > 1;
return $this->fetchList($ldapRecords, $manyAttributes);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions lib/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
*/
class Connection extends LDAPUtility {
/**
* @var resource|null
* @var \LDAP\Connection | null
*/
private $ldapConnectionRes;

Expand Down Expand Up @@ -201,7 +201,7 @@ public function setIgnoreValidation($state) {
/**
* Returns the LDAP handler
*
* @return resource | null
* @return \LDAP\Connection | null
*
* @throws \OC\ServerNotAvailableException
* @throws BindFailedException
Expand Down
37 changes: 19 additions & 18 deletions lib/ILDAPWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ interface ILDAPWrapper {

/**
* Bind to LDAP directory
* @param resource $link LDAP link resource
* @param \LDAP\Connection $link LDAP link resource
* @param string $dn an RDN to log in with
* @param string $password the password
* @return bool true on success, false otherwise
Expand All @@ -59,7 +59,7 @@ public function connect($host, $port);

/**
* Send LDAP pagination control
* @param resource $link LDAP link resource
* @param \LDAP\Connection $link LDAP link resource
* @param int $pageSize number of results per page
* @param bool $isCritical Indicates whether the pagination is critical of not.
* @param string $cookie structure sent by LDAP server
Expand All @@ -69,8 +69,8 @@ public function controlPagedResult($link, $pageSize, $isCritical, $cookie);

/**
* Retrieve the LDAP pagination cookie
* @param resource $link LDAP link resource
* @param resource $result LDAP result resource
* @param \LDAP\Connection $link LDAP link resource
* @param \LDAP\Result $result LDAP result resource
* @param string $cookie structure sent by LDAP server
* @param int $estimated The estimated number of entries to retrieve.
* @return bool true on success, false otherwise
Expand All @@ -81,22 +81,22 @@ public function controlPagedResultResponse($link, $result, &$cookie = null, &$es

/**
* Count the number of entries in a search
* @param resource $link LDAP link resource
* @param \LDAP\Connection $link LDAP link resource
* @param resource $result LDAP result resource
* @return int|false number of results on success, false otherwise
*/
public function countEntries($link, $result);

/**
* Return the LDAP error number of the last LDAP command
* @param resource $link LDAP link resource
* @param \LDAP\Connection $link LDAP link resource
* @return string error message as string
*/
public function errno($link);

/**
* Return the LDAP error message of the last LDAP command
* @param resource $link LDAP link resource
* @param \LDAP\Connection $link LDAP link resource
* @return int error code as integer
*/
public function error($link);
Expand Down Expand Up @@ -124,47 +124,47 @@ public function explodeDN($dn, $withAttrib);

/**
* Return first result id
* @param resource $link LDAP link resource
* @param \LDAP\Connection $link LDAP link resource
* @param resource $result LDAP result resource
* @return Resource an LDAP search result resource
* */
public function firstEntry($link, $result);

/**
* Get attributes from a search result entry
* @param resource $link LDAP link resource
* @param \LDAP\Connection $link LDAP link resource
* @param resource $result LDAP result resource
* @return array containing the results, false on error
* */
public function getAttributes($link, $result);

/**
* Get the DN of a result entry
* @param resource $link LDAP link resource
* @param \LDAP\Connection $link LDAP link resource
* @param resource $result LDAP result resource
* @return string containing the DN, false on error
*/
public function getDN($link, $result);

/**
* Get all result entries
* @param resource $link LDAP link resource
* @param \LDAP\Connection $link LDAP link resource
* @param resource $result LDAP result resource
* @return array containing the results, false on error
*/
public function getEntries($link, $result);

/**
* Return next result id
* @param resource $link LDAP link resource
* @param \LDAP\Connection $link LDAP link resource
* @param resource $result LDAP entry result resource
* @return resource an LDAP search result resource
* */
public function nextEntry($link, $result);

/**
* Read an entry
* @param resource $link LDAP link resource
* @param \LDAP\Connection $link LDAP link resource
* @param string $baseDN The DN of the entry to read from
* @param string $filter An LDAP filter
* @param array $attr array of the attributes to read
Expand All @@ -174,7 +174,8 @@ public function read($link, $baseDN, $filter, $attr);

/**
* Search LDAP tree
* @param resource $link LDAP link resource
*
* @param \LDAP\Connection $link LDAP link resource
* @param string $baseDN The DN of the entry to read from
* @param string $filter An LDAP filter
* @param array $attr array of the attributes to read
Expand All @@ -186,7 +187,7 @@ public function search($link, $baseDN, $filter, $attr, $attrsOnly = 0, $limit =

/**
* Sets the value of the specified option to be $value
* @param resource $link LDAP link resource
* @param \LDAP\Connection $link LDAP link resource
* @param string $option a defined LDAP Server option
* @param int $value the new value for the option
* @return bool true on success, false otherwise
Expand All @@ -195,14 +196,14 @@ public function setOption($link, $option, $value);

/**
* establish Start TLS
* @param resource $link LDAP link resource
* @param \LDAP\Connection $link LDAP link resource
* @return bool true on success, false otherwise
*/
public function startTls($link);

/**
* Unbind from LDAP directory
* @param resource $link LDAP link resource
* @param \LDAP\Connection $link LDAP link resource
* @return bool true on success, false otherwise
*/
public function unbind($link);
Expand All @@ -223,7 +224,7 @@ public function hasPagedResultSupport();

/**
* Checks whether the submitted parameter is a resource
* @param resource $resource the resource variable to check
* @param \LDAP\Connection|resource $resource the resource variable to check
* @return bool true if it is a resource, false otherwise
*/
public function isResource($resource);
Expand Down
Loading