Skip to content
This repository
Browse code

Merge pull request #54 from willdurand/sfPropelORMPlugin

sfPropelORMPlugin : here we go !
  • Loading branch information...
commit d5a3a8701a6d7b5988ae52740492d260b4f65a73 2 parents 28d5893 + 4878b50
William Durand willdurand authored

Showing 42 changed files with 228 additions and 220 deletions. Show diff stats Hide diff stats

  1. +6 1 .gitignore
  2. +6 0 .gitmodules
  3. +0 42 INSTALL.md
  4. +151 123 README.md
  5. +1 1  config/autoload.yml
  6. +1 1  config/installer.php
  7. +5 4 config/{sfPropel15PluginConfiguration.class.php → sfPropelORMPluginConfiguration.class.php}
  8. +6 6 config/skeleton/config/propel.ini
  9. +1 1  data/generator/sfPropelModule/admin/template/templates/_assets.php
  10. +1 1  data/generator/sfPropelModule/admin15/template/templates/_assets.php
  11. +2 2 doc/admin_generator.md
  12. +1 1  doc/database.md
  13. +3 3 doc/form.md
  14. +1 1  doc/schema.md
  15. +1 1  i18n/sf_admin.es.xml
  16. +1 1  i18n/sf_admin.es_AR.xml
  17. +1 1  i18n/sf_admin.hu.xml
  18. +1 1  i18n/sf_admin.uk.xml
  19. +1 1  lib/behavior/SfPropelBehaviorBase.php
  20. +1 1  lib/behavior/SfPropelBehaviorI18n.php
  21. +1 1  lib/form/sfFormPropelCollection.class.php
  22. 0  lib/routing/{sfPropel15Route.class.php → sfPropelORMRoute.class.php}
  23. 0  lib/routing/{sfPropel15RouteCollection.class.php → sfPropelORMRouteCollection.class.php}
  24. +1 1  lib/task/phing/tasks/defaults.properties
  25. +1 1  lib/task/phing/types/defaults.properties
  26. +5 5 lib/task/sfPropelBaseTask.class.php
  27. +5 5 lib/task/sfPropelDiffTask.class.php
  28. +1 1  lib/task/sfPropelMigrateDownTask.class.php
  29. +1 1  lib/task/sfPropelMigrateTask.class.php
  30. +1 1  lib/task/sfPropelMigrateUpTask.class.php
  31. +2 2 lib/task/sfPropelStatusTask.class.php
  32. 0  lib/validator/sfValidatorSchemaRemove.php
  33. +1 0  lib/vendor/phing
  34. +1 0  lib/vendor/propel
  35. +1 1  lib/widget/sfWidgetFormDelete.class.php
  36. 0  lib/widget/sfWidgetFormPlain.php
  37. +7 0 test/bootstrap/functional.php
  38. +1 1  test/bootstrap/unit.php
  39. +1 1  test/functional/crud/crudBrowser.class.php
  40. +2 1  test/functional/fixtures/config/ProjectConfiguration.class.php
  41. +5 5 test/functional/fixtures/config/propel.ini
  42. 0  test/functional/fixtures/symfony
