Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ienaga/PhalconConfig
phalcon config loader for yaml
https://github.com/ienaga/PhalconConfig
phalcon php yaml
Last synced: 3 months 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 (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-04-08T21:41:03.000Z (over 5 years ago)
- Last Synced: 2024-04-24T04:11:47.835Z (7 months ago)
- Topics: phalcon, php, yaml
- Language: PHP
- Size: 48.8 KB
- Stars: 2
- Watchers: 4
- 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
[![Build Status](https://travis-ci.org/ienaga/PhalconConfig.svg?branch=master)](https://travis-ci.org/ienaga/PhalconConfig)
[![Latest Stable Version](https://poser.pugx.org/ienaga/phalcon-config-loader-for-yaml/v/stable)](https://packagist.org/packages/ienaga/phalcon-config-loader-for-yaml) [![Total Downloads](https://poser.pugx.org/ienaga/phalcon-config-loader-for-yaml/downloads)](https://packagist.org/packages/ienaga/phalcon-config-loader-for-yaml) [![Latest Unstable Version](https://poser.pugx.org/ienaga/phalcon-config-loader-for-yaml/v/unstable)](https://packagist.org/packages/ienaga/phalcon-config-loader-for-yaml) [![License](https://poser.pugx.org/ienaga/phalcon-config-loader-for-yaml/license)](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();
```