Development

#3704: 08-Inside-the-Model-Layer.patch

You must first sign up to be able to contribute.

Ticket #3704: 08-Inside-the-Model-Layer.patch

File 08-Inside-the-Model-Layer.patch, 2.0 kB (added by alexf, 7 months ago)

fix typo in propel build xml option

  • C:/TempDir/08-Inside-the-Model-Layer.txt

    old new  
    932932 
    933933Symfony can use the Creole database access layer to generate a `schema.yml` file from an existing database, thanks to introspection (the capability of databases to determine the structure of the tables on which they are operating). This can be particularly useful when you do reverse-engineering, or if you prefer working on the database before working on the object model. 
    934934 
    935935In order to do this, you need to make sure that the project `propel.ini` file points to the correct database and contains all connection settings, and then call the `propel-build-schema` command: 
    936936 
    937937    > php symfony propel:build-schema 
    938938 
    939939A brand-new `schema.yml` file built from your database structure is generated in the `config/` directory. You can build your model based on this schema. 
    940940 
    941941The schema-generation command is quite powerful and can add a lot of database-dependent information to your schema. As the YAML format doesn't handle this kind of vendor information, you need to generate an XML schema to take advantage of it. You can do this simply by adding an `xml` argument to the `build-schema` task: 
    942942 
    943     > php symfony propel:build-schema xml 
     943    > php symfony propel:build-schema --xml 
    944944 
    945945Instead of generating a `schema.yml` file, this will create a `schema.xml` file fully compatible with Propel, containing all the vendor information. But be aware that generated XML schemas tend to be quite verbose and difficult to read. 
    946946 
    947947>**SIDEBAR** 
    948948>The propel.ini configuration 
    949949> 
    950950>The `propel-build-sql` and `propel-build-schema` tasks don't use the connection settings defined in the `databases.yml` file. Rather, these tasks use the connection settings in another file, called `propel.ini` and stored in the project `config/` directory: 
    951951> 
    952952> 
    953953>      propel.database.createUrl = mysql://login:passwd@localhost 
    954954>      propel.database.url       = mysql://login:passwd@localhost/blog