Code Monkey home page Code Monkey logo

doctrine-yaml-to-attributes's Introduction

Doctrine YAML converter

Doctrine's YAML mapping driver is deprecated and will be removed in Doctrine ORM 3.0. This script converts your Doctrine YAML configuration files to compatible configurations using PHP attributes.

Installation

You can simply clone this repository and run the script. This script does not have to be part of your project files.

git clone https://github.com/nicodemuz/doctrine-yaml-to-attributes.git;
cd doctrine-yaml-to-attributes;
composer install;

Sample usage

<?php

use Nicodemuz\DoctrineYamlToAttributes\Runner;

require 'vendor/autoload.php';

$runner = new Runner(
    yamlFilesDir: '/path/to/symfony/config/doctrine',
    doctrineEntityDir: '/path/to/symfony/src/Entity',
);
$runner->run();

Notes

This script was hacked together in a few hours. Use at own risk. Commit your work before executing.

The script does not support all Doctrine V3 configuration parameters. If a configuration parameter is unsupported, no changes will be executed. Please modify Runner.php file accordingly. Pull requests will be gladly accepted.

The script uses Nette PHP Code Generator to rewrite your PHP files. It will likely introduce some unwanted changes. You may wish to modify the printer code in Runner.php to match your coding standard.

Authors

doctrine-yaml-to-attributes's People

Stargazers

Nico Hiort af Ornäs avatar

Watchers

Nico Hiort af Ornäs avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.