Doctrine 1
  1. Doctrine 1
  2. DC-143

php warnings and fatal errors when "package" attribute value is without "." (file config/doctrine/schema.yml)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.0-ALPHA3
    • Fix Version/s: None
    • Component/s: Schema Files
    • Labels:
      None
    • Environment:
      Linux (Fedora 10), symfony 1.3 Beta1, php 5.2.8

      Description

      Bug N1

      When i define "package: user" (to store my Comment, Photo and etc. models in 1 directory lib/models/doctrine/user/) and run "doctrine:build-all-reload --no-confirmation" task, it creates unnecessary to me Plugin* models in plugin/ folder and task dies with fatal error:


      PHP Fatal error: Class 'PluginCommentTable' not found in /home/username/www/sfpro/dev/playground/lib/model/doctrine/user/CommentTable.class.php on line 4

      here is my schema.yml:

      schema.yml
      Comment:
        tableName: comment
        package: user
        columns:
          id:
            type: integer(4)
            primary: true
            autoincrement: true
          message: varchar(255)
      

      Bug N2

      ok, i have changed "package" value to "user.sometext" and runned "doctrine:build-all-reload --no-confirmation" task - it creates all models without errors, but does not create subfolders "user/sometext"

      here is my schema.yml

      schema.yml
      Comment:
        tableName: comment
        package: user.sometext
        package_custom_path: lib/model/doctrine/user/plugin
        columns:
          id:
            type: integer(4)
            primary: true
            autoincrement: true
          message: varchar(255)
      

      Bug N3

      my schema.yml is:

      schema.yml
      Comment:
        tableName: comment
        package: user
        package_custom_path: lib/model/doctrine/user/plugin
        columns:
          id:
            type: integer(4)
            primary: true
            autoincrement: true
          message: varchar(255)
      

      when i run symfony task "doctrine:build-all-reload --no-confirmation"

      i got php warning:


      PHP Warning: file_get_contents(/home/username/www/sfpro/dev/playground/lib/model/doctrine//base/BaseComment.class.php): failed to open stream: No such file or directory in /usr/lib/symfony/1.3-svn/lib/plugins/sfDoctrinePlugin/lib/task/sfDoctrineBuildModelTask.class.php on line 78

      warning message shows "//" where i should have "user" value

        Activity

        Hide
        Jonathan H. Wage added a comment -

        Packages should work now with Symfony 1.3 and Doctrine 1.2. Though, I would still not recommend using it since packages are for symfony plugins.

        Show
        Jonathan H. Wage added a comment - Packages should work now with Symfony 1.3 and Doctrine 1.2. Though, I would still not recommend using it since packages are for symfony plugins.
        Hide
        Ernie added a comment -

        note on "Bug N2":
        When you have the "." in the package name (i.e. "user.sometext" in this example), symfony does generate "lib/model/doctrine/packages/user/sometext" with a "PluginYourClassName" set of files in it. The "packages" folder gets generated here because symfony uses it for plugins (as Jonathan mentions in his comment.

        I would like to see that Symfony supports syntax for the products they supposedly support. IMO, if they are using doctrine, they should allow the dull syntax of doctrine, which includes packages. If that conflicts with Symfony's "plugin" format, then they should redesign the plugins. Unfortunately, we may not see that, or see a complete overhaul as they push out both Symfony2 and Doctrine2.0

        Show
        Ernie added a comment - note on "Bug N2": When you have the "." in the package name (i.e. "user.sometext" in this example), symfony does generate "lib/model/doctrine/packages/user/sometext" with a "PluginYourClassName" set of files in it. The "packages" folder gets generated here because symfony uses it for plugins (as Jonathan mentions in his comment. I would like to see that Symfony supports syntax for the products they supposedly support. IMO, if they are using doctrine, they should allow the dull syntax of doctrine, which includes packages. If that conflicts with Symfony's "plugin" format, then they should redesign the plugins. Unfortunately, we may not see that, or see a complete overhaul as they push out both Symfony2 and Doctrine2.0
        Hide
        Ernie added a comment -

        need to proof before posting, eep! "dull syntax" should say "full syntax"

        Show
        Ernie added a comment - need to proof before posting, eep! "dull syntax" should say "full syntax"

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Ilya Sabelnikov
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: