Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Zend Config Laravel Package

zendframework/zend-config

zendframework/zend-config provides configuration management for PHP apps: load settings from multiple formats (PHP arrays, INI, JSON, XML, YAML), merge/override environments, and access values via a simple object/array API. Part of the Zend Framework component set.

View on GitHub
Deep Wiki
Context7

Getting Started

zend-config is a lightweight configuration management component from the legacy Zend Framework (now Laminas). Due to its archived status, it's largely superseded by modern alternatives like laminas/laminas-config or Symfony's Config component—but you may encounter it in legacy Laravel apps (especially pre-Laravel 5.8) or older codebases being migrated. Start by checking composer.json for zendframework/zend-config. The primary use case: loading config files (PHP, INI, JSON, XML, YAML via adapters) into arrays or objects for application use. Key classes include Zend\Config\Config and Zend\Config\Factory (or manual instantiation with adapters).

Implementation Patterns

  • File-based config loading: Use Zend\Config\Reader\Ini, Json, PhpArray, or Xml to parse config files into Config objects. Often wrapped in helper functions or service providers.
  • Config merging: Leverage Config’s constructor second argument ($allowModifications = true) or toArray() + array merging before reconstruction — useful for local overrides (e.g., config/local.php overriding config/app.php).
  • Environment-specific config: Merge base config with environment-specific overrides using Config::toArray() and new Config([...], true).
  • Immutability for production: Instantiate with allowModifications = false to prevent accidental runtime changes (though this requires strict separation of build-time vs runtime config).
  • Laravel integration (legacy): Some older Laravel apps manually used Zend\Config inside custom config providers or via ConfigRepository wrappers before Laravel adopted its native config system.

Gotchas and Tips

  • ⚠️ Archived and unmaintained: Avoid for new projects. Prefer laminas/laminas-config (direct fork with same namespace) or modern packages like symfony/config.
  • No native YAML support: Requires symfony/yaml as a dependency when using Yaml reader—ensure it’s available or fall back to PHP/INI/JSON.
  • Immutable by default in newer versions: Versions ≥2.5 default to immutable Config; setting allowModifications = true is needed to use offsetSet() or __set().
  • Namespace migration: If upgrading, replace Zend\Config\* with Laminas\Config\* — but this is unnecessary if staying on legacy stack.
  • Debugging tip: var_dump($config->toArray()) reveals merged values; count($config) may be misleading if keys are numeric or nested.
  • Extension point: Implement custom ReaderInterface for domain-specific formats (e.g., .envConfig) — though .env is better handled via vlucas/phpdotenv in Laravel.
  • Security: Never commit YAML/INI configs with secrets—use environment variables + a bridge to Config.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4