Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Introducing new commands #100

Merged
merged 26 commits into from

2 participants

@willdurand
Owner

Added a Filesystem class (thanks to Symfony2), added Finder
(Symfony2 component) as a dependency, added a bunch of new named
exceptions

Should I keep the build.properties file ? I don't like it but it's quite useful..
The syntax should be changed anyway (propel. is useless for instance).

Are you ok with that work on the commands ? There is no Phing related stuffs here, and I could do the same for all other commands now.

An AbstractCommand class will probably handle the config part. Oh, and I use a closure to log messages in Managers.

William

@fzaninotto

Why is Filesystem copied and not a dependency?

Also, I think you should identify all that's required from the build.properties in this command and transform these as command options. Conceptually, they are all inputs to the command. Why should one be passed as option and the other in a configuration file? When all the commands have identified input parameters, we can figure out which parameters really need to be in a configuration file, and the format of the configuration file.

@willdurand
Owner
@fzaninotto

Can't we rely on autoloading only for behaviors?

I mean, a simple inference of the class name based on the behavior name would allow to find the core behavior classes. For the user behaviors, the fully qualified name would be required, and we're good.

@willdurand
Owner
@willdurand
Owner

And I don't know how to deal with third-party behaviors…

We need something smart here. Is autoloading enough ? That's the question...

@fzaninotto

We can move all behaviors into a subdirectory to makeautoloading easier. And for third-party behavior, letting the user enter a fully quialified class names does the trick:

<table name="book">
  <behavior class="My\Foo\Bar\Behavior" />
</table>
@willdurand
Owner

Here we go, behaviors are autoloaded following the convention described above. User behaviors are autoloaded if there is a FQCN in the behavior tag. Note I didn't add a class attribute yet.

I also added all useful options for this command thanks to this page http://www.propelorm.org/reference/buildtime-configuration.html which lists all available build properties.

@willdurand willdurand commented on the diff
src/Propel/Generator/Config/GeneratorConfig.php
((5 lines not shown))
use Propel\Generator\Model\Table;
use Propel\Generator\Platform\PlatformInterface;
use Propel\Generator\Reverse\SchemaParserInterface;
use \PDO;
-// Phing dependencies
-require_once 'phing/Phing.php';
@willdurand Owner

Useless dependance. This is no more needed as behaviors are now autoloaded only.
That's why I removed this part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@willdurand willdurand commented on the diff
.../Behavior/Timestampable/TimestampableBehaviorTest.php
@@ -31,12 +31,12 @@ public function testParameters()
{
$table2 = Table2Peer::getTableMap();
$this->assertEquals(count($table2->getColumns()), 4, 'Timestampable adds two columns by default');
- $this->assertTrue(method_exists('\Propel\Tests\Bookstore\Behavior\Table2', 'getCreatedAt'), 'Timestamplable adds a created_at column by default');
- $this->assertTrue(method_exists('\Propel\Tests\Bookstore\Behavior\Table2', 'getUpdatedAt'), 'Timestamplable adds an updated_at column by default');
+ $this->assertTrue(method_exists('\Propel\Tests\Bookstore\Behavior\Table2', 'getCreatedAt'), 'Timestampable adds a created_at column by default');
@willdurand Owner

Fixed typo here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@fzaninotto

Love it. +100.

@willdurand
Owner

The test:prepare command now uses sql:build and model:build, yay!

willdurand added some commits
@willdurand willdurand Introduced the sql:build command
Added a `Filesystem` class (thanks to Symfony2), added `Finder`
(Symfony2 component) as a dependency, added a bunch of new named
exceptions
b141fdd
@willdurand willdurand Moved all behaviors to their own sub directory 244f706
@willdurand willdurand [Generator] Added new named exceptions b3ac8ec
@willdurand willdurand Changed how behaviors are loaded 9c79cde
@willdurand willdurand [Command] Removed the need to parse 'default.properties' f866bf6
@willdurand willdurand Fixed tests c3e0e77
@willdurand willdurand Allowed FQCN as behavior names eb5240e
@willdurand willdurand [Command] [SqlBuild] Added more options, no need to use a 'build.prop…
…erties' file
b7227b1
@willdurand willdurand Fixed CS cdc80ea
@willdurand willdurand [Command] [SqlBuild] Removed useless code 4a0c52e
@willdurand willdurand Fixed CS (again) e9ab406
@willdurand willdurand Removed the behaviors section in default.properties d08238e
@willdurand willdurand Introduced model:build command
Refactored Managers to be more generic
16d77be
@willdurand willdurand [Command] Autoload Propel commands 97125c6
@willdurand willdurand [Generator][Manager] Fixed ModelManager if file exists a90cbbf
@willdurand willdurand [Command] Use new commands in the 'test:prepare' 17cdf1b
@willdurand willdurand [Generator][Manager] Fixed ModelManager if file exists (again) 3bba5ba
@willdurand willdurand [Command] Keep BC since all tasks are not converted yet 4ffbde6
@willdurand willdurand [Command] Forwarded verbose mode to sub commands in test:prepare cc4ea67
@willdurand willdurand [Command] Refactored commands by adding an AbstractCommand class b1dc3fb
@willdurand willdurand [Command] Fixed exception in AbstractCommand 80e4c46
@willdurand willdurand [Command] Added missing use in AbstractCommand 5a16c9a
@willdurand willdurand [Command] Fixed commands d11f304
@willdurand willdurand [Command] Added more options to the 'model:build', 'sql:build' commands 36eb3f2
@willdurand willdurand [Generator] Removed no more used tasks aa56abc
@willdurand willdurand Updated composer ff0e679
@willdurand willdurand merged commit 4bd3d5e into propelorm:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 22, 2011
  1. @willdurand

    Introduced the sql:build command

    willdurand authored
    Added a `Filesystem` class (thanks to Symfony2), added `Finder`
    (Symfony2 component) as a dependency, added a bunch of new named
    exceptions
  2. @willdurand
  3. @willdurand
  4. @willdurand
  5. @willdurand
  6. @willdurand

    Fixed tests

    willdurand authored
  7. @willdurand
  8. @willdurand
  9. @willdurand

    Fixed CS

    willdurand authored
  10. @willdurand
  11. @willdurand

    Fixed CS (again)

    willdurand authored
  12. @willdurand
  13. @willdurand

    Introduced model:build command

    willdurand authored
    Refactored Managers to be more generic
  14. @willdurand
  15. @willdurand
  16. @willdurand
  17. @willdurand
  18. @willdurand
  19. @willdurand
  20. @willdurand
  21. @willdurand
  22. @willdurand
  23. @willdurand

    [Command] Fixed commands

    willdurand authored
  24. @willdurand
  25. @willdurand
  26. @willdurand

    Updated composer

    willdurand authored
Something went wrong with that request. Please try again.