Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
158 changes: 158 additions & 0 deletions .config/php/error-reporting.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
; ============================================================================
; KaririCode DevKit - Error Reporting Configuration
; ============================================================================
; Strict error reporting configuration for development environment
; All errors, warnings, and notices are displayed to catch issues early
;
; Location: devkit/.config/php/error-reporting.ini
; ============================================================================

[PHP]
; ============================================================================
; ERROR REPORTING
; ============================================================================
; Report all errors, warnings, and notices
error_reporting = E_ALL

; Display errors on screen (development only)
display_errors = On
display_startup_errors = On

; Log errors to file
log_errors = On
error_log = /var/log/php_errors.log

; Detailed error messages
html_errors = On
docref_root = "https://www.php.net/manual/en/"
docref_ext = .html

; Track all errors
track_errors = Off
xmlrpc_errors = Off

; ============================================================================
; ASSERTIONS
; ============================================================================
; Enable assertions for development
zend.assertions = 1
assert.active = 1
assert.exception = 1
assert.warning = 0
assert.bail = 0

; ============================================================================
; DEVELOPMENT SETTINGS
; ============================================================================
; Hide PHP version in headers (security)
expose_php = Off

; Variables order
variables_order = "EGPCS"
request_order = "GP"

; Auto-detect line endings
auto_detect_line_endings = Off

; ============================================================================
; RESOURCE LIMITS
; ============================================================================
; Memory limit (generous for development)
memory_limit = 512M

; Maximum execution time
max_execution_time = 30
max_input_time = 60

; Input size limits
post_max_size = 25M
upload_max_filesize = 20M
max_file_uploads = 20

; ============================================================================
; OUTPUT BUFFERING
; ============================================================================
; Output buffering (off for immediate error display)
output_buffering = Off
implicit_flush = On

; ============================================================================
; DATE/TIME
; ============================================================================
; Default timezone
date.timezone = UTC

; ============================================================================
; SESSION
; ============================================================================
; Session configuration
session.save_handler = files
session.save_path = "/tmp"
session.use_strict_mode = 1
session.use_cookies = 1
session.use_only_cookies = 1
session.cookie_httponly = 1
session.cookie_secure = 0
session.cookie_samesite = "Lax"
session.gc_probability = 1
session.gc_divisor = 100
session.gc_maxlifetime = 1440
session.sid_length = 48
session.sid_bits_per_character = 6

; ============================================================================
; REALPATH CACHE
; ============================================================================
; Realpath cache (keep small for development)
realpath_cache_size = 4096K
realpath_cache_ttl = 120

; ============================================================================
; FILE UPLOADS
; ============================================================================
; File uploads enabled
file_uploads = On
upload_tmp_dir = /tmp

; ============================================================================
; SECURITY
; ============================================================================
; Disable dangerous functions (customize as needed)
disable_functions =
disable_classes =

; ============================================================================
; MAIL
; ============================================================================
; Mail configuration (usually handled by application)
SMTP = localhost
smtp_port = 25
sendmail_path = /usr/sbin/sendmail -t -i

; ============================================================================
; MISC
; ============================================================================
; Allow URL fopen (needed for many libraries)
allow_url_fopen = On
allow_url_include = Off

; Auto-prepend/append files
auto_prepend_file =
auto_append_file =

; Default charset
default_charset = "UTF-8"

; Maximum input variables (prevent resource exhaustion)
max_input_vars = 1000
max_input_nesting_level = 64

; ============================================================================
; EXTENSIONS
; ============================================================================
; Common extensions are enabled by default in kariricode/php-api-stack
; Additional extensions can be enabled as needed:
; extension=redis.so
; extension=memcached.so
; extension=apcu.so
; extension=imagick.so
160 changes: 160 additions & 0 deletions .config/php/xdebug.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
; ============================================================================
; KaririCode DevKit - Xdebug Configuration
; ============================================================================
; Xdebug 3.x configuration for step debugging and code coverage
; https://xdebug.org/docs/all_settings
;
; Location: devkit/.config/php/xdebug.ini
; ============================================================================

