Skip to content

Commit

Permalink
Converted to Yaml configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
ambroisemaupate committed Feb 20, 2015
1 parent 26b7061 commit df0d551
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 52 deletions.
6 changes: 3 additions & 3 deletions intro/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ and to build PHP class autolader.
composer install -n --no-dev;
Then copy `conf/config.default.json` file to `conf/config.json`.
Then copy `conf/config.default.yaml` file to `conf/config.yaml`.

.. code-block:: bash
cp conf/config.default.json conf/config.json;
cp conf/config.default.yaml conf/config.yaml;
When your virtual host is ready, just go to your website to begin with the setup assistant.

Expand All @@ -154,7 +154,7 @@ if you need to setup your website on a shared hosting plan without any SSH or Gi
If you downloaded Roadiz on the `Github release <https://github.com/roadiz/roadiz/releases>`_ page or
`directly from our website <http://www.roadiz.io>`_, you should get a bundled
Zip containing every Roadiz files and Composer dependencies. We even have generated ``.htaccess`` files
and a ``conf/config.json`` file for you.
and a ``conf/config.yaml`` file for you.

If you can unzip directly on your server, that’s cool. It will save you time,
if not, just unzip it on your desktop and upload files to your server via FTP.
Expand Down
84 changes: 39 additions & 45 deletions intro/manual_config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,20 @@
Manual configuration
====================

This section explains how main configuration file ``conf/config.json`` works as you would find
This section explains how main configuration file ``conf/config.yaml`` works as you would find
it more convenient than launching Install theme for each update.

Your ``conf/config.json`` file is built using JSON syntax. Each part match a Roadiz *service* configuration.
Your ``conf/config.yaml`` file is built using YAML syntax. Each part match a Roadiz *service* configuration.
The most important part deals with Doctrine database credentials:

.. code-block:: json
.. code-block:: yaml
"doctrine": {
"driver": "pdo_mysql",
"host": "localhost",
"user": "",
"password": "",
"dbname": ""
}
doctrine:
driver: "pdo_mysql"
host: "localhost"
user: ""
password: ""
dbname: ""
Roadiz uses *Doctrine ORM* to store your data. It will directly pass this JSON part to *Doctrine* so
you can use every available drivers and options from its documentation at
Expand All @@ -37,9 +36,9 @@ and *Twig* templates are requested from cache. It is even better if you have a *
like *APC* or *XCache* since useful data are kept in memory. This efficiency has a drawback:
you’ll need to empty caches if you make a code update or a Roadiz update.

.. code-block:: json
.. code-block:: yaml
"devMode" : true
devMode: true
Another point about devMode is that static *Routes* are compiled at each request into a plain
PHP class (``gen-src/Compiled/…``). If you disable *devMode*, Symfony router will be a lot more efficient
Expand All @@ -50,23 +49,20 @@ Solr endpoint
-------------

Roadiz can use an *Apache Solr* search-engine to index nodes-sources.
Add this to your `config.json` to link your CMS to your *Solr* server:

.. code-block:: json
"solr": {
"endpoint": {
"localhost": {
"host":"localhost",
"port":"8983",
"path":"/solr",
"core":"mycore",
"timeout":3,
"username":"",
"password":""
}
}
}
Add this to your `config.yaml` to link your CMS to your *Solr* server:

.. code-block:: yaml
solr:
endpoint:
localhost:
host: "localhost"
port: "8983"
path: "/solr"
core: "mycore"
timeout: 3
username: ""
password: ""
Roadiz CLI command can easily handle Solr index. Just type ``./bin/roadiz solr --help`` to get
more informations.
Expand All @@ -78,34 +74,32 @@ Entities paths
Roadiz uses *Doctrine* to map object entities to database tables.
In order to make Roadiz more extensible, you can add your own paths to the ``entities`` part.

.. code-block:: json
.. code-block:: yaml
"entities": [
"src/Roadiz/Core/Entities",
"src/Roadiz/Core/AbstractEntities",
"gen-src/GeneratedNodeSources"
]
entities:
- "src/Roadiz/Core/Entities"
- "src/Roadiz/Core/AbstractEntities"
- "gen-src/GeneratedNodeSources"
Swift Mailer
------------

Roadiz uses *Swift Mailer* to send emails. This awesome librairy is built to enable different
kinds of mail transports or protocols. By default, Roadiz uses your PHP ``sendmail`` configuration
but you can tell it to use another transport (such as SMTP) in your ``conf/config.json`` file.
but you can tell it to use another transport (such as SMTP) in your ``conf/config.yaml`` file.

You can use *SSL*, *TLS* or no encryption at all.

.. code-block:: json
.. code-block:: yaml
"mailer": {
"type": "smtp",
"host": "localhost",
"port": 25,
"encryption": false,
"username": "",
"password": ""
}
mailer:
type: "smtp"
host: "localhost"
port: 25
encryption: false
username: ""
password: ""
Console command
---------------
Expand Down
6 changes: 3 additions & 3 deletions intro/moving.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ From this point you can install your new webserver, as described in :ref:`Instal

Then import your dump and files into your new server.

Once you’ve imported your database, you must edit manually your `conf/config.json`,
Once you’ve imported your database, you must edit manually your `conf/config.yaml`,
you can reuse the former server’s one and adapt its database credentials.

.. warning::
**Do not perform any schema update if no *gen-src\\GeneratedNodeSources* classes is available**,
it will erase your NodesSources data as their entities files haven’t been generated yet.

When you’ve edited your ``conf/config.json`` file, regenerate your entities source files
When you’ve edited your ``conf/config.yaml`` file, regenerate your entities source files

.. code-block:: bash
Expand Down Expand Up @@ -80,7 +80,7 @@ your SFTP connection or worst, an old FTP one. Don’t panic, it will take a lit
* If you only have FTP, you must be prepared to transfer your Roadiz folder, file-by-file. Just go get a cup of coffee.
* Once everything is copied on your production server, verify than you have the same files as on your dev-server.
* Import your database dump with phpmyadmin or pgmyadmin.
* Edit your ``conf/config.json`` to match your new database credentials. Enable ``devMode`` manually.
* Edit your ``conf/config.yaml`` to match your new database credentials. Enable ``devMode`` manually.
* Verify that every sensitive folders contain an ``.htaccess`` file to deny access. Verify that root ``.htaccess`` file contains every informations to enable Apache url-rewriting.
* Try to connect to your website, if everything works disable ``devMode`` and enjoy your hard work.
* If it doesn’t work or display anything, read your PHP log file to understand where does the problem come from. It might be your database credentials or you PHP version that is too low. Check that your hoster has installed every needed PHP extensions, see :ref:`requirements`.
2 changes: 1 addition & 1 deletion themes/create_theme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ So once you duplicated and renamed *DefaultTheme* with your own sweet name, do n
methods: [GET]
* Create your own ``config.json`` file, this file is needed by Roadiz to parse correctly your theme
* Create your own theme ``config.json`` file, this file is needed by Roadiz to parse correctly your theme
when you will add it to the backoffice. If your theme does not show up, you may check this JSON file
syntax:

Expand Down

0 comments on commit df0d551

Please sign in to comment.