Skip to content
Browse files

Merge pull request #54 from willdurand/sfPropelORMPlugin

sfPropelORMPlugin : here we go !
  • Loading branch information...
2 parents 28d5893 + 4878b50 commit d5a3a8701a6d7b5988ae52740492d260b4f65a73 @willdurand willdurand committed Aug 18, 2011
Showing with 228 additions and 220 deletions.
  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
View
7 .gitignore
@@ -1 +1,6 @@
-lib/vendor/*
+test/functional/fixtures/data/database.sqlite
+test/functional/fixtures/data/sql/
+test/functional/fixtures/lib/form/base/
+test/functional/fixtures/lib/model/map/
+test/functional/fixtures/lib/model/om/
+
View
6 .gitmodules
@@ -0,0 +1,6 @@
+[submodule "lib/vendor/propel"]
+ path = lib/vendor/propel
+ url = git://github.com/propelorm/Propel.git
+[submodule "lib/vendor/phing"]
+ path = lib/vendor/phing
+ url = git://github.com/Xosofox/phing.git
View
42 INSTALL.md
@@ -1,42 +0,0 @@
-# Installing sfPropel15Plugin With Propel 1.6
-
-This version of sfPropelPlugin doesn't come bundled with the required dependencies. To install the plugin on a symfony application, follow these steps:
-
- > cd plugins/
- > git clone git://github.com/fzaninotto/sfPropel15Plugin.git -b 1.6
- > cd sfPropel15Plugin/
- > cd lib/
- > mkdir vendor
- > cd vendor/
- > svn checkout http://phing.mirror.svn.symfony-project.com/tags/2.3.3/classes/phing phing
- > svn checkout http://svn.propelorm.org/branches/1.6/runtime/lib propel
- > svn checkout http://svn.propelorm.org/branches/1.6/generator propel-generator
- > cd ../../..
-
-Now the classic install continues.
-
-Right after the installation of the plugin, you should update plugin assets:
-
- > ./symfony plugin:publish-assets
-
-Disable the core Propel plugin and enable the `sfPropel15Plugin` instead:
-
- [php]
- class ProjectConfiguration extends sfProjectConfiguration
- {
- public function setup()
- {
- $this->enablePlugins('sfPropel15Plugin');
- }
- }
-
-Change the path of the symfony behaviors in the `config/propel.ini` file of your project:
-
- [ini]
- propel.behavior.symfony.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorSymfony
- propel.behavior.symfony_i18n.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorI18n
- propel.behavior.symfony_i18n_translation.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorI18nTranslation
- propel.behavior.symfony_behaviors.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorSymfonyBehaviors
- propel.behavior.symfony_timestampable.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorTimestampable
-
-You're done.
View
274 README.md 100755 → 100644
@@ -1,103 +1,129 @@
-sfPropel15Plugin
-================
+sfPropelORMPlugin
+=================
-Replaces symfony's core Propel plugin by the latest version of Propel, in branch 1.5.
+Replaces symfony's core Propel plugin by the latest version of Propel, in branch 1.6.
-Installation
-------------
+## Installation
+
+### The Git way
+
+Clone the plugin from Github:
+
+ git clone git://github.com/propelorm/sfPropelORMPlugin.git plugins/sfPropelORMPlugin
+ cd plugins/sfPropelORMPlugin
+ git submodule init --update
+
+If you use Git as a VCS for your project, it should be better to add the plugin as a submodule:
+
+ git submodule add git://github.com/propelorm/sfPropelORMPlugin.git plugins/sfPropelORMPlugin
+ git submodule init --update --recursive
+
+As both Phing and Propel libraries are bundled with the plugin, you have to initialize submodules for the plugin.
+
+### The SVN way
Install the plugin via the subversion repository:
- > svn co http://svn.symfony-project.com/plugins/sfPropel15Plugin/trunk plugins/sfPropel15Plugin
+ svn checkout http://svn.github.com/propelorm/sfPropelORMPlugin.git plugins/sfPropelORMPlugin
-from the project root directory or by using the command:
+Install `Phing` and `Propel`:
- > ./symfony plugin:install sfPropel15Plugin
+ cd plugins/sfPropelORMPlugin/lib/vendor
+ svn checkout http://phing.mirror.svn.symfony-project.com/tags/2.3.3/classes/phing phing
+ svn checkout http://svn.github.com/propelorm/Propel.git propel
-Right after the installation of the plugin, you should update plugin assets:
+### Final step
- > ./symfony plugin:publish-assets
+Disable the core Propel plugin and enable the `sfPropelORMPlugin` instead:
-Disable the core Propel plugin and enable the `sfPropel15Plugin` instead:
+``` php
+// config/ProjectConfiguration.class.php
- [php]
- class ProjectConfiguration extends sfProjectConfiguration
- {
- public function setup()
- {
- $this->enablePlugins('sfPropel15Plugin');
- }
- }
+class ProjectConfiguration extends sfProjectConfiguration
+{
+ public function setup()
+ {
+ $this->enablePlugins('sfPropelORMPlugin');
+ }
+}
+```
+
+Right after the installation of the plugin, you should update plugin assets:
+
+ php symfony plugin:publish-assets
Change the path of the symfony behaviors in the `config/propel.ini` file of your project:
- [ini]
- propel.behavior.symfony.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorSymfony
- propel.behavior.symfony_i18n.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorI18n
- propel.behavior.symfony_i18n_translation.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorI18nTranslation
- propel.behavior.symfony_behaviors.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorSymfonyBehaviors
- propel.behavior.symfony_timestampable.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorTimestampable
+``` ini
+// config/propel.ini
+
+propel.behavior.symfony.class = plugins.sfPropelORMPlugin.lib.behavior.SfPropelBehaviorSymfony
+propel.behavior.symfony_i18n.class = plugins.sfPropelORMPlugin.lib.behavior.SfPropelBehaviorI18n
+propel.behavior.symfony_i18n_translation.class = plugins.sfPropelORMPlugin.lib.behavior.SfPropelBehaviorI18nTranslation
+propel.behavior.symfony_behaviors.class = plugins.sfPropelORMPlugin.lib.behavior.SfPropelBehaviorSymfonyBehaviors
+propel.behavior.symfony_timestampable.class = plugins.sfPropelORMPlugin.lib.behavior.SfPropelBehaviorTimestampable
+```
(Re)Build the model:
- > ./symfony propel:build --all-classes
+ php symfony propel:build --all-classes
+
-What's New In Propel 1.5
-------------------------
+## What's New In Propel 1.6
-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:
+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:
- [php]
- // find the 10 latest books published by authror 'Leo'
- $books = BookQuery::create()
- ->useAuthorQuery()
- ->filterByFirstName('Leo')
- ->endUse()
- ->orderByPublishedAt('desc')
- ->limit(10)
- ->find($con);
+``` php
+// find the 10 latest books published by authror 'Leo'
+$books = BookQuery::create()
+ ->useAuthorQuery()
+ ->filterByFirstName('Leo')
+ ->endUse()
+ ->orderByPublishedAt('desc')
+ ->limit(10)
+ ->find($con);
+```
-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.
+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.
-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.
-Core Propel Behaviors
----------------------
+## Core Propel Behaviors
-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:
+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:
-- [timestampable](http://www.propelorm.org/wiki/Documentation/1.5/Behaviors/timestampable)
-- [sluggable](http://www.propelorm.org/wiki/Documentation/1.5/Behaviors/sluggable)
-- [soft_delete]([http://www.propelorm.org/wiki/Documentation/1.5/Behaviors/soft_delete)
-- [nested_set](http://www.propelorm.org/wiki/Documentation/1.5/Behaviors/nested_set)
-- [sortable](http://www.propelorm.org/wiki/Documentation/1.5/Behaviors/sortable)
-- [concrete_inheritance](http://www.propelorm.org/wiki/Documentation/1.5/Inheritance#ConcreteTableInheritance)
-- [query_cache](http://www.propelorm.org/wiki/Documentation/1.5/Behaviors/query_cache)
-- [alternative_coding_standards](http://www.propelorm.org/xiki/Documentation/1.5/Behaviors/alternative_coding_standards)
-- [auto_add_pk](http://www.propelorm.org/wiki/Documentation/1.5/Behaviors/auto_add_pk)
+- [timestampable](http://www.propelorm.org/wiki/Documentation/1.6/Behaviors/timestampable)
+- [sluggable](http://www.propelorm.org/wiki/Documentation/1.6/Behaviors/sluggable)
+- [soft_delete]([http://www.propelorm.org/wiki/Documentation/1.6/Behaviors/soft_delete)
+- [nested_set](http://www.propelorm.org/wiki/Documentation/1.6/Behaviors/nested_set)
+- [sortable](http://www.propelorm.org/wiki/Documentation/1.6/Behaviors/sortable)
+- [concrete_inheritance](http://www.propelorm.org/wiki/Documentation/1.6/Inheritance#ConcreteTableInheritance)
+- [query_cache](http://www.propelorm.org/wiki/Documentation/1.6/Behaviors/query_cache)
+- [alternative_coding_standards](http://www.propelorm.org/xiki/Documentation/1.6/Behaviors/alternative_coding_standards)
+- [auto_add_pk](http://www.propelorm.org/wiki/Documentation/1.6/Behaviors/auto_add_pk)
-`sfPropel15Plugin` allows you to register core propel behaviors right from your `schema.yml`. For instance, to create a tree structure from a `Section` model:
+`sfPropelORMPlugin` allows you to register core propel behaviors right from your `schema.yml`. For instance, to create a tree structure from a `Section` model:
- [yaml]
- propel:
- section:
- _attributes: { phpName: Section }
- _propel_behaviors:
- - nested_set
- id: ~
- title: { type: varchar(100), required: true primaryString: true }
+``` yaml
+propel:
+ section:
+ _attributes: { phpName: Section }
+ _propel_behaviors:
+ - nested_set
+ id: ~
+ title: { type: varchar(100), required: true primaryString: true }
+```
-**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.
+**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.
-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:
+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:
- [ini]
- propel.behavior.default = symfony,symfony_i18n,alternative_coding_standards,auto_add_pk
+``` ini
+propel.behavior.default = symfony,symfony_i18n,alternative_coding_standards,auto_add_pk
+```
-Admin Generator Extensions
---------------------------
+## Admin Generator Extensions
-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:
+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:
### List view enhancements
@@ -113,68 +139,70 @@ The plugin comes bundled with a new admin generator theme named 'admin15'. This
- **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.
- **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.
-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.
+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.
-Form Subframework Modifications
--------------------------------
+## Form Subframework Modifications
- **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.
- **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`.
- **Plain text widget and validator**: This new widget allows a field to be displayed in a form, without letting the use change it.
- **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.
- [php]
- class ArticleForm extends BaseArticleForm
- {
- public function configure()
- {
- $this->embedRelation('Book');
- }
- }
-
-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.
-
-Routing Modifications
----------------------
-
-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()`.
-
- [yaml]
- author:
- class: sfPropel15RouteCollection
- options:
- model: author
- module: author
- prefix_path: /author
- column: id
- query_methods:
- object: [filterByIsPublished]
- list: [filterByIsPublished, orderByLastName]
- with_wildcard_routes: true
+``` php
+class ArticleForm extends BaseArticleForm
+{
+ public function configure()
+ {
+ $this->embedRelation('Book');
+ }
+}
+```
+
+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.
+
+## Routing Modifications
+
+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()`.
+
+``` yaml
+author:
+ class: sfPropelORMRouteCollection
+ options:
+ model: author
+ module: author
+ prefix_path: /author
+ column: id
+ query_methods:
+ object: [filterByIsPublished]
+ list: [filterByIsPublished, orderByLastName]
+ with_wildcard_routes: true
+```
Array of additional parameters are also possible for `query_methods`:
- [yaml]
- author:
- class: sfPropel15RouteCollection
- options:
- model: author
- module: author
- prefix_path: /author
- column: id
- query_methods:
- object:
- filterByIsPublished: [false]
- list:
- filterByIsPublished: []
- orderBy: [LastName]
- with_wildcard_routes: true
-
-`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:
-
- [php]
- public function executeShow(sfWebRequest $request)
- {
- // using sfPropel15Route with 'Author' as model
- $this->author = $this->getRoute()->getAuthor();
- }
+``` yaml
+author:
+ class: sfPropelORMRouteCollection
+ options:
+ model: author
+ module: author
+ prefix_path: /author
+ column: id
+ query_methods:
+ object:
+ filterByIsPublished: [false]
+ list:
+ filterByIsPublished: []
+ orderBy: [LastName]
+ with_wildcard_routes: true
+```
+
+`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:
+
+``` php
+public function executeShow(sfWebRequest $request)
+{
+ // using sfPropelORMRoute with 'Author' as model
+ $this->author = $this->getRoute()->getAuthor();
+}
+```
View
2 config/autoload.yml
@@ -1,5 +1,5 @@
autoload:
- sfPropel15Plugin_lib:
+ sfPropelORMPlugin_lib:
name: propel addon
path: <?php echo realpath(dirname(__FILE__).'/../lib')."\n" ?>
recursive: true
View
2 config/installer.php
@@ -1,5 +1,5 @@
<?php
$this->installDir(dirname(__FILE__).'/skeleton');
-$this->enablePlugin('sfPropel15Plugin');
+$this->enablePlugin('sfPropelORMPlugin');
$this->reloadTasks();
View
9 ...g/sfPropel15PluginConfiguration.class.php → .../sfPropelORMPluginConfiguration.class.php
@@ -8,7 +8,7 @@
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
* @version SVN: $Id: sfPropelPluginConfiguration.class.php 23739 2009-11-09 23:32:46Z Kris.Wallsmith $
*/
-class sfPropel15PluginConfiguration extends sfPluginConfiguration
+class sfPropelORMPluginConfiguration extends sfPluginConfiguration
{
/**
* @see sfPluginConfiguration
@@ -18,15 +18,16 @@ public function initialize()
sfConfig::set('sf_orm', 'propel');
if (!sfConfig::get('sf_admin_module_web_dir'))
{
- sfConfig::set('sf_admin_module_web_dir', '/sfPropel15Plugin');
+ sfConfig::set('sf_admin_module_web_dir', '/sfPropelORMPlugin');
}
sfToolkit::addIncludePath(array(
sfConfig::get('sf_root_dir'),
- sfConfig::get('sf_propel_runtime_path', realpath(dirname(__FILE__).'/../lib/vendor')),
+ sfConfig::get('sf_phing_path', realpath(dirname(__FILE__).'/../lib/vendor/phing/classes')),
+ sfConfig::get('sf_propel_runtime_path', realpath(dirname(__FILE__).'/../lib/vendor/propel/runtime/lib')),
));
- require_once 'propel/Propel.php';
+ require_once 'Propel.php';
if (!Propel::isInit())
{
View
12 config/skeleton/config/propel.ini
@@ -47,11 +47,11 @@ propel.builder.addBehaviors = true
; behaviors
propel.behavior.default = symfony,symfony_i18n
-propel.behavior.symfony.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorSymfony
-propel.behavior.symfony_i18n.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorI18n
-propel.behavior.symfony_i18n_translation.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorI18nTranslation
-propel.behavior.symfony_behaviors.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorSymfonyBehaviors
-propel.behavior.symfony_timestampable.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorTimestampable
+propel.behavior.symfony.class = plugins.sfPropelORMPlugin.lib.behavior.SfPropelBehaviorSymfony
+propel.behavior.symfony_i18n.class = plugins.sfPropelORMPlugin.lib.behavior.SfPropelBehaviorI18n
+propel.behavior.symfony_i18n_translation.class = plugins.sfPropelORMPlugin.lib.behavior.SfPropelBehaviorI18nTranslation
+propel.behavior.symfony_behaviors.class = plugins.sfPropelORMPlugin.lib.behavior.SfPropelBehaviorSymfonyBehaviors
+propel.behavior.symfony_timestampable.class = plugins.sfPropelORMPlugin.lib.behavior.SfPropelBehaviorTimestampable
propel.behavior.timestampable.class = behavior.TimestampableBehavior
propel.behavior.alternative_coding_standards.class = behavior.AlternativeCodingStandardsBehavior
propel.behavior.soft_delete.class = behavior.SoftDeleteBehavior
@@ -63,4 +63,4 @@ propel.behavior.concrete_inheritance.class = behavior.concrete_inheritance.C
propel.behavior.query_cache.class = behavior.query_cache.QueryCacheBehavior
propel.behavior.aggregate_column.class = behavior.aggregate_column.AggregateColumnBehavior
propel.behavior.versionable.class = behavior.versionable.VersionableBehavior
-propel.behavior.i18n.class = behavior.i18n.I18nBehavior
+propel.behavior.i18n.class = behavior.i18n.I18nBehavior
View
2 data/generator/sfPropelModule/admin/template/templates/_assets.php
@@ -3,4 +3,4 @@
<?php elseif(!isset($this->params['css'])): ?>
[?php use_stylesheet('<?php echo sfConfig::get('sf_admin_module_web_dir').'/css/global.css' ?>', 'first') ?]
[?php use_stylesheet('<?php echo sfConfig::get('sf_admin_module_web_dir').'/css/default.css' ?>', 'first') ?]
-<?php endif; ?>
+<?php endif; ?>
View
2 data/generator/sfPropelModule/admin15/template/templates/_assets.php
@@ -3,4 +3,4 @@
<?php elseif(!isset($this->params['css'])): ?>
[?php use_stylesheet('<?php echo sfConfig::get('sf_admin_module_web_dir').'/css/global.css' ?>', 'first') ?]
[?php use_stylesheet('<?php echo sfConfig::get('sf_admin_module_web_dir').'/css/default.css' ?>', 'first') ?]
-<?php endif; ?>
+<?php endif; ?>
View
4 doc/admin_generator.md 100755 → 100644
@@ -1,7 +1,7 @@
Admin Generator Extensions
==========================
-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.
+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.
To enable this theme, edit your `generator.yml` and change the `theme` property from `admin` to `admin15`, as follows:
@@ -279,4 +279,4 @@ If you want to display some data in a form without allowing the user to edit it,
created_at: { type: plain }
updated_at: { type: plain }
-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.
+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.
View
2 doc/database.md
@@ -35,4 +35,4 @@ Symfony is to specify slave servers for each connection in config/databases.yml
The slave connections will be with the same settings (encoding, persustent, pooling, etc) as
the master connection to ensure the same behavior for all.
-- [Master-Slave](http://www.propelorm.org/wiki/Documentation/1.5/Master-Slave): Please read more details on Master-Slave in Propel 1.5
+- [Master-Slave](http://www.propelorm.org/wiki/Documentation/1.5/Master-Slave): Please read more details on Master-Slave in Propel 1.5
View
6 doc/form.md 100755 → 100644
@@ -1,12 +1,12 @@
Form Extensions
===============
-The `sfPropel15Plugin` provides two widgets and three validators, to help build and validate forms bound to a Model object.
+The `sfPropelORMPlugin` provides two widgets and three validators, to help build and validate forms bound to a Model object.
`sfWidgetPropelChoice` and `sfValidatorPropelChoice`
----------------------------------------------------
-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`.
+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`.
### Generated Configuration
@@ -270,4 +270,4 @@ If `add_delete` is set to `true`, the following additional options are available
* `delete_widget`: Optional delete widget object. If left null, uses a `sfWidgetFormDelete` instance, which is a checkbox widget with a Javascript confirmation.
* `alert_text`: The text of the Javascript alert to show.
* `hide_parent`: Whether to hide the deleted form when clicking the checkbox. Defaults to true.
-* `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.
+* `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.
View
2 doc/schema.md 100755 → 100644
@@ -308,7 +308,7 @@ You can register more than one behavior and set the parameters of each behaviors
sluggable:
timestampable:
-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:
+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:
[ini]
propel.behavior.default = symfony,symfony_i18n,alternative_coding_standards,auto_add_pk
View
2 i18n/sf_admin.es.xml
@@ -167,4 +167,4 @@
</trans-unit>
</body>
</file>
-</xliff>
+</xliff>
View
2 i18n/sf_admin.es_AR.xml
@@ -111,4 +111,4 @@
</trans-unit>
</body>
</file>
-</xliff>
+</xliff>
View
2 i18n/sf_admin.hu.xml
@@ -131,4 +131,4 @@
</trans-unit>
</body>
</file>
-</xliff>
+</xliff>
View
2 i18n/sf_admin.uk.xml
@@ -131,4 +131,4 @@
</trans-unit>
</body>
</file>
-</xliff>
+</xliff>
View
2 lib/behavior/SfPropelBehaviorBase.php
@@ -8,7 +8,7 @@
* file that was distributed with this source code.
*/
-require_once 'propel-generator/lib/model/Behavior.php';
+require_once 'propel/generator/lib/model/Behavior.php';
/**
* Base behavior class.
View
2 lib/behavior/SfPropelBehaviorI18n.php
@@ -8,7 +8,7 @@
* file that was distributed with this source code.
*/
-require_once dirname(__FILE__) . '/../vendor/propel-generator/lib/util/PropelPHPParser.php';
+require_once dirname(__FILE__) . '/../vendor/propel/generator/lib/util/PropelPHPParser.php';
/**
* Internationalizes Propel models.
View
2 lib/form/sfFormPropelCollection.class.php
@@ -187,4 +187,4 @@ public function embedOptionalForm($name, sfForm $form, $decorator = null, $optio
$this->resetFormFields();
}
-}
+}
View
0 lib/routing/sfPropel15Route.class.php → lib/routing/sfPropelORMRoute.class.php 100755 → 100644
File renamed without changes.
View
0 ...uting/sfPropel15RouteCollection.class.php → ...ting/sfPropelORMRouteCollection.class.php 100755 → 100644
File renamed without changes.
View
2 lib/task/phing/tasks/defaults.properties
@@ -83,4 +83,4 @@ phpdocext=phing.tasks.ext.phpdoc.PhpDocumentorExternalTask
;jsllint=phing.tasks.ext.JslLintTask
;manifest=phing.tasks.ext.ManifestTask
;phpcodesniffer=phing.tasks.ext.PhpCodeSnifferTask
-;ftpdeploy=phing.tasks.ext.FtpDeployTask
+;ftpdeploy=phing.tasks.ext.FtpDeployTask
View
2 lib/task/phing/types/defaults.properties
@@ -10,4 +10,4 @@ filterreader=phing.types.PhingFilterReader
regexp=phing.types.RegularExpression
param=phing.types.Parameter
path=phing.types.Path
-selector=phing.types.selectors.SelectSelector
+selector=phing.types.selectors.SelectSelector
View
10 lib/task/sfPropelBaseTask.class.php
@@ -237,7 +237,7 @@ protected function callPhing($taskName, $checkSchema, $properties = array())
// Call phing targets
sfToolkit::addIncludePath(array(
sfConfig::get('sf_symfony_lib_dir'),
- sfConfig::get('sf_propel_generator_path', realpath(dirname(__FILE__).'/../vendor/propel-generator/lib')),
+ sfConfig::get('sf_propel_generator_path', realpath(dirname(__FILE__).'/../vendor/propel/generator/lib')),
));
$args = array();
@@ -255,7 +255,7 @@ protected function callPhing($taskName, $checkSchema, $properties = array())
// Build file
$args[] = '-f';
- $args[] = realpath(dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR.'propel-generator'.DIRECTORY_SEPARATOR.'build.xml');
+ $args[] = realpath(dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR.'propel/generator'.DIRECTORY_SEPARATOR.'build.xml');
// Logger
if (DIRECTORY_SEPARATOR != '\\' && (function_exists('posix_isatty') && @posix_isatty(STDOUT)))
@@ -381,7 +381,7 @@ protected function getPlatform($databaseManager, $connection)
{
$params = $this->getConnection($databaseManager, $connection);
$platformClass = ucfirst($params['adapter']) . 'Platform';
- include_once dirname(__FILE__) . '/../vendor/propel-generator/lib/platform/' . $platformClass . '.php';
+ include_once dirname(__FILE__) . '/../vendor/propel/generator/lib/platform/' . $platformClass . '.php';
$platform = new $platformClass();
$platform->setGeneratorConfig($this->getGeneratorConfig());
return $platform;
@@ -391,7 +391,7 @@ protected function getParser($databaseManager, $connection, $con)
{
$params = $this->getConnection($databaseManager, $connection);
$parserClass = ucfirst($params['adapter']) . 'SchemaParser';
- include_once dirname(__FILE__) . '/../vendor/propel-generator/lib/reverse/' . $params['adapter'] . '/' . $parserClass . '.php';
+ include_once dirname(__FILE__) . '/../vendor/propel/generator/lib/reverse/' . $params['adapter'] . '/' . $parserClass . '.php';
$parser = new $parserClass();
$parser->setConnection($con);
$parser->setGeneratorConfig($this->getGeneratorConfig());
@@ -474,7 +474,7 @@ protected function getGeneratorConfig($params = array())
}
sfToolkit::addIncludePath(array(
- sfConfig::get('sf_propel_generator_path', realpath(dirname(__FILE__).'/../vendor/propel-generator/lib')),
+ sfConfig::get('sf_propel_generator_path', realpath(dirname(__FILE__).'/../vendor/propel/generator/lib')),
));
require_once 'config/GeneratorConfig.php';
return new GeneratorConfig($params);
View
10 lib/task/sfPropelDiffTask.class.php
@@ -9,11 +9,11 @@
*/
require_once(dirname(__FILE__).'/sfPropelBaseTask.class.php');
-require_once(dirname(__FILE__).'/../vendor/propel-generator/lib/model/AppData.php');
-require_once(dirname(__FILE__).'/../vendor/propel-generator/lib/builder/util/XmlToAppData.php');
-require_once(dirname(__FILE__).'/../vendor/propel-generator/lib/platform/DefaultPlatform.php');
-require_once(dirname(__FILE__).'/../vendor/propel-generator/lib/model/diff/PropelDatabaseComparator.php');
-require_once(dirname(__FILE__).'/../vendor/propel-generator/lib/util/PropelMigrationManager.php');
+require_once(dirname(__FILE__).'/../vendor/propel/generator/lib/model/AppData.php');
+require_once(dirname(__FILE__).'/../vendor/propel/generator/lib/builder/util/XmlToAppData.php');
+require_once(dirname(__FILE__).'/../vendor/propel/generator/lib/platform/DefaultPlatform.php');
+require_once(dirname(__FILE__).'/../vendor/propel/generator/lib/model/diff/PropelDatabaseComparator.php');
+require_once(dirname(__FILE__).'/../vendor/propel/generator/lib/util/PropelMigrationManager.php');
/**
* Create classes for the current model.
View
2 lib/task/sfPropelMigrateDownTask.class.php
@@ -9,7 +9,7 @@
*/
require_once(dirname(__FILE__).'/sfPropelBaseTask.class.php');
-require_once(dirname(__FILE__).'/../vendor/propel-generator/lib/util/PropelMigrationManager.php');
+require_once(dirname(__FILE__).'/../vendor/propel/generator/lib/util/PropelMigrationManager.php');
/**
* Executes the next migration down
View
2 lib/task/sfPropelMigrateTask.class.php
@@ -9,7 +9,7 @@
*/
require_once(dirname(__FILE__).'/sfPropelBaseTask.class.php');
-require_once(dirname(__FILE__).'/../vendor/propel-generator/lib/util/PropelMigrationManager.php');
+require_once(dirname(__FILE__).'/../vendor/propel/generator/lib/util/PropelMigrationManager.php');
/**
* Executes the next migrations up
View
2 lib/task/sfPropelMigrateUpTask.class.php
@@ -9,7 +9,7 @@
*/
require_once(dirname(__FILE__).'/sfPropelBaseTask.class.php');
-require_once(dirname(__FILE__).'/../vendor/propel-generator/lib/util/PropelMigrationManager.php');
+require_once(dirname(__FILE__).'/../vendor/propel/generator/lib/util/PropelMigrationManager.php');
/**
* Executes the next migration up
View
4 lib/task/sfPropelStatusTask.class.php
@@ -8,8 +8,8 @@
* file that was distributed with this source code.
*/
-require_once(dirname(__FILE__).'/sfPropelBaseTask.class.php');
-require_once(dirname(__FILE__).'/../vendor/propel-generator/lib/util/PropelMigrationManager.php');
+//require_once(dirname(__FILE__).'/sfPropelBaseTask.class.php');
+//require_once(dirname(__FILE__).'/../vendor/propel/generator/lib/util/PropelMigrationManager.php');
/**
* Checks the migrations to run
View
0 lib/validator/sfValidatorSchemaRemove.php 100755 → 100644
File mode changed.
1 lib/vendor/phing
@@ -0,0 +1 @@
+Subproject commit 98cab9de5845065447b9c0e97e2454f5b571ddab
1 lib/vendor/propel
@@ -0,0 +1 @@
+Subproject commit 8a5bab1298d97ef9c9a67b8eff47d7d47adc6016
View
2 lib/widget/sfWidgetFormDelete.class.php 100755 → 100644
@@ -62,4 +62,4 @@ protected function configure($options = array(), $attributes = array())
$this->addOption('hide_parent', true);
$this->addOption('parent_level', 6);
}
-}
+}
View
0 lib/widget/sfWidgetFormPlain.php 100755 → 100644
File mode changed.
View
7 test/bootstrap/functional.php
@@ -26,6 +26,13 @@
$configuration = ProjectConfiguration::getApplicationConfiguration($app, 'test', isset($debug) ? $debug : true);
sfContext::createInstance($configuration);
+// FIXME
+// for behavior inclusions
+// this a bit dirty, but allow functionnal tests to work.
+sfToolkit::addIncludePath(array(
+ realpath(dirname(__FILE__).'/../../'),
+ ));
+
// remove all cache
sf_functional_test_shutdown();
register_shutdown_function('sf_functional_test_shutdown');
View
2 test/bootstrap/unit.php
@@ -18,4 +18,4 @@
$_test_dir = realpath(dirname(__FILE__).'/..');
-sfToolkit::addIncludePath(realpath(dirname(__FILE__).'/../../lib/vendor'));
+sfToolkit::addIncludePath(realpath(dirname(__FILE__).'/../../lib/vendor'));
View
2 test/functional/crud/crudBrowser.class.php
@@ -211,7 +211,7 @@ public function browse($options)
'body' => 'my body',
'Online' => false,
'category_id' => 1,
- 'end_date' => array('year' => 2005, 'month' => 10, 'day' => 15, 'hour' => '10', 'minute' => '20'),
+ 'end_date' => array('year' => date('Y'), 'month' => 10, 'day' => 15, 'hour' => '10', 'minute' => '20'),
'book_id' => 1,
'author_article_list' => array(1, 3),
), 3, false)
View
3 test/functional/fixtures/config/ProjectConfiguration.class.php
@@ -7,7 +7,8 @@ class ProjectConfiguration extends sfProjectConfiguration
{
public function setup()
{
- $this->enablePlugins('sfPropel15Plugin');
+ $this->enablePlugins(array('sfPropelORMPlugin'));
+ $this->setPluginPath('sfPropelORMPlugin', realpath(dirname(__FILE__) . '/../../../..'));
}
public function initializePropel($app)
View
10 test/functional/fixtures/config/propel.ini
@@ -48,8 +48,8 @@ propel.builder.addBehaviors = true
; behaviors
propel.behavior.default = symfony,symfony_i18n
-propel.behavior.symfony.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorSymfony
-propel.behavior.symfony_i18n.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorI18n
-propel.behavior.symfony_i18n_translation.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorI18nTranslation
-propel.behavior.symfony_behaviors.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorSymfonyBehaviors
-propel.behavior.symfony_timestampable.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorTimestampable
+propel.behavior.symfony.class = lib.behavior.SfPropelBehaviorSymfony
+propel.behavior.symfony_i18n.class = lib.behavior.SfPropelBehaviorI18n
+propel.behavior.symfony_i18n_translation.class = lib.behavior.SfPropelBehaviorI18nTranslation
+propel.behavior.symfony_behaviors.class = lib.behavior.SfPropelBehaviorSymfonyBehaviors
+propel.behavior.symfony_timestampable.class = lib.behavior.SfPropelBehaviorTimestampable
View
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.