[xdebug]
; ============================================================================
; MODE CONFIGURATION
; ============================================================================
; Modes: off, develop, coverage, debug, gcstats, profile, trace
; Multiple modes can be combined with commas (e.g., "debug,coverage")
; This is controlled by environment variable XDEBUG_MODE in .env
xdebug.mode=${XDEBUG_MODE}

; ============================================================================
; DEBUGGING
; ============================================================================
; Start debugging automatically or wait for trigger
; Values: yes, no, trigger
xdebug.start_with_request=yes

; IDE/Client connection settings
; Use host.docker.internal for Docker Desktop (Mac/Windows)
; Use 172.17.0.1 for Docker on Linux
xdebug.client_host=host.docker.internal
xdebug.client_port=9003

; Discovery mode for cloud/dynamic environments
; Set to 1 if you need automatic discovery (not recommended for local dev)
xdebug.discover_client_host=0

; IDE key for identifying debugging session
; PHPStorm: PHPSTORM
; VSCode: VSCODE
xdebug.idekey=PHPSTORM

; Connection timeout in milliseconds
xdebug.connect_timeout_ms=2000

; ============================================================================
; LOGGING
; ============================================================================
; Log file location (useful for debugging connection issues)
xdebug.log=/var/log/xdebug.log

; Log level (0-10, where 10 is most verbose)
; 0 = Criticals
; 1 = Errors
; 3 = Warnings
; 5 = Communication
; 7 = Information
; 10 = Debug
xdebug.log_level=7

; ============================================================================
; STEP DEBUGGING
; ============================================================================
; Maximum nesting level for recursive debugging
; Increase if you have deeply nested structures
xdebug.max_nesting_level=512

; ============================================================================
; COVERAGE
; ============================================================================
; Enable code coverage (required for PHPUnit coverage)
xdebug.coverage_enable=1

; ============================================================================
; DEVELOPMENT MODE
; ============================================================================
; Development helpers (when mode=develop)
; Show local variables in stack traces
xdebug.dump.GET=*
xdebug.dump.POST=*
xdebug.dump.COOKIE=*
xdebug.dump.FILES=*
xdebug.dump.SESSION=*

; ============================================================================
; PROFILING (disabled by default)
; ============================================================================
; Uncomment to enable profiling
; xdebug.profiler_enable=0
; xdebug.profiler_enable_trigger=1
; xdebug.profiler_enable_trigger_value=""
; xdebug.profiler_output_dir=/var/www/profiler
; xdebug.profiler_output_name=cachegrind.out.%p

; ============================================================================
; TRACING (disabled by default)
; ============================================================================
; Uncomment to enable function tracing
; xdebug.trace_enable_trigger=1
; xdebug.trace_enable_trigger_value=""
; xdebug.trace_output_dir=/var/www/traces
; xdebug.trace_output_name=trace.%c
; xdebug.trace_format=0
; xdebug.trace_options=0

; ============================================================================
; PERFORMANCE
; ============================================================================
; Show memory usage in stack traces
xdebug.show_mem_delta=1

; ============================================================================
; DISPLAY
; ============================================================================
; HTML error output formatting
xdebug.cli_color=1

; Variable display depth
xdebug.var_display_max_depth=10

; Maximum number of array children/object properties
xdebug.var_display_max_children=256

; Maximum string length
xdebug.var_display_max_data=4096

; ============================================================================
; USAGE TIPS
; ============================================================================
;
; Enable Xdebug:
; make xdebug-on
;
; Disable Xdebug:
; make xdebug-off
;
; Check Status:
; make xdebug-status
;
; IDE Configuration:
; PHPStorm:
; - Settings > PHP > Debug
; - Port: 9003
; - Check "Accept external connections"
; - Settings > PHP > Servers
; - Add server: localhost, port 9003
; - Map: /var/www -> your-project-path
;
; VSCode:
; - Install PHP Debug extension
; - Add to launch.json:
; {
; "name": "Listen for Xdebug",
; "type": "php",
; "request": "launch",
; "port": 9003,
; "pathMappings": {
; "/var/www": "${workspaceFolder}"
; }
; }
;
; ============================================================================
Loading
Loading