7 .gitignore
... ... @@ -1 +1,6 @@
1   -lib/vendor/*
  1 +test/functional/fixtures/data/database.sqlite
  2 +test/functional/fixtures/data/sql/
  3 +test/functional/fixtures/lib/form/base/
  4 +test/functional/fixtures/lib/model/map/
  5 +test/functional/fixtures/lib/model/om/
  6 +
6 .gitmodules
... ... @@ -0,0 +1,6 @@
  1 +[submodule "lib/vendor/propel"]
  2 + path = lib/vendor/propel
  3 + url = git://github.com/propelorm/Propel.git
  4 +[submodule "lib/vendor/phing"]
  5 + path = lib/vendor/phing
  6 + url = git://github.com/Xosofox/phing.git
42 INSTALL.md
Source Rendered
... ... @@ -1,42 +0,0 @@
1   -# Installing sfPropel15Plugin With Propel 1.6
2   -
3   -This version of sfPropelPlugin doesn't come bundled with the required dependencies. To install the plugin on a symfony application, follow these steps:
4   -
5   - > cd plugins/
6   - > git clone git://github.com/fzaninotto/sfPropel15Plugin.git -b 1.6
7   - > cd sfPropel15Plugin/
8   - > cd lib/
9   - > mkdir vendor
10   - > cd vendor/
11   - > svn checkout http://phing.mirror.svn.symfony-project.com/tags/2.3.3/classes/phing phing
12   - > svn checkout http://svn.propelorm.org/branches/1.6/runtime/lib propel
13   - > svn checkout http://svn.propelorm.org/branches/1.6/generator propel-generator
14   - > cd ../../..
15   -
16   -Now the classic install continues.
17   -
18   -Right after the installation of the plugin, you should update plugin assets:
19   -
20   - > ./symfony plugin:publish-assets
21   -
22   -Disable the core Propel plugin and enable the `sfPropel15Plugin` instead:
23   -
24   - [php]
25   - class ProjectConfiguration extends sfProjectConfiguration
26   - {
27   - public function setup()
28   - {
29   - $this->enablePlugins('sfPropel15Plugin');
30   - }
31   - }
32   -
33   -Change the path of the symfony behaviors in the `config/propel.ini` file of your project:
34   -
35   - [ini]
36   - propel.behavior.symfony.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorSymfony
37   - propel.behavior.symfony_i18n.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorI18n
38   - propel.behavior.symfony_i18n_translation.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorI18nTranslation
39   - propel.behavior.symfony_behaviors.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorSymfonyBehaviors
40   - propel.behavior.symfony_timestampable.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorTimestampable
41   -
42   -You're done.
274 README.md 100755 → 100644
Source Rendered
... ... @@ -1,103 +1,129 @@
1   -sfPropel15Plugin
2   -================
  1 +sfPropelORMPlugin
  2 +=================
3 3
4   -Replaces symfony's core Propel plugin by the latest version of Propel, in branch 1.5.
  4 +Replaces symfony's core Propel plugin by the latest version of Propel, in branch 1.6.
5 5
6   -Installation
7   -------------
  6 +## Installation
  7 +
  8 +### The Git way
  9 +
  10 +Clone the plugin from Github:
  11 +
  12 + git clone git://github.com/propelorm/sfPropelORMPlugin.git plugins/sfPropelORMPlugin
  13 + cd plugins/sfPropelORMPlugin
  14 + git submodule init --update
  15 +
  16 +If you use Git as a VCS for your project, it should be better to add the plugin as a submodule:
  17 +
  18 + git submodule add git://github.com/propelorm/sfPropelORMPlugin.git plugins/sfPropelORMPlugin
  19 + git submodule init --update --recursive
  20 +
  21 +As both Phing and Propel libraries are bundled with the plugin, you have to initialize submodules for the plugin.
  22 +
  23 +### The SVN way
8 24
9 25 Install the plugin via the subversion repository:
10 26
11   - > svn co http://svn.symfony-project.com/plugins/sfPropel15Plugin/trunk plugins/sfPropel15Plugin
  27 + svn checkout http://svn.github.com/propelorm/sfPropelORMPlugin.git plugins/sfPropelORMPlugin
12 28
13   -from the project root directory or by using the command:
  29 +Install `Phing` and `Propel`:
14 30
15   - > ./symfony plugin:install sfPropel15Plugin
  31 + cd plugins/sfPropelORMPlugin/lib/vendor
  32 + svn checkout http://phing.mirror.svn.symfony-project.com/tags/2.3.3/classes/phing phing
  33 + svn checkout http://svn.github.com/propelorm/Propel.git propel
16 34
17   -Right after the installation of the plugin, you should update plugin assets:
  35 +### Final step
18 36
19   - > ./symfony plugin:publish-assets
  37 +Disable the core Propel plugin and enable the `sfPropelORMPlugin` instead:
20 38
21   -Disable the core Propel plugin and enable the `sfPropel15Plugin` instead:
  39 +``` php
  40 +// config/ProjectConfiguration.class.php
22 41
23   - [php]
24   - class ProjectConfiguration extends sfProjectConfiguration
25   - {
26   - public function setup()
27   - {
28   - $this->enablePlugins('sfPropel15Plugin');
29   - }
30   - }
  42 +class ProjectConfiguration extends sfProjectConfiguration
  43 +{
  44 + public function setup()
  45 + {
  46 + $this->enablePlugins('sfPropelORMPlugin');
  47 + }
  48 +}
  49 +```
  50 +
  51 +Right after the installation of the plugin, you should update plugin assets:
  52 +
  53 + php symfony plugin:publish-assets
31 54
32 55 Change the path of the symfony behaviors in the `config/propel.ini` file of your project:
33 56
34   - [ini]
35   - propel.behavior.symfony.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorSymfony
36   - propel.behavior.symfony_i18n.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorI18n
37   - propel.behavior.symfony_i18n_translation.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorI18nTranslation
38   - propel.behavior.symfony_behaviors.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorSymfonyBehaviors
39   - propel.behavior.symfony_timestampable.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorTimestampable
  57 +``` ini
  58 +// config/propel.ini
  59 +
  60 +propel.behavior.symfony.class = plugins.sfPropelORMPlugin.lib.behavior.SfPropelBehaviorSymfony
  61 +propel.behavior.symfony_i18n.class = plugins.sfPropelORMPlugin.lib.behavior.SfPropelBehaviorI18n
  62 +propel.behavior.symfony_i18n_translation.class = plugins.sfPropelORMPlugin.lib.behavior.SfPropelBehaviorI18nTranslation
  63 +propel.behavior.symfony_behaviors.class = plugins.sfPropelORMPlugin.lib.behavior.SfPropelBehaviorSymfonyBehaviors
  64 +propel.behavior.symfony_timestampable.class = plugins.sfPropelORMPlugin.lib.behavior.SfPropelBehaviorTimestampable
  65 +```
40 66
41 67 (Re)Build the model:
42 68
43   - > ./symfony propel:build --all-classes
  69 + php symfony propel:build --all-classes
  70 +
44 71
45   -What's New In Propel 1.5
46   -------------------------
  72 +## What's New In Propel 1.6
47 73
48   -Propel 1.5 is a **backwards compatible** evolution of Propel 1.4 (the version bundled with symfony 1.3 and 1.4), which adds some very interesting features. Among these features, you will find the **new Propel Query API**, which is essentially a Criteria on steroids:
  74 +Propel 1.6 is a **backwards compatible** evolution of Propel 1.4 (the version bundled with symfony 1.3 and 1.4), which adds some very interesting features. Among these features, you will find the **new Propel Query API**, which is essentially a Criteria on steroids:
49 75
50   - [php]
51   - // find the 10 latest books published by authror 'Leo'
52   - $books = BookQuery::create()
53   - ->useAuthorQuery()
54   - ->filterByFirstName('Leo')
55   - ->endUse()
56   - ->orderByPublishedAt('desc')
57   - ->limit(10)
58   - ->find($con);
  76 +``` php
  77 +// find the 10 latest books published by authror 'Leo'
  78 +$books = BookQuery::create()
  79 + ->useAuthorQuery()
  80 + ->filterByFirstName('Leo')
  81 + ->endUse()
  82 + ->orderByPublishedAt('desc')
  83 + ->limit(10)
  84 + ->find($con);
  85 +```
59 86
60   -Propel 1.5 also supports **many-to-many relationships**, **collections**, **on-demand hydration**, **new core behaviors** (see below), better Oracle support, and is now licensed under the MIT license.
  87 +Propel 1.6 also supports **many-to-many relationships**, **collections**, **on-demand hydration**, **new core behaviors** (see below), better Oracle support, and is now licensed under the MIT license.
61 88
62   -Check out the [WHATS_NEW](http://propel.phpdb.org/trac/wiki/Users/Documentation/1.5/WhatsNew) page in the Propel trac to see the full list of changes.
63 89
64   -Core Propel Behaviors
65   ----------------------
  90 +## Core Propel Behaviors
66 91
67   -Propel 1.5 bundles most common behaviors in a new, robust buildtime implementation. These core behaviors provide faster runtime execution and the ability to modify the data model:
  92 +Propel 1.6 bundles most common behaviors in a new, robust buildtime implementation. These core behaviors provide faster runtime execution and the ability to modify the data model:
68 93
69   -- [timestampable](http://www.propelorm.org/wiki/Documentation/1.5/Behaviors/timestampable)
70   -- [sluggable](http://www.propelorm.org/wiki/Documentation/1.5/Behaviors/sluggable)
71   -- [soft_delete]([http://www.propelorm.org/wiki/Documentation/1.5/Behaviors/soft_delete)
72   -- [nested_set](http://www.propelorm.org/wiki/Documentation/1.5/Behaviors/nested_set)
73   -- [sortable](http://www.propelorm.org/wiki/Documentation/1.5/Behaviors/sortable)
74   -- [concrete_inheritance](http://www.propelorm.org/wiki/Documentation/1.5/Inheritance#ConcreteTableInheritance)
75   -- [query_cache](http://www.propelorm.org/wiki/Documentation/1.5/Behaviors/query_cache)
76   -- [alternative_coding_standards](http://www.propelorm.org/xiki/Documentation/1.5/Behaviors/alternative_coding_standards)
77   -- [auto_add_pk](http://www.propelorm.org/wiki/Documentation/1.5/Behaviors/auto_add_pk)
  94 +- [timestampable](http://www.propelorm.org/wiki/Documentation/1.6/Behaviors/timestampable)
  95 +- [sluggable](http://www.propelorm.org/wiki/Documentation/1.6/Behaviors/sluggable)
  96 +- [soft_delete]([http://www.propelorm.org/wiki/Documentation/1.6/Behaviors/soft_delete)
  97 +- [nested_set](http://www.propelorm.org/wiki/Documentation/1.6/Behaviors/nested_set)
  98 +- [sortable](http://www.propelorm.org/wiki/Documentation/1.6/Behaviors/sortable)
  99 +- [concrete_inheritance](http://www.propelorm.org/wiki/Documentation/1.6/Inheritance#ConcreteTableInheritance)
  100 +- [query_cache](http://www.propelorm.org/wiki/Documentation/1.6/Behaviors/query_cache)
  101 +- [alternative_coding_standards](http://www.propelorm.org/xiki/Documentation/1.6/Behaviors/alternative_coding_standards)
  102 +- [auto_add_pk](http://www.propelorm.org/wiki/Documentation/1.6/Behaviors/auto_add_pk)
78 103
79   -`sfPropel15Plugin` allows you to register core propel behaviors right from your `schema.yml`. For instance, to create a tree structure from a `Section` model:
  104 +`sfPropelORMPlugin` allows you to register core propel behaviors right from your `schema.yml`. For instance, to create a tree structure from a `Section` model:
80 105
81   - [yaml]
82   - propel:
83   - section:
84   - _attributes: { phpName: Section }
85   - _propel_behaviors:
86   - - nested_set
87   - id: ~
88   - title: { type: varchar(100), required: true primaryString: true }
  106 +``` yaml
  107 +propel:
  108 + section:
  109 + _attributes: { phpName: Section }
  110 + _propel_behaviors:
  111 + - nested_set
  112 + id: ~
  113 + title: { type: varchar(100), required: true primaryString: true }
  114 +```
89 115
90   -**Tip**: Check the [`doc/schema.txt`](http://trac.symfony-project.org/browser/plugins/sfPropel15Plugin/trunk/doc/schema.txt) file in this plugin source code for a complete reference of the YAML schema format.
  116 +**Tip**: Check the [`doc/schema.md`](https://raw.github.com/propelorm/sfPropelORMPlugin/master/doc/schema.md) file in this plugin source code for a complete reference of the YAML schema format.
91 117
92   -You can also register a behavior for all your models right in the `propel.ini` configuration file. `sfPropel15Plugin` already enables the `symfony` and `symfony_i18n` behaviors to support symfony's behavior system and model localization features, but you can easily add your owns:
  118 +You can also register a behavior for all your models right in the `propel.ini` configuration file. `sfPropelORMPlugin` already enables the `symfony` and `symfony_i18n` behaviors to support symfony's behavior system and model localization features, but you can easily add your owns:
93 119
94   - [ini]
95   - propel.behavior.default = symfony,symfony_i18n,alternative_coding_standards,auto_add_pk
  120 +``` ini
  121 +propel.behavior.default = symfony,symfony_i18n,alternative_coding_standards,auto_add_pk
  122 +```
96 123
97   -Admin Generator Extensions
98   ---------------------------
  124 +## Admin Generator Extensions
99 125
100   -The plugin comes bundled with a new admin generator theme named 'admin15'. This theme is backwards compatible with sfPropelPlugin's admin generator theme, and provides additional features based on the new Propel 1.5 query objects:
  126 +The plugin comes bundled with a new admin generator theme named 'admin15'. This theme is backwards compatible with sfPropelPlugin's admin generator theme, and provides additional features based on the new Propel 1.6 query objects:
101 127
102 128 ### List view enhancements
103 129
@@ -113,68 +139,70 @@ The plugin comes bundled with a new admin generator theme named 'admin15'. This
113 139 - **YAML widget customization**: The `generator.yml` format was extended to allow widget and validator customization directly in YAML, without the need to edit a form object. You can also safely omit a field from a `display` list in a form definition, without any risk to loose data.
114 140 - **Plain text field**: If you want to display some data in a form without allowing the user to edit it, use the `type: plain` attribute, just like in the old days of symfony 1.2. This is very useful for columns managed by the model, like `created_at` and `updated_at` columns.
115 141
116   -The new options for the `admin15` generator theme are fully documented, and illustrated by real life examples, in the [`doc/admin_generator.txt`](http://trac.symfony-project.org/browser/plugins/sfPropel15Plugin/trunk/doc/admin_generator.txt) file in this plugin source code.
  142 +The new options for the `admin15` generator theme are fully documented, and illustrated by real life examples, in the [`doc/admin_generator.md`](https://raw.github.com/propelorm/sfPropelORMPlugin/master/doc/admin_generator.md) file in this plugin source code.
117 143
118   -Form Subframework Modifications
119   --------------------------------
  144 +## Form Subframework Modifications
120 145
121 146 - **Updated `sfWidgetFormPropelChoice` widget**: The widget now uses the new Query API. You can customize the list of choices more easily by executing custom query methods, using the new `query_methods` option.
122 147 - **Updated Propel validators**: Both the `sfValidatorPropelChoice` and the `sfValidatorPropelUnique` were updated to use the new PropelQuery objects, and to accept a `query_methods` option similar to the one of `sfWidgetFormPropelChoice`.
123 148 - **Plain text widget and validator**: This new widget allows a field to be displayed in a form, without letting the use change it.
124 149 - **Easy Relation Embed**: Editing related objects together with the main objects (e.g., editing `Comments` in a `Post` form) is a piece of cake. The new `sfFormPropel::embedRelation()` method does all the work to fetch related objects, build the forms for each of them, and embed the related object forms into the main form. Embdeded relation forms allow to **edit**, **add**, and **delete** a related objects with no additional code.
125 150
126   - [php]
127   - class ArticleForm extends BaseArticleForm
128   - {
129   - public function configure()
130   - {
131   - $this->embedRelation('Book');
132   - }
133   - }
134   -
135   -The Propel widgets, validators, and form classes are fully documented in the [`doc/form.txt`](http://trac.symfony-project.org/browser/plugins/sfPropel15Plugin/trunk/doc/form.txt) file in this plugin source code.
136   -
137   -Routing Modifications
138   ----------------------
139   -
140   -The plugin offer two new routing classes, `sfPropel15Route` and `sfPropel15RouteCollection`. These classes are used by default in the models build with the propel admin generator. They behave just like the previous `sfPropelRoute` class - except they don't use the `methods` option anymore. Instead, use the `query_methods` option to execute a list of arbitrary query methods when calling `getObject()` and `getObjects()`.
141   -
142   - [yaml]
143   - author:
144   - class: sfPropel15RouteCollection
145   - options:
146   - model: author
147   - module: author
148   - prefix_path: /author
149   - column: id
150   - query_methods:
151   - object: [filterByIsPublished]
152   - list: [filterByIsPublished, orderByLastName]
153   - with_wildcard_routes: true
  151 +``` php
  152 +class ArticleForm extends BaseArticleForm
  153 +{
  154 + public function configure()
  155 + {
  156 + $this->embedRelation('Book');
  157 + }
  158 +}
  159 +```
  160 +
  161 +The Propel widgets, validators, and form classes are fully documented in the [`doc/form.md`](https://raw.github.com/propelorm/sfPropelORMPlugin/master/doc/form.md) file in this plugin source code.
  162 +
  163 +## Routing Modifications
  164 +
  165 +The plugin offer two new routing classes, `sfPropelORMRoute` and `sfPropelORMRouteCollection`. These classes are used by default in the models build with the propel admin generator. They behave just like the previous `sfPropelRoute` class - except they don't use the `methods` option anymore. Instead, use the `query_methods` option to execute a list of arbitrary query methods when calling `getObject()` and `getObjects()`.
  166 +
  167 +``` yaml
  168 +author:
  169 + class: sfPropelORMRouteCollection
  170 + options:
  171 + model: author
  172 + module: author
  173 + prefix_path: /author
  174 + column: id
  175 + query_methods:
  176 + object: [filterByIsPublished]
  177 + list: [filterByIsPublished, orderByLastName]
  178 + with_wildcard_routes: true
  179 +```
154 180
155 181 Array of additional parameters are also possible for `query_methods`:
156 182
157   - [yaml]
158   - author:
159   - class: sfPropel15RouteCollection
160   - options:
161   - model: author
162   - module: author
163   - prefix_path: /author
164   - column: id
165   - query_methods:
166   - object:
167   - filterByIsPublished: [false]
168   - list:
169   - filterByIsPublished: []
170   - orderBy: [LastName]
171   - with_wildcard_routes: true
172   -
173   -`sfPropel15Route` also makes your code a little easier to read in the action. Instead of calling `getObject()`, you can actually call a getter using the class name of the object's route:
174   -
175   - [php]
176   - public function executeShow(sfWebRequest $request)
177   - {
178   - // using sfPropel15Route with 'Author' as model
179   - $this->author = $this->getRoute()->getAuthor();
180   - }
  183 +``` yaml
  184 +author:
  185 + class: sfPropelORMRouteCollection
  186 + options:
  187 + model: author
  188 + module: author
  189 + prefix_path: /author
  190 + column: id
  191 + query_methods:
  192 + object:
  193 + filterByIsPublished: [false]
  194 + list:
  195 + filterByIsPublished: []
  196 + orderBy: [LastName]
  197 + with_wildcard_routes: true
  198 +```
  199 +
  200 +`sfPropelORMRoute` also makes your code a little easier to read in the action. Instead of calling `getObject()`, you can actually call a getter using the class name of the object's route:
  201 +
  202 +``` php
  203 +public function executeShow(sfWebRequest $request)
  204 +{
  205 + // using sfPropelORMRoute with 'Author' as model
  206 + $this->author = $this->getRoute()->getAuthor();
  207 +}
  208 +```
2  config/autoload.yml
... ... @@ -1,5 +1,5 @@
1 1 autoload:
2   - sfPropel15Plugin_lib:
  2 + sfPropelORMPlugin_lib:
3 3 name: propel addon
4 4 path: <?php echo realpath(dirname(__FILE__).'/../lib')."\n" ?>
5 5 recursive: true
2  config/installer.php
... ... @@ -1,5 +1,5 @@
1 1 <?php
2 2
3 3 $this->installDir(dirname(__FILE__).'/skeleton');
4   -$this->enablePlugin('sfPropel15Plugin');
  4 +$this->enablePlugin('sfPropelORMPlugin');
5 5 $this->reloadTasks();
9 config/sfPropel15PluginConfiguration.class.php → config/sfPropelORMPluginConfiguration.class.php
@@ -8,7 +8,7 @@
8 8 * @author Fabien Potencier <fabien.potencier@symfony-project.com>
9 9 * @version SVN: $Id: sfPropelPluginConfiguration.class.php 23739 2009-11-09 23:32:46Z Kris.Wallsmith $
10 10 */
11   -class sfPropel15PluginConfiguration extends sfPluginConfiguration
  11 +class sfPropelORMPluginConfiguration extends sfPluginConfiguration
