I met Yaml in Ruby on Rails config files and I really appreciated when I was first encountered the Yii's ones (With no offense sir Qiang
I don't know if it's the optimal way to do this but I crafted a solution with Symfony YAML that produces a double interface consisting:
1. A php config array to Yii
2. A yml structure to user
This is possible just by adding a php tag on the top of configuration file
<?php
Yii::import('system.vendors.SymfonyComponents.YAML.*');
list(,$caller) = debug_backtrace(false);
if($caller['file'] !== __FILE__)
return sfYaml::load(__FILE__);
?>
All the necessary files to make it happen are included here
Symfony Yaml for Yii.zip (13.64K)
Number of downloads: 32
Installation process
1.(optional)Install Symfony YAML as described here
2.Go to the folder \PHP_installation_folder\PEAR (Yes I'm on Windows) and copy the folder SymfonyComponents or take it from the attachment
3.Paste it to Yii_path\framework\vendors
4.Create a new Yii web app and copy yml attachment files to your_new_web_app\protected\config folder
For new files to get involved, these should simply be renamed as php (remove the yml extension) or, mainly for code highlight reasons, change the $config assignment adding the ".yml" extension at the end of the reference path in the following files of your_new_web_app folder
1. index.php line 5
2. index-test.php line 9
3. protected\yiic.php line 5
4. protected\tests\bootstrap.php line 5
Please read the The YAML Format, an excellent single page documentation, for further details about the topic.
I'll be happy to know your opinion about this (or my English
Happy coding!!
[CORRECTION]
In file main.php.yml and line 45 please replace db file name testdrive1.db with testdrive.db (remove the '1')

Help














