https://github.com/ienaga/PhalconConfig
phalcon config loader for yaml
https://github.com/ienaga/PhalconConfig
phalcon php yaml
Last synced: about 10 hours ago
JSON representation
phalcon config loader for yaml
- Host: GitHub
- URL: https://github.com/ienaga/PhalconConfig
- Owner: ienaga
- License: mit
- Created: 2016-10-14T06:58:21.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-04-08T21:41:03.000Z (about 6 years ago)
- Last Synced: 2025-04-28T15:50:17.113Z (16 days ago)
- Topics: phalcon, php, yaml
- Language: PHP
- Size: 48.8 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-phalcon - Phalcon Config Loader for Yaml - Loads all the yml in the directory of the app/config. (Config)
README
# Phalcon Config Loarder for Yaml
[](https://travis-ci.org/ienaga/PhalconConfig)
[](https://packagist.org/packages/ienaga/phalcon-config-loader-for-yaml) [](https://packagist.org/packages/ienaga/phalcon-config-loader-for-yaml) [](https://packagist.org/packages/ienaga/phalcon-config-loader-for-yaml) [](https://packagist.org/packages/ienaga/phalcon-config-loader-for-yaml)
Loads all the `yml` in the directory of the `app/config`.
## Version
```
PHP: 7.0.x, 7.1.x, 7.2.x
Phalcon: 3.x
```## Composer
```json
{
"require": {
"ienaga/phalcon-config-loader-for-yaml": "2.*"
}
}
```## BASE_PATH and APP_PATH
```yaml
all:
application:
appDir: !app_path /
controllersDir: !app_path /controllers/
modelsDir: !app_path /models/
migrationsDir: !app_path /migrations/
viewsDir: !app_path /views/
pluginsDir: !app_path /plugins/
libraryDir: !app_path /library/
cacheDir: !base_path /cache/
baseUri: /project_name/dev:
image: "https://dev.example.com"
stg:
image: "https://stgexample.com"
prd:
image: "https://example.com"
test:
image: "https://test.example.com"
local:
image: "https://local.example.com"
```## app/config/config.php
```php
$loader = new Phalcon\Config\Adapter\Yaml\Loader();
return $loader
->setIgnore(["routing"]) // ignore yml names
->setEnvironment("stg") // default dev
->setBasePath(realpath(dirname(__FILE__) . "/../.."))
->load();
```