mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
fix conflict
This commit is contained in:
commit
feaa2e5ba3
29
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
29
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
|
|
@ -19,20 +19,9 @@ body:
|
|||
- type: input
|
||||
id: environment-version
|
||||
attributes:
|
||||
label: Environment Version
|
||||
label: Dolibarr Version
|
||||
description: Affected Dolibarr version(s)
|
||||
|
||||
- type: input
|
||||
id: environment-os
|
||||
attributes:
|
||||
label: Environment OS
|
||||
description: Server OS type and version
|
||||
|
||||
- type: input
|
||||
id: environment-webserver
|
||||
attributes:
|
||||
label: Environment Web server
|
||||
description: Webserver type and version
|
||||
placeholder: 19.0, develop, ...
|
||||
|
||||
- type: input
|
||||
id: environment-php
|
||||
|
|
@ -46,22 +35,10 @@ body:
|
|||
label: Environment Database
|
||||
description: Database type and version
|
||||
|
||||
- type: input
|
||||
id: environment-urls
|
||||
attributes:
|
||||
label: Environment URL(s)
|
||||
description: Affected URL(s)
|
||||
|
||||
- type: textarea
|
||||
id: expected-behaviour
|
||||
attributes:
|
||||
label: Expected and actual behavior
|
||||
description: Verbose description
|
||||
|
||||
- type: textarea
|
||||
id: reproduce
|
||||
attributes:
|
||||
label: Steps to reproduce the behavior
|
||||
label: Steps to reproduce the behavior and expected behavior
|
||||
description: Verbose description
|
||||
|
||||
- type: textarea
|
||||
|
|
|
|||
588
.github/logToCs.py
vendored
588
.github/logToCs.py
vendored
|
|
@ -1,588 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
# pylint: disable=invalid-name
|
||||
"""
|
||||
Convert a log to CheckStyle format.
|
||||
|
||||
Url: https://github.com/mdeweerd/LogToCheckStyle
|
||||
|
||||
The log can then be used for generating annotations in a github action.
|
||||
|
||||
Note: this script is very young and "quick and dirty".
|
||||
Patterns can be added to "PATTERNS" to match more messages.
|
||||
|
||||
# Examples
|
||||
|
||||
Assumes that logToCs.py is available as .github/logToCs.py.
|
||||
|
||||
## Example 1:
|
||||
|
||||
|
||||
```yaml
|
||||
- run: |
|
||||
pre-commit run -all-files | tee pre-commit.log
|
||||
.github/logToCs.py pre-commit.log pre-commit.xml
|
||||
- uses: staabm/annotate-pull-request-from-checkstyle-action@v1
|
||||
with:
|
||||
files: pre-commit.xml
|
||||
notices-as-warnings: true # optional
|
||||
```
|
||||
|
||||
## Example 2:
|
||||
|
||||
|
||||
```yaml
|
||||
- run: |
|
||||
pre-commit run --all-files | tee pre-commit.log
|
||||
- name: Add results to PR
|
||||
if: ${{ always() }}
|
||||
run: |
|
||||
.github/logToCs.py pre-commit.log | cs2pr
|
||||
```
|
||||
|
||||
Author(s):
|
||||
- https://github.com/mdeweerd
|
||||
|
||||
License: MIT License
|
||||
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import datetime as dt
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import xml.etree.ElementTree as ET # nosec
|
||||
|
||||
|
||||
def remove_prefix(string, prefix):
|
||||
"""
|
||||
Remove prefix from string
|
||||
|
||||
Provided for backward compatibility.
|
||||
"""
|
||||
if prefix and string.startswith(prefix):
|
||||
return string[len(prefix) :]
|
||||
return string
|
||||
|
||||
|
||||
def convert_notices_to_checkstyle(notices, root_path=None):
|
||||
"""
|
||||
Convert annotation list to CheckStyle xml string
|
||||
"""
|
||||
root = ET.Element("checkstyle")
|
||||
for fields in notices:
|
||||
add_error_entry(root, **fields, root_path=root_path)
|
||||
return ET.tostring(root, encoding="utf_8").decode("utf_8")
|
||||
|
||||
|
||||
def convert_lines_to_notices(lines):
|
||||
"""
|
||||
Convert provided message to CheckStyle format.
|
||||
"""
|
||||
notices = []
|
||||
for line in lines:
|
||||
fields = parse_message(line)
|
||||
if fields:
|
||||
notices.append(fields)
|
||||
return notices
|
||||
|
||||
|
||||
def convert_text_to_notices(text):
|
||||
"""
|
||||
Convert provided message to CheckStyle format.
|
||||
"""
|
||||
return parse_file(text)
|
||||
|
||||
|
||||
# Initial version for Checkrun from:
|
||||
# https://github.com/tayfun/flake8-your-pr/blob/50a175cde4dd26a656734c5b64ba1e5bb27151cb/src/main.py#L7C1-L123C36
|
||||
# MIT Licence
|
||||
class CheckRun:
|
||||
"""
|
||||
Represents the check run
|
||||
"""
|
||||
|
||||
GITHUB_TOKEN = os.environ.get("GITHUB_TOKEN", None)
|
||||
GITHUB_EVENT_PATH = os.environ.get("GITHUB_EVENT_PATH", None)
|
||||
|
||||
URI = "https://api.github.com"
|
||||
API_VERSION = "2022-11-28"
|
||||
ACCEPT_HEADER_VALUE = "application/vnd.github+json"
|
||||
AUTH_HEADER_VALUE = f"Bearer {GITHUB_TOKEN}"
|
||||
# This is the max annotations Github API accepts in one go.
|
||||
MAX_ANNOTATIONS = 50
|
||||
|
||||
def __init__(self):
|
||||
"""
|
||||
Initialise Check Run object with information from checkrun
|
||||
"""
|
||||
self.read_event_file()
|
||||
self.read_meta_data()
|
||||
|
||||
def read_event_file(self):
|
||||
"""
|
||||
Read the event file to get the event information later.
|
||||
"""
|
||||
if self.GITHUB_EVENT_PATH is None:
|
||||
raise ValueError("Not running in github workflow")
|
||||
with open(self.GITHUB_EVENT_PATH, encoding="utf_8") as event_file:
|
||||
self.event = json.loads(event_file.read())
|
||||
|
||||
def read_meta_data(self):
|
||||
"""
|
||||
Get meta data from event information
|
||||
"""
|
||||
self.repo_full_name = self.event["repository"]["full_name"]
|
||||
pull_request = self.event.get("pull_request")
|
||||
print("%r", self.event)
|
||||
if pull_request:
|
||||
self.head_sha = pull_request["head"]["sha"]
|
||||
else:
|
||||
print("%r", self.event)
|
||||
check_suite = self.event.get("check_suite", None)
|
||||
if check_suite is not None:
|
||||
self.head_sha = check_suite["pull_requests"][0]["base"]["sha"]
|
||||
else:
|
||||
self.head_sha = None # Can't annotate?
|
||||
|
||||
def submit( # pylint: disable=too-many-arguments
|
||||
self,
|
||||
notices,
|
||||
title=None,
|
||||
summary=None,
|
||||
text=None,
|
||||
conclusion=None,
|
||||
):
|
||||
"""
|
||||
Submit annotations to github
|
||||
|
||||
See:
|
||||
https://docs.github.com/en/rest/checks/runs?apiVersion=2022-11-28
|
||||
#update-a-check-run
|
||||
|
||||
:param conclusion: success, failure
|
||||
"""
|
||||
# pylint: disable=import-outside-toplevel
|
||||
import requests # Import here to not impose presence of module
|
||||
|
||||
if self.head_sha is None:
|
||||
return
|
||||
|
||||
output = {
|
||||
"annotations": notices[: CheckRun.MAX_ANNOTATIONS],
|
||||
}
|
||||
if title is not None:
|
||||
output["title"] = title
|
||||
if summary is not None:
|
||||
output["summary"] = summary
|
||||
if text is not None:
|
||||
output["text"] = text
|
||||
if conclusion is None:
|
||||
# action_required, cancelled, failure, neutral, success
|
||||
# skipped, stale, timed_out
|
||||
if bool(notices):
|
||||
conclusion = "failure"
|
||||
else:
|
||||
conclusion = "success"
|
||||
|
||||
payload = {
|
||||
"name": "log-to-pr-annotation",
|
||||
"head_sha": self.head_sha,
|
||||
"status": "completed", # queued, in_progress, completed
|
||||
"conclusion": conclusion,
|
||||
# "started_at": dt.datetime.now(dt.timezone.utc).isoformat(),
|
||||
"completed_at": dt.datetime.now(dt.timezone.utc).isoformat(),
|
||||
"output": output,
|
||||
}
|
||||
|
||||
# Create the check-run
|
||||
response = requests.post(
|
||||
f"{self.URI}/repos/{self.repo_full_name}/check-runs",
|
||||
headers={
|
||||
"Accept": self.ACCEPT_HEADER_VALUE,
|
||||
"Authorization": self.AUTH_HEADER_VALUE,
|
||||
"X-GitHub-Api-Version": self.API_VERSION,
|
||||
},
|
||||
json=payload,
|
||||
timeout=30,
|
||||
)
|
||||
print(response.content)
|
||||
response.raise_for_status()
|
||||
|
||||
|
||||
ANY_REGEX = r".*?"
|
||||
FILE_REGEX = r"\s*(?P<file_name>\S.*?)\s*?"
|
||||
FILEGROUP_REGEX = r"\s*(?P<file_group>\S.*?)\s*?"
|
||||
EOL_REGEX = r"[\r\n]"
|
||||
LINE_REGEX = r"\s*(?P<line>\d+?)\s*?"
|
||||
COLUMN_REGEX = r"\s*(?P<column>\d+?)\s*?"
|
||||
SEVERITY_REGEX = r"\s*(?P<severity>error|warning|notice|style|info)\s*?"
|
||||
MSG_REGEX = r"\s*(?P<message>.+?)\s*?"
|
||||
MULTILINE_MSG_REGEX = r"\s*(?P<message>(?:.|.[\r\n])+)"
|
||||
# cpplint confidence index
|
||||
CONFIDENCE_REGEX = r"\s*\[(?P<confidence>\d+)\]\s*?"
|
||||
|
||||
|
||||
# List of message patterns, add more specific patterns earlier in the list
|
||||
# Creating patterns by using constants makes them easier to define and read.
|
||||
PATTERNS = [
|
||||
# beautysh
|
||||
# File ftp.sh: error: "esac" before "case" in line 90.
|
||||
re.compile(
|
||||
f"^File {FILE_REGEX}:{SEVERITY_REGEX}:"
|
||||
f" {MSG_REGEX} in line {LINE_REGEX}.$"
|
||||
),
|
||||
# beautysh
|
||||
# File socks4echo.sh: error: indent/outdent mismatch: -2.
|
||||
re.compile(f"^File {FILE_REGEX}:{SEVERITY_REGEX}: {MSG_REGEX}$"),
|
||||
# yamllint
|
||||
# ##[group].pre-commit-config.yaml
|
||||
# ##[error]97:14 [trailing-spaces] trailing spaces
|
||||
# ##[endgroup]
|
||||
re.compile(rf"^##\[group\]{FILEGROUP_REGEX}$"), # Start file group
|
||||
re.compile(
|
||||
rf"^##\[{SEVERITY_REGEX}\]{LINE_REGEX}:{COLUMN_REGEX}{MSG_REGEX}$"
|
||||
), # Msg
|
||||
re.compile(r"^##(?P<file_endgroup>\[endgroup\])$"), # End file group
|
||||
# File socks4echo.sh: error: indent/outdent mismatch: -2.
|
||||
re.compile(f"^File {FILE_REGEX}:{SEVERITY_REGEX}: {MSG_REGEX}$"),
|
||||
# Emacs style
|
||||
# path/to/file:845:5: error - Expected 1 space after closing brace
|
||||
re.compile(
|
||||
rf"^{FILE_REGEX}:{LINE_REGEX}:{COLUMN_REGEX}:{SEVERITY_REGEX}"
|
||||
rf"-?\s{MSG_REGEX}$"
|
||||
),
|
||||
# ESLint (JavaScript Linter), RoboCop, shellcheck
|
||||
# path/to/file.js:10:2: Some linting issue
|
||||
# path/to/file.rb:10:5: Style/Indentation: Incorrect indentation detected
|
||||
# path/to/script.sh:10:1: SC2034: Some shell script issue
|
||||
re.compile(f"^{FILE_REGEX}:{LINE_REGEX}:{COLUMN_REGEX}: {MSG_REGEX}$"),
|
||||
# Cpplint default output:
|
||||
# '%s:%s: %s [%s] [%d]\n'
|
||||
# % (filename, linenum, message, category, confidence)
|
||||
re.compile(f"^{FILE_REGEX}:{LINE_REGEX}:{MSG_REGEX}{CONFIDENCE_REGEX}$"),
|
||||
# MSVC
|
||||
# file.cpp(10): error C1234: Some error message
|
||||
re.compile(
|
||||
f"^{FILE_REGEX}\\({LINE_REGEX}\\):{SEVERITY_REGEX}{MSG_REGEX}$"
|
||||
),
|
||||
# Java compiler
|
||||
# File.java:10: error: Some error message
|
||||
re.compile(f"^{FILE_REGEX}:{LINE_REGEX}:{SEVERITY_REGEX}:{MSG_REGEX}$"),
|
||||
# Python
|
||||
# File ".../logToCs.py", line 90 (note: code line follows)
|
||||
re.compile(f'^File "{FILE_REGEX}", line {LINE_REGEX}$'),
|
||||
# Pylint, others
|
||||
# path/to/file.py:10: [C0111] Missing docstring
|
||||
# others
|
||||
re.compile(f"^{FILE_REGEX}:{LINE_REGEX}: {MSG_REGEX}$"),
|
||||
# Shellcheck:
|
||||
# In script.sh line 76:
|
||||
re.compile(
|
||||
f"^In {FILE_REGEX} line {LINE_REGEX}:{EOL_REGEX}?"
|
||||
f"({MULTILINE_MSG_REGEX})?{EOL_REGEX}{EOL_REGEX}"
|
||||
),
|
||||
# eslint:
|
||||
# /path/to/filename
|
||||
# 14:5 error Unexpected trailing comma comma-dangle
|
||||
re.compile(
|
||||
f"^{FILE_REGEX}{EOL_REGEX}"
|
||||
rf"\s+{LINE_REGEX}:{COLUMN_REGEX}\s+{SEVERITY_REGEX}\s+{MSG_REGEX}$"
|
||||
),
|
||||
]
|
||||
|
||||
# Exceptionnaly some regexes match messages that are not error.
|
||||
# This pattern matches those exceptions
|
||||
EXCLUDE_MSG_PATTERN = re.compile(
|
||||
r"^("
|
||||
r"Placeholder pattern" # To remove on first message pattern
|
||||
r")"
|
||||
)
|
||||
|
||||
# Exceptionnaly some regexes match messages that are not error.
|
||||
# This pattern matches those exceptions
|
||||
EXCLUDE_FILE_PATTERN = re.compile(
|
||||
r"^("
|
||||
# Codespell: (appears as a file name):
|
||||
r"Used config files\b"
|
||||
r")"
|
||||
)
|
||||
|
||||
# Severities available in CodeSniffer report format
|
||||
SEVERITY_NOTICE = "notice"
|
||||
SEVERITY_WARNING = "warning"
|
||||
SEVERITY_ERROR = "error"
|
||||
|
||||
|
||||
def strip_ansi(text: str):
|
||||
"""
|
||||
Strip ANSI escape sequences from string (colors, etc)
|
||||
"""
|
||||
return re.sub(r"\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])", "", text)
|
||||
|
||||
|
||||
def parse_file(text):
|
||||
"""
|
||||
Parse all messages in a file
|
||||
|
||||
Returns the fields in a dict.
|
||||
"""
|
||||
# pylint: disable=too-many-branches,too-many-statements
|
||||
# regex required to allow same group names
|
||||
try:
|
||||
import regex # pylint: disable=import-outside-toplevel
|
||||
except ImportError as exc:
|
||||
raise ImportError(
|
||||
"The 'parsefile' method requires 'python -m pip install regex'"
|
||||
) from exc
|
||||
|
||||
patterns = [pattern.pattern for pattern in PATTERNS]
|
||||
# patterns = [PATTERNS[0].pattern]
|
||||
|
||||
file_group = None # The file name for the group (if any)
|
||||
full_regex = "(?:(?:" + (")|(?:".join(patterns)) + "))"
|
||||
results = []
|
||||
|
||||
for fields in regex.finditer(
|
||||
full_regex, strip_ansi(text), regex.MULTILINE | regex.IGNORECASE
|
||||
):
|
||||
if not fields:
|
||||
continue
|
||||
result = fields.groupdict()
|
||||
|
||||
if len(result) == 0:
|
||||
continue
|
||||
|
||||
severity = result.get("severity", None)
|
||||
file_name = result.get("file_name", None)
|
||||
confidence = result.pop("confidence", None)
|
||||
new_file_group = result.pop("file_group", None)
|
||||
file_endgroup = result.pop("file_endgroup", None)
|
||||
message = result.get("message", None)
|
||||
|
||||
if new_file_group is not None:
|
||||
# Start of file_group, just store file
|
||||
file_group = new_file_group
|
||||
continue
|
||||
|
||||
if file_endgroup is not None:
|
||||
file_group = None
|
||||
continue
|
||||
|
||||
if file_name is None:
|
||||
if file_group is not None:
|
||||
file_name = file_group
|
||||
result["file_name"] = file_name
|
||||
else:
|
||||
# No filename, skip
|
||||
continue
|
||||
else:
|
||||
if EXCLUDE_FILE_PATTERN.search(file_name):
|
||||
# This file_name is excluded
|
||||
continue
|
||||
|
||||
if message is not None:
|
||||
if EXCLUDE_MSG_PATTERN.search(message):
|
||||
# This message is excluded
|
||||
continue
|
||||
|
||||
if confidence is not None:
|
||||
# Convert confidence level of cpplint
|
||||
# to warning, etc.
|
||||
confidence = int(confidence)
|
||||
|
||||
if confidence <= 1:
|
||||
severity = SEVERITY_NOTICE
|
||||
elif confidence >= 5:
|
||||
severity = SEVERITY_ERROR
|
||||
else:
|
||||
severity = SEVERITY_WARNING
|
||||
|
||||
if severity is None:
|
||||
severity = SEVERITY_ERROR
|
||||
else:
|
||||
severity = severity.lower()
|
||||
|
||||
if severity in ["info", "style"]:
|
||||
severity = SEVERITY_NOTICE
|
||||
|
||||
result["severity"] = severity
|
||||
|
||||
results.append(result)
|
||||
|
||||
return results
|
||||
|
||||
|
||||
def parse_message(message):
|
||||
"""
|
||||
Parse message until it matches a pattern.
|
||||
|
||||
Returns the fields in a dict.
|
||||
"""
|
||||
for pattern in PATTERNS:
|
||||
fields = pattern.match(message, re.IGNORECASE)
|
||||
if not fields:
|
||||
continue
|
||||
result = fields.groupdict()
|
||||
if len(result) == 0:
|
||||
continue
|
||||
|
||||
if "confidence" in result:
|
||||
# Convert confidence level of cpplint
|
||||
# to warning, etc.
|
||||
confidence = int(result["confidence"])
|
||||
del result["confidence"]
|
||||
|
||||
if confidence <= 1:
|
||||
severity = SEVERITY_NOTICE
|
||||
elif confidence >= 5:
|
||||
severity = SEVERITY_ERROR
|
||||
else:
|
||||
severity = SEVERITY_WARNING
|
||||
result["severity"] = severity
|
||||
|
||||
if "severity" not in result:
|
||||
result["severity"] = SEVERITY_ERROR
|
||||
else:
|
||||
result["severity"] = result["severity"].lower()
|
||||
|
||||
if result["severity"] in ["info", "style"]:
|
||||
result["severity"] = SEVERITY_NOTICE
|
||||
|
||||
return result
|
||||
|
||||
# Nothing matched
|
||||
return None
|
||||
|
||||
|
||||
def add_error_entry( # pylint: disable=too-many-arguments
|
||||
root,
|
||||
severity,
|
||||
file_name,
|
||||
line=None,
|
||||
column=None,
|
||||
message=None,
|
||||
source=None,
|
||||
root_path=None,
|
||||
):
|
||||
"""
|
||||
Add error information to the CheckStyle output being created.
|
||||
"""
|
||||
file_element = find_or_create_file_element(
|
||||
root, file_name, root_path=root_path
|
||||
)
|
||||
error_element = ET.SubElement(file_element, "error")
|
||||
error_element.set("severity", severity)
|
||||
if line:
|
||||
error_element.set("line", line)
|
||||
if column:
|
||||
error_element.set("column", column)
|
||||
if message:
|
||||
error_element.set("message", message)
|
||||
if source:
|
||||
# To verify if this is a valid attribute
|
||||
error_element.set("source", source)
|
||||
|
||||
|
||||
def find_or_create_file_element(root, file_name: str, root_path=None):
|
||||
"""
|
||||
Find/create file element in XML document tree.
|
||||
"""
|
||||
|
||||
if root_path is not None:
|
||||
file_name = remove_prefix(file_name, root_path)
|
||||
for file_element in root.findall("file"):
|
||||
if file_element.get("name") == file_name:
|
||||
return file_element
|
||||
file_element = ET.SubElement(root, "file")
|
||||
file_element.set("name", file_name)
|
||||
return file_element
|
||||
|
||||
|
||||
def main():
|
||||
"""
|
||||
Parse the script arguments and get the conversion done.
|
||||
"""
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Convert messages to Checkstyle XML format."
|
||||
)
|
||||
parser.add_argument(
|
||||
"input", help="Input file. Use '-' for stdin.", nargs="?", default="-"
|
||||
)
|
||||
parser.add_argument(
|
||||
"output",
|
||||
help="Output file. Use '-' for stdout.",
|
||||
nargs="?",
|
||||
default="-",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-i",
|
||||
"--in",
|
||||
dest="input_named",
|
||||
help="Input filename. Overrides positional input.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-o",
|
||||
"--out",
|
||||
dest="output_named",
|
||||
help="Output filename. Overrides positional output.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--root",
|
||||
metavar="ROOT_PATH",
|
||||
help="Root directory to remove from file paths."
|
||||
" Defaults to working directory.",
|
||||
default=os.getcwd(),
|
||||
)
|
||||
parser.add_argument(
|
||||
"--github-annotate",
|
||||
action=argparse.BooleanOptionalAction,
|
||||
help="Annotate when in Github workflow.",
|
||||
# Currently disabled,
|
||||
# Future: (os.environ.get("GITHUB_EVENT_PATH", None) is not None),
|
||||
default=False,
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.input == "-" and args.input_named:
|
||||
with open(
|
||||
args.input_named, encoding="utf_8", errors="surrogateescape"
|
||||
) as input_file:
|
||||
text = input_file.read()
|
||||
elif args.input != "-":
|
||||
with open(
|
||||
args.input, encoding="utf_8", errors="surrogateescape"
|
||||
) as input_file:
|
||||
text = input_file.read()
|
||||
else:
|
||||
text = sys.stdin.read()
|
||||
|
||||
root_path = os.path.join(args.root, "")
|
||||
|
||||
try:
|
||||
notices = convert_text_to_notices(text)
|
||||
except ImportError:
|
||||
notices = convert_lines_to_notices(re.split(r"[\r\n]+", text))
|
||||
|
||||
checkstyle_xml = convert_notices_to_checkstyle(
|
||||
notices, root_path=root_path
|
||||
)
|
||||
|
||||
if args.output == "-" and args.output_named:
|
||||
with open(args.output_named, "w", encoding="utf_8") as output_file:
|
||||
output_file.write(checkstyle_xml)
|
||||
elif args.output != "-":
|
||||
with open(args.output, "w", encoding="utf_8") as output_file:
|
||||
output_file.write(checkstyle_xml)
|
||||
else:
|
||||
print(checkstyle_xml)
|
||||
|
||||
if args.github_annotate:
|
||||
checkrun = CheckRun()
|
||||
checkrun.submit(notices)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
36
.github/workflows/cache-clean-pr.yml
vendored
Normal file
36
.github/workflows/cache-clean-pr.yml
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
---
|
||||
name: Cleanup caches of a closed branch
|
||||
# See https://github.com/actions/cache/blob/main/tips-and-workarounds.md#force-deletion-of-caches-overriding-default-cache-eviction-policy
|
||||
on:
|
||||
pull_request:
|
||||
types: [closed]
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
cleanup:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
# `actions:write` permission is required to delete caches
|
||||
# See also: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#delete-a-github-actions-cache-for-a-repository-using-a-cache-id
|
||||
actions: write
|
||||
contents: read
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
- name: Cleanup
|
||||
run: |
|
||||
gh extension install actions/gh-actions-cache
|
||||
REPO=${{ github.repository }}
|
||||
BRANCH=refs/pull/${{ github.event.pull_request.number }}/merge
|
||||
echo "Fetching list of cache key"
|
||||
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 )
|
||||
|
||||
## Setting this to not fail the workflow while deleting cache keys.
|
||||
set +e
|
||||
echo "Deleting caches..."
|
||||
for cacheKey in $cacheKeysForPR
|
||||
do
|
||||
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
|
||||
done
|
||||
echo "Done"
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
2
.github/workflows/exakat.yml
vendored
2
.github/workflows/exakat.yml
vendored
|
|
@ -22,7 +22,7 @@ jobs:
|
|||
- name: Exakat
|
||||
uses: docker://exakat/exakat-ga
|
||||
with:
|
||||
ignore_rules: 'Classes/UseInstanceof,Performances/PrePostIncrement,Functions/UndefinedFunctions,Functions/WrongNumberOfArguments,Functions/WrongTypeWithCall,Variables/UndefinedVariable,Classes/DontUnsetProperties,Classes/NonPpp,Classes/StaticMethodsCalledFromObject,Classes/UseClassOperator,Functions/UsesDefaultArguments,Php/NoClassInGlobal,Php/ShouldUseCoalesce,Php/WrongTypeForNativeFunction,Structures/AddZero,Structures/DropElseAfterReturn,Structures/IfWithSameConditions,Structures/MergeIfThen,Structures/NestedTernary,Structures/ElseIfElseif,Structures/ExitUsage,Structures/RepeatedPrint,Structures/RepeatedRegex,Structures/SameConditions,Structures/SwitchWithoutDefault,Structures/ShouldMakeTernary,Structures/UselessParenthesis,Structures/UseConstant'
|
||||
ignore_rules: 'Classes/UseInstanceof,Constants/ConstantStrangeNames,Performances/PrePostIncrement,Functions/UndefinedFunctions,Functions/WrongNumberOfArguments,Functions/WrongTypeWithCall,Variables/UndefinedVariable,Classes/DontUnsetProperties,Classes/NonPpp,Classes/StaticMethodsCalledFromObject,Classes/UseClassOperator,Functions/UsesDefaultArguments,Php/NoClassInGlobal,Php/ShouldUseCoalesce,Php/WrongTypeForNativeFunction,Structures/AddZero,Structures/DropElseAfterReturn,Structures/IfWithSameConditions,Structures/MergeIfThen,Structures/NestedTernary,Structures/ElseIfElseif,Structures/ExitUsage,Structures/RepeatedPrint,Structures/RepeatedRegex,Structures/SameConditions,Structures/SwitchWithoutDefault,Structures/ShouldMakeTernary,Structures/UselessParenthesis,Structures/UseConstant'
|
||||
ignore_dirs: '/htdocs/includes/,/htdocs/install/doctemplates/,/build/,/dev/,/doc/,/scripts/,/test/'
|
||||
file_extensions: php
|
||||
project_reports: Perfile
|
||||
|
|
|
|||
55
.github/workflows/phan.yml
vendored
Normal file
55
.github/workflows/phan.yml
vendored
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
---
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
schedule:
|
||||
# execute once a day, the 1st
|
||||
- cron: 10 9 * * *
|
||||
workflow_dispatch:
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
env:
|
||||
# Do pull analysis on schedule or manual dispatch
|
||||
PHAN_CONFIG: >
|
||||
${{
|
||||
( github.event.schedule || github.event_name == 'workflow_dispatch' )
|
||||
&& 'dev/tools/phan/config_extended.php'
|
||||
|| 'dev/tools/phan/config.php'
|
||||
}}
|
||||
PHAN_BASELINE: dev/tools/phan/baseline.txt
|
||||
PHAN_MIN_PHP: 7.0
|
||||
PHAN_QUICK: ${{ github.event.schedule && '' || '--quick' }}
|
||||
GITHUB_JSON: ${{ toJSON(github) }} # Helps in debugging Github Action
|
||||
name: phan
|
||||
jobs:
|
||||
phan:
|
||||
name: Run phan
|
||||
runs-on: ubuntu-latest
|
||||
# Do not run schedule on forks
|
||||
if: |
|
||||
github.repository == 'Dolibarr/dolibarr'
|
||||
|| github.event.schedule == false
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: 8.2
|
||||
coverage: none # disable xdebug, pcov
|
||||
tools: cs2pr,phan
|
||||
- name: Run Phan analysis
|
||||
run: |
|
||||
phan $PHAN_QUICK -k $PHAN_CONFIG -B $PHAN_BASELINE --analyze-twice --minimum-target-php-version $PHAN_MIN_PHP --output-mode=checkstyle -o _phan.xml
|
||||
- name: Add results to PR
|
||||
if: ${{ always() }}
|
||||
run: |
|
||||
cs2pr --prepend-filename --prepend-source --notices-as-warnings _phan.xml
|
||||
- name: Provide phan log as artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
if: ${{ always() }}
|
||||
with:
|
||||
name: phan-srcrt
|
||||
# path: ${{ github.workspace }}/phan.log
|
||||
path: ${{ github.workspace }}/_phan.xml
|
||||
retention-days: 2
|
||||
14
.github/workflows/phpstan.yml
vendored
14
.github/workflows/phpstan.yml
vendored
|
|
@ -9,9 +9,7 @@ concurrency:
|
|||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
CACHE_KEY_PART: >
|
||||
${{ ( github.event_name == 'pull_request' ) && github.base_ref
|
||||
}}${{ ( github.event_name == 'pull_request' ) && '-' }}${{ github.head_ref }}
|
||||
CACHE_KEY_PART: ${{ github.event_name == 'pull_request' && format('{0}-{1}', github.base_ref, github.head_ref) || github.ref_name }}
|
||||
GITHUB_JSON: ${{ toJSON(github) }} # Helps in debugging Github Action
|
||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||
jobs:
|
||||
|
|
@ -58,7 +56,8 @@ jobs:
|
|||
# Run PHPStan
|
||||
- name: Run PHPStan
|
||||
id: phpstan
|
||||
run: phpstan -vvv analyse --error-format=checkstyle --memory-limit 4G -a build/phpstan/bootstrap_action.php -c phpstan.neon | cs2pr --graceful-warnings
|
||||
run: |
|
||||
phpstan -vvv analyse --error-format=checkstyle --memory-limit 7G -a build/phpstan/bootstrap_action.php | tee _stan.xml | cs2pr --graceful-warnings
|
||||
# continue-on-error: true
|
||||
|
||||
# Save cache
|
||||
|
|
@ -68,3 +67,10 @@ jobs:
|
|||
with:
|
||||
path: ./.github/tmp
|
||||
key: phpstan-cache-${{ matrix.php-version }}-${{ env.CACHE_KEY_PART }}-${{ github.run_id }}
|
||||
- name: Provide phpstan log as artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
if: ${{ always() }}
|
||||
with:
|
||||
name: phpstan-srcrt
|
||||
path: ${{ github.workspace }}/_stan.xml
|
||||
retention-days: 2
|
||||
|
|
|
|||
39
.github/workflows/pre-commit.yml
vendored
39
.github/workflows/pre-commit.yml
vendored
|
|
@ -7,7 +7,6 @@ jobs:
|
|||
pre-commit:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
LOG_TO_CS: .github/logToCs.py
|
||||
RAW_LOG: pre-commit.log
|
||||
CS_XML: pre-commit.xml
|
||||
steps:
|
||||
|
|
@ -20,7 +19,7 @@ jobs:
|
|||
# This is faster for a big repo.
|
||||
- name: Get all changed php files (if PR)
|
||||
id: changed-php
|
||||
uses: tj-actions/changed-files@v42
|
||||
uses: tj-actions/changed-files@v43
|
||||
if: github.event_name == 'pull_request'
|
||||
with:
|
||||
files: |
|
||||
|
|
@ -38,7 +37,7 @@ jobs:
|
|||
with:
|
||||
cache: pip
|
||||
python-version: "3.11"
|
||||
- run: python -m pip install pre-commit regex
|
||||
- run: python -m pip install pre-commit
|
||||
# Restore previous cache of precommit
|
||||
- uses: actions/cache/restore@v4
|
||||
with:
|
||||
|
|
@ -58,7 +57,7 @@ jobs:
|
|||
# The next uses git, which is slow for a bit repo.
|
||||
# - name: Get all changed php files (if PR)
|
||||
# id: changed-php
|
||||
# uses: tj-actions/changed-files@v42
|
||||
# uses: tj-actions/changed-files@v43
|
||||
# if: github.event_name == 'pull_request'
|
||||
# with:
|
||||
# files: |
|
||||
|
|
@ -68,13 +67,16 @@ jobs:
|
|||
uses: shivammathur/setup-php@v2
|
||||
# Install when we're going to run phpcs
|
||||
if: |
|
||||
steps.changed-php.outputs.any_changed == 'true'
|
||||
||
|
||||
! cancelled() &&
|
||||
(
|
||||
github.event_name == 'push'
|
||||
&& (
|
||||
github.event.ref == 'refs/heads/develop'
|
||||
|| endsWith(github.event.ref, '.0')
|
||||
steps.changed-php.outputs.any_changed == 'true'
|
||||
||
|
||||
(
|
||||
github.event_name == 'push'
|
||||
&& (
|
||||
github.event.ref == 'refs/heads/develop'
|
||||
|| endsWith(github.event.ref, '.0')
|
||||
)
|
||||
)
|
||||
)
|
||||
with:
|
||||
|
|
@ -83,7 +85,7 @@ jobs:
|
|||
tools: phpcs
|
||||
|
||||
- name: Run some pre-commit hooks on selected changed files only
|
||||
if: steps.changed-php.outputs.any_changed == 'true'
|
||||
if: "! cancelled() && steps.changed-php.outputs.any_changed == 'true'"
|
||||
env:
|
||||
ALL_CHANGED_FILES: ${{ steps.changed-php.outputs.all_changed_files }}
|
||||
run: |
|
||||
|
|
@ -103,19 +105,12 @@ jobs:
|
|||
pre-commit run --hook-stage manual -a php-cs-with-cache | tee -a ${RAW_LOG}
|
||||
ls -l ~/.cache/pre-commit/
|
||||
|
||||
# If error, we convert log in the checkstyle format
|
||||
- name: Convert Raw Log to CheckStyle format
|
||||
if: ${{ failure() }}
|
||||
run: |
|
||||
python ${LOG_TO_CS} ${RAW_LOG} ${CS_XML}
|
||||
# Annotate the git sources with the log messages
|
||||
- name: Annotate Source Code with Messages
|
||||
uses: staabm/annotate-pull-request-from-checkstyle-action@v1
|
||||
- name: Convert Raw Log to Annotations
|
||||
uses: mdeweerd/logToCheckStyle@2024.3.2
|
||||
if: ${{ failure() }}
|
||||
with:
|
||||
files: ${{ env.CS_XML }}
|
||||
notices-as-warnings: true # optional
|
||||
prepend-filename: true # optional
|
||||
in: ${{ env.RAW_LOG }}
|
||||
|
||||
# Save the precommit cache
|
||||
- uses: actions/cache/save@v4
|
||||
if: ${{ ! cancelled() }}
|
||||
|
|
|
|||
207
.github/workflows/windows-ci.yaml
vendored
207
.github/workflows/windows-ci.yaml
vendored
|
|
@ -1,36 +1,39 @@
|
|||
---
|
||||
name: Win CI
|
||||
# yamllint disable-line rule:truthy
|
||||
on:
|
||||
push:
|
||||
# branches:
|
||||
# - main
|
||||
pull_request:
|
||||
# branches:
|
||||
# - main
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref
|
||||
}}
|
||||
cancel-in-progress: true
|
||||
env:
|
||||
PHPUNIT_LOG: phpunit_tests.log
|
||||
DOLIBARR_LOG: documents/dolibarr.log
|
||||
PHPSERVER_LOG: phpserver.log
|
||||
PHPSERVER_DOMAIN_PORT: 127.0.0.1:8000 # could be 127.0.0.1:8000 if config modified
|
||||
CACHE_KEY_PART: ${{ github.event_name == 'pull_request' && format('{0}-{1}', github.base_ref, github.head_ref) || github.ref_name }}
|
||||
PHP_INI_SCAN_DIR: C:\myphpini
|
||||
CKEY: win-ci-2
|
||||
GITHUB_JSON: ${{ toJSON(github) }} # Helps in debugging Github Action
|
||||
jobs:
|
||||
test:
|
||||
win-test:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [windows-latest]
|
||||
#php_version: [7.4, 8.0] # Add more versions if needed
|
||||
php_version: [7.4] # Add more versions if needed
|
||||
# php_version: [7.4, 8.0] # Add more versions if needed
|
||||
php_version: [7.4] # Add more versions if needed
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup MariaDB
|
||||
uses: ankane/setup-mariadb@v1
|
||||
with:
|
||||
# mariadb-version: ${{ matrix.mariadb-version }}
|
||||
database: travis # Specify your database name
|
||||
|
||||
database: travis # Specify your database name
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
|
|
@ -47,81 +50,131 @@ jobs:
|
|||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
# phpts: ts # ts for thread-safe, default nts
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
if: false
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v4
|
||||
if: false
|
||||
# Restore cache
|
||||
- name: Restore cache
|
||||
id: cache
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||
restore-keys: ${{ runner.os }}-composer-
|
||||
|
||||
- name: Install Composer dependencies
|
||||
if: false
|
||||
run: |
|
||||
composer -n config -g vendor-dir htdocs/includes
|
||||
# composer self-update 2.4.4
|
||||
composer -n require \
|
||||
php-parallel-lint/php-parallel-lint ^1.2 \
|
||||
php-parallel-lint/php-console-highlighter ^0 \
|
||||
php-parallel-lint/php-var-dump-check ~0.4
|
||||
# which phpunit phpcs php-parallel-lint
|
||||
- run: |
|
||||
where php
|
||||
php -v
|
||||
php -r 'phpinfo();'
|
||||
echo ok
|
||||
|
||||
- name: "Windows: Cygwin download"
|
||||
if: false && runner.os == 'Windows'
|
||||
run: |
|
||||
Invoke-WebRequest 'https://cygwin.com/setup-x86_64.exe' -OutFile 'setup-x86_64.exe'
|
||||
|
||||
- name: "Windows: Cygwin setup"
|
||||
if: false && runner.os == 'Windows'
|
||||
# See https://github.com/actions/cache/issues/1275#issuecomment-1925217178
|
||||
enableCrossOsArchive: true
|
||||
path: |
|
||||
db_init.sql
|
||||
db_init.sql.md5
|
||||
key: ${{ matrix.os }}-${{ env.ckey }}-${{ matrix.php_version }}-${{ env.CACHE_KEY_PART
|
||||
}}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
${{ matrix.os }}-${{ env.ckey }}-${{ matrix.php_version }}-${{ env.CACHE_KEY_PART }}-
|
||||
${{ matrix.os }}-${{ env.ckey }}-${{ matrix.php_version }}-${{ github.head_ref }}-
|
||||
${{ matrix.os }}-${{ env.ckey }}-${{ matrix.php_version }}-${{ github.base_ref }}-
|
||||
${{ matrix.os }}-${{ env.ckey }}-${{ matrix.php_version }}-
|
||||
- name: Create local php.ini
|
||||
shell: cmd
|
||||
#run: .\setup-x86_64.exe --quiet-mode --site http://cygwin.mirror.constant.com --symlink-type=sys --packages mingw64-i686-binutils=2.37-2,mingw64-x86_64-binutils=2.37-2,curl,diffutils,git,m4,make,mercurial,mingw64-i686-gcc-core,mingw64-i686-gcc-g++,mingw64-x86_64-gcc-core,mingw64-x86_64-gcc-g++,patch,perl,rsync,unzip
|
||||
run: .\setup-x86_64.exe --quiet-mode --site http://cygwin.mirror.constant.com --symlink-type=sys --packages sed
|
||||
|
||||
- name: Setup MSYS (provides 'bash' and other unix-tools on windows)
|
||||
uses: msys2/setup-msys2@v2
|
||||
if: false
|
||||
with:
|
||||
path-type: inherit
|
||||
cache: true
|
||||
release: false
|
||||
msystem: UCRT64
|
||||
update: false
|
||||
install: git mingw-w64-ucrt-x86_64-gcc
|
||||
|
||||
# Note: Setting the basedir before initialising the database results in open_basedir errors
|
||||
# Objective: separate step, and before database initialisation to verify open_basedir restrictions
|
||||
run: |-
|
||||
ECHO "==== Show INI file usage before our configuration ==="
|
||||
php --ini
|
||||
ECHO "==== Set PHP_INI_SCAN_DIR to include the INI File we create ==="
|
||||
mkdir %PHP_INI_SCAN_DIR%
|
||||
SET INIFILE="%PHP_INI_SCAN_DIR%\dolibarr.ini"
|
||||
SET HTDOCS_DIR=%CD%\htdocs
|
||||
SET DATA_DIR=%CD%\documents
|
||||
SET TEST_DIR=%CD%\test
|
||||
SET INITDEMO_DIR=%CD%\dev\initdemo
|
||||
ECHO "==== Create INI file to set open_basedir ==="
|
||||
echo [php] > %INIFILE%
|
||||
echo open_basedir^="%HTDOCS_DIR%;%DATA_DIR%;%TEST_DIR%;%INITDEMO_DIR%;%PHPROOT%" >> %INIFILE%
|
||||
ECHO "==== Show contents of INI file to set open_basedir ==="
|
||||
type %INIFILE%
|
||||
REM Next line disables open_basedir limitation (to limit errors)
|
||||
SET PHP_INI_SCAN_DIR=
|
||||
ECHO "==== Verify it is used by PHP ==="
|
||||
php --ini
|
||||
- name: Run Bash script
|
||||
# shell: msys2 {0}
|
||||
# Note this is bash (MSYS) on Windows
|
||||
shell: bash
|
||||
# Note: Initialise the database (possibly from cache) and set some variables.
|
||||
run: |
|
||||
# Replace the following commands with your bash script commands
|
||||
# Example:
|
||||
# ./script.sh arg1 arg2
|
||||
# would be
|
||||
# bash script.sh arg1 arg2
|
||||
# env
|
||||
php -r 'phpinfo();'
|
||||
# Check if database cache is present (visually, to remove once ok)
|
||||
ls -l
|
||||
# Run bash script to initialise database
|
||||
${SHELL} -xv dev/setup/phpunit/setup_conf.sh
|
||||
sed -i -e 's/stopOnFailure="[^"]*"/stopOnFailure="false"/' test/phpunit/phpunittest.xml
|
||||
|
||||
# Check if database cache is present after the script (visually, to remove once ok)
|
||||
ls -l
|
||||
echo "TAIL=$(cygpath -w "$(which tail)")" >> "$GITHUB_ENV"
|
||||
echo "GREP=$(cygpath -w "$(which grep)")" >> "$GITHUB_ENV"
|
||||
echo "TEE=$(cygpath -w "$(which tee)")" >> "$GITHUB_ENV"
|
||||
echo "BASEDIR=$(realpath .)" >> "$GITHUB_ENV"
|
||||
- name: Start web server
|
||||
id: server
|
||||
if: false
|
||||
# Objective: Start php server in separate step (but after open_basedir restriction setup!)
|
||||
run: |
|
||||
Start-Process -FilePath "php.exe" -WindowStyle Hidden -ArgumentList "-S ${{ env.PHPSERVER_DOMAIN_PORT }} -t htdocs > ${{ env.PHPSERVER_LOG }}" -PassThru
|
||||
curl "http://${{ env.PHPSERVER_DOMAIN_PORT }}"
|
||||
shell: powershell
|
||||
- name: Run PHPUnit tests
|
||||
# continue-on-error: true
|
||||
shell: cmd
|
||||
# setting up php.ini, starting the php server are currently in this step
|
||||
run: |-
|
||||
echo "BASEDIR=%CD%" >> %GITHUB_ENV%
|
||||
start /B php -S %PHPSERVER_DOMAIN_PORT% -t htdocs >> %PHPSERVER_LOG% 2>&1
|
||||
curl "http://${{ env.PHPSERVER_DOMAIN_PORT }}"
|
||||
ECHO "==== Show INI file usage before our configuration ==="
|
||||
php --ini
|
||||
REM TODO Uncomment next line to restrict directory access
|
||||
REM SET PHP_INI_SCAN_DIR=C:\myphpini
|
||||
SET INIFILE="C:\myphpini\dolibarr.ini"
|
||||
mkdir c:\myphpini
|
||||
ECHO "==== Set PHP_INI_SCAN_DIR to include the INI File we create ==="
|
||||
mkdir %PHP_INI_SCAN_DIR%
|
||||
SET INIFILE="%PHP_INI_SCAN_DIR%\dolibarr.ini"
|
||||
SET HTDOCS_DIR=%CD%\htdocs
|
||||
SET DATA_DIR=%CD%\documents
|
||||
SET TEST_DIR=%CD%\test
|
||||
SET INITDEMO_DIR=%CD%\dev\initdemo
|
||||
ECHO "==== Create INI file to set open_basedir ==="
|
||||
echo [php] > %INIFILE%
|
||||
echo open_basedir^="%CD%;%PHPROOT%" >> %INIFILE%
|
||||
echo open_basedir^="%HTDOCS_DIR%;%DATA_DIR%;%TEST_DIR%;%INITDEMO_DIR%;%PHPROOT%" >> %INIFILE%
|
||||
REM Unset PHP_INI_SCAN_DIR to disable open_basedir restritions (to limit debug effort)
|
||||
REM SET PHP_INI_SCAN_DIR=
|
||||
ECHO "==== Show contents of INI file to set open_basedir ==="
|
||||
type %INIFILE%
|
||||
ECHO "==== Verify it is used by PHP ==="
|
||||
php --ini
|
||||
php "%PHPROOT%\phpunit" -d memory_limit=-1 -c "test\phpunit\phpunittest.xml" "test\phpunit\AllTests.php"
|
||||
echo $dolibarr_main_url_root="http://${{ env.PHPSERVER_DOMAIN_PORT }}"; >> htdocs/conf/conf.php
|
||||
cat htdocs/conf/conf.php
|
||||
curl "http://${{ env.PHPSERVER_DOMAIN_PORT }}"
|
||||
REM 'DOSKEY' USED to recover error code (no pipefile equivalent in windows?)
|
||||
( php "%PHPROOT%\phpunit" -d memory_limit=-1 -c %CD%\test\phpunit\phpunittest.xml "test\phpunit\AllTests.php" --exclude-group WindowsWaitingForFix & call doskey /exename=err err=%%^^errorlevel%% ) | "${{ env.TEE }}" "${{ env.PHPUNIT_LOG }}"
|
||||
echo ""
|
||||
echo "Ensure that PHPUNIT completed (no early exit from code)"
|
||||
"${{ env.TAIL }}" -5 "${{ env.PHPUNIT_LOG }}" | "${{ env.GREP }}" -qE "(OK .*[0-9]+ tests.*[0-9]+ assertions|Tests: [0-9]+)" || EXIT /B 1
|
||||
echo "PHPUNIT seems to have completed with a test result, reuse the exit code"
|
||||
for /f "tokens=2 delims==" %%A in ('doskey /m:err') do EXIT /B %%A
|
||||
- name: Convert Raw Log to Annotations
|
||||
uses: mdeweerd/logToCheckStyle@2024.3.2
|
||||
if: ${{ failure() }}
|
||||
with:
|
||||
in: ${{ env.PHPUNIT_LOG }}
|
||||
- name: Provide dolibarr and phpunit logs as artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
if: ${{ ! cancelled() }}
|
||||
with:
|
||||
name: win-ci-logs
|
||||
path: |
|
||||
${{ env.PHPUNIT_LOG }}
|
||||
${{ env.DOLIBARR_LOG }}
|
||||
${{ env.PHPSERVER_LOG }}
|
||||
db_init.sql
|
||||
db_init.sql.md5
|
||||
retention-days: 2
|
||||
|
||||
# Save cache
|
||||
- name: Save cache
|
||||
uses: actions/cache/save@v4
|
||||
if: ${{ ! cancelled() }}
|
||||
with:
|
||||
# See https://github.com/actions/cache/issues/1275#issuecomment-1925217178
|
||||
enableCrossOsArchive: true
|
||||
key: ${{ steps.cache.outputs.cache-primary-key }}
|
||||
path: db_init.*
|
||||
|
|
|
|||
18
.gitignore
vendored
18
.gitignore
vendored
|
|
@ -66,8 +66,26 @@ doc/install.lock
|
|||
/composer.json
|
||||
/composer.lock
|
||||
|
||||
# Local script, executed during pre-commit
|
||||
/local.sh
|
||||
|
||||
# Local phpstan configuration
|
||||
/phpstan.neon
|
||||
/phpstan-baseline.neon
|
||||
|
||||
# Logs
|
||||
/*.log
|
||||
|
||||
# Vim swap files
|
||||
*.sw?
|
||||
|
||||
# Generated by PHPUNIT.BAT
|
||||
/INI_PHPUNIT
|
||||
|
||||
# ignore cache builds
|
||||
/build/phpstan/phpstan
|
||||
/build/phpstan/bootstrap_custom.php
|
||||
phpstan_custom.neon
|
||||
/.php-cs-fixer.cache
|
||||
/.php_cs.cache
|
||||
/.cache
|
||||
|
|
|
|||
4
.phan/config.php
Normal file
4
.phan/config.php
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<?php
|
||||
/* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*/
|
||||
return include __DIR__ . "/../dev/tools/phan/config.php";
|
||||
|
|
@ -5,22 +5,30 @@ repos:
|
|||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.5.0
|
||||
hooks:
|
||||
# This hook test the name of the branch and return error if the name is 'develop' or an official version 'x.y'
|
||||
# so you can't commit if your branch name is not a custom branch name. Using a custom branch name is good
|
||||
# practice that make easier to manage PR. You can enable/disable this if you want to commit or not on branch
|
||||
# with common names.
|
||||
#- id: no-commit-to-branch
|
||||
# args: [--branch, develop, --pattern, \d+.0]
|
||||
# This check format of xml files
|
||||
# This hook tests the name of the branch and return an error if the name is
|
||||
# 'develop' or an official version 'x.y'
|
||||
# So you can't commit if your branch name is not a custom branch name.
|
||||
# Using a custom branch name is good practice that makes it easier to manage PRs.
|
||||
# You can skip this:
|
||||
# - Permanently:
|
||||
# export SKIP=no-commit-to-branch # In your .bashrc or session.
|
||||
# - Only this for one commit:
|
||||
# SKIP=no-commit-to-branch git commit -a -m "My message"
|
||||
# - Skipping all checks for a commit:
|
||||
# git commit -a -m "My message" --no-verify
|
||||
# (Recommendation: run git commit -a .. once, then with `--no-verify`)
|
||||
- id: no-commit-to-branch
|
||||
args: [--branch, develop, --pattern, \d+.0]
|
||||
# This checks that xml files are correct
|
||||
- id: check-xml
|
||||
exclude: |
|
||||
(?x)^(htdocs/includes/.*)$
|
||||
# This check format of yaml files
|
||||
# This checks that yaml files are correct
|
||||
- id: check-yaml
|
||||
args: [--unsafe]
|
||||
# This checl format of json files
|
||||
# This checks that json files are correct
|
||||
- id: check-json
|
||||
# Fix DOS end of files to get Unix end of files
|
||||
# Fixes Fix files that have DOS end of line endings
|
||||
- id: mixed-line-ending
|
||||
# alternative for dev/tools/fixdosfiles.sh
|
||||
exclude: |
|
||||
|
|
@ -28,14 +36,14 @@ repos:
|
|||
|.*/CRLF.*.php # Files in swiftmailer
|
||||
)$
|
||||
args: [--fix=lf]
|
||||
# Remove trailing whitespace.
|
||||
# Remove trailing whitespace
|
||||
- id: trailing-whitespace
|
||||
exclude_types: [markdown]
|
||||
# Fix the end of file
|
||||
- id: end-of-file-fixer
|
||||
# Check if there is not completly merged conflict
|
||||
# Check that there are no completely merged file conflicts
|
||||
- id: check-merge-conflict
|
||||
# Chech the shebangs of shell files
|
||||
# Check that files with shebangs have the executable bit set (in git)
|
||||
- id: check-executables-have-shebangs
|
||||
# Check that shell files are executables
|
||||
- id: check-shebang-scripts-are-executable
|
||||
|
|
@ -46,7 +54,7 @@ repos:
|
|||
|build/debian/dolibarr.config )$
|
||||
# Fix the first UTF8 byte
|
||||
- id: fix-byte-order-marker
|
||||
# ???
|
||||
# Check that there are no files that have are the same when uppercased (conflict on windows)
|
||||
- id: check-case-conflict
|
||||
|
||||
# Beautify shell scripts
|
||||
|
|
@ -54,21 +62,30 @@ repos:
|
|||
rev: v6.2.1
|
||||
hooks:
|
||||
- id: beautysh
|
||||
exclude: (?x)^(dev/setup/git/hooks/pre-commit)$
|
||||
exclude: |
|
||||
(?x)^(dev/setup/git/hooks/pre-commit
|
||||
)$
|
||||
args: [--tab]
|
||||
|
||||
# Run local script
|
||||
#
|
||||
# For instance to update the license in edited files, you could add to local.sh:
|
||||
# For example, to update the license in edited files, you could add to local.sh:
|
||||
#
|
||||
# ```shell
|
||||
# #!/bin/bash
|
||||
# #!/bin/bash
|
||||
# MYDIR=$(dirname "$0")
|
||||
# git diff HEAD --name-only | grep -v includes | \
|
||||
# xargs "$MYDIR/dev/tools/updatelicense.php"
|
||||
# ```
|
||||
- repo: local
|
||||
hooks:
|
||||
- name: Find missing/unused/duplicate language keys
|
||||
id: check-translations
|
||||
files: (?x)^(htdocs/langs/en_US/.*\.lang)
|
||||
language: script
|
||||
entry: ./dev/translation/sanity_check_trans_missing_unused.sh
|
||||
pass_filenames: false
|
||||
args: [list]
|
||||
- id: local-precommit-script
|
||||
name: Run local script before commit if it exists
|
||||
language: system
|
||||
|
|
@ -183,8 +200,6 @@ repos:
|
|||
- dev/tools/codespell/codespell-ignore.txt
|
||||
- -x
|
||||
- dev/tools/codespell/codespell-lines-ignore.txt
|
||||
- --uri-ignore-words-list
|
||||
- ned
|
||||
exclude_types: [image]
|
||||
exclude: (?x)^(.phan/stubs/.*)$
|
||||
additional_dependencies: [tomli]
|
||||
|
|
|
|||
|
|
@ -556,18 +556,18 @@ after_failure:
|
|||
# Show upgrade log files
|
||||
#for ficlog in `ls $TRAVIS_BUILD_DIR/*.log`
|
||||
#do
|
||||
#echo "Debugging informations for file $ficlog"
|
||||
#echo "Debugging information for file $ficlog"
|
||||
#cat $ficlog
|
||||
#done
|
||||
# Show Apache log file
|
||||
echo "Debugging informations for file apache error.log"
|
||||
echo "Debugging information for file apache error.log"
|
||||
sudo tail -n 200 /var/log/apache2/travis_error_log
|
||||
if [ "$DEBUG" = true ]; then
|
||||
# Dolibarr log file
|
||||
echo "Debugging informations for file dolibarr.log (latest 50 lines)"
|
||||
echo "Debugging information for file dolibarr.log (latest 50 lines)"
|
||||
tail -n 200 $TRAVIS_BUILD_DIR/documents/dolibarr.log
|
||||
# Database log file
|
||||
echo "Debugging informations for file mysql error.log"
|
||||
echo "Debugging information for file mysql error.log"
|
||||
sudo tail -n 200 /var/log/mysql/error.log
|
||||
# TODO: PostgreSQL log file
|
||||
echo
|
||||
|
|
|
|||
81
ChangeLog
81
ChangeLog
|
|
@ -3,7 +3,7 @@ English Dolibarr ChangeLog
|
|||
--------------------------------------------------------------
|
||||
|
||||
|
||||
***** ChangeLog for 20.0.0 compared to 19.0.0 *****
|
||||
***** ChangeLog for 20.0.0 compared to 19.0 *****
|
||||
|
||||
For users:
|
||||
----------
|
||||
|
|
@ -23,8 +23,82 @@ The following changes may create regressions for some external modules, but were
|
|||
* Some API HTTP return code were moved from 401 to 403 to better follow REST specification.
|
||||
* dolibarrtriggers class VERSION_XXX constants have been deprecated. Please use array dictionary VERSIONS['XXX'].
|
||||
* Properties ->date_update and ->date_modification were merged into date_modification.
|
||||
* All CLI tools (into /scripts) return a positive value to the shell if error (0 remains success) for a better
|
||||
cross platform compatibility. On linux the exit(-1) was caught as 255, it may be now exit(1) so will be caught as 1.
|
||||
* The parameter $filter of method fetchAll does not accept array of SQL but must be a string of an Universal Search Filter syntax.
|
||||
* Use of dol_eval with parameter $returnvalue=0 is deprecated.
|
||||
* The signature for all ->delete() method has been modified to match the modulebuilder template (so first paramis now always $user), except
|
||||
the delete for thirdparty (still accept the id of thirdparty to delete as first parameter). Will probably be modified into another version.
|
||||
* Route for API /thirdparties/gateways has been renamed into /thirdparties/accounts to better match the api object name.
|
||||
* The AGENDA_ENABLE_DONEBY hidden option has been removed. So $userdoneid in actioncomm class is deprecated. Please use $userownerid instead. Also,
|
||||
the field $fk_user_done in actioncomm table is deprecated. Please use $fk_user_action instead.
|
||||
* The table commande_fournisseur_dispatch has been renamed into receptiondet_batch to better match its goal.
|
||||
|
||||
|
||||
***** ChangeLog for 19.0.1 compared to 19.0.0 *****
|
||||
|
||||
FIX: 16.0 - parent company gets emptied when updating a third party from the card in edit mode (#28269)
|
||||
FIX: 17.0: $num doesn't take trigger-modified newref into account, leading to inconsistencies if BILL_SUPPLIER_VALIDATE changes the invoice's ref (#28684)
|
||||
FIX: #22948
|
||||
FIX: #24265 regression cannot see all product on takepos (#28753)
|
||||
FIX: #28205
|
||||
FIX: #28251 Fixing subpermission name on api_multicurrencies.class.php (#28252)
|
||||
FIX: #28369
|
||||
FIX: #28429
|
||||
FIX: #28491 (#28522)
|
||||
FIX: #28518 (#28520)
|
||||
FIX: #28533 Mo::deleteLine removes the "main" MoLine if consumed line is delete (#28535)
|
||||
FIX: #28564
|
||||
FIX: Adding the dependencies list feature for extrafields "select" (#28549)
|
||||
FIX: Add new hidden conf "DISABLE_QTY_OVERWRITTEN" (#28523)
|
||||
FIX: Amount of localtaxes in foreign currency was wrong on screen and PDF
|
||||
FIX: an error in a complex else condition
|
||||
FIX: avoid error "Column 'entity' in where clause is ambiguous" (#28270)
|
||||
FIX: avoid Unknown column 'pfp.ref_fourn' (#28145)
|
||||
FIX: avoid warning "error parsing attribute name in Entity" (#28543)
|
||||
FIX: Bad column for total in bom list
|
||||
FIX: Bad condition on button back to draft on recruitment job.
|
||||
FIX: Bad CRLF when sending text only content. Fix dol_htmlwithnojs()
|
||||
FIX: Bad picto on list of permission of a user when user not admin
|
||||
FIX: bad timezone for the start/end date of an event
|
||||
FIX: Better test on validity of compute field syntax with parenthesis
|
||||
FIX: close #28279
|
||||
FIX: Count of virtual stock at Services and MoLine with disabled stock change (#28580)
|
||||
FIX: disabled picto of menu must be greyed.
|
||||
FIX: Don't display column when it's out of date (#28271)
|
||||
FIX: duplicate with lines: 414-416 (#28358)
|
||||
FIX: edit bank suggested for credit transfer payment in invoice setup
|
||||
FIX: Error When cloning fourn price no default value for tva_tx (#28368)
|
||||
FIX: fatal error Unsupported operand types when recording load payment
|
||||
FIX: Fix create shipping with product who have negative stocks on warehouse but the negative stock transfer is allowed (#26217)
|
||||
FIX: migration missing 2 columns in llx_resource and 1 in llx_user
|
||||
FIX: missing trans
|
||||
FIX: notification module: for supplier orders (any of the 3 triggers), user can choose an e-mail template in conf, but the conf is not used when sending the notification (#28216)
|
||||
FIX: Not trancate the multicurrency rate shown on cards (even if the global MAIN_MAX_DECIMALS_SHOWN is set to 0) (#28211)
|
||||
FIX: Option MAIN_DOC_USE_TIMING can be a string with date format
|
||||
FIX: Payment on customer invoice - Remove accountid in url if empty for apply default value (#28156)
|
||||
FIX: Pb in redirect of a website page in USEDOLIBARRSERVER mode
|
||||
FIX: permission on payment file of a tax
|
||||
FIX: PHP Warning: Undefined variable $lib (#28342)
|
||||
FIX: PHP Warning: Undefined variable $mode (#28697)
|
||||
FIX: Picto for mime
|
||||
FIX: Picto in top menu
|
||||
FIX: position of field in list of field in shipment list
|
||||
FIX: postgresql error (#28542)
|
||||
FIX: quote in sql request
|
||||
FIX: Responsive on admin project
|
||||
FIX: Shipment closing action has wrong value (#28174)
|
||||
FIX: skip adding tab if user doesn't have permission (#28698)
|
||||
FIX: some tooltips has disappeared on invoice action button
|
||||
FIX: Special code is now transmitted by args only in order supplier (#28546)
|
||||
FIX: Special code is now transmitted by args only in order supplier (#28619)
|
||||
FIX: subscription must be editable when accounting isn't reconciled (#28469)
|
||||
FIX: Translation for select (#28677)
|
||||
FIX: upload odt files should not start/end with space
|
||||
FIX: Value of field int = 0 from modulebuilder must not be set to null
|
||||
FIX: Wrong currency shown in TakePOS payment page
|
||||
FIX: #yogosha21416
|
||||
|
||||
|
||||
***** ChangeLog for 19.0.0 compared to 18.0.0 *****
|
||||
|
||||
|
|
@ -353,6 +427,7 @@ FIX: update price extrafield on propal card
|
|||
FIX: user filter in per user view of event list (#28049)
|
||||
FIX: use the currency for propal signature page
|
||||
|
||||
|
||||
***** ChangeLog for 18.0.4 compared to 18.0.3 *****
|
||||
FIX: $this->newref already exists and could have been modified by trigger but we still use a local variable for the filesystem-based renaming
|
||||
FIX: 16.0 only, backport fix for SQL error on global search product
|
||||
|
|
@ -541,7 +616,7 @@ FIX: url to check keyword not saved on partnership from public form
|
|||
FIX: when adding new times on a survey, all hours would be erased.
|
||||
|
||||
|
||||
***** ChangeLog for 18.0.0 compared to 17.0.0 *****
|
||||
***** ChangeLog for 18.0.0 compared to 17.0 *****
|
||||
|
||||
For users:
|
||||
----------
|
||||
|
|
@ -10048,7 +10123,7 @@ For developers:
|
|||
WARNING:
|
||||
- A lot of class files (*.class.php) has moved into subdirectories. So If you use
|
||||
or develop non official modules that includes Dolibarr classes, you will have to rename
|
||||
path to thoose classes into the include function.
|
||||
path to those classes into the include function.
|
||||
- Also, parameters of the "fetch()" method for class "User" has changed to reflect
|
||||
other fetch methods.
|
||||
- If you build a personalised themes, you must rename the style sheet into style.css.php.
|
||||
|
|
|
|||
10
README.md
10
README.md
|
|
@ -5,13 +5,13 @@
|
|||
[](https://github.com/Dolibarr/dolibarr)
|
||||
[](https://bestpractices.coreinfrastructure.org/projects/5521)
|
||||
|
||||
Dolibarr ERP & CRM is a modern software package that helps manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda…).
|
||||
Dolibarr ERP & CRM is a modern software package that helps manage your organization's activities (contacts, suppliers, invoices, orders, stocks, agenda…).
|
||||
|
||||
It's an Open Source Software suite (written in PHP with optional JavaScript enhancements) designed for small, medium or large companies, foundations and freelancers.
|
||||
It's an Open-Source Software suite (written in PHP with optional JavaScript enhancements) designed for small, medium or large companies, foundations and freelancers.
|
||||
|
||||
You can freely use, study, modify or distribute it according to its license.
|
||||
|
||||
You can use it as a standalone application or as a web application to access it from the Internet or a LAN.
|
||||
You can use it as a standalone application or as a web application to access it from the Internet or from a LAN.
|
||||
|
||||
Dolibarr has a large community ready to help you, free forums and [preferred partners ready to offer commercial support should you need it](https://partners.dolibarr.org)
|
||||
|
||||
|
|
@ -19,7 +19,7 @@ Dolibarr has a large community ready to help you, free forums and [preferred par
|
|||
|
||||
## LICENSE
|
||||
|
||||
Dolibarr is released under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version (GPL-3+).
|
||||
Dolibarr is released under the terms of the GNU General Public License as published by the Free Software Foundation; either Version 3 of the License, or (at your option) any later version (GPL-3+).
|
||||
|
||||
See the [COPYING](https://github.com/Dolibarr/dolibarr/blob/develop/COPYING) file for a full copy of the license.
|
||||
|
||||
|
|
@ -29,7 +29,7 @@ Other licenses apply for some included dependencies. See [COPYRIGHT](https://git
|
|||
|
||||
### Simple setup
|
||||
|
||||
If you have low technical skills and you're looking to install Dolibarr ERP/CRM in just a few clicks, you can use one of the packaged versions:
|
||||
If you have low technical skills and you're looking to install Dolibarr ERP/CRM with just a few clicks, you can use one of the packaged versions:
|
||||
|
||||
- [DoliWamp for Windows](https://wiki.dolibarr.org/index.php/Dolibarr_for_Windows_(DoliWamp))
|
||||
- [DoliDeb for Debian](https://wiki.dolibarr.org/index.php/Dolibarr_for_Ubuntu_or_Debian)
|
||||
|
|
|
|||
|
|
@ -11,7 +11,9 @@ Security report are valid only on current stable version (see https://dolibarr.o
|
|||
To report a vulnerability, for a private report, you can:
|
||||
|
||||
- Send your report on Vulnerability Disclosure Program (VDP) [https://app.yogosha.com/cvd/dolibarr/10VxeNx6Ui3rSEhAgX63US](https://app.yogosha.com/cvd/dolibarr/10VxeNx6Ui3rSEhAgX63US) (recommended for everybody)
|
||||
<!--
|
||||
- Or if you have permissions, use GitHub security advisory at [https://github.com/Dolibarr/dolibarr/security/advisories/new](https://github.com/Dolibarr/dolibarr/security/advisories/new)
|
||||
-->
|
||||
- Or send an email to security@dolibarr.org with clear textual description of the report along with steps to reproduce the issue, include attachments such as screenshots or proof of concept code as necessary.
|
||||
|
||||
## Hunting vulnerabilities on Dolibarr
|
||||
|
|
@ -102,3 +104,5 @@ Scope is the web application (backoffice) and the APIs.
|
|||
* SSL/TLS best practices
|
||||
* Invalid or missing SPF (Sender Policy Framework) records (Incomplete or missing SPF/DKIM/DMARC)
|
||||
* Physical or social engineering attempts or issues that require physical access to a victim’s computer/device
|
||||
* Vulnerabilities of type XSS exploited by using javascript into a website page (with permission to edit website pages) or by using php code into a website page
|
||||
using the permission to edit php code are not qualified, except if this allow to get higher privileges (being able to set javascript or php code is the expected behaviour).
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ Denied from all
|
|||
</IfVersion>
|
||||
|
||||
|
||||
# OPTIMIZE: To use cache on static pages (A259200 = 1 month, A7200 = 2 hours, A691600 = 8 days = recommanded for static resources).
|
||||
# OPTIMIZE: To use cache on static pages (A259200 = 1 month, A7200 = 2 hours, A691600 = 8 days = recommended for static resources).
|
||||
# Note that you must also enable the module mod_expires.
|
||||
#ExpiresActive On
|
||||
#ExpiresByType image/x-icon A2592000
|
||||
|
|
|
|||
|
|
@ -43,5 +43,5 @@ DoliWampWillStartApacheMysql=L'instal·lador DoliWamp intentarà iniciar o reini
|
|||
OldVersionFoundAndMoveInNew=S'ha trobat una versió antiga de base de dades i ha estat moguda per a ser utilitzada per la nova versió de Dolibarr
|
||||
OldVersionFoundButFailedToMoveInNew=S'ha trobat una versió antiga de base de dades, però no es pot moure per a ser utilitzada per la nova versió de Dolibarr
|
||||
|
||||
DLLMissing=La teva instal·lació windows no té el component "Microsoft Visual C++ Redistributable for Visual Studio 2015". Instal·la primer la versió de 32-bit (vcredist_x86.exe) (pots trobar-la a https://www.microsoft.com/en-us/download/) i reiniciar després la instal·lació/actualització de DoliWamp.
|
||||
DLLMissing=La teva instal·lació windows no té el component "Microsoft Visual C++ Redistributable for Visual Studio 2017". Instal·la primer la versió de 32-bit (vcredist_x86.exe) (pots trobar-la a https://www.microsoft.com/en-us/download/) i reiniciar després la instal·lació/actualització de DoliWamp.
|
||||
ContinueAnyway=Continua igualment (el procés d'instal·lació podria fallar sense aquest prerequisit)
|
||||
|
|
|
|||
|
|
@ -44,5 +44,5 @@ DoliWampWillStartApacheMysql=DoliWamp installer will now start or restart Apache
|
|||
OldVersionFoundAndMoveInNew=An old database version has been found and moved to be used by the new Dolibarr version
|
||||
OldVersionFoundButFailedToMoveInNew=An old database version has been found but could not be moved to be used with the new Dolibarr version
|
||||
|
||||
DLLMissing=Your Windows installation is missing The "Microsoft Visual C++ Redistributable for Visual Studio 2015" component. Please install the 32-bit version (vcredist_x86.exe) first (you can find it at https://www.microsoft.com/en-us/download/) and restart DoliWamp installation/upgrade after.
|
||||
DLLMissing=Your Windows installation is missing The "Microsoft Visual C++ Redistributable for Visual Studio 2017" component. Please install the 32-bit version (vcredist_x86.exe) first (you can find it at https://learn.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist?view=msvc-170) and restart DoliWamp installation/upgrade after.
|
||||
ContinueAnyway=Continue anyway (install process may fail without this prerequisite)
|
||||
|
|
|
|||
|
|
@ -44,5 +44,5 @@ DoliWampWillStartApacheMysql=L'installeur DoliWamp va maintenant d
|
|||
OldVersionFoundAndMoveInNew=Une ancienne version de base a été trouvée et déplacée pour fonctionner avec la nouvelle version de Dolibarr.
|
||||
OldVersionFoundButFailedToMoveInNew=Une ancienne version de base a été trouvée mais ne peut être déplacée pour être utilisée avec la nouvelle version de Dolibarr.
|
||||
|
||||
DLLMissing=L'installation de votre Windows est incomplète. Il manque le composant "Micrsoft Visual C++ Redistributable for Visual Studio 2015". Installer la version 32-bit (vcredist_x86.exe) d'abord (vous pourrez le trouver à https://www.microsoft.com/fr-fr/download/) puis relancer l'installation de DoliWamp après.
|
||||
DLLMissing=L'installation de votre Windows est incomplète. Il manque le composant "Micrsoft Visual C++ Redistributable for Visual Studio 2017". Installer la version 32-bit (vcredist_x86.exe) d'abord (vous pourrez le trouver à https://www.microsoft.com/fr-fr/download/) puis relancer l'installation de DoliWamp après.
|
||||
ContinueAnyway=Continuer malgré tout (le process d'installaton échouera)
|
||||
|
|
|
|||
|
|
@ -43,5 +43,5 @@ DoliWampWillStartApacheMysql=Die DoliWamp-Installation wird nun starten oder Apa
|
|||
OldVersionFoundAndMoveInNew=Eine alte Datenbankversion wurde gefunden und verschoben, um von der neuen Dolibarr-Version verwendet zu werden.
|
||||
OldVersionFoundButFailedToMoveInNew=Eine alte Datenbankversion wurde gefunden, konnte jedoch nicht verschoben werden, um mit der neuen Dolibarr-Version verwendet zu werden.
|
||||
|
||||
DLLMissing=Your Windows installation is missing The "Micrsoft Visual C++ Redistributable for Visual Studio 2015" component. Please install the 32-bit version (vcredist_x86.exe) first (you can find it at https://www.microsoft.com/en-us/download/) and restart DoliWamp installation/upgrade after.
|
||||
DLLMissing=Your Windows installation is missing The "Micrsoft Visual C++ Redistributable for Visual Studio 2017" component. Please install the 32-bit version (vcredist_x86.exe) first (you can find it at https://www.microsoft.com/en-us/download/) and restart DoliWamp installation/upgrade after.
|
||||
ContinueAnyway=Fahren Sie trotzdem fort (der Installationsvorgang kann ohne diese Voraussetzung fehlschlagen).
|
||||
|
|
|
|||
|
|
@ -43,5 +43,5 @@ DoliWampWillStartApacheMysql=El instalador DoliWamp intentará iniciar o reinici
|
|||
OldVersionFoundAndMoveInNew=Se ha encontrado una versión antigua de base de datos y ha sido movida para ser utilizada por la nueva versión de Dolibarr
|
||||
OldVersionFoundButFailedToMoveInNew=Se ha encontrado una versión antigua de base de datos, pero no se pudo mover para ser utilizada por la nueva versión de Dolibarr
|
||||
|
||||
DLLMissing=Su instalación Windows no tiene el componente "Microsoft Visual C++ Redistributable for Visual Studio 2015". Instale primero la versión de 32-bit (vcredist_x86.exe) (puedes encontrarlo en https://www.microsoft.com/en-us/download/) y reiniciar después la instalación/actualización de DoliWamp.
|
||||
DLLMissing=Su instalación Windows no tiene el componente "Microsoft Visual C++ Redistributable for Visual Studio 2017". Instale primero la versión de 32-bit (vcredist_x86.exe) (puedes encontrarlo en https://www.microsoft.com/en-us/download/) y reiniciar después la instalación/actualización de DoliWamp.
|
||||
ContinueAnyway=Continua igualmente (el proceso de instalación podría fallar sin este prerequisito)
|
||||
|
|
|
|||
|
|
@ -100,9 +100,9 @@ Source: "build\exe\doliwamp\UsedPort.exe"; DestDir: "{app}\"; Flags: ignoreversi
|
|||
|
||||
; Apache, Php, Mysql
|
||||
; Put here path of Wampserver applications
|
||||
; Value OK: apache 2.4.51, php 7.3.33, mariadb10.6.5 (wampserver3.2.6_x64.exe)
|
||||
; Value OK: apache 2.4.51, php 7.4.26, mariadb10.6.5 (wampserver3.2.6_x64.exe)
|
||||
Source: "C:\wamp64\bin\apache\apache2.4.51\*.*"; DestDir: "{app}\bin\apache\apache2.4.51"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,httpd.conf,wampserver.conf,*.log,*_log"
|
||||
Source: "C:\wamp64\bin\php\php7.3.33\*.*"; DestDir: "{app}\bin\php\php7.3.33"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,phpForApache.ini,wampserver.conf,*.log,*_log"
|
||||
Source: "C:\wamp64\bin\php\php7.4.26\*.*"; DestDir: "{app}\bin\php\php7.4.26"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,phpForApache.ini,wampserver.conf,*.log,*_log"
|
||||
Source: "C:\wamp64\bin\mariadb\mariadb10.6.5\*.*"; DestDir: "{app}\bin\mariadb\mariadb10.6.5"; Flags: ignoreversion recursesubdirs; Excludes: "my.ini,data\*,wampserver.conf,*.log,*_log,MySQLInstanceConfig.exe"
|
||||
|
||||
; Mysql data files (does not overwrite if exists)
|
||||
|
|
@ -121,7 +121,7 @@ Source: "build\exe\doliwamp\dolibarr.conf.install"; DestDir: "{app}\alias"; Flag
|
|||
Source: "build\exe\doliwamp\httpd.conf.install"; DestDir: "{app}\bin\apache\apache2.4.51\conf"; Flags: ignoreversion;
|
||||
Source: "build\exe\doliwamp\my.ini.install"; DestDir: "{app}\bin\mysql\mysql5.0.45"; Flags: ignoreversion;
|
||||
Source: "build\exe\doliwamp\my.ini.install"; DestDir: "{app}\bin\mariadb\mariadb10.6.5"; Flags: ignoreversion;
|
||||
Source: "build\exe\doliwamp\php.ini.install"; DestDir: "{app}\bin\php\php7.3.33"; Flags: ignoreversion;
|
||||
Source: "build\exe\doliwamp\php.ini.install"; DestDir: "{app}\bin\php\php7.4.26"; Flags: ignoreversion;
|
||||
Source: "build\exe\doliwamp\index.php.install"; DestDir: "{app}\www"; Flags: ignoreversion;
|
||||
Source: "build\exe\doliwamp\install.forced.php.install"; DestDir: "{app}\www\dolibarr\htdocs\install"; Flags: ignoreversion;
|
||||
Source: "build\exe\doliwamp\openssl.conf"; DestDir: "{app}"; Flags: ignoreversion;
|
||||
|
|
@ -228,7 +228,7 @@ begin
|
|||
|
||||
//version des applis, a modifier pour chaque version de WampServer 2
|
||||
apacheVersion := '2.4.51';
|
||||
phpVersion := '7.3.33' ;
|
||||
phpVersion := '7.4.26' ;
|
||||
mysqlVersion := '10.6.5';
|
||||
|
||||
smtpServer := 'localhost';
|
||||
|
|
|
|||
|
|
@ -14,11 +14,11 @@ Prerequisites to build autoexe DoliWamp package from Linux (solution seems broke
|
|||
> Install InnoSetup
|
||||
For example by running isetup-5.5.8.exe (https://www.jrsoftware.org) https://files.jrsoftware.org/is/5/
|
||||
> Install WampServer into "C:\wamp64" to have Apache, PHP and MariaDB
|
||||
For example by running wampserver3.2.6_x64.exe (https://www.wampserver.com).
|
||||
For example by running wampserver3.2.6_x64.exe (https://www.wampserver.com).
|
||||
See file build/exe/doliwamp.iss to know the doliwamp version currently setup.
|
||||
> Add path to ISCC into PATH windows var:
|
||||
Launch wine cmd, then regedit and add entry int HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment\PATH
|
||||
> To build manually the .exe from Windows (running from makepack-dolibarr.pl script is however recommended),
|
||||
> To build manually the .exe from Windows (running from makepack-dolibarr.pl script is however recommended),
|
||||
open file build/exe/doliwamp.iss and click on button "Compile".
|
||||
The .exe file will be build into directory build.
|
||||
|
||||
|
|
@ -29,12 +29,13 @@ Prerequisites to build autoexe DoliWamp package from Windows:
|
|||
|
||||
> Install Perl for Windows (https://strawberryperl.com/)
|
||||
> Install isetup-5.5.8.exe (https://www.jrsoftware.org)
|
||||
> Install WampServer-3.2.*-64.exe (Apache 2.4.51, PHP 7.3.33, MariaDB 10.6.5 for example. Version must match the values found into doliwamp.iss)
|
||||
> Install Microsoft Visual C++ Redistributable 2017 (https://learn.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist?view=msvc-170)
|
||||
> Install WampServer-3.2.6-64.exe (Apache 2.4.51, PHP 7.4.26, MariaDB 10.6.5 for example. Version must match the values found into doliwamp.iss)
|
||||
> Install GIT for Windows (https://git-scm.com/ => You must choose option "Add Git bash profile", "Git commit as-is")
|
||||
> Install Dolibarr current version:
|
||||
git clone https://github.com/dolibarr/dolibarr or git clone --branch X.Y https://github.com/dolibarr/dolibarr
|
||||
> Install Dolibarr current version:
|
||||
git clone https://github.com/dolibarr/dolibarr or git clone --branch X.Y https://github.com/dolibarr/dolibarr
|
||||
|
||||
> Add the path of PHP (C:\wamp64\bin\php\php7.3.33) and InnoSetup (C:\Program Files (x86)\Inno Setup 5) into the %PATH% of Windows.
|
||||
> Add the path of PHP (C:\wamp64\bin\php\php7.4.26) and InnoSetup (C:\Program Files (x86)\Inno Setup 5) into the %PATH% of Windows.
|
||||
|
||||
> Create a config file c:\dolibarr\dolibarr\htdocs\conf\conf.php with content
|
||||
<?php
|
||||
|
|
@ -44,11 +45,11 @@ Prerequisites to build autoexe DoliWamp package from Windows:
|
|||
|
||||
***** Actions to do a BETA *****
|
||||
|
||||
This files describe steps made by Dolibarr packaging team to make a
|
||||
This files describe steps made by Dolibarr packaging team to make a
|
||||
beta version of Dolibarr, step by step.
|
||||
|
||||
- Check all files are committed.
|
||||
- Update version/info in ChangeLog, for this you can:
|
||||
- Update version/info in ChangeLog, for this you can:
|
||||
To generate a changelog of a major new version x.y.0 (from a repo on branch develop), you can do "cd ~/git/dolibarr; git log `diff -u <(git rev-list --first-parent x.(y-1).0) <(git rev-list --first-parent develop) | sed -ne 's/^ //p' | head -1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
|
||||
To generate a changelog of a major new version x.y.0 (from a repo on branch x.y repo), you can do "cd ~/git/dolibarr_x.y; git log `diff -u <(git rev-list --first-parent x.(y-1).0) <(git rev-list --first-parent x.y.0) | sed -ne 's/^ //p' | head -1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
|
||||
To generate a changelog of a maintenance version x.y.z, you can do "cd ~/git/dolibarr_x.y; git log x.y.z-1.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
|
||||
|
|
@ -69,7 +70,7 @@ Recopy the content of the output file into the file ChangeLog.
|
|||
|
||||
***** Actions to do a RELEASE *****
|
||||
|
||||
This files describe steps made by Dolibarr packaging team to make a
|
||||
This files describe steps made by Dolibarr packaging team to make a
|
||||
complete release of Dolibarr, step by step.
|
||||
|
||||
- Check all files are committed.
|
||||
|
|
@ -86,9 +87,9 @@ Recopy the content of the output file into the file ChangeLog.
|
|||
|
||||
- Check content of built packages.
|
||||
|
||||
- Run makepack-dolibarr.pl again with option to publish files on
|
||||
- Run makepack-dolibarr.pl again with option to publish files on
|
||||
dolibarr foundation server (Dir /home/dolibarr/wwwroot/files/stable on www.dolibarr.org).
|
||||
- Run makepack-dolibarr.pl again with option to publish files on
|
||||
- Run makepack-dolibarr.pl again with option to publish files on
|
||||
sourceforge. This will also add official tag.
|
||||
- Edit symbolic links in directory "/home/dolibarr/wwwroot/files/stable/xxx"
|
||||
on server to point to new files (used by some web sites).
|
||||
|
|
|
|||
|
|
@ -145,12 +145,16 @@ fi
|
|||
|
||||
|
||||
# ---------------------------- run sql file
|
||||
if [ "x$port" != "x0" ]
|
||||
then
|
||||
export Pport="-P$port"
|
||||
fi
|
||||
if [ "x$passwd" != "x" ]
|
||||
then
|
||||
export passwd="-p$passwd"
|
||||
fi
|
||||
#echo "mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile"
|
||||
#mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile
|
||||
#echo "mysql $Pport -u$admin $passwd $base < $mydir/$dumpfile"
|
||||
#mysql $Pport -u$admin $passwd $base < $mydir/$dumpfile
|
||||
|
||||
if [ "x${demopasshash}" != "xpassword_hash" ]
|
||||
then
|
||||
|
|
@ -162,19 +166,19 @@ else
|
|||
fi
|
||||
#rm /tmp/tmp.php
|
||||
|
||||
echo "echo \"UPDATE llx_user SET pass_crypted = '$newpass' WHERE login = '$demologin';\" | mysql -P$port $base"
|
||||
echo "UPDATE llx_user SET pass_crypted = '$newpass' WHERE login = '$demologin';" | mysql -P$port $base
|
||||
echo "echo \"UPDATE llx_user SET pass_crypted = '$newpass' WHERE login = '$demologin';\" | mysql $Pport $base"
|
||||
echo "UPDATE llx_user SET pass_crypted = '$newpass' WHERE login = '$demologin';" | mysql $Pport $base
|
||||
export res=$?
|
||||
|
||||
if [ $res -ne 0 ]; then
|
||||
echo "Error to execute sql with mysql -P$port -u$admin -p***** $base"
|
||||
echo "Error to execute sql with mysql $Pport -u$admin -p***** $base"
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ -s "$mydir/initdemopostsql.sql" ]; then
|
||||
echo A file initdemopostsql.sql was found, we execute it.
|
||||
echo "mysql -P$port $base < \"$mydir/initdemopostsql.sql\""
|
||||
mysql -P$port $base < "$mydir/initdemopostsql.sql"
|
||||
echo "mysql $Pport $base < \"$mydir/initdemopostsql.sql\""
|
||||
mysql $Pport $base < "$mydir/initdemopostsql.sql"
|
||||
else
|
||||
echo No file initdemopostsql.sql found, so no extra sql action done.
|
||||
fi
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -9,6 +9,7 @@
|
|||
<!-- info: 'relative' paths are relative to the examined file, so not ok. -->
|
||||
<exclude-pattern>/build/(html|aps)/</exclude-pattern>
|
||||
<exclude-pattern>/dev/tools/test/namespacemig/</exclude-pattern>
|
||||
<exclude-pattern>/dev/tools/phan/stubs/</exclude-pattern>
|
||||
<!-- <exclude-pattern>dev/initdata/dbf/includes</exclude-pattern> -->
|
||||
<exclude-pattern>/documents/</exclude-pattern>
|
||||
<exclude-pattern>/htdocs/core/class/lessc\.class\.php</exclude-pattern>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,73 @@
|
|||
REM SAMPLE WINDOWS SCRIPT TO START TESTS
|
||||
REM
|
||||
REM CURRENTLY THIS SCRIPT MUST BE LOCATED AT THE ROOT OF THE PROJECT.
|
||||
REM A copy of phpunit-9.5.phar is required
|
||||
REM @ECHO OFF
|
||||
|
||||
SET OPEN_BASEDIR=%~dp0
|
||||
c:\wamp64\bin\php\php7.4.33\php -dopen_basedir=%OPEN_BASEDIR% .\phpunit-9.5.phar -d memory_limit=-1 -c test\phpunit\phpunittest.xml test\phpunit\AllTests.php
|
||||
SET DD_TRACE_CLI_ENABLED=1
|
||||
SET DD_TRACE_CLI_LOG_FILE=%~dp0/trace.log
|
||||
SET PHP=c:\wamp64\bin\php\php7.4.33\php
|
||||
|
||||
REM c:\wamp64\bin\php\php7.4.33\php -dopen_basedir=%OPEN_BASEDIR% .\phpunit-9.5.phar -d memory_limit=-1 -c test\phpunit\phpunittest.xml test\phpunit\AllTests.php --filter FilesLibTest --migrate-configuration
|
||||
REM Example: phpunit.bat test/phpunit/FilesLibTest.php --filter FilesLibTest::testDolDirMove
|
||||
REM
|
||||
|
||||
REM The DOMAIN/Port value should be the same as in htdocs/conf/conf.php
|
||||
REM (This is only needed if did not set up another server locally
|
||||
REM for your test installation database).
|
||||
SET PHPSERVER_DOMAIN_PORT=127.0.0.1:8080
|
||||
SET PHPSERVER_LOG=%~dp0/php_serv.log
|
||||
|
||||
echo if (class_exists('PHPUnit\Framework\TestSuite')) { $dolibarr_main_url_root='http://%PHPSERVER_DOMAIN_PORT%'; } >> %~dp0\htdocs\conf\conf.php
|
||||
GOTO :START
|
||||
|
||||
REM The error handler
|
||||
:ERROR_HANDLER
|
||||
echo An error occurred. Stop php server
|
||||
taskkill /F /PID %php_pid%
|
||||
exit /b 1
|
||||
|
||||
:START
|
||||
|
||||
start /B php -S %PHPSERVER_DOMAIN_PORT% -t htdocs > %PHPSERVER_LOG% 2>&1
|
||||
for /F "tokens=2 delims=," %%i in ('tasklist /FI "IMAGENAME eq php.exe" /FO CSV /NH') do (
|
||||
set "php_pid=%%~i"
|
||||
goto :FOUND_PID
|
||||
)
|
||||
|
||||
:FOUND_PID
|
||||
echo "Server PID: %php_pid%"
|
||||
REM curl "http://%PHPSERVER_DOMAIN_PORT%"
|
||||
|
||||
|
||||
SET MEMOPT=-d memory-limit=-1
|
||||
SET CONFOPT=-c test\phpunit\phpunittest.xml
|
||||
SET TESTS=test\phpunit\AllTests.php
|
||||
|
||||
setlocal enabledelayedexpansion
|
||||
|
||||
for %%i in (%*) do (
|
||||
set "f=%%i"
|
||||
if "!f:~0,12!"=="memory-limit" (
|
||||
SET MEMOPT=""
|
||||
goto :continue
|
||||
)
|
||||
if "%%i"=="-c" (
|
||||
SET CONFOPT=""
|
||||
goto :continue
|
||||
)
|
||||
if "!f:~-4!"==".php" (
|
||||
set TESTS=""
|
||||
goto :continue
|
||||
)
|
||||
:continue
|
||||
REM NEEDED FOR CONTINUE
|
||||
|
||||
)
|
||||
|
||||
%PHP% -d display_errors=on -dopen_basedir=%OPEN_BASEDIR% .\phpunit-9.5.phar %MEMOPT% %CONFOPT% %TESTS% %*
|
||||
|
||||
REM c:\wamp64\bin\php\php7.4.33\php -dopen_basedir=%OPEN_BASEDIR% .\phpunit-9.5.phar -d memory_limit=-1 -c test\phpunit\phpunittest.xml test\phpunit\SecurityTest.php
|
||||
|
||||
REM c:\wamp64\bin\php\php7.4.33\php -dopen_basedir=%OPEN_BASEDIR% .\phpunit-9.5.phar -d memory_limit=-1 -c test\phpunit\phpunittest.xml
|
||||
REM c:\wamp64\bin\php\php7.4.33\php -dopen_basedir=%OPEN_BASEDIR% .\phpunit-9.5.phar -d memory_limit=-1 test\phpunit\AllTests.php --filter FilesLibTest
|
||||
|
||||
|
||||
taskkill /F /PID %php_pid%
|
||||
|
|
|
|||
|
|
@ -4,10 +4,12 @@
|
|||
|
||||
TRAVIS_BUILD_DIR=${TRAVIS_BUILD_DIR:=$(realpath "$(dirname "$0")/../../..")}
|
||||
MYSQL=${MYSQL:=mysql}
|
||||
MYSQLDUMP=${MYSQLDUMP:="${MYSQL}dump"}
|
||||
|
||||
DB=${DB:=mariadb}
|
||||
DB_ROOT=${DB_ROOT:=root}
|
||||
DB_PASS=${DB_PASS:=}
|
||||
DB_CACHE_FILE="${TRAVIS_BUILD_DIR}/db_init.sql"
|
||||
|
||||
TRAVIS_DOC_ROOT_PHP="${TRAVIS_DOC_ROOT_PHP:=$TRAVIS_BUILD_DIR/htdocs}"
|
||||
TRAVIS_DATA_ROOT_PHP="${TRAVIS_DATA_ROOT_PHP:=$TRAVIS_BUILD_DIR/documents}"
|
||||
|
|
@ -23,6 +25,18 @@ else
|
|||
fi
|
||||
CONF_FILE=${CONF_FILE:=${TRAVIS_BUILD_DIR}/htdocs/conf/conf.php}
|
||||
|
||||
function save_db_cache() (
|
||||
set -x
|
||||
rm "${DB_CACHE_FILE}".md5 2>/dev/null
|
||||
echo "Saving DB to cache file '${DB_CACHE_FILE}'"
|
||||
${SUDO} "${MYSQLDUMP}" -u "$DB_ROOT" -h 127.0.0.1 $PASS_OPT travis \
|
||||
--hex-blob --lock-tables=false --skip-add-locks \
|
||||
| sed -e 's/DEFINER=[^ ]* / /' > ${DB_CACHE_FILE}
|
||||
echo "${sum}" > "${DB_CACHE_FILE}".md5
|
||||
set +x
|
||||
)
|
||||
|
||||
|
||||
if [ -r "${CONF_FILE}" ] ; then
|
||||
echo "'${CONF_FILE} exists, not overwriting!"
|
||||
|
||||
|
|
@ -55,6 +69,7 @@ else
|
|||
echo
|
||||
fi
|
||||
|
||||
load_cache=0
|
||||
echo "Setting up database '$DB'"
|
||||
if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ] || [ "$DB" = 'postgresql' ]; then
|
||||
echo "MySQL stop"
|
||||
|
|
@ -71,6 +86,7 @@ if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ] || [ "$DB" = 'postgresql' ]; the
|
|||
PASS_OPT="'-password=${DB_PASS}'"
|
||||
fi
|
||||
echo "MySQL set root password"
|
||||
|
||||
if [ 1 = 1 ] ; then
|
||||
CMDS=( \
|
||||
""
|
||||
|
|
@ -110,8 +126,20 @@ if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ] || [ "$DB" = 'postgresql' ]; the
|
|||
echo "MySQL flush"
|
||||
${SUDO} "${MYSQL}" -u "$DB_ROOT" -h 127.0.0.1 $PASS_OPT -e 'FLUSH PRIVILEGES;'
|
||||
|
||||
echo "MySQL load sql"
|
||||
${SUDO} "${MYSQL}" --force -u "$DB_ROOT" -h 127.0.0.1 $PASS_OPT -D travis < ${TRAVIS_BUILD_DIR}/dev/initdemo/mysqldump_dolibarr_3.5.0.sql | tee $TRAVIS_BUILD_DIR/initial_350.log
|
||||
sum=$(find "${TRAVIS_BUILD_DIR}/htdocs/install" -type f -exec md5sum {} + | LC_ALL=C sort | md5sum)
|
||||
load_cache=0
|
||||
if [ -r "$DB_CACHE_FILE".md5 ] && [ -r "$DB_CACHE_FILE" ] && [ -x "$(which "${MYSQLDUMP}")" ] ; then
|
||||
cache_sum="$(<"$DB_CACHE_FILE".md5)"
|
||||
[ "$sum" = "$cache_sum" ] && load_cache=1
|
||||
fi
|
||||
|
||||
if [ "$load_cache" = "1" ] ; then
|
||||
echo "MySQL load cached sql"
|
||||
${SUDO} "${MYSQL}" --force -u "$DB_ROOT" -h 127.0.0.1 $PASS_OPT -D travis < ${DB_CACHE_FILE} | tee $TRAVIS_BUILD_DIR/db_from_cacheinit.log
|
||||
else
|
||||
echo "MySQL load initial sql"
|
||||
${SUDO} "${MYSQL}" --force -u "$DB_ROOT" -h 127.0.0.1 $PASS_OPT -D travis < ${TRAVIS_BUILD_DIR}/dev/initdemo/mysqldump_dolibarr_3.5.0.sql | tee $TRAVIS_BUILD_DIR/initial_350.log
|
||||
fi
|
||||
elif [ "$DB" = 'postgresql' ]; then
|
||||
echo Install pgsql if run is for pgsql
|
||||
|
||||
|
|
@ -158,32 +186,33 @@ set +e
|
|||
echo '$'force_install_prefix=\'llx_\'';'
|
||||
} > "$INSTALL_FORCED_FILE"
|
||||
|
||||
(
|
||||
cd "${TRAVIS_BUILD_DIR}/htdocs/install" || exit 1
|
||||
if [ "$load_cache" != "1" ] ; then
|
||||
(
|
||||
cd "${TRAVIS_BUILD_DIR}/htdocs/install" || exit 1
|
||||
|
||||
VERSIONS=("3.5.0" "3.6.0" "3.7.0" "3.8.0" "3.9.0")
|
||||
VERSIONS+=("4.0.0")
|
||||
VERSIONS+=("5.0.0" "6.0.0" "7.0.0" "8.0.0" "9.0.0")
|
||||
VERSIONS+=("10.0.0" "11.0.0" "12.0.0" "13.0.0" "14.0.0")
|
||||
VERSIONS+=("15.0.0" "16.0.0" "18.0.0" "19.0.0" "20.0.0")
|
||||
pVer=${VERSIONS[0]}
|
||||
for v in "${VERSIONS[@]:1}" ; do
|
||||
LOGNAME="${TRAVIS_BUILD_DIR}/upgrade${pVer//./}${v//./}"
|
||||
php upgrade.php "$pVer" "$v" ignoredbversion > "${LOGNAME}.log"
|
||||
php upgrade2.php "$pVer" "$v" ignoredbversion > "${LOGNAME}-2.log"
|
||||
php step5.php "$pVer" "$v" ignoredbversion > "${LOGNAME}-3.log"
|
||||
pVer="$v"
|
||||
done
|
||||
VERSIONS=("3.5.0" "3.6.0" "3.7.0" "3.8.0" "3.9.0")
|
||||
VERSIONS+=("4.0.0")
|
||||
VERSIONS+=("5.0.0" "6.0.0" "7.0.0" "8.0.0" "9.0.0")
|
||||
VERSIONS+=("10.0.0" "11.0.0" "12.0.0" "13.0.0" "14.0.0")
|
||||
VERSIONS+=("15.0.0" "16.0.0" "18.0.0" "19.0.0" "20.0.0")
|
||||
pVer=${VERSIONS[0]}
|
||||
for v in "${VERSIONS[@]:1}" ; do
|
||||
LOGNAME="${TRAVIS_BUILD_DIR}/upgrade${pVer//./}${v//./}"
|
||||
php upgrade.php "$pVer" "$v" ignoredbversion > "${LOGNAME}.log"
|
||||
php upgrade2.php "$pVer" "$v" ignoredbversion > "${LOGNAME}-2.log"
|
||||
php step5.php "$pVer" "$v" ignoredbversion > "${LOGNAME}-3.log"
|
||||
pVer="$v"
|
||||
done
|
||||
|
||||
${SUDO} "${MYSQL}" --force -u "$DB_ROOT" -h 127.0.0.1 $PASS_OPT -D travis < "${TRAVIS_BUILD_DIR}/htdocs/install/mysql/migration/repair.sql"
|
||||
${SUDO} "${MYSQL}" --force -u "$DB_ROOT" -h 127.0.0.1 $PASS_OPT -D travis < "${TRAVIS_BUILD_DIR}/htdocs/install/mysql/migration/repair.sql"
|
||||
|
||||
|
||||
{
|
||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_API,MAIN_MODULE_ProductBatch,MAIN_MODULE_SupplierProposal,MAIN_MODULE_STRIPE,MAIN_MODULE_ExpenseReport
|
||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_WEBSITE,MAIN_MODULE_TICKET,MAIN_MODULE_ACCOUNTING,MAIN_MODULE_MRP
|
||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_RECEPTION,MAIN_MODULE_RECRUITMENT
|
||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_KnowledgeManagement,MAIN_MODULE_EventOrganization,MAIN_MODULE_PARTNERSHIP
|
||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_EmailCollector
|
||||
} > $TRAVIS_BUILD_DIR/enablemodule.log
|
||||
|
||||
)
|
||||
{
|
||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_API,MAIN_MODULE_ProductBatch,MAIN_MODULE_SupplierProposal,MAIN_MODULE_STRIPE,MAIN_MODULE_ExpenseReport
|
||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_WEBSITE,MAIN_MODULE_TICKET,MAIN_MODULE_ACCOUNTING,MAIN_MODULE_MRP
|
||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_RECEPTION,MAIN_MODULE_RECRUITMENT
|
||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_KnowledgeManagement,MAIN_MODULE_EventOrganization,MAIN_MODULE_PARTNERSHIP
|
||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_EmailCollector
|
||||
} > $TRAVIS_BUILD_DIR/enablemodule.log
|
||||
) && save_db_cache
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -23,23 +23,24 @@ the project: `pre-commit-config.yaml`.
|
|||
|
||||
### Installation in your git project
|
||||
|
||||
1. Install `pre-commit` tool.\
|
||||
1. Install pre-commit tool.\
|
||||
If you do not have python installed, install [python](https://www.python.org) first.\
|
||||
If you do not have [`pip`](https://pypi.org/project/pip), install that as well.\\
|
||||
|
||||
Then you can install pre-commit tool: `python -m pip install pre-commit`.
|
||||
Then you can install pre-commit tool:
|
||||
`python3 -m pip install pre-commit`
|
||||
|
||||
2. In your local git clone of the project, run `pre-commit install` to add the hooks.\
|
||||
or copy the file git/hooks/pre-commit manually. (recommended because this file differs
|
||||
from the file installed with pre-commit install as it redirects output to the error
|
||||
channel so your IDE will be able to catch the error.
|
||||
2. In your local git clone of the project, run `pre-commit install` to add the hooks
|
||||
or copy the file *dev/setup/git/hooks/pre-commit* manually into *.git/hooks/pre-commit*
|
||||
(recommended because this file may differ from the file installed with the pre-commit install).
|
||||
The good file redirects output to the error channel so your IDE will be able to catch the error.
|
||||
|
||||
|
||||
### Tips
|
||||
|
||||
After installing `pre-commit` onto your local git clone, pre-commit will run
|
||||
on every commit. The first time, all tools required by pre-commit will be installed
|
||||
into ~/.cache/pre-commit
|
||||
on every commit. The first time, all tools required by pre-commit will be installed
|
||||
into ~/.cache/pre-commit
|
||||
|
||||
When it finds some issue, the git commit will be aborted, so you can fix it,
|
||||
or verify it.
|
||||
|
|
@ -87,3 +88,7 @@ There is much more you can do with pre-commit, check out its
|
|||
Now your commit is less likely to fail in the Continuous Intagration (CI) run
|
||||
on github.\
|
||||
CI also runs pre-commit to help maintain code quality.
|
||||
|
||||
Note:
|
||||
Code for precommits are saved into:
|
||||
.cache/pre-commit/repoyXXXXX/py_env-python3/lib/pythonX.Y/site-packages/pre_commit_hooks/no_commit_to_branch.py
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
/*
|
||||
* Copyright (C) 2023 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -650,7 +651,8 @@ $html .= '</div>';
|
|||
|
||||
$html .= '</section>'."\n";
|
||||
|
||||
$tmp = '';
|
||||
|
||||
$tmpstan = '';
|
||||
$nblines = 0;
|
||||
if (!empty($output_arrtd)) {
|
||||
foreach ($output_arrtd as $line) {
|
||||
|
|
@ -659,22 +661,23 @@ if (!empty($output_arrtd)) {
|
|||
preg_match('/^::error file=(.*),line=(\d+),col=(\d+)::(.*)$/', $line, $reg);
|
||||
if (!empty($reg[1])) {
|
||||
if ($nblines < 20) {
|
||||
$tmp .= '<tr class="nohidden">';
|
||||
$tmpstan .= '<tr class="nohidden">';
|
||||
} else {
|
||||
$tmp .= '<tr class="hidden sourcephpstan">';
|
||||
$tmpstan .= '<tr class="hidden sourcephpstan">';
|
||||
}
|
||||
$tmp .= '<td>'.dolPrintLabel($reg[1]).'</td>';
|
||||
$tmp .= '<td class="">';
|
||||
$tmp .= '<a href="'.dol_escape_htmltag($urlgit.$reg[1].'#L'.$reg[2]).'" target="_blank">'.dolPrintLabel($reg[2]).'</a>';
|
||||
$tmp .= '</td>';
|
||||
$tmp .= '<td class="tdoverflowmax300" title="'.dol_escape_htmltag($reg[4]).'">'.dolPrintLabel($reg[4]).'</td>';
|
||||
$tmp .= '</tr>'."\n";
|
||||
$tmpstan .= '<td>'.dolPrintLabel($reg[1]).'</td>';
|
||||
$tmpstan .= '<td class="">';
|
||||
$tmpstan .= '<a href="'.($urlgit.$reg[1].'#L'.$reg[2]).'" target="_blank">'.dolPrintLabel($reg[2]).'</a>';
|
||||
$tmpstan .= '</td>';
|
||||
$tmpstan .= '<td class="tdoverflowmax300" title="'.dolPrintHTMLForAttribute($reg[4]).'">'.dolPrintLabel($reg[4]).'</td>';
|
||||
$tmpstan .= '</tr>'."\n";
|
||||
|
||||
$nblines++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$tmpphan = '';
|
||||
$phan_nblines = 0;
|
||||
if (count($output_phan_json) != 0) {
|
||||
$phan_notices = json_decode($output_phan_json[count($output_phan_json) - 1], true);
|
||||
|
|
@ -684,6 +687,9 @@ if (count($output_phan_json) != 0) {
|
|||
foreach ($phan_notices as $notice) {
|
||||
if (!empty($notice['location'])) {
|
||||
$path = $notice['location']['path'];
|
||||
if ($path == 'internal') {
|
||||
continue;
|
||||
}
|
||||
$line_start = $notice['location']['lines']['begin'];
|
||||
$line_end = $notice['location']['lines']['end'];
|
||||
if ($line_start == $line_end) {
|
||||
|
|
@ -695,18 +701,18 @@ if (count($output_phan_json) != 0) {
|
|||
}
|
||||
$code_url_attr = dol_escape_htmltag($urlgit.$path.$line_range);
|
||||
if ($phan_nblines < 20) {
|
||||
$tmp = '<tr class="nohidden">';
|
||||
$tmpphan .= '<tr class="nohidden">';
|
||||
} else {
|
||||
$tmp = '<tr class="hidden sourcephan">';
|
||||
$tmpphan .= '<tr class="hidden sourcephan">';
|
||||
}
|
||||
$tmp .= '<td>'.dolPrintLabel($path).'</td>';
|
||||
$tmp .= '<td class="">';
|
||||
$tmp .= '<a href="'.$code_url_attr.'" target="_blank">'.$line_range_txt.'</a>';
|
||||
$tmp .= '</td>';
|
||||
$tmp .= '<td class="tdoverflowmax300">'.dolPrintLabel($notice['description']).'</td>';
|
||||
$tmp .= '</tr>';
|
||||
$tmpphan .= '<td>'.dolPrintLabel($path).'</td>';
|
||||
$tmpphan .= '<td class="">';
|
||||
$tmpphan .= '<a href="'.$code_url_attr.'" target="_blank">'.$line_range_txt.'</a>';
|
||||
$tmpphan .= '</td>';
|
||||
$tmpphan .= '<td class="tdoverflowmax300" title="'.dolPrintHTMLForAttribute($notice['description']).'">'.dolPrintLabel($notice['description']).'</td>';
|
||||
$tmpphan .= '</tr>';
|
||||
$tmpphan .= "\n";
|
||||
|
||||
$phan_items[] = $tmp;
|
||||
$phan_nblines++;
|
||||
}
|
||||
}
|
||||
|
|
@ -769,10 +775,15 @@ $html .= '</section>';
|
|||
|
||||
|
||||
// Technical debt PHPstan
|
||||
if ($nblines != 0) {
|
||||
|
||||
if ($dirphpstan != 'disabled') {
|
||||
$datatable_script .= '
|
||||
if (typeof(DataTable)==="function") {jQuery(".sourcephpstan").toggle(true);}
|
||||
let phpstantable = new DataTable("#technicaldebt table");
|
||||
let phpstantable = new DataTable("#technicaldebt table", {
|
||||
lengthMenu: [
|
||||
[10, 25, 50, 100, -1],
|
||||
[10, 25, 50, 100, \'All\']
|
||||
]});
|
||||
';
|
||||
$html .= '<section class="chapter" id="technicaldebt">'."\n";
|
||||
$html .= '<h2><span class="fas fa-book-dead pictofixedwidth"></span>Technical debt <span class="opacitymedium">(PHPStan level '.$phpstanlevel.' -> '.$nblines.' warnings)</span></h2>'."\n";
|
||||
|
|
@ -781,9 +792,10 @@ if ($nblines != 0) {
|
|||
$html .= '<div class="div-table-responsive">'."\n";
|
||||
$html .= '<table class="list_technical_debt centpercent">'."\n";
|
||||
$html .= '<thead><tr class="trgroup"><td>File</td><td>Line</td><td>Type</td></tr></thead><tbody>'."\n";
|
||||
$html .= $tmp;
|
||||
$html .= $tmpstan;
|
||||
$html .= '<tbody></table>';
|
||||
$html .= '<div><span class="seedetail" data-source="phpstan" id="sourcephpstan">Show all...</span></div>';
|
||||
// Disabled, no more required as list is managed with datatable
|
||||
//$html .= '<div><span class="seedetail" data-source="phpstan" id="sourcephpstan">Show all...</span></div>';
|
||||
$html .= '</div></div>';
|
||||
|
||||
$html .= '</section>'."\n";
|
||||
|
|
@ -792,7 +804,7 @@ if ($nblines != 0) {
|
|||
|
||||
// Technical debt Phan
|
||||
|
||||
if ($phan_nblines != 0) {
|
||||
if ($dir_phan != 'disabled') {
|
||||
$datatable_script .= '
|
||||
if (typeof(DataTable)==="function") {jQuery(".sourcephan").toggle(true);}
|
||||
let phantable = new DataTable("#technicaldebtphan table", {
|
||||
|
|
@ -808,7 +820,7 @@ if ($phan_nblines != 0) {
|
|||
$html .= '<div class="div-table-responsive">'."\n";
|
||||
$html .= '<table class="list_technical_debt centpercent">'."\n";
|
||||
$html .= '<thead><tr class="trgroup"><td>File</td><td>Line</td><td>Detail</td></tr></thead><tbody>'."\n";
|
||||
$html .= implode("\n", $phan_items);
|
||||
$html .= $tmpphan;
|
||||
$html .= '</tbody></table>';
|
||||
// Disabled, no more required as list is managed with datatable
|
||||
//$html .= '<div><span class="seedetail" data-source="phan" id="sourcephan">Show all...</span></div>';
|
||||
|
|
|
|||
|
|
@ -9,9 +9,13 @@ aploha->alpha
|
|||
aplohanothtml->alphanohtml
|
||||
aplphanothtml->alphanohtml
|
||||
choosed->chosen
|
||||
cumuled->cumulative
|
||||
dokument->document
|
||||
dolibar->dolibarr
|
||||
dolibarrr->dolibarr
|
||||
dollibar->dolibarr
|
||||
dollibarr->dolibarr
|
||||
thoose->those
|
||||
# fiche->card
|
||||
mot de passe->password
|
||||
not de passe->password
|
||||
|
|
|
|||
|
|
@ -57,3 +57,4 @@ dur
|
|||
fonction
|
||||
espace
|
||||
methode
|
||||
datee
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
$tmpprojtime = $element->getSumOfAmount($idofelementuser ? $elementuser : '', $dates, $datee); // $element is a task. $elementuser may be empty
|
||||
$typea = ($data[$j]->typea == 'birth') ? $picb : $pice;
|
||||
//var_dump("$key, $tablename, $datefieldname, $dates, $datee");
|
||||
GETPOST("mouvement", 'int'),
|
||||
GETPOSTINT("mouvement"),
|
||||
dol_syslog("msgid=".$overview[0]->message_id." date=".dol_print_date($overview[0]->udate, 'dayrfc', 'gmt')." from=".$overview[0]->from." to=".$overview[0]->to." subject=".$overview[0]->subject);
|
||||
if ((empty($dates) && empty($datee)) || (intval($dates) <= $element->datestart && intval($datee) >= $element->dateend)) {
|
||||
jQuery("#mouvement option").removeAttr("selected").change();
|
||||
|
|
@ -56,28 +56,30 @@
|
|||
$this->datea = $this->db->jdate($obj->datea);
|
||||
$this->datee = $this->db->jdate($obj->datee);
|
||||
$this->periode = $this->db->jdate($obj->period);
|
||||
$tmp = array('id_users'=>$obj->id_users, 'nom'=>$obj->name, 'reponses'=>$obj->reponses);
|
||||
$tmp = array('id_users' => $obj->id_users, 'nom' => $obj->name, 'reponses' => $obj->reponses);
|
||||
$tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.od(s|t)$', '', 'name', SORT_ASC, 0, true); // Disable hook for the moment
|
||||
//si les reponses ne concerne pas la colonne effacée, on concatenate
|
||||
GETPOST("mouvement", "int"),
|
||||
GETPOST("mouvement", 'alpha'),
|
||||
GETPOST("mouvement", 'int'),
|
||||
GETPOSTINT("mouvement"),
|
||||
foreach ($TWeek as $weekIndex => $weekNb) {
|
||||
if (count($arrayfields) > 0 && !empty($arrayfields['t.datee']['checked'])) {
|
||||
if (jQuery("#mouvement").val() == \'0\') jQuery("#unitprice").removeAttr("disabled");
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=transfert">'.$langs->trans("TransferStock").'</a>';
|
||||
print '<td class="center">'.dol_print_date($link->datea, "dayhour", "tzuser").'</td>';
|
||||
$action = 'transfert';
|
||||
$date_com = dol_mktime(GETPOST('rehour', 'int'), GETPOST('remin', 'int'), GETPOST('resec', 'int'), GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
|
||||
$date_com = dol_mktime(GETPOSTINT('rehour'), GETPOSTINT('remin'), GETPOSTINT('resec'), GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'));
|
||||
$date_next_execution = (GETPOST('remonth') ? dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')) : -1);
|
||||
$date_next_execution = dol_mktime($rehour, $remin, 0, $remonth, $reday, $reyear);
|
||||
$datee = dol_get_last_day(GETPOST('yeartoexport', 'int'), GETPOST('monthtoexport', 'int') ? GETPOST('monthtoexport', 'int') : 12);
|
||||
$datesubscription = dol_mktime(12, 0, 0, GETPOST("remonth", 'int'), GETPOST("reday", "int"), GETPOST("reyear", "int"));
|
||||
$datee = dol_get_last_day(GETPOSTINT('yeartoexport'), GETPOSTINT('monthtoexport') ? GETPOSTINT('monthtoexport') : 12);
|
||||
$datesubscription = dol_mktime(12, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear"));
|
||||
$ensemblereponses = $obj->reponses;
|
||||
$field = preg_replace('/(:[!<>=\s]+:|:in:|:notin:|:like:|:notlike:).*$/', '', $tmpcrit); // the name of the field
|
||||
$newcrit = preg_replace('/(:[!<>=\s]+:|:in:|:notin:|:like:|:notlike:)/', '', $tmpcrit);
|
||||
$object->datee = $datee;
|
||||
$object->periode = $dateperiod;
|
||||
$return .= '<br><span class="opacitymedium">'.$langs->trans("Payement").'</span> : <span class="info-box-label">'.$this->type_payment.'</span>';
|
||||
$sortfield = "datea";
|
||||
$sql = "SELECT p.rowid as id, p.entity, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status, p.fk_opp_status, p.opp_amount, p.opp_percent, p.tms as date_update, p.budget_amount";
|
||||
$sql .= " '".$db->escape($conf->currency)."' as currency, 0 as fk_soc, t.date_ech as date, t.periode as date_due, 'SocialContributions' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum, ".PAY_DEBIT." as sens";
|
||||
$sql .= " , datee = ".(!empty($obj->datee) ? "'".$this->db->escape($obj->datee)."'" : "null");
|
||||
$sql .= " AND (".$datefieldname." <= '".$this->db->idate($datee)."' OR ".$datefieldname." IS NULL)";
|
||||
|
|
@ -98,36 +100,36 @@
|
|||
$taskstatic->datee = $db->jdate($obj->date_end);
|
||||
$this->category->childs = array();
|
||||
$this->datea = dol_now();
|
||||
$tmpcrit = preg_replace('/^.*(:[!<>=\s]+:|:in:|:notin:|:like:|:notlike:)/', '\1', $tmpcrit); // the condition after the name of the field
|
||||
'datee' => $date_end,
|
||||
// mise a jour des reponses utilisateurs dans la base
|
||||
if (!empty($arrayfields['t.datee']['checked'])) {
|
||||
if ($user->hasRight('stock', 'mouvement', 'lire')) {
|
||||
if (empty($reyear) || empty($remonth) || empty($reday)) {
|
||||
jQuery("#mouvement").change(function() {
|
||||
preg_match('/:([!<>=\s]+|in|notin|like|notlike):/', $tmpcrit, $reg);
|
||||
print $form->selectDate($object->periode, 'period', 0, 0, 0, 'charge', 1);
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&action=transfert">'.$langs->trans("TransferStock").'</a>';
|
||||
print '<span class="opacitymedium">'.$langs->trans("ClinkOnALinkOfColumn", $langs->transnoentitiesnoconv("Referers")).'</span>';
|
||||
print '<td class="center nowraponall">'.dol_print_date($db->jdate($obj->periode), 'day').'</td>';
|
||||
print '<tr><td>'.$langs->trans("AddIn").'</td><td>';
|
||||
print dol_print_date($object->periode, "day");
|
||||
$TWeek[$week_number] = $week_number;
|
||||
$action = 'transfert';
|
||||
$cle_rib = strtolower(checkES($rib, $CCC));
|
||||
$date_com = dol_mktime(GETPOST('rehour'), GETPOST('remin'), GETPOST('resec'), GETPOST("remonth"), GETPOST("reday"), GETPOST("reyear"));
|
||||
$date_next_execution = isset($date_next_execution) ? $date_next_execution : (GETPOST('remonth') ? dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')) : -1);
|
||||
$datefrom = dol_mktime(0, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
|
||||
$datesubscription = dol_mktime(0, 0, 0, GETPOST("remonth", "int"), GETPOST("reday", "int"), GETPOST("reyear", "int"));
|
||||
$datefrom = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'));
|
||||
$datesubscription = dol_mktime(0, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear"));
|
||||
$datetouse = ($this->date_end > 0) ? $this->date_end : ((isset($this->datee) && $this->datee > 0) ? $this->datee : 0);
|
||||
$elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee, !empty($project_field) ? $project_field : 'fk_projet');
|
||||
$ensemblereponses = $obj->reponses;
|
||||
$head[$h][1] = $langs->trans("Referers");
|
||||
$head[$tab][1] = $langs->trans("Referers");
|
||||
$out .= "<b>".$langs->trans("Referer").":</b> ".(isset($_SERVER["HTTP_REFERER"]) ? dol_htmlentities($_SERVER["HTTP_REFERER"], ENT_COMPAT) : '')."<br>\n";
|
||||
$reday = GETPOST('reday', 'int');
|
||||
$reday = GETPOSTINT('reday');
|
||||
$sql = "SELECT p.rowid as id, p.entity, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status, p.fk_opp_status, p.opp_amount, p.opp_percent, p.tms as date_modification, p.budget_amount";
|
||||
$sql = "SELECT p.rowid as id, p.entity, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status, p.fk_opp_status, p.opp_amount, p.opp_percent, p.tms as date_update, p.budget_amount";
|
||||
$sql = 'SELECT p.rowid as id, p.entity, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status, p.fk_opp_status, p.opp_amount, p.opp_percent, p.tms as date_modification, p.budget_amount';
|
||||
$sql = 'SELECT p.rowid as id, p.entity, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status, p.fk_opp_status, p.opp_amount, p.opp_percent, p.tms as date_update, p.budget_amount';
|
||||
$sql .= " (cs.periode IS NOT NULL AND cs.periode between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')";
|
||||
$sql .= " OR (cs.periode IS NULL AND cs.date_ech between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')";
|
||||
$sql .= " VALUES (".$conf->entity.", '".$this->db->idate($this->datea)."'";
|
||||
|
|
@ -177,7 +179,10 @@
|
|||
if (empty($this->datea)) {
|
||||
if (in_array('01', $TWeek) && in_array('52', $TWeek) && $weekNb == '01') {
|
||||
print $form->selectDate(strtotime(date('Y-m-d', $object->datee)), 'end', '', '', 0, '', 1, 0);
|
||||
print $form->selectDate(strtotime(date('Y-m-d', $object->datee)), 'end', 0, 0, 0, '', 1, 0);
|
||||
print $object->datee ? dol_print_date($object->datee, 'daytext') : ' ';
|
||||
print '<input type="hidden" name="action" value="addin">';
|
||||
print '<tr><td>'.$langs->trans("AddIn").'</td><td>';
|
||||
print '<tr><td>'.$langs->trans("Datee").'</td>';
|
||||
print_liste_field_titre($arrayfields['t.datee']['label'], $_SERVER["PHP_SELF"], "t.datee", '', $param, '', $sortfield, $sortorder, 'center ');
|
||||
* @param string $datee End date (ex 23:59:59)
|
||||
|
|
@ -187,13 +192,14 @@
|
|||
$datee = dol_mktime(12, 0, 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear'));
|
||||
$datee = dol_stringtotime($dateerfc);
|
||||
$datepaid = dol_mktime(12, 0, 0, GETPOST("remonth"), GETPOST("reday"), GETPOST("reyear"));
|
||||
$datepaid = dol_mktime(12, 0, 0, GETPOST("remonth", 'int'), GETPOST("reday", 'int'), GETPOST("reyear", 'int'));
|
||||
$datepaye = dol_mktime(12, 0, 0, GETPOST("remonth", "int"), GETPOST("reday", "int"), GETPOST("reyear", "int"));
|
||||
$datepaye = dol_mktime(12, 0, 0, GETPOST("remonth", 'int'), GETPOST("reday", 'int'), GETPOST("reyear", 'int'));
|
||||
$datepaye = dol_mktime(GETPOST("rehour", 'int'), GETPOST("remin", 'int'), GETPOST("resec", 'int'), GETPOST("remonth", 'int'), GETPOST("reday", 'int'), GETPOST("reyear", 'int'));
|
||||
$datepaye = dol_mktime(GETPOST("rehour", 'int'), GETPOST("remin", 'int'), GETPOST("resec", 'int'), GETPOST("remonth", 'int'), GETPOST("reday", 'int'), GETPOST("reyear", 'int'), 'tzuserrel');
|
||||
$datepaid = dol_mktime(12, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear"));
|
||||
$datepaye = dol_mktime(12, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear"));
|
||||
$datepaye = dol_mktime(GETPOSTINT("rehour"), GETPOSTINT("remin"), GETPOSTINT("resec"), GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear"));
|
||||
$datepaye = dol_mktime(GETPOSTINT("rehour"), GETPOSTINT("remin"), GETPOSTINT("resec"), GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear"), 'tzuserrel');
|
||||
$ensemblereponses = $obj->reponses;
|
||||
$head[$h][1] = $langs->trans('Referers');
|
||||
$inj += preg_match('/on(dblclick|drop|durationchange|emptied|end|ended|error|focus|focusin|focusout|formdata|gotpointercapture|hashchange|input|invalid)[a-z]*\s*=/i', $tmpval);
|
||||
$inj += preg_match('/on(dblclick|drop|durationchange|emptied|end|ended|error|focus|focusin|focusout|formdata|gotpointercapture|hashchange|input|invalid)[a-z]*\s*=/i', $val);
|
||||
$morewherefilterarray[] = " t.datee <= '".$db->idate($search_date_end_end)."'";
|
||||
$morewherefilterarray[] = " t.datee >= '".$db->idate($search_date_end_start)."'";
|
||||
$opensurveysondage->mail_admin = $_SESSION['adresse'];
|
||||
|
|
@ -226,7 +232,8 @@
|
|||
$sql2 .= " s.logo, s.email, s.entity, p.fk_user_creat, p.public, p.fk_statut, p.fk_opp_status, p.opp_percent, p.opp_amount, p.dateo, p.datee";
|
||||
$title = $langs->trans('Batch')." ".$shortlabel." - ".$langs->trans('Referers');
|
||||
$totalforvisibletasks = projectLinesPerMonth($j, $firstdaytoshow, $usertoprocess, 0, $tasksarray, $level, $projectsrole, $tasksrole, $mine, $restrictviewformytask, $isavailable, 0, $TWeek);
|
||||
'cs.periode' =>array('label'=>"PeriodEndDate", 'checked'=>1, 'position'=>50),
|
||||
$value = preg_replace('/([a-z\.]+)\s*([!<>=]+|in|notin|like|notlike)\s*/', '\1:\2:', $value); // Clean string 'x < 10' into 'x:<:10' so we can then explode on space to get all AND tests to do
|
||||
'cs.periode' => array('label' => "PeriodEndDate", 'checked' => 1, 'position' => 50),
|
||||
't.datee'=>array('label'=>"Deadline", 'checked'=>1, 'position'=>101),
|
||||
't.datee'=>array('label'=>"Deadline", 'checked'=>1, 'position'=>5),
|
||||
// Ligne de la periode d'analyse du rapport
|
||||
|
|
@ -238,13 +245,15 @@
|
|||
foreach ($TWeek as $week_number) {
|
||||
if (!empty($arrayfields['t.datee']['checked'])) {
|
||||
if ($action == "transfert") {
|
||||
if (GETPOST("reyear", "int") && GETPOST("remonth", "int") && GETPOST("reday", "int")) {
|
||||
if ($object->id > 0 && $action == 'addin') {
|
||||
if (GETPOST('reday')) {
|
||||
if (GETPOSTINT("reyear") && GETPOSTINT("remonth") && GETPOSTINT("reday")) {
|
||||
print $form->selectDate($datee, 'datee', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
|
||||
print '<option value="1"'.(GETPOST('mouvement') ? ' selected="selected"' : '').'>'.$langs->trans("Delete").'</option>';
|
||||
print '<select name="mouvement" id="mouvement" class="minwidth100 valignmiddle">';
|
||||
print '<td class="left" width="25%">'.$langs->trans("Referers").'</td>';
|
||||
print '<td class="right">'.$langs->trans("NbOfMembers").' <span class="opacitymedium">('.$langs->trans("AllTime").')</span></td>';
|
||||
print '<tr><td>'.$langs->trans("AddIn").'</td><td>';
|
||||
print '<tr><td>'.$langs->trans("Period")."</td><td>".dol_print_date($charge->periode, 'day')."</td></tr>\n";
|
||||
print ajax_combobox("mouvement");
|
||||
print_liste_field_titre("Employee", $_SERVER["PHP_SELF"], "u.lastname,cs.periode", "", $param, 'class="left"', $sortfield, $sortorder);
|
||||
|
|
@ -265,6 +274,9 @@
|
|||
public function getSumOfAmount($fuser = '', $dates = '', $datee = '')
|
||||
return $TWeek;
|
||||
unset($_SESSION["adresse"]);
|
||||
- creat,unitl,alltime,datas,referers
|
||||
- informations,medias,uptodate,reenable,crypted,developpers
|
||||
- ned
|
||||
* @param array $TWeek array of week numbers
|
||||
* @param array $TWeek Array of week numbers
|
||||
* Copyright (C) 2019 Tim Otte <otte@meuser.it>
|
||||
|
|
@ -296,9 +308,7 @@ $sql .= " GROUP BY cs.rowid, cs.fk_type, cs.fk_user, cs.amount, cs.date_ech, cs.
|
|||
$sql .= " cs.amount, cs.date_ech, cs.libelle as label, cs.paye, cs.periode, cs.fk_account,";
|
||||
$sql .= " cs.rowid, cs.libelle as label_sc, cs.fk_type as type, cs.periode, cs.date_ech, cs.amount as total, cs.paye,";
|
||||
$sql .= " p.datec as date_creation, p.dateo as date_start, p.datee as date_end, p.opp_amount, p.opp_percent, (p.opp_amount*p.opp_percent/100) as opp_weighted_amount, p.tms as date_modification, p.budget_amount,";
|
||||
$sql .= " p.datec as date_creation, p.dateo as date_start, p.datee as date_end, p.opp_amount, p.opp_percent, (p.opp_amount*p.opp_percent/100) as opp_weighted_amount, p.tms as date_update, p.budget_amount,";
|
||||
$sql .= " t.datec as date_creation, t.dateo as date_start, t.datee as date_end, t.tms as date_modification,";
|
||||
$sql .= " t.datec as date_creation, t.dateo as date_start, t.datee as date_end, t.tms as date_update,";
|
||||
$sql .= dolSqlDateFilter('p.datee', $search_eday, $search_emonth, $search_eyear);
|
||||
$sql = "SELECT ".$distinct." p.rowid as projectid, p.ref as projectref, p.title as projecttitle, p.fk_statut as projectstatus, p.datee as projectdatee, p.fk_opp_status, p.public, p.fk_user_creat as projectusercreate, p.usage_bill_time,";
|
||||
$sql = "SELECT id_users, nom as name, id_sondage, reponses";
|
||||
|
|
@ -316,6 +326,9 @@ $usercanread = (($user->hasRight('stock', 'mouvement', 'lire')));
|
|||
* The hook contaxt thirdpartycard has been renamed thirdpartycontact
|
||||
* The private array ->status_short, ->statuts and ->status_long are now array ->labelStatusShort and ->labelStatus everywhere.
|
||||
- New: Add proposals into referer page of thirdparty.
|
||||
AmountIn
|
||||
NEW: ModuleBuilder: Checkin comments begin and end before each actions
|
||||
for /F "tokens=2 delims=," %%i in ('tasklist /FI "IMAGENAME eq php.exe" /FO CSV /NH') do (
|
||||
foreach ($TWeek as $week_number) {
|
||||
function checkES($IentOfi, $InumCta)
|
||||
function getFirstDayOfEachWeek($TWeek, $year)
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
#
|
||||
# shellcheck disable=1113,2002,2006,2086,2164,2219
|
||||
|
||||
Releases=("3.9" "4.0" "5.0" "6.0" "7.0" "8.0" "9.0" "10.0" "11.0" "12.0" "13.0" "14.0" "15.0" "16.0" "17.0" "18.0" "develop")
|
||||
Releases=("3.9" "4.0" "5.0" "6.0" "7.0" "8.0" "9.0" "10.0" "11.0" "12.0" "13.0" "14.0" "15.0" "16.0" "17.0" "18.0" "19.0" "develop")
|
||||
let "counter = 0"
|
||||
|
||||
echo "Copy script into /tmp/github_commits_byversion.sh"
|
||||
|
|
@ -49,4 +49,3 @@ do
|
|||
echo
|
||||
let "counter +=1"
|
||||
done
|
||||
|
||||
|
|
|
|||
3
dev/tools/phan/.gitignore
vendored
Normal file
3
dev/tools/phan/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
*.sw?
|
||||
composer.*
|
||||
vendor
|
||||
46
dev/tools/phan/PHAN.BAT
Normal file
46
dev/tools/phan/PHAN.BAT
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
@ECHO OFF
|
||||
REM Usage (use from root of project):
|
||||
REM - Standard checks:
|
||||
REM PHAN.BAT
|
||||
REM - Extended checks:
|
||||
REM PHAN.BAT extended
|
||||
REM - Use fixer configuration:
|
||||
REM PHAN.BAT fix
|
||||
REM
|
||||
REM Standard phan options can be added on the command line.
|
||||
|
||||
set MEMOPT=--memory-limit=4G
|
||||
set CONFIG=--config-file
|
||||
set CONFIG_FILE=dev/tools/phan/config.php
|
||||
set FIX=
|
||||
set USERARGS=
|
||||
SET TWICE=--analyze-twice
|
||||
|
||||
rem Iterate through each argument
|
||||
for %%i in (%*) do (
|
||||
if "%%i"=="--memory-limit" (
|
||||
set MEMOPT=""
|
||||
)
|
||||
if "%%i"=="extended" (
|
||||
set CONFIG="--config-file"
|
||||
set CONFIG_FILE=dev/tools/phan/config_extended.php
|
||||
goto :nextloop
|
||||
)
|
||||
if "%%i"=="fix" (
|
||||
set FIX="--automatic-fix"
|
||||
set CONFIG="--config-file"
|
||||
set CONFIG_FILE=dev/tools/phan/config_fixer.php
|
||||
set TWICE=
|
||||
goto :nextloop
|
||||
)
|
||||
if "%%i"=="--config-file" (
|
||||
set CONFIG=
|
||||
set CONFIG_FILE=
|
||||
)
|
||||
set "USERARGS=%USERARGS% %%i"
|
||||
|
||||
:nextloop
|
||||
REM NEXTLOOP
|
||||
)
|
||||
|
||||
../phan/vendor/bin/phan.bat %TWICE% %MEMOPT% %FIX% %CONFIG% %CONFIG_FILE% %USERARGS%
|
||||
46
dev/tools/phan/README.md
Normal file
46
dev/tools/phan/README.md
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
### Static Code Checks using [phan]
|
||||
|
||||
#### Installation, running
|
||||
|
||||
`run-phan.sh` can install and run `phan`.
|
||||
|
||||
See instructions in `run-phan.sh` for installing (or just run it).
|
||||
|
||||
The configuration file in `PROJECT_DIR/.phan/config.php` also allows you to run
|
||||
`phan` independently from the script.
|
||||
|
||||
#### Run options:
|
||||
|
||||
No option : Runs the minimum checks
|
||||
|
||||
Option 'full' : Runs all an extensive set of checks
|
||||
|
||||
Option '1' : Writes the baseline
|
||||
|
||||
Examples:
|
||||
|
||||
- `run-phan.sh` runs the default checks
|
||||
- `run-phan.sh 1` updates the baseline for the default checks
|
||||
- `run-phan.sh full` runs the extended checks
|
||||
- `run-phan.sh full 1` updates the baseline for the extended checks
|
||||
|
||||
#### Baseline
|
||||
|
||||
The `baseline.txt` file in this directory defines the issues that are currently
|
||||
excluded from the final report. In principle you should not add any more
|
||||
exceptions to that file, but rather fix the issues or add [phan annotations]
|
||||
that provide more information or to exclude specific cases.
|
||||
|
||||
#### Configuration
|
||||
|
||||
`config.php` : Default configuration file
|
||||
|
||||
`config_extended.php` : Configuration that enables more checks.
|
||||
|
||||
`baseline.txt` : Ignored issues (with `config.php`)
|
||||
|
||||
`baseline_extended.txt` : Ignored issues (with `config_extended.php`), not
|
||||
currently in git
|
||||
|
||||
[phan]: https://github.com/phan/phan/wiki/Getting-Started
|
||||
[phan annotations]: https://github.com/phan/phan/wiki/Annotating-Your-Source-Code
|
||||
94
dev/tools/phan/baseline.txt
Normal file
94
dev/tools/phan/baseline.txt
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
<?php
|
||||
/**
|
||||
* This is an automatically generated baseline for Phan issues.
|
||||
* When Phan is invoked with --load-baseline=path/to/baseline.php,
|
||||
* The pre-existing issues listed in this file won't be emitted.
|
||||
*
|
||||
* This file can be updated by invoking Phan with --save-baseline=path/to/baseline.php
|
||||
* (can be combined with --load-baseline)
|
||||
*/
|
||||
return [
|
||||
// # Issue statistics:
|
||||
// PhanParamSignatureMismatch : 25+ occurrences
|
||||
// PhanTypeMismatchReturnNullable : 20+ occurrences
|
||||
// PhanPluginSuspiciousParamPosition : 15+ occurrences
|
||||
// PhanUndeclaredConstant : 15+ occurrences
|
||||
// PhanPluginDuplicateExpressionBinaryOp : 10+ occurrences
|
||||
// PhanTypeArraySuspiciousNull : 10+ occurrences
|
||||
// PhanTypeMismatchReturn : 10+ occurrences
|
||||
// PhanRedefineFunctionInternal : 6 occurrences
|
||||
// PhanParamTooMany : 4 occurrences
|
||||
// PhanTypeMismatchPropertyProbablyReal : 2 occurrences
|
||||
// PhanAccessMethodProtected : 1 occurrence
|
||||
// PhanAccessPropertyStaticAsNonStatic : 1 occurrence
|
||||
// PhanNoopStringLiteral : 1 occurrence
|
||||
// PhanPluginAlwaysReturnFunction : 1 occurrence
|
||||
|
||||
// Currently, file_suppressions and directory_suppressions are the only supported suppressions
|
||||
'file_suppressions' => [
|
||||
'htdocs/adherents/class/adherent.class.php' => ['PhanTypeMismatchReturnNullable'],
|
||||
'htdocs/adherents/class/adherentstats.class.php' => ['PhanTypeMismatchReturnNullable'],
|
||||
'htdocs/adherents/stats/geo.php' => ['PhanTypeArraySuspiciousNull'],
|
||||
'htdocs/adherents/type.php' => ['PhanPluginDuplicateExpressionBinaryOp'],
|
||||
'htdocs/admin/receiptprinter.php' => ['PhanRedefineFunctionInternal'],
|
||||
'htdocs/api/class/api_documents.class.php' => ['PhanPluginDuplicateExpressionBinaryOp'],
|
||||
'htdocs/barcode/printsheet.php' => ['PhanPluginDuplicateExpressionBinaryOp'],
|
||||
'htdocs/categories/class/api_categories.class.php' => ['PhanAccessMethodProtected'],
|
||||
'htdocs/categories/viewcat.php' => ['PhanPluginDuplicateExpressionBinaryOp'],
|
||||
'htdocs/collab/index.php' => ['PhanParamTooMany'],
|
||||
'htdocs/comm/action/class/actioncomm.class.php' => ['PhanTypeMismatchReturnNullable'],
|
||||
'htdocs/comm/action/index.php' => ['PhanTypeArraySuspiciousNull'],
|
||||
'htdocs/comm/mailing/card.php' => ['PhanPluginSuspiciousParamPosition'],
|
||||
'htdocs/comm/propal/class/api_proposals.class.php' => ['PhanTypeMismatchReturnNullable'],
|
||||
'htdocs/compta/cashcontrol/cashcontrol_card.php' => ['PhanPluginDuplicateExpressionBinaryOp'],
|
||||
'htdocs/compta/prelevement/class/bonprelevement.class.php' => ['PhanParamTooMany'],
|
||||
'htdocs/compta/prelevement/create.php' => ['PhanPluginSuspiciousParamPosition'],
|
||||
'htdocs/core/class/commondocgenerator.class.php' => ['PhanTypeArraySuspiciousNull'],
|
||||
'htdocs/core/class/commonobject.class.php' => ['PhanTypeMismatchReturnNullable'],
|
||||
'htdocs/core/class/extrafields.class.php' => ['PhanTypeMismatchReturnNullable'],
|
||||
'htdocs/core/class/html.form.class.php' => ['PhanPluginSuspiciousParamPosition'],
|
||||
'htdocs/core/class/html.formprojet.class.php' => ['PhanTypeMismatchReturnNullable'],
|
||||
'htdocs/core/class/smtps.class.php' => ['PhanTypeMismatchReturnNullable'],
|
||||
'htdocs/core/class/stats.class.php' => ['PhanTypeMismatchReturnNullable'],
|
||||
'htdocs/core/db/mysqli.class.php' => ['PhanParamSignatureMismatch'],
|
||||
'htdocs/core/db/pgsql.class.php' => ['PhanParamSignatureMismatch'],
|
||||
'htdocs/core/db/sqlite3.class.php' => ['PhanParamSignatureMismatch', 'PhanTypeMismatchReturnNullable'],
|
||||
'htdocs/core/get_info.php' => ['PhanPluginSuspiciousParamPosition'],
|
||||
'htdocs/core/lib/date.lib.php' => ['PhanTypeMismatchReturnNullable'],
|
||||
'htdocs/core/lib/files.lib.php' => ['PhanPluginDuplicateExpressionBinaryOp'],
|
||||
'htdocs/core/lib/functions.lib.php' => ['PhanParamTooMany', 'PhanPluginAlwaysReturnFunction', 'PhanRedefineFunctionInternal'],
|
||||
'htdocs/core/lib/functions2.lib.php' => ['PhanTypeMismatchReturnNullable'],
|
||||
'htdocs/core/lib/pdf.lib.php' => ['PhanTypeMismatchReturnNullable'],
|
||||
'htdocs/core/lib/price.lib.php' => ['PhanPluginSuspiciousParamPosition'],
|
||||
'htdocs/core/lib/website.lib.php' => ['PhanTypeMismatchReturnNullable'],
|
||||
'htdocs/core/modules/DolibarrModules.class.php' => ['PhanTypeMismatchReturnNullable'],
|
||||
'htdocs/core/modules/movement/doc/pdf_standard.modules.php' => ['PhanPluginDuplicateExpressionBinaryOp'],
|
||||
'htdocs/core/modules/mrp/doc/pdf_vinci.modules.php' => ['PhanTypeArraySuspiciousNull'],
|
||||
'htdocs/core/modules/societe/modules_societe.class.php' => ['PhanTypeMismatchReturn'],
|
||||
'htdocs/core/modules/syslog/mod_syslog_file.php' => ['PhanParamSignatureMismatch'],
|
||||
'htdocs/core/modules/syslog/mod_syslog_syslog.php' => ['PhanParamSignatureMismatch'],
|
||||
'htdocs/don/class/don.class.php' => ['PhanParamTooMany'],
|
||||
'htdocs/expedition/class/api_shipments.class.php' => ['PhanTypeMismatchReturn'],
|
||||
'htdocs/expensereport/class/api_expensereports.class.php' => ['PhanTypeMismatchReturn'],
|
||||
'htdocs/fourn/class/fournisseur.commande.class.php' => ['PhanTypeMismatchReturn'],
|
||||
'htdocs/fourn/class/fournisseur.facture.class.php' => ['PhanTypeMismatchReturn'],
|
||||
'htdocs/intracommreport/list.php' => ['PhanAccessPropertyStaticAsNonStatic'],
|
||||
'htdocs/mrp/class/mo.class.php' => ['PhanParamSignatureMismatch'],
|
||||
'htdocs/product/admin/product_tools.php' => ['PhanNoopStringLiteral'],
|
||||
'htdocs/product/class/product.class.php' => ['PhanTypeMismatchReturn'],
|
||||
'htdocs/projet/class/project.class.php' => ['PhanTypeMismatchReturnNullable'],
|
||||
'htdocs/projet/class/projectstats.class.php' => ['PhanTypeMismatchReturnNullable'],
|
||||
'htdocs/projet/class/task.class.php' => ['PhanTypeMismatchReturnNullable'],
|
||||
'htdocs/projet/tasks/list.php' => ['PhanTypeArraySuspiciousNull'],
|
||||
'htdocs/public/payment/paymentok.php' => ['PhanPluginSuspiciousParamPosition'],
|
||||
'htdocs/societe/class/companybankaccount.class.php' => ['PhanParamSignatureMismatch'],
|
||||
'htdocs/stripe/admin/stripe.php' => ['PhanDeprecatedFunction'],
|
||||
'htdocs/stripe/class/actions_stripe.class.php' => ['PhanPluginSuspiciousParamPosition'],
|
||||
'htdocs/takepos/invoice.php' => ['PhanPluginSuspiciousParamPosition'],
|
||||
'htdocs/variants/class/ProductCombination.class.php' => ['PhanPluginSuspiciousParamPosition'],
|
||||
'htdocs/website/class/website.class.php' => ['PhanTypeMismatchReturnNullable'],
|
||||
'internal' => ['PhanUndeclaredConstant'],
|
||||
],
|
||||
// 'directory_suppressions' => ['src/directory_name' => ['PhanIssueName1', 'PhanIssueName2']] can be manually added if needed.
|
||||
// (directory_suppressions will currently be ignored by subsequent calls to --save-baseline, but may be preserved in future Phan releases)
|
||||
];
|
||||
662
dev/tools/phan/config.php
Normal file
662
dev/tools/phan/config.php
Normal file
|
|
@ -0,0 +1,662 @@
|
|||
<?php
|
||||
/* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*/
|
||||
define('DOL_PROJECT_ROOT', __DIR__.'/../../..');
|
||||
define('DOL_DOCUMENT_ROOT', DOL_PROJECT_ROOT.'/htdocs');
|
||||
define('PHAN_DIR', __DIR__);
|
||||
$sanitizeRegex
|
||||
= '/^(array:)?(?:'.implode(
|
||||
'|',
|
||||
array(
|
||||
// Documented:
|
||||
'none',
|
||||
'array',
|
||||
'int',
|
||||
'intcomma',
|
||||
'alpha',
|
||||
'alphawithlgt',
|
||||
'alphanohtml',
|
||||
'MS',
|
||||
'aZ',
|
||||
'aZ09',
|
||||
'aZ09arobase',
|
||||
'aZ09comma',
|
||||
'san_alpha',
|
||||
'restricthtml',
|
||||
'nohtml',
|
||||
'custom',
|
||||
// Not documented:
|
||||
'email',
|
||||
'restricthtmlallowclass',
|
||||
'restricthtmlallowunvalid',
|
||||
'restricthtmlnolink',
|
||||
//'ascii',
|
||||
//'categ_id',
|
||||
//'chaine',
|
||||
|
||||
//'html',
|
||||
//'boolean',
|
||||
//'double',
|
||||
//'float',
|
||||
//'string',
|
||||
)
|
||||
).')*$/';
|
||||
|
||||
/**
|
||||
* Map deprecated module names to new module names
|
||||
*/
|
||||
$DEPRECATED_MODULE_MAPPING = array(
|
||||
'actioncomm' => 'agenda',
|
||||
'adherent' => 'member',
|
||||
'adherent_type' => 'member_type',
|
||||
'banque' => 'bank',
|
||||
'categorie' => 'category',
|
||||
'commande' => 'order',
|
||||
'contrat' => 'contract',
|
||||
'entrepot' => 'stock',
|
||||
'expedition' => 'shipping',
|
||||
'facture' => 'invoice',
|
||||
'ficheinter' => 'intervention',
|
||||
'product_fournisseur_price' => 'productsupplierprice',
|
||||
'product_price' => 'productprice',
|
||||
'projet' => 'project',
|
||||
'propale' => 'propal',
|
||||
'socpeople' => 'contact',
|
||||
);
|
||||
|
||||
/**
|
||||
* Map module names to the 'class' name (the class is: mod<CLASSNAME>)
|
||||
* Value is null when the module is not internal to the default
|
||||
* Dolibarr setup.
|
||||
*/
|
||||
$VALID_MODULE_MAPPING = array(
|
||||
'accounting' => 'Accounting',
|
||||
'agenda' => 'Agenda',
|
||||
'ai' => 'Ai',
|
||||
'anothermodule' => null,
|
||||
'api' => 'Api',
|
||||
'asset' => 'Asset',
|
||||
'bank' => 'Banque',
|
||||
'barcode' => 'Barcode',
|
||||
'blockedlog' => 'BlockedLog',
|
||||
'bom' => 'Bom',
|
||||
'bookcal' => 'BookCal',
|
||||
'bookmark' => 'Bookmark',
|
||||
'cashdesk' => null, // TODO: fill in proper class
|
||||
'category' => 'Categorie',
|
||||
'clicktodial' => 'ClickToDial',
|
||||
'collab' => 'Collab',
|
||||
'comptabilite' => 'Comptabilite',
|
||||
'contact' => null, // TODO: fill in proper class
|
||||
'contract' => 'Contrat',
|
||||
'cron' => 'Cron',
|
||||
'datapolicy' => 'DataPolicy',
|
||||
'dav' => 'Dav',
|
||||
'debugbar' => 'DebugBar',
|
||||
'shipping' => 'Expedition',
|
||||
'deplacement' => 'Deplacement',
|
||||
"documentgeneration" => 'DocumentGeneration',
|
||||
'don' => 'Don',
|
||||
'dynamicprices' => 'DynamicPrices',
|
||||
'ecm' => 'ECM',
|
||||
'ecotax' => null, // TODO: External module ?
|
||||
'emailcollector' => 'EmailCollector',
|
||||
'eventorganization' => 'EventOrganization',
|
||||
'expensereport' => 'ExpenseReport',
|
||||
'export' => 'Export',
|
||||
'externalrss' => 'ExternalRss',
|
||||
'externalsite' => 'ExternalSite',
|
||||
'fckeditor' => 'Fckeditor',
|
||||
'fournisseur' => 'Fournisseur',
|
||||
'ftp' => 'FTP',
|
||||
'geoipmaxmind' => 'GeoIPMaxmind',
|
||||
'google' => null, // External ?
|
||||
'gravatar' => 'Gravatar',
|
||||
'holiday' => 'Holiday',
|
||||
'hrm' => 'HRM',
|
||||
'import' => 'Import',
|
||||
'incoterm' => 'Incoterm',
|
||||
'intervention' => 'Ficheinter',
|
||||
'intracommreport' => 'Intracommreport',
|
||||
'invoice' => 'Facture',
|
||||
'knowledgemanagement' => 'KnowledgeManagement',
|
||||
'label' => 'Label',
|
||||
'ldap' => 'Ldap',
|
||||
'loan' => 'Loan',
|
||||
'mailing' => 'Mailing',
|
||||
'mailman' => null, // Same module as mailmanspip -> MailmanSpip ??
|
||||
'mailmanspip' => 'MailmanSpip',
|
||||
'margin' => 'Margin',
|
||||
'member' => 'Adherent',
|
||||
'memcached' => null, // TODO: External module?
|
||||
'modulebuilder' => 'ModuleBuilder',
|
||||
'mrp' => 'Mrp',
|
||||
'multicompany' => null, // Not provided by default, no module tests
|
||||
'multicurrency' => 'MultiCurrency',
|
||||
'mymodule' => null, // modMyModule - Name used in module builder (avoid false positives)
|
||||
'notification' => 'Notification',
|
||||
'numberwords' => null, // Not provided by default, no module tests
|
||||
'oauth' => 'Oauth',
|
||||
'openstreetmap' => null, // External module?
|
||||
'opensurvey' => 'OpenSurvey',
|
||||
'order' => 'Commande',
|
||||
'partnership' => 'Partnership',
|
||||
'paybox' => 'Paybox',
|
||||
'paymentbybanktransfer' => 'PaymentByBankTransfer',
|
||||
'paypal' => 'Paypal',
|
||||
'paypalplus' => null,
|
||||
'prelevement' => 'Prelevement',
|
||||
'printing' => 'Printing',
|
||||
'product' => 'Product',
|
||||
'productbatch' => 'ProductBatch',
|
||||
'productprice' => null,
|
||||
'productsupplierprice' => null,
|
||||
'project' => 'Projet',
|
||||
'propal' => 'Propale',
|
||||
'receiptprinter' => 'ReceiptPrinter',
|
||||
'reception' => 'Reception',
|
||||
'recruitment' => 'Recruitment',
|
||||
'resource' => 'Resource',
|
||||
'salaries' => 'Salaries',
|
||||
'service' => 'Service',
|
||||
'socialnetworks' => 'SocialNetworks',
|
||||
'societe' => 'Societe',
|
||||
'stock' => 'Stock',
|
||||
'stocktransfer' => 'StockTransfer',
|
||||
'stripe' => 'Stripe',
|
||||
'supplier_invoice' => null, // Special case, uses invoice
|
||||
'supplier_order' => null, // Special case, uses invoice
|
||||
'supplier_proposal' => 'SupplierProposal',
|
||||
'syslog' => 'Syslog',
|
||||
'takepos' => 'TakePos',
|
||||
'tax' => 'Tax',
|
||||
'theme_datacolor' => 'array{0:array{0:int,1:int,2:int},1:array{0:int,1:int,2:int},2:array{0:int,1:int,2:int},3:array{0:int,1:int,2:int}}',
|
||||
'ticket' => 'Ticket',
|
||||
'user' => 'User',
|
||||
'variants' => 'Variants',
|
||||
'webhook' => 'Webhook',
|
||||
'webportal' => 'WebPortal',
|
||||
'webservices' => 'WebServices',
|
||||
'webservicesclient' => 'WebServicesClient',
|
||||
'website' => 'Website',
|
||||
'workflow' => 'Workflow',
|
||||
'workstation' => 'Workstation',
|
||||
'zapier' => 'Zapier',
|
||||
);
|
||||
|
||||
// From ExtraFields class
|
||||
$EXTRAFIELDS_TYPE2LABEL = array(
|
||||
'varchar' => 'String1Line',
|
||||
'text' => 'TextLongNLines',
|
||||
'html' => 'HtmlText',
|
||||
'int' => 'Int',
|
||||
'double' => 'Float',
|
||||
'date' => 'Date',
|
||||
'datetime' => 'DateAndTime',
|
||||
//'datetimegmt'=>'DateAndTimeUTC',
|
||||
'boolean' => 'Boolean', // Remove as test
|
||||
'price' => 'ExtrafieldPrice',
|
||||
'pricecy' => 'ExtrafieldPriceWithCurrency',
|
||||
'phone' => 'ExtrafieldPhone',
|
||||
'mail' => 'ExtrafieldMail',
|
||||
'url' => 'ExtrafieldUrl',
|
||||
'ip' => 'ExtrafieldIP',
|
||||
'icon' => 'Icon',
|
||||
'password' => 'ExtrafieldPassword',
|
||||
'select' => 'ExtrafieldSelect',
|
||||
'sellist' => 'ExtrafieldSelectList',
|
||||
'radio' => 'ExtrafieldRadio',
|
||||
'checkbox' => 'ExtrafieldCheckBox',
|
||||
'chkbxlst' => 'ExtrafieldCheckBoxFromList',
|
||||
'link' => 'ExtrafieldLink',
|
||||
'separate' => 'ExtrafieldSeparator',
|
||||
);
|
||||
|
||||
|
||||
$moduleNameRegex = '/^(?:'.implode('|', array_merge(array_keys($DEPRECATED_MODULE_MAPPING), array_keys($VALID_MODULE_MAPPING), array('\$modulename'))).')$/';
|
||||
$deprecatedModuleNameRegex = '/^(?!(?:'.implode('|', array_keys($DEPRECATED_MODULE_MAPPING)).')$).*/';
|
||||
|
||||
$extraFieldTypeRegex = '/^(?:'.implode('|', array_keys($EXTRAFIELDS_TYPE2LABEL)).')$/';
|
||||
|
||||
/**
|
||||
* This configuration will be read and overlaid on top of the
|
||||
* default configuration. Command line arguments will be applied
|
||||
* after this file is read.
|
||||
*/
|
||||
return [
|
||||
// 'processes' => 6,
|
||||
'backward_compatibility_checks' => false,
|
||||
'simplify_ast' => true,
|
||||
'analyzed_file_extensions' => ['php','inc'],
|
||||
'globals_type_map' => [
|
||||
'action' => 'string',
|
||||
'actioncode' => 'string',
|
||||
'badgeStatus0' => 'string',
|
||||
'badgeStatus1' => 'string',
|
||||
'badgeStatus11' => 'string',
|
||||
'badgeStatus3' => 'string',
|
||||
'badgeStatus4' => 'string',
|
||||
'badgeStatus6' => 'string',
|
||||
'badgeStatus8' => 'string',
|
||||
'badgeStatus9' => 'string',
|
||||
'classname' => 'string',
|
||||
'conf' => '\Conf',
|
||||
'conffile' => 'string',
|
||||
'conffiletoshow' => 'string',
|
||||
'conffiletoshowshort' => 'string',
|
||||
'dateSelector' => 'int<0,1>',
|
||||
'db' => '\DoliDB',
|
||||
'disableedit' => 'int<0,1>',
|
||||
'disablemove' => 'int<0,1>',
|
||||
'disableremove' => 'int<0,1>',
|
||||
'dolibarr_main_authentication' => 'string',
|
||||
'dolibarr_main_data_root' => 'string',
|
||||
'dolibarr_main_data_root' => 'string',
|
||||
'dolibarr_main_db_encrypted_pass' => 'string',
|
||||
'dolibarr_main_db_host' => 'string',
|
||||
'dolibarr_main_db_pass' => 'string',
|
||||
'dolibarr_main_demo' => 'string',
|
||||
'dolibarr_main_document_root' => 'string',
|
||||
'dolibarr_main_url_root' => 'string',
|
||||
'errormsg' => 'string',
|
||||
'extrafields' => '\ExtraFields',
|
||||
'filter' => 'string',
|
||||
'filtert' => 'int',
|
||||
'forceall' => 'int<0,1>',
|
||||
'form' => '\Form',
|
||||
'hookmanager' => '\HookManager',
|
||||
'inputalsopricewithtax' => 'int<0,1>',
|
||||
'langs' => '\Translate',
|
||||
'leftmenu' => 'string',
|
||||
'mainmenu' => 'string',
|
||||
'menumanager' => 'string',
|
||||
'mysoc' => '\Societe',
|
||||
'nblines' => '\int',
|
||||
'obj' => '\CommonObject', // Deprecated
|
||||
'object_rights' => 'int|stdClass',
|
||||
'objectoffield' => '\CommonObject',
|
||||
'senderissupplier' => 'int<0,1,2>',
|
||||
'user' => '\User',
|
||||
'website' => 'string', // See discussion https://github.com/Dolibarr/dolibarr/pull/28891#issuecomment-2002268334 // Disable because Phan infers Website type
|
||||
'websitepage' => '\WebSitePage',
|
||||
'websitepagefile' => 'string',
|
||||
// 'object' => '\CommonObject', // Deprecated, not enabled because conflicts with $object assignments
|
||||
],
|
||||
|
||||
// Supported values: `'5.6'`, `'7.0'`, `'7.1'`, `'7.2'`, `'7.3'`, `'7.4'`, `null`.
|
||||
// If this is set to `null`,
|
||||
// then Phan assumes the PHP version which is closest to the minor version
|
||||
// of the php executable used to execute Phan.
|
||||
//"target_php_version" => null,
|
||||
"target_php_version" => '8.2',
|
||||
//"target_php_version" => '7.3',
|
||||
//"target_php_version" => '5.6',
|
||||
|
||||
// A list of directories that should be parsed for class and
|
||||
// method information. After excluding the directories
|
||||
// defined in exclude_analysis_directory_list, the remaining
|
||||
// files will be statically analyzed for errors.
|
||||
//
|
||||
// Thus, both first-party and third-party code being used by
|
||||
// your application should be included in this list.
|
||||
'directory_list' => [
|
||||
'htdocs',
|
||||
PHAN_DIR . '/stubs/',
|
||||
],
|
||||
|
||||
// A directory list that defines files that will be excluded
|
||||
// from static analysis, but whose class and method
|
||||
// information should be included.
|
||||
//
|
||||
// Generally, you'll want to include the directories for
|
||||
// third-party code (such as "vendor/") in this list.
|
||||
//
|
||||
// n.b.: If you'd like to parse but not analyze 3rd
|
||||
// party code, directories containing that code
|
||||
// should be added to the `directory_list` as
|
||||
// to `exclude_analysis_directory_list`.
|
||||
"exclude_analysis_directory_list" => [
|
||||
'htdocs/includes/',
|
||||
'htdocs/install/doctemplates/websites/',
|
||||
'htdocs/core/class/lessc.class.php', // External library
|
||||
PHAN_DIR . '/stubs/',
|
||||
],
|
||||
//'exclude_file_regex' => '@^vendor/.*/(tests?|Tests?)/@',
|
||||
'exclude_file_regex' => '@^(' // @phpstan-ignore-line
|
||||
.'dummy' // @phpstan-ignore-line
|
||||
.'|htdocs/.*/canvas/.*/tpl/.*.tpl.php' // @phpstan-ignore-line
|
||||
.'|htdocs/modulebuilder/template/.*' // @phpstan-ignore-line
|
||||
// Included as stub (old version + incompatible typing hints)
|
||||
.'|htdocs/includes/restler/.*' // @phpstan-ignore-line
|
||||
// Included as stub (did not seem properly analysed by phan without it)
|
||||
.'|htdocs/includes/stripe/.*' // @phpstan-ignore-line
|
||||
.'|htdocs/conf/conf.php' // @phpstan-ignore-line
|
||||
// .'|htdocs/[^h].*/.*' // For testing @phpstan-ignore-line
|
||||
.')@', // @phpstan-ignore-line
|
||||
|
||||
// A list of plugin files to execute.
|
||||
// Plugins which are bundled with Phan can be added here by providing their name
|
||||
// (e.g. 'AlwaysReturnPlugin')
|
||||
//
|
||||
// Documentation about available bundled plugins can be found
|
||||
// at https://github.com/phan/phan/tree/master/.phan/plugins
|
||||
//
|
||||
// Alternately, you can pass in the full path to a PHP file
|
||||
// with the plugin's implementation (e.g. 'vendor/phan/phan/.phan/plugins/AlwaysReturnPlugin.php')
|
||||
'ParamMatchRegexPlugin' => [
|
||||
'/^GETPOST$/' => [1, $sanitizeRegex, 'GetPostUnknownSanitizeType'],
|
||||
'/^isModEnabled$/' => [0, $moduleNameRegex, 'UnknownModuleName'],
|
||||
// Note: trick to have different key for same regex:
|
||||
'/^isModEnable[d]$/' => [0, $deprecatedModuleNameRegex, "DeprecatedModuleName"],
|
||||
'/^sanitizeVal$/' => [1, $sanitizeRegex,"UnknownSanitizeType"],
|
||||
'/^\\\\ExtraFields::addExtraField$/' => [2, $extraFieldTypeRegex,"UnknownExtrafieldTypeBack"],
|
||||
],
|
||||
'plugins' => [
|
||||
__DIR__.'/plugins/NoVarDumpPlugin.php',
|
||||
__DIR__.'/plugins/ParamMatchRegexPlugin.php',
|
||||
// checks if a function, closure or method unconditionally returns.
|
||||
// can also be written as 'vendor/phan/phan/.phan/plugins/AlwaysReturnPlugin.php'
|
||||
'DeprecateAliasPlugin',
|
||||
//'EmptyMethodAndFunctionPlugin',
|
||||
'InvalidVariableIssetPlugin',
|
||||
//'MoreSpecificElementTypePlugin',
|
||||
'NoAssertPlugin',
|
||||
'NotFullyQualifiedUsagePlugin',
|
||||
//'PHPDocRedundantPlugin',
|
||||
'PHPUnitNotDeadCodePlugin',
|
||||
//'PossiblyStaticMethodPlugin',
|
||||
'PreferNamespaceUsePlugin',
|
||||
'PrintfCheckerPlugin',
|
||||
'RedundantAssignmentPlugin',
|
||||
|
||||
'ConstantVariablePlugin', // Warns about values that are actually constant
|
||||
//'HasPHPDocPlugin', // Requires PHPDoc
|
||||
// 'InlineHTMLPlugin', // html in PHP file, or at end of file
|
||||
//'NonBoolBranchPlugin', // Requires test on bool, nont on ints
|
||||
//'NonBoolInLogicalArithPlugin',
|
||||
'NumericalComparisonPlugin',
|
||||
//'PHPDocToRealTypesPlugin',
|
||||
'PHPDocInWrongCommentPlugin', // Missing /** (/* was used)
|
||||
//'ShortArrayPlugin', // Checks that [] is used
|
||||
//'StrictLiteralComparisonPlugin',
|
||||
'UnknownClassElementAccessPlugin',
|
||||
'UnknownElementTypePlugin',
|
||||
'WhitespacePlugin',
|
||||
//'RemoveDebugStatementPlugin', // Reports echo, print, ...
|
||||
//'SimplifyExpressionPlugin',
|
||||
//'StrictComparisonPlugin', // Expects ===
|
||||
'SuspiciousParamOrderPlugin',
|
||||
'UnsafeCodePlugin',
|
||||
//'UnusedSuppressionPlugin',
|
||||
|
||||
'AlwaysReturnPlugin',
|
||||
//'DollarDollarPlugin',
|
||||
'DuplicateArrayKeyPlugin',
|
||||
'DuplicateExpressionPlugin',
|
||||
'PregRegexCheckerPlugin',
|
||||
'PrintfCheckerPlugin',
|
||||
'SleepCheckerPlugin',
|
||||
// Checks for syntactically unreachable statements in
|
||||
// the global scope or function bodies.
|
||||
'UnreachableCodePlugin',
|
||||
'UseReturnValuePlugin',
|
||||
'EmptyStatementListPlugin',
|
||||
'LoopVariableReusePlugin',
|
||||
],
|
||||
|
||||
// Add any issue types (such as 'PhanUndeclaredMethod')
|
||||
// here to inhibit them from being reported
|
||||
'suppress_issue_types' => [
|
||||
// Dolibarr uses a lot of internal deprecated stuff, not reporting
|
||||
'PhanDeprecatedProperty',
|
||||
// 'PhanDeprecatedFunction',
|
||||
//'PhanCompatibleNegativeStringOffset',
|
||||
// 'PhanPluginDuplicateExpressionAssignment',
|
||||
// Nulls are likely mostly false positives
|
||||
'PhanPluginConstantVariableNull',
|
||||
'PhanTypeObjectUnsetDeclaredProperty',
|
||||
// 'PhanPluginComparisonNotStrictForScalar',
|
||||
'PhanPluginNonBoolBranch',
|
||||
'PhanPluginShortArray',
|
||||
'PhanPluginNumericalComparison',
|
||||
'PhanPluginUnknownObjectMethodCall',
|
||||
'PhanPluginNonBoolInLogicalArith',
|
||||
// Fixers From PHPDocToRealTypesPlugin:
|
||||
'PhanPluginCanUseParamType', // Fixer - Report/Add types in the function definition (function abc(string $var) (adds string)
|
||||
'PhanPluginCanUseReturnType', // Fixer - Report/Add return types in the function definition (function abc(string $var) (adds string)
|
||||
'PhanPluginCanUseNullableParamType', // Fixer - Report/Add nullable parameter types in the function definition
|
||||
'PhanPluginCanUseNullableReturnType', // Fixer - Report/Add nullable return types in the function definition
|
||||
|
||||
// 'PhanPluginNotFullyQualifiedFunctionCall',
|
||||
'PhanPluginConstantVariableScalar',
|
||||
// 'PhanPluginNoCommentOnPublicProperty',
|
||||
'PhanPluginUnknownPropertyType',
|
||||
// 'PhanPluginUnknownMethodParamType',
|
||||
// 'PhanPluginNotFullyQualifiedOptimizableFunctionCall',
|
||||
// 'PhanPluginUnknownMethodReturnType',
|
||||
'PhanPluginUnknownArrayMethodParamType',
|
||||
'PhanPluginWhitespaceTab', // Dolibarr uses tabs
|
||||
// 'PhanPluginWhitespaceTrailing',
|
||||
// 'PhanPluginCanUsePHP71Void',
|
||||
'PhanPluginUnknownArrayMethodReturnType',
|
||||
'PhanTypeMismatchArgumentInternal',
|
||||
'PhanPluginDuplicateAdjacentStatement',
|
||||
'PhanTypeInvalidLeftOperandOfNumericOp',
|
||||
'PhanTypeMismatchProperty',
|
||||
// 'PhanPluginNoCommentOnPublicMethod',
|
||||
'PhanRedefinedClassReference',
|
||||
// 'PhanPluginNoCommentOnClass',
|
||||
// 'PhanPluginNotFullyQualifiedGlobalConstant',
|
||||
// 'PhanTypeMismatchDefault',
|
||||
// 'PhanPluginPHPDocHashComment',
|
||||
'PhanPluginShortArrayList',
|
||||
'PhanPluginUnknownArrayPropertyType',
|
||||
'PhanTypeInvalidDimOffset',
|
||||
// 'PhanPluginNoCommentOnProtectedProperty',
|
||||
// 'PhanPluginDescriptionlessCommentOnPublicMethod',
|
||||
// 'PhanPluginUnknownClosureParamType',
|
||||
// 'PhanPluginUnknownClosureReturnType',
|
||||
// 'PhanPluginNoCommentOnProtectedMethod',
|
||||
// 'PhanTypeArraySuspicious',
|
||||
// 'PhanTypeMismatchPropertyProbablyReal',
|
||||
// 'PhanPluginNoCommentOnPrivateMethod',
|
||||
'PhanPluginUnknownArrayFunctionReturnType',
|
||||
'PhanTypeInvalidLeftOperandOfAdd',
|
||||
// 'PhanPluginNoCommentOnPrivateProperty',
|
||||
// 'PhanPluginNoCommentOnFunction',
|
||||
'PhanPluginUnknownArrayFunctionParamType',
|
||||
// 'PhanPluginDescriptionlessCommentOnPublicProperty',
|
||||
// 'PhanPluginUnknownFunctionParamType', // Finds certain errors in PHPdoc typing
|
||||
// 'PhanTypeSuspiciousStringExpression',
|
||||
// 'PhanPluginRedundantAssignment',
|
||||
|
||||
'PhanTypeExpectedObjectPropAccess',
|
||||
'PhanTypeInvalidRightOperandOfNumericOp',
|
||||
// 'PhanPluginInlineHTML',
|
||||
// 'PhanPluginInlineHTMLTrailing',
|
||||
// 'PhanPluginUnknownFunctionReturnType',
|
||||
// 'PhanPluginDescriptionlessCommentOnProtectedProperty',
|
||||
'PhanPluginRedundantAssignmentInGlobalScope',
|
||||
// 'PhanTypeMismatchDeclaredParamNullable',
|
||||
'PhanTypeInvalidRightOperandOfAdd',
|
||||
// 'PhanPluginDescriptionlessCommentOnPrivateProperty',
|
||||
// 'PhanUndeclaredVariableDim', // Array initialisation on undeclared var: $abc['x']='ab'
|
||||
'PhanTypeInvalidPropertyName',
|
||||
'PhanPluginDuplicateCatchStatementBody',
|
||||
'PhanPluginUndeclaredVariableIsset',
|
||||
// 'PhanTypeInvalidUnaryOperandIncOrDec',
|
||||
// 'PhanPluginDescriptionlessCommentOnClass',
|
||||
'PhanPluginEmptyStatementIf',
|
||||
// 'PhanUndeclaredStaticMethod',
|
||||
// 'PhanPluginDescriptionlessCommentOnPrivateMethod',
|
||||
// 'PhanPluginPrintfIncompatibleArgumentType',
|
||||
'PhanPossiblyNullTypeMismatchProperty',
|
||||
'PhanRedefineClass',
|
||||
'PhanRedefineFunction',
|
||||
'PhanTypeInvalidLeftOperandOfBitwiseOp',
|
||||
// 'PhanTypeMismatchDimAssignment',
|
||||
// 'PhanPluginDescriptionlessCommentOnProtectedMethod',
|
||||
// 'PhanPluginPrintfIncompatibleArgumentTypeWeak',
|
||||
// 'PhanUndeclaredVariableAssignOp',
|
||||
// 'PhanTypeExpectedObjectOrClassName',
|
||||
'PhanEmptyFQSENInClasslike',
|
||||
// 'PhanTypeMismatchArgumentInternalReal',
|
||||
// 'PhanUnextractableAnnotationElementName',
|
||||
// 'PhanCommentParamWithoutRealParam',
|
||||
// 'PhanRedefinedExtendedClass',
|
||||
'PhanTypeComparisonFromArray',
|
||||
'PhanPluginConstantVariableBool',
|
||||
// 'PhanPluginPrintfVariableFormatString',
|
||||
'PhanTypeMismatchDimFetch',
|
||||
'PhanTypeMismatchDimFetchNullable',
|
||||
'PhanTypeSuspiciousNonTraversableForeach',
|
||||
'PhanEmptyForeach',
|
||||
'PhanTypeInvalidRightOperandOfBitwiseOp',
|
||||
// 'PhanPluginDuplicateConditionalUnnecessary',
|
||||
// 'PhanTraitParentReference',
|
||||
'PhanPluginBothLiteralsBinaryOp',
|
||||
// 'PhanTypeMismatchDeclaredParam',
|
||||
// 'PhanCommentDuplicateMagicMethod',
|
||||
// 'PhanParamSpecial1',
|
||||
// 'PhanPluginInlineHTMLLeading',
|
||||
// 'PhanPluginUseReturnValueInternalKnown',
|
||||
// 'PhanRedefinedInheritedInterface',
|
||||
// 'PhanTypeComparisonToArray',
|
||||
'PhanTypeConversionFromArray',
|
||||
// 'PhanTypeInvalidLeftOperandOfIntegerOp',
|
||||
// 'PhanTypeMismatchArgumentInternalProbablyReal',
|
||||
// 'PhanTypeMismatchBitwiseBinaryOperands',
|
||||
'PhanTypeMismatchDimEmpty',
|
||||
// 'PhanTypeSuspiciousEcho',
|
||||
// 'PhanNoopBinaryOperator',
|
||||
// 'PhanTypeInvalidBitwiseBinaryOperator',
|
||||
// 'PhanPluginDescriptionlessCommentOnFunction',
|
||||
// 'PhanPluginPHPDocInWrongComment',
|
||||
'PhanRedefineClassInternal',
|
||||
// 'PhanTypeInvalidThrowsIsInterface',
|
||||
// 'PhanPluginRedundantAssignmentInLoop',
|
||||
// 'PhanInvalidCommentForDeclarationType',
|
||||
// 'PhanParamSignatureMismatchInternal',
|
||||
// 'PhanParamSignatureMismatch',
|
||||
// 'PhanPluginEmptyStatementForeachLoop',
|
||||
// 'PhanCompatibleDimAlternativeSyntax',
|
||||
'PhanInvalidFQSENInClasslike',
|
||||
// 'PhanMismatchVariadicComment',
|
||||
// 'PhanNoopConstant',
|
||||
// 'PhanPluginUnknownArrayClosureParamType',
|
||||
// 'PhanTypeInstantiateAbstractStatic',
|
||||
'PhanEmptyForeachBody',
|
||||
// 'PhanPluginEmptyStatementWhileLoop',
|
||||
// 'PhanSyntaxReturnValueInVoid',
|
||||
// 'PhanTypeInstantiateTraitStaticOrSelf',
|
||||
// 'PhanUndeclaredInvokeInCallable',
|
||||
// 'PhanNoopProperty',
|
||||
// 'PhanNoopVariable',
|
||||
// 'PhanPluginPrintfUnusedArgument',
|
||||
// 'PhanSyntaxReturnExpectedValue',
|
||||
// 'PhanAccessClassInternal',
|
||||
// 'PhanCompatibleAccessMethodOnTraitDefinition',
|
||||
// 'PhanNoopSwitchCases',
|
||||
// 'PhanNoopTernary',
|
||||
// 'PhanNoopUnaryOperator',
|
||||
// 'PhanParamNameIndicatingUnusedInClosure',
|
||||
// 'PhanParamSignatureRealMismatchTooFewParametersInternal',
|
||||
// 'PhanPluginEmptyStatementSwitch',
|
||||
'PhanPossiblyUnsetPropertyOfThis',
|
||||
// 'PhanTypeInvalidLeftOperand',
|
||||
// 'PhanTypeInvalidRightOperand',
|
||||
// 'PhanTypeInvalidRightOperandOfIntegerOp',
|
||||
'PhanTypeMismatchArgumentReal',
|
||||
// 'PhanTypeMismatchDeclaredReturnNullable',
|
||||
|
||||
// 'PhanUndeclaredThis',
|
||||
// 'PhanPluginMixedKeyNoKey',
|
||||
'PhanPluginDuplicateConditionalNullCoalescing', // Suggests to optimize to ??
|
||||
//'PhanUnreferencedClosure', // False positives seen with closures in arrays, TODO: move closure checks closer to what is done by unused variable plugin
|
||||
//'PhanPluginNoCommentOnProtectedMethod',
|
||||
//'PhanPluginDescriptionlessCommentOnProtectedMethod',
|
||||
//'PhanPluginNoCommentOnPrivateMethod',
|
||||
//'PhanPluginDescriptionlessCommentOnPrivateMethod',
|
||||
//'PhanPluginDescriptionlessCommentOnPrivateProperty',
|
||||
// TODO: Fix edge cases in --automatic-fix for PhanPluginRedundantClosureComment
|
||||
//'PhanPluginRedundantClosureComment',
|
||||
// 'PhanPluginPossiblyStaticPublicMethod',
|
||||
//'PhanPluginPossiblyStaticProtectedMethod',
|
||||
|
||||
// The types of ast\Node->children are all possibly unset.
|
||||
'PhanTypePossiblyInvalidDimOffset', // Also checks optional array keys and requires that they are checked for existence.
|
||||
'PhanUndeclaredGlobalVariable',
|
||||
'PhanUndeclaredProperty',
|
||||
// 'PhanPluginPrintfNotPercent', // Detects fishy stuff with '%' format and suggests %%
|
||||
'PhanPossiblyUndeclaredGlobalVariable',
|
||||
// 'PhanPluginPossiblyStaticProtectedMethod',
|
||||
// 'PhanTypeMismatchReturn',
|
||||
// 'PhanPluginMoreSpecificActualReturnType',
|
||||
// 'PhanTypeMismatchReturnProbablyReal',
|
||||
'PhanPossiblyUndeclaredVariable',
|
||||
'PhanTypeMismatchArgument',
|
||||
// 'PhanPluginUnreachableCode',
|
||||
// 'PhanTypeMismatchArgumentInternal',
|
||||
// 'PhanPluginAlwaysReturnMethod',
|
||||
'PhanUndeclaredClassMethod',
|
||||
'PhanUndeclaredMethod',
|
||||
'PhanTypeMismatchArgumentProbablyReal',
|
||||
'PhanPluginDuplicateExpressionAssignmentOperation', // Suggestions for optimisation
|
||||
// 'PhanTypeMismatchPropertyDefault',
|
||||
// 'PhanPluginAlwaysReturnMethod',
|
||||
// 'PhanPluginMissingReturnMethod',
|
||||
// 'PhanUndeclaredTypeReturnType',
|
||||
'PhanUndeclaredClassProperty',
|
||||
'PhanTypeArraySuspiciousNullable',
|
||||
// 'PhanPluginInconsistentReturnMethod',
|
||||
'PhanTypeExpectedObjectPropAccessButGotNull',
|
||||
// 'PhanUndeclaredClassAttribute',
|
||||
'PhanNonClassMethodCall',
|
||||
// 'PhanPluginNoAssert',
|
||||
// 'PhanTypeMismatchReturnSuperType',
|
||||
'PhanTypeMismatchArgumentSuperType',
|
||||
'PhanPluginDuplicateConditionalTernaryDuplication',
|
||||
],
|
||||
// You can put relative paths to internal stubs in this config option.
|
||||
// Phan will continue using its detailed type annotations,
|
||||
// but load the constants, classes, functions, and classes (and their Reflection types)
|
||||
// from these stub files (doubling as valid php files).
|
||||
// Use a different extension from php (and preferably a separate folder)
|
||||
// to avoid accidentally parsing these as PHP (includes projects depending on this).
|
||||
// The 'mkstubs' script can be used to generate your own stubs (compatible with php 7.0+ right now)
|
||||
// Note: The array key must be the same as the extension name reported by `php -m`,
|
||||
// so that phan can skip loading the stubs if the extension is actually available.
|
||||
'autoload_internal_extension_signatures' => [
|
||||
// Stubs may be available at https://github.com/JetBrains/phpstorm-stubs/tree/master
|
||||
|
||||
// Xdebug stubs are bundled with Phan 0.10.1+/0.8.9+ for usage,
|
||||
// because Phan disables xdebug by default.
|
||||
//'xdebug' => 'vendor/phan/phan/.phan/internal_stubs/xdebug.phan_php',
|
||||
//'memcached' => PHAN_DIR . '/your_internal_stubs_folder_name/memcached.phan_php',
|
||||
//'PDO' => PHAN_DIR . '/stubs/PDO.phan_php',
|
||||
'brotli' => PHAN_DIR . '/stubs/brotli.phan_php',
|
||||
'curl' => PHAN_DIR . '/stubs/curl.phan_php',
|
||||
'calendar' => PHAN_DIR . '/stubs/calendar.phan_php',
|
||||
'fileinfo' => PHAN_DIR . '/stubs/fileinfo.phan_php',
|
||||
'ftp' => PHAN_DIR . '/stubs/ftp.phan_php',
|
||||
'gd' => PHAN_DIR . '/stubs/gd.phan_php',
|
||||
'geoip' => PHAN_DIR . '/stubs/geoip.phan_php',
|
||||
'imap' => PHAN_DIR . '/stubs/imap.phan_php',
|
||||
'intl' => PHAN_DIR . '/stubs/intl.phan_php',
|
||||
'ldap' => PHAN_DIR . '/stubs/ldap.phan_php',
|
||||
'mcrypt' => PHAN_DIR . '/stubs/mcrypt.phan_php',
|
||||
'memcache' => PHAN_DIR . '/stubs/memcache.phan_php',
|
||||
'mysqli' => PHAN_DIR . '/stubs/mysqli.phan_php',
|
||||
'pdo_cubrid' => PHAN_DIR . '/stubs/pdo_cubrid.phan_php',
|
||||
'pdo_mysql' => PHAN_DIR . '/stubs/pdo_mysql.phan_php',
|
||||
'pdo_pgsql' => PHAN_DIR . '/stubs/pdo_pgsql.phan_php',
|
||||
'pdo_sqlite' => PHAN_DIR . '/stubs/pdo_sqlite.phan_php',
|
||||
'pgsql' => PHAN_DIR . '/stubs/pgsql.phan_php',
|
||||
'session' => PHAN_DIR . '/stubs/session.phan_php',
|
||||
'simplexml' => PHAN_DIR . '/stubs/SimpleXML.phan_php',
|
||||
'soap' => PHAN_DIR . '/stubs/soap.phan_php',
|
||||
'sockets' => PHAN_DIR . '/stubs/sockets.phan_php',
|
||||
'zip' => PHAN_DIR . '/stubs/zip.phan_php',
|
||||
],
|
||||
];
|
||||
417
dev/tools/phan/config_extended.php
Normal file
417
dev/tools/phan/config_extended.php
Normal file
|
|
@ -0,0 +1,417 @@
|
|||
<?php
|
||||
/* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*/
|
||||
define('DOL_PROJECT_ROOT', __DIR__.'/../../..');
|
||||
define('DOL_DOCUMENT_ROOT', DOL_PROJECT_ROOT.'/htdocs');
|
||||
define('PHAN_DIR', __DIR__);
|
||||
$sanitizeRegex
|
||||
= '/^(array:)?(?:'.implode(
|
||||
'|',
|
||||
array(
|
||||
// Documented:
|
||||
'none',
|
||||
'array',
|
||||
'int',
|
||||
'intcomma',
|
||||
'alpha',
|
||||
'alphawithlgt',
|
||||
'alphanohtml',
|
||||
'MS',
|
||||
'aZ',
|
||||
'aZ09',
|
||||
'aZ09arobase',
|
||||
'aZ09comma',
|
||||
'san_alpha',
|
||||
'restricthtml',
|
||||
'nohtml',
|
||||
'custom',
|
||||
// Not documented:
|
||||
'email',
|
||||
'restricthtmlallowclass',
|
||||
'restricthtmlallowunvalid',
|
||||
'restricthtmlnolink',
|
||||
//'ascii',
|
||||
//'categ_id',
|
||||
//'chaine',
|
||||
|
||||
//'html',
|
||||
//'boolean',
|
||||
//'double',
|
||||
//'float',
|
||||
//'string',
|
||||
)
|
||||
).')*$/';
|
||||
|
||||
/**
|
||||
* Map deprecated module names to new module names
|
||||
*/
|
||||
$DEPRECATED_MODULE_MAPPING = array(
|
||||
'actioncomm' => 'agenda',
|
||||
'adherent' => 'member',
|
||||
'adherent_type' => 'member_type',
|
||||
'banque' => 'bank',
|
||||
'categorie' => 'category',
|
||||
'commande' => 'order',
|
||||
'contrat' => 'contract',
|
||||
'entrepot' => 'stock',
|
||||
'expedition' => 'shipping',
|
||||
'facture' => 'invoice',
|
||||
'ficheinter' => 'intervention',
|
||||
'product_fournisseur_price' => 'productsupplierprice',
|
||||
'product_price' => 'productprice',
|
||||
'projet' => 'project',
|
||||
'propale' => 'propal',
|
||||
'socpeople' => 'contact',
|
||||
);
|
||||
|
||||
/**
|
||||
* Map module names to the 'class' name (the class is: mod<CLASSNAME>)
|
||||
* Value is null when the module is not internal to the default
|
||||
* Dolibarr setup.
|
||||
*/
|
||||
$VALID_MODULE_MAPPING = array(
|
||||
'accounting' => 'Accounting',
|
||||
'agenda' => 'Agenda',
|
||||
'ai' => 'Ai',
|
||||
'anothermodule' => null,
|
||||
'api' => 'Api',
|
||||
'asset' => 'Asset',
|
||||
'bank' => 'Banque',
|
||||
'barcode' => 'Barcode',
|
||||
'blockedlog' => 'BlockedLog',
|
||||
'bom' => 'Bom',
|
||||
'bookcal' => 'BookCal',
|
||||
'bookmark' => 'Bookmark',
|
||||
'cashdesk' => null, // TODO: fill in proper class
|
||||
'category' => 'Categorie',
|
||||
'clicktodial' => 'ClickToDial',
|
||||
'collab' => 'Collab',
|
||||
'comptabilite' => 'Comptabilite',
|
||||
'contact' => null, // TODO: fill in proper class
|
||||
'contract' => 'Contrat',
|
||||
'cron' => 'Cron',
|
||||
'datapolicy' => 'DataPolicy',
|
||||
'dav' => 'Dav',
|
||||
'debugbar' => 'DebugBar',
|
||||
'shipping' => 'Expedition',
|
||||
'deplacement' => 'Deplacement',
|
||||
"documentgeneration" => 'DocumentGeneration',
|
||||
'don' => 'Don',
|
||||
'dynamicprices' => 'DynamicPrices',
|
||||
'ecm' => 'ECM',
|
||||
'ecotax' => null, // TODO: External module ?
|
||||
'emailcollector' => 'EmailCollector',
|
||||
'eventorganization' => 'EventOrganization',
|
||||
'expensereport' => 'ExpenseReport',
|
||||
'export' => 'Export',
|
||||
'externalrss' => 'ExternalRss',
|
||||
'externalsite' => 'ExternalSite',
|
||||
'fckeditor' => 'Fckeditor',
|
||||
'fournisseur' => 'Fournisseur',
|
||||
'ftp' => 'FTP',
|
||||
'geoipmaxmind' => 'GeoIPMaxmind',
|
||||
'google' => null, // External ?
|
||||
'gravatar' => 'Gravatar',
|
||||
'holiday' => 'Holiday',
|
||||
'hrm' => 'HRM',
|
||||
'import' => 'Import',
|
||||
'incoterm' => 'Incoterm',
|
||||
'intervention' => 'Ficheinter',
|
||||
'intracommreport' => 'Intracommreport',
|
||||
'invoice' => 'Facture',
|
||||
'knowledgemanagement' => 'KnowledgeManagement',
|
||||
'label' => 'Label',
|
||||
'ldap' => 'Ldap',
|
||||
'loan' => 'Loan',
|
||||
'mailing' => 'Mailing',
|
||||
'mailman' => null, // Same module as mailmanspip -> MailmanSpip ??
|
||||
'mailmanspip' => 'MailmanSpip',
|
||||
'margin' => 'Margin',
|
||||
'member' => 'Adherent',
|
||||
'memcached' => null, // TODO: External module?
|
||||
'modulebuilder' => 'ModuleBuilder',
|
||||
'mrp' => 'Mrp',
|
||||
'multicompany' => null, // Not provided by default, no module tests
|
||||
'multicurrency' => 'MultiCurrency',
|
||||
'mymodule' => null, // modMyModule - Name used in module builder (avoid false positives)
|
||||
'notification' => 'Notification',
|
||||
'numberwords' => null, // Not provided by default, no module tests
|
||||
'oauth' => 'Oauth',
|
||||
'openstreetmap' => null, // External module?
|
||||
'opensurvey' => 'OpenSurvey',
|
||||
'order' => 'Commande',
|
||||
'partnership' => 'Partnership',
|
||||
'paybox' => 'Paybox',
|
||||
'paymentbybanktransfer' => 'PaymentByBankTransfer',
|
||||
'paypal' => 'Paypal',
|
||||
'paypalplus' => null,
|
||||
'prelevement' => 'Prelevement',
|
||||
'printing' => 'Printing',
|
||||
'product' => 'Product',
|
||||
'productbatch' => 'ProductBatch',
|
||||
'productprice' => null,
|
||||
'productsupplierprice' => null,
|
||||
'project' => 'Projet',
|
||||
'propal' => 'Propale',
|
||||
'receiptprinter' => 'ReceiptPrinter',
|
||||
'reception' => 'Reception',
|
||||
'recruitment' => 'Recruitment',
|
||||
'resource' => 'Resource',
|
||||
'salaries' => 'Salaries',
|
||||
'service' => 'Service',
|
||||
'socialnetworks' => 'SocialNetworks',
|
||||
'societe' => 'Societe',
|
||||
'stock' => 'Stock',
|
||||
'stocktransfer' => 'StockTransfer',
|
||||
'stripe' => 'Stripe',
|
||||
'supplier_invoice' => null, // Special case, uses invoice
|
||||
'supplier_order' => null, // Special case, uses invoice
|
||||
'supplier_proposal' => 'SupplierProposal',
|
||||
'syslog' => 'Syslog',
|
||||
'takepos' => 'TakePos',
|
||||
'tax' => 'Tax',
|
||||
'theme_datacolor' => 'array{0:array{0:int,1:int,2:int},1:array{0:int,1:int,2:int},2:array{0:int,1:int,2:int},3:array{0:int,1:int,2:int}}',
|
||||
'ticket' => 'Ticket',
|
||||
'user' => 'User',
|
||||
'variants' => 'Variants',
|
||||
'webhook' => 'Webhook',
|
||||
'webportal' => 'WebPortal',
|
||||
'webservices' => 'WebServices',
|
||||
'webservicesclient' => 'WebServicesClient',
|
||||
'website' => 'Website',
|
||||
'workflow' => 'Workflow',
|
||||
'workstation' => 'Workstation',
|
||||
'zapier' => 'Zapier',
|
||||
);
|
||||
|
||||
$moduleNameRegex = '/^(?:'.implode('|', array_merge(array_keys($DEPRECATED_MODULE_MAPPING), array_keys($VALID_MODULE_MAPPING))).')$/';
|
||||
|
||||
$deprecatedModuleNameRegex = '/^(?!(?:'.implode('|', array_keys($DEPRECATED_MODULE_MAPPING)).')$).*/';
|
||||
|
||||
/**
|
||||
* This configuration will be read and overlaid on top of the
|
||||
* default configuration. Command line arguments will be applied
|
||||
* after this file is read.
|
||||
*/
|
||||
return [
|
||||
// 'processes' => 6,
|
||||
'backward_compatibility_checks' => false,
|
||||
'simplify_ast' => true,
|
||||
'analyzed_file_extensions' => ['php','inc'],
|
||||
'globals_type_map' => [
|
||||
'conf' => '\Conf',
|
||||
'db' => '\DoliDB',
|
||||
'extrafields' => '\ExtraFields',
|
||||
'hookmanager' => '\HookManager',
|
||||
'langs' => '\Translate',
|
||||
'mysoc' => '\Societe',
|
||||
'nblines' => '\int',
|
||||
'user' => '\User',
|
||||
'dolibarr_main_data_root' => 'string',
|
||||
'dolibarr_main_authentication' => 'string',
|
||||
'dolibarr_main_demo' => 'string',
|
||||
'menumanager' => 'string',
|
||||
'errormsg' => 'string',
|
||||
'form' => '\Form',
|
||||
'object_rights' => 'int|stdClass',
|
||||
'disableedit' => 'int<0,1>',
|
||||
'disablemove' => 'int<0,1>',
|
||||
'disableremove' => 'int<0,1>',
|
||||
// Found in dol_eval
|
||||
'website' => 'string', // See discussion https://github.com/Dolibarr/dolibarr/pull/28891#issuecomment-2002268334 // Disable because Phan infers Website type
|
||||
'websitepage' => '\WebSitePage',
|
||||
'websitepagefile' => 'string',
|
||||
'action' => 'string',
|
||||
'mainmenu' => 'string',
|
||||
'leftmenu' => 'string',
|
||||
'objectoffield' => '\CommonObject',
|
||||
// 'object' => '\CommonObject', // Deprecated, not enabled because conflicts with $object assignments
|
||||
'obj' => '\CommonObject', // Deprecated
|
||||
],
|
||||
|
||||
// Supported values: `'5.6'`, `'7.0'`, `'7.1'`, `'7.2'`, `'7.3'`, `'7.4'`, `null`.
|
||||
// If this is set to `null`,
|
||||
// then Phan assumes the PHP version which is closest to the minor version
|
||||
// of the php executable used to execute Phan.
|
||||
//"target_php_version" => null,
|
||||
"target_php_version" => '8.2',
|
||||
//"target_php_version" => '7.3',
|
||||
//"target_php_version" => '5.6',
|
||||
|
||||
// A list of directories that should be parsed for class and
|
||||
// method information. After excluding the directories
|
||||
// defined in exclude_analysis_directory_list, the remaining
|
||||
// files will be statically analyzed for errors.
|
||||
//
|
||||
// Thus, both first-party and third-party code being used by
|
||||
// your application should be included in this list.
|
||||
'directory_list' => [
|
||||
'htdocs',
|
||||
PHAN_DIR . '/stubs/',
|
||||
],
|
||||
|
||||
// A directory list that defines files that will be excluded
|
||||
// from static analysis, but whose class and method
|
||||
// information should be included.
|
||||
//
|
||||
// Generally, you'll want to include the directories for
|
||||
// third-party code (such as "vendor/") in this list.
|
||||
//
|
||||
// n.b.: If you'd like to parse but not analyze 3rd
|
||||
// party code, directories containing that code
|
||||
// should be added to the `directory_list` as
|
||||
// to `exclude_analysis_directory_list`.
|
||||
"exclude_analysis_directory_list" => [
|
||||
'htdocs/includes/',
|
||||
'htdocs/install/doctemplates/websites/',
|
||||
'htdocs/core/class/lessc.class.php', // External library
|
||||
PHAN_DIR . '/stubs/',
|
||||
],
|
||||
//'exclude_file_regex' => '@^vendor/.*/(tests?|Tests?)/@',
|
||||
'exclude_file_regex' => '@^(' // @phpstan-ignore-line
|
||||
.'dummy' // @phpstan-ignore-line
|
||||
.'|htdocs/.*/canvas/.*/tpl/.*.tpl.php' // @phpstan-ignore-line
|
||||
.'|htdocs/modulebuilder/template/.*' // @phpstan-ignore-line
|
||||
// Included as stub (old version + incompatible typing hints)
|
||||
.'|htdocs/includes/restler/.*' // @phpstan-ignore-line
|
||||
// Included as stub (did not seem properly analysed by phan without it)
|
||||
.'|htdocs/includes/stripe/.*' // @phpstan-ignore-line
|
||||
.'|htdocs/conf/conf.php' // @phpstan-ignore-line
|
||||
.')@', // @phpstan-ignore-line
|
||||
|
||||
// A list of plugin files to execute.
|
||||
// Plugins which are bundled with Phan can be added here by providing their name
|
||||
// (e.g. 'AlwaysReturnPlugin')
|
||||
//
|
||||
// Documentation about available bundled plugins can be found
|
||||
// at https://github.com/phan/phan/tree/master/.phan/plugins
|
||||
//
|
||||
// Alternately, you can pass in the full path to a PHP file
|
||||
// with the plugin's implementation (e.g. 'vendor/phan/phan/.phan/plugins/AlwaysReturnPlugin.php')
|
||||
'ParamMatchRegexPlugin' => [
|
||||
'/^GETPOST$/' => [1, $sanitizeRegex, 'GetPostUnknownSanitizeType'],
|
||||
'/^isModEnabled$/' => [0, $moduleNameRegex, 'UnknownModuleName'],
|
||||
// Note: trick to have different key for same regex:
|
||||
'/^isModEnable[d]$/' => [0, $deprecatedModuleNameRegex, "DeprecatedModuleName"],
|
||||
'/^sanitizeVal$/' => [1, $sanitizeRegex,"UnknownSanitizeType"],
|
||||
],
|
||||
'plugins' => [
|
||||
__DIR__.'/plugins/NoVarDumpPlugin.php',
|
||||
__DIR__.'/plugins/ParamMatchRegexPlugin.php',
|
||||
'DeprecateAliasPlugin',
|
||||
//'EmptyMethodAndFunctionPlugin',
|
||||
'InvalidVariableIssetPlugin',
|
||||
//'MoreSpecificElementTypePlugin',
|
||||
'NoAssertPlugin',
|
||||
'NotFullyQualifiedUsagePlugin',
|
||||
'PHPDocRedundantPlugin',
|
||||
'PHPUnitNotDeadCodePlugin',
|
||||
//'PossiblyStaticMethodPlugin',
|
||||
'PreferNamespaceUsePlugin',
|
||||
'PrintfCheckerPlugin',
|
||||
'RedundantAssignmentPlugin',
|
||||
|
||||
'ConstantVariablePlugin', // Warns about values that are actually constant
|
||||
//'HasPHPDocPlugin', // Requires PHPDoc
|
||||
'InlineHTMLPlugin', // html in PHP file, or at end of file
|
||||
'NonBoolBranchPlugin', // Requires test on bool, nont on ints
|
||||
'NonBoolInLogicalArithPlugin',
|
||||
'NumericalComparisonPlugin',
|
||||
// 'PHPDocToRealTypesPlugin', // Report/Add types to function definitions
|
||||
'PHPDocInWrongCommentPlugin', // Missing /** (/* was used)
|
||||
//'ShortArrayPlugin', // Checks that [] is used
|
||||
//'StrictLiteralComparisonPlugin',
|
||||
'UnknownClassElementAccessPlugin',
|
||||
'UnknownElementTypePlugin',
|
||||
'WhitespacePlugin',
|
||||
//'RemoveDebugStatementPlugin', // Reports echo, print, ...
|
||||
'SimplifyExpressionPlugin',
|
||||
//'StrictComparisonPlugin', // Expects ===
|
||||
'SuspiciousParamOrderPlugin',
|
||||
'UnsafeCodePlugin',
|
||||
//'UnusedSuppressionPlugin',
|
||||
|
||||
'AlwaysReturnPlugin',
|
||||
//'DollarDollarPlugin',
|
||||
'DuplicateArrayKeyPlugin',
|
||||
'DuplicateExpressionPlugin',
|
||||
'PregRegexCheckerPlugin',
|
||||
'PrintfCheckerPlugin',
|
||||
'SleepCheckerPlugin',
|
||||
// Checks for syntactically unreachable statements in
|
||||
// the global scope or function bodies.
|
||||
'UnreachableCodePlugin',
|
||||
'UseReturnValuePlugin',
|
||||
'EmptyStatementListPlugin',
|
||||
'LoopVariableReusePlugin',
|
||||
],
|
||||
|
||||
// Add any issue types (such as 'PhanUndeclaredMethod')
|
||||
// here to inhibit them from being reported
|
||||
'suppress_issue_types' => [
|
||||
'PhanCompatibleNegativeStringOffset', // return false positive
|
||||
|
||||
'PhanPluginWhitespaceTab', // Dolibarr used tabs
|
||||
'PhanPluginCanUsePHP71Void', // Dolibarr is maintaining 7.0 compatibility
|
||||
'PhanPluginShortArray', // Dolibarr uses array()
|
||||
'PhanPluginShortArrayList', // Dolibarr uses array()
|
||||
// Fixers From PHPDocToRealTypesPlugin:
|
||||
'PhanPluginCanUseParamType', // Fixer - Report/Add types in the function definition (function abc(string $var) (adds string)
|
||||
'PhanPluginCanUseReturnType', // Fixer - Report/Add return types in the function definition (function abc(string $var) (adds string)
|
||||
'PhanPluginCanUseNullableParamType', // Fixer - Report/Add nullable parameter types in the function definition
|
||||
'PhanPluginCanUseNullableReturnType', // Fixer - Report/Add nullable return types in the function definition
|
||||
|
||||
'PhanPluginNonBoolBranch', // Not essential - 31240+ occurrences
|
||||
'PhanPluginNumericalComparison', // Not essential - 19870+ occurrences
|
||||
'PhanTypeMismatchArgument', // Not essential - 12300+ occurrences
|
||||
'PhanPluginNonBoolInLogicalArith', // Not essential - 11040+ occurrences
|
||||
'PhanPluginConstantVariableScalar', // Not essential - 5180+ occurrences
|
||||
'PhanPluginDuplicateAdjacentStatement',
|
||||
'PhanPluginDuplicateConditionalTernaryDuplication', // 2750+ occurrences
|
||||
'PhanPluginDuplicateConditionalNullCoalescing', // Not essential - 990+ occurrences
|
||||
'PhanPluginRedundantAssignmentInGlobalScope', // Not essential, a lot of false warning
|
||||
'PhanPluginDuplicateCatchStatementBody', // Requires PHP7.1 - 50+ occurrences
|
||||
],
|
||||
// You can put relative paths to internal stubs in this config option.
|
||||
// Phan will continue using its detailed type annotations,
|
||||
// but load the constants, classes, functions, and classes (and their Reflection types)
|
||||
// from these stub files (doubling as valid php files).
|
||||
// Use a different extension from php (and preferably a separate folder)
|
||||
// to avoid accidentally parsing these as PHP (includes projects depending on this).
|
||||
// The 'mkstubs' script can be used to generate your own stubs (compatible with php 7.0+ right now)
|
||||
// Note: The array key must be the same as the extension name reported by `php -m`,
|
||||
// so that phan can skip loading the stubs if the extension is actually available.
|
||||
'autoload_internal_extension_signatures' => [
|
||||
// Stubs may be available at https://github.com/JetBrains/phpstorm-stubs/tree/master
|
||||
|
||||
// Xdebug stubs are bundled with Phan 0.10.1+/0.8.9+ for usage,
|
||||
// because Phan disables xdebug by default.
|
||||
//'xdebug' => 'vendor/phan/phan/.phan/internal_stubs/xdebug.phan_php',
|
||||
//'memcached' => PHAN_DIR . '/your_internal_stubs_folder_name/memcached.phan_php',
|
||||
//'PDO' => PHAN_DIR . '/stubs/PDO.phan_php',
|
||||
'brotli' => PHAN_DIR . '/stubs/brotli.phan_php',
|
||||
'curl' => PHAN_DIR . '/stubs/curl.phan_php',
|
||||
'calendar' => PHAN_DIR . '/stubs/calendar.phan_php',
|
||||
'fileinfo' => PHAN_DIR . '/stubs/fileinfo.phan_php',
|
||||
'ftp' => PHAN_DIR . '/stubs/ftp.phan_php',
|
||||
'gd' => PHAN_DIR . '/stubs/gd.phan_php',
|
||||
'geoip' => PHAN_DIR . '/stubs/geoip.phan_php',
|
||||
'imap' => PHAN_DIR . '/stubs/imap.phan_php',
|
||||
'intl' => PHAN_DIR . '/stubs/intl.phan_php',
|
||||
'ldap' => PHAN_DIR . '/stubs/ldap.phan_php',
|
||||
'mcrypt' => PHAN_DIR . '/stubs/mcrypt.phan_php',
|
||||
'memcache' => PHAN_DIR . '/stubs/memcache.phan_php',
|
||||
'mysqli' => PHAN_DIR . '/stubs/mysqli.phan_php',
|
||||
'pdo_cubrid' => PHAN_DIR . '/stubs/pdo_cubrid.phan_php',
|
||||
'pdo_mysql' => PHAN_DIR . '/stubs/pdo_mysql.phan_php',
|
||||
'pdo_pgsql' => PHAN_DIR . '/stubs/pdo_pgsql.phan_php',
|
||||
'pdo_sqlite' => PHAN_DIR . '/stubs/pdo_sqlite.phan_php',
|
||||
'pgsql' => PHAN_DIR . '/stubs/pgsql.phan_php',
|
||||
'session' => PHAN_DIR . '/stubs/session.phan_php',
|
||||
'simplexml' => PHAN_DIR . '/stubs/SimpleXML.phan_php',
|
||||
'soap' => PHAN_DIR . '/stubs/soap.phan_php',
|
||||
'sockets' => PHAN_DIR . '/stubs/sockets.phan_php',
|
||||
'zip' => PHAN_DIR . '/stubs/zip.phan_php',
|
||||
],
|
||||
|
||||
];
|
||||
248
dev/tools/phan/config_fixer.php
Normal file
248
dev/tools/phan/config_fixer.php
Normal file
|
|
@ -0,0 +1,248 @@
|
|||
<?php
|
||||
/* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*/
|
||||
|
||||
// Uncomment require_once to enable corresponding fixer
|
||||
|
||||
//require_once __DIR__.'/plugins/DeprecatedModuleNameFixer.php';
|
||||
//require_once __DIR__.'/plugins/PriceFormFixer.php';
|
||||
//require_once __DIR__.'/plugins/UrlEncodeStringifyFixer.php';
|
||||
require_once __DIR__.'/plugins/SelectDateFixer.php';
|
||||
|
||||
define('DOL_PROJECT_ROOT', __DIR__.'/../../..');
|
||||
define('DOL_DOCUMENT_ROOT', DOL_PROJECT_ROOT.'/htdocs');
|
||||
define('PHAN_DIR', __DIR__);
|
||||
|
||||
$DEPRECATED_MODULE_MAPPING = array(
|
||||
'actioncomm' => 'agenda',
|
||||
'adherent' => 'member',
|
||||
'adherent_type' => 'member_type',
|
||||
'banque' => 'bank',
|
||||
'categorie' => 'category',
|
||||
'commande' => 'order',
|
||||
'contrat' => 'contract',
|
||||
'entrepot' => 'stock',
|
||||
'expedition' => 'shipping',
|
||||
'facture' => 'invoice',
|
||||
'ficheinter' => 'intervention',
|
||||
'product_fournisseur_price' => 'productsupplierprice',
|
||||
'product_price' => 'productprice',
|
||||
'projet' => 'project',
|
||||
'propale' => 'propal',
|
||||
'socpeople' => 'contact',
|
||||
);
|
||||
|
||||
$deprecatedModuleNameRegex = '/^(?!(?:'.implode('|', array_keys($DEPRECATED_MODULE_MAPPING)).')$).*/';
|
||||
|
||||
require_once __DIR__.'/plugins/DeprecatedModuleNameFixer.php';
|
||||
|
||||
/**
|
||||
* This configuration will be read and overlaid on top of the
|
||||
* default configuration. Command line arguments will be applied
|
||||
* after this file is read.
|
||||
*/
|
||||
return [
|
||||
// 'processes' => 6,
|
||||
'backward_compatibility_checks' => false,
|
||||
'simplify_ast' => true,
|
||||
'analyzed_file_extensions' => ['php','inc'],
|
||||
'globals_type_map' => [
|
||||
'conf' => '\Conf',
|
||||
'db' => '\DoliDB',
|
||||
'extrafields' => '\ExtraFields',
|
||||
'hookmanager' => '\HookManager',
|
||||
'langs' => '\Translate',
|
||||
'mysoc' => '\Societe',
|
||||
'nblines' => '\int',
|
||||
'user' => '\User',
|
||||
],
|
||||
|
||||
// Supported values: `'5.6'`, `'7.0'`, `'7.1'`, `'7.2'`, `'7.3'`, `'7.4'`, `null`.
|
||||
// If this is set to `null`,
|
||||
// then Phan assumes the PHP version which is closest to the minor version
|
||||
// of the php executable used to execute Phan.
|
||||
//"target_php_version" => null,
|
||||
"target_php_version" => '8.2',
|
||||
//"target_php_version" => '7.3',
|
||||
//"target_php_version" => '5.6',
|
||||
|
||||
// A list of directories that should be parsed for class and
|
||||
// method information. After excluding the directories
|
||||
// defined in exclude_analysis_directory_list, the remaining
|
||||
// files will be statically analyzed for errors.
|
||||
//
|
||||
// Thus, both first-party and third-party code being used by
|
||||
// your application should be included in this list.
|
||||
'directory_list' => [
|
||||
'htdocs',
|
||||
PHAN_DIR . '/stubs/',
|
||||
],
|
||||
|
||||
// A directory list that defines files that will be excluded
|
||||
// from static analysis, but whose class and method
|
||||
// information should be included.
|
||||
//
|
||||
// Generally, you'll want to include the directories for
|
||||
// third-party code (such as "vendor/") in this list.
|
||||
//
|
||||
// n.b.: If you'd like to parse but not analyze 3rd
|
||||
// party code, directories containing that code
|
||||
// should be added to the `directory_list` as
|
||||
// to `exclude_analysis_directory_list`.
|
||||
"exclude_analysis_directory_list" => [
|
||||
'htdocs/includes/',
|
||||
'htdocs/install/doctemplates/websites/',
|
||||
'htdocs/core/class/lessc.class.php', // External library
|
||||
PHAN_DIR . '/stubs/',
|
||||
],
|
||||
//'exclude_file_regex' => '@^vendor/.*/(tests?|Tests?)/@',
|
||||
'exclude_file_regex' => '@^(' // @phpstan-ignore-line
|
||||
.'dummy' // @phpstan-ignore-line
|
||||
.'|htdocs/.*/canvas/.*/tpl/.*.tpl.php' // @phpstan-ignore-line
|
||||
.'|htdocs/modulebuilder/template/.*' // @phpstan-ignore-line
|
||||
// Included as stub (old version + incompatible typing hints)
|
||||
.'|htdocs/includes/restler/.*' // @phpstan-ignore-line
|
||||
// Included as stub (did not seem properly analysed by phan without it)
|
||||
.'|htdocs/includes/stripe/.*' // @phpstan-ignore-line
|
||||
.'|htdocs/conf/conf.php' // @phpstan-ignore-line
|
||||
//.'|htdocs/[^c][^o][^r][^e][^/].*' // For testing @phpstan-ignore-line
|
||||
//.'|htdocs/[^h].*' // For testing on restricted set @phpstan-ignore-line
|
||||
.')@', // @phpstan-ignore-line
|
||||
|
||||
// A list of plugin files to execute.
|
||||
// Plugins which are bundled with Phan can be added here by providing their name
|
||||
// (e.g. 'AlwaysReturnPlugin')
|
||||
//
|
||||
// Documentation about available bundled plugins can be found
|
||||
// at https://github.com/phan/phan/tree/master/.phan/plugins
|
||||
//
|
||||
// Alternately, you can pass in the full path to a PHP file
|
||||
// with the plugin's implementation (e.g. 'vendor/phan/phan/.phan/plugins/AlwaysReturnPlugin.php')
|
||||
'ParamMatchRegexPlugin' => [
|
||||
'/^isModEnabled$/' => [0, $deprecatedModuleNameRegex, "DeprecatedModuleName"],
|
||||
],
|
||||
'plugins' => [
|
||||
__DIR__.'/plugins/ParamMatchRegexPlugin.php',
|
||||
'DeprecateAliasPlugin',
|
||||
// __DIR__.'/plugins/NoVarDumpPlugin.php',
|
||||
//__DIR__.'/plugins/GetPostFixerPlugin.php',
|
||||
//'PHPDocToRealTypesPlugin',
|
||||
|
||||
/*
|
||||
//'EmptyMethodAndFunctionPlugin',
|
||||
'InvalidVariableIssetPlugin',
|
||||
//'MoreSpecificElementTypePlugin',
|
||||
'NoAssertPlugin',
|
||||
'NotFullyQualifiedUsagePlugin',
|
||||
'PHPDocRedundantPlugin',
|
||||
'PHPUnitNotDeadCodePlugin',
|
||||
//'PossiblyStaticMethodPlugin',
|
||||
'PreferNamespaceUsePlugin',
|
||||
'PrintfCheckerPlugin',
|
||||
'RedundantAssignmentPlugin',
|
||||
|
||||
'ConstantVariablePlugin', // Warns about values that are actually constant
|
||||
//'HasPHPDocPlugin', // Requires PHPDoc
|
||||
'InlineHTMLPlugin', // html in PHP file, or at end of file
|
||||
'NonBoolBranchPlugin', // Requires test on bool, nont on ints
|
||||
'NonBoolInLogicalArithPlugin',
|
||||
'NumericalComparisonPlugin',
|
||||
'PHPDocToRealTypesPlugin',
|
||||
'PHPDocInWrongCommentPlugin', // Missing /** (/* was used)
|
||||
//'ShortArrayPlugin', // Checks that [] is used
|
||||
//'StrictLiteralComparisonPlugin',
|
||||
'UnknownClassElementAccessPlugin',
|
||||
'UnknownElementTypePlugin',
|
||||
'WhitespacePlugin',
|
||||
//'RemoveDebugStatementPlugin', // Reports echo, print, ...
|
||||
//'StrictComparisonPlugin', // Expects ===
|
||||
'SuspiciousParamOrderPlugin',
|
||||
'UnsafeCodePlugin',
|
||||
//'UnusedSuppressionPlugin',
|
||||
|
||||
'AlwaysReturnPlugin',
|
||||
//'DollarDollarPlugin',
|
||||
'DuplicateArrayKeyPlugin',
|
||||
'DuplicateExpressionPlugin',
|
||||
'PregRegexCheckerPlugin',
|
||||
'PrintfCheckerPlugin',
|
||||
'SleepCheckerPlugin',
|
||||
// Checks for syntactically unreachable statements in
|
||||
// the global scope or function bodies.
|
||||
'UnreachableCodePlugin',
|
||||
'UseReturnValuePlugin',
|
||||
'EmptyStatementListPlugin',
|
||||
'LoopVariableReusePlugin',
|
||||
*/
|
||||
],
|
||||
|
||||
// Add any issue types (such as 'PhanUndeclaredMethod')
|
||||
// here to inhibit them from being reported
|
||||
'suppress_issue_types' => [
|
||||
'PhanCompatibleNegativeStringOffset', // return false positive
|
||||
|
||||
'PhanPluginWhitespaceTab', // Dolibarr used tabs
|
||||
'PhanPluginCanUsePHP71Void', // Dolibarr is maintaining 7.0 compatibility
|
||||
'PhanPluginShortArray', // Dolibarr uses array()
|
||||
'PhanPluginShortArrayList', // Dolibarr uses array()
|
||||
// The following may require that --quick is not used
|
||||
// Fixers From PHPDocToRealTypesPlugin:
|
||||
'PhanPluginCanUseParamType', // Fixer - Report/Add types in the function definition (function abc(string $var) (adds string)
|
||||
'PhanPluginCanUseReturnType', // Fixer - Report/Add return types in the function definition (function abc(string $var) (adds string)
|
||||
'PhanPluginCanUseNullableParamType', // Fixer - Report/Add nullable parameter types in the function definition
|
||||
'PhanPluginCanUseNullableReturnType', // Fixer - Report/Add nullable return types in the function definition
|
||||
|
||||
'PhanPluginNonBoolBranch', // Not essential - 31240+ occurrences
|
||||
'PhanPluginNumericalComparison', // Not essential - 19870+ occurrences
|
||||
'PhanTypeMismatchArgument', // Not essential - 12300+ occurrences
|
||||
'PhanPluginNonBoolInLogicalArith', // Not essential - 11040+ occurrences
|
||||
'PhanPluginConstantVariableScalar', // Not essential - 5180+ occurrences
|
||||
'PhanPluginDuplicateAdjacentStatement',
|
||||
'PhanPluginDuplicateConditionalTernaryDuplication', // 2750+ occurrences
|
||||
'PhanPluginDuplicateConditionalNullCoalescing', // Not essential - 990+ occurrences
|
||||
'PhanPluginRedundantAssignmentInGlobalScope', // Not essential, a lot of false warning
|
||||
],
|
||||
// You can put relative paths to internal stubs in this config option.
|
||||
// Phan will continue using its detailed type annotations,
|
||||
// but load the constants, classes, functions, and classes (and their Reflection types)
|
||||
// from these stub files (doubling as valid php files).
|
||||
// Use a different extension from php (and preferably a separate folder)
|
||||
// to avoid accidentally parsing these as PHP (includes projects depending on this).
|
||||
// The 'mkstubs' script can be used to generate your own stubs (compatible with php 7.0+ right now)
|
||||
// Note: The array key must be the same as the extension name reported by `php -m`,
|
||||
// so that phan can skip loading the stubs if the extension is actually available.
|
||||
'autoload_internal_extension_signatures' => [
|
||||
// Stubs may be available at https://github.com/JetBrains/phpstorm-stubs/tree/master
|
||||
|
||||
// Xdebug stubs are bundled with Phan 0.10.1+/0.8.9+ for usage,
|
||||
// because Phan disables xdebug by default.
|
||||
//'xdebug' => 'vendor/phan/phan/.phan/internal_stubs/xdebug.phan_php',
|
||||
//'memcached' => PHAN_DIR . '/your_internal_stubs_folder_name/memcached.phan_php',
|
||||
//'PDO' => PHAN_DIR . '/stubs/PDO.phan_php',
|
||||
'brotli' => PHAN_DIR . '/stubs/brotli.phan_php',
|
||||
'curl' => PHAN_DIR . '/stubs/curl.phan_php',
|
||||
'calendar' => PHAN_DIR . '/stubs/calendar.phan_php',
|
||||
'fileinfo' => PHAN_DIR . '/stubs/fileinfo.phan_php',
|
||||
'ftp' => PHAN_DIR . '/stubs/ftp.phan_php',
|
||||
'gd' => PHAN_DIR . '/stubs/gd.phan_php',
|
||||
'geoip' => PHAN_DIR . '/stubs/geoip.phan_php',
|
||||
'imap' => PHAN_DIR . '/stubs/imap.phan_php',
|
||||
'intl' => PHAN_DIR . '/stubs/intl.phan_php',
|
||||
'ldap' => PHAN_DIR . '/stubs/ldap.phan_php',
|
||||
'mcrypt' => PHAN_DIR . '/stubs/mcrypt.phan_php',
|
||||
'memcache' => PHAN_DIR . '/stubs/memcache.phan_php',
|
||||
'mysqli' => PHAN_DIR . '/stubs/mysqli.phan_php',
|
||||
'pdo_cubrid' => PHAN_DIR . '/stubs/pdo_cubrid.phan_php',
|
||||
'pdo_mysql' => PHAN_DIR . '/stubs/pdo_mysql.phan_php',
|
||||
'pdo_pgsql' => PHAN_DIR . '/stubs/pdo_pgsql.phan_php',
|
||||
'pdo_sqlite' => PHAN_DIR . '/stubs/pdo_sqlite.phan_php',
|
||||
'pgsql' => PHAN_DIR . '/stubs/pgsql.phan_php',
|
||||
'session' => PHAN_DIR . '/stubs/session.phan_php',
|
||||
'simplexml' => PHAN_DIR . '/stubs/SimpleXML.phan_php',
|
||||
'soap' => PHAN_DIR . '/stubs/soap.phan_php',
|
||||
'sockets' => PHAN_DIR . '/stubs/sockets.phan_php',
|
||||
'zip' => PHAN_DIR . '/stubs/zip.phan_php',
|
||||
],
|
||||
|
||||
];
|
||||
124
dev/tools/phan/plugins/DeprecatedModuleNameFixer.php
Normal file
124
dev/tools/phan/plugins/DeprecatedModuleNameFixer.php
Normal file
|
|
@ -0,0 +1,124 @@
|
|||
<?php
|
||||
/* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Microsoft\PhpParser\Node\Expression\CallExpression;
|
||||
use Microsoft\PhpParser\Node\QualifiedName;
|
||||
use Phan\AST\TolerantASTConverter\NodeUtils;
|
||||
use Phan\CodeBase;
|
||||
use Phan\IssueInstance;
|
||||
use Phan\Library\FileCacheEntry;
|
||||
use Phan\Plugin\Internal\IssueFixingPlugin\FileEdit;
|
||||
use Phan\Plugin\Internal\IssueFixingPlugin\FileEditSet;
|
||||
use Phan\Plugin\Internal\IssueFixingPlugin\IssueFixer;
|
||||
use Microsoft\PhpParser\Node\Expression\ArgumentExpression;
|
||||
use Microsoft\PhpParser\Node\DelimitedList\ArgumentExpressionList;
|
||||
use Microsoft\PhpParser\Node\StringLiteral;
|
||||
|
||||
/**
|
||||
* This is a prototype, there are various features it does not implement.
|
||||
*/
|
||||
|
||||
call_user_func(static function (): void {
|
||||
/**
|
||||
* @param $code_base @unused-param
|
||||
* @return ?FileEditSet a representation of the edit to make to replace a call to a function alias with a call to the original function
|
||||
*/
|
||||
$fix = static function (CodeBase $code_base, FileCacheEntry $contents, IssueInstance $instance): ?FileEditSet {
|
||||
$DEPRECATED_MODULE_MAPPING = array(
|
||||
'actioncomm' => 'agenda',
|
||||
'adherent' => 'member',
|
||||
'adherent_type' => 'member_type',
|
||||
'banque' => 'bank',
|
||||
'categorie' => 'category',
|
||||
'commande' => 'order',
|
||||
'contrat' => 'contract',
|
||||
'entrepot' => 'stock',
|
||||
'expedition' => 'shipping',
|
||||
'facture' => 'invoice',
|
||||
'ficheinter' => 'intervention',
|
||||
'product_fournisseur_price' => 'productsupplierprice',
|
||||
'product_price' => 'productprice',
|
||||
'projet' => 'project',
|
||||
'propale' => 'propal',
|
||||
'socpeople' => 'contact',
|
||||
);
|
||||
|
||||
$line = $instance->getLine();
|
||||
$expected_name = 'isModEnabled';
|
||||
$edits = [];
|
||||
foreach ($contents->getNodesAtLine($line) as $node) {
|
||||
if (!$node instanceof ArgumentExpressionList) {
|
||||
continue;
|
||||
}
|
||||
$arguments = $node->children;
|
||||
if (count($arguments) != 1) {
|
||||
print "Arg Count is ".count($arguments)." - Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
$is_actual_call = $node->parent instanceof CallExpression;
|
||||
if (!$is_actual_call) {
|
||||
print "Not actual call - Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
$callable = $node->parent;
|
||||
|
||||
$callableExpression = $callable->callableExpression;
|
||||
|
||||
if ($callableExpression instanceof Microsoft\PhpParser\Node\QualifiedName) {
|
||||
$actual_name = $callableExpression->getResolvedName();
|
||||
} else {
|
||||
print "Callable expression is ".get_class($callableExpression)."- Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((string) $actual_name !== (string) $expected_name) {
|
||||
print "Name unexpected '$actual_name'!='$expected_name' - Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($arguments as $i => $argument) {
|
||||
print "Type$i: ".get_class($argument).PHP_EOL;
|
||||
}
|
||||
|
||||
$arg1 = $arguments[0];
|
||||
|
||||
if ($arg1 instanceof ArgumentExpression && $arg1->expression instanceof StringLiteral) {
|
||||
// Get the string value of the StringLiteral
|
||||
$stringValue = $arg1->expression->getStringContentsText();
|
||||
} else {
|
||||
print "Expression is not string ".get_class($arg1)."/".get_class($arg1->expression)."- Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
print "Fixture elem on $line - $actual_name('$stringValue') - $instance".PHP_EOL;
|
||||
|
||||
// Check that module is deprecated
|
||||
if (isset($DEPRECATED_MODULE_MAPPING[$stringValue])) {
|
||||
$replacement = $DEPRECATED_MODULE_MAPPING[$stringValue];
|
||||
} else {
|
||||
print "Module is not deprecated in $expected_name - Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Get the first argument (delimiter)
|
||||
$moduleargument = $arguments[0];
|
||||
|
||||
$arg_start_pos = $moduleargument->getStartPosition() + 1;
|
||||
$arg_end_pos = $moduleargument->getEndPosition() - 1;
|
||||
|
||||
// Remove deprecated module name
|
||||
$edits[] = new FileEdit($arg_start_pos, $arg_end_pos, $replacement);
|
||||
}
|
||||
if ($edits) {
|
||||
return new FileEditSet($edits);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
IssueFixer::registerFixerClosure(
|
||||
'DeprecatedModuleName',
|
||||
$fix
|
||||
);
|
||||
});
|
||||
81
dev/tools/phan/plugins/NoVarDumpPlugin.php
Normal file
81
dev/tools/phan/plugins/NoVarDumpPlugin.php
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
<?php
|
||||
/* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use ast\Node;
|
||||
use Phan\PluginV3;
|
||||
use Phan\PluginV3\PluginAwarePostAnalysisVisitor;
|
||||
use Phan\PluginV3\PostAnalyzeNodeCapability;
|
||||
|
||||
/**
|
||||
* NoVarDumpPlugin hooks into one event:
|
||||
*
|
||||
* - getPostAnalyzeNodeVisitorClassName
|
||||
* This method returns a visitor that is called on every AST node from every
|
||||
* file being analyzed
|
||||
*
|
||||
* A plugin file must
|
||||
*
|
||||
* - Contain a class that inherits from \Phan\PluginV3
|
||||
*
|
||||
* - End by returning an instance of that class.
|
||||
*
|
||||
* It is assumed without being checked that plugins aren't
|
||||
* mangling state within the passed code base or context.
|
||||
*
|
||||
* Note: When adding new plugins,
|
||||
* add them to the corresponding section of README.md
|
||||
*/
|
||||
class NoVarDumpPlugin extends PluginV3 implements PostAnalyzeNodeCapability
|
||||
{
|
||||
/**
|
||||
* @return string - name of PluginAwarePostAnalysisVisitor subclass
|
||||
*/
|
||||
public static function getPostAnalyzeNodeVisitorClassName(): string
|
||||
{
|
||||
return NoVarDumpVisitor::class;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* When __invoke on this class is called with a node, a method
|
||||
* will be dispatched based on the `kind` of the given node.
|
||||
*
|
||||
* Visitors such as this are useful for defining lots of different
|
||||
* checks on a node based on its kind.
|
||||
*/
|
||||
class NoVarDumpVisitor extends PluginAwarePostAnalysisVisitor
|
||||
{
|
||||
// A plugin's visitors should not override visit() unless they need to.
|
||||
|
||||
/**
|
||||
* @param Node $node A node to analyze
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @override
|
||||
*/
|
||||
public function visitCall(Node $node): void
|
||||
{
|
||||
$name = $node->children['expr']->children['name'] ?? null;
|
||||
if (!is_string($name)) {
|
||||
return;
|
||||
}
|
||||
if (strcasecmp($name, 'var_dump') !== 0) {
|
||||
return;
|
||||
}
|
||||
$this->emitPluginIssue(
|
||||
$this->code_base,
|
||||
$this->context,
|
||||
'NoVarDumpPlugin',
|
||||
'var_dump() should be commented in submitted code',
|
||||
[]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Every plugin needs to return an instance of itself at the
|
||||
// end of the file in which it's defined.
|
||||
return new NoVarDumpPlugin();
|
||||
248
dev/tools/phan/plugins/ParamMatchRegexPlugin.php
Normal file
248
dev/tools/phan/plugins/ParamMatchRegexPlugin.php
Normal file
|
|
@ -0,0 +1,248 @@
|
|||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* Phan Plugin to validate that arguments match a regex
|
||||
*
|
||||
*
|
||||
* "ParamMatchRegexPlugin" => [
|
||||
* "/^test1$/" => [ 0, "/^OK$/"], // Argument 0 must be 'OK'
|
||||
* "/^test2$/" => [ 1, "/^NOK$/", "Test2Arg1NokError"], // Argument 1 must be 'NOK', error code
|
||||
* "/^\\MyTest::mymethod$/" => [ 0, "/^NOK$/"], // Argument 0 must be 'NOK'
|
||||
* ],
|
||||
* 'plugins' => [
|
||||
* ".phan/plugins/ParamMatchRegexPlugin.php",
|
||||
* // [...]
|
||||
* ],
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
|
||||
use ast\Node;
|
||||
use Phan\Config;
|
||||
use Phan\AST\UnionTypeVisitor;
|
||||
//use Phan\Language\Element\FunctionInterface;
|
||||
use Phan\Language\UnionType;
|
||||
use Phan\Language\Type;
|
||||
use Phan\PluginV3;
|
||||
use Phan\PluginV3\PluginAwarePostAnalysisVisitor;
|
||||
use Phan\PluginV3\PostAnalyzeNodeCapability;
|
||||
use Phan\Exception\NodeException;
|
||||
use Phan\Language\FQSEN\FullyQualifiedClassName;
|
||||
use Phan\Exception\FQSENException;
|
||||
|
||||
/**
|
||||
* ParamMatchPlugin hooks into one event:
|
||||
*
|
||||
* - getPostAnalyzeNodeVisitorClassName
|
||||
* This method returns a visitor that is called on every AST node from every
|
||||
* file being analyzed
|
||||
*
|
||||
* A plugin file must
|
||||
*
|
||||
* - Contain a class that inherits from \Phan\PluginV3
|
||||
*
|
||||
* - End by returning an instance of that class.
|
||||
*
|
||||
* It is assumed without being checked that plugins aren't
|
||||
* mangling state within the passed code base or context.
|
||||
*
|
||||
* Note: When adding new plugins,
|
||||
* add them to the corresponding section of README.md
|
||||
*/
|
||||
class ParamMatchPlugin extends PluginV3 implements PostAnalyzeNodeCapability
|
||||
{
|
||||
/**
|
||||
* @return string - name of PluginAwarePostAnalysisVisitor subclass
|
||||
*/
|
||||
public static function getPostAnalyzeNodeVisitorClassName(): string
|
||||
{
|
||||
return ParamMatchVisitor::class;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* When __invoke on this class is called with a node, a method
|
||||
* will be dispatched based on the `kind` of the given node.
|
||||
*
|
||||
* Visitors such as this are useful for defining lots of different
|
||||
* checks on a node based on its kind.
|
||||
*/
|
||||
class ParamMatchVisitor extends PluginAwarePostAnalysisVisitor
|
||||
{
|
||||
// A plugin's visitors should not override visit() unless they need to.
|
||||
|
||||
/**
|
||||
* @override
|
||||
* @param Node $node Node to analyze
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function visitMethodCall(Node $node): void
|
||||
{
|
||||
$method_name = $node->children['method'] ?? null;
|
||||
if (!\is_string($method_name)) {
|
||||
return; // Not handled, TODO: handle variable(?) methods
|
||||
// throw new NodeException($node);
|
||||
}
|
||||
try {
|
||||
// Fetch the list of valid classes, and warn about any undefined classes.
|
||||
$union_type = UnionTypeVisitor::unionTypeFromNode($this->code_base, $this->context, $node->children['expr']);
|
||||
} catch (Exception $_) {
|
||||
// Phan should already throw for this
|
||||
return;
|
||||
}
|
||||
|
||||
$class_list = [];
|
||||
foreach ($union_type->getTypeSet() as $type) {
|
||||
$class_fqsen = "NoFSQENType";
|
||||
if ($type instanceof Type) {
|
||||
try {
|
||||
$class_fqsen = (string) FullyQualifiedClassName::fromFullyQualifiedString($type->getName());
|
||||
} catch (FQSENException $_) {
|
||||
// var_dump([$_, $node]);
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
// var_dump( $type) ;
|
||||
continue;
|
||||
}
|
||||
$class_name = (string) $class_fqsen;
|
||||
$class_list[] = $class_name;
|
||||
}
|
||||
|
||||
/* May need to check list of classes
|
||||
*/
|
||||
|
||||
/*
|
||||
if (!$class->hasMethodWithName($this->code_base, $method_name, true)) {
|
||||
throw new NodeException($expr, 'does not have method');
|
||||
}
|
||||
$class_name = $class->getName();
|
||||
*/
|
||||
foreach ($class_list as $class_name) {
|
||||
$this->checkRule($node, "$class_name::$method_name");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @override
|
||||
* @param Node $node Node to analyze
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function visitStaticCall(Node $node): void
|
||||
{
|
||||
$class_name = $node->children['class']->children['name'] ?? null;
|
||||
if (!\is_string($class_name)) {
|
||||
throw new NodeException($expr, 'does not have class');
|
||||
}
|
||||
try {
|
||||
$class_name = (string) FullyQualifiedClassName::fromFullyQualifiedString($class_name);
|
||||
} catch (FQSENException $_) {
|
||||
}
|
||||
$method_name = $node->children['method'] ?? null;
|
||||
|
||||
if (!\is_string($method_name)) {
|
||||
return;
|
||||
}
|
||||
$this->checkRule($node, "$class_name::$method_name");
|
||||
}
|
||||
/**
|
||||
* @override
|
||||
*
|
||||
* @param Node $node A node to analyze
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function visitCall(Node $node): void
|
||||
{
|
||||
$name = $node->children['expr']->children['name'] ?? null;
|
||||
if (!\is_string($name)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$this->checkRule($node, $name);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param Node $node A node to analyze
|
||||
* @param string $name function name or fqsn of class::<method>
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function checkRule(Node $node, string $name)
|
||||
{
|
||||
$rules = Config::getValue('ParamMatchRegexPlugin');
|
||||
foreach ($rules as $regex => $rule) {
|
||||
if (preg_match($regex, $name)) {
|
||||
$this->checkParam($node, $rule[0], $rule[1], $name, $rule[2] ?? null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check that argument matches regex at node
|
||||
*
|
||||
* @param Node $node Visited node for which to verify arguments match regex
|
||||
* @param int $argPosition Position of argument to check
|
||||
* @param string $argRegex Regex to validate against argument
|
||||
* @param string $functionName Function name for report
|
||||
* @param string $messageCode Message code to provide in message
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function checkParam(Node $node, int $argPosition, string $argRegex, $functionName, $messageCode = null): void
|
||||
{
|
||||
$args = $node->children['args']->children;
|
||||
|
||||
if (!array_key_exists($argPosition, $args)) {
|
||||
/*
|
||||
$this->emitPluginIssue(
|
||||
$this->code_base,
|
||||
$this->context,
|
||||
'ParamMatchMissingArgument',
|
||||
"Argument at %s for %s is missing",
|
||||
[$argPosition, $function_name]
|
||||
);
|
||||
*/
|
||||
return;
|
||||
}
|
||||
$expr = $args[$argPosition];
|
||||
try {
|
||||
$expr_type = UnionTypeVisitor::unionTypeFromNode($this->code_base, $this->context, $expr, false);
|
||||
} catch (Exception $_) {
|
||||
return;
|
||||
}
|
||||
|
||||
$expr_value = $expr_type->getRealUnionType()->asValueOrNullOrSelf();
|
||||
if (!is_object($expr_value)) {
|
||||
$list = [(string) $expr_value];
|
||||
} elseif ($expr_value instanceof UnionType) {
|
||||
$list = $expr_value->asScalarValues();
|
||||
} else {
|
||||
// Note: maybe more types could be supported
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($list as $argValue) {
|
||||
if (!\preg_match($argRegex, (string) $argValue)) {
|
||||
// Emit an issue if the argument does not match the expected regex pattern
|
||||
// var_dump([$node,$expr_value,$expr_type->getRealUnionType()]); // Information about node
|
||||
$this->emitPluginIssue(
|
||||
$this->code_base,
|
||||
$this->context,
|
||||
$messageCode ?? 'ParamMatchRegexError',
|
||||
"Argument {INDEX} function {FUNCTION} can have value {STRING_LITERAL} that does not match the expected pattern '{STRING_LITERAL}'",
|
||||
[$argPosition, $functionName, json_encode($argValue), $argRegex]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Every plugin needs to return an instance of itself at the
|
||||
// end of the file in which it's defined.
|
||||
return new ParamMatchPlugin();
|
||||
138
dev/tools/phan/plugins/PriceFormFixer.php
Normal file
138
dev/tools/phan/plugins/PriceFormFixer.php
Normal file
|
|
@ -0,0 +1,138 @@
|
|||
<?php
|
||||
/* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* For 'price()', replace $form parameter that is '' with 0.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use ast\flags;
|
||||
use Microsoft\PhpParser\Node\Expression\CallExpression;
|
||||
use Microsoft\PhpParser\Node\QualifiedName;
|
||||
use Phan\AST\TolerantASTConverter\NodeUtils;
|
||||
use Phan\CodeBase;
|
||||
use Phan\IssueInstance;
|
||||
use Phan\Library\FileCacheEntry;
|
||||
use Phan\Plugin\Internal\IssueFixingPlugin\FileEdit;
|
||||
use Phan\Plugin\Internal\IssueFixingPlugin\FileEditSet;
|
||||
use Phan\Plugin\Internal\IssueFixingPlugin\IssueFixer;
|
||||
use Microsoft\PhpParser\Node\Expression\ArgumentExpression;
|
||||
use Microsoft\PhpParser\Node\DelimitedList\ArgumentExpressionList;
|
||||
use Microsoft\PhpParser\Node\StringLiteral;
|
||||
use Microsoft\PhpParser\Node\ReservedWord;
|
||||
use Microsoft\PhpParser\Token;
|
||||
|
||||
/**
|
||||
* This is a prototype, there are various features it does not implement.
|
||||
*/
|
||||
|
||||
call_user_func(static function (): void {
|
||||
/**
|
||||
* @param $code_base @unused-param
|
||||
* @return ?FileEditSet a representation of the edit to make to replace a call to a function alias with a call to the original function
|
||||
*/
|
||||
$fix = static function (CodeBase $code_base, FileCacheEntry $contents, IssueInstance $instance): ?FileEditSet {
|
||||
$line = $instance->getLine();
|
||||
// print flags\TYPE_NULL;
|
||||
$expected_name = 'price';
|
||||
$edits = [];
|
||||
foreach ($contents->getNodesAtLine($line) as $node) {
|
||||
if (!$node instanceof ArgumentExpressionList) {
|
||||
continue;
|
||||
}
|
||||
$arguments = $node->children;
|
||||
if (count($arguments) < 2) {
|
||||
// print "Arg Count is ".count($arguments)." - Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
$is_actual_call = $node->parent instanceof CallExpression;
|
||||
if (!$is_actual_call) {
|
||||
print "Not actual call - Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
print "Actual call - $instance".PHP_EOL;
|
||||
$callable = $node->parent;
|
||||
|
||||
$callableExpression = $callable->callableExpression;
|
||||
|
||||
if ($callableExpression instanceof Microsoft\PhpParser\Node\QualifiedName) {
|
||||
$actual_name = $callableExpression->getResolvedName();
|
||||
} else {
|
||||
print "Callable expression is ".get_class($callableExpression)."- Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((string) $actual_name !== (string) $expected_name) {
|
||||
print "Name unexpected '$actual_name'!='$expected_name' - Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($arguments as $i => $argument) {
|
||||
if ($argument instanceof ArgumentExpression) {
|
||||
print "Type$i: ".get_class($argument->expression).PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
$stringValue = null;
|
||||
foreach ([1] as $argIdx) {
|
||||
$arg = $arguments[$argIdx * 2]; // Pair number to skip "TOKEN" (,)
|
||||
|
||||
if (
|
||||
$arg instanceof ArgumentExpression
|
||||
&& $arg->expression instanceof StringLiteral
|
||||
) {
|
||||
// Get the string value of the StringLiteral
|
||||
$stringValue = $arg->expression->getStringContentsText();
|
||||
print "String is '$stringValue'".PHP_EOL;
|
||||
} elseif ($arg instanceof ArgumentExpression && $arg->expression instanceof ReservedWord) {
|
||||
$child = $arg->expression->children;
|
||||
if (!$child instanceof Token) {
|
||||
continue;
|
||||
}
|
||||
$token_str = (new NodeUtils($contents->getContents()))->tokenToString($child);
|
||||
print "$token_str KIND:".($child->kind ?? 'no kind')." ".get_class($child).PHP_EOL;
|
||||
|
||||
if ($token_str !== 'null') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$stringValue = ''; // Fake empty
|
||||
} else {
|
||||
print "Expression is not string or null ".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($stringValue !== '') {
|
||||
print "Not replacing \$form which is '$stringValue'/".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Reached end of switch case without "continue" -> replace
|
||||
$replacement = 0;
|
||||
|
||||
print "Fixture elem on $line - $actual_name(...'$stringValue'...) - $instance".PHP_EOL;
|
||||
|
||||
// Determine replacement
|
||||
$replacement = '0';
|
||||
|
||||
// Get the first argument (delimiter)
|
||||
$argument_to_replace = $arg;
|
||||
|
||||
$arg_start_pos = $argument_to_replace->getStartPosition();
|
||||
$arg_end_pos = $argument_to_replace->getEndPosition();
|
||||
|
||||
// Remove deprecated module name
|
||||
$edits[] = new FileEdit($arg_start_pos, $arg_end_pos, $replacement);
|
||||
}
|
||||
}
|
||||
if ($edits) {
|
||||
return new FileEditSet($edits);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
IssueFixer::registerFixerClosure(
|
||||
'PhanTypeMismatchArgumentProbablyReal',
|
||||
$fix
|
||||
);
|
||||
});
|
||||
175
dev/tools/phan/plugins/SelectDateFixer.php
Normal file
175
dev/tools/phan/plugins/SelectDateFixer.php
Normal file
|
|
@ -0,0 +1,175 @@
|
|||
<?php
|
||||
/* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* For 'price()', replace $form parameter that is '' with 0.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use ast\flags;
|
||||
use Microsoft\PhpParser\Node\Expression\CallExpression;
|
||||
use Microsoft\PhpParser\Node\QualifiedName;
|
||||
use Phan\AST\TolerantASTConverter\NodeUtils;
|
||||
use Phan\CodeBase;
|
||||
use Phan\IssueInstance;
|
||||
use Phan\Library\FileCacheEntry;
|
||||
use Phan\Plugin\Internal\IssueFixingPlugin\FileEdit;
|
||||
use Phan\Plugin\Internal\IssueFixingPlugin\FileEditSet;
|
||||
use Phan\Plugin\Internal\IssueFixingPlugin\IssueFixer;
|
||||
use Microsoft\PhpParser\Node\Expression\ArgumentExpression;
|
||||
use Microsoft\PhpParser\Node\DelimitedList\ArgumentExpressionList;
|
||||
use Microsoft\PhpParser\Node\StringLiteral;
|
||||
use Microsoft\PhpParser\Node\ReservedWord;
|
||||
use Microsoft\PhpParser\Token;
|
||||
|
||||
/**
|
||||
* This is a prototype, there are various features it does not implement.
|
||||
*/
|
||||
|
||||
call_user_func(static function (): void {
|
||||
/**
|
||||
* @param $code_base @unused-param
|
||||
* @return ?FileEditSet a representation of the edit to make to replace a call to a function alias with a call to the original function
|
||||
*/
|
||||
$fix = static function (CodeBase $code_base, FileCacheEntry $contents, IssueInstance $instance): ?FileEditSet {
|
||||
|
||||
// Argument {INDEX} (${PARAMETER}) is {CODE} of type {TYPE}{DETAILS} but
|
||||
// {FUNCTIONLIKE} takes {TYPE}{DETAILS} defined at {FILE}:{LINE} (the inferred real argument type has nothing in common with the parameter's phpdoc type)
|
||||
|
||||
//htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 3 ($h) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type)
|
||||
//htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 4 ($m) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type)
|
||||
|
||||
$argument_index = (string) $instance->getTemplateParameters()[0];
|
||||
$argument_name = (string) $instance->getTemplateParameters()[1];
|
||||
$argument_code = (string) $instance->getTemplateParameters()[2];
|
||||
$argument_type = (string) $instance->getTemplateParameters()[3];
|
||||
$details = (string) $instance->getTemplateParameters()[4];
|
||||
$functionlike = (string) $instance->getTemplateParameters()[5];
|
||||
|
||||
$expected_functionlike = "\\Form::selectDate()";
|
||||
$expected_name = "selectDate";
|
||||
if ($functionlike !== $expected_functionlike) {
|
||||
print "$functionlike != '$expected_functionlike'".PHP_EOL;
|
||||
return null;
|
||||
}
|
||||
|
||||
// Check if we fix any of this
|
||||
if (
|
||||
($argument_name === 'h' && $argument_code === "''")
|
||||
|| ($argument_name === 'm' && $argument_code === "''")
|
||||
|| ($argument_name === 'empty' && $argument_code === "''")
|
||||
) {
|
||||
$replacement = '0';
|
||||
$argIdx = ($argument_index - 1) * 2;
|
||||
$expectedStringValue = "";
|
||||
} else {
|
||||
print "ARG$argument_index:$argument_name CODE:$argument_code".PHP_EOL;
|
||||
return null;
|
||||
}
|
||||
|
||||
// At this point we established that the notification
|
||||
// matches some we fix.
|
||||
|
||||
$line = $instance->getLine();
|
||||
|
||||
$edits = [];
|
||||
foreach ($contents->getNodesAtLine($line) as $node) {
|
||||
if (!$node instanceof ArgumentExpressionList) {
|
||||
continue;
|
||||
}
|
||||
$arguments = $node->children;
|
||||
if (count($arguments) <= $argIdx) {
|
||||
// print "Arg Count is ".count($arguments)." - Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
$is_actual_call = $node->parent instanceof CallExpression;
|
||||
if (!$is_actual_call) {
|
||||
// print "Not actual call - Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
print "Actual call - $instance".PHP_EOL;
|
||||
$callable = $node->parent;
|
||||
|
||||
$callableExpression = $callable->callableExpression;
|
||||
|
||||
if ($callableExpression instanceof Microsoft\PhpParser\Node\QualifiedName) {
|
||||
$actual_name = $callableExpression->getResolvedName();
|
||||
} elseif ($callableExpression instanceof Microsoft\PhpParser\Node\Expression\MemberAccessExpression) {
|
||||
$memberNameToken = $callableExpression->memberName;
|
||||
$actual_name = (new NodeUtils($contents->getContents()))->tokenToString($memberNameToken);
|
||||
} else {
|
||||
print "Callable expression is ".get_class($callableExpression)."- Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((string) $actual_name !== (string) $expected_name) {
|
||||
// print "Name unexpected '$actual_name'!='$expected_name' - Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($arguments as $i => $argument) {
|
||||
if ($argument instanceof ArgumentExpression) {
|
||||
print "Type$i: ".get_class($argument->expression).PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
$stringValue = null;
|
||||
|
||||
|
||||
$arg = $arguments[$argIdx];
|
||||
|
||||
if (
|
||||
$arg instanceof ArgumentExpression
|
||||
&& $arg->expression instanceof StringLiteral
|
||||
) {
|
||||
// Get the string value of the StringLiteral
|
||||
$stringValue = $arg->expression->getStringContentsText();
|
||||
print "String is '$stringValue'".PHP_EOL;
|
||||
} elseif ($arg instanceof ArgumentExpression && $arg->expression instanceof ReservedWord) {
|
||||
$child = $arg->expression->children;
|
||||
if (!$child instanceof Token) {
|
||||
continue;
|
||||
}
|
||||
$token_str = (new NodeUtils($contents->getContents()))->tokenToString($child);
|
||||
print "$token_str KIND:".($child->kind ?? 'no kind')." ".get_class($child).PHP_EOL;
|
||||
|
||||
if ($token_str !== 'null') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$stringValue = ''; // Fake empty
|
||||
} else {
|
||||
print "Expression is not string or null ".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($stringValue !== $expectedStringValue) {
|
||||
print "Not replacing $argument_name which is '$stringValue'/".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
print "Fixture elem on $line - $actual_name(...'$stringValue'...) - $instance".PHP_EOL;
|
||||
|
||||
|
||||
|
||||
// Get the first argument (delimiter)
|
||||
$argument_to_replace = $arg;
|
||||
|
||||
$arg_start_pos = $argument_to_replace->getStartPosition();
|
||||
$arg_end_pos = $argument_to_replace->getEndPosition();
|
||||
|
||||
// Set edit instruction
|
||||
$edits[] = new FileEdit($arg_start_pos, $arg_end_pos, $replacement);
|
||||
}
|
||||
if ($edits) {
|
||||
return new FileEditSet($edits);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
IssueFixer::registerFixerClosure(
|
||||
'PhanTypeMismatchArgumentProbablyReal',
|
||||
$fix
|
||||
);
|
||||
});
|
||||
106
dev/tools/phan/plugins/UrlEncodeStringifyFixer.php
Normal file
106
dev/tools/phan/plugins/UrlEncodeStringifyFixer.php
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
<?php
|
||||
/* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* For 'price()', replace $form parameter that is '' with 0.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use ast\flags;
|
||||
use Microsoft\PhpParser\Node\Expression\CallExpression;
|
||||
use Microsoft\PhpParser\Node\QualifiedName;
|
||||
use Phan\AST\TolerantASTConverter\NodeUtils;
|
||||
use Phan\CodeBase;
|
||||
use Phan\IssueInstance;
|
||||
use Phan\Library\FileCacheEntry;
|
||||
use Phan\Plugin\Internal\IssueFixingPlugin\FileEdit;
|
||||
use Phan\Plugin\Internal\IssueFixingPlugin\FileEditSet;
|
||||
use Phan\Plugin\Internal\IssueFixingPlugin\IssueFixer;
|
||||
use Microsoft\PhpParser\Node\Expression\ArgumentExpression;
|
||||
use Microsoft\PhpParser\Node\DelimitedList\ArgumentExpressionList;
|
||||
use Microsoft\PhpParser\Node\StringLiteral;
|
||||
use Microsoft\PhpParser\Node\ReservedWord;
|
||||
use Microsoft\PhpParser\Token;
|
||||
|
||||
/**
|
||||
* This is a prototype, there are various features it does not implement.
|
||||
*/
|
||||
|
||||
call_user_func(static function (): void {
|
||||
/**
|
||||
* @param $code_base @unused-param
|
||||
* @return ?FileEditSet a representation of the edit to make to replace a call to a function alias with a call to the original function
|
||||
*/
|
||||
$fix = static function (CodeBase $code_base, FileCacheEntry $contents, IssueInstance $instance): ?FileEditSet {
|
||||
$line = $instance->getLine();
|
||||
// print flags\TYPE_NULL;
|
||||
$expected_name = 'urlencode';
|
||||
$edits = [];
|
||||
foreach ($contents->getNodesAtLine($line) as $node) {
|
||||
if (!$node instanceof ArgumentExpressionList) {
|
||||
continue;
|
||||
}
|
||||
$arguments = $node->children;
|
||||
if (count($arguments) < 1) {
|
||||
// print "Arg Count is ".count($arguments)." - Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
$is_actual_call = $node->parent instanceof CallExpression;
|
||||
if (!$is_actual_call) {
|
||||
print "Not actual call - Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
print "Actual call - $instance".PHP_EOL;
|
||||
$callable = $node->parent;
|
||||
|
||||
$callableExpression = $callable->callableExpression;
|
||||
|
||||
if ($callableExpression instanceof Microsoft\PhpParser\Node\QualifiedName) {
|
||||
$actual_name = $callableExpression->getResolvedName();
|
||||
} else {
|
||||
print "Callable expression is ".get_class($callableExpression)."- Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((string) $actual_name !== (string) $expected_name) {
|
||||
print "Name unexpected '$actual_name'!='$expected_name' - Skip $instance".PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($arguments as $i => $argument) {
|
||||
if ($argument instanceof ArgumentExpression) {
|
||||
print "Type$i: ".get_class($argument->expression).PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
$arg = $arguments[0];
|
||||
|
||||
// Reached end of switch case without "continue" -> replace
|
||||
$replacement = 0;
|
||||
|
||||
print "Fixture elem on $line - $actual_name() - $instance".PHP_EOL;
|
||||
|
||||
// Determine replacement
|
||||
$replacement = '0';
|
||||
|
||||
// Get the first argument (delimiter)
|
||||
$argument_to_replace = $arg;
|
||||
|
||||
$arg_start_pos = $argument_to_replace->getStartPosition();
|
||||
$arg_end_pos = $argument_to_replace->getEndPosition();
|
||||
|
||||
// Remove deprecated module name
|
||||
$edits[] = new FileEdit($arg_start_pos, $arg_start_pos, "(string) (");
|
||||
$edits[] = new FileEdit($arg_end_pos, $arg_end_pos, ")");
|
||||
}
|
||||
if ($edits) {
|
||||
return new FileEditSet($edits);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
IssueFixer::registerFixerClosure(
|
||||
'PhanTypeMismatchArgumentInternal',
|
||||
$fix
|
||||
);
|
||||
});
|
||||
99
dev/tools/phan/run-phan.sh
Executable file
99
dev/tools/phan/run-phan.sh
Executable file
|
|
@ -0,0 +1,99 @@
|
|||
#!/bin/bash -xv
|
||||
# Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
|
||||
|
||||
#
|
||||
# Usage:
|
||||
# Optionally set COMPOSER_CMD to allow running composer.
|
||||
# Optionally point COMPOSER_VENDOR_DIR to your vendor path for composer.
|
||||
#
|
||||
# Run phan by calling this script:
|
||||
# ./run-phan.sh # Only checks
|
||||
# ./run-phan.sh 1 # Regenerate the baseline.txt file
|
||||
#
|
||||
# You can run this from the root directory of dolibarr
|
||||
# dev/tools/run-phan.sh
|
||||
#
|
||||
# You can provide the environment variables on the CLI like this:
|
||||
# COMPOSER_CMD="php ~/composer.phar" COMPOSER_VENDOR_DIR="~/vendor" ./run-phan.sh
|
||||
#
|
||||
# or export them:
|
||||
# export COMPOSER_CMD="~/composer.phar"
|
||||
# export COMPOSER_VENDOR_DIR="~/vendor"
|
||||
# ./run-phan.sh
|
||||
#
|
||||
# Or some other method
|
||||
#
|
||||
#
|
||||
|
||||
MYDIR=$(dirname "$(realpath "$0")")
|
||||
PROJECT_DIR=$(realpath "${MYDIR}/../../..")
|
||||
|
||||
if [[ $(uname) = CYGWIN* ]] ; then
|
||||
MYDIR="$(cygpath -w "$MYDIR")"
|
||||
PROJECT_DIR="$(cygpath -w "$PROJECT_DIR")"
|
||||
fi
|
||||
BASELINE=${MYDIR}/baseline.txt
|
||||
PHAN_CONFIG=${PHAN_CONFIG:=${MYDIR}/config.php}
|
||||
export COMPOSER_VENDOR_DIR=${COMPOSER_VENDOR_DIR:=$MYDIR/vendor}
|
||||
COMPOSER_CMD=${COMPOSER_CMD:=${MYDIR}/../composer.phar}
|
||||
PHAN=${COMPOSER_VENDOR_DIR}/bin/phan
|
||||
PHP=${PHP:=php${MINPHPVERSION}}
|
||||
|
||||
# Check if we should use the extended configuration
|
||||
if [ "$1" = "full" ] ; then
|
||||
shift
|
||||
PHAN_CONFIG=${MYDIR}/config_extended.php
|
||||
BASELINE=${MYDIR}/baseline_extended.txt
|
||||
fi
|
||||
|
||||
if [ "$1" = "1" ] ; then
|
||||
shift
|
||||
BASELINE_OPT=(--save-baseline "${BASELINE}")
|
||||
elif [ -r "${BASELINE}" ] ; then
|
||||
BASELINE_OPT=(--load-baseline "${BASELINE}")
|
||||
fi
|
||||
export BASELINE_OPT
|
||||
|
||||
|
||||
|
||||
echo "***** $(basename "$0") *****"
|
||||
|
||||
|
||||
if [ ! -x "${PHAN}" ] && [ "$(which phan 2>/dev/null)" != "" ] ; then
|
||||
PHAN=phan
|
||||
fi
|
||||
|
||||
if [ ! -x "${PHAN}" ] ; then
|
||||
#
|
||||
# Check composer is available
|
||||
#
|
||||
if [ ! -r "${COMPOSER_CMD}" ] ; then
|
||||
echo composer is not available. Provide the path by setting COMPOSER_CMD=/path/to/composer
|
||||
echo Example: export COMPOSER_CMD="~/composer.phar"
|
||||
echo Example: export COMPOSER_CMD="/usr/local/bin/composer"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# Install/update phan
|
||||
#
|
||||
echo Install phan
|
||||
if [ ! -r "${PHAN}" ] ; then
|
||||
# shellcheck disable=2086
|
||||
[[ ! -e "${COMPOSER_VENDOR_DIR}" ]] && "${PHP}" ${COMPOSER_CMD} install
|
||||
# shellcheck disable=2086
|
||||
[[ -e "${COMPOSER_VENDOR_DIR}" ]] && "${PHP}" ${COMPOSER_CMD} update
|
||||
"${PHP}" "${COMPOSER_CMD}" require --dev phan/phan
|
||||
echo
|
||||
fi
|
||||
fi
|
||||
|
||||
(
|
||||
echo "cd '${PROJECT_DIR}'"
|
||||
cd "${PROJECT_DIR}" || exit
|
||||
echo "\"${PHAN}\" --analyze-twice --config-file \"${PHAN_CONFIG}\" --memory-limit 4096M ${BASELINE_OPT}""$*"
|
||||
# shellcheck disable=2086,2090
|
||||
"${PHAN}" --analyze-twice --config-file "${PHAN_CONFIG}" --memory-limit 4096M "${BASELINE_OPT[@]}" "$@"
|
||||
)
|
||||
27
dev/tools/phan/runPhanDocker.sh
Executable file
27
dev/tools/phan/runPhanDocker.sh
Executable file
|
|
@ -0,0 +1,27 @@
|
|||
#!/bin/bash
|
||||
# Script compatible with Cygwin
|
||||
# When argument is '1', save baseline
|
||||
#
|
||||
# Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
|
||||
MYPATH=$(realpath "$(dirname "$(readlink -f "$0")")/../../..")
|
||||
if [[ $(uname) = CYGWIN* ]] ; then
|
||||
MYPATH="$(cygpath -w "$MYPATH")"
|
||||
fi
|
||||
|
||||
# BASELINE_PATH=.phan/baseline.txt
|
||||
CONFIG_PATH=dev/tools/phan/config.php
|
||||
BASELINE_PATH=dev/tools/phan/baseline.txt
|
||||
|
||||
# When full is provided as an argument,
|
||||
# still use the baseline, but verify all
|
||||
# rules.
|
||||
if [ "$1" = "full" ] || [ "$2" = "full" ] ; then
|
||||
CONFIG_PATH=dev/tools/phan/config_extended.php
|
||||
fi
|
||||
|
||||
if [ "$1" = "1" ] ; then
|
||||
docker run -v "$MYPATH:/mnt/src" phanphp/phan:latest -k /mnt/src/${CONFIG_PATH} --analyze-twice --save-baseline /mnt/src/${BASELINE_PATH}
|
||||
else
|
||||
docker run -v "$MYPATH:/mnt/src" phanphp/phan:latest -k /mnt/src/${CONFIG_PATH} -B /mnt/src/${BASELINE_PATH} --analyze-twice
|
||||
fi
|
||||
1293
dev/tools/phan/stubs/GeoIP2.php
Normal file
1293
dev/tools/phan/stubs/GeoIP2.php
Normal file
File diff suppressed because it is too large
Load Diff
43
dev/tools/phan/stubs/SimpleXML.phan_php
Normal file
43
dev/tools/phan/stubs/SimpleXML.phan_php
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
// These stubs were generated by the phan stub generator.
|
||||
// @phan-stub-for-extension SimpleXML@7.4.12
|
||||
|
||||
namespace {
|
||||
class SimpleXMLElement implements \Traversable, \Countable {
|
||||
|
||||
// methods
|
||||
final public function __construct($data, $options = null, $data_is_url = null, $ns = null, $is_prefix = null) {}
|
||||
public function asXML($filename = null) {}
|
||||
public function saveXML($filename = null) {}
|
||||
public function xpath($path) {}
|
||||
public function registerXPathNamespace($prefix, $ns) {}
|
||||
public function attributes($ns = null, $is_prefix = null) {}
|
||||
public function children($ns = null, $is_prefix = null) {}
|
||||
public function getNamespaces($recursve = null) {}
|
||||
public function getDocNamespaces($recursve = null, $from_root = null) {}
|
||||
public function getName() {}
|
||||
public function addChild($name, $value = null, $ns = null) {}
|
||||
public function addAttribute($name, $value = null, $ns = null) {}
|
||||
public function __toString() {}
|
||||
public function count() {}
|
||||
}
|
||||
|
||||
class SimpleXMLIterator extends \SimpleXMLElement implements \RecursiveIterator, \Iterator {
|
||||
|
||||
// properties
|
||||
public $name;
|
||||
|
||||
// methods
|
||||
public function rewind() {}
|
||||
public function valid() {}
|
||||
public function current() {}
|
||||
public function key() {}
|
||||
public function next() {}
|
||||
public function hasChildren() {}
|
||||
public function getChildren() {}
|
||||
}
|
||||
|
||||
function simplexml_import_dom($node, $class_name = null) {}
|
||||
function simplexml_load_file($filename, $class_name = null, $options = null, $ns = null, $is_prefix = null) {}
|
||||
function simplexml_load_string($data, $class_name = null, $options = null, $ns = null, $is_prefix = null) {}
|
||||
}
|
||||
29
dev/tools/phan/stubs/brotli.phan_php
Normal file
29
dev/tools/phan/stubs/brotli.phan_php
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
// These stubs were generated by the phan stub generator.
|
||||
// @phan-stub-for-extension brotli@0.14.2
|
||||
|
||||
namespace {
|
||||
function brotli_compress($data, $quality = null, $mode = null) {}
|
||||
function brotli_compress_add($context, $data, $mode = null) {}
|
||||
function brotli_compress_init($quality = null, $mode = null) {}
|
||||
function brotli_uncompress($data, $max = null) {}
|
||||
function brotli_uncompress_add($context, $data, $mode = null) {}
|
||||
function brotli_uncompress_init() {}
|
||||
const BROTLI_COMPRESS_LEVEL_DEFAULT = 11;
|
||||
const BROTLI_COMPRESS_LEVEL_MAX = 11;
|
||||
const BROTLI_COMPRESS_LEVEL_MIN = 0;
|
||||
const BROTLI_FINISH = 2;
|
||||
const BROTLI_FONT = 2;
|
||||
const BROTLI_GENERIC = 0;
|
||||
const BROTLI_PROCESS = 0;
|
||||
const BROTLI_TEXT = 1;
|
||||
}
|
||||
|
||||
namespace brotli {
|
||||
function compress($data, $quality = null, $mode = null) {}
|
||||
function compress_add($context, $data, $mode = null) {}
|
||||
function compress_init($quality = null, $mode = null) {}
|
||||
function uncompress($data, $max = null) {}
|
||||
function uncompress_add($context, $data, $mode = null) {}
|
||||
function uncompress_init() {}
|
||||
}
|
||||
45
dev/tools/phan/stubs/calendar.phan_php
Normal file
45
dev/tools/phan/stubs/calendar.phan_php
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
<?php
|
||||
// These stubs were generated by the phan stub generator.
|
||||
// @phan-stub-for-extension calendar@8.2.9
|
||||
|
||||
namespace {
|
||||
function cal_days_in_month(int $calendar, int $month, int $year) : int {}
|
||||
function cal_from_jd(int $julian_day, int $calendar) : array {}
|
||||
function cal_info(int $calendar = -1) : array {}
|
||||
function cal_to_jd(int $calendar, int $month, int $day, int $year) : int {}
|
||||
function easter_date(?int $year = null, int $mode = \CAL_EASTER_DEFAULT) : int {}
|
||||
function easter_days(?int $year = null, int $mode = \CAL_EASTER_DEFAULT) : int {}
|
||||
function frenchtojd(int $month, int $day, int $year) : int {}
|
||||
function gregoriantojd(int $month, int $day, int $year) : int {}
|
||||
function jddayofweek(int $julian_day, int $mode = \CAL_DOW_DAYNO) : int|string {}
|
||||
function jdmonthname(int $julian_day, int $mode) : string {}
|
||||
function jdtofrench(int $julian_day) : string {}
|
||||
function jdtogregorian(int $julian_day) : string {}
|
||||
function jdtojewish(int $julian_day, bool $hebrew = false, int $flags = 0) : string {}
|
||||
function jdtojulian(int $julian_day) : string {}
|
||||
function jdtounix(int $julian_day) : int {}
|
||||
function jewishtojd(int $month, int $day, int $year) : int {}
|
||||
function juliantojd(int $month, int $day, int $year) : int {}
|
||||
function unixtojd(?int $timestamp = null) : false|int {}
|
||||
const CAL_DOW_DAYNO = 0;
|
||||
const CAL_DOW_LONG = 1;
|
||||
const CAL_DOW_SHORT = 2;
|
||||
const CAL_EASTER_ALWAYS_GREGORIAN = 2;
|
||||
const CAL_EASTER_ALWAYS_JULIAN = 3;
|
||||
const CAL_EASTER_DEFAULT = 0;
|
||||
const CAL_EASTER_ROMAN = 1;
|
||||
const CAL_FRENCH = 3;
|
||||
const CAL_GREGORIAN = 0;
|
||||
const CAL_JEWISH = 2;
|
||||
const CAL_JEWISH_ADD_ALAFIM = 4;
|
||||
const CAL_JEWISH_ADD_ALAFIM_GERESH = 2;
|
||||
const CAL_JEWISH_ADD_GERESHAYIM = 8;
|
||||
const CAL_JULIAN = 1;
|
||||
const CAL_MONTH_FRENCH = 5;
|
||||
const CAL_MONTH_GREGORIAN_LONG = 1;
|
||||
const CAL_MONTH_GREGORIAN_SHORT = 0;
|
||||
const CAL_MONTH_JEWISH = 4;
|
||||
const CAL_MONTH_JULIAN_LONG = 3;
|
||||
const CAL_MONTH_JULIAN_SHORT = 2;
|
||||
const CAL_NUM_CALS = 4;
|
||||
}
|
||||
616
dev/tools/phan/stubs/curl.phan_php
Normal file
616
dev/tools/phan/stubs/curl.phan_php
Normal file
|
|
@ -0,0 +1,616 @@
|
|||
<?php
|
||||
// These stubs were generated by the phan stub generator.
|
||||
// @phan-stub-for-extension curl@7.4.12
|
||||
|
||||
namespace {
|
||||
class CURLFile {
|
||||
|
||||
// properties
|
||||
public $mime;
|
||||
public $name;
|
||||
public $postname;
|
||||
|
||||
// methods
|
||||
public function __construct($filename, $mimetype = null, $postname = null) {}
|
||||
public function getFilename() {}
|
||||
public function getMimeType() {}
|
||||
public function setMimeType($name) {}
|
||||
public function getPostFilename() {}
|
||||
public function setPostFilename($name) {}
|
||||
}
|
||||
|
||||
function curl_close($ch) {}
|
||||
function curl_copy_handle($ch) {}
|
||||
function curl_errno($ch) {}
|
||||
function curl_error($ch) {}
|
||||
function curl_escape($ch, $str) {}
|
||||
function curl_exec($ch) {}
|
||||
function curl_file_create($filename, $mimetype = null, $postname = null) {}
|
||||
function curl_getinfo($ch, $option = null) {}
|
||||
function curl_init($url = null) {}
|
||||
function curl_multi_add_handle($mh, $ch) {}
|
||||
function curl_multi_close($mh) {}
|
||||
function curl_multi_errno($mh) {}
|
||||
function curl_multi_exec($mh, &$still_running = null) {}
|
||||
function curl_multi_getcontent($ch) {}
|
||||
function curl_multi_info_read($mh, &$msgs_in_queue = null) {}
|
||||
function curl_multi_init() {}
|
||||
function curl_multi_remove_handle($mh, $ch) {}
|
||||
function curl_multi_select($mh, $timeout = null) {}
|
||||
function curl_multi_setopt($sh, $option, $value) {}
|
||||
function curl_multi_strerror($errornum) {}
|
||||
function curl_pause($ch, $bitmask) {}
|
||||
function curl_reset($ch) {}
|
||||
function curl_setopt($ch, $option, $value) {}
|
||||
function curl_setopt_array($ch, array $options) {}
|
||||
function curl_share_close($sh) {}
|
||||
function curl_share_errno($sh) {}
|
||||
function curl_share_init() {}
|
||||
function curl_share_setopt($sh, $option, $value) {}
|
||||
function curl_share_strerror($errornum) {}
|
||||
function curl_strerror($errornum) {}
|
||||
function curl_unescape($ch, $str) {}
|
||||
function curl_version($version = null) {}
|
||||
const CURLAUTH_ANY = -17;
|
||||
const CURLAUTH_ANYSAFE = -18;
|
||||
const CURLAUTH_BASIC = 1;
|
||||
const CURLAUTH_BEARER = 64;
|
||||
const CURLAUTH_DIGEST = 2;
|
||||
const CURLAUTH_DIGEST_IE = 16;
|
||||
const CURLAUTH_GSSAPI = 4;
|
||||
const CURLAUTH_GSSNEGOTIATE = 4;
|
||||
const CURLAUTH_NEGOTIATE = 4;
|
||||
const CURLAUTH_NONE = 0;
|
||||
const CURLAUTH_NTLM = 8;
|
||||
const CURLAUTH_NTLM_WB = 32;
|
||||
const CURLAUTH_ONLY = 2147483648;
|
||||
const CURLE_ABORTED_BY_CALLBACK = 42;
|
||||
const CURLE_BAD_CALLING_ORDER = 44;
|
||||
const CURLE_BAD_CONTENT_ENCODING = 61;
|
||||
const CURLE_BAD_DOWNLOAD_RESUME = 36;
|
||||
const CURLE_BAD_FUNCTION_ARGUMENT = 43;
|
||||
const CURLE_BAD_PASSWORD_ENTERED = 46;
|
||||
const CURLE_COULDNT_CONNECT = 7;
|
||||
const CURLE_COULDNT_RESOLVE_HOST = 6;
|
||||
const CURLE_COULDNT_RESOLVE_PROXY = 5;
|
||||
const CURLE_FAILED_INIT = 2;
|
||||
const CURLE_FILESIZE_EXCEEDED = 63;
|
||||
const CURLE_FILE_COULDNT_READ_FILE = 37;
|
||||
const CURLE_FTP_ACCESS_DENIED = 9;
|
||||
const CURLE_FTP_BAD_DOWNLOAD_RESUME = 36;
|
||||
const CURLE_FTP_CANT_GET_HOST = 15;
|
||||
const CURLE_FTP_CANT_RECONNECT = 16;
|
||||
const CURLE_FTP_COULDNT_GET_SIZE = 32;
|
||||
const CURLE_FTP_COULDNT_RETR_FILE = 19;
|
||||
const CURLE_FTP_COULDNT_SET_ASCII = 29;
|
||||
const CURLE_FTP_COULDNT_SET_BINARY = 17;
|
||||
const CURLE_FTP_COULDNT_STOR_FILE = 25;
|
||||
const CURLE_FTP_COULDNT_USE_REST = 31;
|
||||
const CURLE_FTP_PARTIAL_FILE = 18;
|
||||
const CURLE_FTP_PORT_FAILED = 30;
|
||||
const CURLE_FTP_QUOTE_ERROR = 21;
|
||||
const CURLE_FTP_SSL_FAILED = 64;
|
||||
const CURLE_FTP_USER_PASSWORD_INCORRECT = 10;
|
||||
const CURLE_FTP_WEIRD_227_FORMAT = 14;
|
||||
const CURLE_FTP_WEIRD_PASS_REPLY = 11;
|
||||
const CURLE_FTP_WEIRD_PASV_REPLY = 13;
|
||||
const CURLE_FTP_WEIRD_SERVER_REPLY = 8;
|
||||
const CURLE_FTP_WEIRD_USER_REPLY = 12;
|
||||
const CURLE_FTP_WRITE_ERROR = 20;
|
||||
const CURLE_FUNCTION_NOT_FOUND = 41;
|
||||
const CURLE_GOT_NOTHING = 52;
|
||||
const CURLE_HTTP_NOT_FOUND = 22;
|
||||
const CURLE_HTTP_PORT_FAILED = 45;
|
||||
const CURLE_HTTP_POST_ERROR = 34;
|
||||
const CURLE_HTTP_RANGE_ERROR = 33;
|
||||
const CURLE_HTTP_RETURNED_ERROR = 22;
|
||||
const CURLE_LDAP_CANNOT_BIND = 38;
|
||||
const CURLE_LDAP_INVALID_URL = 62;
|
||||
const CURLE_LDAP_SEARCH_FAILED = 39;
|
||||
const CURLE_LIBRARY_NOT_FOUND = 40;
|
||||
const CURLE_MALFORMAT_USER = 24;
|
||||
const CURLE_OBSOLETE = 50;
|
||||
const CURLE_OK = 0;
|
||||
const CURLE_OPERATION_TIMEDOUT = 28;
|
||||
const CURLE_OPERATION_TIMEOUTED = 28;
|
||||
const CURLE_OUT_OF_MEMORY = 27;
|
||||
const CURLE_PARTIAL_FILE = 18;
|
||||
const CURLE_READ_ERROR = 26;
|
||||
const CURLE_RECV_ERROR = 56;
|
||||
const CURLE_SEND_ERROR = 55;
|
||||
const CURLE_SHARE_IN_USE = 57;
|
||||
const CURLE_SSH = 79;
|
||||
const CURLE_SSL_CACERT = 60;
|
||||
const CURLE_SSL_CACERT_BADFILE = 77;
|
||||
const CURLE_SSL_CERTPROBLEM = 58;
|
||||
const CURLE_SSL_CIPHER = 59;
|
||||
const CURLE_SSL_CONNECT_ERROR = 35;
|
||||
const CURLE_SSL_ENGINE_NOTFOUND = 53;
|
||||
const CURLE_SSL_ENGINE_SETFAILED = 54;
|
||||
const CURLE_SSL_PEER_CERTIFICATE = 60;
|
||||
const CURLE_SSL_PINNEDPUBKEYNOTMATCH = 90;
|
||||
const CURLE_TELNET_OPTION_SYNTAX = 49;
|
||||
const CURLE_TOO_MANY_REDIRECTS = 47;
|
||||
const CURLE_UNKNOWN_TELNET_OPTION = 48;
|
||||
const CURLE_UNSUPPORTED_PROTOCOL = 1;
|
||||
const CURLE_URL_MALFORMAT = 3;
|
||||
const CURLE_URL_MALFORMAT_USER = 4;
|
||||
const CURLE_WEIRD_SERVER_REPLY = 8;
|
||||
const CURLE_WRITE_ERROR = 23;
|
||||
const CURLFTPAUTH_DEFAULT = 0;
|
||||
const CURLFTPAUTH_SSL = 1;
|
||||
const CURLFTPAUTH_TLS = 2;
|
||||
const CURLFTPMETHOD_MULTICWD = 1;
|
||||
const CURLFTPMETHOD_NOCWD = 2;
|
||||
const CURLFTPMETHOD_SINGLECWD = 3;
|
||||
const CURLFTPSSL_ALL = 3;
|
||||
const CURLFTPSSL_CCC_ACTIVE = 2;
|
||||
const CURLFTPSSL_CCC_NONE = 0;
|
||||
const CURLFTPSSL_CCC_PASSIVE = 1;
|
||||
const CURLFTPSSL_CONTROL = 2;
|
||||
const CURLFTPSSL_NONE = 0;
|
||||
const CURLFTPSSL_TRY = 1;
|
||||
const CURLFTP_CREATE_DIR = 1;
|
||||
const CURLFTP_CREATE_DIR_NONE = 0;
|
||||
const CURLFTP_CREATE_DIR_RETRY = 2;
|
||||
const CURLGSSAPI_DELEGATION_FLAG = 2;
|
||||
const CURLGSSAPI_DELEGATION_POLICY_FLAG = 1;
|
||||
const CURLHEADER_SEPARATE = 1;
|
||||
const CURLHEADER_UNIFIED = 0;
|
||||
const CURLINFO_APPCONNECT_TIME = 3145761;
|
||||
const CURLINFO_APPCONNECT_TIME_T = 6291512;
|
||||
const CURLINFO_CERTINFO = 4194338;
|
||||
const CURLINFO_CONDITION_UNMET = 2097187;
|
||||
const CURLINFO_CONNECT_TIME = 3145733;
|
||||
const CURLINFO_CONNECT_TIME_T = 6291508;
|
||||
const CURLINFO_CONTENT_LENGTH_DOWNLOAD = 3145743;
|
||||
const CURLINFO_CONTENT_LENGTH_DOWNLOAD_T = 6291471;
|
||||
const CURLINFO_CONTENT_LENGTH_UPLOAD = 3145744;
|
||||
const CURLINFO_CONTENT_LENGTH_UPLOAD_T = 6291472;
|
||||
const CURLINFO_CONTENT_TYPE = 1048594;
|
||||
const CURLINFO_COOKIELIST = 4194332;
|
||||
const CURLINFO_EFFECTIVE_URL = 1048577;
|
||||
const CURLINFO_FILETIME = 2097166;
|
||||
const CURLINFO_FILETIME_T = 6291470;
|
||||
const CURLINFO_FTP_ENTRY_PATH = 1048606;
|
||||
const CURLINFO_HEADER_OUT = 2;
|
||||
const CURLINFO_HEADER_SIZE = 2097163;
|
||||
const CURLINFO_HTTPAUTH_AVAIL = 2097175;
|
||||
const CURLINFO_HTTP_CODE = 2097154;
|
||||
const CURLINFO_HTTP_CONNECTCODE = 2097174;
|
||||
const CURLINFO_HTTP_VERSION = 2097198;
|
||||
const CURLINFO_LASTONE = 56;
|
||||
const CURLINFO_LOCAL_IP = 1048617;
|
||||
const CURLINFO_LOCAL_PORT = 2097194;
|
||||
const CURLINFO_NAMELOOKUP_TIME = 3145732;
|
||||
const CURLINFO_NAMELOOKUP_TIME_T = 6291507;
|
||||
const CURLINFO_NUM_CONNECTS = 2097178;
|
||||
const CURLINFO_OS_ERRNO = 2097177;
|
||||
const CURLINFO_PRETRANSFER_TIME = 3145734;
|
||||
const CURLINFO_PRETRANSFER_TIME_T = 6291509;
|
||||
const CURLINFO_PRIMARY_IP = 1048608;
|
||||
const CURLINFO_PRIMARY_PORT = 2097192;
|
||||
const CURLINFO_PRIVATE = 1048597;
|
||||
const CURLINFO_PROTOCOL = 2097200;
|
||||
const CURLINFO_PROXYAUTH_AVAIL = 2097176;
|
||||
const CURLINFO_PROXY_SSL_VERIFYRESULT = 2097199;
|
||||
const CURLINFO_REDIRECT_COUNT = 2097172;
|
||||
const CURLINFO_REDIRECT_TIME = 3145747;
|
||||
const CURLINFO_REDIRECT_TIME_T = 6291511;
|
||||
const CURLINFO_REDIRECT_URL = 1048607;
|
||||
const CURLINFO_REQUEST_SIZE = 2097164;
|
||||
const CURLINFO_RESPONSE_CODE = 2097154;
|
||||
const CURLINFO_RTSP_CLIENT_CSEQ = 2097189;
|
||||
const CURLINFO_RTSP_CSEQ_RECV = 2097191;
|
||||
const CURLINFO_RTSP_SERVER_CSEQ = 2097190;
|
||||
const CURLINFO_RTSP_SESSION_ID = 1048612;
|
||||
const CURLINFO_SCHEME = 1048625;
|
||||
const CURLINFO_SIZE_DOWNLOAD = 3145736;
|
||||
const CURLINFO_SIZE_DOWNLOAD_T = 6291464;
|
||||
const CURLINFO_SIZE_UPLOAD = 3145735;
|
||||
const CURLINFO_SIZE_UPLOAD_T = 6291463;
|
||||
const CURLINFO_SPEED_DOWNLOAD = 3145737;
|
||||
const CURLINFO_SPEED_DOWNLOAD_T = 6291465;
|
||||
const CURLINFO_SPEED_UPLOAD = 3145738;
|
||||
const CURLINFO_SPEED_UPLOAD_T = 6291466;
|
||||
const CURLINFO_SSL_ENGINES = 4194331;
|
||||
const CURLINFO_SSL_VERIFYRESULT = 2097165;
|
||||
const CURLINFO_STARTTRANSFER_TIME = 3145745;
|
||||
const CURLINFO_STARTTRANSFER_TIME_T = 6291510;
|
||||
const CURLINFO_TOTAL_TIME = 3145731;
|
||||
const CURLINFO_TOTAL_TIME_T = 6291506;
|
||||
const CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE = 30010;
|
||||
const CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE = 30009;
|
||||
const CURLMOPT_MAXCONNECTS = 6;
|
||||
const CURLMOPT_MAX_HOST_CONNECTIONS = 7;
|
||||
const CURLMOPT_MAX_PIPELINE_LENGTH = 8;
|
||||
const CURLMOPT_MAX_TOTAL_CONNECTIONS = 13;
|
||||
const CURLMOPT_PIPELINING = 3;
|
||||
const CURLMOPT_PUSHFUNCTION = 20014;
|
||||
const CURLMSG_DONE = 1;
|
||||
const CURLM_ADDED_ALREADY = 7;
|
||||
const CURLM_BAD_EASY_HANDLE = 2;
|
||||
const CURLM_BAD_HANDLE = 1;
|
||||
const CURLM_CALL_MULTI_PERFORM = -1;
|
||||
const CURLM_INTERNAL_ERROR = 4;
|
||||
const CURLM_OK = 0;
|
||||
const CURLM_OUT_OF_MEMORY = 3;
|
||||
const CURLOPT_ABSTRACT_UNIX_SOCKET = 10264;
|
||||
const CURLOPT_ACCEPTTIMEOUT_MS = 212;
|
||||
const CURLOPT_ACCEPT_ENCODING = 10102;
|
||||
const CURLOPT_ADDRESS_SCOPE = 171;
|
||||
const CURLOPT_APPEND = 50;
|
||||
const CURLOPT_AUTOREFERER = 58;
|
||||
const CURLOPT_BINARYTRANSFER = 19914;
|
||||
const CURLOPT_BUFFERSIZE = 98;
|
||||
const CURLOPT_CAINFO = 10065;
|
||||
const CURLOPT_CAPATH = 10097;
|
||||
const CURLOPT_CERTINFO = 172;
|
||||
const CURLOPT_CONNECTTIMEOUT = 78;
|
||||
const CURLOPT_CONNECTTIMEOUT_MS = 156;
|
||||
const CURLOPT_CONNECT_ONLY = 141;
|
||||
const CURLOPT_CONNECT_TO = 10243;
|
||||
const CURLOPT_COOKIE = 10022;
|
||||
const CURLOPT_COOKIEFILE = 10031;
|
||||
const CURLOPT_COOKIEJAR = 10082;
|
||||
const CURLOPT_COOKIELIST = 10135;
|
||||
const CURLOPT_COOKIESESSION = 96;
|
||||
const CURLOPT_CRLF = 27;
|
||||
const CURLOPT_CRLFILE = 10169;
|
||||
const CURLOPT_CUSTOMREQUEST = 10036;
|
||||
const CURLOPT_DEFAULT_PROTOCOL = 10238;
|
||||
const CURLOPT_DIRLISTONLY = 48;
|
||||
const CURLOPT_DISALLOW_USERNAME_IN_URL = 278;
|
||||
const CURLOPT_DNS_CACHE_TIMEOUT = 92;
|
||||
const CURLOPT_DNS_INTERFACE = 10221;
|
||||
const CURLOPT_DNS_LOCAL_IP4 = 10222;
|
||||
const CURLOPT_DNS_LOCAL_IP6 = 10223;
|
||||
const CURLOPT_DNS_SERVERS = 10211;
|
||||
const CURLOPT_DNS_SHUFFLE_ADDRESSES = 275;
|
||||
const CURLOPT_DNS_USE_GLOBAL_CACHE = 91;
|
||||
const CURLOPT_EGDSOCKET = 10077;
|
||||
const CURLOPT_ENCODING = 10102;
|
||||
const CURLOPT_EXPECT_100_TIMEOUT_MS = 227;
|
||||
const CURLOPT_FAILONERROR = 45;
|
||||
const CURLOPT_FILE = 10001;
|
||||
const CURLOPT_FILETIME = 69;
|
||||
const CURLOPT_FNMATCH_FUNCTION = 20200;
|
||||
const CURLOPT_FOLLOWLOCATION = 52;
|
||||
const CURLOPT_FORBID_REUSE = 75;
|
||||
const CURLOPT_FRESH_CONNECT = 74;
|
||||
const CURLOPT_FTPAPPEND = 50;
|
||||
const CURLOPT_FTPLISTONLY = 48;
|
||||
const CURLOPT_FTPPORT = 10017;
|
||||
const CURLOPT_FTPSSLAUTH = 129;
|
||||
const CURLOPT_FTP_ACCOUNT = 10134;
|
||||
const CURLOPT_FTP_ALTERNATIVE_TO_USER = 10147;
|
||||
const CURLOPT_FTP_CREATE_MISSING_DIRS = 110;
|
||||
const CURLOPT_FTP_FILEMETHOD = 138;
|
||||
const CURLOPT_FTP_RESPONSE_TIMEOUT = 112;
|
||||
const CURLOPT_FTP_SKIP_PASV_IP = 137;
|
||||
const CURLOPT_FTP_SSL = 119;
|
||||
const CURLOPT_FTP_SSL_CCC = 154;
|
||||
const CURLOPT_FTP_USE_EPRT = 106;
|
||||
const CURLOPT_FTP_USE_EPSV = 85;
|
||||
const CURLOPT_FTP_USE_PRET = 188;
|
||||
const CURLOPT_GSSAPI_DELEGATION = 210;
|
||||
const CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS = 271;
|
||||
const CURLOPT_HAPROXYPROTOCOL = 274;
|
||||
const CURLOPT_HEADER = 42;
|
||||
const CURLOPT_HEADERFUNCTION = 20079;
|
||||
const CURLOPT_HEADEROPT = 229;
|
||||
const CURLOPT_HTTP09_ALLOWED = 285;
|
||||
const CURLOPT_HTTP200ALIASES = 10104;
|
||||
const CURLOPT_HTTPAUTH = 107;
|
||||
const CURLOPT_HTTPGET = 80;
|
||||
const CURLOPT_HTTPHEADER = 10023;
|
||||
const CURLOPT_HTTPPROXYTUNNEL = 61;
|
||||
const CURLOPT_HTTP_CONTENT_DECODING = 158;
|
||||
const CURLOPT_HTTP_TRANSFER_DECODING = 157;
|
||||
const CURLOPT_HTTP_VERSION = 84;
|
||||
const CURLOPT_IGNORE_CONTENT_LENGTH = 136;
|
||||
const CURLOPT_INFILE = 10009;
|
||||
const CURLOPT_INFILESIZE = 14;
|
||||
const CURLOPT_INTERFACE = 10062;
|
||||
const CURLOPT_IPRESOLVE = 113;
|
||||
const CURLOPT_ISSUERCERT = 10170;
|
||||
const CURLOPT_KEEP_SENDING_ON_ERROR = 245;
|
||||
const CURLOPT_KEYPASSWD = 10026;
|
||||
const CURLOPT_KRB4LEVEL = 10063;
|
||||
const CURLOPT_KRBLEVEL = 10063;
|
||||
const CURLOPT_LOCALPORT = 139;
|
||||
const CURLOPT_LOCALPORTRANGE = 140;
|
||||
const CURLOPT_LOGIN_OPTIONS = 10224;
|
||||
const CURLOPT_LOW_SPEED_LIMIT = 19;
|
||||
const CURLOPT_LOW_SPEED_TIME = 20;
|
||||
const CURLOPT_MAIL_AUTH = 10217;
|
||||
const CURLOPT_MAIL_FROM = 10186;
|
||||
const CURLOPT_MAIL_RCPT = 10187;
|
||||
const CURLOPT_MAXCONNECTS = 71;
|
||||
const CURLOPT_MAXFILESIZE = 114;
|
||||
const CURLOPT_MAXREDIRS = 68;
|
||||
const CURLOPT_MAX_RECV_SPEED_LARGE = 30146;
|
||||
const CURLOPT_MAX_SEND_SPEED_LARGE = 30145;
|
||||
const CURLOPT_NETRC = 51;
|
||||
const CURLOPT_NETRC_FILE = 10118;
|
||||
const CURLOPT_NEW_DIRECTORY_PERMS = 160;
|
||||
const CURLOPT_NEW_FILE_PERMS = 159;
|
||||
const CURLOPT_NOBODY = 44;
|
||||
const CURLOPT_NOPROGRESS = 43;
|
||||
const CURLOPT_NOPROXY = 10177;
|
||||
const CURLOPT_NOSIGNAL = 99;
|
||||
const CURLOPT_PASSWORD = 10174;
|
||||
const CURLOPT_PATH_AS_IS = 234;
|
||||
const CURLOPT_PINNEDPUBLICKEY = 10230;
|
||||
const CURLOPT_PIPEWAIT = 237;
|
||||
const CURLOPT_PORT = 3;
|
||||
const CURLOPT_POST = 47;
|
||||
const CURLOPT_POSTFIELDS = 10015;
|
||||
const CURLOPT_POSTQUOTE = 10039;
|
||||
const CURLOPT_POSTREDIR = 161;
|
||||
const CURLOPT_PREQUOTE = 10093;
|
||||
const CURLOPT_PRE_PROXY = 10262;
|
||||
const CURLOPT_PRIVATE = 10103;
|
||||
const CURLOPT_PROGRESSFUNCTION = 20056;
|
||||
const CURLOPT_PROTOCOLS = 181;
|
||||
const CURLOPT_PROXY = 10004;
|
||||
const CURLOPT_PROXYAUTH = 111;
|
||||
const CURLOPT_PROXYHEADER = 10228;
|
||||
const CURLOPT_PROXYPASSWORD = 10176;
|
||||
const CURLOPT_PROXYPORT = 59;
|
||||
const CURLOPT_PROXYTYPE = 101;
|
||||
const CURLOPT_PROXYUSERNAME = 10175;
|
||||
const CURLOPT_PROXYUSERPWD = 10006;
|
||||
const CURLOPT_PROXY_CAINFO = 10246;
|
||||
const CURLOPT_PROXY_CAPATH = 10247;
|
||||
const CURLOPT_PROXY_CRLFILE = 10260;
|
||||
const CURLOPT_PROXY_KEYPASSWD = 10258;
|
||||
const CURLOPT_PROXY_PINNEDPUBLICKEY = 10263;
|
||||
const CURLOPT_PROXY_SERVICE_NAME = 10235;
|
||||
const CURLOPT_PROXY_SSLCERT = 10254;
|
||||
const CURLOPT_PROXY_SSLCERTTYPE = 10255;
|
||||
const CURLOPT_PROXY_SSLKEY = 10256;
|
||||
const CURLOPT_PROXY_SSLKEYTYPE = 10257;
|
||||
const CURLOPT_PROXY_SSLVERSION = 250;
|
||||
const CURLOPT_PROXY_SSL_CIPHER_LIST = 10259;
|
||||
const CURLOPT_PROXY_SSL_OPTIONS = 261;
|
||||
const CURLOPT_PROXY_SSL_VERIFYHOST = 249;
|
||||
const CURLOPT_PROXY_SSL_VERIFYPEER = 248;
|
||||
const CURLOPT_PROXY_TLS13_CIPHERS = 10277;
|
||||
const CURLOPT_PROXY_TLSAUTH_PASSWORD = 10252;
|
||||
const CURLOPT_PROXY_TLSAUTH_TYPE = 10253;
|
||||
const CURLOPT_PROXY_TLSAUTH_USERNAME = 10251;
|
||||
const CURLOPT_PROXY_TRANSFER_MODE = 166;
|
||||
const CURLOPT_PUT = 54;
|
||||
const CURLOPT_QUOTE = 10028;
|
||||
const CURLOPT_RANDOM_FILE = 10076;
|
||||
const CURLOPT_RANGE = 10007;
|
||||
const CURLOPT_READDATA = 10009;
|
||||
const CURLOPT_READFUNCTION = 20012;
|
||||
const CURLOPT_REDIR_PROTOCOLS = 182;
|
||||
const CURLOPT_REFERER = 10016;
|
||||
const CURLOPT_REQUEST_TARGET = 10266;
|
||||
const CURLOPT_RESOLVE = 10203;
|
||||
const CURLOPT_RESUME_FROM = 21;
|
||||
const CURLOPT_RETURNTRANSFER = 19913;
|
||||
const CURLOPT_RTSP_CLIENT_CSEQ = 193;
|
||||
const CURLOPT_RTSP_REQUEST = 189;
|
||||
const CURLOPT_RTSP_SERVER_CSEQ = 194;
|
||||
const CURLOPT_RTSP_SESSION_ID = 10190;
|
||||
const CURLOPT_RTSP_STREAM_URI = 10191;
|
||||
const CURLOPT_RTSP_TRANSPORT = 10192;
|
||||
const CURLOPT_SAFE_UPLOAD = -1;
|
||||
const CURLOPT_SASL_IR = 218;
|
||||
const CURLOPT_SERVICE_NAME = 10236;
|
||||
const CURLOPT_SHARE = 10100;
|
||||
const CURLOPT_SOCKS5_AUTH = 267;
|
||||
const CURLOPT_SOCKS5_GSSAPI_NEC = 180;
|
||||
const CURLOPT_SOCKS5_GSSAPI_SERVICE = 10179;
|
||||
const CURLOPT_SSH_AUTH_TYPES = 151;
|
||||
const CURLOPT_SSH_COMPRESSION = 268;
|
||||
const CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 = 10162;
|
||||
const CURLOPT_SSH_KNOWNHOSTS = 10183;
|
||||
const CURLOPT_SSH_PRIVATE_KEYFILE = 10153;
|
||||
const CURLOPT_SSH_PUBLIC_KEYFILE = 10152;
|
||||
const CURLOPT_SSLCERT = 10025;
|
||||
const CURLOPT_SSLCERTPASSWD = 10026;
|
||||
const CURLOPT_SSLCERTTYPE = 10086;
|
||||
const CURLOPT_SSLENGINE = 10089;
|
||||
const CURLOPT_SSLENGINE_DEFAULT = 90;
|
||||
const CURLOPT_SSLKEY = 10087;
|
||||
const CURLOPT_SSLKEYPASSWD = 10026;
|
||||
const CURLOPT_SSLKEYTYPE = 10088;
|
||||
const CURLOPT_SSLVERSION = 32;
|
||||
const CURLOPT_SSL_CIPHER_LIST = 10083;
|
||||
const CURLOPT_SSL_ENABLE_ALPN = 226;
|
||||
const CURLOPT_SSL_ENABLE_NPN = 225;
|
||||
const CURLOPT_SSL_FALSESTART = 233;
|
||||
const CURLOPT_SSL_OPTIONS = 216;
|
||||
const CURLOPT_SSL_SESSIONID_CACHE = 150;
|
||||
const CURLOPT_SSL_VERIFYHOST = 81;
|
||||
const CURLOPT_SSL_VERIFYPEER = 64;
|
||||
const CURLOPT_SSL_VERIFYSTATUS = 232;
|
||||
const CURLOPT_STDERR = 10037;
|
||||
const CURLOPT_STREAM_WEIGHT = 239;
|
||||
const CURLOPT_SUPPRESS_CONNECT_HEADERS = 265;
|
||||
const CURLOPT_TCP_FASTOPEN = 244;
|
||||
const CURLOPT_TCP_KEEPALIVE = 213;
|
||||
const CURLOPT_TCP_KEEPIDLE = 214;
|
||||
const CURLOPT_TCP_KEEPINTVL = 215;
|
||||
const CURLOPT_TCP_NODELAY = 121;
|
||||
const CURLOPT_TELNETOPTIONS = 10070;
|
||||
const CURLOPT_TFTP_BLKSIZE = 178;
|
||||
const CURLOPT_TFTP_NO_OPTIONS = 242;
|
||||
const CURLOPT_TIMECONDITION = 33;
|
||||
const CURLOPT_TIMEOUT = 13;
|
||||
const CURLOPT_TIMEOUT_MS = 155;
|
||||
const CURLOPT_TIMEVALUE = 34;
|
||||
const CURLOPT_TIMEVALUE_LARGE = 30270;
|
||||
const CURLOPT_TLS13_CIPHERS = 10276;
|
||||
const CURLOPT_TLSAUTH_PASSWORD = 10205;
|
||||
const CURLOPT_TLSAUTH_TYPE = 10206;
|
||||
const CURLOPT_TLSAUTH_USERNAME = 10204;
|
||||
const CURLOPT_TRANSFERTEXT = 53;
|
||||
const CURLOPT_TRANSFER_ENCODING = 207;
|
||||
const CURLOPT_UNIX_SOCKET_PATH = 10231;
|
||||
const CURLOPT_UNRESTRICTED_AUTH = 105;
|
||||
const CURLOPT_UPLOAD = 46;
|
||||
const CURLOPT_URL = 10002;
|
||||
const CURLOPT_USERAGENT = 10018;
|
||||
const CURLOPT_USERNAME = 10173;
|
||||
const CURLOPT_USERPWD = 10005;
|
||||
const CURLOPT_USE_SSL = 119;
|
||||
const CURLOPT_VERBOSE = 41;
|
||||
const CURLOPT_WILDCARDMATCH = 197;
|
||||
const CURLOPT_WRITEFUNCTION = 20011;
|
||||
const CURLOPT_WRITEHEADER = 10029;
|
||||
const CURLOPT_XOAUTH2_BEARER = 10220;
|
||||
const CURLPAUSE_ALL = 5;
|
||||
const CURLPAUSE_CONT = 0;
|
||||
const CURLPAUSE_RECV = 1;
|
||||
const CURLPAUSE_RECV_CONT = 0;
|
||||
const CURLPAUSE_SEND = 4;
|
||||
const CURLPAUSE_SEND_CONT = 0;
|
||||
const CURLPIPE_HTTP1 = 1;
|
||||
const CURLPIPE_MULTIPLEX = 2;
|
||||
const CURLPIPE_NOTHING = 0;
|
||||
const CURLPROTO_ALL = -1;
|
||||
const CURLPROTO_DICT = 512;
|
||||
const CURLPROTO_FILE = 1024;
|
||||
const CURLPROTO_FTP = 4;
|
||||
const CURLPROTO_FTPS = 8;
|
||||
const CURLPROTO_GOPHER = 33554432;
|
||||
const CURLPROTO_HTTP = 1;
|
||||
const CURLPROTO_HTTPS = 2;
|
||||
const CURLPROTO_IMAP = 4096;
|
||||
const CURLPROTO_IMAPS = 8192;
|
||||
const CURLPROTO_LDAP = 128;
|
||||
const CURLPROTO_LDAPS = 256;
|
||||
const CURLPROTO_POP3 = 16384;
|
||||
const CURLPROTO_POP3S = 32768;
|
||||
const CURLPROTO_RTMP = 524288;
|
||||
const CURLPROTO_RTMPE = 2097152;
|
||||
const CURLPROTO_RTMPS = 8388608;
|
||||
const CURLPROTO_RTMPT = 1048576;
|
||||
const CURLPROTO_RTMPTE = 4194304;
|
||||
const CURLPROTO_RTMPTS = 16777216;
|
||||
const CURLPROTO_RTSP = 262144;
|
||||
const CURLPROTO_SCP = 16;
|
||||
const CURLPROTO_SFTP = 32;
|
||||
const CURLPROTO_SMB = 67108864;
|
||||
const CURLPROTO_SMBS = 134217728;
|
||||
const CURLPROTO_SMTP = 65536;
|
||||
const CURLPROTO_SMTPS = 131072;
|
||||
const CURLPROTO_TELNET = 64;
|
||||
const CURLPROTO_TFTP = 2048;
|
||||
const CURLPROXY_HTTP = 0;
|
||||
const CURLPROXY_HTTPS = 2;
|
||||
const CURLPROXY_HTTP_1_0 = 1;
|
||||
const CURLPROXY_SOCKS4 = 4;
|
||||
const CURLPROXY_SOCKS4A = 6;
|
||||
const CURLPROXY_SOCKS5 = 5;
|
||||
const CURLPROXY_SOCKS5_HOSTNAME = 7;
|
||||
const CURLSHOPT_NONE = 0;
|
||||
const CURLSHOPT_SHARE = 1;
|
||||
const CURLSHOPT_UNSHARE = 2;
|
||||
const CURLSSH_AUTH_AGENT = 16;
|
||||
const CURLSSH_AUTH_ANY = -1;
|
||||
const CURLSSH_AUTH_DEFAULT = -1;
|
||||
const CURLSSH_AUTH_GSSAPI = 32;
|
||||
const CURLSSH_AUTH_HOST = 4;
|
||||
const CURLSSH_AUTH_KEYBOARD = 8;
|
||||
const CURLSSH_AUTH_NONE = 0;
|
||||
const CURLSSH_AUTH_PASSWORD = 2;
|
||||
const CURLSSH_AUTH_PUBLICKEY = 1;
|
||||
const CURLSSLOPT_ALLOW_BEAST = 1;
|
||||
const CURLSSLOPT_NO_REVOKE = 2;
|
||||
const CURLUSESSL_ALL = 3;
|
||||
const CURLUSESSL_CONTROL = 2;
|
||||
const CURLUSESSL_NONE = 0;
|
||||
const CURLUSESSL_TRY = 1;
|
||||
const CURLVERSION_NOW = 4;
|
||||
const CURL_FNMATCHFUNC_FAIL = 2;
|
||||
const CURL_FNMATCHFUNC_MATCH = 0;
|
||||
const CURL_FNMATCHFUNC_NOMATCH = 1;
|
||||
const CURL_HTTP_VERSION_1_0 = 1;
|
||||
const CURL_HTTP_VERSION_1_1 = 2;
|
||||
const CURL_HTTP_VERSION_2 = 3;
|
||||
const CURL_HTTP_VERSION_2TLS = 4;
|
||||
const CURL_HTTP_VERSION_2_0 = 3;
|
||||
const CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE = 5;
|
||||
const CURL_HTTP_VERSION_NONE = 0;
|
||||
const CURL_IPRESOLVE_V4 = 1;
|
||||
const CURL_IPRESOLVE_V6 = 2;
|
||||
const CURL_IPRESOLVE_WHATEVER = 0;
|
||||
const CURL_LOCK_DATA_CONNECT = 5;
|
||||
const CURL_LOCK_DATA_COOKIE = 2;
|
||||
const CURL_LOCK_DATA_DNS = 3;
|
||||
const CURL_LOCK_DATA_PSL = 6;
|
||||
const CURL_LOCK_DATA_SSL_SESSION = 4;
|
||||
const CURL_MAX_READ_SIZE = 524288;
|
||||
const CURL_NETRC_IGNORED = 0;
|
||||
const CURL_NETRC_OPTIONAL = 1;
|
||||
const CURL_NETRC_REQUIRED = 2;
|
||||
const CURL_PUSH_DENY = 1;
|
||||
const CURL_PUSH_OK = 0;
|
||||
const CURL_READFUNC_PAUSE = 268435457;
|
||||
const CURL_REDIR_POST_301 = 1;
|
||||
const CURL_REDIR_POST_302 = 2;
|
||||
const CURL_REDIR_POST_303 = 4;
|
||||
const CURL_REDIR_POST_ALL = 7;
|
||||
const CURL_RTSPREQ_ANNOUNCE = 3;
|
||||
const CURL_RTSPREQ_DESCRIBE = 2;
|
||||
const CURL_RTSPREQ_GET_PARAMETER = 8;
|
||||
const CURL_RTSPREQ_OPTIONS = 1;
|
||||
const CURL_RTSPREQ_PAUSE = 6;
|
||||
const CURL_RTSPREQ_PLAY = 5;
|
||||
const CURL_RTSPREQ_RECEIVE = 11;
|
||||
const CURL_RTSPREQ_RECORD = 10;
|
||||
const CURL_RTSPREQ_SETUP = 4;
|
||||
const CURL_RTSPREQ_SET_PARAMETER = 9;
|
||||
const CURL_RTSPREQ_TEARDOWN = 7;
|
||||
const CURL_SSLVERSION_DEFAULT = 0;
|
||||
const CURL_SSLVERSION_MAX_DEFAULT = 65536;
|
||||
const CURL_SSLVERSION_MAX_NONE = 0;
|
||||
const CURL_SSLVERSION_MAX_TLSv1_0 = 262144;
|
||||
const CURL_SSLVERSION_MAX_TLSv1_1 = 327680;
|
||||
const CURL_SSLVERSION_MAX_TLSv1_2 = 393216;
|
||||
const CURL_SSLVERSION_MAX_TLSv1_3 = 458752;
|
||||
const CURL_SSLVERSION_SSLv2 = 2;
|
||||
const CURL_SSLVERSION_SSLv3 = 3;
|
||||
const CURL_SSLVERSION_TLSv1 = 1;
|
||||
const CURL_SSLVERSION_TLSv1_0 = 4;
|
||||
const CURL_SSLVERSION_TLSv1_1 = 5;
|
||||
const CURL_SSLVERSION_TLSv1_2 = 6;
|
||||
const CURL_SSLVERSION_TLSv1_3 = 7;
|
||||
const CURL_TIMECOND_IFMODSINCE = 1;
|
||||
const CURL_TIMECOND_IFUNMODSINCE = 2;
|
||||
const CURL_TIMECOND_LASTMOD = 3;
|
||||
const CURL_TIMECOND_NONE = 0;
|
||||
const CURL_TLSAUTH_SRP = 1;
|
||||
const CURL_VERSION_ASYNCHDNS = 128;
|
||||
const CURL_VERSION_BROTLI = 8388608;
|
||||
const CURL_VERSION_CONV = 4096;
|
||||
const CURL_VERSION_CURLDEBUG = 8192;
|
||||
const CURL_VERSION_DEBUG = 64;
|
||||
const CURL_VERSION_GSSAPI = 131072;
|
||||
const CURL_VERSION_GSSNEGOTIATE = 32;
|
||||
const CURL_VERSION_HTTP2 = 65536;
|
||||
const CURL_VERSION_HTTPS_PROXY = 2097152;
|
||||
const CURL_VERSION_IDN = 1024;
|
||||
const CURL_VERSION_IPV6 = 1;
|
||||
const CURL_VERSION_KERBEROS4 = 2;
|
||||
const CURL_VERSION_KERBEROS5 = 262144;
|
||||
const CURL_VERSION_LARGEFILE = 512;
|
||||
const CURL_VERSION_LIBZ = 8;
|
||||
const CURL_VERSION_MULTI_SSL = 4194304;
|
||||
const CURL_VERSION_NTLM = 16;
|
||||
const CURL_VERSION_NTLM_WB = 32768;
|
||||
const CURL_VERSION_PSL = 1048576;
|
||||
const CURL_VERSION_SPNEGO = 256;
|
||||
const CURL_VERSION_SSL = 4;
|
||||
const CURL_VERSION_SSPI = 2048;
|
||||
const CURL_VERSION_TLSAUTH_SRP = 16384;
|
||||
const CURL_VERSION_UNIX_SOCKETS = 524288;
|
||||
const CURL_WRITEFUNC_PAUSE = 268435457;
|
||||
}
|
||||
30
dev/tools/phan/stubs/fileinfo.phan_php
Normal file
30
dev/tools/phan/stubs/fileinfo.phan_php
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
// These stubs were generated by the phan stub generator.
|
||||
// @phan-stub-for-extension fileinfo@1.0.5
|
||||
|
||||
namespace {
|
||||
class finfo {
|
||||
|
||||
// methods
|
||||
public function finfo($options = null, $arg = null) {}
|
||||
public function set_flags($options) {}
|
||||
public function file($filename, $options = null, $context = null) {}
|
||||
public function buffer($string, $options = null, $context = null) {}
|
||||
}
|
||||
|
||||
function finfo_buffer($finfo, $string, $options = null, $context = null) {}
|
||||
function finfo_close($finfo) {}
|
||||
function finfo_file($finfo, $filename, $options = null, $context = null) {}
|
||||
function finfo_open($options = null, $arg = null) {}
|
||||
function finfo_set_flags($finfo, $options) {}
|
||||
function mime_content_type($string) {}
|
||||
const FILEINFO_CONTINUE = 32;
|
||||
const FILEINFO_DEVICES = 8;
|
||||
const FILEINFO_MIME = 1040;
|
||||
const FILEINFO_MIME_ENCODING = 1024;
|
||||
const FILEINFO_MIME_TYPE = 16;
|
||||
const FILEINFO_NONE = 0;
|
||||
const FILEINFO_PRESERVE_ATIME = 128;
|
||||
const FILEINFO_RAW = 256;
|
||||
const FILEINFO_SYMLINK = 2;
|
||||
}
|
||||
53
dev/tools/phan/stubs/ftp.phan_php
Normal file
53
dev/tools/phan/stubs/ftp.phan_php
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
<?php
|
||||
// These stubs were generated by the phan stub generator.
|
||||
// @phan-stub-for-extension ftp@7.4.12
|
||||
|
||||
namespace {
|
||||
function ftp_alloc($ftp, $size, &$response = null) {}
|
||||
function ftp_append($ftp, $remote_file, $local_file, $mode = null) {}
|
||||
function ftp_cdup($ftp) {}
|
||||
function ftp_chdir($ftp, $directory) {}
|
||||
function ftp_chmod($ftp, $mode, $filename) {}
|
||||
function ftp_close($ftp) {}
|
||||
function ftp_connect($host, $port = null, $timeout = null) {}
|
||||
function ftp_delete($ftp, $file) {}
|
||||
function ftp_exec($ftp, $command) {}
|
||||
function ftp_fget($ftp, $fp, $remote_file, $mode = null, $resumepos = null) {}
|
||||
function ftp_fput($ftp, $remote_file, $fp, $mode = null, $startpos = null) {}
|
||||
function ftp_get($ftp, $local_file, $remote_file, $mode = null, $resume_pos = null) {}
|
||||
function ftp_get_option($ftp, $option) {}
|
||||
function ftp_login($ftp, $username, $password) {}
|
||||
function ftp_mdtm($ftp, $filename) {}
|
||||
function ftp_mkdir($ftp, $directory) {}
|
||||
function ftp_mlsd($ftp, $directory) {}
|
||||
function ftp_nb_continue($ftp) {}
|
||||
function ftp_nb_fget($ftp, $fp, $remote_file, $mode = null, $resumepos = null) {}
|
||||
function ftp_nb_fput($ftp, $remote_file, $fp, $mode = null, $startpos = null) {}
|
||||
function ftp_nb_get($ftp, $local_file, $remote_file, $mode = null, $resume_pos = null) {}
|
||||
function ftp_nb_put($ftp, $remote_file, $local_file, $mode = null, $startpos = null) {}
|
||||
function ftp_nlist($ftp, $directory) {}
|
||||
function ftp_pasv($ftp, $pasv) {}
|
||||
function ftp_put($ftp, $remote_file, $local_file, $mode = null, $startpos = null) {}
|
||||
function ftp_pwd($ftp) {}
|
||||
function ftp_quit($ftp) {}
|
||||
function ftp_raw($ftp, $command) {}
|
||||
function ftp_rawlist($ftp, $directory, $recursive = null) {}
|
||||
function ftp_rename($ftp, $src, $dest) {}
|
||||
function ftp_rmdir($ftp, $directory) {}
|
||||
function ftp_set_option($ftp, $option, $value) {}
|
||||
function ftp_site($ftp, $cmd) {}
|
||||
function ftp_size($ftp, $filename) {}
|
||||
function ftp_ssl_connect($host, $port = null, $timeout = null) {}
|
||||
function ftp_systype($ftp) {}
|
||||
const FTP_ASCII = 1;
|
||||
const FTP_AUTORESUME = -1;
|
||||
const FTP_AUTOSEEK = 1;
|
||||
const FTP_BINARY = 2;
|
||||
const FTP_FAILED = 0;
|
||||
const FTP_FINISHED = 1;
|
||||
const FTP_IMAGE = 2;
|
||||
const FTP_MOREDATA = 2;
|
||||
const FTP_TEXT = 1;
|
||||
const FTP_TIMEOUT_SEC = 0;
|
||||
const FTP_USEPASVADDRESS = 2;
|
||||
}
|
||||
207
dev/tools/phan/stubs/gd.phan_php
Normal file
207
dev/tools/phan/stubs/gd.phan_php
Normal file
|
|
@ -0,0 +1,207 @@
|
|||
<?php
|
||||
// These stubs were generated by the phan stub generator.
|
||||
// @phan-stub-for-extension gd@8.2.11
|
||||
|
||||
namespace {
|
||||
final class GdFont {
|
||||
}
|
||||
|
||||
final class GdImage {
|
||||
}
|
||||
|
||||
function gd_info() : array {}
|
||||
function imageaffine(\GdImage $image, array $affine, ?array $clip = null) : \GdImage|false {}
|
||||
function imageaffinematrixconcat(array $matrix1, array $matrix2) : array|false {}
|
||||
function imageaffinematrixget(int $type, $options) : array|false {}
|
||||
function imagealphablending(\GdImage $image, bool $enable) : bool {}
|
||||
function imageantialias(\GdImage $image, bool $enable) : bool {}
|
||||
function imagearc(\GdImage $image, int $center_x, int $center_y, int $width, int $height, int $start_angle, int $end_angle, int $color) : bool {}
|
||||
function imageavif(\GdImage $image, $file = null, int $quality = -1, int $speed = -1) : bool {}
|
||||
function imagebmp(\GdImage $image, $file = null, bool $compressed = true) : bool {}
|
||||
function imagechar(\GdImage $image, \GdFont|int $font, int $x, int $y, string $char, int $color) : bool {}
|
||||
function imagecharup(\GdImage $image, \GdFont|int $font, int $x, int $y, string $char, int $color) : bool {}
|
||||
function imagecolorallocate(\GdImage $image, int $red, int $green, int $blue) : false|int {}
|
||||
function imagecolorallocatealpha(\GdImage $image, int $red, int $green, int $blue, int $alpha) : false|int {}
|
||||
function imagecolorat(\GdImage $image, int $x, int $y) : false|int {}
|
||||
function imagecolorclosest(\GdImage $image, int $red, int $green, int $blue) : int {}
|
||||
function imagecolorclosestalpha(\GdImage $image, int $red, int $green, int $blue, int $alpha) : int {}
|
||||
function imagecolorclosesthwb(\GdImage $image, int $red, int $green, int $blue) : int {}
|
||||
function imagecolordeallocate(\GdImage $image, int $color) : bool {}
|
||||
function imagecolorexact(\GdImage $image, int $red, int $green, int $blue) : int {}
|
||||
function imagecolorexactalpha(\GdImage $image, int $red, int $green, int $blue, int $alpha) : int {}
|
||||
function imagecolormatch(\GdImage $image1, \GdImage $image2) : bool {}
|
||||
function imagecolorresolve(\GdImage $image, int $red, int $green, int $blue) : int {}
|
||||
function imagecolorresolvealpha(\GdImage $image, int $red, int $green, int $blue, int $alpha) : int {}
|
||||
function imagecolorset(\GdImage $image, int $color, int $red, int $green, int $blue, int $alpha = 0) : ?false {}
|
||||
function imagecolorsforindex(\GdImage $image, int $color) : array {}
|
||||
function imagecolorstotal(\GdImage $image) : int {}
|
||||
function imagecolortransparent(\GdImage $image, ?int $color = null) : int {}
|
||||
function imageconvolution(\GdImage $image, array $matrix, float $divisor, float $offset) : bool {}
|
||||
function imagecopy(\GdImage $dst_image, \GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height) : bool {}
|
||||
function imagecopymerge(\GdImage $dst_image, \GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height, int $pct) : bool {}
|
||||
function imagecopymergegray(\GdImage $dst_image, \GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height, int $pct) : bool {}
|
||||
function imagecopyresampled(\GdImage $dst_image, \GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $dst_width, int $dst_height, int $src_width, int $src_height) : bool {}
|
||||
function imagecopyresized(\GdImage $dst_image, \GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $dst_width, int $dst_height, int $src_width, int $src_height) : bool {}
|
||||
function imagecreate(int $width, int $height) : \GdImage|false {}
|
||||
function imagecreatefromavif(string $filename) : \GdImage|false {}
|
||||
function imagecreatefrombmp(string $filename) : \GdImage|false {}
|
||||
function imagecreatefromgd(string $filename) : \GdImage|false {}
|
||||
function imagecreatefromgd2(string $filename) : \GdImage|false {}
|
||||
function imagecreatefromgd2part(string $filename, int $x, int $y, int $width, int $height) : \GdImage|false {}
|
||||
function imagecreatefromgif(string $filename) : \GdImage|false {}
|
||||
function imagecreatefromjpeg(string $filename) : \GdImage|false {}
|
||||
function imagecreatefrompng(string $filename) : \GdImage|false {}
|
||||
function imagecreatefromstring(string $data) : \GdImage|false {}
|
||||
function imagecreatefromtga(string $filename) : \GdImage|false {}
|
||||
function imagecreatefromwbmp(string $filename) : \GdImage|false {}
|
||||
function imagecreatefromwebp(string $filename) : \GdImage|false {}
|
||||
function imagecreatefromxbm(string $filename) : \GdImage|false {}
|
||||
function imagecreatefromxpm(string $filename) : \GdImage|false {}
|
||||
function imagecreatetruecolor(int $width, int $height) : \GdImage|false {}
|
||||
function imagecrop(\GdImage $image, array $rectangle) : \GdImage|false {}
|
||||
function imagecropauto(\GdImage $image, int $mode = \IMG_CROP_DEFAULT, float $threshold = 0.5, int $color = -1) : \GdImage|false {}
|
||||
function imagedashedline(\GdImage $image, int $x1, int $y1, int $x2, int $y2, int $color) : bool {}
|
||||
function imagedestroy(\GdImage $image) : bool {}
|
||||
function imageellipse(\GdImage $image, int $center_x, int $center_y, int $width, int $height, int $color) : bool {}
|
||||
function imagefill(\GdImage $image, int $x, int $y, int $color) : bool {}
|
||||
function imagefilledarc(\GdImage $image, int $center_x, int $center_y, int $width, int $height, int $start_angle, int $end_angle, int $color, int $style) : bool {}
|
||||
function imagefilledellipse(\GdImage $image, int $center_x, int $center_y, int $width, int $height, int $color) : bool {}
|
||||
function imagefilledpolygon(\GdImage $image, array $points, int $num_points_or_color, ?int $color = null) : bool {}
|
||||
function imagefilledrectangle(\GdImage $image, int $x1, int $y1, int $x2, int $y2, int $color) : bool {}
|
||||
function imagefilltoborder(\GdImage $image, int $x, int $y, int $border_color, int $color) : bool {}
|
||||
function imagefilter(\GdImage $image, int $filter, ...$args) : bool {}
|
||||
function imageflip(\GdImage $image, int $mode) : bool {}
|
||||
function imagefontheight(\GdFont|int $font) : int {}
|
||||
function imagefontwidth(\GdFont|int $font) : int {}
|
||||
function imageftbbox(float $size, float $angle, string $font_filename, string $string, array $options = []) : array|false {}
|
||||
function imagefttext(\GdImage $image, float $size, float $angle, int $x, int $y, int $color, string $font_filename, string $text, array $options = []) : array|false {}
|
||||
function imagegammacorrect(\GdImage $image, float $input_gamma, float $output_gamma) : bool {}
|
||||
function imagegd(\GdImage $image, ?string $file = null) : bool {}
|
||||
function imagegd2(\GdImage $image, ?string $file = null, int $chunk_size = unknown, int $mode = unknown) : bool {}
|
||||
function imagegetclip(\GdImage $image) : array {}
|
||||
function imagegetinterpolation(\GdImage $image) : int {}
|
||||
function imagegif(\GdImage $image, $file = null) : bool {}
|
||||
function imageinterlace(\GdImage $image, ?bool $enable = null) : bool {}
|
||||
function imageistruecolor(\GdImage $image) : bool {}
|
||||
function imagejpeg(\GdImage $image, $file = null, int $quality = -1) : bool {}
|
||||
function imagelayereffect(\GdImage $image, int $effect) : bool {}
|
||||
function imageline(\GdImage $image, int $x1, int $y1, int $x2, int $y2, int $color) : bool {}
|
||||
function imageloadfont(string $filename) : \GdFont|false {}
|
||||
function imageopenpolygon(\GdImage $image, array $points, int $num_points_or_color, ?int $color = null) : bool {}
|
||||
function imagepalettecopy(\GdImage $dst, \GdImage $src) : void {}
|
||||
function imagepalettetotruecolor(\GdImage $image) : bool {}
|
||||
function imagepng(\GdImage $image, $file = null, int $quality = -1, int $filters = -1) : bool {}
|
||||
function imagepolygon(\GdImage $image, array $points, int $num_points_or_color, ?int $color = null) : bool {}
|
||||
function imagerectangle(\GdImage $image, int $x1, int $y1, int $x2, int $y2, int $color) : bool {}
|
||||
function imageresolution(\GdImage $image, ?int $resolution_x = null, ?int $resolution_y = null) : array|bool {}
|
||||
function imagerotate(\GdImage $image, float $angle, int $background_color, bool $ignore_transparent = false) : \GdImage|false {}
|
||||
function imagesavealpha(\GdImage $image, bool $enable) : bool {}
|
||||
function imagescale(\GdImage $image, int $width, int $height = -1, int $mode = \IMG_BILINEAR_FIXED) : \GdImage|false {}
|
||||
function imagesetbrush(\GdImage $image, \GdImage $brush) : bool {}
|
||||
function imagesetclip(\GdImage $image, int $x1, int $y1, int $x2, int $y2) : bool {}
|
||||
function imagesetinterpolation(\GdImage $image, int $method = \IMG_BILINEAR_FIXED) : bool {}
|
||||
function imagesetpixel(\GdImage $image, int $x, int $y, int $color) : bool {}
|
||||
function imagesetstyle(\GdImage $image, array $style) : bool {}
|
||||
function imagesetthickness(\GdImage $image, int $thickness) : bool {}
|
||||
function imagesettile(\GdImage $image, \GdImage $tile) : bool {}
|
||||
function imagestring(\GdImage $image, \GdFont|int $font, int $x, int $y, string $string, int $color) : bool {}
|
||||
function imagestringup(\GdImage $image, \GdFont|int $font, int $x, int $y, string $string, int $color) : bool {}
|
||||
function imagesx(\GdImage $image) : int {}
|
||||
function imagesy(\GdImage $image) : int {}
|
||||
function imagetruecolortopalette(\GdImage $image, bool $dither, int $num_colors) : bool {}
|
||||
function imagettfbbox(float $size, float $angle, string $font_filename, string $string, array $options = []) : array|false {}
|
||||
function imagettftext(\GdImage $image, float $size, float $angle, int $x, int $y, int $color, string $font_filename, string $text, array $options = []) : array|false {}
|
||||
function imagetypes() : int {}
|
||||
function imagewbmp(\GdImage $image, $file = null, ?int $foreground_color = null) : bool {}
|
||||
function imagewebp(\GdImage $image, $file = null, int $quality = -1) : bool {}
|
||||
function imagexbm(\GdImage $image, ?string $filename, ?int $foreground_color = null) : bool {}
|
||||
const GD_BUNDLED = 0;
|
||||
const GD_EXTRA_VERSION = '';
|
||||
const GD_MAJOR_VERSION = 2;
|
||||
const GD_MINOR_VERSION = 3;
|
||||
const GD_RELEASE_VERSION = 3;
|
||||
const GD_VERSION = '2.3.3';
|
||||
const IMG_AFFINE_ROTATE = 2;
|
||||
const IMG_AFFINE_SCALE = 1;
|
||||
const IMG_AFFINE_SHEAR_HORIZONTAL = 3;
|
||||
const IMG_AFFINE_SHEAR_VERTICAL = 4;
|
||||
const IMG_AFFINE_TRANSLATE = 0;
|
||||
const IMG_ARC_CHORD = 1;
|
||||
const IMG_ARC_EDGED = 4;
|
||||
const IMG_ARC_NOFILL = 2;
|
||||
const IMG_ARC_PIE = 0;
|
||||
const IMG_ARC_ROUNDED = 0;
|
||||
const IMG_AVIF = 256;
|
||||
const IMG_BELL = 1;
|
||||
const IMG_BESSEL = 2;
|
||||
const IMG_BICUBIC = 4;
|
||||
const IMG_BICUBIC_FIXED = 5;
|
||||
const IMG_BILINEAR_FIXED = 3;
|
||||
const IMG_BLACKMAN = 6;
|
||||
const IMG_BMP = 64;
|
||||
const IMG_BOX = 7;
|
||||
const IMG_BSPLINE = 8;
|
||||
const IMG_CATMULLROM = 9;
|
||||
const IMG_COLOR_BRUSHED = -3;
|
||||
const IMG_COLOR_STYLED = -2;
|
||||
const IMG_COLOR_STYLEDBRUSHED = -4;
|
||||
const IMG_COLOR_TILED = -5;
|
||||
const IMG_COLOR_TRANSPARENT = -6;
|
||||
const IMG_CROP_BLACK = 2;
|
||||
const IMG_CROP_DEFAULT = 0;
|
||||
const IMG_CROP_SIDES = 4;
|
||||
const IMG_CROP_THRESHOLD = 5;
|
||||
const IMG_CROP_TRANSPARENT = 1;
|
||||
const IMG_CROP_WHITE = 3;
|
||||
const IMG_EFFECT_ALPHABLEND = 1;
|
||||
const IMG_EFFECT_MULTIPLY = 4;
|
||||
const IMG_EFFECT_NORMAL = 2;
|
||||
const IMG_EFFECT_OVERLAY = 3;
|
||||
const IMG_EFFECT_REPLACE = 0;
|
||||
const IMG_FILTER_BRIGHTNESS = 2;
|
||||
const IMG_FILTER_COLORIZE = 4;
|
||||
const IMG_FILTER_CONTRAST = 3;
|
||||
const IMG_FILTER_EDGEDETECT = 5;
|
||||
const IMG_FILTER_EMBOSS = 6;
|
||||
const IMG_FILTER_GAUSSIAN_BLUR = 7;
|
||||
const IMG_FILTER_GRAYSCALE = 1;
|
||||
const IMG_FILTER_MEAN_REMOVAL = 9;
|
||||
const IMG_FILTER_NEGATE = 0;
|
||||
const IMG_FILTER_PIXELATE = 11;
|
||||
const IMG_FILTER_SCATTER = 12;
|
||||
const IMG_FILTER_SELECTIVE_BLUR = 8;
|
||||
const IMG_FILTER_SMOOTH = 10;
|
||||
const IMG_FLIP_BOTH = 3;
|
||||
const IMG_FLIP_HORIZONTAL = 1;
|
||||
const IMG_FLIP_VERTICAL = 2;
|
||||
const IMG_GAUSSIAN = 10;
|
||||
const IMG_GD2_COMPRESSED = 2;
|
||||
const IMG_GD2_RAW = 1;
|
||||
const IMG_GENERALIZED_CUBIC = 11;
|
||||
const IMG_GIF = 1;
|
||||
const IMG_HAMMING = 13;
|
||||
const IMG_HANNING = 14;
|
||||
const IMG_HERMITE = 12;
|
||||
const IMG_JPEG = 2;
|
||||
const IMG_JPG = 2;
|
||||
const IMG_MITCHELL = 15;
|
||||
const IMG_NEAREST_NEIGHBOUR = 16;
|
||||
const IMG_PNG = 4;
|
||||
const IMG_POWER = 17;
|
||||
const IMG_QUADRATIC = 18;
|
||||
const IMG_SINC = 19;
|
||||
const IMG_TGA = 128;
|
||||
const IMG_TRIANGLE = 20;
|
||||
const IMG_WBMP = 8;
|
||||
const IMG_WEBP = 32;
|
||||
const IMG_WEBP_LOSSLESS = 101;
|
||||
const IMG_WEIGHTED4 = 21;
|
||||
const IMG_XPM = 16;
|
||||
const PNG_ALL_FILTERS = 248;
|
||||
const PNG_FILTER_AVG = 64;
|
||||
const PNG_FILTER_NONE = 8;
|
||||
const PNG_FILTER_PAETH = 128;
|
||||
const PNG_FILTER_SUB = 16;
|
||||
const PNG_FILTER_UP = 32;
|
||||
const PNG_NO_FILTER = 0;
|
||||
}
|
||||
44
dev/tools/phan/stubs/geoip.phan_php
Normal file
44
dev/tools/phan/stubs/geoip.phan_php
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
// These stubs were generated by the phan stub generator.
|
||||
// @phan-stub-for-extension geoip@1.1.1
|
||||
|
||||
namespace {
|
||||
function geoip_asnum_by_name() {}
|
||||
function geoip_continent_code_by_name() {}
|
||||
function geoip_country_code3_by_name() {}
|
||||
function geoip_country_code3_by_name_v6() {}
|
||||
function geoip_country_code_by_name() {}
|
||||
function geoip_country_code_by_name_v6() {}
|
||||
function geoip_country_name_by_name() {}
|
||||
function geoip_country_name_by_name_v6() {}
|
||||
function geoip_database_info() {}
|
||||
function geoip_db_avail() {}
|
||||
function geoip_db_filename() {}
|
||||
function geoip_db_get_all_info() {}
|
||||
function geoip_domain_by_name() {}
|
||||
function geoip_id_by_name() {}
|
||||
function geoip_isp_by_name() {}
|
||||
function geoip_netspeedcell_by_name() {}
|
||||
function geoip_org_by_name() {}
|
||||
function geoip_record_by_name() {}
|
||||
function geoip_region_by_name() {}
|
||||
function geoip_region_name_by_code() {}
|
||||
function geoip_setup_custom_directory() {}
|
||||
function geoip_time_zone_by_country_and_region() {}
|
||||
const GEOIP_ASNUM_EDITION = 9;
|
||||
const GEOIP_CABLEDSL_SPEED = 2;
|
||||
const GEOIP_CITY_EDITION_REV0 = 6;
|
||||
const GEOIP_CITY_EDITION_REV1 = 2;
|
||||
const GEOIP_CORPORATE_SPEED = 3;
|
||||
const GEOIP_COUNTRY_EDITION = 1;
|
||||
const GEOIP_DIALUP_SPEED = 1;
|
||||
const GEOIP_DOMAIN_EDITION = 11;
|
||||
const GEOIP_ISP_EDITION = 4;
|
||||
const GEOIP_NETSPEED_EDITION = 10;
|
||||
const GEOIP_NETSPEED_EDITION_REV1 = 32;
|
||||
const GEOIP_ORG_EDITION = 5;
|
||||
const GEOIP_PROXY_EDITION = 8;
|
||||
const GEOIP_REGION_EDITION_REV0 = 7;
|
||||
const GEOIP_REGION_EDITION_REV1 = 3;
|
||||
const GEOIP_UNKNOWN_SPEED = 0;
|
||||
}
|
||||
194
dev/tools/phan/stubs/geoip_inc.php
Normal file
194
dev/tools/phan/stubs/geoip_inc.php
Normal file
|
|
@ -0,0 +1,194 @@
|
|||
<?php
|
||||
// phpcs:disable Generic.Files.LineLength,PEAR.Commenting,PEAR.NamingConventions
|
||||
class GeoIP
|
||||
{
|
||||
public $flags;
|
||||
public $filehandle;
|
||||
public $memory_buffer;
|
||||
public $databaseType;
|
||||
public $databaseSegments;
|
||||
public $record_length;
|
||||
public $shmid;
|
||||
public $GEOIP_COUNTRY_CODE_TO_NUMBER = array("" => 0, "AP" => 1, "EU" => 2, "AD" => 3, "AE" => 4, "AF" => 5, "AG" => 6, "AI" => 7, "AL" => 8, "AM" => 9, "CW" => 10, "AO" => 11, "AQ" => 12, "AR" => 13, "AS" => 14, "AT" => 15, "AU" => 16, "AW" => 17, "AZ" => 18, "BA" => 19, "BB" => 20, "BD" => 21, "BE" => 22, "BF" => 23, "BG" => 24, "BH" => 25, "BI" => 26, "BJ" => 27, "BM" => 28, "BN" => 29, "BO" => 30, "BR" => 31, "BS" => 32, "BT" => 33, "BV" => 34, "BW" => 35, "BY" => 36, "BZ" => 37, "CA" => 38, "CC" => 39, "CD" => 40, "CF" => 41, "CG" => 42, "CH" => 43, "CI" => 44, "CK" => 45, "CL" => 46, "CM" => 47, "CN" => 48, "CO" => 49, "CR" => 50, "CU" => 51, "CV" => 52, "CX" => 53, "CY" => 54, "CZ" => 55, "DE" => 56, "DJ" => 57, "DK" => 58, "DM" => 59, "DO" => 60, "DZ" => 61, "EC" => 62, "EE" => 63, "EG" => 64, "EH" => 65, "ER" => 66, "ES" => 67, "ET" => 68, "FI" => 69, "FJ" => 70, "FK" => 71, "FM" => 72, "FO" => 73, "FR" => 74, "SX" => 75, "GA" => 76, "GB" => 77, "GD" => 78, "GE" => 79, "GF" => 80, "GH" => 81, "GI" => 82, "GL" => 83, "GM" => 84, "GN" => 85, "GP" => 86, "GQ" => 87, "GR" => 88, "GS" => 89, "GT" => 90, "GU" => 91, "GW" => 92, "GY" => 93, "HK" => 94, "HM" => 95, "HN" => 96, "HR" => 97, "HT" => 98, "HU" => 99, "ID" => 100, "IE" => 101, "IL" => 102, "IN" => 103, "IO" => 104, "IQ" => 105, "IR" => 106, "IS" => 107, "IT" => 108, "JM" => 109, "JO" => 110, "JP" => 111, "KE" => 112, "KG" => 113, "KH" => 114, "KI" => 115, "KM" => 116, "KN" => 117, "KP" => 118, "KR" => 119, "KW" => 120, "KY" => 121, "KZ" => 122, "LA" => 123, "LB" => 124, "LC" => 125, "LI" => 126, "LK" => 127, "LR" => 128, "LS" => 129, "LT" => 130, "LU" => 131, "LV" => 132, "LY" => 133, "MA" => 134, "MC" => 135, "MD" => 136, "MG" => 137, "MH" => 138, "MK" => 139, "ML" => 140, "MM" => 141, "MN" => 142, "MO" => 143, "MP" => 144, "MQ" => 145, "MR" => 146, "MS" => 147, "MT" => 148, "MU" => 149, "MV" => 150, "MW" => 151, "MX" => 152, "MY" => 153, "MZ" => 154, "NA" => 155, "NC" => 156, "NE" => 157, "NF" => 158, "NG" => 159, "NI" => 160, "NL" => 161, "NO" => 162, "NP" => 163, "NR" => 164, "NU" => 165, "NZ" => 166, "OM" => 167, "PA" => 168, "PE" => 169, "PF" => 170, "PG" => 171, "PH" => 172, "PK" => 173, "PL" => 174, "PM" => 175, "PN" => 176, "PR" => 177, "PS" => 178, "PT" => 179, "PW" => 180, "PY" => 181, "QA" => 182, "RE" => 183, "RO" => 184, "RU" => 185, "RW" => 186, "SA" => 187, "SB" => 188, "SC" => 189, "SD" => 190, "SE" => 191, "SG" => 192, "SH" => 193, "SI" => 194, "SJ" => 195, "SK" => 196, "SL" => 197, "SM" => 198, "SN" => 199, "SO" => 200, "SR" => 201, "ST" => 202, "SV" => 203, "SY" => 204, "SZ" => 205, "TC" => 206, "TD" => 207, "TF" => 208, "TG" => 209, "TH" => 210, "TJ" => 211, "TK" => 212, "TM" => 213, "TN" => 214, "TO" => 215, "TL" => 216, "TR" => 217, "TT" => 218, "TV" => 219, "TW" => 220, "TZ" => 221, "UA" => 222, "UG" => 223, "UM" => 224, "US" => 225, "UY" => 226, "UZ" => 227, "VA" => 228, "VC" => 229, "VE" => 230, "VG" => 231, "VI" => 232, "VN" => 233, "VU" => 234, "WF" => 235, "WS" => 236, "YE" => 237, "YT" => 238, "RS" => 239, "ZA" => 240, "ZM" => 241, "ME" => 242, "ZW" => 243, "A1" => 244, "A2" => 245, "O1" => 246, "AX" => 247, "GG" => 248, "IM" => 249, "JE" => 250, "BL" => 251, "MF" => 252, "BQ" => 253, "SS" => 254);
|
||||
public $GEOIP_COUNTRY_CODES = array("", "AP", "EU", "AD", "AE", "AF", "AG", "AI", "AL", "AM", "CW", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BM", "BN", "BO", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "SX", "GA", "GB", "GD", "GE", "GF", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IN", "IO", "IQ", "IR", "IS", "IT", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "ST", "SV", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TM", "TN", "TO", "TL", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "YE", "YT", "RS", "ZA", "ZM", "ME", "ZW", "A1", "A2", "O1", "AX", "GG", "IM", "JE", "BL", "MF", "BQ", "SS", "O1");
|
||||
public $GEOIP_COUNTRY_CODES3 = array("", "AP", "EU", "AND", "ARE", "AFG", "ATG", "AIA", "ALB", "ARM", "CUW", "AGO", "ATA", "ARG", "ASM", "AUT", "AUS", "ABW", "AZE", "BIH", "BRB", "BGD", "BEL", "BFA", "BGR", "BHR", "BDI", "BEN", "BMU", "BRN", "BOL", "BRA", "BHS", "BTN", "BVT", "BWA", "BLR", "BLZ", "CAN", "CCK", "COD", "CAF", "COG", "CHE", "CIV", "COK", "CHL", "CMR", "CHN", "COL", "CRI", "CUB", "CPV", "CXR", "CYP", "CZE", "DEU", "DJI", "DNK", "DMA", "DOM", "DZA", "ECU", "EST", "EGY", "ESH", "ERI", "ESP", "ETH", "FIN", "FJI", "FLK", "FSM", "FRO", "FRA", "SXM", "GAB", "GBR", "GRD", "GEO", "GUF", "GHA", "GIB", "GRL", "GMB", "GIN", "GLP", "GNQ", "GRC", "SGS", "GTM", "GUM", "GNB", "GUY", "HKG", "HMD", "HND", "HRV", "HTI", "HUN", "IDN", "IRL", "ISR", "IND", "IOT", "IRQ", "IRN", "ISL", "ITA", "JAM", "JOR", "JPN", "KEN", "KGZ", "KHM", "KIR", "COM", "KNA", "PRK", "KOR", "KWT", "CYM", "KAZ", "LAO", "LBN", "LCA", "LIE", "LKA", "LBR", "LSO", "LTU", "LUX", "LVA", "LBY", "MAR", "MCO", "MDA", "MDG", "MHL", "MKD", "MLI", "MMR", "MNG", "MAC", "MNP", "MTQ", "MRT", "MSR", "MLT", "MUS", "MDV", "MWI", "MEX", "MYS", "MOZ", "NAM", "NCL", "NER", "NFK", "NGA", "NIC", "NLD", "NOR", "NPL", "NRU", "NIU", "NZL", "OMN", "PAN", "PER", "PYF", "PNG", "PHL", "PAK", "POL", "SPM", "PCN", "PRI", "PSE", "PRT", "PLW", "PRY", "QAT", "REU", "ROU", "RUS", "RWA", "SAU", "SLB", "SYC", "SDN", "SWE", "SGP", "SHN", "SVN", "SJM", "SVK", "SLE", "SMR", "SEN", "SOM", "SUR", "STP", "SLV", "SYR", "SWZ", "TCA", "TCD", "ATF", "TGO", "THA", "TJK", "TKL", "TKM", "TUN", "TON", "TLS", "TUR", "TTO", "TUV", "TWN", "TZA", "UKR", "UGA", "UMI", "USA", "URY", "UZB", "VAT", "VCT", "VEN", "VGB", "VIR", "VNM", "VUT", "WLF", "WSM", "YEM", "MYT", "SRB", "ZAF", "ZMB", "MNE", "ZWE", "A1", "A2", "O1", "ALA", "GGY", "IMN", "JEY", "BLM", "MAF", "BES", "SSD", "O1");
|
||||
public $GEOIP_COUNTRY_NAMES = array("", "Asia/Pacific Region", "Europe", "Andorra", "United Arab Emirates", "Afghanistan", "Antigua and Barbuda", "Anguilla", "Albania", "Armenia", "Curacao", "Angola", "Antarctica", "Argentina", "American Samoa", "Austria", "Australia", "Aruba", "Azerbaijan", "Bosnia and Herzegovina", "Barbados", "Bangladesh", "Belgium", "Burkina Faso", "Bulgaria", "Bahrain", "Burundi", "Benin", "Bermuda", "Brunei Darussalam", "Bolivia", "Brazil", "Bahamas", "Bhutan", "Bouvet Island", "Botswana", "Belarus", "Belize", "Canada", "Cocos (Keeling) Islands", "Congo, The Democratic Republic of the", "Central African Republic", "Congo", "Switzerland", "Cote D'Ivoire", "Cook Islands", "Chile", "Cameroon", "China", "Colombia", "Costa Rica", "Cuba", "Cape Verde", "Christmas Island", "Cyprus", "Czech Republic", "Germany", "Djibouti", "Denmark", "Dominica", "Dominican Republic", "Algeria", "Ecuador", "Estonia", "Egypt", "Western Sahara", "Eritrea", "Spain", "Ethiopia", "Finland", "Fiji", "Falkland Islands (Malvinas)", "Micronesia, Federated States of", "Faroe Islands", "France", "Sint Maarten (Dutch part)", "Gabon", "United Kingdom", "Grenada", "Georgia", "French Guiana", "Ghana", "Gibraltar", "Greenland", "Gambia", "Guinea", "Guadeloupe", "Equatorial Guinea", "Greece", "South Georgia and the South Sandwich Islands", "Guatemala", "Guam", "Guinea-Bissau", "Guyana", "Hong Kong", "Heard Island and McDonald Islands", "Honduras", "Croatia", "Haiti", "Hungary", "Indonesia", "Ireland", "Israel", "India", "British Indian Ocean Territory", "Iraq", "Iran, Islamic Republic of", "Iceland", "Italy", "Jamaica", "Jordan", "Japan", "Kenya", "Kyrgyzstan", "Cambodia", "Kiribati", "Comoros", "Saint Kitts and Nevis", "Korea, Democratic People's Republic of", "Korea, Republic of", "Kuwait", "Cayman Islands", "Kazakhstan", "Lao People's Democratic Republic", "Lebanon", "Saint Lucia", "Liechtenstein", "Sri Lanka", "Liberia", "Lesotho", "Lithuania", "Luxembourg", "Latvia", "Libya", "Morocco", "Monaco", "Moldova, Republic of", "Madagascar", "Marshall Islands", "Macedonia", "Mali", "Myanmar", "Mongolia", "Macau", "Northern Mariana Islands", "Martinique", "Mauritania", "Montserrat", "Malta", "Mauritius", "Maldives", "Malawi", "Mexico", "Malaysia", "Mozambique", "Namibia", "New Caledonia", "Niger", "Norfolk Island", "Nigeria", "Nicaragua", "Netherlands", "Norway", "Nepal", "Nauru", "Niue", "New Zealand", "Oman", "Panama", "Peru", "French Polynesia", "Papua New Guinea", "Philippines", "Pakistan", "Poland", "Saint Pierre and Miquelon", "Pitcairn Islands", "Puerto Rico", "Palestinian Territory", "Portugal", "Palau", "Paraguay", "Qatar", "Reunion", "Romania", "Russian Federation", "Rwanda", "Saudi Arabia", "Solomon Islands", "Seychelles", "Sudan", "Sweden", "Singapore", "Saint Helena", "Slovenia", "Svalbard and Jan Mayen", "Slovakia", "Sierra Leone", "San Marino", "Senegal", "Somalia", "Suriname", "Sao Tome and Principe", "El Salvador", "Syrian Arab Republic", "Swaziland", "Turks and Caicos Islands", "Chad", "French Southern Territories", "Togo", "Thailand", "Tajikistan", "Tokelau", "Turkmenistan", "Tunisia", "Tonga", "Timor-Leste", "Turkey", "Trinidad and Tobago", "Tuvalu", "Taiwan", "Tanzania, United Republic of", "Ukraine", "Uganda", "United States Minor Outlying Islands", "United States", "Uruguay", "Uzbekistan", "Holy See (Vatican City State)", "Saint Vincent and the Grenadines", "Venezuela", "Virgin Islands, British", "Virgin Islands, U.S.", "Vietnam", "Vanuatu", "Wallis and Futuna", "Samoa", "Yemen", "Mayotte", "Serbia", "South Africa", "Zambia", "Montenegro", "Zimbabwe", "Anonymous Proxy", "Satellite Provider", "Other", "Aland Islands", "Guernsey", "Isle of Man", "Jersey", "Saint Barthelemy", "Saint Martin", "Bonaire, Saint Eustatius and Saba", "South Sudan", "Other");
|
||||
public $GEOIP_CONTINENT_CODES = array("--", "AS", "EU", "EU", "AS", "AS", "NA", "NA", "EU", "AS", "NA", "AF", "AN", "SA", "OC", "EU", "OC", "NA", "AS", "EU", "NA", "AS", "EU", "AF", "EU", "AS", "AF", "AF", "NA", "AS", "SA", "SA", "NA", "AS", "AN", "AF", "EU", "NA", "NA", "AS", "AF", "AF", "AF", "EU", "AF", "OC", "SA", "AF", "AS", "SA", "NA", "NA", "AF", "AS", "AS", "EU", "EU", "AF", "EU", "NA", "NA", "AF", "SA", "EU", "AF", "AF", "AF", "EU", "AF", "EU", "OC", "SA", "OC", "EU", "EU", "NA", "AF", "EU", "NA", "AS", "SA", "AF", "EU", "NA", "AF", "AF", "NA", "AF", "EU", "AN", "NA", "OC", "AF", "SA", "AS", "AN", "NA", "EU", "NA", "EU", "AS", "EU", "AS", "AS", "AS", "AS", "AS", "EU", "EU", "NA", "AS", "AS", "AF", "AS", "AS", "OC", "AF", "NA", "AS", "AS", "AS", "NA", "AS", "AS", "AS", "NA", "EU", "AS", "AF", "AF", "EU", "EU", "EU", "AF", "AF", "EU", "EU", "AF", "OC", "EU", "AF", "AS", "AS", "AS", "OC", "NA", "AF", "NA", "EU", "AF", "AS", "AF", "NA", "AS", "AF", "AF", "OC", "AF", "OC", "AF", "NA", "EU", "EU", "AS", "OC", "OC", "OC", "AS", "NA", "SA", "OC", "OC", "AS", "AS", "EU", "NA", "OC", "NA", "AS", "EU", "OC", "SA", "AS", "AF", "EU", "EU", "AF", "AS", "OC", "AF", "AF", "EU", "AS", "AF", "EU", "EU", "EU", "AF", "EU", "AF", "AF", "SA", "AF", "NA", "AS", "AF", "NA", "AF", "AN", "AF", "AS", "AS", "OC", "AS", "AF", "OC", "AS", "EU", "NA", "OC", "AS", "AF", "EU", "AF", "OC", "NA", "SA", "AS", "EU", "NA", "SA", "NA", "NA", "AS", "OC", "OC", "OC", "AS", "AF", "EU", "AF", "AF", "EU", "AF", "--", "--", "--", "EU", "EU", "EU", "EU", "NA", "NA", "NA", "AF", "--");
|
||||
}
|
||||
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */
|
||||
/* geoip.inc
|
||||
*
|
||||
* Copyright (C) 2007 MaxMind LLC
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
\define("GEOIP_COUNTRY_BEGIN", 16776960);
|
||||
\define("GEOIP_STATE_BEGIN_REV0", 16700000);
|
||||
\define("GEOIP_STATE_BEGIN_REV1", 16000000);
|
||||
\define("GEOIP_STANDARD", 0);
|
||||
\define("GEOIP_MEMORY_CACHE", 1);
|
||||
\define("GEOIP_SHARED_MEMORY", 2);
|
||||
\define("STRUCTURE_INFO_MAX_SIZE", 20);
|
||||
\define("DATABASE_INFO_MAX_SIZE", 100);
|
||||
\define("GEOIP_COUNTRY_EDITION", 1);
|
||||
\define("GEOIP_PROXY_EDITION", 8);
|
||||
\define("GEOIP_ASNUM_EDITION", 9);
|
||||
\define("GEOIP_NETSPEED_EDITION", 10);
|
||||
\define("GEOIP_REGION_EDITION_REV0", 7);
|
||||
\define("GEOIP_REGION_EDITION_REV1", 3);
|
||||
\define("GEOIP_CITY_EDITION_REV0", 6);
|
||||
\define("GEOIP_CITY_EDITION_REV1", 2);
|
||||
\define("GEOIP_ORG_EDITION", 5);
|
||||
\define("GEOIP_ISP_EDITION", 4);
|
||||
\define("SEGMENT_RECORD_LENGTH", 3);
|
||||
\define("STANDARD_RECORD_LENGTH", 3);
|
||||
\define("ORG_RECORD_LENGTH", 4);
|
||||
\define("MAX_RECORD_LENGTH", 4);
|
||||
\define("MAX_ORG_RECORD_LENGTH", 300);
|
||||
\define("GEOIP_SHM_KEY", 0x4f415401);
|
||||
\define("US_OFFSET", 1);
|
||||
\define("CANADA_OFFSET", 677);
|
||||
\define("WORLD_OFFSET", 1353);
|
||||
\define("FIPS_RANGE", 360);
|
||||
\define("GEOIP_UNKNOWN_SPEED", 0);
|
||||
\define("GEOIP_DIALUP_SPEED", 1);
|
||||
\define("GEOIP_CABLEDSL_SPEED", 2);
|
||||
\define("GEOIP_CORPORATE_SPEED", 3);
|
||||
\define("GEOIP_DOMAIN_EDITION", 11);
|
||||
\define("GEOIP_COUNTRY_EDITION_V6", 12);
|
||||
\define("GEOIP_LOCATIONA_EDITION", 13);
|
||||
\define("GEOIP_ACCURACYRADIUS_EDITION", 14);
|
||||
\define("GEOIP_CITYCOMBINED_EDITION", 15);
|
||||
\define("GEOIP_CITY_EDITION_REV1_V6", 30);
|
||||
\define("GEOIP_CITY_EDITION_REV0_V6", 31);
|
||||
\define("GEOIP_NETSPEED_EDITION_REV1", 32);
|
||||
\define("GEOIP_NETSPEED_EDITION_REV1_V6", 33);
|
||||
\define("GEOIP_USERTYPE_EDITION", 28);
|
||||
\define("GEOIP_USERTYPE_EDITION_V6", 29);
|
||||
\define("GEOIP_ASNUM_EDITION_V6", 21);
|
||||
\define("GEOIP_ISP_EDITION_V6", 22);
|
||||
\define("GEOIP_ORG_EDITION_V6", 23);
|
||||
\define("GEOIP_DOMAIN_EDITION_V6", 24);
|
||||
\define("CITYCOMBINED_FIXED_RECORD", 7);
|
||||
function geoip_load_shared_mem($file)
|
||||
{
|
||||
}
|
||||
function _setup_segments($gi)
|
||||
{
|
||||
}
|
||||
// This should be only used for variable-length records where
|
||||
// $start + $maxLength may be greater than the shared mem size
|
||||
function _sharedMemRead($gi, $start, $maxLength)
|
||||
{
|
||||
}
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param int $flags
|
||||
* @return GeoIP
|
||||
*/
|
||||
function geoip_open($filename, $flags)
|
||||
{
|
||||
}
|
||||
/**
|
||||
* @param GeoIP $gi
|
||||
* @return bool
|
||||
*/
|
||||
function geoip_close($gi)
|
||||
{
|
||||
}
|
||||
function geoip_country_id_by_name_v6($gi, $name)
|
||||
{
|
||||
}
|
||||
function geoip_country_id_by_name($gi, $name)
|
||||
{
|
||||
}
|
||||
function geoip_country_code_by_name_v6($gi, $name)
|
||||
{
|
||||
}
|
||||
function geoip_country_code_by_name($gi, $name)
|
||||
{
|
||||
}
|
||||
function geoip_country_name_by_name_v6($gi, $name)
|
||||
{
|
||||
}
|
||||
function geoip_country_name_by_name($gi, $name)
|
||||
{
|
||||
}
|
||||
function geoip_country_id_by_addr_v6($gi, $addr)
|
||||
{
|
||||
}
|
||||
function geoip_country_id_by_addr($gi, $addr)
|
||||
{
|
||||
}
|
||||
/**
|
||||
* @return string|false
|
||||
*/
|
||||
function geoip_country_code_by_addr_v6($gi, $addr)
|
||||
{
|
||||
}
|
||||
/**
|
||||
* @param GeoIP $gi
|
||||
* @return string|false
|
||||
*/
|
||||
function geoip_country_code_by_addr($gi, $addr)
|
||||
{
|
||||
}
|
||||
/**
|
||||
* @param GeoIP $gi
|
||||
* @return string|false
|
||||
*/
|
||||
function geoip_country_name_by_addr_v6($gi, $addr)
|
||||
{
|
||||
}
|
||||
/**
|
||||
* @param GeoIP $gi
|
||||
* @return string|false
|
||||
*/
|
||||
function geoip_country_name_by_addr($gi, $addr)
|
||||
{
|
||||
}
|
||||
function _geoip_seek_country_v6($gi, $ipnum)
|
||||
{
|
||||
}
|
||||
function _geoip_seek_country($gi, $ipnum)
|
||||
{
|
||||
}
|
||||
function _common_get_org($gi, $seek_org)
|
||||
{
|
||||
}
|
||||
function _get_org_v6($gi, $ipnum)
|
||||
{
|
||||
}
|
||||
function _get_org($gi, $ipnum)
|
||||
{
|
||||
}
|
||||
function geoip_name_by_addr_v6($gi, $addr)
|
||||
{
|
||||
}
|
||||
function geoip_name_by_addr($gi, $addr)
|
||||
{
|
||||
}
|
||||
function geoip_org_by_addr($gi, $addr)
|
||||
{
|
||||
}
|
||||
function _get_region($gi, $ipnum)
|
||||
{
|
||||
}
|
||||
function geoip_region_by_addr($gi, $addr)
|
||||
{
|
||||
}
|
||||
function _safe_substr($string, $start, $length)
|
||||
{
|
||||
}
|
||||
149
dev/tools/phan/stubs/imap.phan_php
Normal file
149
dev/tools/phan/stubs/imap.phan_php
Normal file
|
|
@ -0,0 +1,149 @@
|
|||
<?php
|
||||
// These stubs were generated by the phan stub generator.
|
||||
// @phan-stub-for-extension imap@7.4.33
|
||||
|
||||
namespace {
|
||||
function imap_8bit($text) {}
|
||||
function imap_alerts() {}
|
||||
function imap_append($stream_id, $folder, $message, $options = null, $date = null) {}
|
||||
function imap_base64($text) {}
|
||||
function imap_binary($text) {}
|
||||
function imap_body($stream_id, $msg_no, $options = null) {}
|
||||
function imap_bodystruct($stream_id, $msg_no, $section) {}
|
||||
function imap_check($stream_id) {}
|
||||
function imap_clearflag_full($stream_id, $sequence, $flag, $options = null) {}
|
||||
function imap_close($stream_id, $options = null) {}
|
||||
function imap_create($stream_id, $mailbox) {}
|
||||
function imap_createmailbox($stream_id, $mailbox) {}
|
||||
function imap_delete($stream_id, $msg_no, $options = null) {}
|
||||
function imap_deletemailbox($stream_id, $mailbox) {}
|
||||
function imap_errors() {}
|
||||
function imap_expunge($stream_id) {}
|
||||
function imap_fetch_overview($stream_id, $sequence, $options = null) {}
|
||||
function imap_fetchbody($stream_id, $msg_no, $section, $options = null) {}
|
||||
function imap_fetchheader($stream_id, $msg_no, $options = null) {}
|
||||
function imap_fetchmime($stream_id, $msg_no, $section, $options = null) {}
|
||||
function imap_fetchstructure($stream_id, $msg_no, $options = null) {}
|
||||
function imap_fetchtext($stream_id, $msg_no, $options = null) {}
|
||||
function imap_gc($stream_id, $flags = null) {}
|
||||
function imap_get_quota($stream_id, $qroot) {}
|
||||
function imap_get_quotaroot($stream_id, $mbox) {}
|
||||
function imap_getacl($stream_id, $mailbox) {}
|
||||
function imap_getmailboxes($stream_id, $ref, $pattern) {}
|
||||
function imap_getsubscribed($stream_id, $ref, $pattern) {}
|
||||
function imap_header($stream_id, $msg_no, $from_length = null, $subject_length = null, $default_host = null) {}
|
||||
function imap_headerinfo($stream_id, $msg_no, $from_length = null, $subject_length = null, $default_host = null) {}
|
||||
function imap_headers($stream_id) {}
|
||||
function imap_last_error() {}
|
||||
function imap_list($stream_id, $ref, $pattern) {}
|
||||
function imap_listmailbox($stream_id, $ref, $pattern) {}
|
||||
function imap_listscan($stream_id, $ref, $pattern, $content) {}
|
||||
function imap_listsubscribed($stream_id, $ref, $pattern) {}
|
||||
function imap_lsub($stream_id, $ref, $pattern) {}
|
||||
function imap_mail($to, $subject, $message, $additional_headers = null, $cc = null, $bcc = null, $rpath = null) {}
|
||||
function imap_mail_compose($envelope, $body) {}
|
||||
function imap_mail_copy($stream_id, $msglist, $mailbox, $options = null) {}
|
||||
function imap_mail_move($stream_id, $sequence, $mailbox, $options = null) {}
|
||||
function imap_mailboxmsginfo($stream_id) {}
|
||||
function imap_mime_header_decode($str) {}
|
||||
function imap_msgno($stream_id, $unique_msg_id) {}
|
||||
function imap_mutf7_to_utf8($in) {}
|
||||
function imap_num_msg($stream_id) {}
|
||||
function imap_num_recent($stream_id) {}
|
||||
function imap_open($mailbox, $user, $password, $options = null, $n_retries = null, $params = null) {}
|
||||
function imap_ping($stream_id) {}
|
||||
function imap_qprint($text) {}
|
||||
function imap_rename($stream_id, $old_name, $new_name) {}
|
||||
function imap_renamemailbox($stream_id, $old_name, $new_name) {}
|
||||
function imap_reopen($stream_id, $mailbox, $options = null, $n_retries = null) {}
|
||||
function imap_rfc822_parse_adrlist($address_string, $default_host) {}
|
||||
function imap_rfc822_parse_headers($headers, $default_host = null) {}
|
||||
function imap_rfc822_write_address($mailbox, $host, $personal) {}
|
||||
function imap_savebody($stream_id, $file, $msg_no, $section = null, $options = null) {}
|
||||
function imap_scan($stream_id, $ref, $pattern, $content) {}
|
||||
function imap_scanmailbox($stream_id, $ref, $pattern, $content) {}
|
||||
function imap_search($stream_id, $criteria, $options = null, $charset = null) {}
|
||||
function imap_set_quota($stream_id, $qroot, $mailbox_size) {}
|
||||
function imap_setacl($stream_id, $mailbox, $id, $rights) {}
|
||||
function imap_setflag_full($stream_id, $sequence, $flag, $options = null) {}
|
||||
function imap_sort($stream_id, $criteria, $reverse, $options = null, $search_criteria = null, $charset = null) {}
|
||||
function imap_status($stream_id, $mailbox, $options) {}
|
||||
function imap_subscribe($stream_id, $mailbox) {}
|
||||
function imap_thread($stream_id, $options = null) {}
|
||||
function imap_timeout($timeout_type, $timeout = null) {}
|
||||
function imap_uid($stream_id, $msg_no) {}
|
||||
function imap_undelete($stream_id, $msg_no, $flags = null) {}
|
||||
function imap_unsubscribe($stream_id, $mailbox) {}
|
||||
function imap_utf7_decode($buf) {}
|
||||
function imap_utf7_encode($buf) {}
|
||||
function imap_utf8($mime_encoded_text) {}
|
||||
function imap_utf8_to_mutf7($in) {}
|
||||
const CL_EXPUNGE = 32768;
|
||||
const CP_MOVE = 2;
|
||||
const CP_UID = 1;
|
||||
const ENC7BIT = 0;
|
||||
const ENC8BIT = 1;
|
||||
const ENCBASE64 = 3;
|
||||
const ENCBINARY = 2;
|
||||
const ENCOTHER = 5;
|
||||
const ENCQUOTEDPRINTABLE = 4;
|
||||
const FT_INTERNAL = 8;
|
||||
const FT_NOT = 4;
|
||||
const FT_PEEK = 2;
|
||||
const FT_PREFETCHTEXT = 32;
|
||||
const FT_UID = 1;
|
||||
const IMAP_CLOSETIMEOUT = 4;
|
||||
const IMAP_GC_ELT = 1;
|
||||
const IMAP_GC_ENV = 2;
|
||||
const IMAP_GC_TEXTS = 4;
|
||||
const IMAP_OPENTIMEOUT = 1;
|
||||
const IMAP_READTIMEOUT = 2;
|
||||
const IMAP_WRITETIMEOUT = 3;
|
||||
const LATT_HASCHILDREN = 32;
|
||||
const LATT_HASNOCHILDREN = 64;
|
||||
const LATT_MARKED = 4;
|
||||
const LATT_NOINFERIORS = 1;
|
||||
const LATT_NOSELECT = 2;
|
||||
const LATT_REFERRAL = 16;
|
||||
const LATT_UNMARKED = 8;
|
||||
const NIL = 0;
|
||||
const OP_ANONYMOUS = 4;
|
||||
const OP_DEBUG = 1;
|
||||
const OP_EXPUNGE = 128;
|
||||
const OP_HALFOPEN = 64;
|
||||
const OP_PROTOTYPE = 32;
|
||||
const OP_READONLY = 2;
|
||||
const OP_SECURE = 256;
|
||||
const OP_SHORTCACHE = 8;
|
||||
const OP_SILENT = 16;
|
||||
const SA_ALL = 31;
|
||||
const SA_MESSAGES = 1;
|
||||
const SA_RECENT = 2;
|
||||
const SA_UIDNEXT = 8;
|
||||
const SA_UIDVALIDITY = 16;
|
||||
const SA_UNSEEN = 4;
|
||||
const SE_FREE = 2;
|
||||
const SE_NOPREFETCH = 4;
|
||||
const SE_UID = 1;
|
||||
const SORTARRIVAL = 1;
|
||||
const SORTCC = 5;
|
||||
const SORTDATE = 0;
|
||||
const SORTFROM = 2;
|
||||
const SORTSIZE = 6;
|
||||
const SORTSUBJECT = 3;
|
||||
const SORTTO = 4;
|
||||
const SO_FREE = 8;
|
||||
const SO_NOSERVER = 16;
|
||||
const ST_SET = 4;
|
||||
const ST_SILENT = 2;
|
||||
const ST_UID = 1;
|
||||
const TYPEAPPLICATION = 3;
|
||||
const TYPEAUDIO = 4;
|
||||
const TYPEIMAGE = 5;
|
||||
const TYPEMESSAGE = 2;
|
||||
const TYPEMODEL = 7;
|
||||
const TYPEMULTIPART = 1;
|
||||
const TYPEOTHER = 8;
|
||||
const TYPETEXT = 0;
|
||||
const TYPEVIDEO = 6;
|
||||
}
|
||||
1807
dev/tools/phan/stubs/intl.phan_php
Normal file
1807
dev/tools/phan/stubs/intl.phan_php
Normal file
File diff suppressed because it is too large
Load Diff
157
dev/tools/phan/stubs/ldap.phan_php
Normal file
157
dev/tools/phan/stubs/ldap.phan_php
Normal file
|
|
@ -0,0 +1,157 @@
|
|||
<?php
|
||||
// These stubs were generated by the phan stub generator.
|
||||
// @phan-stub-for-extension ldap@7.4.33
|
||||
|
||||
namespace {
|
||||
function ldap_add($link_identifier, $dn, $entry, $servercontrols = null) {}
|
||||
function ldap_add_ext($link_identifier, $dn, $entry, $servercontrols = null) {}
|
||||
function ldap_bind($link_identifier, $bind_rdn = null, $bind_password = null) {}
|
||||
function ldap_bind_ext($link_identifier, $bind_rdn = null, $bind_password = null, $servercontrols = null) {}
|
||||
function ldap_close($link_identifier) {}
|
||||
function ldap_compare($link_identifier, $dn, $attribute, $value, $servercontrols = null) {}
|
||||
function ldap_connect($hostname = null, $port = null) {}
|
||||
function ldap_control_paged_result($link, $pagesize, $iscritical = null, $cookie = null) {}
|
||||
function ldap_control_paged_result_response($link, $result, &$cookie = null, &$estimated = null) {}
|
||||
function ldap_count_entries($link_identifier, $result_identifier) {}
|
||||
function ldap_delete($link_identifier, $dn, $servercontrols = null) {}
|
||||
function ldap_delete_ext($link_identifier, $dn, $servercontrols = null) {}
|
||||
function ldap_dn2ufn($dn) {}
|
||||
function ldap_err2str($errno) {}
|
||||
/** @return int */
|
||||
function ldap_errno($link_identifier) {}
|
||||
/** @return string */
|
||||
function ldap_error($link_identifier) {}
|
||||
function ldap_escape($value, $ignore = null, $flags = null) {}
|
||||
function ldap_exop($link, $reqoid, $reqdata = null, $servercontrols = null, &$retdata = null, &$retoid = null) {}
|
||||
function ldap_exop_passwd($link, $user = null, $oldpw = null, $newpw = null, &$serverctrls = null) {}
|
||||
function ldap_exop_refresh($link, $dn, $ttl) {}
|
||||
function ldap_exop_whoami($link) {}
|
||||
function ldap_explode_dn($dn, $with_attrib) {}
|
||||
function ldap_first_attribute($link_identifier, $result_entry_identifier) {}
|
||||
function ldap_first_entry($link_identifier, $result_identifier) {}
|
||||
function ldap_first_reference($link, $result) {}
|
||||
function ldap_free_result($link_identifier) {}
|
||||
function ldap_get_attributes($link_identifier, $result_entry_identifier) {}
|
||||
function ldap_get_dn($link_identifier, $result_entry_identifier) {}
|
||||
function ldap_get_entries($link_identifier, $result_identifier) {}
|
||||
function ldap_get_option($link_identifier, $option, &$retval) {}
|
||||
function ldap_get_values($link_identifier, $result_entry_identifier, $attribute) {}
|
||||
function ldap_get_values_len($link_identifier, $result_entry_identifier, $attribute) {}
|
||||
function ldap_list($link_identifier, $base_dn, $filter, $attributes = null, $attrsonly = null, $sizelimit = null, $timelimit = null, $deref = null, $servercontrols = null) {}
|
||||
function ldap_mod_add($link_identifier, $dn, $entry, $servercontrols = null) {}
|
||||
function ldap_mod_add_ext($link_identifier, $dn, $entry, $servercontrols = null) {}
|
||||
function ldap_mod_del($link_identifier, $dn, $entry, $servercontrols = null) {}
|
||||
function ldap_mod_del_ext($link_identifier, $dn, $entry, $servercontrols = null) {}
|
||||
function ldap_mod_replace($link_identifier, $dn, $entry, $servercontrols = null) {}
|
||||
function ldap_mod_replace_ext($link_identifier, $dn, $entry, $servercontrols = null) {}
|
||||
function ldap_modify($link_identifier, $dn, $entry, $servercontrols = null) {}
|
||||
function ldap_modify_batch($link_identifier, $dn, array $modifications_info, $servercontrols = null) {}
|
||||
function ldap_next_attribute($link_identifier, $result_entry_identifier) {}
|
||||
function ldap_next_entry($link_identifier, $result_identifier) {}
|
||||
function ldap_next_reference($link, $entry) {}
|
||||
function ldap_parse_exop($link, $result, &$retdata, &$retoid) {}
|
||||
function ldap_parse_reference($link, $entry, &$referrals) {}
|
||||
function ldap_parse_result($link, $result, &$errcode, &$matcheddn = null, &$errmsg = null, &$referrals = null, &$serverctrls = null) {}
|
||||
function ldap_read($link_identifier, $base_dn, $filter, $attributes = null, $attrsonly = null, $sizelimit = null, $timelimit = null, $deref = null, $servercontrols = null) {}
|
||||
function ldap_rename($link_identifier, $dn, $newrdn, $newparent, $deleteoldrdn, $servercontrols = null) {}
|
||||
function ldap_rename_ext($link_identifier, $dn, $newrdn, $newparent, $deleteoldrdn, $servercontrols = null) {}
|
||||
function ldap_sasl_bind($link, $binddn = null, $password = null, $sasl_mech = null, $sasl_realm = null, $sasl_authz_id = null, $props = null) {}
|
||||
function ldap_search($link_identifier, $base_dn, $filter, $attributes = null, $attrsonly = null, $sizelimit = null, $timelimit = null, $deref = null, $servercontrols = null) {}
|
||||
function ldap_set_option($link_identifier, $option, $newval) {}
|
||||
function ldap_set_rebind_proc($link, $callback) {}
|
||||
function ldap_sort($link, $result, $sortfilter) {}
|
||||
function ldap_start_tls($link_identifier) {}
|
||||
function ldap_unbind($link_identifier) {}
|
||||
const LDAP_CONTROL_ASSERT = '1.3.6.1.1.12';
|
||||
const LDAP_CONTROL_DONTUSECOPY = '1.3.6.1.1.22';
|
||||
const LDAP_CONTROL_MANAGEDSAIT = '2.16.840.1.113730.3.4.2';
|
||||
const LDAP_CONTROL_PAGEDRESULTS = '1.2.840.113556.1.4.319';
|
||||
const LDAP_CONTROL_PASSWORDPOLICYREQUEST = '1.3.6.1.4.1.42.2.27.8.5.1';
|
||||
const LDAP_CONTROL_PASSWORDPOLICYRESPONSE = '1.3.6.1.4.1.42.2.27.8.5.1';
|
||||
const LDAP_CONTROL_POST_READ = '1.3.6.1.1.13.2';
|
||||
const LDAP_CONTROL_PRE_READ = '1.3.6.1.1.13.1';
|
||||
const LDAP_CONTROL_PROXY_AUTHZ = '2.16.840.1.113730.3.4.18';
|
||||
const LDAP_CONTROL_SORTREQUEST = '1.2.840.113556.1.4.473';
|
||||
const LDAP_CONTROL_SORTRESPONSE = '1.2.840.113556.1.4.474';
|
||||
const LDAP_CONTROL_SUBENTRIES = '1.3.6.1.4.1.4203.1.10.1';
|
||||
const LDAP_CONTROL_SYNC = '1.3.6.1.4.1.4203.1.9.1.1';
|
||||
const LDAP_CONTROL_SYNC_DONE = '1.3.6.1.4.1.4203.1.9.1.3';
|
||||
const LDAP_CONTROL_SYNC_STATE = '1.3.6.1.4.1.4203.1.9.1.2';
|
||||
const LDAP_CONTROL_VALUESRETURNFILTER = '1.2.826.0.1.3344810.2.3';
|
||||
const LDAP_CONTROL_VLVREQUEST = '2.16.840.1.113730.3.4.9';
|
||||
const LDAP_CONTROL_VLVRESPONSE = '2.16.840.1.113730.3.4.10';
|
||||
const LDAP_CONTROL_X_DOMAIN_SCOPE = '1.2.840.113556.1.4.1339';
|
||||
const LDAP_CONTROL_X_EXTENDED_DN = '1.2.840.113556.1.4.529';
|
||||
const LDAP_CONTROL_X_INCREMENTAL_VALUES = '1.2.840.113556.1.4.802';
|
||||
const LDAP_CONTROL_X_PERMISSIVE_MODIFY = '1.2.840.113556.1.4.1413';
|
||||
const LDAP_CONTROL_X_SEARCH_OPTIONS = '1.2.840.113556.1.4.1340';
|
||||
const LDAP_CONTROL_X_TREE_DELETE = '1.2.840.113556.1.4.805';
|
||||
const LDAP_DEREF_ALWAYS = 3;
|
||||
const LDAP_DEREF_FINDING = 2;
|
||||
const LDAP_DEREF_NEVER = 0;
|
||||
const LDAP_DEREF_SEARCHING = 1;
|
||||
const LDAP_ESCAPE_DN = 2;
|
||||
const LDAP_ESCAPE_FILTER = 1;
|
||||
const LDAP_EXOP_MODIFY_PASSWD = '1.3.6.1.4.1.4203.1.11.1';
|
||||
const LDAP_EXOP_REFRESH = '1.3.6.1.4.1.1466.101.119.1';
|
||||
const LDAP_EXOP_START_TLS = '1.3.6.1.4.1.1466.20037';
|
||||
const LDAP_EXOP_TURN = '1.3.6.1.1.19';
|
||||
const LDAP_EXOP_WHO_AM_I = '1.3.6.1.4.1.4203.1.11.3';
|
||||
const LDAP_MODIFY_BATCH_ADD = 1;
|
||||
const LDAP_MODIFY_BATCH_ATTRIB = 'attrib';
|
||||
const LDAP_MODIFY_BATCH_MODTYPE = 'modtype';
|
||||
const LDAP_MODIFY_BATCH_REMOVE = 2;
|
||||
const LDAP_MODIFY_BATCH_REMOVE_ALL = 18;
|
||||
const LDAP_MODIFY_BATCH_REPLACE = 3;
|
||||
const LDAP_MODIFY_BATCH_VALUES = 'values';
|
||||
const LDAP_OPT_CLIENT_CONTROLS = 19;
|
||||
const LDAP_OPT_DEBUG_LEVEL = 20481;
|
||||
const LDAP_OPT_DEREF = 2;
|
||||
const LDAP_OPT_DIAGNOSTIC_MESSAGE = 50;
|
||||
const LDAP_OPT_ERROR_NUMBER = 49;
|
||||
const LDAP_OPT_ERROR_STRING = 50;
|
||||
const LDAP_OPT_HOST_NAME = 48;
|
||||
const LDAP_OPT_MATCHED_DN = 51;
|
||||
const LDAP_OPT_NETWORK_TIMEOUT = 20485;
|
||||
const LDAP_OPT_PROTOCOL_VERSION = 17;
|
||||
const LDAP_OPT_REFERRALS = 8;
|
||||
const LDAP_OPT_RESTART = 9;
|
||||
const LDAP_OPT_SERVER_CONTROLS = 18;
|
||||
const LDAP_OPT_SIZELIMIT = 3;
|
||||
const LDAP_OPT_TIMELIMIT = 4;
|
||||
const LDAP_OPT_TIMEOUT = 20482;
|
||||
const LDAP_OPT_X_KEEPALIVE_IDLE = 25344;
|
||||
const LDAP_OPT_X_KEEPALIVE_INTERVAL = 25346;
|
||||
const LDAP_OPT_X_KEEPALIVE_PROBES = 25345;
|
||||
const LDAP_OPT_X_SASL_AUTHCID = 24834;
|
||||
const LDAP_OPT_X_SASL_AUTHZID = 24835;
|
||||
const LDAP_OPT_X_SASL_MECH = 24832;
|
||||
const LDAP_OPT_X_SASL_NOCANON = 24843;
|
||||
const LDAP_OPT_X_SASL_REALM = 24833;
|
||||
const LDAP_OPT_X_SASL_USERNAME = 24844;
|
||||
const LDAP_OPT_X_TLS_ALLOW = 3;
|
||||
const LDAP_OPT_X_TLS_CACERTDIR = 24579;
|
||||
const LDAP_OPT_X_TLS_CACERTFILE = 24578;
|
||||
const LDAP_OPT_X_TLS_CERTFILE = 24580;
|
||||
const LDAP_OPT_X_TLS_CIPHER_SUITE = 24584;
|
||||
const LDAP_OPT_X_TLS_CRLCHECK = 24587;
|
||||
const LDAP_OPT_X_TLS_CRLFILE = 24592;
|
||||
const LDAP_OPT_X_TLS_CRL_ALL = 2;
|
||||
const LDAP_OPT_X_TLS_CRL_NONE = 0;
|
||||
const LDAP_OPT_X_TLS_CRL_PEER = 1;
|
||||
const LDAP_OPT_X_TLS_DEMAND = 2;
|
||||
const LDAP_OPT_X_TLS_DHFILE = 24590;
|
||||
const LDAP_OPT_X_TLS_HARD = 1;
|
||||
const LDAP_OPT_X_TLS_KEYFILE = 24581;
|
||||
const LDAP_OPT_X_TLS_NEVER = 0;
|
||||
const LDAP_OPT_X_TLS_PACKAGE = 24593;
|
||||
const LDAP_OPT_X_TLS_PROTOCOL_MIN = 24583;
|
||||
const LDAP_OPT_X_TLS_PROTOCOL_SSL2 = 512;
|
||||
const LDAP_OPT_X_TLS_PROTOCOL_SSL3 = 768;
|
||||
const LDAP_OPT_X_TLS_PROTOCOL_TLS1_0 = 769;
|
||||
const LDAP_OPT_X_TLS_PROTOCOL_TLS1_1 = 770;
|
||||
const LDAP_OPT_X_TLS_PROTOCOL_TLS1_2 = 771;
|
||||
const LDAP_OPT_X_TLS_RANDOM_FILE = 24585;
|
||||
const LDAP_OPT_X_TLS_REQUIRE_CERT = 24582;
|
||||
const LDAP_OPT_X_TLS_TRY = 4;
|
||||
}
|
||||
79
dev/tools/phan/stubs/mcrypt.phan_php
Normal file
79
dev/tools/phan/stubs/mcrypt.phan_php
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
<?php
|
||||
// These stubs were generated by the phan stub generator.
|
||||
// @phan-stub-for-extension mcrypt@1.0.6
|
||||
|
||||
namespace {
|
||||
function mcrypt_create_iv($size, $source = null) {}
|
||||
function mcrypt_decrypt($cipher, $key, $data, $mode, $iv = null) {}
|
||||
function mcrypt_enc_get_algorithms_name($td) {}
|
||||
function mcrypt_enc_get_block_size($td) {}
|
||||
function mcrypt_enc_get_iv_size($td) {}
|
||||
function mcrypt_enc_get_key_size($td) {}
|
||||
function mcrypt_enc_get_modes_name($td) {}
|
||||
function mcrypt_enc_get_supported_key_sizes($td) {}
|
||||
function mcrypt_enc_is_block_algorithm($td) {}
|
||||
function mcrypt_enc_is_block_algorithm_mode($td) {}
|
||||
function mcrypt_enc_is_block_mode($td) {}
|
||||
function mcrypt_enc_self_test($td) {}
|
||||
function mcrypt_encrypt($cipher, $key, $data, $mode, $iv = null) {}
|
||||
function mcrypt_generic($td, $data) {}
|
||||
function mcrypt_generic_deinit($td) {}
|
||||
function mcrypt_generic_init($td, $key, $iv) {}
|
||||
function mcrypt_get_block_size($cipher, $module) {}
|
||||
function mcrypt_get_cipher_name($cipher) {}
|
||||
function mcrypt_get_iv_size($cipher, $module) {}
|
||||
function mcrypt_get_key_size($cipher, $module) {}
|
||||
function mcrypt_list_algorithms($lib_dir = null) {}
|
||||
function mcrypt_list_modes($lib_dir = null) {}
|
||||
function mcrypt_module_close($td) {}
|
||||
function mcrypt_module_get_algo_block_size($algorithm, $lib_dir = null) {}
|
||||
function mcrypt_module_get_algo_key_size($algorithm, $lib_dir = null) {}
|
||||
function mcrypt_module_get_supported_key_sizes($algorithm, $lib_dir = null) {}
|
||||
function mcrypt_module_is_block_algorithm($algorithm, $lib_dir = null) {}
|
||||
function mcrypt_module_is_block_algorithm_mode($mode, $lib_dir = null) {}
|
||||
function mcrypt_module_is_block_mode($mode, $lib_dir = null) {}
|
||||
function mcrypt_module_open($cipher, $cipher_directory, $mode, $mode_directory) {}
|
||||
function mcrypt_module_self_test($algorithm, $lib_dir = null) {}
|
||||
function mdecrypt_generic($td, $data) {}
|
||||
const MCRYPT_3DES = 'tripledes';
|
||||
const MCRYPT_ARCFOUR = 'arcfour';
|
||||
const MCRYPT_ARCFOUR_IV = 'arcfour-iv';
|
||||
const MCRYPT_BLOWFISH = 'blowfish';
|
||||
const MCRYPT_BLOWFISH_COMPAT = 'blowfish-compat';
|
||||
const MCRYPT_CAST_128 = 'cast-128';
|
||||
const MCRYPT_CAST_256 = 'cast-256';
|
||||
const MCRYPT_CRYPT = 'crypt';
|
||||
const MCRYPT_DECRYPT = 1;
|
||||
const MCRYPT_DES = 'des';
|
||||
const MCRYPT_DEV_RANDOM = 0;
|
||||
const MCRYPT_DEV_URANDOM = 1;
|
||||
const MCRYPT_ENCRYPT = 0;
|
||||
const MCRYPT_ENIGNA = 'crypt';
|
||||
const MCRYPT_GOST = 'gost';
|
||||
const MCRYPT_IDEA = 'idea';
|
||||
const MCRYPT_LOKI97 = 'loki97';
|
||||
const MCRYPT_MARS = 'mars';
|
||||
const MCRYPT_MODE_CBC = 'cbc';
|
||||
const MCRYPT_MODE_CFB = 'cfb';
|
||||
const MCRYPT_MODE_ECB = 'ecb';
|
||||
const MCRYPT_MODE_NOFB = 'nofb';
|
||||
const MCRYPT_MODE_OFB = 'ofb';
|
||||
const MCRYPT_MODE_STREAM = 'stream';
|
||||
const MCRYPT_PANAMA = 'panama';
|
||||
const MCRYPT_RAND = 2;
|
||||
const MCRYPT_RC2 = 'rc2';
|
||||
const MCRYPT_RC6 = 'rc6';
|
||||
const MCRYPT_RIJNDAEL_128 = 'rijndael-128';
|
||||
const MCRYPT_RIJNDAEL_192 = 'rijndael-192';
|
||||
const MCRYPT_RIJNDAEL_256 = 'rijndael-256';
|
||||
const MCRYPT_SAFER64 = 'safer-sk64';
|
||||
const MCRYPT_SAFER128 = 'safer-sk128';
|
||||
const MCRYPT_SAFERPLUS = 'saferplus';
|
||||
const MCRYPT_SERPENT = 'serpent';
|
||||
const MCRYPT_SKIPJACK = 'skipjack';
|
||||
const MCRYPT_THREEWAY = 'threeway';
|
||||
const MCRYPT_TRIPLEDES = 'tripledes';
|
||||
const MCRYPT_TWOFISH = 'twofish';
|
||||
const MCRYPT_WAKE = 'wake';
|
||||
const MCRYPT_XTEA = 'xtea';
|
||||
}
|
||||
72
dev/tools/phan/stubs/memcache.phan_php
Normal file
72
dev/tools/phan/stubs/memcache.phan_php
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
<?php
|
||||
// These stubs were generated by the phan stub generator.
|
||||
// @phan-stub-for-extension memcache@4.0.5.2
|
||||
|
||||
namespace {
|
||||
class Memcache extends \MemcachePool {
|
||||
|
||||
// methods
|
||||
public function connect() {}
|
||||
public function pconnect() {}
|
||||
public function addserver() {}
|
||||
}
|
||||
|
||||
class MemcachePool {
|
||||
|
||||
// methods
|
||||
public function connect() {}
|
||||
public function addserver() {}
|
||||
public function setserverparams() {}
|
||||
public function setfailurecallback() {}
|
||||
public function getserverstatus() {}
|
||||
public function findserver() {}
|
||||
public function getversion() {}
|
||||
public function add() {}
|
||||
public function set() {}
|
||||
public function replace() {}
|
||||
public function cas() {}
|
||||
public function append() {}
|
||||
public function prepend() {}
|
||||
public function get($arg, &$arg, &$arg) {}
|
||||
public function delete() {}
|
||||
public function getstats() {}
|
||||
public function getextendedstats() {}
|
||||
public function setcompressthreshold() {}
|
||||
public function increment() {}
|
||||
public function decrement() {}
|
||||
public function close() {}
|
||||
public function flush() {}
|
||||
public function setSaslAuthData() {}
|
||||
}
|
||||
|
||||
function memcache_add() {}
|
||||
function memcache_add_server() {}
|
||||
function memcache_append() {}
|
||||
function memcache_cas() {}
|
||||
function memcache_close() {}
|
||||
function memcache_connect() {}
|
||||
function memcache_debug() {}
|
||||
function memcache_decrement() {}
|
||||
function memcache_delete() {}
|
||||
function memcache_flush() {}
|
||||
function memcache_get($arg, $arg, &$arg, &$arg) {}
|
||||
function memcache_get_extended_stats() {}
|
||||
function memcache_get_server_status() {}
|
||||
function memcache_get_stats() {}
|
||||
function memcache_get_version() {}
|
||||
function memcache_increment() {}
|
||||
function memcache_pconnect() {}
|
||||
function memcache_prepend() {}
|
||||
function memcache_replace() {}
|
||||
function memcache_set() {}
|
||||
function memcache_set_compress_threshold() {}
|
||||
function memcache_set_failure_callback() {}
|
||||
function memcache_set_sasl_auth_data() {}
|
||||
function memcache_set_server_params() {}
|
||||
const MEMCACHE_COMPRESSED = 2;
|
||||
const MEMCACHE_HAVE_SESSION = 1;
|
||||
const MEMCACHE_USER1 = 65536;
|
||||
const MEMCACHE_USER2 = 131072;
|
||||
const MEMCACHE_USER3 = 262144;
|
||||
const MEMCACHE_USER4 = 524288;
|
||||
}
|
||||
48
dev/tools/phan/stubs/module_numberwords.php
Normal file
48
dev/tools/phan/stubs/module_numberwords.php
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* or see http://www.gnu.org/
|
||||
*/
|
||||
/**
|
||||
* \file htdocs/core/modules/substitutions/functions_numberwords.lib.php
|
||||
* \brief A set of functions for Dolibarr
|
||||
* This file contains functions for plugin numberwords.
|
||||
*/
|
||||
/**
|
||||
* Function called to complete substitution array (before generating on ODT, or a personalized email)
|
||||
* functions xxx_completesubstitutionarray are called by make_substitutions() if file
|
||||
* is inside directory htdocs/core/substitutions
|
||||
*
|
||||
* @param array $substitutionarray Array with substitution key=>val
|
||||
* @param Translate $outlangs Output langs
|
||||
* @param Object $object Object to use to get values
|
||||
* @return void The entry parameter $substitutionarray is modified
|
||||
*/
|
||||
function numberwords_completesubstitutionarray(&$substitutionarray, $outlangs, $object)
|
||||
{
|
||||
}
|
||||
/**
|
||||
* Return full text translated to language label for a key. Store key-label in a cache.
|
||||
*
|
||||
* @param Translate $outlangs Language for output
|
||||
* @param int $number Number to encode in full text
|
||||
* @param string $isamount ''=it's just a number, '1'=It's an amount (default currency), 'currencycode'=It's an amount (foreign currency)
|
||||
* @return string Label translated in UTF8 (but without entities)
|
||||
* 10 if setDefaultLang was en_US => ten
|
||||
* 123 if setDefaultLang was fr_FR => cent vingt trois
|
||||
*/
|
||||
function numberwords_getLabelFromNumber($outlangs, $number, $isamount = '')
|
||||
{
|
||||
}
|
||||
397
dev/tools/phan/stubs/mysqli.phan_php
Normal file
397
dev/tools/phan/stubs/mysqli.phan_php
Normal file
|
|
@ -0,0 +1,397 @@
|
|||
<?php
|
||||
// These stubs were generated by the phan stub generator.
|
||||
// @phan-stub-for-extension mysqli@8.2.9
|
||||
|
||||
namespace {
|
||||
class mysqli {
|
||||
|
||||
// properties
|
||||
public $affected_rows;
|
||||
public $client_info;
|
||||
public $client_version;
|
||||
public $connect_errno;
|
||||
public $connect_error;
|
||||
public $errno;
|
||||
public $error;
|
||||
public $error_list;
|
||||
public $field_count;
|
||||
public $host_info;
|
||||
public $info;
|
||||
public $insert_id;
|
||||
public $protocol_version;
|
||||
public $server_info;
|
||||
public $server_version;
|
||||
public $sqlstate;
|
||||
public $stat;
|
||||
public $thread_id;
|
||||
public $warning_count;
|
||||
|
||||
// methods
|
||||
public function __construct(?string $hostname = null, ?string $username = null, ?string $password = null, ?string $database = null, ?int $port = null, ?string $socket = null) {}
|
||||
public function autocommit(bool $enable) : bool {}
|
||||
public function begin_transaction(int $flags = 0, ?string $name = null) : bool {}
|
||||
public function change_user(string $username, string $password, ?string $database) : bool {}
|
||||
public function character_set_name() : string {}
|
||||
public function close() {}
|
||||
public function commit(int $flags = 0, ?string $name = null) : bool {}
|
||||
public function connect(?string $hostname = null, ?string $username = null, ?string $password = null, ?string $database = null, ?int $port = null, ?string $socket = null) : bool {}
|
||||
public function dump_debug_info() : bool {}
|
||||
public function debug(string $options) {}
|
||||
public function get_charset() : ?object {}
|
||||
public function execute_query(string $query, ?array $params = null) : \mysqli_result|bool {}
|
||||
public function get_client_info() : string {}
|
||||
public function get_connection_stats() : array {}
|
||||
public function get_server_info() : string {}
|
||||
public function get_warnings() : \mysqli_warning|false {}
|
||||
public function init() {}
|
||||
public function kill(int $process_id) : bool {}
|
||||
public function multi_query(string $query) : bool {}
|
||||
public function more_results() : bool {}
|
||||
public function next_result() : bool {}
|
||||
public function ping() : bool {}
|
||||
public static function poll(?array &$read, ?array &$error, array &$reject, int $seconds, int $microseconds = 0) : false|int {}
|
||||
public function prepare(string $query) : \mysqli_stmt|false {}
|
||||
public function query(string $query, int $result_mode = \MYSQLI_STORE_RESULT) : \mysqli_result|bool {}
|
||||
public function real_connect(?string $hostname = null, ?string $username = null, ?string $password = null, ?string $database = null, ?int $port = null, ?string $socket = null, int $flags = 0) : bool {}
|
||||
public function real_escape_string(string $string) : string {}
|
||||
public function reap_async_query() : \mysqli_result|bool {}
|
||||
public function escape_string(string $string) : string {}
|
||||
public function real_query(string $query) : bool {}
|
||||
public function release_savepoint(string $name) : bool {}
|
||||
public function rollback(int $flags = 0, ?string $name = null) : bool {}
|
||||
public function savepoint(string $name) : bool {}
|
||||
public function select_db(string $database) : bool {}
|
||||
public function set_charset(string $charset) : bool {}
|
||||
public function options(int $option, $value) : bool {}
|
||||
public function set_opt(int $option, $value) : bool {}
|
||||
public function ssl_set(?string $key, ?string $certificate, ?string $ca_certificate, ?string $ca_path, ?string $cipher_algos) {}
|
||||
public function stat() : false|string {}
|
||||
public function stmt_init() : \mysqli_stmt|false {}
|
||||
public function store_result(int $mode = 0) : \mysqli_result|false {}
|
||||
public function thread_safe() : bool {}
|
||||
public function use_result() : \mysqli_result|false {}
|
||||
public function refresh(int $flags) : bool {}
|
||||
}
|
||||
|
||||
final class mysqli_driver {
|
||||
|
||||
// properties
|
||||
public $client_info;
|
||||
public $client_version;
|
||||
public $driver_version;
|
||||
public $embedded;
|
||||
public $reconnect;
|
||||
public $report_mode;
|
||||
}
|
||||
|
||||
class mysqli_result implements \IteratorAggregate, \Traversable {
|
||||
|
||||
// properties
|
||||
public $current_field;
|
||||
public $field_count;
|
||||
public $lengths;
|
||||
public $num_rows;
|
||||
public $type;
|
||||
|
||||
// methods
|
||||
public function __construct(\mysqli $mysql, int $result_mode = \MYSQLI_STORE_RESULT) {}
|
||||
public function close() : void {}
|
||||
public function free() : void {}
|
||||
public function data_seek(int $offset) : bool {}
|
||||
public function fetch_field() : false|object {}
|
||||
public function fetch_fields() : array {}
|
||||
public function fetch_field_direct(int $index) : false|object {}
|
||||
public function fetch_all(int $mode = \MYSQLI_NUM) : array {}
|
||||
public function fetch_array(int $mode = \MYSQLI_BOTH) : array|false|null {}
|
||||
public function fetch_assoc() : array|false|null {}
|
||||
public function fetch_object(string $class = 'stdClass', array $constructor_args = []) : false|null|object {}
|
||||
public function fetch_row() : array|false|null {}
|
||||
public function fetch_column(int $column = 0) : false|float|int|null|string {}
|
||||
public function field_seek(int $index) : bool {}
|
||||
public function free_result() : void {}
|
||||
public function getIterator() : \Iterator {}
|
||||
}
|
||||
|
||||
final class mysqli_sql_exception extends \RuntimeException {
|
||||
|
||||
// properties
|
||||
protected $sqlstate;
|
||||
protected $message;
|
||||
protected $code;
|
||||
protected $file;
|
||||
protected $line;
|
||||
|
||||
// methods
|
||||
public function getSqlState() : string {}
|
||||
}
|
||||
|
||||
class mysqli_stmt {
|
||||
|
||||
// properties
|
||||
public $affected_rows;
|
||||
public $errno;
|
||||
public $error;
|
||||
public $error_list;
|
||||
public $field_count;
|
||||
public $id;
|
||||
public $insert_id;
|
||||
public $num_rows;
|
||||
public $param_count;
|
||||
public $sqlstate;
|
||||
|
||||
// methods
|
||||
public function __construct(\mysqli $mysql, ?string $query = null) {}
|
||||
public function attr_get(int $attribute) : int {}
|
||||
public function attr_set(int $attribute, int $value) : bool {}
|
||||
public function bind_param(string $types, mixed &...$vars) : bool {}
|
||||
public function bind_result(mixed &...$vars) : bool {}
|
||||
public function close() {}
|
||||
public function data_seek(int $offset) : void {}
|
||||
public function execute(?array $params = null) : bool {}
|
||||
public function fetch() : ?bool {}
|
||||
public function get_warnings() : \mysqli_warning|false {}
|
||||
public function result_metadata() : \mysqli_result|false {}
|
||||
public function more_results() : bool {}
|
||||
public function next_result() : bool {}
|
||||
public function num_rows() : int|string {}
|
||||
public function send_long_data(int $param_num, string $data) : bool {}
|
||||
public function free_result() : void {}
|
||||
public function reset() : bool {}
|
||||
public function prepare(string $query) : bool {}
|
||||
public function store_result() : bool {}
|
||||
public function get_result() : \mysqli_result|false {}
|
||||
}
|
||||
|
||||
final class mysqli_warning {
|
||||
|
||||
// properties
|
||||
public $errno;
|
||||
public $message;
|
||||
public $sqlstate;
|
||||
|
||||
// methods
|
||||
private function __construct() {}
|
||||
public function next() : bool {}
|
||||
}
|
||||
|
||||
function mysqli_affected_rows(\mysqli $mysql) : int|string {}
|
||||
function mysqli_autocommit(\mysqli $mysql, bool $enable) : bool {}
|
||||
function mysqli_begin_transaction(\mysqli $mysql, int $flags = 0, ?string $name = null) : bool {}
|
||||
function mysqli_change_user(\mysqli $mysql, string $username, string $password, ?string $database) : bool {}
|
||||
function mysqli_character_set_name(\mysqli $mysql) : string {}
|
||||
function mysqli_close(\mysqli $mysql) : true {}
|
||||
function mysqli_commit(\mysqli $mysql, int $flags = 0, ?string $name = null) : bool {}
|
||||
function mysqli_connect(?string $hostname = null, ?string $username = null, ?string $password = null, ?string $database = null, ?int $port = null, ?string $socket = null) : \mysqli|false {}
|
||||
function mysqli_connect_errno() : int {}
|
||||
function mysqli_connect_error() : ?string {}
|
||||
function mysqli_data_seek(\mysqli_result $result, int $offset) : bool {}
|
||||
function mysqli_debug(string $options) : true {}
|
||||
function mysqli_dump_debug_info(\mysqli $mysql) : bool {}
|
||||
function mysqli_errno(\mysqli $mysql) : int {}
|
||||
function mysqli_error(\mysqli $mysql) : string {}
|
||||
function mysqli_error_list(\mysqli $mysql) : array {}
|
||||
function mysqli_escape_string(\mysqli $mysql, string $string) : string {}
|
||||
function mysqli_execute(\mysqli_stmt $statement, ?array $params = null) : bool {}
|
||||
function mysqli_execute_query(\mysqli $mysql, string $query, ?array $params = null) : \mysqli_result|bool {}
|
||||
function mysqli_fetch_all(\mysqli_result $result, int $mode = \MYSQLI_NUM) : array {}
|
||||
function mysqli_fetch_array(\mysqli_result $result, int $mode = \MYSQLI_BOTH) : array|false|null {}
|
||||
function mysqli_fetch_assoc(\mysqli_result $result) : array|false|null {}
|
||||
function mysqli_fetch_column(\mysqli_result $result, int $column = 0) : false|float|int|null|string {}
|
||||
function mysqli_fetch_field(\mysqli_result $result) : false|object {}
|
||||
function mysqli_fetch_field_direct(\mysqli_result $result, int $index) : false|object {}
|
||||
function mysqli_fetch_fields(\mysqli_result $result) : array {}
|
||||
function mysqli_fetch_lengths(\mysqli_result $result) : array|false {}
|
||||
function mysqli_fetch_object(\mysqli_result $result, string $class = 'stdClass', array $constructor_args = []) : false|null|object {}
|
||||
function mysqli_fetch_row(\mysqli_result $result) : array|false|null {}
|
||||
function mysqli_field_count(\mysqli $mysql) : int {}
|
||||
function mysqli_field_seek(\mysqli_result $result, int $index) : bool {}
|
||||
function mysqli_field_tell(\mysqli_result $result) : int {}
|
||||
function mysqli_free_result(\mysqli_result $result) : void {}
|
||||
function mysqli_get_charset(\mysqli $mysql) : ?object {}
|
||||
function mysqli_get_client_info(?\mysqli $mysql = null) : string {}
|
||||
function mysqli_get_client_stats() : array {}
|
||||
function mysqli_get_client_version() : int {}
|
||||
function mysqli_get_connection_stats(\mysqli $mysql) : array {}
|
||||
function mysqli_get_host_info(\mysqli $mysql) : string {}
|
||||
function mysqli_get_links_stats() : array {}
|
||||
function mysqli_get_proto_info(\mysqli $mysql) : int {}
|
||||
function mysqli_get_server_info(\mysqli $mysql) : string {}
|
||||
function mysqli_get_server_version(\mysqli $mysql) : int {}
|
||||
function mysqli_get_warnings(\mysqli $mysql) : \mysqli_warning|false {}
|
||||
function mysqli_info(\mysqli $mysql) : ?string {}
|
||||
function mysqli_init() : \mysqli|false {}
|
||||
function mysqli_insert_id(\mysqli $mysql) : int|string {}
|
||||
function mysqli_kill(\mysqli $mysql, int $process_id) : bool {}
|
||||
function mysqli_more_results(\mysqli $mysql) : bool {}
|
||||
function mysqli_multi_query(\mysqli $mysql, string $query) : bool {}
|
||||
function mysqli_next_result(\mysqli $mysql) : bool {}
|
||||
function mysqli_num_fields(\mysqli_result $result) : int {}
|
||||
function mysqli_num_rows(\mysqli_result $result) : int|string {}
|
||||
function mysqli_options(\mysqli $mysql, int $option, $value) : bool {}
|
||||
function mysqli_ping(\mysqli $mysql) : bool {}
|
||||
function mysqli_poll(?array &$read, ?array &$error, array &$reject, int $seconds, int $microseconds = 0) : false|int {}
|
||||
function mysqli_prepare(\mysqli $mysql, string $query) : \mysqli_stmt|false {}
|
||||
function mysqli_query(\mysqli $mysql, string $query, int $result_mode = \MYSQLI_STORE_RESULT) : \mysqli_result|bool {}
|
||||
function mysqli_real_connect(\mysqli $mysql, ?string $hostname = null, ?string $username = null, ?string $password = null, ?string $database = null, ?int $port = null, ?string $socket = null, int $flags = 0) : bool {}
|
||||
function mysqli_real_escape_string(\mysqli $mysql, string $string) : string {}
|
||||
function mysqli_real_query(\mysqli $mysql, string $query) : bool {}
|
||||
function mysqli_reap_async_query(\mysqli $mysql) : \mysqli_result|bool {}
|
||||
function mysqli_refresh(\mysqli $mysql, int $flags) : bool {}
|
||||
function mysqli_release_savepoint(\mysqli $mysql, string $name) : bool {}
|
||||
function mysqli_report(int $flags) : bool {}
|
||||
function mysqli_rollback(\mysqli $mysql, int $flags = 0, ?string $name = null) : bool {}
|
||||
function mysqli_savepoint(\mysqli $mysql, string $name) : bool {}
|
||||
function mysqli_select_db(\mysqli $mysql, string $database) : bool {}
|
||||
function mysqli_set_charset(\mysqli $mysql, string $charset) : bool {}
|
||||
function mysqli_set_opt(\mysqli $mysql, int $option, $value) : bool {}
|
||||
function mysqli_sqlstate(\mysqli $mysql) : string {}
|
||||
function mysqli_ssl_set(\mysqli $mysql, ?string $key, ?string $certificate, ?string $ca_certificate, ?string $ca_path, ?string $cipher_algos) : true {}
|
||||
function mysqli_stat(\mysqli $mysql) : false|string {}
|
||||
function mysqli_stmt_affected_rows(\mysqli_stmt $statement) : int|string {}
|
||||
function mysqli_stmt_attr_get(\mysqli_stmt $statement, int $attribute) : int {}
|
||||
function mysqli_stmt_attr_set(\mysqli_stmt $statement, int $attribute, int $value) : bool {}
|
||||
function mysqli_stmt_bind_param(\mysqli_stmt $statement, string $types, mixed &...$vars) : bool {}
|
||||
function mysqli_stmt_bind_result(\mysqli_stmt $statement, mixed &...$vars) : bool {}
|
||||
function mysqli_stmt_close(\mysqli_stmt $statement) : true {}
|
||||
function mysqli_stmt_data_seek(\mysqli_stmt $statement, int $offset) : void {}
|
||||
function mysqli_stmt_errno(\mysqli_stmt $statement) : int {}
|
||||
function mysqli_stmt_error(\mysqli_stmt $statement) : string {}
|
||||
function mysqli_stmt_error_list(\mysqli_stmt $statement) : array {}
|
||||
function mysqli_stmt_execute(\mysqli_stmt $statement, ?array $params = null) : bool {}
|
||||
function mysqli_stmt_fetch(\mysqli_stmt $statement) : ?bool {}
|
||||
function mysqli_stmt_field_count(\mysqli_stmt $statement) : int {}
|
||||
function mysqli_stmt_free_result(\mysqli_stmt $statement) : void {}
|
||||
function mysqli_stmt_get_result(\mysqli_stmt $statement) : \mysqli_result|false {}
|
||||
function mysqli_stmt_get_warnings(\mysqli_stmt $statement) : \mysqli_warning|false {}
|
||||
function mysqli_stmt_init(\mysqli $mysql) : \mysqli_stmt|false {}
|
||||
function mysqli_stmt_insert_id(\mysqli_stmt $statement) : int|string {}
|
||||
function mysqli_stmt_more_results(\mysqli_stmt $statement) : bool {}
|
||||
function mysqli_stmt_next_result(\mysqli_stmt $statement) : bool {}
|
||||
function mysqli_stmt_num_rows(\mysqli_stmt $statement) : int|string {}
|
||||
function mysqli_stmt_param_count(\mysqli_stmt $statement) : int {}
|
||||
function mysqli_stmt_prepare(\mysqli_stmt $statement, string $query) : bool {}
|
||||
function mysqli_stmt_reset(\mysqli_stmt $statement) : bool {}
|
||||
function mysqli_stmt_result_metadata(\mysqli_stmt $statement) : \mysqli_result|false {}
|
||||
function mysqli_stmt_send_long_data(\mysqli_stmt $statement, int $param_num, string $data) : bool {}
|
||||
function mysqli_stmt_sqlstate(\mysqli_stmt $statement) : string {}
|
||||
function mysqli_stmt_store_result(\mysqli_stmt $statement) : bool {}
|
||||
function mysqli_store_result(\mysqli $mysql, int $mode = 0) : \mysqli_result|false {}
|
||||
function mysqli_thread_id(\mysqli $mysql) : int {}
|
||||
function mysqli_thread_safe() : bool {}
|
||||
function mysqli_use_result(\mysqli $mysql) : \mysqli_result|false {}
|
||||
function mysqli_warning_count(\mysqli $mysql) : int {}
|
||||
const MYSQLI_ASSOC = 1;
|
||||
const MYSQLI_ASYNC = 8;
|
||||
const MYSQLI_AUTO_INCREMENT_FLAG = 512;
|
||||
const MYSQLI_BINARY_FLAG = 128;
|
||||
const MYSQLI_BLOB_FLAG = 16;
|
||||
const MYSQLI_BOTH = 3;
|
||||
const MYSQLI_CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS = 4194304;
|
||||
const MYSQLI_CLIENT_COMPRESS = 32;
|
||||
const MYSQLI_CLIENT_FOUND_ROWS = 2;
|
||||
const MYSQLI_CLIENT_IGNORE_SPACE = 256;
|
||||
const MYSQLI_CLIENT_INTERACTIVE = 1024;
|
||||
const MYSQLI_CLIENT_NO_SCHEMA = 16;
|
||||
const MYSQLI_CLIENT_SSL = 2048;
|
||||
const MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT = 64;
|
||||
const MYSQLI_CLIENT_SSL_VERIFY_SERVER_CERT = 1073741824;
|
||||
const MYSQLI_CURSOR_TYPE_FOR_UPDATE = 2;
|
||||
const MYSQLI_CURSOR_TYPE_NO_CURSOR = 0;
|
||||
const MYSQLI_CURSOR_TYPE_READ_ONLY = 1;
|
||||
const MYSQLI_CURSOR_TYPE_SCROLLABLE = 4;
|
||||
const MYSQLI_DATA_TRUNCATED = 101;
|
||||
const MYSQLI_DEBUG_TRACE_ENABLED = 0;
|
||||
const MYSQLI_ENUM_FLAG = 256;
|
||||
const MYSQLI_GROUP_FLAG = 32768;
|
||||
const MYSQLI_INIT_COMMAND = 3;
|
||||
const MYSQLI_IS_MARIADB = false;
|
||||
const MYSQLI_MULTIPLE_KEY_FLAG = 8;
|
||||
const MYSQLI_NOT_NULL_FLAG = 1;
|
||||
const MYSQLI_NO_DATA = 100;
|
||||
const MYSQLI_NO_DEFAULT_VALUE_FLAG = 4096;
|
||||
const MYSQLI_NUM = 2;
|
||||
const MYSQLI_NUM_FLAG = 32768;
|
||||
const MYSQLI_ON_UPDATE_NOW_FLAG = 8192;
|
||||
const MYSQLI_OPT_CAN_HANDLE_EXPIRED_PASSWORDS = 37;
|
||||
const MYSQLI_OPT_CONNECT_TIMEOUT = 0;
|
||||
const MYSQLI_OPT_INT_AND_FLOAT_NATIVE = 201;
|
||||
const MYSQLI_OPT_LOAD_DATA_LOCAL_DIR = 43;
|
||||
const MYSQLI_OPT_LOCAL_INFILE = 8;
|
||||
const MYSQLI_OPT_NET_CMD_BUFFER_SIZE = 202;
|
||||
const MYSQLI_OPT_NET_READ_BUFFER_SIZE = 203;
|
||||
const MYSQLI_OPT_READ_TIMEOUT = 11;
|
||||
const MYSQLI_OPT_SSL_VERIFY_SERVER_CERT = 21;
|
||||
const MYSQLI_PART_KEY_FLAG = 16384;
|
||||
const MYSQLI_PRI_KEY_FLAG = 2;
|
||||
const MYSQLI_READ_DEFAULT_FILE = 4;
|
||||
const MYSQLI_READ_DEFAULT_GROUP = 5;
|
||||
const MYSQLI_REFRESH_BACKUP_LOG = 2097152;
|
||||
const MYSQLI_REFRESH_GRANT = 1;
|
||||
const MYSQLI_REFRESH_HOSTS = 8;
|
||||
const MYSQLI_REFRESH_LOG = 2;
|
||||
const MYSQLI_REFRESH_MASTER = 128;
|
||||
const MYSQLI_REFRESH_REPLICA = 64;
|
||||
const MYSQLI_REFRESH_SLAVE = 64;
|
||||
const MYSQLI_REFRESH_STATUS = 16;
|
||||
const MYSQLI_REFRESH_TABLES = 4;
|
||||
const MYSQLI_REFRESH_THREADS = 32;
|
||||
const MYSQLI_REPORT_ALL = 255;
|
||||
const MYSQLI_REPORT_ERROR = 1;
|
||||
const MYSQLI_REPORT_INDEX = 4;
|
||||
const MYSQLI_REPORT_OFF = 0;
|
||||
const MYSQLI_REPORT_STRICT = 2;
|
||||
const MYSQLI_SERVER_PS_OUT_PARAMS = 4096;
|
||||
const MYSQLI_SERVER_PUBLIC_KEY = 35;
|
||||
const MYSQLI_SERVER_QUERY_NO_GOOD_INDEX_USED = 16;
|
||||
const MYSQLI_SERVER_QUERY_NO_INDEX_USED = 32;
|
||||
const MYSQLI_SERVER_QUERY_WAS_SLOW = 2048;
|
||||
const MYSQLI_SET_CHARSET_DIR = 6;
|
||||
const MYSQLI_SET_CHARSET_NAME = 7;
|
||||
const MYSQLI_SET_FLAG = 2048;
|
||||
const MYSQLI_STMT_ATTR_CURSOR_TYPE = 1;
|
||||
const MYSQLI_STMT_ATTR_PREFETCH_ROWS = 2;
|
||||
const MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH = 0;
|
||||
const MYSQLI_STORE_RESULT = 0;
|
||||
const MYSQLI_STORE_RESULT_COPY_DATA = 16;
|
||||
const MYSQLI_TIMESTAMP_FLAG = 1024;
|
||||
const MYSQLI_TRANS_COR_AND_CHAIN = 1;
|
||||
const MYSQLI_TRANS_COR_AND_NO_CHAIN = 2;
|
||||
const MYSQLI_TRANS_COR_NO_RELEASE = 8;
|
||||
const MYSQLI_TRANS_COR_RELEASE = 4;
|
||||
const MYSQLI_TRANS_START_READ_ONLY = 4;
|
||||
const MYSQLI_TRANS_START_READ_WRITE = 2;
|
||||
const MYSQLI_TRANS_START_WITH_CONSISTENT_SNAPSHOT = 1;
|
||||
const MYSQLI_TYPE_BIT = 16;
|
||||
const MYSQLI_TYPE_BLOB = 252;
|
||||
const MYSQLI_TYPE_CHAR = 1;
|
||||
const MYSQLI_TYPE_DATE = 10;
|
||||
const MYSQLI_TYPE_DATETIME = 12;
|
||||
const MYSQLI_TYPE_DECIMAL = 0;
|
||||
const MYSQLI_TYPE_DOUBLE = 5;
|
||||
const MYSQLI_TYPE_ENUM = 247;
|
||||
const MYSQLI_TYPE_FLOAT = 4;
|
||||
const MYSQLI_TYPE_GEOMETRY = 255;
|
||||
const MYSQLI_TYPE_INT24 = 9;
|
||||
const MYSQLI_TYPE_INTERVAL = 247;
|
||||
const MYSQLI_TYPE_JSON = 245;
|
||||
const MYSQLI_TYPE_LONG = 3;
|
||||
const MYSQLI_TYPE_LONGLONG = 8;
|
||||
const MYSQLI_TYPE_LONG_BLOB = 251;
|
||||
const MYSQLI_TYPE_MEDIUM_BLOB = 250;
|
||||
const MYSQLI_TYPE_NEWDATE = 14;
|
||||
const MYSQLI_TYPE_NEWDECIMAL = 246;
|
||||
const MYSQLI_TYPE_NULL = 6;
|
||||
const MYSQLI_TYPE_SET = 248;
|
||||
const MYSQLI_TYPE_SHORT = 2;
|
||||
const MYSQLI_TYPE_STRING = 254;
|
||||
const MYSQLI_TYPE_TIME = 11;
|
||||
const MYSQLI_TYPE_TIMESTAMP = 7;
|
||||
const MYSQLI_TYPE_TINY = 1;
|
||||
const MYSQLI_TYPE_TINY_BLOB = 249;
|
||||
const MYSQLI_TYPE_VAR_STRING = 253;
|
||||
const MYSQLI_TYPE_YEAR = 13;
|
||||
const MYSQLI_UNIQUE_KEY_FLAG = 4;
|
||||
const MYSQLI_UNSIGNED_FLAG = 32;
|
||||
const MYSQLI_USE_RESULT = 1;
|
||||
const MYSQLI_ZEROFILL_FLAG = 64;
|
||||
}
|
||||
3
dev/tools/phan/stubs/pdo_cubrid.phan_php
Normal file
3
dev/tools/phan/stubs/pdo_cubrid.phan_php
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<?php
|
||||
// These stubs were generated by the phan stub generator.
|
||||
// @phan-stub-for-extension pdo_mysql@7.1.33-55+0~20230829.86+debian10~1.gbp0254ab
|
||||
3
dev/tools/phan/stubs/pdo_mysql.phan_php
Normal file
3
dev/tools/phan/stubs/pdo_mysql.phan_php
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<?php
|
||||
// These stubs were generated by the phan stub generator.
|
||||
// @phan-stub-for-extension pdo_mysql@8.2.9
|
||||
3
dev/tools/phan/stubs/pdo_pgsql.phan_php
Normal file
3
dev/tools/phan/stubs/pdo_pgsql.phan_php
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<?php
|
||||
// These stubs were generated by the phan stub generator.
|
||||
// @phan-stub-for-extension pdo_pgsql@7.1.33-55+0~20230829.86+debian10~1.gbp0254ab
|
||||
3
dev/tools/phan/stubs/pdo_sqlite.phan_php
Normal file
3
dev/tools/phan/stubs/pdo_sqlite.phan_php
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<?php
|
||||
// These stubs were generated by the phan stub generator.
|
||||
// @phan-stub-for-extension pdo_sqlite@7.4.12
|
||||
974
dev/tools/phan/stubs/pgsql.phan_php
Normal file
974
dev/tools/phan/stubs/pgsql.phan_php
Normal file
|
|
@ -0,0 +1,974 @@
|
|||
<?php
|
||||
// From https://raw.githubusercontent.com/php/php-src/master/ext/pgsql/pgsql.stub.php
|
||||
|
||||
/** @generate-class-entries */
|
||||
|
||||
namespace {
|
||||
/* libpq version */
|
||||
|
||||
/**
|
||||
* @var string
|
||||
* @cvalue pgsql_libpq_version
|
||||
*/
|
||||
const PGSQL_LIBPQ_VERSION = UNKNOWN;
|
||||
/**
|
||||
* @var string
|
||||
* @cvalue pgsql_libpq_version
|
||||
* @deprecated
|
||||
*/
|
||||
const PGSQL_LIBPQ_VERSION_STR = UNKNOWN;
|
||||
|
||||
/* For connection option */
|
||||
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PGSQL_CONNECT_FORCE_NEW
|
||||
*/
|
||||
const PGSQL_CONNECT_FORCE_NEW = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PGSQL_CONNECT_ASYNC
|
||||
*/
|
||||
const PGSQL_CONNECT_ASYNC = UNKNOWN;
|
||||
|
||||
/* For pg_fetch_array() */
|
||||
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PGSQL_ASSOC
|
||||
*/
|
||||
const PGSQL_ASSOC = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PGSQL_NUM
|
||||
*/
|
||||
const PGSQL_NUM = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PGSQL_BOTH
|
||||
*/
|
||||
const PGSQL_BOTH = UNKNOWN;
|
||||
|
||||
/* For pg_last_notice() */
|
||||
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PGSQL_NOTICE_LAST
|
||||
*/
|
||||
const PGSQL_NOTICE_LAST = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PGSQL_NOTICE_ALL
|
||||
*/
|
||||
const PGSQL_NOTICE_ALL = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PGSQL_NOTICE_CLEAR
|
||||
*/
|
||||
const PGSQL_NOTICE_CLEAR = UNKNOWN;
|
||||
|
||||
/* For pg_connection_status() */
|
||||
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue CONNECTION_BAD
|
||||
*/
|
||||
const PGSQL_CONNECTION_BAD = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue CONNECTION_OK
|
||||
*/
|
||||
const PGSQL_CONNECTION_OK = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue CONNECTION_STARTED
|
||||
*/
|
||||
const PGSQL_CONNECTION_STARTED = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue CONNECTION_MADE
|
||||
*/
|
||||
const PGSQL_CONNECTION_MADE = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue CONNECTION_AWAITING_RESPONSE
|
||||
*/
|
||||
const PGSQL_CONNECTION_AWAITING_RESPONSE = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue CONNECTION_AUTH_OK
|
||||
*/
|
||||
const PGSQL_CONNECTION_AUTH_OK = UNKNOWN;
|
||||
#ifdef CONNECTION_SSL_STARTUP
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue CONNECTION_SSL_STARTUP
|
||||
*/
|
||||
const PGSQL_CONNECTION_SSL_STARTUP = UNKNOWN;
|
||||
#endif
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue CONNECTION_SETENV
|
||||
*/
|
||||
const PGSQL_CONNECTION_SETENV = UNKNOWN;
|
||||
|
||||
/* For pg_connect_poll() */
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PGRES_POLLING_FAILED
|
||||
*/
|
||||
const PGSQL_POLLING_FAILED = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PGRES_POLLING_READING
|
||||
*/
|
||||
const PGSQL_POLLING_READING = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PGRES_POLLING_WRITING
|
||||
*/
|
||||
const PGSQL_POLLING_WRITING = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PGRES_POLLING_OK
|
||||
*/
|
||||
const PGSQL_POLLING_OK = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PGRES_POLLING_ACTIVE
|
||||
*/
|
||||
const PGSQL_POLLING_ACTIVE = UNKNOWN;
|
||||
|
||||
/* For pg_transaction_status() */
|
||||
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PQTRANS_IDLE
|
||||
*/
|
||||
const PGSQL_TRANSACTION_IDLE = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PQTRANS_ACTIVE
|
||||
*/
|
||||
const PGSQL_TRANSACTION_ACTIVE = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PQTRANS_INTRANS
|
||||
*/
|
||||
const PGSQL_TRANSACTION_INTRANS = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PQTRANS_INERROR
|
||||
*/
|
||||
const PGSQL_TRANSACTION_INERROR = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PQTRANS_UNKNOWN
|
||||
*/
|
||||
const PGSQL_TRANSACTION_UNKNOWN = UNKNOWN;
|
||||
|
||||
/* For pg_set_error_verbosity() */
|
||||
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PQERRORS_TERSE
|
||||
*/
|
||||
const PGSQL_ERRORS_TERSE = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PQERRORS_DEFAULT
|
||||
*/
|
||||
const PGSQL_ERRORS_DEFAULT = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PQERRORS_VERBOSE
|
||||
*/
|
||||
const PGSQL_ERRORS_VERBOSE = UNKNOWN;
|
||||
#if PGVERSION_NUM > 110000
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PQERRORS_SQLSTATE
|
||||
*/
|
||||
const PGSQL_ERRORS_SQLSTATE = UNKNOWN;
|
||||
#else
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PQERRORS_TERSE
|
||||
*/
|
||||
const PGSQL_ERRORS_SQLSTATE = UNKNOWN;
|
||||
#endif
|
||||
|
||||
/* For lo_seek() */
|
||||
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue SEEK_SET
|
||||
*/
|
||||
const PGSQL_SEEK_SET = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue SEEK_CUR
|
||||
*/
|
||||
const PGSQL_SEEK_CUR = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue SEEK_END
|
||||
*/
|
||||
const PGSQL_SEEK_END = UNKNOWN;
|
||||
|
||||
/* For pg_result_status() return value type */
|
||||
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PGSQL_STATUS_LONG
|
||||
*/
|
||||
const PGSQL_STATUS_LONG = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PGSQL_STATUS_STRING
|
||||
*/
|
||||
const PGSQL_STATUS_STRING = UNKNOWN;
|
||||
|
||||
/* For pg_result_status() return value */
|
||||
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PGRES_EMPTY_QUERY
|
||||
*/
|
||||
const PGSQL_EMPTY_QUERY = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PGRES_COMMAND_OK
|
||||
*/
|
||||
const PGSQL_COMMAND_OK = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PGRES_TUPLES_OK
|
||||
*/
|
||||
const PGSQL_TUPLES_OK = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PGRES_COPY_OUT
|
||||
*/
|
||||
const PGSQL_COPY_OUT = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PGRES_COPY_IN
|
||||
*/
|
||||
const PGSQL_COPY_IN = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PGRES_BAD_RESPONSE
|
||||
*/
|
||||
const PGSQL_BAD_RESPONSE = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PGRES_NONFATAL_ERROR
|
||||
*/
|
||||
const PGSQL_NONFATAL_ERROR = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PGRES_FATAL_ERROR
|
||||
*/
|
||||
const PGSQL_FATAL_ERROR = UNKNOWN;
|
||||
|
||||
/* For pg_result_error_field() field codes */
|
||||
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PG_DIAG_SEVERITY
|
||||
*/
|
||||
const PGSQL_DIAG_SEVERITY = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PG_DIAG_SQLSTATE
|
||||
*/
|
||||
const PGSQL_DIAG_SQLSTATE = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PG_DIAG_MESSAGE_PRIMARY
|
||||
*/
|
||||
const PGSQL_DIAG_MESSAGE_PRIMARY = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PG_DIAG_MESSAGE_DETAIL
|
||||
*/
|
||||
const PGSQL_DIAG_MESSAGE_DETAIL = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PG_DIAG_MESSAGE_HINT
|
||||
*/
|
||||
const PGSQL_DIAG_MESSAGE_HINT = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PG_DIAG_STATEMENT_POSITION
|
||||
*/
|
||||
const PGSQL_DIAG_STATEMENT_POSITION = UNKNOWN;
|
||||
#ifdef PG_DIAG_INTERNAL_POSITION
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PG_DIAG_INTERNAL_POSITION
|
||||
*/
|
||||
const PGSQL_DIAG_INTERNAL_POSITION = UNKNOWN;
|
||||
#endif
|
||||
#ifdef PG_DIAG_INTERNAL_QUERY
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PG_DIAG_INTERNAL_QUERY
|
||||
*/
|
||||
const PGSQL_DIAG_INTERNAL_QUERY = UNKNOWN;
|
||||
#endif
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PG_DIAG_CONTEXT
|
||||
*/
|
||||
const PGSQL_DIAG_CONTEXT = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PG_DIAG_SOURCE_FILE
|
||||
*/
|
||||
const PGSQL_DIAG_SOURCE_FILE = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PG_DIAG_SOURCE_LINE
|
||||
*/
|
||||
const PGSQL_DIAG_SOURCE_LINE = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PG_DIAG_SOURCE_FUNCTION
|
||||
*/
|
||||
const PGSQL_DIAG_SOURCE_FUNCTION = UNKNOWN;
|
||||
#ifdef PG_DIAG_SCHEMA_NAME
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PG_DIAG_SCHEMA_NAME
|
||||
*/
|
||||
const PGSQL_DIAG_SCHEMA_NAME = UNKNOWN;
|
||||
#endif
|
||||
#ifdef PG_DIAG_TABLE_NAME
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PG_DIAG_TABLE_NAME
|
||||
*/
|
||||
const PGSQL_DIAG_TABLE_NAME = UNKNOWN;
|
||||
#endif
|
||||
#ifdef PG_DIAG_COLUMN_NAME
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PG_DIAG_COLUMN_NAME
|
||||
*/
|
||||
const PGSQL_DIAG_COLUMN_NAME = UNKNOWN;
|
||||
#endif
|
||||
#ifdef PG_DIAG_DATATYPE_NAME
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PG_DIAG_DATATYPE_NAME
|
||||
*/
|
||||
const PGSQL_DIAG_DATATYPE_NAME = UNKNOWN;
|
||||
#endif
|
||||
#ifdef PG_DIAG_CONSTRAINT_NAME
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PG_DIAG_CONSTRAINT_NAME
|
||||
*/
|
||||
const PGSQL_DIAG_CONSTRAINT_NAME = UNKNOWN;
|
||||
#endif
|
||||
#ifdef PG_DIAG_SEVERITY_NONLOCALIZED
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PG_DIAG_SEVERITY_NONLOCALIZED
|
||||
*/
|
||||
const PGSQL_DIAG_SEVERITY_NONLOCALIZED = UNKNOWN;
|
||||
#endif
|
||||
|
||||
/* pg_convert options */
|
||||
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PGSQL_CONV_IGNORE_DEFAULT
|
||||
*/
|
||||
const PGSQL_CONV_IGNORE_DEFAULT = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PGSQL_CONV_FORCE_NULL
|
||||
*/
|
||||
const PGSQL_CONV_FORCE_NULL = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PGSQL_CONV_IGNORE_NOT_NULL
|
||||
*/
|
||||
const PGSQL_CONV_IGNORE_NOT_NULL = UNKNOWN;
|
||||
|
||||
/* pg_insert/update/delete/select options */
|
||||
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PGSQL_DML_ESCAPE
|
||||
*/
|
||||
const PGSQL_DML_ESCAPE = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PGSQL_DML_NO_CONV
|
||||
*/
|
||||
const PGSQL_DML_NO_CONV = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PGSQL_DML_EXEC
|
||||
*/
|
||||
const PGSQL_DML_EXEC = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PGSQL_DML_ASYNC
|
||||
*/
|
||||
const PGSQL_DML_ASYNC = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PGSQL_DML_STRING
|
||||
*/
|
||||
const PGSQL_DML_STRING = UNKNOWN;
|
||||
#ifdef PQTRACE_SUPPPRESS_TIMESTAMPS
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PQTRACE_SUPPRESS_TIMESTAMPS
|
||||
*/
|
||||
const PGSQL_TRACE_SUPPRESS_TIMESTAMPS = UNKNOWN;
|
||||
#endif
|
||||
#ifdef PQTRACE_REGRESS_MODE
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PQTRACE_REGRESS_MODE
|
||||
*/
|
||||
const PGSQL_TRACE_REGRESS_MODE = UNKNOWN;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PG_CONTEXT_VISIBILITY
|
||||
/* For pg_set_error_context_visibility() */
|
||||
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PQSHOW_CONTEXT_NEVER
|
||||
*/
|
||||
const PGSQL_SHOW_CONTEXT_NEVER = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PQSHOW_CONTEXT_ERRORS
|
||||
*/
|
||||
const PGSQL_SHOW_CONTEXT_ERRORS = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PQSHOW_CONTEXT_ALWAYS
|
||||
*/
|
||||
const PGSQL_SHOW_CONTEXT_ALWAYS = UNKNOWN;
|
||||
#endif
|
||||
|
||||
function pg_connect(string $connection_string, int $flags = 0): PgSql\Connection|false {}
|
||||
|
||||
function pg_pconnect(string $connection_string, int $flags = 0): PgSql\Connection|false {}
|
||||
|
||||
function pg_connect_poll(PgSql\Connection $connection): int {}
|
||||
|
||||
function pg_close(?PgSql\Connection $connection = null): true {}
|
||||
|
||||
/** @refcount 1 */
|
||||
function pg_dbname(?PgSql\Connection $connection = null): string {}
|
||||
|
||||
function pg_last_error(?PgSql\Connection $connection = null): string {}
|
||||
|
||||
/**
|
||||
* @alias pg_last_error
|
||||
* @deprecated
|
||||
*/
|
||||
function pg_errormessage(?PgSql\Connection $connection = null): string {}
|
||||
|
||||
/** @refcount 1 */
|
||||
function pg_options(?PgSql\Connection $connection = null): string {}
|
||||
|
||||
/** @refcount 1 */
|
||||
function pg_port(?PgSql\Connection $connection = null): string {}
|
||||
|
||||
/** @refcount 1 */
|
||||
function pg_tty(?PgSql\Connection $connection = null): string {}
|
||||
|
||||
/** @refcount 1 */
|
||||
function pg_host(?PgSql\Connection $connection = null): string {}
|
||||
|
||||
/**
|
||||
* @return array<string, int|string|null>
|
||||
* @refcount 1
|
||||
*/
|
||||
function pg_version(?PgSql\Connection $connection = null): array {}
|
||||
|
||||
/**
|
||||
* @param PgSql\Connection|string $connection
|
||||
* @refcount 1
|
||||
*/
|
||||
function pg_parameter_status($connection, string $name = UNKNOWN): string|false {}
|
||||
|
||||
function pg_ping(?PgSql\Connection $connection = null): bool {}
|
||||
|
||||
/**
|
||||
* @param PgSql\Connection|string $connection
|
||||
* @refcount 1
|
||||
*/
|
||||
function pg_query($connection, string $query = UNKNOWN): PgSql\Result|false {}
|
||||
|
||||
/**
|
||||
* @param PgSql\Connection|string $connection
|
||||
* @alias pg_query
|
||||
*/
|
||||
function pg_exec($connection, string $query = UNKNOWN): PgSql\Result|false {}
|
||||
|
||||
/**
|
||||
* @param PgSql\Connection|string $connection
|
||||
* @param string|array $query
|
||||
* @refcount 1
|
||||
*/
|
||||
function pg_query_params($connection, $query, array $params = UNKNOWN): PgSql\Result|false {}
|
||||
|
||||
/**
|
||||
* @param PgSql\Connection|string $connection
|
||||
* @refcount 1
|
||||
*/
|
||||
function pg_prepare($connection, string $statement_name, string $query = UNKNOWN): PgSql\Result|false {}
|
||||
|
||||
/**
|
||||
* @param PgSql\Connection|string $connection
|
||||
* @param string|array $statement_name
|
||||
* @refcount 1
|
||||
*/
|
||||
function pg_execute($connection, $statement_name, array $params = UNKNOWN): PgSql\Result|false {}
|
||||
|
||||
function pg_num_rows(PgSql\Result $result): int {}
|
||||
|
||||
/**
|
||||
* @alias pg_num_rows
|
||||
* @deprecated
|
||||
*/
|
||||
function pg_numrows(PgSql\Result $result): int {}
|
||||
|
||||
function pg_num_fields(PgSql\Result $result): int {}
|
||||
|
||||
/**
|
||||
* @alias pg_num_fields
|
||||
* @deprecated
|
||||
*/
|
||||
function pg_numfields(PgSql\Result $result): int {}
|
||||
|
||||
function pg_affected_rows(PgSql\Result $result): int {}
|
||||
|
||||
/**
|
||||
* @alias pg_affected_rows
|
||||
* @deprecated
|
||||
*/
|
||||
function pg_cmdtuples(PgSql\Result $result): int {}
|
||||
|
||||
function pg_last_notice(PgSql\Connection $connection, int $mode = PGSQL_NOTICE_LAST): array|string|bool {}
|
||||
|
||||
function pg_field_table(PgSql\Result $result, int $field, bool $oid_only = false): string|int|false {}
|
||||
|
||||
/** @refcount 1 */
|
||||
function pg_field_name(PgSql\Result $result, int $field): string {}
|
||||
|
||||
/**
|
||||
* @alias pg_field_name
|
||||
* @deprecated
|
||||
*/
|
||||
function pg_fieldname(PgSql\Result $result, int $field): string {}
|
||||
|
||||
function pg_field_size(PgSql\Result $result, int $field): int {}
|
||||
|
||||
/**
|
||||
* @alias pg_field_size
|
||||
* @deprecated
|
||||
*/
|
||||
function pg_fieldsize(PgSql\Result $result, int $field): int {}
|
||||
|
||||
function pg_field_type(PgSql\Result $result, int $field): string {}
|
||||
|
||||
/**
|
||||
* @alias pg_field_type
|
||||
* @deprecated
|
||||
*/
|
||||
function pg_fieldtype(PgSql\Result $result, int $field): string {}
|
||||
|
||||
/** @refcount 1 */
|
||||
function pg_field_type_oid(PgSql\Result $result, int $field): string|int {}
|
||||
|
||||
function pg_field_num(PgSql\Result $result, string $field): int {}
|
||||
|
||||
/**
|
||||
* @alias pg_field_num
|
||||
* @deprecated
|
||||
*/
|
||||
function pg_fieldnum(PgSql\Result $result, string $field): int {}
|
||||
|
||||
/**
|
||||
* @param string|int|null $row
|
||||
* @refcount 1
|
||||
*/
|
||||
function pg_fetch_result(PgSql\Result $result, $row, string|int $field = UNKNOWN): string|false|null {}
|
||||
|
||||
/**
|
||||
* @param string|int $row
|
||||
* @alias pg_fetch_result
|
||||
* @deprecated
|
||||
*/
|
||||
function pg_result(PgSql\Result $result, $row, string|int $field = UNKNOWN): string|false|null {}
|
||||
|
||||
/**
|
||||
* @return array<int|string, string|null>|false
|
||||
* @refcount 1
|
||||
*/
|
||||
function pg_fetch_row(PgSql\Result $result, ?int $row = null, int $mode = PGSQL_NUM): array|false {}
|
||||
|
||||
/**
|
||||
* @return array<int|string, string|null>|false
|
||||
* @refcount 1
|
||||
*/
|
||||
function pg_fetch_assoc(PgSql\Result $result, ?int $row = null): array|false {}
|
||||
|
||||
/**
|
||||
* @return array<int|string, string|null>|false
|
||||
* @refcount 1
|
||||
*/
|
||||
function pg_fetch_array(PgSql\Result $result, ?int $row = null, int $mode = PGSQL_BOTH): array|false {}
|
||||
|
||||
/** @refcount 1 */
|
||||
function pg_fetch_object(PgSql\Result $result, ?int $row = null, string $class = "stdClass", array $constructor_args = []): object|false {}
|
||||
|
||||
/**
|
||||
* @return array<int, array>
|
||||
* @refcount 1
|
||||
*/
|
||||
function pg_fetch_all(PgSql\Result $result, int $mode = PGSQL_ASSOC): array {}
|
||||
|
||||
/**
|
||||
* @return array<int, string|null>
|
||||
* @refcount 1
|
||||
*/
|
||||
function pg_fetch_all_columns(PgSql\Result $result, int $field = 0): array {}
|
||||
|
||||
function pg_result_seek(PgSql\Result $result, int $row): bool {}
|
||||
|
||||
/** @param string|int|null $row */
|
||||
function pg_field_prtlen(PgSql\Result $result, $row, string|int $field = UNKNOWN): int|false {}
|
||||
|
||||
/**
|
||||
* @param string|int $row
|
||||
* @deprecated
|
||||
*/
|
||||
function pg_fieldprtlen(PgSql\Result $result, $row, string|int $field = UNKNOWN): int|false {}
|
||||
|
||||
/** @param string|int|null $row */
|
||||
function pg_field_is_null(PgSql\Result $result, $row, string|int $field = UNKNOWN): int|false {}
|
||||
|
||||
/**
|
||||
* @param string|int $row
|
||||
* @deprecated
|
||||
*/
|
||||
function pg_fieldisnull(PgSql\Result $result, $row, string|int $field = UNKNOWN): int|false {}
|
||||
|
||||
function pg_free_result(PgSql\Result $result): bool {}
|
||||
|
||||
/**
|
||||
* @alias pg_free_result
|
||||
* @deprecated
|
||||
*/
|
||||
function pg_freeresult(PgSql\Result $result): bool {}
|
||||
|
||||
/** @refcount 1 */
|
||||
function pg_last_oid(PgSql\Result $result): string|int|false {}
|
||||
|
||||
/**
|
||||
* @alias pg_last_oid
|
||||
* @deprecated
|
||||
*/
|
||||
function pg_getlastoid(PgSql\Result $result): string|int|false {}
|
||||
|
||||
function pg_trace(string $filename, string $mode = "w", ?PgSql\Connection $connection = null, int $trace_mode = 0): bool {}
|
||||
|
||||
function pg_untrace(?PgSql\Connection $connection = null): true {}
|
||||
|
||||
/**
|
||||
* @param PgSql\Connection $connection
|
||||
* @param string|int $oid
|
||||
* @refcount 1
|
||||
*/
|
||||
function pg_lo_create($connection = UNKNOWN, $oid = UNKNOWN): string|int|false {}
|
||||
|
||||
/**
|
||||
* @param PgSql\Connection $connection
|
||||
* @param string|int $oid
|
||||
* @alias pg_lo_create
|
||||
* @deprecated
|
||||
*/
|
||||
function pg_locreate($connection = UNKNOWN, $oid = UNKNOWN): string|int|false {}
|
||||
|
||||
/**
|
||||
* @param PgSql\Connection $connection
|
||||
* @param string|int $oid
|
||||
*/
|
||||
function pg_lo_unlink($connection, $oid = UNKNOWN): bool {}
|
||||
|
||||
/**
|
||||
* @param PgSql\Connection $connection
|
||||
* @param string|int $oid
|
||||
* @alias pg_lo_unlink
|
||||
* @deprecated
|
||||
*/
|
||||
function pg_lounlink($connection, $oid = UNKNOWN): bool {}
|
||||
|
||||
/**
|
||||
* @param PgSql\Connection $connection
|
||||
* @param string|int $oid
|
||||
* @refcount 1
|
||||
*/
|
||||
function pg_lo_open($connection, $oid = UNKNOWN, string $mode = UNKNOWN): PgSql\Lob|false {}
|
||||
|
||||
/**
|
||||
* @param PgSql\Connection $connection
|
||||
* @param string|int $oid
|
||||
* @alias pg_lo_open
|
||||
* @deprecated
|
||||
*/
|
||||
function pg_loopen($connection, $oid = UNKNOWN, string $mode = UNKNOWN): PgSql\Lob|false {}
|
||||
|
||||
function pg_lo_close(PgSql\Lob $lob): bool {}
|
||||
|
||||
/**
|
||||
* @alias pg_lo_close
|
||||
* @deprecated
|
||||
*/
|
||||
function pg_loclose(PgSql\Lob $lob): bool {}
|
||||
|
||||
/** @refcount 1 */
|
||||
function pg_lo_read(PgSql\Lob $lob, int $length = 8192): string|false {}
|
||||
|
||||
/**
|
||||
* @alias pg_lo_read
|
||||
* @deprecated
|
||||
*/
|
||||
function pg_loread(PgSql\Lob $lob, int $length = 8192): string|false {}
|
||||
|
||||
function pg_lo_write(PgSql\Lob $lob, string $data, ?int $length = null): int|false {}
|
||||
|
||||
/**
|
||||
* @alias pg_lo_write
|
||||
* @deprecated
|
||||
*/
|
||||
function pg_lowrite(PgSql\Lob $lob, string $data, ?int $length = null): int|false {}
|
||||
|
||||
function pg_lo_read_all(PgSql\Lob $lob): int {}
|
||||
|
||||
/**
|
||||
* @alias pg_lo_read_all
|
||||
* @deprecated
|
||||
*/
|
||||
function pg_loreadall(PgSql\Lob $lob): int {}
|
||||
|
||||
/**
|
||||
* @param PgSql\Connection|string $connection
|
||||
* @param string|int $filename
|
||||
* @param string|int $oid
|
||||
* @refcount 1
|
||||
*/
|
||||
function pg_lo_import($connection, $filename = UNKNOWN, $oid = UNKNOWN): string|int|false {}
|
||||
|
||||
/**
|
||||
* @param PgSql\Connection|string $connection
|
||||
* @param string|int $filename
|
||||
* @param string|int $oid
|
||||
* @alias pg_lo_import
|
||||
* @deprecated
|
||||
*/
|
||||
function pg_loimport($connection, $filename = UNKNOWN, $oid = UNKNOWN): string|int|false {}
|
||||
|
||||
/**
|
||||
* @param PgSql\Connection|string|int $connection
|
||||
* @param string|int $oid
|
||||
* @param string|int $filename
|
||||
*/
|
||||
function pg_lo_export($connection, $oid = UNKNOWN, $filename = UNKNOWN): bool {}
|
||||
|
||||
/**
|
||||
* @param PgSql\Connection|string|int $connection
|
||||
* @param string|int $oid
|
||||
* @param string|int $filename
|
||||
* @alias pg_lo_export
|
||||
* @deprecated
|
||||
*/
|
||||
function pg_loexport($connection, $oid = UNKNOWN, $filename = UNKNOWN): bool {}
|
||||
|
||||
function pg_lo_seek(PgSql\Lob $lob, int $offset, int $whence = SEEK_CUR): bool {}
|
||||
|
||||
function pg_lo_tell(PgSql\Lob $lob): int {}
|
||||
|
||||
function pg_lo_truncate(PgSql\Lob $lob, int $size): bool {}
|
||||
|
||||
/** @param PgSql\Connection|int $connection */
|
||||
function pg_set_error_verbosity($connection, int $verbosity = UNKNOWN): int|false {}
|
||||
|
||||
/** @param PgSql\Connection|string $connection */
|
||||
function pg_set_client_encoding($connection, string $encoding = UNKNOWN): int {}
|
||||
|
||||
/**
|
||||
* @param PgSql\Connection|string $connection
|
||||
* @alias pg_set_client_encoding
|
||||
* @deprecated
|
||||
*/
|
||||
function pg_setclientencoding($connection, string $encoding = UNKNOWN): int {}
|
||||
|
||||
function pg_client_encoding(?PgSql\Connection $connection = null): string {}
|
||||
|
||||
/**
|
||||
* @alias pg_client_encoding
|
||||
* @deprecated
|
||||
*/
|
||||
function pg_clientencoding(?PgSql\Connection $connection = null): string {}
|
||||
|
||||
function pg_end_copy(?PgSql\Connection $connection = null): bool {}
|
||||
|
||||
/** @param PgSql\Connection|string $connection */
|
||||
function pg_put_line($connection, string $query = UNKNOWN): bool {}
|
||||
|
||||
/**
|
||||
* @return array<int, string>|false
|
||||
* @refcount 1
|
||||
*/
|
||||
function pg_copy_to(PgSql\Connection $connection, string $table_name, string $separator = "\t", string $null_as = "\\\\N"): array|false {}
|
||||
|
||||
function pg_copy_from(PgSql\Connection $connection, string $table_name, array $rows, string $separator = "\t", string $null_as = "\\\\N"): bool {}
|
||||
|
||||
/**
|
||||
* @param PgSql\Connection|string $connection
|
||||
* @refcount 1
|
||||
*/
|
||||
function pg_escape_string($connection, string $string = UNKNOWN): string {}
|
||||
|
||||
/**
|
||||
* @param PgSql\Connection|string $connection
|
||||
* @refcount 1
|
||||
*/
|
||||
function pg_escape_bytea($connection, string $string = UNKNOWN): string {}
|
||||
|
||||
/** @refcount 1 */
|
||||
function pg_unescape_bytea(string $string): string {}
|
||||
|
||||
/**
|
||||
* @param PgSql\Connection|string $connection
|
||||
* @refcount 1
|
||||
*/
|
||||
function pg_escape_literal($connection, string $string = UNKNOWN): string|false {}
|
||||
|
||||
/**
|
||||
* @param PgSql\Connection|string $connection
|
||||
* @refcount 1
|
||||
*/
|
||||
function pg_escape_identifier($connection, string $string = UNKNOWN): string|false {}
|
||||
|
||||
/** @refcount 1 */
|
||||
function pg_result_error(PgSql\Result $result): string|false {}
|
||||
|
||||
/** @refcount 1 */
|
||||
function pg_result_error_field(PgSql\Result $result, int $field_code): string|false|null {}
|
||||
|
||||
function pg_connection_status(PgSql\Connection $connection): int {}
|
||||
|
||||
function pg_transaction_status(PgSql\Connection $connection): int {}
|
||||
|
||||
function pg_connection_reset(PgSql\Connection $connection): bool {}
|
||||
|
||||
function pg_cancel_query(PgSql\Connection $connection): bool {}
|
||||
|
||||
function pg_connection_busy(PgSql\Connection $connection): bool {}
|
||||
|
||||
function pg_send_query(PgSql\Connection $connection, string $query): int|bool {}
|
||||
|
||||
function pg_send_query_params(PgSql\Connection $connection, string $query, array $params): int|bool {}
|
||||
|
||||
function pg_send_prepare(PgSql\Connection $connection, string $statement_name, string $query): int|bool {}
|
||||
|
||||
function pg_send_execute(PgSql\Connection $connection, string $statement_name, array $params): int|bool {}
|
||||
|
||||
/** @refcount 1 */
|
||||
function pg_get_result(PgSql\Connection $connection): PgSql\Result|false {}
|
||||
|
||||
/** @refcount 1 */
|
||||
function pg_result_status(PgSql\Result $result, int $mode = PGSQL_STATUS_LONG): string|int {}
|
||||
|
||||
/**
|
||||
* @return array<int|string, int|string>
|
||||
* @refcount 1
|
||||
*/
|
||||
function pg_get_notify(PgSql\Connection $connection, int $mode = PGSQL_ASSOC): array|false {}
|
||||
|
||||
function pg_get_pid(PgSql\Connection $connection): int {}
|
||||
|
||||
/**
|
||||
* @return resource|false
|
||||
* @refcount 1
|
||||
*/
|
||||
function pg_socket(PgSql\Connection $connection) {}
|
||||
|
||||
function pg_consume_input(PgSql\Connection $connection): bool {}
|
||||
|
||||
function pg_flush(PgSql\Connection $connection): int|bool {}
|
||||
|
||||
/**
|
||||
* @return array<string, array>|false
|
||||
* @refcount 1
|
||||
*/
|
||||
function pg_meta_data(PgSql\Connection $connection, string $table_name, bool $extended = false): array|false {}
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>|false
|
||||
* @refcount 1
|
||||
*/
|
||||
function pg_convert(PgSql\Connection $connection, string $table_name, array $values, int $flags = 0): array|false {}
|
||||
|
||||
/** @refcount 1 */
|
||||
function pg_insert(PgSql\Connection $connection, string $table_name, array $values, int $flags = PGSQL_DML_EXEC): PgSql\Result|string|bool {}
|
||||
|
||||
/** @refcount 1 */
|
||||
function pg_update(PgSql\Connection $connection, string $table_name, array $values, array $conditions, int $flags = PGSQL_DML_EXEC): string|bool {}
|
||||
|
||||
/** @refcount 1 */
|
||||
function pg_delete(PgSql\Connection $connection, string $table_name, array $conditions, int $flags = PGSQL_DML_EXEC): string|bool {}
|
||||
|
||||
/**
|
||||
* @return array<int, array>|string|false
|
||||
* @refcount 1
|
||||
*/
|
||||
function pg_select(PgSql\Connection $connection, string $table_name, array $conditions = [], int $flags = PGSQL_DML_EXEC, int $mode = PGSQL_ASSOC): array|string|false {}
|
||||
|
||||
#ifdef HAVE_PG_CONTEXT_VISIBILITY
|
||||
function pg_set_error_context_visibility(PgSql\Connection $connection, int $visibility): int {}
|
||||
#endif
|
||||
}
|
||||
|
||||
namespace PgSql {
|
||||
/**
|
||||
* @strict-properties
|
||||
* @not-serializable
|
||||
*/
|
||||
final class Connection
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @strict-properties
|
||||
* @not-serializable
|
||||
*/
|
||||
final class Result
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @strict-properties
|
||||
* @not-serializable
|
||||
*/
|
||||
final class Lob
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
4958
dev/tools/phan/stubs/restler.php
Normal file
4958
dev/tools/phan/stubs/restler.php
Normal file
File diff suppressed because it is too large
Load Diff
68
dev/tools/phan/stubs/session.phan_php
Normal file
68
dev/tools/phan/stubs/session.phan_php
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
<?php
|
||||
// These stubs were generated by the phan stub generator.
|
||||
// @phan-stub-for-extension session@7.4.12
|
||||
|
||||
namespace {
|
||||
class SessionHandler implements \SessionHandlerInterface, \SessionIdInterface {
|
||||
|
||||
// methods
|
||||
public function open($save_path, $session_name) {}
|
||||
public function close() {}
|
||||
public function read($key) {}
|
||||
public function write($key, $val) {}
|
||||
public function destroy($key) {}
|
||||
public function gc($maxlifetime) {}
|
||||
public function create_sid() {}
|
||||
}
|
||||
|
||||
interface SessionHandlerInterface {
|
||||
|
||||
// methods
|
||||
function open($save_path, $session_name);
|
||||
function close();
|
||||
function read($key);
|
||||
function write($key, $val);
|
||||
function destroy($key);
|
||||
function gc($maxlifetime);
|
||||
}
|
||||
|
||||
interface SessionIdInterface {
|
||||
|
||||
// methods
|
||||
function create_sid();
|
||||
}
|
||||
|
||||
interface SessionUpdateTimestampHandlerInterface {
|
||||
|
||||
// methods
|
||||
function validateId($key);
|
||||
function updateTimestamp($key, $val);
|
||||
}
|
||||
|
||||
function session_abort() {}
|
||||
function session_cache_expire($new_cache_expire = null) {}
|
||||
function session_cache_limiter($cache_limiter = null) {}
|
||||
function session_commit() {}
|
||||
function session_create_id($prefix = null) {}
|
||||
function session_decode($data) {}
|
||||
function session_destroy() {}
|
||||
function session_encode() {}
|
||||
function session_gc() {}
|
||||
function session_get_cookie_params() {}
|
||||
function session_id($id = null) {}
|
||||
function session_module_name($module = null) {}
|
||||
function session_name($name = null) {}
|
||||
function session_regenerate_id($delete_old_session = null) {}
|
||||
function session_register_shutdown() {}
|
||||
function session_reset() {}
|
||||
function session_save_path($path = null) {}
|
||||
function session_set_cookie_params($lifetime_or_options, $path = null, $domain = null, $secure = null, $httponly = null) {}
|
||||
function session_set_save_handler($open, $close = null, $read = null, $write = null, $destroy = null, $gc = null, $create_sid = null, $validate_sid = null, $update_timestamp = null) {}
|
||||
function session_start($options = null) {}
|
||||
function session_status() {}
|
||||
function session_unset() {}
|
||||
function session_write_close() {}
|
||||
const PHP_SESSION_ACTIVE = 2;
|
||||
const PHP_SESSION_DISABLED = 0;
|
||||
const PHP_SESSION_NONE = 1;
|
||||
}
|
||||
220
dev/tools/phan/stubs/soap.phan_php
Normal file
220
dev/tools/phan/stubs/soap.phan_php
Normal file
|
|
@ -0,0 +1,220 @@
|
|||
<?php
|
||||
// These stubs were generated by the phan stub generator.
|
||||
// @phan-stub-for-extension soap@8.2.9
|
||||
|
||||
namespace {
|
||||
class SoapClient {
|
||||
|
||||
// properties
|
||||
private $uri;
|
||||
private $style;
|
||||
private $use;
|
||||
private $location;
|
||||
private $trace;
|
||||
private $compression;
|
||||
private $sdl;
|
||||
private $typemap;
|
||||
private $httpsocket;
|
||||
private $httpurl;
|
||||
private $_login;
|
||||
private $_password;
|
||||
private $_use_digest;
|
||||
private $_digest;
|
||||
private $_proxy_host;
|
||||
private $_proxy_port;
|
||||
private $_proxy_login;
|
||||
private $_proxy_password;
|
||||
private $_exceptions;
|
||||
private $_encoding;
|
||||
private $_classmap;
|
||||
private $_features;
|
||||
private $_connection_timeout;
|
||||
private $_stream_context;
|
||||
private $_user_agent;
|
||||
private $_keep_alive;
|
||||
private $_ssl_method;
|
||||
private $_use_proxy;
|
||||
private $_cookies;
|
||||
private $__default_headers;
|
||||
private $__soap_fault;
|
||||
private $__last_request;
|
||||
private $__last_response;
|
||||
private $__last_request_headers;
|
||||
private $__last_response_headers;
|
||||
private $_soap_version;
|
||||
|
||||
// methods
|
||||
public function __construct(?string $wsdl, array $options = []) {}
|
||||
public function __call(string $name, array $args) : mixed {}
|
||||
public function __soapCall(string $name, array $args, ?array $options = null, $inputHeaders = null, &$outputHeaders = null) : mixed {}
|
||||
public function __getFunctions() : ?array {}
|
||||
public function __getTypes() : ?array {}
|
||||
public function __getLastRequest() : ?string {}
|
||||
public function __getLastResponse() : ?string {}
|
||||
public function __getLastRequestHeaders() : ?string {}
|
||||
public function __getLastResponseHeaders() : ?string {}
|
||||
public function __doRequest(string $request, string $location, string $action, int $version, bool $oneWay = false) : ?string {}
|
||||
public function __setCookie(string $name, ?string $value = null) : void {}
|
||||
public function __getCookies() : array {}
|
||||
public function __setSoapHeaders($headers = null) : bool {}
|
||||
public function __setLocation(?string $location = null) : ?string {}
|
||||
}
|
||||
|
||||
class SoapFault extends \Exception {
|
||||
|
||||
// properties
|
||||
protected $message;
|
||||
protected $code;
|
||||
protected $file;
|
||||
protected $line;
|
||||
public $faultcode;
|
||||
public $faultcodens;
|
||||
public $faultactor;
|
||||
public $detail;
|
||||
public $_name;
|
||||
public $headerfault;
|
||||
public $faultstring;
|
||||
|
||||
// methods
|
||||
public function __construct(array|null|string $code, string $string, ?string $actor = null, mixed $details = null, ?string $name = null, mixed $headerFault = null) {}
|
||||
public function __toString() : string {}
|
||||
}
|
||||
|
||||
class SoapHeader {
|
||||
|
||||
// properties
|
||||
public $data;
|
||||
public $namespace;
|
||||
public $name;
|
||||
public $mustUnderstand;
|
||||
public $actor;
|
||||
|
||||
// methods
|
||||
public function __construct(string $namespace, string $name, mixed $data = null, bool $mustUnderstand = false, int|null|string $actor = null) {}
|
||||
}
|
||||
|
||||
class SoapParam {
|
||||
|
||||
// properties
|
||||
public $param_name;
|
||||
public $param_data;
|
||||
|
||||
// methods
|
||||
public function __construct(mixed $data, string $name) {}
|
||||
}
|
||||
|
||||
class SoapServer {
|
||||
|
||||
// properties
|
||||
private $__soap_fault;
|
||||
|
||||
// methods
|
||||
public function __construct(?string $wsdl, array $options = []) {}
|
||||
public function fault(string $code, string $string, string $actor = '', mixed $details = null, string $name = '') : void {}
|
||||
public function addSoapHeader(\SoapHeader $header) : void {}
|
||||
public function setPersistence(int $mode) : void {}
|
||||
public function setClass(string $class, mixed ...$args) : void {}
|
||||
public function setObject(object $object) : void {}
|
||||
public function getFunctions() : array {}
|
||||
public function addFunction($functions) : void {}
|
||||
public function handle(?string $request = null) : void {}
|
||||
}
|
||||
|
||||
class SoapVar {
|
||||
|
||||
// properties
|
||||
public $enc_value;
|
||||
public $enc_stype;
|
||||
public $enc_ns;
|
||||
public $enc_name;
|
||||
public $enc_namens;
|
||||
public $enc_type;
|
||||
|
||||
// methods
|
||||
public function __construct(mixed $data, ?int $encoding, ?string $typeName = null, ?string $typeNamespace = null, ?string $nodeName = null, ?string $nodeNamespace = null) {}
|
||||
}
|
||||
|
||||
function is_soap_fault(mixed $object) : bool {}
|
||||
function use_soap_error_handler(bool $enable = true) : bool {}
|
||||
const APACHE_MAP = 200;
|
||||
const SOAP_1_1 = 1;
|
||||
const SOAP_1_2 = 2;
|
||||
const SOAP_ACTOR_NEXT = 1;
|
||||
const SOAP_ACTOR_NONE = 2;
|
||||
const SOAP_ACTOR_UNLIMATERECEIVER = 3;
|
||||
const SOAP_AUTHENTICATION_BASIC = 0;
|
||||
const SOAP_AUTHENTICATION_DIGEST = 1;
|
||||
const SOAP_COMPRESSION_ACCEPT = 32;
|
||||
const SOAP_COMPRESSION_DEFLATE = 16;
|
||||
const SOAP_COMPRESSION_GZIP = 0;
|
||||
const SOAP_DOCUMENT = 2;
|
||||
const SOAP_ENCODED = 1;
|
||||
const SOAP_ENC_ARRAY = 300;
|
||||
const SOAP_ENC_OBJECT = 301;
|
||||
const SOAP_FUNCTIONS_ALL = 999;
|
||||
const SOAP_LITERAL = 2;
|
||||
const SOAP_PERSISTENCE_REQUEST = 2;
|
||||
const SOAP_PERSISTENCE_SESSION = 1;
|
||||
const SOAP_RPC = 1;
|
||||
const SOAP_SINGLE_ELEMENT_ARRAYS = 1;
|
||||
const SOAP_SSL_METHOD_SSLv2 = 1;
|
||||
const SOAP_SSL_METHOD_SSLv3 = 2;
|
||||
const SOAP_SSL_METHOD_SSLv23 = 3;
|
||||
const SOAP_SSL_METHOD_TLS = 0;
|
||||
const SOAP_USE_XSI_ARRAY_TYPE = 4;
|
||||
const SOAP_WAIT_ONE_WAY_CALLS = 2;
|
||||
const UNKNOWN_TYPE = 999998;
|
||||
const WSDL_CACHE_BOTH = 3;
|
||||
const WSDL_CACHE_DISK = 1;
|
||||
const WSDL_CACHE_MEMORY = 2;
|
||||
const WSDL_CACHE_NONE = 0;
|
||||
const XSD_1999_NAMESPACE = 'http://www.w3.org/1999/XMLSchema';
|
||||
const XSD_1999_TIMEINSTANT = 401;
|
||||
const XSD_ANYTYPE = 145;
|
||||
const XSD_ANYURI = 117;
|
||||
const XSD_ANYXML = 147;
|
||||
const XSD_BASE64BINARY = 116;
|
||||
const XSD_BOOLEAN = 102;
|
||||
const XSD_BYTE = 137;
|
||||
const XSD_DATE = 109;
|
||||
const XSD_DATETIME = 107;
|
||||
const XSD_DECIMAL = 103;
|
||||
const XSD_DOUBLE = 105;
|
||||
const XSD_DURATION = 106;
|
||||
const XSD_ENTITIES = 130;
|
||||
const XSD_ENTITY = 129;
|
||||
const XSD_FLOAT = 104;
|
||||
const XSD_GDAY = 113;
|
||||
const XSD_GMONTH = 114;
|
||||
const XSD_GMONTHDAY = 112;
|
||||
const XSD_GYEAR = 111;
|
||||
const XSD_GYEARMONTH = 110;
|
||||
const XSD_HEXBINARY = 115;
|
||||
const XSD_ID = 126;
|
||||
const XSD_IDREF = 127;
|
||||
const XSD_IDREFS = 128;
|
||||
const XSD_INT = 135;
|
||||
const XSD_INTEGER = 131;
|
||||
const XSD_LANGUAGE = 122;
|
||||
const XSD_LONG = 134;
|
||||
const XSD_NAME = 124;
|
||||
const XSD_NAMESPACE = 'http://www.w3.org/2001/XMLSchema';
|
||||
const XSD_NCNAME = 125;
|
||||
const XSD_NEGATIVEINTEGER = 133;
|
||||
const XSD_NMTOKEN = 123;
|
||||
const XSD_NMTOKENS = 144;
|
||||
const XSD_NONNEGATIVEINTEGER = 138;
|
||||
const XSD_NONPOSITIVEINTEGER = 132;
|
||||
const XSD_NORMALIZEDSTRING = 120;
|
||||
const XSD_NOTATION = 119;
|
||||
const XSD_POSITIVEINTEGER = 143;
|
||||
const XSD_QNAME = 118;
|
||||
const XSD_SHORT = 136;
|
||||
const XSD_STRING = 101;
|
||||
const XSD_TIME = 108;
|
||||
const XSD_TOKEN = 121;
|
||||
const XSD_UNSIGNEDBYTE = 142;
|
||||
const XSD_UNSIGNEDINT = 140;
|
||||
const XSD_UNSIGNEDLONG = 139;
|
||||
const XSD_UNSIGNEDSHORT = 141;
|
||||
}
|
||||
260
dev/tools/phan/stubs/sockets.phan_php
Normal file
260
dev/tools/phan/stubs/sockets.phan_php
Normal file
|
|
@ -0,0 +1,260 @@
|
|||
<?php
|
||||
// These stubs were generated by the phan stub generator.
|
||||
// @phan-stub-for-extension sockets@8.2.9
|
||||
|
||||
namespace {
|
||||
final class AddressInfo {
|
||||
}
|
||||
|
||||
final class Socket {
|
||||
}
|
||||
|
||||
function socket_accept(\Socket $socket) : \Socket|false {}
|
||||
function socket_addrinfo_bind(\AddressInfo $address) : \Socket|false {}
|
||||
function socket_addrinfo_connect(\AddressInfo $address) : \Socket|false {}
|
||||
function socket_addrinfo_explain(\AddressInfo $address) : array {}
|
||||
function socket_addrinfo_lookup(string $host, ?string $service = null, array $hints = []) : array|false {}
|
||||
function socket_bind(\Socket $socket, string $address, int $port = 0) : bool {}
|
||||
function socket_clear_error(?\Socket $socket = null) : void {}
|
||||
function socket_close(\Socket $socket) : void {}
|
||||
function socket_cmsg_space(int $level, int $type, int $num = 0) : ?int {}
|
||||
function socket_connect(\Socket $socket, string $address, ?int $port = null) : bool {}
|
||||
function socket_create(int $domain, int $type, int $protocol) : \Socket|false {}
|
||||
function socket_create_listen(int $port, int $backlog = 128) : \Socket|false {}
|
||||
function socket_create_pair(int $domain, int $type, int $protocol, &$pair) : bool {}
|
||||
function socket_export_stream(\Socket $socket) {}
|
||||
function socket_get_option(\Socket $socket, int $level, int $option) : array|false|int {}
|
||||
function socket_getopt(\Socket $socket, int $level, int $option) : array|false|int {}
|
||||
function socket_getpeername(\Socket $socket, &$address, &$port = null) : bool {}
|
||||
function socket_getsockname(\Socket $socket, &$address, &$port = null) : bool {}
|
||||
function socket_import_stream($stream) : \Socket|false {}
|
||||
function socket_last_error(?\Socket $socket = null) : int {}
|
||||
function socket_listen(\Socket $socket, int $backlog = 0) : bool {}
|
||||
function socket_read(\Socket $socket, int $length, int $mode = \PHP_BINARY_READ) : false|string {}
|
||||
function socket_recv(\Socket $socket, &$data, int $length, int $flags) : false|int {}
|
||||
function socket_recvfrom(\Socket $socket, &$data, int $length, int $flags, &$address, &$port = null) : false|int {}
|
||||
function socket_recvmsg(\Socket $socket, array &$message, int $flags = 0) : false|int {}
|
||||
function socket_select(?array &$read, ?array &$write, ?array &$except, ?int $seconds, int $microseconds = 0) : false|int {}
|
||||
function socket_send(\Socket $socket, string $data, int $length, int $flags) : false|int {}
|
||||
function socket_sendmsg(\Socket $socket, array $message, int $flags = 0) : false|int {}
|
||||
function socket_sendto(\Socket $socket, string $data, int $length, int $flags, string $address, ?int $port = null) : false|int {}
|
||||
function socket_set_block(\Socket $socket) : bool {}
|
||||
function socket_set_nonblock(\Socket $socket) : bool {}
|
||||
function socket_set_option(\Socket $socket, int $level, int $option, $value) : bool {}
|
||||
function socket_setopt(\Socket $socket, int $level, int $option, $value) : bool {}
|
||||
function socket_shutdown(\Socket $socket, int $mode = 2) : bool {}
|
||||
function socket_strerror(int $error_code) : string {}
|
||||
function socket_write(\Socket $socket, string $data, ?int $length = null) : false|int {}
|
||||
const AF_INET = 2;
|
||||
const AF_INET6 = 10;
|
||||
const AF_UNIX = 1;
|
||||
const AI_ADDRCONFIG = 32;
|
||||
const AI_ALL = 16;
|
||||
const AI_CANONIDN = 128;
|
||||
const AI_CANONNAME = 2;
|
||||
const AI_IDN = 64;
|
||||
const AI_NUMERICHOST = 4;
|
||||
const AI_NUMERICSERV = 1024;
|
||||
const AI_PASSIVE = 1;
|
||||
const AI_V4MAPPED = 8;
|
||||
const IPPROTO_IP = 0;
|
||||
const IPPROTO_IPV6 = 41;
|
||||
const IPV6_HOPLIMIT = 52;
|
||||
const IPV6_MULTICAST_HOPS = 18;
|
||||
const IPV6_MULTICAST_IF = 17;
|
||||
const IPV6_MULTICAST_LOOP = 19;
|
||||
const IPV6_PKTINFO = 50;
|
||||
const IPV6_RECVHOPLIMIT = 51;
|
||||
const IPV6_RECVPKTINFO = 49;
|
||||
const IPV6_RECVTCLASS = 66;
|
||||
const IPV6_TCLASS = 67;
|
||||
const IPV6_UNICAST_HOPS = 16;
|
||||
const IPV6_V6ONLY = 26;
|
||||
const IP_MULTICAST_IF = 32;
|
||||
const IP_MULTICAST_LOOP = 34;
|
||||
const IP_MULTICAST_TTL = 33;
|
||||
const MCAST_BLOCK_SOURCE = 43;
|
||||
const MCAST_JOIN_GROUP = 42;
|
||||
const MCAST_JOIN_SOURCE_GROUP = 46;
|
||||
const MCAST_LEAVE_GROUP = 45;
|
||||
const MCAST_LEAVE_SOURCE_GROUP = 47;
|
||||
const MCAST_UNBLOCK_SOURCE = 44;
|
||||
const MSG_CMSG_CLOEXEC = 1073741824;
|
||||
const MSG_CONFIRM = 2048;
|
||||
const MSG_CTRUNC = 8;
|
||||
const MSG_DONTROUTE = 4;
|
||||
const MSG_DONTWAIT = 64;
|
||||
const MSG_EOF = 512;
|
||||
const MSG_EOR = 128;
|
||||
const MSG_ERRQUEUE = 8192;
|
||||
const MSG_MORE = 32768;
|
||||
const MSG_NOSIGNAL = 16384;
|
||||
const MSG_OOB = 1;
|
||||
const MSG_PEEK = 2;
|
||||
const MSG_TRUNC = 32;
|
||||
const MSG_WAITALL = 256;
|
||||
const MSG_WAITFORONE = 65536;
|
||||
const MSG_ZEROCOPY = 67108864;
|
||||
const PHP_BINARY_READ = 2;
|
||||
const PHP_NORMAL_READ = 1;
|
||||
const SCM_CREDENTIALS = 2;
|
||||
const SCM_RIGHTS = 1;
|
||||
const SKF_AD_ALU_XOR_X = 40;
|
||||
const SKF_AD_CPU = 36;
|
||||
const SKF_AD_HATYPE = 28;
|
||||
const SKF_AD_IFINDEX = 8;
|
||||
const SKF_AD_MARK = 20;
|
||||
const SKF_AD_MAX = 64;
|
||||
const SKF_AD_NLATTR = 12;
|
||||
const SKF_AD_NLATTR_NEST = 16;
|
||||
const SKF_AD_OFF = -4096;
|
||||
const SKF_AD_PAY_OFFSET = 52;
|
||||
const SKF_AD_PKTTYPE = 4;
|
||||
const SKF_AD_PROTOCOL = 0;
|
||||
const SKF_AD_QUEUE = 24;
|
||||
const SKF_AD_RANDOM = 56;
|
||||
const SKF_AD_RXHASH = 32;
|
||||
const SKF_AD_VLAN_TAG = 44;
|
||||
const SKF_AD_VLAN_TAG_PRESENT = 48;
|
||||
const SKF_AD_VLAN_TPID = 60;
|
||||
const SOCKET_E2BIG = 7;
|
||||
const SOCKET_EACCES = 13;
|
||||
const SOCKET_EADDRINUSE = 98;
|
||||
const SOCKET_EADDRNOTAVAIL = 99;
|
||||
const SOCKET_EADV = 68;
|
||||
const SOCKET_EAFNOSUPPORT = 97;
|
||||
const SOCKET_EAGAIN = 11;
|
||||
const SOCKET_EALREADY = 114;
|
||||
const SOCKET_EBADE = 52;
|
||||
const SOCKET_EBADF = 9;
|
||||
const SOCKET_EBADFD = 77;
|
||||
const SOCKET_EBADMSG = 74;
|
||||
const SOCKET_EBADR = 53;
|
||||
const SOCKET_EBADRQC = 56;
|
||||
const SOCKET_EBADSLT = 57;
|
||||
const SOCKET_EBUSY = 16;
|
||||
const SOCKET_ECHRNG = 44;
|
||||
const SOCKET_ECOMM = 70;
|
||||
const SOCKET_ECONNABORTED = 103;
|
||||
const SOCKET_ECONNREFUSED = 111;
|
||||
const SOCKET_ECONNRESET = 104;
|
||||
const SOCKET_EDESTADDRREQ = 89;
|
||||
const SOCKET_EDQUOT = 122;
|
||||
const SOCKET_EEXIST = 17;
|
||||
const SOCKET_EFAULT = 14;
|
||||
const SOCKET_EHOSTDOWN = 112;
|
||||
const SOCKET_EHOSTUNREACH = 113;
|
||||
const SOCKET_EIDRM = 43;
|
||||
const SOCKET_EINPROGRESS = 115;
|
||||
const SOCKET_EINTR = 4;
|
||||
const SOCKET_EINVAL = 22;
|
||||
const SOCKET_EIO = 5;
|
||||
const SOCKET_EISCONN = 106;
|
||||
const SOCKET_EISDIR = 21;
|
||||
const SOCKET_EISNAM = 120;
|
||||
const SOCKET_EL2HLT = 51;
|
||||
const SOCKET_EL2NSYNC = 45;
|
||||
const SOCKET_EL3HLT = 46;
|
||||
const SOCKET_EL3RST = 47;
|
||||
const SOCKET_ELNRNG = 48;
|
||||
const SOCKET_ELOOP = 40;
|
||||
const SOCKET_EMEDIUMTYPE = 124;
|
||||
const SOCKET_EMFILE = 24;
|
||||
const SOCKET_EMLINK = 31;
|
||||
const SOCKET_EMSGSIZE = 90;
|
||||
const SOCKET_EMULTIHOP = 72;
|
||||
const SOCKET_ENAMETOOLONG = 36;
|
||||
const SOCKET_ENETDOWN = 100;
|
||||
const SOCKET_ENETRESET = 102;
|
||||
const SOCKET_ENETUNREACH = 101;
|
||||
const SOCKET_ENFILE = 23;
|
||||
const SOCKET_ENOANO = 55;
|
||||
const SOCKET_ENOBUFS = 105;
|
||||
const SOCKET_ENOCSI = 50;
|
||||
const SOCKET_ENODATA = 61;
|
||||
const SOCKET_ENODEV = 19;
|
||||
const SOCKET_ENOENT = 2;
|
||||
const SOCKET_ENOLCK = 37;
|
||||
const SOCKET_ENOLINK = 67;
|
||||
const SOCKET_ENOMEDIUM = 123;
|
||||
const SOCKET_ENOMEM = 12;
|
||||
const SOCKET_ENOMSG = 42;
|
||||
const SOCKET_ENONET = 64;
|
||||
const SOCKET_ENOPROTOOPT = 92;
|
||||
const SOCKET_ENOSPC = 28;
|
||||
const SOCKET_ENOSR = 63;
|
||||
const SOCKET_ENOSTR = 60;
|
||||
const SOCKET_ENOSYS = 38;
|
||||
const SOCKET_ENOTBLK = 15;
|
||||
const SOCKET_ENOTCONN = 107;
|
||||
const SOCKET_ENOTDIR = 20;
|
||||
const SOCKET_ENOTEMPTY = 39;
|
||||
const SOCKET_ENOTSOCK = 88;
|
||||
const SOCKET_ENOTTY = 25;
|
||||
const SOCKET_ENOTUNIQ = 76;
|
||||
const SOCKET_ENXIO = 6;
|
||||
const SOCKET_EOPNOTSUPP = 95;
|
||||
const SOCKET_EPERM = 1;
|
||||
const SOCKET_EPFNOSUPPORT = 96;
|
||||
const SOCKET_EPIPE = 32;
|
||||
const SOCKET_EPROTO = 71;
|
||||
const SOCKET_EPROTONOSUPPORT = 93;
|
||||
const SOCKET_EPROTOTYPE = 91;
|
||||
const SOCKET_EREMCHG = 78;
|
||||
const SOCKET_EREMOTE = 66;
|
||||
const SOCKET_EREMOTEIO = 121;
|
||||
const SOCKET_ERESTART = 85;
|
||||
const SOCKET_EROFS = 30;
|
||||
const SOCKET_ESHUTDOWN = 108;
|
||||
const SOCKET_ESOCKTNOSUPPORT = 94;
|
||||
const SOCKET_ESPIPE = 29;
|
||||
const SOCKET_ESRMNT = 69;
|
||||
const SOCKET_ESTRPIPE = 86;
|
||||
const SOCKET_ETIME = 62;
|
||||
const SOCKET_ETIMEDOUT = 110;
|
||||
const SOCKET_ETOOMANYREFS = 109;
|
||||
const SOCKET_EUNATCH = 49;
|
||||
const SOCKET_EUSERS = 87;
|
||||
const SOCKET_EWOULDBLOCK = 11;
|
||||
const SOCKET_EXDEV = 18;
|
||||
const SOCKET_EXFULL = 54;
|
||||
const SOCK_DGRAM = 2;
|
||||
const SOCK_RAW = 3;
|
||||
const SOCK_RDM = 4;
|
||||
const SOCK_SEQPACKET = 5;
|
||||
const SOCK_STREAM = 1;
|
||||
const SOL_SOCKET = 1;
|
||||
const SOL_TCP = 6;
|
||||
const SOL_UDP = 17;
|
||||
const SOMAXCONN = 128;
|
||||
const SO_BINDTODEVICE = 25;
|
||||
const SO_BPF_EXTENSIONS = 48;
|
||||
const SO_BROADCAST = 6;
|
||||
const SO_DEBUG = 1;
|
||||
const SO_DONTROUTE = 5;
|
||||
const SO_ERROR = 4;
|
||||
const SO_INCOMING_CPU = 49;
|
||||
const SO_KEEPALIVE = 9;
|
||||
const SO_LINGER = 13;
|
||||
const SO_MARK = 36;
|
||||
const SO_MEMINFO = 55;
|
||||
const SO_OOBINLINE = 10;
|
||||
const SO_PASSCRED = 16;
|
||||
const SO_RCVBUF = 8;
|
||||
const SO_RCVLOWAT = 18;
|
||||
const SO_RCVTIMEO = 20;
|
||||
const SO_REUSEADDR = 2;
|
||||
const SO_REUSEPORT = 15;
|
||||
const SO_SNDBUF = 7;
|
||||
const SO_SNDLOWAT = 19;
|
||||
const SO_SNDTIMEO = 21;
|
||||
const SO_TYPE = 3;
|
||||
const SO_ZEROCOPY = 60;
|
||||
const TCP_CONGESTION = 13;
|
||||
const TCP_DEFER_ACCEPT = 9;
|
||||
const TCP_KEEPCNT = 6;
|
||||
const TCP_KEEPIDLE = 4;
|
||||
const TCP_KEEPINTVL = 5;
|
||||
const TCP_NODELAY = 1;
|
||||
const TCP_NOTSENT_LOWAT = 25;
|
||||
}
|
||||
15688
dev/tools/phan/stubs/stripe.php
Normal file
15688
dev/tools/phan/stubs/stripe.php
Normal file
File diff suppressed because one or more lines are too long
1021
dev/tools/phan/stubs/swiss-qr-bill.php
Normal file
1021
dev/tools/phan/stubs/swiss-qr-bill.php
Normal file
File diff suppressed because it is too large
Load Diff
161
dev/tools/phan/stubs/zip.phan_php
Normal file
161
dev/tools/phan/stubs/zip.phan_php
Normal file
|
|
@ -0,0 +1,161 @@
|
|||
<?php
|
||||
// These stubs were generated by the phan stub generator.
|
||||
// @phan-stub-for-extension zip@1.15.6
|
||||
|
||||
namespace {
|
||||
class ZipArchive implements \Countable {
|
||||
|
||||
// constants
|
||||
const CREATE = 1;
|
||||
const EXCL = 2;
|
||||
const CHECKCONS = 4;
|
||||
const OVERWRITE = 8;
|
||||
const RDONLY = 16;
|
||||
const FL_NOCASE = 1;
|
||||
const FL_NODIR = 2;
|
||||
const FL_COMPRESSED = 4;
|
||||
const FL_UNCHANGED = 8;
|
||||
const FL_ENC_GUESS = 0;
|
||||
const FL_ENC_RAW = 64;
|
||||
const FL_ENC_STRICT = 128;
|
||||
const FL_ENC_UTF_8 = 2048;
|
||||
const FL_ENC_CP437 = 4096;
|
||||
const CM_DEFAULT = -1;
|
||||
const CM_STORE = 0;
|
||||
const CM_SHRINK = 1;
|
||||
const CM_REDUCE_1 = 2;
|
||||
const CM_REDUCE_2 = 3;
|
||||
const CM_REDUCE_3 = 4;
|
||||
const CM_REDUCE_4 = 5;
|
||||
const CM_IMPLODE = 6;
|
||||
const CM_DEFLATE = 8;
|
||||
const CM_DEFLATE64 = 9;
|
||||
const CM_PKWARE_IMPLODE = 10;
|
||||
const CM_BZIP2 = 12;
|
||||
const CM_LZMA = 14;
|
||||
const CM_XZ = 95;
|
||||
const CM_TERSE = 18;
|
||||
const CM_LZ77 = 19;
|
||||
const CM_WAVPACK = 97;
|
||||
const CM_PPMD = 98;
|
||||
const ER_OK = 0;
|
||||
const ER_MULTIDISK = 1;
|
||||
const ER_RENAME = 2;
|
||||
const ER_CLOSE = 3;
|
||||
const ER_SEEK = 4;
|
||||
const ER_READ = 5;
|
||||
const ER_WRITE = 6;
|
||||
const ER_CRC = 7;
|
||||
const ER_ZIPCLOSED = 8;
|
||||
const ER_NOENT = 9;
|
||||
const ER_EXISTS = 10;
|
||||
const ER_OPEN = 11;
|
||||
const ER_TMPOPEN = 12;
|
||||
const ER_ZLIB = 13;
|
||||
const ER_MEMORY = 14;
|
||||
const ER_CHANGED = 15;
|
||||
const ER_COMPNOTSUPP = 16;
|
||||
const ER_EOF = 17;
|
||||
const ER_INVAL = 18;
|
||||
const ER_NOZIP = 19;
|
||||
const ER_INTERNAL = 20;
|
||||
const ER_INCONS = 21;
|
||||
const ER_REMOVE = 22;
|
||||
const ER_DELETED = 23;
|
||||
const ER_ENCRNOTSUPP = 24;
|
||||
const ER_RDONLY = 25;
|
||||
const ER_NOPASSWD = 26;
|
||||
const ER_WRONGPASSWD = 27;
|
||||
const ER_OPNOTSUPP = 28;
|
||||
const ER_INUSE = 29;
|
||||
const ER_TELL = 30;
|
||||
const ER_COMPRESSED_DATA = 31;
|
||||
const OPSYS_DOS = 0;
|
||||
const OPSYS_AMIGA = 1;
|
||||
const OPSYS_OPENVMS = 2;
|
||||
const OPSYS_UNIX = 3;
|
||||
const OPSYS_VM_CMS = 4;
|
||||
const OPSYS_ATARI_ST = 5;
|
||||
const OPSYS_OS_2 = 6;
|
||||
const OPSYS_MACINTOSH = 7;
|
||||
const OPSYS_Z_SYSTEM = 8;
|
||||
const OPSYS_Z_CPM = 9;
|
||||
const OPSYS_CPM = 9;
|
||||
const OPSYS_WINDOWS_NTFS = 10;
|
||||
const OPSYS_MVS = 11;
|
||||
const OPSYS_VSE = 12;
|
||||
const OPSYS_ACORN_RISC = 13;
|
||||
const OPSYS_VFAT = 14;
|
||||
const OPSYS_ALTERNATE_MVS = 15;
|
||||
const OPSYS_BEOS = 16;
|
||||
const OPSYS_TANDEM = 17;
|
||||
const OPSYS_OS_400 = 18;
|
||||
const OPSYS_OS_X = 19;
|
||||
const OPSYS_DEFAULT = 3;
|
||||
const EM_NONE = 0;
|
||||
const EM_AES_128 = 257;
|
||||
const EM_AES_192 = 258;
|
||||
const EM_AES_256 = 259;
|
||||
const LIBZIP_VERSION = '1.5.1';
|
||||
|
||||
// properties
|
||||
public $comment;
|
||||
public $filename;
|
||||
public $numFiles;
|
||||
public $status;
|
||||
public $statusSys;
|
||||
|
||||
// methods
|
||||
public function open($filename, $flags = null) {}
|
||||
public function setPassword($password) {}
|
||||
public function close() {}
|
||||
public function count() {}
|
||||
public function getStatusString() {}
|
||||
public function addEmptyDir($dirname) {}
|
||||
public function addFromString($name, $content) {}
|
||||
public function addFile($filepath, $entryname = null, $start = null, $length = null) {}
|
||||
public function addGlob($pattern, $flags = null, $options = null) {}
|
||||
public function addPattern($pattern, $path = null, $options = null) {}
|
||||
public function renameIndex($index, $new_name) {}
|
||||
public function renameName($name, $new_name) {}
|
||||
public function setArchiveComment($comment) {}
|
||||
public function getArchiveComment($flags = null) {}
|
||||
public function setCommentIndex($index, $comment) {}
|
||||
public function setCommentName($name, $comment) {}
|
||||
public function getCommentIndex($index, $flags = null) {}
|
||||
public function getCommentName($name, $flags = null) {}
|
||||
public function deleteIndex($index) {}
|
||||
public function deleteName($name) {}
|
||||
public function statName($filename, $flags = null) {}
|
||||
public function statIndex($index, $flags = null) {}
|
||||
public function locateName($filename, $flags = null) {}
|
||||
public function getNameIndex($index, $flags = null) {}
|
||||
public function unchangeArchive() {}
|
||||
public function unchangeAll() {}
|
||||
public function unchangeIndex($index) {}
|
||||
public function unchangeName($name) {}
|
||||
public function extractTo($pathto, $files = null) {}
|
||||
public function getFromName($entryname, $len = null, $flags = null) {}
|
||||
public function getFromIndex($index, $len = null, $flags = null) {}
|
||||
public function getStream($entryname) {}
|
||||
public function setExternalAttributesName($name, $opsys, $attr, $flags = null) {}
|
||||
public function setExternalAttributesIndex($index, $opsys, $attr, $flags = null) {}
|
||||
public function getExternalAttributesName($name, &$opsys, &$attr, $flags = null) {}
|
||||
public function getExternalAttributesIndex($index, &$opsys, &$attr, $flags = null) {}
|
||||
public function setCompressionName($name, $method, $compflags = null) {}
|
||||
public function setCompressionIndex($index, $method, $compflags = null) {}
|
||||
public function setEncryptionName($name, $method, $password = null) {}
|
||||
public function setEncryptionIndex($index, $method, $password = null) {}
|
||||
}
|
||||
|
||||
function zip_close($zip) {}
|
||||
function zip_entry_close($zip_ent) {}
|
||||
function zip_entry_compressedsize($zip_entry) {}
|
||||
function zip_entry_compressionmethod($zip_entry) {}
|
||||
function zip_entry_filesize($zip_entry) {}
|
||||
function zip_entry_name($zip_entry) {}
|
||||
function zip_entry_open($zip_dp, $zip_entry, $mode = null) {}
|
||||
function zip_entry_read($zip_entry, $len = null) {}
|
||||
function zip_open($filename) {}
|
||||
function zip_read($zip) {}
|
||||
}
|
||||
|
|
@ -39,7 +39,7 @@ return (new PhpCsFixer\Config())
|
|||
|
||||
// Minimum version Dolibarr v18.0.0
|
||||
// Compatibility with min 7.1 is announced with Dolibarr18.0 but
|
||||
// app is still working with 7.0 so no reason to abandon compatiblity with this target for the moment.
|
||||
// app is still working with 7.0 so no reason to abandon compatibility with this target for the moment.
|
||||
// So we use target PHP70 for the moment.
|
||||
'@PHP70Migration' => true,
|
||||
//'@PHP71Migration' => true,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,28 @@
|
|||
<?php
|
||||
/* Copyright (C) 2016-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file dev/tools/rector/rector.php
|
||||
* \ingroup core
|
||||
* \brief Toolt to run rector
|
||||
*
|
||||
* cd dev/tools/rector
|
||||
* ./vendor/bin/rector process [--dry-run] [--clear-cache] ../../../htdocs/core/
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
|
|
@ -56,6 +80,7 @@ return static function (RectorConfig $rectorConfig): void {
|
|||
$rectorConfig->rule(Dolibarr\Rector\Renaming\EmptyUserRightsToFunction::class);
|
||||
$rectorConfig->rule(Dolibarr\Rector\Renaming\GlobalToFunction::class);
|
||||
$rectorConfig->rule(Dolibarr\Rector\Renaming\UserRightsToFunction::class);
|
||||
//$rectorConfig->rule(Dolibarr\Rector\Renaming\UsePositiveExit::class);
|
||||
|
||||
// Add all predefined rules to migrate to up to php 71.
|
||||
// Warning this break tab spacing of arrays on several lines
|
||||
|
|
|
|||
114
dev/tools/rector/src/Renaming/UsePositiveExit.php
Normal file
114
dev/tools/rector/src/Renaming/UsePositiveExit.php
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
<?php
|
||||
/**
|
||||
* This rule to replace exit does not work because "exit" is not a function
|
||||
*/
|
||||
|
||||
namespace Dolibarr\Rector\Renaming;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Arg;
|
||||
use PhpParser\Node\Expr\ArrayDimFetch;
|
||||
use PhpParser\Node\Expr\BinaryOp\BooleanAnd;
|
||||
use PhpParser\Node\Expr\BinaryOp\Concat;
|
||||
use PhpParser\Node\Expr\BinaryOp\Equal;
|
||||
use PhpParser\Node\Expr\BooleanNot;
|
||||
use PhpParser\Node\Expr\Empty_;
|
||||
use PhpParser\Node\Expr\FuncCall;
|
||||
use PhpParser\Node\Expr\Isset_;
|
||||
use PhpParser\Node\Expr\PropertyFetch;
|
||||
use PhpParser\Node\Name;
|
||||
use PhpParser\Node\Scalar\String_;
|
||||
use Rector\Core\NodeManipulator\BinaryOpManipulator;
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
use Rector\Php71\ValueObject\TwoNodeMatch;
|
||||
use Symplify\RuleDocGenerator\Exception\PoorDocumentationException;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
|
||||
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
||||
use Rector\Strict\Rector\BooleanNot\BooleanInBooleanNotRuleFixerRector;
|
||||
|
||||
/**
|
||||
* Class with Rector custom rule to fix code
|
||||
*/
|
||||
class UsePositiveExit extends AbstractRector
|
||||
{
|
||||
/**
|
||||
* @var \Rector\Core\NodeManipulator\BinaryOpManipulator
|
||||
*/
|
||||
private $binaryOpManipulator;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param BinaryOpManipulator $binaryOpManipulator The $binaryOpManipulator
|
||||
*/
|
||||
public function __construct(BinaryOpManipulator $binaryOpManipulator)
|
||||
{
|
||||
$this->binaryOpManipulator = $binaryOpManipulator;
|
||||
}
|
||||
|
||||
/**
|
||||
* getRuleDefinition
|
||||
*
|
||||
* @return RuleDefinition
|
||||
* @throws PoorDocumentationException
|
||||
*/
|
||||
public function getRuleDefinition(): RuleDefinition
|
||||
{
|
||||
return new RuleDefinition(
|
||||
'Change exit(-x) int exit(x)',
|
||||
[new CodeSample(
|
||||
'exit(-2)',
|
||||
'exit(2)'
|
||||
)]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a node type from https://github.com/rectorphp/php-parser-nodes-docs/
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getNodeTypes(): array
|
||||
{
|
||||
return [FuncCall::class];
|
||||
}
|
||||
|
||||
/**
|
||||
* refactor
|
||||
*
|
||||
* @param Node $node A node
|
||||
* @return FuncCall|BooleanNot
|
||||
*/
|
||||
public function refactor(Node $node)
|
||||
{
|
||||
if ($node instanceof FuncCall) {
|
||||
$tmpfunctionname = $this->getName($node);
|
||||
// If function is ok. We must avoid a lot of cases like isset(), empty()
|
||||
if (in_array($tmpfunctionname, array('exit'))) {
|
||||
//print "tmpfunctionname=".$tmpfunctionname."\n";
|
||||
$args = $node->getArgs();
|
||||
$nbofparam = count($args);
|
||||
|
||||
if ($nbofparam >= 1) {
|
||||
$tmpargs = $args;
|
||||
foreach ($args as $key => $arg) { // only 1 element in this array
|
||||
//var_dump($key);
|
||||
//var_dump($arg->value);exit;
|
||||
if (empty($arg->value)) {
|
||||
return;
|
||||
}
|
||||
$a = new FuncCall(new Name('exit'), [new Arg(abs($arg->value))]);
|
||||
//$tmpargs[$key] = new Arg($a);
|
||||
return $a;
|
||||
|
||||
//$r = new FuncCall(new Name($tmpfunctionname), $tmpargs);
|
||||
//return $r;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $node;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
265
dev/translation/duplicate_translation_keys.lst
Normal file
265
dev/translation/duplicate_translation_keys.lst
Normal file
|
|
@ -0,0 +1,265 @@
|
|||
# File with duplicate translation keys that are ignored for
|
||||
# reporting duplicates.
|
||||
# FYI: Headers generated on https://manytools.org/hacker-tools/ascii-banner/ - DOS Rebel or ANSI Shadow
|
||||
# Can also use 'figlet' tool (installable with `apt-get install figlet`)
|
||||
#
|
||||
# ██████████
|
||||
# ░░███░░░░░█
|
||||
# ░███ █ ░ █████ █████ ████████ ██████ ████████ █████ ██████ █████
|
||||
# ░██████ ░░███ ░░███ ░░███░░███ ███░░███░░███░░███ ███░░ ███░░███ ███░░
|
||||
# ░███░░█ ░░░█████░ ░███ ░███░███████ ░███ ░███ ░░█████ ░███████ ░░█████
|
||||
# ░███ ░ █ ███░░░███ ░███ ░███░███░░░ ░███ ░███ ░░░░███░███░░░ ░░░░███
|
||||
# ██████████ █████ █████ ░███████ ░░██████ ████ █████ ██████ ░░██████ ██████
|
||||
# ░░░░░░░░░░ ░░░░░ ░░░░░ ░███░░░ ░░░░░░ ░░░░ ░░░░░ ░░░░░░ ░░░░░░ ░░░░░░
|
||||
# ░███
|
||||
# █████
|
||||
# ░░░░░
|
||||
# Expenses and trips overlap quite a bit, which is by design
|
||||
#
|
||||
AUTHOR
|
||||
AUTHORPAIEMENT
|
||||
AddTrip
|
||||
AllExpenseReport
|
||||
AllExpenseReports
|
||||
AnyOtherInThisListCanValidate
|
||||
AttachTheNewLineToTheDocument
|
||||
AucuneLigne
|
||||
BrouillonnerTrip
|
||||
CANCEL_USER
|
||||
CarCategory
|
||||
ClassifyRefunded
|
||||
CompanyVisited
|
||||
ConfirmBrouillonnerTrip
|
||||
ConfirmCancelTrip
|
||||
ConfirmCloneExpenseReport
|
||||
ConfirmDeleteTrip
|
||||
ConfirmPaidTrip
|
||||
ConfirmRefuseTrip
|
||||
ConfirmSaveTrip
|
||||
ConfirmValideTrip
|
||||
DATE_CANCEL
|
||||
DATE_PAIEMENT
|
||||
DATE_REFUS
|
||||
DATE_SAVE
|
||||
DefaultCategoryCar
|
||||
DefaultRangeNumber
|
||||
DeleteTrip
|
||||
EX_BRE
|
||||
EX_CAM
|
||||
EX_CAM_VP
|
||||
EX_CAR
|
||||
EX_CUR
|
||||
EX_DOC
|
||||
EX_EMM
|
||||
EX_FUE
|
||||
EX_FUE_VP
|
||||
EX_GUM
|
||||
EX_HOT
|
||||
EX_IND
|
||||
EX_KME
|
||||
EX_OTR
|
||||
EX_PAR
|
||||
EX_PAR_VP
|
||||
EX_POS
|
||||
EX_SUM
|
||||
EX_SUO
|
||||
EX_TAX
|
||||
EX_TOL
|
||||
EX_TOL_VP
|
||||
ErrorBadValueForParameter
|
||||
ErrorDoubleDeclaration
|
||||
ErrorRecordNotFound
|
||||
Error_EXPENSEREPORT_ADDON_NotDefined
|
||||
ExpenseRangeOffset
|
||||
ExpenseReportApplyTo
|
||||
ExpenseReportApproved
|
||||
ExpenseReportApprovedMessage
|
||||
ExpenseReportCanceled
|
||||
ExpenseReportCanceledMessage
|
||||
ExpenseReportConstraintViolationError
|
||||
ExpenseReportConstraintViolationWarning
|
||||
ExpenseReportDateEnd
|
||||
ExpenseReportDateStart
|
||||
ExpenseReportDomain
|
||||
ExpenseReportIkDesc
|
||||
ExpenseReportLimitAmount
|
||||
ExpenseReportLimitOn
|
||||
ExpenseReportLine
|
||||
ExpenseReportPaid
|
||||
ExpenseReportPaidMessage
|
||||
ExpenseReportPayment
|
||||
ExpenseReportRef
|
||||
ExpenseReportRefused
|
||||
ExpenseReportRefusedMessage
|
||||
ExpenseReportRestrictive
|
||||
ExpenseReportRuleErrorOnSave
|
||||
ExpenseReportRuleSave
|
||||
ExpenseReportRulesDesc
|
||||
ExpenseReportWaitingForApproval
|
||||
ExpenseReportWaitingForApprovalMessage
|
||||
ExpenseReportWaitingForReApproval
|
||||
ExpenseReportWaitingForReApprovalMessage
|
||||
ExpenseReportsIk
|
||||
ExpenseReportsRules
|
||||
ExpenseReportsToApprove
|
||||
ExpenseReportsToPay
|
||||
ExpensesArea
|
||||
FeesKilometersOrAmout
|
||||
LastExpenseReports
|
||||
ListOfFees
|
||||
ListOfTrips
|
||||
ListToApprove
|
||||
ListTripsAndExpenses
|
||||
MOTIF_CANCEL
|
||||
MOTIF_REFUS
|
||||
ModePaiement
|
||||
NOT_AUTHOR
|
||||
NewTrip
|
||||
NoTripsToExportCSV
|
||||
OnExpense
|
||||
PDFStandardExpenseReports
|
||||
PaidTrip
|
||||
REFUSEUR
|
||||
RangeIk
|
||||
RangeNum
|
||||
SaveTrip
|
||||
ShowExpenseReport
|
||||
ShowTrip
|
||||
TF_BUS
|
||||
TF_CAR
|
||||
TF_ESSENCE
|
||||
TF_HOTEL
|
||||
TF_LUNCH
|
||||
TF_METRO
|
||||
TF_OTHER
|
||||
TF_PEAGE
|
||||
TF_TAXI
|
||||
TF_TRAIN
|
||||
TF_TRIP
|
||||
TripCard
|
||||
TripId
|
||||
TripNDF
|
||||
TripSociete
|
||||
Trips
|
||||
TripsAndExpenses
|
||||
TripsAndExpensesStatistics
|
||||
TypeFees
|
||||
UploadANewFileNow
|
||||
VALIDATOR
|
||||
VALIDOR
|
||||
ValidateAndSubmit
|
||||
ValidatedWaitingApproval
|
||||
ValideTrip
|
||||
byEX_DAY
|
||||
byEX_EXP
|
||||
byEX_MON
|
||||
byEX_YEA
|
||||
expenseReportCatDisabled
|
||||
expenseReportCoef
|
||||
expenseReportCoefUndefined
|
||||
expenseReportOffset
|
||||
expenseReportPrintExample
|
||||
expenseReportRangeDisabled
|
||||
expenseReportRangeFromTo
|
||||
expenseReportRangeMoreThan
|
||||
expenseReportTotalForFive
|
||||
nolimitbyEX_DAY
|
||||
nolimitbyEX_EXP
|
||||
nolimitbyEX_MON
|
||||
nolimitbyEX_YEA
|
||||
#
|
||||
# █████████ █████ ███
|
||||
# ███░░░░░███ ░░███ ░░░
|
||||
# ░███ ░░░ ███████ ████████ ████ ████████ ██████
|
||||
# ░░█████████ ░░░███░ ░░███░░███░░███ ░░███░░███ ███░░███
|
||||
# ░░░░░░░░███ ░███ ░███ ░░░ ░███ ░███ ░███░███████
|
||||
# ███ ░███ ░███ ███ ░███ ░███ ░███ ░███░███░░░
|
||||
# ░░█████████ ░░█████ █████ █████ ░███████ ░░██████
|
||||
# ░░░░░░░░░ ░░░░░ ░░░░░ ░░░░░ ░███░░░ ░░░░░░
|
||||
# ░███
|
||||
# █████
|
||||
# ░░░░░
|
||||
# Stripe is similar to Paybox and has some keys in common
|
||||
#
|
||||
AccountParameter
|
||||
CSSUrlForPaymentForm
|
||||
Continue
|
||||
Creditor
|
||||
FollowingUrlAreAvailableToMakePayments
|
||||
InformationToFindParameters
|
||||
PaymentCode
|
||||
PaymentForm
|
||||
ThisIsInformationOnPayment
|
||||
ThisScreenAllowsYouToPay
|
||||
ToComplete
|
||||
UsageParameter
|
||||
WelcomeOnPaymentPage
|
||||
YourEMail
|
||||
|
||||
|
||||
|
||||
#############################################################
|
||||
#############################################################
|
||||
AccountancyCode
|
||||
AffectedTo
|
||||
AvailableFormats
|
||||
BIC
|
||||
BankTransferAmount
|
||||
Buy
|
||||
ByDefaultInList
|
||||
ByYear
|
||||
CashDesk
|
||||
ChooseFileToImport
|
||||
ConfirmCloneAsk
|
||||
ContractSigned
|
||||
ContractStatusClosed
|
||||
CreateUser
|
||||
CreatedBy
|
||||
Customer
|
||||
CustomerInvoicePayment
|
||||
DatabaseName
|
||||
DatabaseServer
|
||||
DeleteFromCat
|
||||
DeleteType
|
||||
DriverType
|
||||
ExportableDatas
|
||||
ExportsArea
|
||||
History
|
||||
IBAN
|
||||
IdModule
|
||||
InterventionSentByEMail
|
||||
InvoiceRef
|
||||
InvoiceSubtype
|
||||
LanguageFile
|
||||
LineId
|
||||
ListOfStockMovements
|
||||
Location
|
||||
MinimumAmount
|
||||
Movements
|
||||
NewSubscription
|
||||
NewUser
|
||||
NoSupplierOrder
|
||||
NoticePeriod
|
||||
OrderWaiting
|
||||
PriceFormatInCurrentLanguage
|
||||
Prospect
|
||||
Prospect
|
||||
ReOpen
|
||||
ReceptionClassifyClosedInDolibarr
|
||||
Rejects
|
||||
Salaries
|
||||
Sell
|
||||
Server
|
||||
ShowCompany
|
||||
ShowTask
|
||||
ShowTypeCard
|
||||
StatusInterInvoiced
|
||||
StatusToPay
|
||||
Stock
|
||||
Stocks
|
||||
SubscriptionPayment
|
||||
Suppliers
|
||||
Type
|
||||
Unit
|
||||
Upgrade
|
||||
WithdrawalReceipt
|
||||
3687
dev/translation/dynamic_translation_keys.lst
Normal file
3687
dev/translation/dynamic_translation_keys.lst
Normal file
File diff suppressed because it is too large
Load Diff
1183
dev/translation/ignore_translation_keys.lst
Normal file
1183
dev/translation/ignore_translation_keys.lst
Normal file
File diff suppressed because it is too large
Load Diff
212
dev/translation/sanity_check_trans_missing_unused.sh
Executable file
212
dev/translation/sanity_check_trans_missing_unused.sh
Executable file
|
|
@ -0,0 +1,212 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Find unused translations pretty fast...
|
||||
#
|
||||
# Principle:
|
||||
#
|
||||
# 1.Generate two files:
|
||||
# - one for available translations keys,
|
||||
# - one for expected keys.
|
||||
# 2. Make the difference between the files.
|
||||
#
|
||||
# Find expected translation keys:
|
||||
# 1. Find all occurrences that look like `->trans("` or `->trans('`
|
||||
# with fast grep.
|
||||
# 2. Split result to have only one '->trans(' on each line
|
||||
# 3. Filter the text between the single or double quotes.
|
||||
#
|
||||
# Find available translation keys:
|
||||
# 1. Get all strings before '=' token in the language files
|
||||
#
|
||||
# Notes:
|
||||
# - Some side effects from translations on variables.
|
||||
# - Some other minors side effects to be examined (#, %).
|
||||
#
|
||||
# Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
|
||||
LANG_DIR=htdocs/langs/en_US/
|
||||
MYDIR=$(dirname "$(realpath "$0")")
|
||||
TMP=${TMP:=/tmp} # Most of the time defined on the system.
|
||||
EXPECTED_FILE=${TMP}/expected_translations
|
||||
AVAILABLE_FILE_NODEDUP=${TMP}/available_translations_no_dedup
|
||||
AVAILABLE_FILE=${TMP}/available_translations
|
||||
DUPLICATE_KEYS_FILE=${TMP}/duplicate_keys
|
||||
DYNAMIC_KEYS_FILE=${TMP}/dynamic_keys
|
||||
MISSING_AND_UNUSED_FILE=${TMP}/missing_and_unused
|
||||
MISSING_FILE=${TMP}/missing
|
||||
UNUSED_FILE=${TMP}/unused
|
||||
EXPECTED_REGEX='(Country..|Language_.._..|MonthVeryShort\d\d|PaperFormat.*|ProfId\d(..)?|unit.*)'
|
||||
DYNAMIC_KEYS_SRC_FILE=${MYDIR}/dynamic_translation_keys.lst
|
||||
EXCLUDE_KEYS_SRC_FILE=${MYDIR}/ignore_translation_keys.lst
|
||||
DUPLICATE_KEYS_SRC_FILE=${MYDIR}/duplicate_translation_keys.lst
|
||||
|
||||
# Grep options that are reused (normal grep)
|
||||
GREP_OPTS=""
|
||||
GREP_OPTS="${GREP_OPTS} --exclude=htdocs/theme/common/fontawe*/"
|
||||
GREP_OPTS="${GREP_OPTS} --exclude-dir=.cache --exclude-dir=.git"
|
||||
GREP_OPTS="${GREP_OPTS} --exclude=*.phar --exclude=*.webp --exclude=*.z"
|
||||
GREP_OPTS="${GREP_OPTS} --exclude=*.sw? --exclude=*.json"
|
||||
|
||||
# Note: using 'git grep' to restrict to version controlled files
|
||||
# and more flexible globbing.
|
||||
|
||||
# TODO/to ignore:
|
||||
# transnoentities(), transnoentitiesnoconv(),
|
||||
# formSetup->newItem()
|
||||
|
||||
exit_code=0
|
||||
|
||||
# Find all translations keys available in the language files (for the language)
|
||||
grep --no-filename -r -oP -- '^([^#=]+?)(?=\s*=.*)' "${LANG_DIR}" \
|
||||
| grep -x -v -F -f "${EXCLUDE_KEYS_SRC_FILE}" \
|
||||
| sort > "${AVAILABLE_FILE_NODEDUP}"
|
||||
sort -u \
|
||||
< "${AVAILABLE_FILE_NODEDUP}" \
|
||||
> "${AVAILABLE_FILE}"
|
||||
|
||||
|
||||
# Combine strings found in sources with pre-determined dynamic string values.
|
||||
|
||||
## Build some regex strings to match translations
|
||||
#
|
||||
EXTRACT_STR=""
|
||||
JOIN_STR=""
|
||||
for t in '->trans' '->transnoentities' '->transnoentitiesnoconv' 'formSetup->newItem' ; do
|
||||
MATCH_STR="$MATCH_STR$JOIN_STR$t"
|
||||
EXTRACT_STR="$EXTRACT_STR$JOIN_STR(?<=${t}\\([\"'])([^\"']+)(?=[\"']\$)"
|
||||
JOIN_STR="|"
|
||||
done
|
||||
|
||||
{
|
||||
# Find static strings that are translated in the sources (comments stripped)
|
||||
# shellcheck disable=2086
|
||||
# With std grep: `grep --no-filename -r ${GREP_OPTS} -- '->trans(' . `
|
||||
# Using git grep avoiding to look into unversioned files
|
||||
# transnoentitiesnoconv
|
||||
git grep -h -r -P -- "${MATCH_STR}\\(" ':*.php' ':*.html' \
|
||||
| sed 's@\(^#\|[^:]//\|/\*\|^\s*\*\).*@@' \
|
||||
| sed 's@)\|\(['"'"'"]\)\(,\)@\1\n@g' \
|
||||
| grep -aPo "$EXTRACT_STR(?=.$)"
|
||||
|
||||
# "Append" the list of strings that are used in dynamic expressions.
|
||||
# (Fixed list: needs to be updated if the dynamic strings evolve.)
|
||||
cat "${DYNAMIC_KEYS_SRC_FILE}"
|
||||
} \
|
||||
| grep -x -v -F -f "${EXCLUDE_KEYS_SRC_FILE}" \
|
||||
| sort -u \
|
||||
| grep -v -P '^(#|$)' \
|
||||
> "${EXPECTED_FILE}"
|
||||
|
||||
|
||||
# shellcheck disable=2050
|
||||
if [ 0 = 1 ] ; then
|
||||
# Find dynamic keys for call to trans.
|
||||
# shellcheck disable=2086
|
||||
grep --no-filename ${GREP_OPTS} -r -- '->trans(' . \
|
||||
| tr ')' '\n' \
|
||||
| grep -- '->trans(' \
|
||||
| grep -v -P '(?<=->trans\(["'"'"'])([^"'"'"']*)(?=["'"'"'])' \
|
||||
| grep -Po '(?<=->trans\()(.*)' \
|
||||
| sort -u \
|
||||
> "${DYNAMIC_KEYS_FILE}"
|
||||
fi
|
||||
|
||||
|
||||
# Produce reports on STDOUT.
|
||||
# Some output is already compatible with message extraction for github annotation (logToCs.py)
|
||||
# # Produce reports on STDOUT.
|
||||
# Some output is already compatible with message extraction for github annotation (logToCs.py)
|
||||
#
|
||||
diff "${AVAILABLE_FILE}" "${EXPECTED_FILE}" \
|
||||
| grep -E "^[<>]" \
|
||||
| grep -v -P "^< ${EXPECTED_REGEX}$" \
|
||||
| sort \
|
||||
> "${MISSING_AND_UNUSED_FILE}"
|
||||
|
||||
if [ -s "${MISSING_AND_UNUSED_FILE}" ] ; then
|
||||
echo "##[group]List Apparently Unused Translations (<) and Missing Translations (>)"
|
||||
echo
|
||||
echo "## :warning: Unused Translations may match ->trans(\$key.'SomeString')."
|
||||
echo "## You can add such dynamic keys to $(basename "$DYNAMIC_KEYS_SRC_FILE")"
|
||||
echo "## so that they are ignored for this report."
|
||||
echo "## :warning: Unused Translations may be commented in the code"
|
||||
echo "## You can add such 'disabled' keys to $(basename "$EXCLUDE_KEYS_SRC_FILE")"
|
||||
echo "## so that they are ignored for this report."
|
||||
echo
|
||||
cat "${MISSING_AND_UNUSED_FILE}"
|
||||
echo "##[endgroup]"
|
||||
echo
|
||||
fi
|
||||
|
||||
sed -n 's@< \(.*\)@^\1\\s*=@p' \
|
||||
< "${MISSING_AND_UNUSED_FILE}" \
|
||||
> "${UNUSED_FILE}.grep"
|
||||
|
||||
# Too many results, git grep is slow
|
||||
#sed -n 's@> \(.*\)@trans.["'"'"']\1["'"'"'].@p' \
|
||||
# < "${MISSING_AND_UNUSED_FILE}" \
|
||||
# > "${MISSING_FILE}.grep"
|
||||
#
|
||||
|
||||
# Prepare file with exact matches for use with `git grep`, supposing " quotes
|
||||
#
|
||||
REPL_STR=""
|
||||
for t in trans transnoentities transnoentitiesnoconv ; do
|
||||
REPL_STR="${REPL_STR}\n->${t}(\"\\1\","
|
||||
REPL_STR="${REPL_STR}\n->${t}('\\1',"
|
||||
REPL_STR="${REPL_STR}\n->${t}(\"\\1\")"
|
||||
REPL_STR="${REPL_STR}\n->${t}('\\1')"
|
||||
done
|
||||
|
||||
sed -n 's@> \(.*\)'"@${REPL_STR}@p" \
|
||||
< "${MISSING_AND_UNUSED_FILE}" \
|
||||
| grep -v -E '^$' \
|
||||
> "${MISSING_FILE}.grep"
|
||||
|
||||
|
||||
|
||||
if [ -s "${UNUSED_FILE}.grep" ] ; then
|
||||
exit_code=1
|
||||
|
||||
# Report unused translation in recognizable format
|
||||
git grep -n --column -r -f "${UNUSED_FILE}.grep" -- "${LANG_DIR}"'/*.lang' \
|
||||
| sort -t: -k 4 \
|
||||
| sed 's@^\([^:]*:[^:]*:[^:]*:\)\s*@\1 Not used, translated; @'
|
||||
fi
|
||||
|
||||
if [ -s "${MISSING_FILE}.grep" ] ; then
|
||||
exit_code=1
|
||||
|
||||
# Report missing translation in recognizable format
|
||||
git grep -n --column -r -F -f "${MISSING_FILE}.grep" -- ':*.php' ':*.html' \
|
||||
| sort -t: -k 4 \
|
||||
| sed 's@^\([^:]*:[^:]*:[^:]*:\)\s*@\1 Missing translation; @'
|
||||
fi
|
||||
|
||||
|
||||
diff "${AVAILABLE_FILE_NODEDUP}" "${AVAILABLE_FILE}" \
|
||||
| grep -Po '(?<=^\< )(.*)$' \
|
||||
| grep -x -v -F -f "${DUPLICATE_KEYS_SRC_FILE}" \
|
||||
| sed 's/.*/^\0=/' \
|
||||
> "${DUPLICATE_KEYS_FILE}"
|
||||
|
||||
if [ -s "${DUPLICATE_KEYS_FILE}" ] ; then
|
||||
exit_code=1
|
||||
echo
|
||||
echo "##[group]List Duplicate Keys"
|
||||
echo "## :warning:"
|
||||
echo "## Duplicate keys may be expected across language files."
|
||||
echo "## You may want to avoid them or they could be a copy/paste mistake."
|
||||
echo "## You can add add valid duplicates to $(basename "$DUPLICATE_KEYS_SRC_FILE")"
|
||||
echo "## so that they are ignored for this report."
|
||||
cat "${DUPLICATE_KEYS_FILE}"
|
||||
echo "##[endgroup]"
|
||||
echo
|
||||
|
||||
git grep -n -r -f "${DUPLICATE_KEYS_FILE}" -- "${LANG_DIR}"'/*.lang' \
|
||||
| sort -t: -k 3 \
|
||||
| sed 's@^\([^:]*:[^:]*:\)\s*@\1 Is/Has duplicate @'
|
||||
fi
|
||||
|
||||
|
||||
exit $exit_code
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
/* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2024 Alexandre Spangaro <aspangaro@easya.solutions>
|
||||
* Copyright (C) 2016-2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -35,8 +36,8 @@ $langs->loadLangs(array('accountancy', 'admin', 'bills', 'compta', 'salaries'));
|
|||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$cancel = GETPOST('cancel', 'alpha');
|
||||
$id = GETPOST('id', 'int');
|
||||
$rowid = GETPOST('rowid', 'int');
|
||||
$id = GETPOSTINT('id');
|
||||
$rowid = GETPOSTINT('rowid');
|
||||
$massaction = GETPOST('massaction', 'aZ09');
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'accountingaccountlist'; // To manage different context of search
|
||||
|
|
@ -49,10 +50,10 @@ $search_accountparent = GETPOST('search_accountparent', 'alpha');
|
|||
$search_pcgtype = GETPOST('search_pcgtype', 'alpha');
|
||||
$search_import_key = GETPOST('search_import_key', 'alpha');
|
||||
$toselect = GETPOST('toselect', 'array');
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
|
||||
$chartofaccounts = GETPOST('chartofaccounts', 'int');
|
||||
$chartofaccounts = GETPOSTINT('chartofaccounts');
|
||||
|
||||
$permissiontoadd = $user->hasRight('accounting', 'chartofaccount');
|
||||
$permissiontodelete = $user->hasRight('accounting', 'chartofaccount');
|
||||
|
|
@ -66,10 +67,10 @@ if (!$user->hasRight('accounting', 'chartofaccount')) {
|
|||
}
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
|
||||
if (empty($page) || $page == -1) {
|
||||
$page = 0;
|
||||
} // If $page is not defined, or '' or -1
|
||||
|
|
@ -84,15 +85,15 @@ if (!$sortorder) {
|
|||
}
|
||||
|
||||
$arrayfields = array(
|
||||
'aa.account_number'=>array('label'=>"AccountNumber", 'checked'=>1),
|
||||
'aa.label'=>array('label'=>"Label", 'checked'=>1),
|
||||
'aa.labelshort'=>array('label'=>"LabelToShow", 'checked'=>1),
|
||||
'aa.account_parent'=>array('label'=>"Accountparent", 'checked'=>1),
|
||||
'aa.pcg_type'=>array('label'=>"Pcgtype", 'checked'=>1, 'help'=>'PcgtypeDesc'),
|
||||
'categories'=>array('label'=>"AccountingCategories", 'checked'=>-1, 'help'=>'AccountingCategoriesDesc'),
|
||||
'aa.reconcilable'=>array('label'=>"Reconcilable", 'checked'=>1),
|
||||
'aa.import_key'=>array('label'=>"ImportId", 'checked'=>-1, 'help'=>''),
|
||||
'aa.active'=>array('label'=>"Activated", 'checked'=>1)
|
||||
'aa.account_number' => array('label' => "AccountNumber", 'checked' => 1),
|
||||
'aa.label' => array('label' => "Label", 'checked' => 1),
|
||||
'aa.labelshort' => array('label' => "LabelToShow", 'checked' => 1),
|
||||
'aa.account_parent' => array('label' => "Accountparent", 'checked' => 1),
|
||||
'aa.pcg_type' => array('label' => "Pcgtype", 'checked' => 1, 'help' => 'PcgtypeDesc'),
|
||||
'categories' => array('label' => "AccountingCategories", 'checked' => -1, 'help' => 'AccountingCategoriesDesc'),
|
||||
'aa.reconcilable' => array('label' => "Reconcilable", 'checked' => 1),
|
||||
'aa.import_key' => array('label' => "ImportId", 'checked' => -1, 'help' => ''),
|
||||
'aa.active' => array('label' => "Activated", 'checked' => 1)
|
||||
);
|
||||
|
||||
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
|
||||
|
|
@ -147,11 +148,12 @@ if (empty($reshook)) {
|
|||
$search_import_key = "";
|
||||
$search_array_options = array();
|
||||
}
|
||||
if ((GETPOST('valid_change_chart', 'alpha') && GETPOST('chartofaccounts', 'int') > 0) // explicit click on button 'Change and load' with js on
|
||||
|| (GETPOST('chartofaccounts', 'int') > 0 && GETPOST('chartofaccounts', 'int') != getDolGlobalInt('CHARTOFACCOUNTS'))) { // a submit of form is done and chartofaccounts combo has been modified
|
||||
if ((GETPOSTINT('valid_change_chart') && GETPOSTINT('chartofaccounts') > 0) // explicit click on button 'Change and load' with js on
|
||||
|| (GETPOSTINT('chartofaccounts') > 0 && GETPOSTINT('chartofaccounts') != getDolGlobalInt('CHARTOFACCOUNTS'))) { // a submit of form is done and chartofaccounts combo has been modified
|
||||
$error = 0;
|
||||
|
||||
if ($chartofaccounts > 0 && $permissiontoadd) {
|
||||
$country_code = '';
|
||||
// Get language code for this $chartofaccounts
|
||||
$sql = 'SELECT code FROM '.MAIN_DB_PREFIX.'c_country as c, '.MAIN_DB_PREFIX.'accounting_system as a';
|
||||
$sql .= ' WHERE c.rowid = a.fk_country AND a.rowid = '.(int) $chartofaccounts;
|
||||
|
|
@ -199,23 +201,23 @@ if (empty($reshook)) {
|
|||
|
||||
if ($action == 'disable' && $permissiontoadd) {
|
||||
if ($accounting->fetch($id)) {
|
||||
$mode = GETPOST('mode', 'int');
|
||||
$mode = GETPOSTINT('mode');
|
||||
$result = $accounting->accountDeactivate($id, $mode);
|
||||
if ($result < 0) {
|
||||
setEventMessages($accounting->error, $accounting->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
$action = 'update';
|
||||
if ($result < 0) {
|
||||
setEventMessages($accounting->error, $accounting->errors, 'errors');
|
||||
}
|
||||
} elseif ($action == 'enable' && $permissiontoadd) {
|
||||
if ($accounting->fetch($id)) {
|
||||
$mode = GETPOST('mode', 'int');
|
||||
$mode = GETPOSTINT('mode');
|
||||
$result = $accounting->accountActivate($id, $mode);
|
||||
if ($result < 0) {
|
||||
setEventMessages($accounting->error, $accounting->errors, 'errors');
|
||||
}
|
||||
}
|
||||
$action = 'update';
|
||||
if ($result < 0) {
|
||||
setEventMessages($accounting->error, $accounting->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -385,6 +387,7 @@ if ($resql) {
|
|||
}
|
||||
|
||||
// List of mass actions available
|
||||
$arrayofmassactions = array();
|
||||
if ($user->hasRight('accounting', 'chartofaccount')) {
|
||||
$arrayofmassactions['predelete'] = '<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
|
||||
}
|
||||
|
|
@ -409,6 +412,7 @@ if ($resql) {
|
|||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
|
||||
print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'accounting_account', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
|
||||
|
|
@ -452,7 +456,7 @@ if ($resql) {
|
|||
print '<br>';
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields
|
||||
$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields
|
||||
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
|
||||
|
||||
$moreforfilter = '';
|
||||
|
|
@ -505,7 +509,7 @@ if ($resql) {
|
|||
}
|
||||
|
||||
// Fields from hook
|
||||
$parameters = array('arrayfields'=>$arrayfields);
|
||||
$parameters = array('arrayfields' => $arrayfields);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
|
|
@ -567,7 +571,7 @@ if ($resql) {
|
|||
}
|
||||
|
||||
// Hook fields
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
|
||||
$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
|
|
@ -708,7 +712,7 @@ if ($resql) {
|
|||
}
|
||||
|
||||
// Fields from hook
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
|
||||
$parameters = array('arrayfields' => $arrayfields, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
|
|
@ -802,7 +806,7 @@ if ($resql) {
|
|||
|
||||
$db->free($resql);
|
||||
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
||||
$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
|
|
|
|||
|
|
@ -53,18 +53,20 @@ $id = 31;
|
|||
$rowid = GETPOST('rowid', 'alpha');
|
||||
$code = GETPOST('code', 'alpha');
|
||||
|
||||
$acts = array();
|
||||
$actl = array();
|
||||
$acts[0] = "activate";
|
||||
$acts[1] = "disable";
|
||||
$actl[0] = img_picto($langs->trans("Disabled"), 'switch_off', 'class="size15x"');
|
||||
$actl[1] = img_picto($langs->trans("Activated"), 'switch_on', 'class="size15x"');
|
||||
|
||||
$listoffset = GETPOST('listoffset', 'alpha');
|
||||
$listlimit = GETPOST('listlimit', 'int') > 0 ? GETPOST('listlimit', 'int') : 1000;
|
||||
$listlimit = GETPOSTINT('listlimit') > 0 ? GETPOSTINT('listlimit') : 1000;
|
||||
$active = 1;
|
||||
|
||||
$sortfield = GETPOST("sortfield", 'aZ09comma');
|
||||
$sortorder = GETPOST("sortorder", 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
|
||||
if (empty($page) || $page == -1) {
|
||||
$page = 0;
|
||||
} // If $page is not defined, or '' or -1
|
||||
|
|
@ -72,7 +74,7 @@ $offset = $listlimit * $page;
|
|||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
$search_country_id = GETPOST('search_country_id', 'int');
|
||||
$search_country_id = GETPOSTINT('search_country_id');
|
||||
|
||||
|
||||
// Security check
|
||||
|
|
@ -127,7 +129,7 @@ $tabrowid[31] = "";
|
|||
|
||||
// List of help for fields
|
||||
$tabhelp = array();
|
||||
$tabhelp[31] = array('pcg_version'=>$langs->trans("EnterAnyCode"));
|
||||
$tabhelp[31] = array('pcg_version' => $langs->trans("EnterAnyCode"));
|
||||
|
||||
|
||||
// Define elementList and sourceList (used for dictionary type of contacts "llx_c_type_contact")
|
||||
|
|
@ -189,10 +191,10 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
|
|||
|
||||
// Si verif ok et action add, on ajoute la ligne
|
||||
if ($ok && GETPOST('actionadd', 'alpha')) {
|
||||
$newid = 0;
|
||||
if ($tabrowid[$id]) {
|
||||
// Get free id for insert
|
||||
$newid = 0;
|
||||
$sql = "SELECT MAX(".$tabrowid[$id].") newid from ".$tabname[$id];
|
||||
$sql = "SELECT MAX(".$db->sanitize($tabrowid[$id]).") as newid FROM ".$db->sanitize($tabname[$id]);
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
$obj = $db->fetch_object($result);
|
||||
|
|
@ -203,12 +205,12 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
|
|||
}
|
||||
|
||||
// Add new entry
|
||||
$sql = "INSERT INTO ".$tabname[$id]." (";
|
||||
$sql = "INSERT INTO ".$db->sanitize($tabname[$id])." (";
|
||||
// List of fields
|
||||
if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldinsert)) {
|
||||
$sql .= $tabrowid[$id].",";
|
||||
$sql .= $db->sanitize($tabrowid[$id]).",";
|
||||
}
|
||||
$sql .= $tabfieldinsert[$id];
|
||||
$sql .= $db->sanitize($tabfieldinsert[$id]);
|
||||
$sql .= ",active)";
|
||||
$sql .= " VALUES(";
|
||||
|
||||
|
|
@ -239,7 +241,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
|
|||
$result = $db->query($sql);
|
||||
if ($result) { // Add is ok
|
||||
setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs');
|
||||
$_POST = array('id'=>$id); // Clean $_POST array, we keep only
|
||||
$_POST = array('id' => $id); // Clean $_POST array, we keep only
|
||||
} else {
|
||||
if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
|
||||
setEventMessages($langs->transnoentities("ErrorRecordAlreadyExists"), null, 'errors');
|
||||
|
|
@ -258,10 +260,10 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
|
|||
}
|
||||
|
||||
// Modify entry
|
||||
$sql = "UPDATE ".$tabname[$id]." SET ";
|
||||
$sql = "UPDATE ".$db->sanitize($tabname[$id])." SET ";
|
||||
// Modifie valeur des champs
|
||||
if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldmodify)) {
|
||||
$sql .= $tabrowid[$id]."=";
|
||||
$sql .= $db->sanitize($tabrowid[$id])." = ";
|
||||
$sql .= "'".$db->escape($rowid)."', ";
|
||||
}
|
||||
$i = 0;
|
||||
|
|
@ -300,7 +302,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') { // delete
|
|||
$rowidcol = "rowid";
|
||||
}
|
||||
|
||||
$sql = "DELETE from ".$tabname[$id]." WHERE ".$rowidcol." = ".((int) $rowid);
|
||||
$sql = "DELETE from ".$db->sanitize($tabname[$id])." WHERE ".$db->sanitize($rowidcol)." = ".((int) $rowid);
|
||||
|
||||
dol_syslog("delete", LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
|
|
@ -314,19 +316,8 @@ if ($action == 'confirm_delete' && $confirm == 'yes') { // delete
|
|||
}
|
||||
|
||||
// activate
|
||||
if ($action == $acts[0]) {
|
||||
if ($tabrowid[$id]) {
|
||||
$rowidcol = $tabrowid[$id];
|
||||
} else {
|
||||
$rowidcol = "rowid";
|
||||
}
|
||||
|
||||
if ($rowid) {
|
||||
$sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE ".$rowidcol." = ".((int) $rowid);
|
||||
} elseif ($code) {
|
||||
$sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE code='".$db->escape($code)."'";
|
||||
}
|
||||
|
||||
if ($action == 'activate') {
|
||||
$sql = "UPDATE ".$db->sanitize($tabname[$id])." SET active = 1 WHERE rowid = ".((int) $rowid);
|
||||
$result = $db->query($sql);
|
||||
if (!$result) {
|
||||
dol_print_error($db);
|
||||
|
|
@ -335,58 +326,7 @@ if ($action == $acts[0]) {
|
|||
|
||||
// disable
|
||||
if ($action == $acts[1]) {
|
||||
if ($tabrowid[$id]) {
|
||||
$rowidcol = $tabrowid[$id];
|
||||
} else {
|
||||
$rowidcol = "rowid";
|
||||
}
|
||||
|
||||
if ($rowid) {
|
||||
$sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE ".$rowidcol." = ".((int) $rowid);
|
||||
} elseif ($code) {
|
||||
$sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE code='".$db->escape($code)."'";
|
||||
}
|
||||
|
||||
$result = $db->query($sql);
|
||||
if (!$result) {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
// favorite
|
||||
if ($action == 'activate_favorite') {
|
||||
if ($tabrowid[$id]) {
|
||||
$rowidcol = $tabrowid[$id];
|
||||
} else {
|
||||
$rowidcol = "rowid";
|
||||
}
|
||||
|
||||
if ($rowid) {
|
||||
$sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE ".$rowidcol." = ".((int) $rowid);
|
||||
} elseif ($code) {
|
||||
$sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE code='".$db->escape($code)."'";
|
||||
}
|
||||
|
||||
$result = $db->query($sql);
|
||||
if (!$result) {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
// disable favorite
|
||||
if ($action == 'disable_favorite') {
|
||||
if ($tabrowid[$id]) {
|
||||
$rowidcol = $tabrowid[$id];
|
||||
} else {
|
||||
$rowidcol = "rowid";
|
||||
}
|
||||
|
||||
if ($rowid) {
|
||||
$sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE ".$rowidcol." = ".((int) $rowid);
|
||||
} elseif ($code) {
|
||||
$sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE code='".$db->escape($code)."'";
|
||||
}
|
||||
|
||||
$sql = "UPDATE ".$db->sanitize($tabname[$id])." SET active = 0 WHERE rowid = ".((int) $rowid);
|
||||
$result = $db->query($sql);
|
||||
if (!$result) {
|
||||
dol_print_error($db);
|
||||
|
|
@ -413,7 +353,7 @@ print load_fiche_titre($titre, $linkback, 'title_accountancy');
|
|||
|
||||
// Confirmation de la suppression de la ligne
|
||||
if ($action == 'delete') {
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page ? 'page='.urlencode($page).'&' : '').'sortfield='.urlencode($sortfield).'&sortorder='.urlencode($sortorder).'&rowid='.urlencode($rowid).'&code='.urlencode($code).'&id='.urlencode($id), $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1);
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page ? 'page='.urlencode((string) ($page)).'&' : '').'sortfield='.urlencode((string) ($sortfield)).'&sortorder='.urlencode((string) ($sortorder)).'&rowid='.urlencode((string) ($rowid)).'&code='.urlencode((string) ($code)).'&id='.urlencode((string) ($id)), $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1);
|
||||
}
|
||||
//var_dump($elementList);
|
||||
|
||||
|
|
@ -518,7 +458,7 @@ if ($id) {
|
|||
}
|
||||
|
||||
$tmpaction = 'create';
|
||||
$parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
||||
$parameters = array('fieldlist' => $fieldlist, 'tabname' => $tabname[$id]);
|
||||
$reshook = $hookmanager->executeHooks('createDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||
$error = $hookmanager->error;
|
||||
$errors = $hookmanager->errors;
|
||||
|
|
@ -546,9 +486,9 @@ if ($id) {
|
|||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
$param = '&id='.urlencode($id);
|
||||
$param = '&id='.urlencode((string) ($id));
|
||||
if ($search_country_id > 0) {
|
||||
$param .= '&search_country_id='.urlencode($search_country_id);
|
||||
$param .= '&search_country_id='.urlencode((string) ($search_country_id));
|
||||
}
|
||||
$paramwithsearch = $param;
|
||||
if ($sortorder) {
|
||||
|
|
@ -616,7 +556,7 @@ if ($id) {
|
|||
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
|
||||
|
||||
$tmpaction = 'edit';
|
||||
$parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
||||
$parameters = array('fieldlist' => $fieldlist, 'tabname' => $tabname[$id]);
|
||||
$reshook = $hookmanager->executeHooks('editDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||
$error = $hookmanager->error;
|
||||
$errors = $hookmanager->errors;
|
||||
|
|
@ -631,7 +571,7 @@ if ($id) {
|
|||
print '</td>';
|
||||
} else {
|
||||
$tmpaction = 'view';
|
||||
$parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
||||
$parameters = array('fieldlist' => $fieldlist, 'tabname' => $tabname[$id]);
|
||||
$reshook = $hookmanager->executeHooks('viewDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
$error = $hookmanager->error;
|
||||
|
|
@ -778,7 +718,7 @@ function fieldListAccountModel($fieldlist, $obj = null, $tabname = '', $context
|
|||
print '<td>';
|
||||
}
|
||||
if ($fieldlist[$field] == 'type_cdr') {
|
||||
print $form->selectarray($fieldlist[$field], array(0=>$langs->trans('None'), 1=>$langs->trans('AtEndOfMonth'), 2=>$langs->trans('CurrentNext')), (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]} : ''));
|
||||
print $form->selectarray($fieldlist[$field], array(0 => $langs->trans('None'), 1 => $langs->trans('AtEndOfMonth'), 2 => $langs->trans('CurrentNext')), (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]} : ''));
|
||||
} else {
|
||||
print $form->selectyesno($fieldlist[$field], (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]} : ''), 1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2024 Alexandre Spangaro <aspangaro@easya.solutions>
|
||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -37,9 +38,9 @@ $langs->loadLangs(array('accountancy', 'bills', 'compta'));
|
|||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$backtopage = GETPOST('backtopage', 'alpha');
|
||||
$id = GETPOST('id', 'int');
|
||||
$id = GETPOSTINT('id');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
$rowid = GETPOST('rowid', 'int');
|
||||
$rowid = GETPOSTINT('rowid');
|
||||
$cancel = GETPOST('cancel', 'alpha');
|
||||
|
||||
$account_number = GETPOST('account_number', 'alphanohtml');
|
||||
|
|
@ -85,17 +86,11 @@ if ($action == 'add' && $user->hasRight('accounting', 'chartofaccount')) {
|
|||
// Clean code
|
||||
|
||||
// To manage zero or not at the end of the accounting account
|
||||
if (getDolGlobalString('ACCOUNTING_MANAGE_ZERO')) {
|
||||
$account_number = $account_number;
|
||||
} else {
|
||||
if (!getDolGlobalString('ACCOUNTING_MANAGE_ZERO')) {
|
||||
$account_number = clean_account($account_number);
|
||||
}
|
||||
|
||||
if (GETPOSTINT('account_parent') <= 0) {
|
||||
$account_parent = 0;
|
||||
} else {
|
||||
$account_parent = GETPOSTINT('account_parent');
|
||||
}
|
||||
$account_parent = (GETPOSTINT('account_parent') > 0) ? GETPOSTINT('account_parent') : 0;
|
||||
|
||||
$object->fk_pcg_version = $obj->pcg_version;
|
||||
$object->pcg_type = GETPOST('pcg_type', 'alpha');
|
||||
|
|
@ -148,17 +143,11 @@ if ($action == 'add' && $user->hasRight('accounting', 'chartofaccount')) {
|
|||
// Clean code
|
||||
|
||||
// To manage zero or not at the end of the accounting account
|
||||
if (getDolGlobalString('ACCOUNTING_MANAGE_ZERO')) {
|
||||
$account_number = $account_number;
|
||||
} else {
|
||||
if (!getDolGlobalString('ACCOUNTING_MANAGE_ZERO')) {
|
||||
$account_number = clean_account($account_number);
|
||||
}
|
||||
|
||||
if (GETPOSTINT('account_parent') <= 0) {
|
||||
$account_parent = 0;
|
||||
} else {
|
||||
$account_parent = GETPOSTINT('account_parent');
|
||||
}
|
||||
$account_parent = (GETPOSTINT('account_parent') > 0) ? GETPOSTINT('account_parent') : 0;
|
||||
|
||||
$object->fk_pcg_version = $obj->pcg_version;
|
||||
$object->pcg_type = GETPOST('pcg_type', 'alpha');
|
||||
|
|
@ -253,7 +242,7 @@ if ($action == 'create') {
|
|||
// Account parent
|
||||
print '<tr><td>'.$langs->trans("Accountparent").'</td>';
|
||||
print '<td>';
|
||||
print $formaccounting->select_account($object->account_parent, 'account_parent', 1, null, 0, 0, 'minwidth200');
|
||||
print $formaccounting->select_account($object->account_parent, 'account_parent', 1, [], 0, 0, 'minwidth200');
|
||||
print '</td></tr>';
|
||||
|
||||
// Chart of accounts type
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
/* Copyright (C) 2016 Jamal Elbaz <jamelbaz@gmail.pro>
|
||||
* Copyright (C) 2017-2024 Alexandre Spangaro <aspangaro@easya.solutions>
|
||||
* Copyright (C) 2022 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -34,22 +35,22 @@ $error = 0;
|
|||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("bills", "accountancy", "compta"));
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
$id = GETPOSTINT('id');
|
||||
$cancel = GETPOST('cancel', 'alpha');
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$cat_id = GETPOST('account_category', 'int');
|
||||
$cat_id = GETPOSTINT('account_category');
|
||||
$selectcpt = GETPOST('cpt_bk', 'array');
|
||||
$cpt_id = GETPOST('cptid', 'int');
|
||||
$cpt_id = GETPOSTINT('cptid');
|
||||
|
||||
if ($cat_id == 0) {
|
||||
$cat_id = null;
|
||||
}
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
|
||||
if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
|
||||
// If $page is not defined, or '' or -1 or if we click on clear filters
|
||||
$page = 0;
|
||||
|
|
@ -164,7 +165,7 @@ if (!empty($cat_id)) {
|
|||
|
||||
if (is_array($accountingcategory->lines_cptbk) && count($accountingcategory->lines_cptbk) > 0) {
|
||||
print img_picto($langs->trans("AccountingAccount"), 'accounting_account', 'class="pictofixedwith"');
|
||||
print $form->multiselectarray('cpt_bk', $arraykeyvalue, GETPOST('cpt_bk', 'array'), null, null, '', 0, "80%", '', '', $langs->transnoentitiesnoconv("AddAccountFromBookKeepingWithNoCategories"));
|
||||
print $form->multiselectarray('cpt_bk', $arraykeyvalue, GETPOST('cpt_bk', 'array'), 0, 0, '', 0, "80%", '', '', $langs->transnoentitiesnoconv("AddAccountFromBookKeepingWithNoCategories"));
|
||||
print '<input type="submit" class="button button-add small" id="" class="action-delete" value="'.$langs->trans("Add").'"> ';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2004-2023 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011-2024 Alexandre Spangaro <aspangaro@easya.solutions>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -47,17 +48,19 @@ if (!$user->hasRight('accounting', 'chartofaccount')) {
|
|||
accessforbidden();
|
||||
}
|
||||
|
||||
$acts = array();
|
||||
$acts[0] = "activate";
|
||||
$acts[1] = "disable";
|
||||
$actl = array();
|
||||
$actl[0] = img_picto($langs->trans("Disabled"), 'switch_off', 'class="size15x"');
|
||||
$actl[1] = img_picto($langs->trans("Activated"), 'switch_on', 'class="size15x"');
|
||||
|
||||
$listoffset = GETPOST('listoffset', 'alpha');
|
||||
$listlimit = GETPOST('listlimit', 'int') > 0 ? GETPOST('listlimit', 'int') : 1000;
|
||||
$listlimit = GETPOSTINT('listlimit') > 0 ? GETPOSTINT('listlimit') : 1000;
|
||||
|
||||
$sortfield = GETPOST("sortfield", 'aZ09comma');
|
||||
$sortorder = GETPOST("sortorder", 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
|
||||
if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
|
||||
// If $page is not defined, or '' or -1 or if we click on clear filters
|
||||
$page = 0;
|
||||
|
|
@ -66,7 +69,7 @@ $offset = $listlimit * $page;
|
|||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
$search_country_id = GETPOST('search_country_id', 'int');
|
||||
$search_country_id = GETPOSTINT('search_country_id');
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('admin'));
|
||||
|
|
@ -117,7 +120,7 @@ $tabcond[32] = isModEnabled('accounting');
|
|||
|
||||
// List of help for fields
|
||||
$tabhelp = array();
|
||||
$tabhelp[32] = array('code'=>$langs->trans("EnterAnyCode"), 'category_type'=>$langs->trans("SetToYesIfGroupIsComputationOfOtherGroups"), 'formula'=>$langs->trans("EnterCalculationRuleIfPreviousFieldIsYes"));
|
||||
$tabhelp[32] = array('code' => $langs->trans("EnterAnyCode"), 'category_type' => $langs->trans("SetToYesIfGroupIsComputationOfOtherGroups"), 'formula' => $langs->trans("EnterCalculationRuleIfPreviousFieldIsYes"));
|
||||
|
||||
// List of check for fields (NOT USED YET)
|
||||
$tabfieldcheck = array();
|
||||
|
|
@ -199,10 +202,11 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
|
|||
|
||||
// Si verif ok et action add, on ajoute la ligne
|
||||
if ($ok && GETPOST('actionadd', 'alpha')) {
|
||||
$newid = 0;
|
||||
|
||||
if ($tabrowid[$id]) {
|
||||
// Get free id for insert
|
||||
$newid = 0;
|
||||
$sql = "SELECT MAX(".$tabrowid[$id].") newid from ".$tabname[$id];
|
||||
$sql = "SELECT MAX(".$db->sanitize($tabrowid[$id]).") newid FROM ".$db->sanitize($tabname[$id]);
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
$obj = $db->fetch_object($result);
|
||||
|
|
@ -213,12 +217,12 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
|
|||
}
|
||||
|
||||
// Add new entry
|
||||
$sql = "INSERT INTO ".$tabname[$id]." (";
|
||||
$sql = "INSERT INTO ".$db->sanitize($tabname[$id])." (";
|
||||
// List of fields
|
||||
if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldinsert)) {
|
||||
$sql .= $tabrowid[$id].",";
|
||||
$sql .= $db->sanitize($tabrowid[$id]).",";
|
||||
}
|
||||
$sql .= $tabfieldinsert[$id];
|
||||
$sql .= $db->sanitize($tabfieldinsert[$id]);
|
||||
$sql .= ",active)";
|
||||
$sql .= " VALUES(";
|
||||
|
||||
|
|
@ -247,7 +251,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
|
|||
$result = $db->query($sql);
|
||||
if ($result) { // Add is ok
|
||||
setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs');
|
||||
$_POST = array('id'=>$id); // Clean $_POST array, we keep only
|
||||
$_POST = array('id' => $id); // Clean $_POST array, we keep only
|
||||
} else {
|
||||
if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
|
||||
setEventMessages($langs->transnoentities("ErrorRecordAlreadyExists"), null, 'errors');
|
||||
|
|
@ -266,10 +270,10 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
|
|||
}
|
||||
|
||||
// Modify entry
|
||||
$sql = "UPDATE ".$tabname[$id]." SET ";
|
||||
$sql = "UPDATE ".$db->sanitize($tabname[$id])." SET ";
|
||||
// Modifie valeur des champs
|
||||
if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldmodify)) {
|
||||
$sql .= $tabrowid[$id]."=";
|
||||
$sql .= $db->sanitize($tabrowid[$id])." = ";
|
||||
$sql .= "'".$db->escape($rowid)."', ";
|
||||
}
|
||||
$i = 0;
|
||||
|
|
@ -302,18 +306,14 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
|
|||
//$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
|
||||
}
|
||||
|
||||
if (GETPOST('actioncancel', 'alpha')) {
|
||||
//$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
|
||||
}
|
||||
// if (GETPOST('actioncancel', 'alpha')) {
|
||||
// $_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
|
||||
// }
|
||||
|
||||
if ($action == 'confirm_delete' && $confirm == 'yes') { // delete
|
||||
if ($tabrowid[$id]) {
|
||||
$rowidcol = $tabrowid[$id];
|
||||
} else {
|
||||
$rowidcol = "rowid";
|
||||
}
|
||||
$rowidcol = "rowid";
|
||||
|
||||
$sql = "DELETE from ".$tabname[$id]." WHERE ".$rowidcol." = ".((int) $rowid);
|
||||
$sql = "DELETE from ".$db->sanitize($tabname[$id])." WHERE ".$db->sanitize($rowidcol)." = ".((int) $rowid);
|
||||
|
||||
dol_syslog("delete", LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
|
|
@ -328,81 +328,73 @@ if ($action == 'confirm_delete' && $confirm == 'yes') { // delete
|
|||
|
||||
// activate
|
||||
if ($action == $acts[0]) {
|
||||
if ($tabrowid[$id]) {
|
||||
$rowidcol = $tabrowid[$id];
|
||||
} else {
|
||||
$rowidcol = "rowid";
|
||||
}
|
||||
$rowidcol = "rowid";
|
||||
|
||||
if ($rowid) {
|
||||
$sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE ".$rowidcol." = ".((int) $rowid);
|
||||
$sql = "UPDATE ".$db->sanitize($tabname[$id])." SET active = 1 WHERE ".$db->sanitize($rowidcol)." = ".((int) $rowid);
|
||||
} elseif ($code) {
|
||||
$sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE code = '".$db->escape($code)."'";
|
||||
$sql = "UPDATE ".$db->sanitize($tabname[$id])." SET active = 1 WHERE code = '".$db->escape($code)."'";
|
||||
}
|
||||
|
||||
$result = $db->query($sql);
|
||||
if (!$result) {
|
||||
dol_print_error($db);
|
||||
if ($sql) {
|
||||
$result = $db->query($sql);
|
||||
if (!$result) {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// disable
|
||||
if ($action == $acts[1]) {
|
||||
if ($tabrowid[$id]) {
|
||||
$rowidcol = $tabrowid[$id];
|
||||
} else {
|
||||
$rowidcol = "rowid";
|
||||
}
|
||||
$rowidcol = "rowid";
|
||||
|
||||
if ($rowid) {
|
||||
$sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE ".$rowidcol." = ".((int) $rowid);
|
||||
$sql = "UPDATE ".$db->sanitize($tabname[$id])." SET active = 0 WHERE ".$db->sanitize($rowidcol)." = ".((int) $rowid);
|
||||
} elseif ($code) {
|
||||
$sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE code = '".$db->escape($code)."'";
|
||||
$sql = "UPDATE ".$db->sanitize($tabname[$id])." SET active = 0 WHERE code = '".$db->escape($code)."'";
|
||||
}
|
||||
|
||||
$result = $db->query($sql);
|
||||
if (!$result) {
|
||||
dol_print_error($db);
|
||||
if ($sql) {
|
||||
$result = $db->query($sql);
|
||||
if (!$result) {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// favorite
|
||||
if ($action == 'activate_favorite') {
|
||||
if ($tabrowid[$id]) {
|
||||
$rowidcol = $tabrowid[$id];
|
||||
} else {
|
||||
$rowidcol = "rowid";
|
||||
}
|
||||
$rowidcol = "rowid";
|
||||
|
||||
if ($rowid) {
|
||||
$sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE ".$rowidcol." = ".((int) $rowid);
|
||||
$sql = "UPDATE ".$db->sanitize($tabname[$id])." SET favorite = 1 WHERE ".$db->sanitize($rowidcol)." = ".((int) $rowid);
|
||||
} elseif ($code) {
|
||||
$sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE code = '".$db->escape($code)."'";
|
||||
$sql = "UPDATE ".$db->sanitize($tabname[$id])." SET favorite = 1 WHERE code = '".$db->escape($code)."'";
|
||||
}
|
||||
|
||||
$result = $db->query($sql);
|
||||
if (!$result) {
|
||||
dol_print_error($db);
|
||||
if ($sql) {
|
||||
$result = $db->query($sql);
|
||||
if (!$result) {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// disable favorite
|
||||
if ($action == 'disable_favorite') {
|
||||
if ($tabrowid[$id]) {
|
||||
$rowidcol = $tabrowid[$id];
|
||||
} else {
|
||||
$rowidcol = "rowid";
|
||||
}
|
||||
$rowidcol = "rowid";
|
||||
|
||||
if ($rowid) {
|
||||
$sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE ".$rowidcol." = ".((int) $rowid);
|
||||
$sql = "UPDATE ".$db->sanitize($tabname[$id])." SET favorite = 0 WHERE ".$db->sanitize($rowidcol)." = ".((int) $rowid);
|
||||
} elseif ($code) {
|
||||
$sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE code = '".$db->escape($code)."'";
|
||||
$sql = "UPDATE ".$db->sanitize($tabname[$id])." SET favorite = 0 WHERE code = '".$db->escape($code)."'";
|
||||
}
|
||||
|
||||
$result = $db->query($sql);
|
||||
if (!$result) {
|
||||
dol_print_error($db);
|
||||
if ($sql) {
|
||||
$result = $db->query($sql);
|
||||
if (!$result) {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -459,7 +451,7 @@ $fieldlist = explode(',', $tabfield[$id]);
|
|||
|
||||
$param = '&id='.$id;
|
||||
if ($search_country_id > 0) {
|
||||
$param .= '&search_country_id='.urlencode($search_country_id);
|
||||
$param .= '&search_country_id='.urlencode((string) ($search_country_id));
|
||||
}
|
||||
$paramwithsearch = $param;
|
||||
if ($sortorder) {
|
||||
|
|
@ -472,7 +464,7 @@ if (GETPOST('from', 'alpha')) {
|
|||
$paramwithsearch .= '&from='.urlencode(GETPOST('from', 'alpha'));
|
||||
}
|
||||
if ($listlimit) {
|
||||
$paramwithsearch .= '&listlimit='.urlencode(GETPOST('listlimit', 'int'));
|
||||
$paramwithsearch .= '&listlimit='.urlencode((string) (GETPOSTINT('listlimit')));
|
||||
}
|
||||
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
|
|
@ -582,7 +574,7 @@ if ($tabname[$id]) {
|
|||
}
|
||||
|
||||
$tmpaction = 'create';
|
||||
$parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
||||
$parameters = array('fieldlist' => $fieldlist, 'tabname' => $tabname[$id]);
|
||||
$reshook = $hookmanager->executeHooks('createDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||
$error = $hookmanager->error;
|
||||
$errors = $hookmanager->errors;
|
||||
|
|
@ -786,7 +778,7 @@ if ($resql) {
|
|||
print '<tr class="oddeven" id="rowid-'.$obj->rowid.'">';
|
||||
if ($action == 'edit' && ($rowid == (!empty($obj->rowid) ? $obj->rowid : $obj->code))) {
|
||||
$tmpaction = 'edit';
|
||||
$parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
||||
$parameters = array('fieldlist' => $fieldlist, 'tabname' => $tabname[$id]);
|
||||
$reshook = $hookmanager->executeHooks('editDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||
$error = $hookmanager->error;
|
||||
$errors = $hookmanager->errors;
|
||||
|
|
@ -833,7 +825,7 @@ if ($resql) {
|
|||
$canbemodified = $iserasable;
|
||||
|
||||
$tmpaction = 'view';
|
||||
$parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
||||
$parameters = array('fieldlist' => $fieldlist, 'tabname' => $tabname[$id]);
|
||||
$reshook = $hookmanager->executeHooks('viewDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
$error = $hookmanager->error;
|
||||
|
|
@ -977,7 +969,7 @@ function fieldListAccountingCategories($fieldlist, $obj = null, $tabname = '', $
|
|||
$fieldname = 'country';
|
||||
if ($context == 'add') {
|
||||
$fieldname = 'country_id';
|
||||
$preselectcountrycode = GETPOSTISSET('country_id') ? GETPOST('country_id', 'int') : $mysoc->country_code;
|
||||
$preselectcountrycode = GETPOSTISSET('country_id') ? GETPOSTINT('country_id') : $mysoc->country_code;
|
||||
print $form->select_country($preselectcountrycode, $fieldname, '', 28, 'maxwidth150 maxwidthonsmartphone');
|
||||
} else {
|
||||
$preselectcountrycode = (empty($obj->country_code) ? (empty($obj->country) ? $mysoc->country_code : $obj->country) : $obj->country_code);
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -92,7 +93,7 @@ if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) {
|
|||
$list_account[] = 'ACCOUNTING_VAT_BUY_REVERSE_CHARGES_CREDIT';
|
||||
$list_account[] = 'ACCOUNTING_VAT_BUY_REVERSE_CHARGES_DEBIT';
|
||||
}
|
||||
if (isModEnabled('banque')) {
|
||||
if (isModEnabled('bank')) {
|
||||
$list_account[] = 'ACCOUNTING_ACCOUNT_TRANSFER_CASH';
|
||||
}
|
||||
if (getDolGlobalString('INVOICE_USE_RETAINED_WARRANTY')) {
|
||||
|
|
@ -101,7 +102,7 @@ if (getDolGlobalString('INVOICE_USE_RETAINED_WARRANTY')) {
|
|||
if (isModEnabled('don')) {
|
||||
$list_account[] = 'DONATION_ACCOUNTINGACCOUNT';
|
||||
}
|
||||
if (isModEnabled('adherent')) {
|
||||
if (isModEnabled('member')) {
|
||||
$list_account[] = 'ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT';
|
||||
}
|
||||
if (isModEnabled('loan')) {
|
||||
|
|
@ -143,13 +144,13 @@ if ($action == 'update') {
|
|||
}
|
||||
|
||||
$constname = 'ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT';
|
||||
$constvalue = GETPOST($constname, 'int');
|
||||
$constvalue = GETPOSTINT($constname);
|
||||
if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
$constname = 'ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT';
|
||||
$constvalue = GETPOST($constname, 'int');
|
||||
$constvalue = GETPOSTINT($constname);
|
||||
if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
|
||||
$error++;
|
||||
}
|
||||
|
|
@ -163,7 +164,7 @@ if ($action == 'update') {
|
|||
}
|
||||
|
||||
if ($action == 'setACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT') {
|
||||
$setDisableAuxiliaryAccountOnCustomerDeposit = GETPOST('value', 'int');
|
||||
$setDisableAuxiliaryAccountOnCustomerDeposit = GETPOSTINT('value');
|
||||
$res = dolibarr_set_const($db, "ACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT", $setDisableAuxiliaryAccountOnCustomerDeposit, 'yesno', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
|
|
@ -177,7 +178,7 @@ if ($action == 'setACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT') {
|
|||
}
|
||||
|
||||
if ($action == 'setACCOUNTING_ACCOUNT_SUPPLIER_USE_AUXILIARY_ON_DEPOSIT') {
|
||||
$setDisableAuxiliaryAccountOnSupplierDeposit = GETPOST('value', 'int');
|
||||
$setDisableAuxiliaryAccountOnSupplierDeposit = GETPOSTINT('value');
|
||||
$res = dolibarr_set_const($db, "ACCOUNTING_ACCOUNT_SUPPLIER_USE_AUXILIARY_ON_DEPOSIT", $setDisableAuxiliaryAccountOnSupplierDeposit, 'yesno', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
|
|
@ -239,7 +240,7 @@ foreach ($list_account_main as $key) {
|
|||
// Value
|
||||
print '<td class="right">'; // Do not force class=right, or it align also the content of the select box
|
||||
$key_value = getDolGlobalString($key);
|
||||
print $formaccounting->select_account($key_value, $key, 1, '', 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 'accountsmain');
|
||||
print $formaccounting->select_account($key_value, $key, 1, [], 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 'accountsmain');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
|
@ -285,7 +286,7 @@ foreach ($list_account as $key) {
|
|||
print '</td>';
|
||||
// Value
|
||||
print '<td class="right">'; // Do not force class=right, or it align also the content of the select box
|
||||
print $formaccounting->select_account(getDolGlobalString($key), $key, 1, '', 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 'accounts');
|
||||
print $formaccounting->select_account(getDolGlobalString($key), $key, 1, [], 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 'accounts');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
|
@ -300,7 +301,7 @@ print img_picto('', 'bill', 'class="pictofixedwidth"') . $langs->trans('ACCOUNTI
|
|||
print '</td>';
|
||||
// Value
|
||||
print '<td class="right">'; // Do not force class=right, or it align also the content of the select box
|
||||
print $formaccounting->select_account(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT'), 'ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT', 1, '', 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 'accounts');
|
||||
print $formaccounting->select_account(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT'), 'ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT', 1, [], 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 'accounts');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
|
@ -327,7 +328,7 @@ print img_picto('', 'supplier_invoice', 'class="pictofixedwidth"') . $langs->tra
|
|||
print '</td>';
|
||||
// Value
|
||||
print '<td class="right">'; // Do not force class=right, or it align also the content of the select box
|
||||
print $formaccounting->select_account(getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT'), 'ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT', 1, '', 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 'accounts');
|
||||
print $formaccounting->select_account(getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT'), 'ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT', 1, [], 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 'accounts');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ $model_option = array(
|
|||
if ($action == 'update') {
|
||||
$error = 0;
|
||||
|
||||
$modelcsv = GETPOST('ACCOUNTING_EXPORT_MODELCSV', 'int');
|
||||
$modelcsv = GETPOSTINT('ACCOUNTING_EXPORT_MODELCSV');
|
||||
|
||||
if (!empty($modelcsv)) {
|
||||
if (!dolibarr_set_const($db, 'ACCOUNTING_EXPORT_MODELCSV', $modelcsv, 'chaine', 0, '', $conf->entity)) {
|
||||
|
|
|
|||
|
|
@ -29,10 +29,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/fiscalyear.class.php';
|
|||
$action = GETPOST('action', 'aZ09');
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
|
||||
if (empty($page) || $page == -1) {
|
||||
$page = 0;
|
||||
} // If $page is not defined, or '' or -1
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/fiscalyear.class.php';
|
|||
$langs->loadLangs(array("admin", "compta"));
|
||||
|
||||
// Get parameters
|
||||
$id = GETPOST('id', 'int');
|
||||
$id = GETPOSTINT('id');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
|
|
@ -70,8 +70,8 @@ foreach ($tmpstatus2label as $key => $val) {
|
|||
$status2label[$key] = $langs->trans($val);
|
||||
}
|
||||
|
||||
$date_start = dol_mktime(0, 0, 0, GETPOST('fiscalyearmonth', 'int'), GETPOST('fiscalyearday', 'int'), GETPOST('fiscalyearyear', 'int'));
|
||||
$date_end = dol_mktime(0, 0, 0, GETPOST('fiscalyearendmonth', 'int'), GETPOST('fiscalyearendday', 'int'), GETPOST('fiscalyearendyear', 'int'));
|
||||
$date_start = dol_mktime(0, 0, 0, GETPOSTINT('fiscalyearmonth'), GETPOSTINT('fiscalyearday'), GETPOSTINT('fiscalyearyear'));
|
||||
$date_end = dol_mktime(0, 0, 0, GETPOSTINT('fiscalyearendmonth'), GETPOSTINT('fiscalyearendday'), GETPOSTINT('fiscalyearendyear'));
|
||||
|
||||
$permissiontoadd = $user->hasRight('accounting', 'fiscalyear', 'write');
|
||||
|
||||
|
|
@ -95,7 +95,7 @@ if ($reshook < 0) {
|
|||
}
|
||||
|
||||
if ($action == 'confirm_delete' && $confirm == "yes") {
|
||||
$result = $object->delete($id);
|
||||
$result = $object->delete($user);
|
||||
if ($result >= 0) {
|
||||
header("Location: fiscalyear.php");
|
||||
exit();
|
||||
|
|
@ -313,23 +313,23 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
|
||||
// Label
|
||||
print '<tr><td class="tdtop">';
|
||||
print $form->editfieldkey("Label", 'label', $object->label, $object, 1, 'alpha:32');
|
||||
print $form->editfieldkey("Label", 'label', $object->label, $object, 0, 'alpha:32');
|
||||
print '</td><td colspan="2">';
|
||||
print $form->editfieldval("Label", 'label', $object->label, $object, 1, 'alpha:32');
|
||||
print $form->editfieldval("Label", 'label', $object->label, $object, 0, 'alpha:32');
|
||||
print "</td></tr>";
|
||||
|
||||
// Date start
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey("DateStart", 'date_start', $object->date_start, $object, 1, 'datepicker');
|
||||
print $form->editfieldkey("DateStart", 'date_start', $object->date_start, $object, 0, 'datepicker');
|
||||
print '</td><td colspan="2">';
|
||||
print $form->editfieldval("DateStart", 'date_start', $object->date_start, $object, 1, 'datepicker');
|
||||
print $form->editfieldval("DateStart", 'date_start', $object->date_start, $object, 0, 'datepicker');
|
||||
print '</td></tr>';
|
||||
|
||||
// Date end
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey("DateEnd", 'date_end', $object->date_end, $object, 1, 'datepicker');
|
||||
print $form->editfieldkey("DateEnd", 'date_end', $object->date_end, $object, 0, 'datepicker');
|
||||
print '</td><td colspan="2">';
|
||||
print $form->editfieldval("DateEnd", 'date_end', $object->date_end, $object, 1, 'datepicker');
|
||||
print $form->editfieldval("DateEnd", 'date_end', $object->date_end, $object, 0, 'datepicker');
|
||||
print '</td></tr>';
|
||||
|
||||
// Status
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ if (!$user->hasRight('accounting', 'fiscalyear', 'write')) {
|
|||
accessforbidden();
|
||||
}
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
$id = GETPOSTINT('id');
|
||||
|
||||
|
||||
// View
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ if (!$user->hasRight('accounting', 'chartofaccount')) {
|
|||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
|
||||
$nbletter = GETPOST('ACCOUNTING_LETTERING_NBLETTERS', 'int');
|
||||
$nbletter = GETPOSTINT('ACCOUNTING_LETTERING_NBLETTERS');
|
||||
|
||||
// Parameters ACCOUNTING_* and others
|
||||
$list = array(
|
||||
|
|
@ -70,7 +70,7 @@ $error = 0;
|
|||
|
||||
if (in_array($action, array('setBANK_DISABLE_DIRECT_INPUT', 'setACCOUNTANCY_COMBO_FOR_AUX', 'setACCOUNTING_MANAGE_ZERO'))) {
|
||||
$constname = preg_replace('/^set/', '', $action);
|
||||
$constvalue = GETPOST('value', 'int');
|
||||
$constvalue = GETPOSTINT('value');
|
||||
$res = dolibarr_set_const($db, $constname, $constvalue, 'yesno', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
|
|
@ -102,7 +102,7 @@ if ($action == 'update') {
|
|||
$constvalue = GETPOST($constname, 'alpha');
|
||||
|
||||
if ($constname == 'ACCOUNTING_DATE_START_BINDING') {
|
||||
$constvalue = dol_mktime(0, 0, 0, GETPOST($constname.'month', 'int'), GETPOST($constname.'day', 'int'), GETPOST($constname.'year', 'int'));
|
||||
$constvalue = dol_mktime(0, 0, 0, GETPOSTINT($constname.'month'), GETPOSTINT($constname.'day'), GETPOSTINT($constname.'year'));
|
||||
}
|
||||
|
||||
if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
|
||||
|
|
@ -128,7 +128,7 @@ if ($action == 'update') {
|
|||
}
|
||||
|
||||
if ($action == 'setmanagezero') {
|
||||
$setmanagezero = GETPOST('value', 'int');
|
||||
$setmanagezero = GETPOSTINT('value');
|
||||
$res = dolibarr_set_const($db, "ACCOUNTING_MANAGE_ZERO", $setmanagezero, 'yesno', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
|
|
@ -142,7 +142,7 @@ if ($action == 'setmanagezero') {
|
|||
}
|
||||
|
||||
if ($action == 'setdisabledirectinput') {
|
||||
$setdisabledirectinput = GETPOST('value', 'int');
|
||||
$setdisabledirectinput = GETPOSTINT('value');
|
||||
$res = dolibarr_set_const($db, "BANK_DISABLE_DIRECT_INPUT", $setdisabledirectinput, 'yesno', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
|
|
@ -156,7 +156,7 @@ if ($action == 'setdisabledirectinput') {
|
|||
}
|
||||
|
||||
if ($action == 'setenabledraftexport') {
|
||||
$setenabledraftexport = GETPOST('value', 'int');
|
||||
$setenabledraftexport = GETPOSTINT('value');
|
||||
$res = dolibarr_set_const($db, "ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL", $setenabledraftexport, 'yesno', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
|
|
@ -170,7 +170,7 @@ if ($action == 'setenabledraftexport') {
|
|||
}
|
||||
|
||||
if ($action == 'setenablesubsidiarylist') {
|
||||
$setenablesubsidiarylist = GETPOST('value', 'int');
|
||||
$setenablesubsidiarylist = GETPOSTINT('value');
|
||||
$res = dolibarr_set_const($db, "ACCOUNTANCY_COMBO_FOR_AUX", $setenablesubsidiarylist, 'yesno', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
|
|
@ -184,7 +184,7 @@ if ($action == 'setenablesubsidiarylist') {
|
|||
}
|
||||
|
||||
if ($action == 'setdisablebindingonsales') {
|
||||
$setdisablebindingonsales = GETPOST('value', 'int');
|
||||
$setdisablebindingonsales = GETPOSTINT('value');
|
||||
$res = dolibarr_set_const($db, "ACCOUNTING_DISABLE_BINDING_ON_SALES", $setdisablebindingonsales, 'yesno', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
|
|
@ -198,7 +198,7 @@ if ($action == 'setdisablebindingonsales') {
|
|||
}
|
||||
|
||||
if ($action == 'setdisablebindingonpurchases') {
|
||||
$setdisablebindingonpurchases = GETPOST('value', 'int');
|
||||
$setdisablebindingonpurchases = GETPOSTINT('value');
|
||||
$res = dolibarr_set_const($db, "ACCOUNTING_DISABLE_BINDING_ON_PURCHASES", $setdisablebindingonpurchases, 'yesno', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
|
|
@ -212,7 +212,7 @@ if ($action == 'setdisablebindingonpurchases') {
|
|||
}
|
||||
|
||||
if ($action == 'setdisablebindingonexpensereports') {
|
||||
$setdisablebindingonexpensereports = GETPOST('value', 'int');
|
||||
$setdisablebindingonexpensereports = GETPOSTINT('value');
|
||||
$res = dolibarr_set_const($db, "ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS", $setdisablebindingonexpensereports, 'yesno', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
|
|
@ -226,7 +226,7 @@ if ($action == 'setdisablebindingonexpensereports') {
|
|||
}
|
||||
|
||||
if ($action == 'setenablelettering') {
|
||||
$setenablelettering = GETPOST('value', 'int');
|
||||
$setenablelettering = GETPOSTINT('value');
|
||||
$res = dolibarr_set_const($db, "ACCOUNTING_ENABLE_LETTERING", $setenablelettering, 'yesno', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
|
|
@ -240,7 +240,7 @@ if ($action == 'setenablelettering') {
|
|||
}
|
||||
|
||||
if ($action == 'setenableautolettering') {
|
||||
$setenableautolettering = GETPOST('value', 'int');
|
||||
$setenableautolettering = GETPOSTINT('value');
|
||||
$res = dolibarr_set_const($db, "ACCOUNTING_ENABLE_AUTOLETTERING", $setenableautolettering, 'yesno', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
|
|
@ -254,7 +254,7 @@ if ($action == 'setenableautolettering') {
|
|||
}
|
||||
|
||||
if ($action == 'setenablevatreversecharge') {
|
||||
$setenablevatreversecharge = GETPOST('value', 'int');
|
||||
$setenablevatreversecharge = GETPOSTINT('value');
|
||||
$res = dolibarr_set_const($db, "ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE", $setenablevatreversecharge, 'yesno', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
|
|
|
|||
|
|
@ -50,18 +50,20 @@ if (!$user->hasRight('accounting', 'chartofaccount')) {
|
|||
accessforbidden();
|
||||
}
|
||||
|
||||
$acts = array();
|
||||
$acts[0] = "activate";
|
||||
$acts[1] = "disable";
|
||||
$actl = array();
|
||||
$actl[0] = img_picto($langs->trans("Disabled"), 'switch_off', 'class="size15x"');
|
||||
$actl[1] = img_picto($langs->trans("Activated"), 'switch_on', 'class="size15x"');
|
||||
|
||||
$listoffset = GETPOST('listoffset', 'alpha');
|
||||
$listlimit = GETPOST('listlimit', 'int') > 0 ? GETPOST('listlimit', 'int') : 1000;
|
||||
$listlimit = GETPOSTINT('listlimit') > 0 ? GETPOSTINT('listlimit') : 1000;
|
||||
$active = 1;
|
||||
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
|
||||
if (empty($page) || $page == -1) {
|
||||
$page = 0;
|
||||
} // If $page is not defined, or '' or -1
|
||||
|
|
@ -77,7 +79,7 @@ if (empty($sortorder)) {
|
|||
|
||||
$error = 0;
|
||||
|
||||
$search_country_id = GETPOST('search_country_id', 'int');
|
||||
$search_country_id = GETPOSTINT('search_country_id');
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('admin'));
|
||||
|
|
@ -128,7 +130,7 @@ $tabcond[35] = isModEnabled('accounting');
|
|||
|
||||
// List of help for fields
|
||||
$tabhelp = array();
|
||||
$tabhelp[35] = array('code'=>$langs->trans("EnterAnyCode"));
|
||||
$tabhelp[35] = array('code' => $langs->trans("EnterAnyCode"));
|
||||
|
||||
// List of check for fields (NOT USED YET)
|
||||
$tabfieldcheck = array();
|
||||
|
|
@ -186,7 +188,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
|
|||
if ($tabrowid[$id]) {
|
||||
// Get free id for insert
|
||||
$newid = 0;
|
||||
$sql = "SELECT MAX(".$tabrowid[$id].") newid from ".$tabname[$id];
|
||||
$sql = "SELECT MAX(".$db->sanitize($tabrowid[$id]).") newid FROM ".$db->sanitize($tabname[$id]);
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
$obj = $db->fetch_object($result);
|
||||
|
|
@ -197,12 +199,12 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
|
|||
}
|
||||
|
||||
// Add new entry
|
||||
$sql = "INSERT INTO ".$tabname[$id]." (";
|
||||
$sql = "INSERT INTO ".$db->sanitize($tabname[$id])." (";
|
||||
// List of fields
|
||||
if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldinsert)) {
|
||||
$sql .= $tabrowid[$id].",";
|
||||
}
|
||||
$sql .= $tabfieldinsert[$id];
|
||||
$sql .= $db->sanitize($tabfieldinsert[$id]);
|
||||
$sql .= ",active,entity)";
|
||||
$sql .= " VALUES(";
|
||||
|
||||
|
|
@ -228,7 +230,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
|
|||
$result = $db->query($sql);
|
||||
if ($result) { // Add is ok
|
||||
setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs');
|
||||
$_POST = array('id'=>$id); // Clean $_POST array, we keep only id
|
||||
$_POST = array('id' => $id); // Clean $_POST array, we keep only id
|
||||
} else {
|
||||
if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
|
||||
setEventMessages($langs->transnoentities("ErrorRecordAlreadyExists"), null, 'errors');
|
||||
|
|
@ -247,10 +249,10 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
|
|||
}
|
||||
|
||||
// Modify entry
|
||||
$sql = "UPDATE ".$tabname[$id]." SET ";
|
||||
$sql = "UPDATE ".$db->sanitize($tabname[$id])." SET ";
|
||||
// Modifie valeur des champs
|
||||
if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldmodify)) {
|
||||
$sql .= $tabrowid[$id]."=";
|
||||
$sql .= $db->sanitize($tabrowid[$id])." = ";
|
||||
$sql .= "'".$db->escape($rowid)."', ";
|
||||
}
|
||||
$i = 0;
|
||||
|
|
@ -262,7 +264,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
|
|||
$sql .= "'".$db->escape(GETPOST($listfieldvalue[$i]))."'";
|
||||
$i++;
|
||||
}
|
||||
$sql .= " WHERE ".$rowidcol." = ".((int) $rowid);
|
||||
$sql .= " WHERE ".$db->sanitize($rowidcol)." = ".((int) $rowid);
|
||||
$sql .= " AND entity = ".((int) $conf->entity);
|
||||
|
||||
dol_syslog("actionmodify", LOG_DEBUG);
|
||||
|
|
@ -287,7 +289,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') { // delete
|
|||
$rowidcol = "rowid";
|
||||
}
|
||||
|
||||
$sql = "DELETE from ".$tabname[$id]." WHERE ".$rowidcol." = ".((int) $rowid);
|
||||
$sql = "DELETE from ".$db->sanitize($tabname[$id])." WHERE ".$db->sanitize($rowidcol)." = ".((int) $rowid);
|
||||
$sql .= " AND entity = ".((int) $conf->entity);
|
||||
|
||||
dol_syslog("delete", LOG_DEBUG);
|
||||
|
|
@ -310,9 +312,9 @@ if ($action == $acts[0]) {
|
|||
}
|
||||
|
||||
if ($rowid) {
|
||||
$sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE ".$rowidcol." = ".((int) $rowid);
|
||||
$sql = "UPDATE ".$db->sanitize($tabname[$id])." SET active = 1 WHERE ".$db->sanitize($rowidcol)." = ".((int) $rowid);
|
||||
} elseif ($code) {
|
||||
$sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE code='".$db->escape($code)."'";
|
||||
$sql = "UPDATE ".$db->sanitize($tabname[$id])." SET active = 1 WHERE code = '".$db->escape($code)."'";
|
||||
}
|
||||
$sql .= " AND entity = ".$conf->entity;
|
||||
|
||||
|
|
@ -331,9 +333,9 @@ if ($action == $acts[1]) {
|
|||
}
|
||||
|
||||
if ($rowid) {
|
||||
$sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE ".$rowidcol." = ".((int) $rowid);
|
||||
$sql = "UPDATE ".$db->sanitize($tabname[$id])." SET active = 0 WHERE ".$db->sanitize($rowidcol)." = ".((int) $rowid);
|
||||
} elseif ($code) {
|
||||
$sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE code='".$db->escape($code)."'";
|
||||
$sql = "UPDATE ".$db->sanitize($tabname[$id])." SET active = 0 WHERE code='".$db->escape($code)."'";
|
||||
}
|
||||
$sql .= " AND entity = ".$conf->entity;
|
||||
|
||||
|
|
@ -451,7 +453,7 @@ if ($id) {
|
|||
}
|
||||
|
||||
$tmpaction = 'create';
|
||||
$parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
||||
$parameters = array('fieldlist' => $fieldlist, 'tabname' => $tabname[$id]);
|
||||
$reshook = $hookmanager->executeHooks('createDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||
$error = $hookmanager->error;
|
||||
$errors = $hookmanager->errors;
|
||||
|
|
@ -479,7 +481,7 @@ if ($id) {
|
|||
|
||||
$param = '&id='.((int) $id);
|
||||
if ($search_country_id > 0) {
|
||||
$param .= '&search_country_id='.urlencode($search_country_id);
|
||||
$param .= '&search_country_id='.urlencode((string) ($search_country_id));
|
||||
}
|
||||
$paramwithsearch = $param;
|
||||
if ($sortorder) {
|
||||
|
|
@ -561,7 +563,7 @@ if ($id) {
|
|||
print '<tr class="oddeven" id="rowid-'.$obj->rowid.'">';
|
||||
if ($action == 'edit' && ($rowid == (!empty($obj->rowid) ? $obj->rowid : $obj->code))) {
|
||||
$tmpaction = 'edit';
|
||||
$parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
||||
$parameters = array('fieldlist' => $fieldlist, 'tabname' => $tabname[$id]);
|
||||
$reshook = $hookmanager->executeHooks('editDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||
$error = $hookmanager->error;
|
||||
$errors = $hookmanager->errors;
|
||||
|
|
@ -580,7 +582,7 @@ if ($id) {
|
|||
print '</td>';
|
||||
} else {
|
||||
$tmpaction = 'view';
|
||||
$parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
||||
$parameters = array('fieldlist' => $fieldlist, 'tabname' => $tabname[$id]);
|
||||
$reshook = $hookmanager->executeHooks('viewDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
$error = $hookmanager->error;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@
|
|||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -26,17 +28,16 @@
|
|||
* \brief To define accounting account on product / service
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
if (isModEnabled('categorie')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
}
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("companies", "compta", "accountancy", "products"));
|
||||
|
|
@ -58,13 +59,13 @@ $optioncss = GETPOST('optioncss', 'alpha');
|
|||
$codeventil_buy = GETPOST('codeventil_buy', 'array');
|
||||
$codeventil_sell = GETPOST('codeventil_sell', 'array');
|
||||
$chk_prod = GETPOST('chk_prod', 'array');
|
||||
$default_account = GETPOST('default_account', 'int');
|
||||
$default_account = GETPOSTINT('default_account');
|
||||
$account_number_buy = GETPOST('account_number_buy');
|
||||
$account_number_sell = GETPOST('account_number_sell');
|
||||
$changeaccount = GETPOST('changeaccount', 'array');
|
||||
$changeaccount_buy = GETPOST('changeaccount_buy', 'array');
|
||||
$changeaccount_sell = GETPOST('changeaccount_sell', 'array');
|
||||
$searchCategoryProductOperator = (GETPOST('search_category_product_operator', 'int') ? GETPOST('search_category_product_operator', 'int') : 0);
|
||||
$searchCategoryProductOperator = (GETPOSTINT('search_category_product_operator') ? GETPOSTINT('search_category_product_operator') : 0);
|
||||
$searchCategoryProductList = GETPOST('search_category_product_list', 'array');
|
||||
$search_ref = GETPOST('search_ref', 'alpha');
|
||||
$search_label = GETPOST('search_label', 'alpha');
|
||||
|
|
@ -81,14 +82,20 @@ $search_onpurchase = GETPOST('search_onpurchase', 'alpha');
|
|||
$accounting_product_mode = GETPOST('accounting_product_mode', 'alpha');
|
||||
$btn_changetype = GETPOST('changetype', 'alpha');
|
||||
|
||||
// Show/hide child product variants
|
||||
$show_childproducts = 0;
|
||||
if (isModEnabled('variants')) {
|
||||
$show_childproducts = GETPOST('search_show_childproducts');
|
||||
}
|
||||
|
||||
if (empty($accounting_product_mode)) {
|
||||
$accounting_product_mode = 'ACCOUNTANCY_SELL';
|
||||
}
|
||||
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalInt('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit);
|
||||
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : getDolGlobalInt('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit);
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
|
||||
if (empty($page) || $page == -1) {
|
||||
$page = 0;
|
||||
} // If $page is not defined, or '' or -1
|
||||
|
|
@ -179,6 +186,10 @@ if ($action == 'update') {
|
|||
|
||||
if (!empty($chk_prod) && $massaction === 'changeaccount') {
|
||||
//$msg = '<div><span class="accountingprocessing">' . $langs->trans("Processing") . '...</span></div>';
|
||||
$ok = 0;
|
||||
$ko = 0;
|
||||
$msg = '';
|
||||
$sql = '';
|
||||
if (!empty($chk_prod) && in_array($accounting_product_mode, $accounting_product_modes)) {
|
||||
$accounting = new AccountingAccount($db);
|
||||
|
||||
|
|
@ -186,8 +197,6 @@ if ($action == 'update') {
|
|||
$arrayofdifferentselectedvalues = array();
|
||||
|
||||
$cpt = 0;
|
||||
$ok = 0;
|
||||
$ko = 0;
|
||||
foreach ($chk_prod as $productid) {
|
||||
$accounting_account_id = GETPOST('codeventil_'.$productid);
|
||||
|
||||
|
|
@ -201,31 +210,30 @@ if ($action == 'update') {
|
|||
$msg .= '<div><span class="error">'.$langs->trans("ErrorDB").' : '.$langs->trans("Product").' '.$productid.' '.$langs->trans("NotVentilatedinAccount").' : id='.$accounting_account_id.'<br> <pre>'.$sql.'</pre></span></div>';
|
||||
$ko++;
|
||||
} else {
|
||||
$sql = '';
|
||||
if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
|
||||
$sql_exists = "SELECT rowid FROM " . MAIN_DB_PREFIX . "product_perentity";
|
||||
$sql_exists .= " WHERE fk_product = " . ((int) $productid) . " AND entity = " . ((int) $conf->entity);
|
||||
$resql_exists = $db->query($sql_exists);
|
||||
if (!$resql_exists) {
|
||||
$msg .= '<div><span class="error">'.$langs->trans("ErrorDB").' : '.$langs->trans("Product").' '.$productid.' '.$langs->trans("NotVentilatedinAccount").' : id='.$accounting_account_id.'<br> <pre>'.$resql_exists.'</pre></span></div>';
|
||||
$msg .= '<div><span class="error">'.$langs->trans("ErrorDB").' : '.$langs->trans("Product").' '.$productid.' '.$langs->trans("NotVentilatedinAccount").' : id='.$accounting_account_id.'<br> <pre>'.json_encode($resql_exists).'</pre></span></div>';
|
||||
$ko++;
|
||||
} else {
|
||||
$nb_exists = $db->num_rows($resql_exists);
|
||||
if ($nb_exists <= 0) {
|
||||
// insert
|
||||
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "product_perentity (fk_product, entity, " . $db->escape($accountancy_field_name) . ")";
|
||||
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "product_perentity (fk_product, entity, " . $db->sanitize($accountancy_field_name) . ")";
|
||||
$sql .= " VALUES (" . ((int) $productid) . ", " . ((int) $conf->entity) . ", '" . $db->escape($accounting->account_number) . "')";
|
||||
} else {
|
||||
$obj_exists = $db->fetch_object($resql_exists);
|
||||
// update
|
||||
$sql = "UPDATE " . MAIN_DB_PREFIX . "product_perentity";
|
||||
$sql .= " SET " . $accountancy_field_name . " = '" . $db->escape($accounting->account_number) . "'";
|
||||
$sql .= " SET " . $db->sanitize($accountancy_field_name) . " = '" . $db->escape($accounting->account_number) . "'";
|
||||
$sql .= " WHERE rowid = " . ((int) $obj_exists->rowid);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$sql = " UPDATE ".MAIN_DB_PREFIX."product";
|
||||
$sql .= " SET ".$accountancy_field_name." = '".$db->escape($accounting->account_number)."'";
|
||||
$sql .= " SET ".$db->sanitize($accountancy_field_name)." = '".$db->escape($accounting->account_number)."'";
|
||||
$sql .= " WHERE rowid = ".((int) $productid);
|
||||
}
|
||||
|
||||
|
|
@ -268,18 +276,18 @@ $form = new FormAccounting($db);
|
|||
// so we need to get those the rowid of those default value first
|
||||
$accounting = new AccountingAccount($db);
|
||||
// TODO: we should need to check if result is already exists accountaccount rowid.....
|
||||
$aarowid_servbuy = $accounting->fetch('', getDolGlobalString('ACCOUNTING_SERVICE_BUY_ACCOUNT'), 1);
|
||||
$aarowid_servbuy_intra = $accounting->fetch('', getDolGlobalString('ACCOUNTING_SERVICE_BUY_INTRA_ACCOUNT'), 1);
|
||||
$aarowid_servbuy_export = $accounting->fetch('', getDolGlobalString('ACCOUNTING_SERVICE_BUY_EXPORT_ACCOUNT'), 1);
|
||||
$aarowid_prodbuy = $accounting->fetch('', getDolGlobalString('ACCOUNTING_PRODUCT_BUY_ACCOUNT'), 1);
|
||||
$aarowid_prodbuy_intra = $accounting->fetch('', getDolGlobalString('ACCOUNTING_PRODUCT_BUY_INTRA_ACCOUNT'), 1);
|
||||
$aarowid_prodbuy_export = $accounting->fetch('', getDolGlobalString('ACCOUNTING_PRODUCT_BUY_EXPORT_ACCOUNT'), 1);
|
||||
$aarowid_servsell = $accounting->fetch('', getDolGlobalString('ACCOUNTING_SERVICE_SOLD_ACCOUNT'), 1);
|
||||
$aarowid_servsell_intra = $accounting->fetch('', getDolGlobalString('ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT'), 1);
|
||||
$aarowid_servsell_export = $accounting->fetch('', getDolGlobalString('ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT'), 1);
|
||||
$aarowid_prodsell = $accounting->fetch('', getDolGlobalString('ACCOUNTING_PRODUCT_SOLD_ACCOUNT'), 1);
|
||||
$aarowid_prodsell_intra = $accounting->fetch('', getDolGlobalString('ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT'), 1);
|
||||
$aarowid_prodsell_export = $accounting->fetch('', getDolGlobalString('ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT'), 1);
|
||||
$aarowid_servbuy = $accounting->fetch(0, getDolGlobalString('ACCOUNTING_SERVICE_BUY_ACCOUNT'), 1);
|
||||
$aarowid_servbuy_intra = $accounting->fetch(0, getDolGlobalString('ACCOUNTING_SERVICE_BUY_INTRA_ACCOUNT'), 1);
|
||||
$aarowid_servbuy_export = $accounting->fetch(0, getDolGlobalString('ACCOUNTING_SERVICE_BUY_EXPORT_ACCOUNT'), 1);
|
||||
$aarowid_prodbuy = $accounting->fetch(0, getDolGlobalString('ACCOUNTING_PRODUCT_BUY_ACCOUNT'), 1);
|
||||
$aarowid_prodbuy_intra = $accounting->fetch(0, getDolGlobalString('ACCOUNTING_PRODUCT_BUY_INTRA_ACCOUNT'), 1);
|
||||
$aarowid_prodbuy_export = $accounting->fetch(0, getDolGlobalString('ACCOUNTING_PRODUCT_BUY_EXPORT_ACCOUNT'), 1);
|
||||
$aarowid_servsell = $accounting->fetch(0, getDolGlobalString('ACCOUNTING_SERVICE_SOLD_ACCOUNT'), 1);
|
||||
$aarowid_servsell_intra = $accounting->fetch(0, getDolGlobalString('ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT'), 1);
|
||||
$aarowid_servsell_export = $accounting->fetch(0, getDolGlobalString('ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT'), 1);
|
||||
$aarowid_prodsell = $accounting->fetch(0, getDolGlobalString('ACCOUNTING_PRODUCT_SOLD_ACCOUNT'), 1);
|
||||
$aarowid_prodsell_intra = $accounting->fetch(0, getDolGlobalString('ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT'), 1);
|
||||
$aarowid_prodsell_export = $accounting->fetch(0, getDolGlobalString('ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT'), 1);
|
||||
|
||||
$aacompta_servbuy = getDolGlobalString('ACCOUNTING_SERVICE_BUY_ACCOUNT', $langs->trans("CodeNotDef"));
|
||||
$aacompta_servbuy_intra = getDolGlobalString('ACCOUNTING_SERVICE_BUY_INTRA_ACCOUNT', $langs->trans("CodeNotDef"));
|
||||
|
|
@ -324,16 +332,16 @@ $sql .= " aa.rowid as aaid";
|
|||
$sql .= " FROM ".MAIN_DB_PREFIX."product as p";
|
||||
if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity);
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.account_number = ppe." . $accountancy_field_name . " AND aa.fk_pcg_version = '" . $db->escape($pcgvercode) . "'";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.account_number = ppe." . $db->sanitize($accountancy_field_name) . " AND aa.fk_pcg_version = '" . $db->escape($pcgvercode) . "'";
|
||||
} else {
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.account_number = p." . $accountancy_field_name . " AND aa.fk_pcg_version = '" . $db->escape($pcgvercode) . "'";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.account_number = p." . $db->sanitize($accountancy_field_name) . " AND aa.fk_pcg_version = '" . $db->escape($pcgvercode) . "'";
|
||||
}
|
||||
if (!empty($searchCategoryProductList)) {
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product"; // We'll need this table joined to the select in order to filter by categ
|
||||
}
|
||||
$sql .= ' WHERE p.entity IN ('.getEntity('product').')';
|
||||
if (strlen(trim($search_current_account))) {
|
||||
$sql .= natural_search((!getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED') ? "p." : "ppe.") . $accountancy_field_name, $search_current_account);
|
||||
$sql .= natural_search((!getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED') ? "p." : "ppe.") . $db->sanitize($accountancy_field_name), $search_current_account);
|
||||
}
|
||||
if ($search_current_account_valid == 'withoutvalidaccount') {
|
||||
$sql .= " AND aa.account_number IS NULL";
|
||||
|
|
@ -347,7 +355,7 @@ if ($searchCategoryProductOperator == 1) {
|
|||
if (intval($searchCategoryProduct) == -2) {
|
||||
$searchCategoryProductSqlList[] = "cp.fk_categorie IS NULL";
|
||||
} elseif (intval($searchCategoryProduct) > 0) {
|
||||
$searchCategoryProductSqlList[] = "cp.fk_categorie = ".$db->escape($searchCategoryProduct);
|
||||
$searchCategoryProductSqlList[] = "cp.fk_categorie = ".((int) $searchCategoryProduct);
|
||||
}
|
||||
}
|
||||
if (!empty($searchCategoryProductSqlList)) {
|
||||
|
|
@ -423,7 +431,7 @@ if ($resql) {
|
|||
$param .= '&limit='.((int) $limit);
|
||||
}
|
||||
if ($searchCategoryProductOperator == 1) {
|
||||
$param .= "&search_category_product_operator=".urlencode($searchCategoryProductOperator);
|
||||
$param .= "&search_category_product_operator=".urlencode((string) ($searchCategoryProductOperator));
|
||||
}
|
||||
foreach ($searchCategoryProductList as $searchCategoryProduct) {
|
||||
$param .= "&search_category_product_list[]=".urlencode($searchCategoryProduct);
|
||||
|
|
@ -504,8 +512,8 @@ if ($resql) {
|
|||
|
||||
if ($massaction !== 'set_default_account') {
|
||||
$arrayofmassactions = array(
|
||||
'changeaccount'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Save")
|
||||
,'set_default_account'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("ConfirmPreselectAccount")
|
||||
'changeaccount' => img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Save")
|
||||
,'set_default_account' => img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("ConfirmPreselectAccount")
|
||||
);
|
||||
$massactionbutton = $form->selectMassAction('', $arrayofmassactions, 1);
|
||||
}
|
||||
|
|
@ -517,7 +525,8 @@ if ($resql) {
|
|||
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, '', 0, '', '', $limit, 0, 0, 1);
|
||||
|
||||
if ($massaction == 'set_default_account') {
|
||||
$formquestion[]=array('type' => 'other',
|
||||
$formquestion = array();
|
||||
$formquestion[] = array('type' => 'other',
|
||||
'name' => 'set_default_account',
|
||||
'label' => $langs->trans("AccountancyCode"),
|
||||
'value' => $form->select_account('', 'default_account', 1, array(), 0, 0, 'maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone'));
|
||||
|
|
@ -526,7 +535,10 @@ if ($resql) {
|
|||
|
||||
// Filter on categories
|
||||
$moreforfilter = '';
|
||||
if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) {
|
||||
if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) {
|
||||
$formcategory = new FormCategory($db);
|
||||
$moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PRODUCT, $searchCategoryProductList, 'minwidth300', $searchCategoryProductList ? $searchCategoryProductList : 0);
|
||||
/*
|
||||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
$moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedwidth"');
|
||||
$categoriesProductArr = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', '', 64, 0, 1);
|
||||
|
|
@ -534,6 +546,7 @@ if ($resql) {
|
|||
$moreforfilter .= Form::multiselectarray('search_category_product_list', $categoriesProductArr, $searchCategoryProductList, 0, 0, 'minwidth300');
|
||||
$moreforfilter .= ' <input type="checkbox" class="valignmiddle" id="search_category_product_operator" name="search_category_product_operator" value="1"'.($searchCategoryProductOperator == 1 ? ' checked="checked"' : '').'/> <label for="search_category_product_operator"><span class="none">'.$langs->trans('UseOrOperatorForCategories').'</span></label>';
|
||||
$moreforfilter .= '</div>';
|
||||
*/
|
||||
}
|
||||
|
||||
// Show/hide child products. Hidden by default
|
||||
|
|
@ -586,7 +599,7 @@ if ($resql) {
|
|||
// Current account
|
||||
print '<td class="liste_titre">';
|
||||
print '<input type="text" class="flat" size="6" name="search_current_account" id="search_current_account" value="'.dol_escape_htmltag($search_current_account).'">';
|
||||
$listofvals = array('withoutvalidaccount'=>$langs->trans("WithoutValidAccount"), 'withvalidaccount'=>$langs->trans("WithValidAccount"));
|
||||
$listofvals = array('withoutvalidaccount' => $langs->trans("WithoutValidAccount"), 'withvalidaccount' => $langs->trans("WithValidAccount"));
|
||||
print ' '.$langs->trans("or").' '.$form->selectarray('search_current_account_valid', $listofvals, $search_current_account_valid, 1);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@ $langs->loadLangs(array("accountancy", "admin", "bills", "compta", "errors", "hr
|
|||
$mesg = '';
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$cancel = GETPOST('cancel', 'alpha');
|
||||
$id = GETPOST('id', 'int');
|
||||
$rowid = GETPOST('rowid', 'int');
|
||||
$id = GETPOSTINT('id');
|
||||
$rowid = GETPOSTINT('rowid');
|
||||
$massaction = GETPOST('massaction', 'aZ09');
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
$mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...)
|
||||
|
|
@ -44,7 +44,7 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'ac
|
|||
|
||||
$search_subaccount = GETPOST('search_subaccount', 'alpha');
|
||||
$search_label = GETPOST('search_label', 'alpha');
|
||||
$search_type = GETPOST('search_type', 'int');
|
||||
$search_type = GETPOSTINT('search_type');
|
||||
|
||||
// Security check
|
||||
if ($user->socid > 0) {
|
||||
|
|
@ -55,10 +55,10 @@ if (!$user->hasRight('accounting', 'chartofaccount')) {
|
|||
}
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
|
||||
if (empty($page) || $page == -1) {
|
||||
$page = 0;
|
||||
} // If $page is not defined, or '' or -1
|
||||
|
|
@ -329,7 +329,7 @@ if ($resql) {
|
|||
print '<div class="info">'.$langs->trans("WarningCreateSubAccounts").'</div>';
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields
|
||||
$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields
|
||||
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
|
||||
|
||||
$moreforfilter = '';
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/* Copyright (C) 2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2016-2024 Alexandre Spangaro <aspangaro@easya.solutions>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -50,8 +50,8 @@ if ($type == 'sub') {
|
|||
}
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : $context_default;
|
||||
$show_subgroup = GETPOST('show_subgroup', 'alpha');
|
||||
$search_date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int'));
|
||||
$search_date_end = dol_mktime(23, 59, 59, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int'));
|
||||
$search_date_start = dol_mktime(0, 0, 0, GETPOSTINT('date_startmonth'), GETPOSTINT('date_startday'), GETPOSTINT('date_startyear'));
|
||||
$search_date_end = dol_mktime(23, 59, 59, GETPOSTINT('date_endmonth'), GETPOSTINT('date_endday'), GETPOSTINT('date_endyear'));
|
||||
$search_ledger_code = GETPOST('search_ledger_code', 'array');
|
||||
$search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha');
|
||||
if ($search_accountancy_code_start == - 1) {
|
||||
|
|
@ -64,10 +64,10 @@ if ($search_accountancy_code_end == - 1) {
|
|||
$search_not_reconciled = GETPOST('search_not_reconciled', 'alpha');
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
|
||||
if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) {
|
||||
$page = 0;
|
||||
} // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
|
||||
|
|
@ -161,15 +161,15 @@ if (empty($reshook)) {
|
|||
|
||||
if (!empty($search_date_start)) {
|
||||
$filter['t.doc_date>='] = $search_date_start;
|
||||
$param .= '&date_startmonth=' . GETPOST('date_startmonth', 'int') . '&date_startday=' . GETPOST('date_startday', 'int') . '&date_startyear=' . GETPOST('date_startyear', 'int');
|
||||
$param .= '&date_startmonth=' . GETPOSTINT('date_startmonth') . '&date_startday=' . GETPOSTINT('date_startday') . '&date_startyear=' . GETPOSTINT('date_startyear');
|
||||
}
|
||||
if (!empty($search_date_end)) {
|
||||
$filter['t.doc_date<='] = $search_date_end;
|
||||
$param .= '&date_endmonth=' . GETPOST('date_endmonth', 'int') . '&date_endday=' . GETPOST('date_endday', 'int') . '&date_endyear=' . GETPOST('date_endyear', 'int');
|
||||
$param .= '&date_endmonth=' . GETPOSTINT('date_endmonth') . '&date_endday=' . GETPOSTINT('date_endday') . '&date_endyear=' . GETPOSTINT('date_endyear');
|
||||
}
|
||||
if (!empty($search_doc_date)) {
|
||||
$filter['t.doc_date'] = $search_doc_date;
|
||||
$param .= '&doc_datemonth=' . GETPOST('doc_datemonth', 'int') . '&doc_dateday=' . GETPOST('doc_dateday', 'int') . '&doc_dateyear=' . GETPOST('doc_dateyear', 'int');
|
||||
$param .= '&doc_datemonth=' . GETPOSTINT('doc_datemonth') . '&doc_dateday=' . GETPOSTINT('doc_dateday') . '&doc_dateyear=' . GETPOSTINT('doc_dateyear');
|
||||
}
|
||||
if (!empty($search_accountancy_code_start)) {
|
||||
if ($type == 'sub') {
|
||||
|
|
@ -238,6 +238,7 @@ if ($action == 'export_csv') {
|
|||
exit;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
|
@ -442,7 +443,7 @@ if ($action != 'export_csv') {
|
|||
print_liste_field_titre("Balance", $_SERVER["PHP_SELF"], "", $param, "", 'class="right"', $sortfield, $sortorder);
|
||||
|
||||
// Hook fields
|
||||
$parameters = array('param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
|
||||
$parameters = array('param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Action column
|
||||
|
|
@ -471,11 +472,13 @@ if ($action != 'export_csv') {
|
|||
$sql .= " GROUP BY t.numero_compte";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
$nrows = $resql->num_rows;
|
||||
$opening_balances = array();
|
||||
for ($i = 0; $i < $nrows; $i++) {
|
||||
$arr = $resql->fetch_array();
|
||||
$opening_balances["'" . $arr['numero_compte'] . "'"] = $arr['opening_balance'];
|
||||
if ($resql) {
|
||||
$nrows = $resql->num_rows;
|
||||
for ($i = 0; $i < $nrows; $i++) {
|
||||
$arr = $resql->fetch_array();
|
||||
$opening_balances["'" . $arr['numero_compte'] . "'"] = $arr['opening_balance'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -546,7 +549,7 @@ if ($action != 'export_csv') {
|
|||
|
||||
// Show first line of a break
|
||||
print '<tr class="trforbreak">';
|
||||
print '<td colspan="'.($colspan+1).'" style="font-weight:bold; border-bottom: 1pt solid black;">'.$line->numero_compte.($root_account_description ? ' - '.$root_account_description : '').'</td>';
|
||||
print '<td colspan="'.($colspan + 1).'" class="tdforbreak">'.$root_account_number.($root_account_description ? ' - '.$root_account_description : '').'</td>';
|
||||
print '</tr>';
|
||||
|
||||
$displayed_account = $root_account_number;
|
||||
|
|
@ -587,20 +590,20 @@ if ($action != 'export_csv') {
|
|||
if ($line->subledger_account) {
|
||||
$urlzoom = DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?type=sub&search_accountancy_code_start=' . urlencode($line->subledger_account) . '&search_accountancy_code_end=' . urlencode($line->subledger_account);
|
||||
if (GETPOSTISSET('date_startmonth')) {
|
||||
$urlzoom .= '&search_date_startmonth=' . GETPOST('date_startmonth', 'int') . '&search_date_startday=' . GETPOST('date_startday', 'int') . '&search_date_startyear=' . GETPOST('date_startyear', 'int');
|
||||
$urlzoom .= '&search_date_startmonth=' . GETPOSTINT('date_startmonth') . '&search_date_startday=' . GETPOSTINT('date_startday') . '&search_date_startyear=' . GETPOSTINT('date_startyear');
|
||||
}
|
||||
if (GETPOSTISSET('date_endmonth')) {
|
||||
$urlzoom .= '&search_date_endmonth=' . GETPOST('date_endmonth', 'int') . '&search_date_endday=' . GETPOST('date_endday', 'int') . '&search_date_endyear=' . GETPOST('date_endyear', 'int');
|
||||
$urlzoom .= '&search_date_endmonth=' . GETPOSTINT('date_endmonth') . '&search_date_endday=' . GETPOSTINT('date_endday') . '&search_date_endyear=' . GETPOSTINT('date_endyear');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ($line->numero_compte) {
|
||||
$urlzoom = DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?search_accountancy_code_start=' . urlencode($line->numero_compte) . '&search_accountancy_code_end=' . urlencode($line->numero_compte);
|
||||
if (GETPOSTISSET('date_startmonth')) {
|
||||
$urlzoom .= '&search_date_startmonth=' . GETPOST('date_startmonth', 'int') . '&search_date_startday=' . GETPOST('date_startday', 'int') . '&search_date_startyear=' . GETPOST('date_startyear', 'int');
|
||||
$urlzoom .= '&search_date_startmonth=' . GETPOSTINT('date_startmonth') . '&search_date_startday=' . GETPOSTINT('date_startday') . '&search_date_startyear=' . GETPOSTINT('date_startyear');
|
||||
}
|
||||
if (GETPOSTISSET('date_endmonth')) {
|
||||
$urlzoom .= '&search_date_endmonth=' . GETPOST('date_endmonth', 'int') . '&search_date_endday=' . GETPOST('date_endday', 'int') . '&search_date_endyear=' . GETPOST('date_endyear', 'int');
|
||||
$urlzoom .= '&search_date_endmonth=' . GETPOSTINT('date_endmonth') . '&search_date_endday=' . GETPOSTINT('date_endday') . '&search_date_endyear=' . GETPOSTINT('date_endyear');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -689,7 +692,7 @@ if ($action != 'export_csv') {
|
|||
|
||||
$accountingResult = $object->accountingResult($search_date_start, $search_date_end);
|
||||
if ($accountingResult < 0) {
|
||||
$accountingResultDebit = price(price2num(abs($accountingResult), 'MT'));
|
||||
$accountingResultDebit = price(abs(price2num($accountingResult, 'MT')));
|
||||
$accountingResultClassCSS = ' error';
|
||||
} else {
|
||||
$accountingResultCredit = price(price2num($accountingResult, 'MT'));
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user