12 12 {
13 13 /**
14 14 * @see sfPluginConfiguration
@@ -18,15 +18,16 @@ public function initialize()
18 18 sfConfig::set('sf_orm', 'propel');
19 19 if (!sfConfig::get('sf_admin_module_web_dir'))
20 20 {
21   - sfConfig::set('sf_admin_module_web_dir', '/sfPropel15Plugin');
  21 + sfConfig::set('sf_admin_module_web_dir', '/sfPropelORMPlugin');
22 22 }
23 23
24 24 sfToolkit::addIncludePath(array(
25 25 sfConfig::get('sf_root_dir'),
26   - sfConfig::get('sf_propel_runtime_path', realpath(dirname(__FILE__).'/../lib/vendor')),
  26 + sfConfig::get('sf_phing_path', realpath(dirname(__FILE__).'/../lib/vendor/phing/classes')),
  27 + sfConfig::get('sf_propel_runtime_path', realpath(dirname(__FILE__).'/../lib/vendor/propel/runtime/lib')),
27 28 ));
28 29
29   - require_once 'propel/Propel.php';
  30 + require_once 'Propel.php';
30 31
31 32 if (!Propel::isInit())
32 33 {
12 config/skeleton/config/propel.ini
@@ -47,11 +47,11 @@ propel.builder.addBehaviors = true
47 47
48 48 ; behaviors
49 49 propel.behavior.default = symfony,symfony_i18n
50   -propel.behavior.symfony.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorSymfony
51   -propel.behavior.symfony_i18n.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorI18n
52   -propel.behavior.symfony_i18n_translation.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorI18nTranslation
53   -propel.behavior.symfony_behaviors.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorSymfonyBehaviors
54   -propel.behavior.symfony_timestampable.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorTimestampable
  50 +propel.behavior.symfony.class = plugins.sfPropelORMPlugin.lib.behavior.SfPropelBehaviorSymfony
  51 +propel.behavior.symfony_i18n.class = plugins.sfPropelORMPlugin.lib.behavior.SfPropelBehaviorI18n
  52 +propel.behavior.symfony_i18n_translation.class = plugins.sfPropelORMPlugin.lib.behavior.SfPropelBehaviorI18nTranslation
  53 +propel.behavior.symfony_behaviors.class = plugins.sfPropelORMPlugin.lib.behavior.SfPropelBehaviorSymfonyBehaviors
  54 +propel.behavior.symfony_timestampable.class = plugins.sfPropelORMPlugin.lib.behavior.SfPropelBehaviorTimestampable
55 55 propel.behavior.timestampable.class = behavior.TimestampableBehavior
56 56 propel.behavior.alternative_coding_standards.class = behavior.AlternativeCodingStandardsBehavior
57 57 propel.behavior.soft_delete.class = behavior.SoftDeleteBehavior
@@ -63,4 +63,4 @@ propel.behavior.concrete_inheritance.class = behavior.concrete_inheritance.C
63 63 propel.behavior.query_cache.class = behavior.query_cache.QueryCacheBehavior
64 64 propel.behavior.aggregate_column.class = behavior.aggregate_column.AggregateColumnBehavior
65 65 propel.behavior.versionable.class = behavior.versionable.VersionableBehavior
66   -propel.behavior.i18n.class = behavior.i18n.I18nBehavior
  66 +propel.behavior.i18n.class = behavior.i18n.I18nBehavior
2  data/generator/sfPropelModule/admin/template/templates/_assets.php
@@ -3,4 +3,4 @@
3 3 <?php elseif(!isset($this->params['css'])): ?>
4 4 [?php use_stylesheet('<?php echo sfConfig::get('sf_admin_module_web_dir').'/css/global.css' ?>', 'first') ?]
5 5 [?php use_stylesheet('<?php echo sfConfig::get('sf_admin_module_web_dir').'/css/default.css' ?>', 'first') ?]
6   -<?php endif; ?>
  6 +<?php endif; ?>
2  data/generator/sfPropelModule/admin15/template/templates/_assets.php
@@ -3,4 +3,4 @@
3 3 <?php elseif(!isset($this->params['css'])): ?>
4 4 [?php use_stylesheet('<?php echo sfConfig::get('sf_admin_module_web_dir').'/css/global.css' ?>', 'first') ?]
5 5 [?php use_stylesheet('<?php echo sfConfig::get('sf_admin_module_web_dir').'/css/default.css' ?>', 'first') ?]
6   -<?php endif; ?>
  6 +<?php endif; ?>
4 doc/admin_generator.md 100755 → 100644
Source Rendered
... ... @@ -1,7 +1,7 @@
1 1 Admin Generator Extensions
2 2 ==========================
3 3
4   -sfPropel15Plugin comes bundled with a new admin generator theme named 'admin15'. This theme provides additional features based on the new Propel 1.5 query objects, and is backwards compatible with sfPropelPlugin's admin generator theme.
  4 +sfPropelORMPlugin comes bundled with a new admin generator theme named 'admin15'. This theme provides additional features based on the new Propel 1.5 query objects, and is backwards compatible with sfPropelPlugin's admin generator theme.
5 5
6 6 To enable this theme, edit your `generator.yml` and change the `theme` property from `admin` to `admin15`, as follows:
7 7
@@ -279,4 +279,4 @@ If you want to display some data in a form without allowing the user to edit it,
279 279 created_at: { type: plain }
280 280 updated_at: { type: plain }
281 281
282   -This displays the field in the edit view, but not in a form input. Submitting the form will leave these fields unchanged - or, in the previous example, will let the model take care of their values.
  282 +This displays the field in the edit view, but not in a form input. Submitting the form will leave these fields unchanged - or, in the previous example, will let the model take care of their values.
2  doc/database.md
Source Rendered
@@ -35,4 +35,4 @@ Symfony is to specify slave servers for each connection in config/databases.yml
35 35 The slave connections will be with the same settings (encoding, persustent, pooling, etc) as
36 36 the master connection to ensure the same behavior for all.
37 37
38   -- [Master-Slave](http://www.propelorm.org/wiki/Documentation/1.5/Master-Slave): Please read more details on Master-Slave in Propel 1.5
  38 +- [Master-Slave](http://www.propelorm.org/wiki/Documentation/1.5/Master-Slave): Please read more details on Master-Slave in Propel 1.5
6 doc/form.md 100755 → 100644
Source Rendered
... ... @@ -1,12 +1,12 @@
1 1 Form Extensions
2 2 ===============
3 3
4   -The `sfPropel15Plugin` provides two widgets and three validators, to help build and validate forms bound to a Model object.
  4 +The `sfPropelORMPlugin` provides two widgets and three validators, to help build and validate forms bound to a Model object.
5 5
6 6 `sfWidgetPropelChoice` and `sfValidatorPropelChoice`
7 7 ----------------------------------------------------
8 8
9   -Editing a foreign key columns is often a matter of choosing the related object to relate. For instance, editing the `author_id` field of an `Article` model means choosing an element in the list of existing Authors. `sfPropel15Plugin` provides an extension of the `sfWidgetFormChoice` class that takes care of populating the list of options based on a related table. It is called `sfWidgetPropelChoice`, and is associated witha validator called `sfValidatorPropelChoice`.
  9 +Editing a foreign key columns is often a matter of choosing the related object to relate. For instance, editing the `author_id` field of an `Article` model means choosing an element in the list of existing Authors. `sfPropelORMPlugin` provides an extension of the `sfWidgetFormChoice` class that takes care of populating the list of options based on a related table. It is called `sfWidgetPropelChoice`, and is associated witha validator called `sfValidatorPropelChoice`.
10 10
11 11 ### Generated Configuration
12 12
@@ -270,4 +270,4 @@ If `add_delete` is set to `true`, the following additional options are available
270 270 * `delete_widget`: Optional delete widget object. If left null, uses a `sfWidgetFormDelete` instance, which is a checkbox widget with a Javascript confirmation.
271 271 * `alert_text`: The text of the Javascript alert to show.
272 272 * `hide_parent`: Whether to hide the deleted form when clicking the checkbox. Defaults to true.
273   -* `parent_level`: The number of times parentNode must be called to reach the parent to hide. As a widget doesn't know if it's merged or embedded, this setting allows the JavaScript code used to hide the parent to find it. Recommended values: 6 for embedded form (default), 7 for merged form.
  273 +* `parent_level`: The number of times parentNode must be called to reach the parent to hide. As a widget doesn't know if it's merged or embedded, this setting allows the JavaScript code used to hide the parent to find it. Recommended values: 6 for embedded form (default), 7 for merged form.
2  doc/schema.md 100755 → 100644
Source Rendered
@@ -308,7 +308,7 @@ You can register more than one behavior and set the parameters of each behaviors
308 308 sluggable:
309 309 timestampable:
310 310
311   -You can also register a behavior for all your models right in the `propel.ini`. `sfPropel15Plugin` already enables the `symfony` and `symfony_i18n` behaviors to support symfony's behavior system and model localization features, but you can easily add your owns:
  311 +You can also register a behavior for all your models right in the `propel.ini`. `sfPropelORMPlugin` already enables the `symfony` and `symfony_i18n` behaviors to support symfony's behavior system and model localization features, but you can easily add your owns:
312 312
313 313 [ini]
314 314 propel.behavior.default = symfony,symfony_i18n,alternative_coding_standards,auto_add_pk
2  i18n/sf_admin.es.xml
@@ -167,4 +167,4 @@
167 167 </trans-unit>
168 168 </body>
169 169 </file>
170   -</xliff>
  170 +</xliff>
2  i18n/sf_admin.es_AR.xml
@@ -111,4 +111,4 @@
111 111 </trans-unit>
112 112 </body>
113 113 </file>
114   -</xliff>
  114 +</xliff>
2  i18n/sf_admin.hu.xml
@@ -131,4 +131,4 @@
131 131 </trans-unit>
132 132 </body>
133 133 </file>
134   -</xliff>
  134 +</xliff>
2  i18n/sf_admin.uk.xml
@@ -131,4 +131,4 @@
131 131 </trans-unit>
132 132 </body>
133 133 </file>
134   -</xliff>
  134 +</xliff>
2  lib/behavior/SfPropelBehaviorBase.php
@@ -8,7 +8,7 @@
8 8 * file that was distributed with this source code.
9 9 */
10 10
11   -require_once 'propel-generator/lib/model/Behavior.php';
  11 +require_once 'propel/generator/lib/model/Behavior.php';
12 12
13 13 /**
14 14 * Base behavior class.
2  lib/behavior/SfPropelBehaviorI18n.php
@@ -8,7 +8,7 @@
8 8 * file that was distributed with this source code.
9 9 */
10 10
11   -require_once dirname(__FILE__) . '/../vendor/propel-generator/lib/util/PropelPHPParser.php';
  11 +require_once dirname(__FILE__) . '/../vendor/propel/generator/lib/util/PropelPHPParser.php';
12 12
13 13 /**
14 14 * Internationalizes Propel models.
2  lib/form/sfFormPropelCollection.class.php
@@ -187,4 +187,4 @@ public function embedOptionalForm($name, sfForm $form, $decorator = null, $optio
187 187
188 188 $this->resetFormFields();
189 189 }
190   -}
  190 +}
0  lib/routing/sfPropel15Route.class.php → lib/routing/sfPropelORMRoute.class.php 100755 → 100644
File renamed without changes
0  lib/routing/sfPropel15RouteCollection.class.php → lib/routing/sfPropelORMRouteCollection.class.php 100755 → 100644
File renamed without changes
2  lib/task/phing/tasks/defaults.properties
@@ -83,4 +83,4 @@ phpdocext=phing.tasks.ext.phpdoc.PhpDocumentorExternalTask
83 83 ;jsllint=phing.tasks.ext.JslLintTask
84 84 ;manifest=phing.tasks.ext.ManifestTask
85 85 ;phpcodesniffer=phing.tasks.ext.PhpCodeSnifferTask
86   -;ftpdeploy=phing.tasks.ext.FtpDeployTask
  86 +;ftpdeploy=phing.tasks.ext.FtpDeployTask
2  lib/task/phing/types/defaults.properties
@@ -10,4 +10,4 @@ filterreader=phing.types.PhingFilterReader
10 10 regexp=phing.types.RegularExpression
11 11 param=phing.types.Parameter
12 12 path=phing.types.Path
13   -selector=phing.types.selectors.SelectSelector
  13 +selector=phing.types.selectors.SelectSelector
10 lib/task/sfPropelBaseTask.class.php
@@ -237,7 +237,7 @@ protected function callPhing($taskName, $checkSchema, $properties = array())
237 237 // Call phing targets
238 238 sfToolkit::addIncludePath(array(
239 239 sfConfig::get('sf_symfony_lib_dir'),
240   - sfConfig::get('sf_propel_generator_path', realpath(dirname(__FILE__).'/../vendor/propel-generator/lib')),
  240 + sfConfig::get('sf_propel_generator_path', realpath(dirname(__FILE__).'/../vendor/propel/generator/lib')),
241 241 ));
242 242
243 243 $args = array();
@@ -255,7 +255,7 @@ protected function callPhing($taskName, $checkSchema, $properties = array())
255 255
256 256 // Build file
257 257 $args[] = '-f';
258   - $args[] = realpath(dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR.'propel-generator'.DIRECTORY_SEPARATOR.'build.xml');
  258 + $args[] = realpath(dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR.'propel/generator'.DIRECTORY_SEPARATOR.'build.xml');
259 259
260 260 // Logger
261 261 if (DIRECTORY_SEPARATOR != '\\' && (function_exists('posix_isatty') && @posix_isatty(STDOUT)))
@@ -381,7 +381,7 @@ protected function getPlatform($databaseManager, $connection)
381 381 {
382 382 $params = $this->getConnection($databaseManager, $connection);
383 383 $platformClass = ucfirst($params['adapter']) . 'Platform';
384   - include_once dirname(__FILE__) . '/../vendor/propel-generator/lib/platform/' . $platformClass . '.php';
  384 + include_once dirname(__FILE__) . '/../vendor/propel/generator/lib/platform/' . $platformClass . '.php';
385 385 $platform = new $platformClass();
386 386 $platform->setGeneratorConfig($this->getGeneratorConfig());
387 387 return $platform;
@@ -391,7 +391,7 @@ protected function getParser($databaseManager, $connection, $con)
391 391 {
392 392 $params = $this->getConnection($databaseManager, $connection);
393 393 $parserClass = ucfirst($params['adapter']) . 'SchemaParser';
394   - include_once dirname(__FILE__) . '/../vendor/propel-generator/lib/reverse/' . $params['adapter'] . '/' . $parserClass . '.php';
  394 + include_once dirname(__FILE__) . '/../vendor/propel/generator/lib/reverse/' . $params['adapter'] . '/' . $parserClass . '.php';
395 395 $parser = new $parserClass();
396 396 $parser->setConnection($con);
397 397 $parser->setGeneratorConfig($this->getGeneratorConfig());
@@ -474,7 +474,7 @@ protected function getGeneratorConfig($params = array())
474 474 }
475 475
476 476 sfToolkit::addIncludePath(array(
477   - sfConfig::get('sf_propel_generator_path', realpath(dirname(__FILE__).'/../vendor/propel-generator/lib')),
  477 + sfConfig::get('sf_propel_generator_path', realpath(dirname(__FILE__).'/../vendor/propel/generator/lib')),
478 478 ));
479 479 require_once 'config/GeneratorConfig.php';
480 480 return new GeneratorConfig($params);
10 lib/task/sfPropelDiffTask.class.php
@@ -9,11 +9,11 @@
9 9 */
10 10
11 11 require_once(dirname(__FILE__).'/sfPropelBaseTask.class.php');
12   -require_once(dirname(__FILE__).'/../vendor/propel-generator/lib/model/AppData.php');
13   -require_once(dirname(__FILE__).'/../vendor/propel-generator/lib/builder/util/XmlToAppData.php');
14   -require_once(dirname(__FILE__).'/../vendor/propel-generator/lib/platform/DefaultPlatform.php');
15   -require_once(dirname(__FILE__).'/../vendor/propel-generator/lib/model/diff/PropelDatabaseComparator.php');
16   -require_once(dirname(__FILE__).'/../vendor/propel-generator/lib/util/PropelMigrationManager.php');
  12 +require_once(dirname(__FILE__).'/../vendor/propel/generator/lib/model/AppData.php');
  13 +require_once(dirname(__FILE__).'/../vendor/propel/generator/lib/builder/util/XmlToAppData.php');
  14 +require_once(dirname(__FILE__).'/../vendor/propel/generator/lib/platform/DefaultPlatform.php');
  15 +require_once(dirname(__FILE__).'/../vendor/propel/generator/lib/model/diff/PropelDatabaseComparator.php');
  16 +require_once(dirname(__FILE__).'/../vendor/propel/generator/lib/util/PropelMigrationManager.php');
17 17
18 18 /**
19 19 * Create classes for the current model.
2  lib/task/sfPropelMigrateDownTask.class.php
@@ -9,7 +9,7 @@
9 9 */
10 10
11 11 require_once(dirname(__FILE__).'/sfPropelBaseTask.class.php');
12   -require_once(dirname(__FILE__).'/../vendor/propel-generator/lib/util/PropelMigrationManager.php');
  12 +require_once(dirname(__FILE__).'/../vendor/propel/generator/lib/util/PropelMigrationManager.php');
13 13
14 14 /**
15 15 * Executes the next migration down
2  lib/task/sfPropelMigrateTask.class.php
@@ -9,7 +9,7 @@
9 9 */
10 10
11 11 require_once(dirname(__FILE__).'/sfPropelBaseTask.class.php');
12   -require_once(dirname(__FILE__).'/../vendor/propel-generator/lib/util/PropelMigrationManager.php');
  12 +require_once(dirname(__FILE__).'/../vendor/propel/generator/lib/util/PropelMigrationManager.php');
13 13
14 14 /**
15 15 * Executes the next migrations up
2  lib/task/sfPropelMigrateUpTask.class.php
@@ -9,7 +9,7 @@
9 9 */
10 10
11 11 require_once(dirname(__FILE__).'/sfPropelBaseTask.class.php');
12   -require_once(dirname(__FILE__).'/../vendor/propel-generator/lib/util/PropelMigrationManager.php');
  12 +require_once(dirname(__FILE__).'/../vendor/propel/generator/lib/util/PropelMigrationManager.php');
13 13
14 14 /**
15 15 * Executes the next migration up
4 lib/task/sfPropelStatusTask.class.php
@@ -8,8 +8,8 @@
8 8 * file that was distributed with this source code.
9 9 */
10 10
11   -require_once(dirname(__FILE__).'/sfPropelBaseTask.class.php');
12   -require_once(dirname(__FILE__).'/../vendor/propel-generator/lib/util/PropelMigrationManager.php');
  11 +//require_once(dirname(__FILE__).'/sfPropelBaseTask.class.php');
  12 +//require_once(dirname(__FILE__).'/../vendor/propel/generator/lib/util/PropelMigrationManager.php');
13 13
14 14 /**
15 15 * Checks the migrations to run
0  lib/validator/sfValidatorSchemaRemove.php 100755 → 100644
File mode changed
1  lib/vendor/phing
... ... @@ -0,0 +1 @@
  1 +Subproject commit 98cab9de5845065447b9c0e97e2454f5b571ddab
1  lib/vendor/propel
... ... @@ -0,0 +1 @@
  1 +Subproject commit 8a5bab1298d97ef9c9a67b8eff47d7d47adc6016
2  lib/widget/sfWidgetFormDelete.class.php 100755 → 100644
@@ -62,4 +62,4 @@ protected function configure($options = array(), $attributes = array())
62 62 $this->addOption('hide_parent', true);
63 63 $this->addOption('parent_level', 6);
64 64 }
65   -}
  65 +}
0  lib/widget/sfWidgetFormPlain.php 100755 → 100644
File mode changed
7 test/bootstrap/functional.php
@@ -26,6 +26,13 @@
26 26 $configuration = ProjectConfiguration::getApplicationConfiguration($app, 'test', isset($debug) ? $debug : true);
27 27 sfContext::createInstance($configuration);
28 28
  29 +// FIXME
  30 +// for behavior inclusions
  31 +// this a bit dirty, but allow functionnal tests to work.
  32 +sfToolkit::addIncludePath(array(
  33 + realpath(dirname(__FILE__).'/../../'),
  34 + ));
  35 +
29 36 // remove all cache
30 37 sf_functional_test_shutdown();
31 38 register_shutdown_function('sf_functional_test_shutdown');
2  test/bootstrap/unit.php
@@ -18,4 +18,4 @@
18 18
19 19 $_test_dir = realpath(dirname(__FILE__).'/..');
20 20
21   -sfToolkit::addIncludePath(realpath(dirname(__FILE__).'/../../lib/vendor'));
  21 +sfToolkit::addIncludePath(realpath(dirname(__FILE__).'/../../lib/vendor'));
2  test/functional/crud/crudBrowser.class.php
@@ -211,7 +211,7 @@ public function browse($options)
211 211 'body' => 'my body',
212 212 'Online' => false,
213 213 'category_id' => 1,
214   - 'end_date' => array('year' => 2005, 'month' => 10, 'day' => 15, 'hour' => '10', 'minute' => '20'),
  214 + 'end_date' => array('year' => date('Y'), 'month' => 10, 'day' => 15, 'hour' => '10', 'minute' => '20'),
215 215 'book_id' => 1,
216 216 'author_article_list' => array(1, 3),
217 217 ), 3, false)
3  test/functional/fixtures/config/ProjectConfiguration.class.php
@@ -7,7 +7,8 @@ class ProjectConfiguration extends sfProjectConfiguration
7 7 {
8 8 public function setup()
9 9 {
10   - $this->enablePlugins('sfPropel15Plugin');
  10 + $this->enablePlugins(array('sfPropelORMPlugin'));
  11 + $this->setPluginPath('sfPropelORMPlugin', realpath(dirname(__FILE__) . '/../../../..'));
11 12 }
12 13
13 14 public function initializePropel($app)
10 test/functional/fixtures/config/propel.ini
@@ -48,8 +48,8 @@ propel.builder.addBehaviors = true
48 48
49 49 ; behaviors
50 50 propel.behavior.default = symfony,symfony_i18n
51   -propel.behavior.symfony.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorSymfony
52   -propel.behavior.symfony_i18n.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorI18n
53   -propel.behavior.symfony_i18n_translation.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorI18nTranslation
54   -propel.behavior.symfony_behaviors.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorSymfonyBehaviors
55   -propel.behavior.symfony_timestampable.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorTimestampable
  51 +propel.behavior.symfony.class = lib.behavior.SfPropelBehaviorSymfony
  52 +propel.behavior.symfony_i18n.class = lib.behavior.SfPropelBehaviorI18n
  53 +propel.behavior.symfony_i18n_translation.class = lib.behavior.SfPropelBehaviorI18nTranslation
  54 +propel.behavior.symfony_behaviors.class = lib.behavior.SfPropelBehaviorSymfonyBehaviors
  55 +propel.behavior.symfony_timestampable.class = lib.behavior.SfPropelBehaviorTimestampable
0  test/functional/fixtures/symfony 100755 → 100644
File mode changed

0 comments on commit d5a3a87

Please sign in to comment.
Something went wrong with that request. Please try again.