Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

made test installer cross platform #124

Merged
merged 2 commits into from

2 participants

@jaugustin
Collaborator

I change the test installer.php to make it cross platform (work on my windows 7 and on travis-ci)

Build Status

This will help me to write and fix tests for #90 ;)

prepare_tests.sh is still unix only but it work on my git bash ;)

@willdurand willdurand merged commit b3c15ff into propelorm:master
@willdurand
Owner

Much better, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 18 additions and 16 deletions.
  1. +18 −16 test/bin/installer.php
View
34 test/bin/installer.php
@@ -7,36 +7,38 @@
$this->logSection('install', 'default to propel');
$this->logSection('install', 'default to sqlite');
-$this->runTask('configure:database', sprintf("'sqlite:%s/propel.db'", sfConfig::get('sf_data_dir')));
+$this->runTask('configure:database', sprintf("'sqlite:%spropel.db'", sfConfig::get('sf_data_dir') . DIRECTORY_SEPARATOR));
$this->logSection('install', 'fix sqlite database permissions');
-touch(sfConfig::get('sf_data_dir').'/propel.db');
+touch(sfConfig::get('sf_data_dir') . DIRECTORY_SEPARATOR .'propel.db');
chmod(sfConfig::get('sf_data_dir'), 0777);
-chmod(sfConfig::get('sf_data_dir').'/propel.db', 0777);
+chmod(sfConfig::get('sf_data_dir') . DIRECTORY_SEPARATOR . 'propel.db', 0777);
$this->logSection('install', 'install propel 1.6');
sfSymfonyPluginManager::disablePlugin('sfPropelPlugin', sfConfig::get('sf_config_dir'));
-$fs->execute(sprintf('mkdir %s/sfPropelORMPlugin', sfConfig::get('sf_plugins_dir')));
-$fs->execute(sprintf('cd %s ; cp -R `ls | grep -v "mockproject"` %s/sfPropelORMPlugin/',
- realpath(sfConfig::get('sf_root_dir') . '/../'),
- sfConfig::get('sf_plugins_dir')
-));
-$fs->execute(sprintf('cd %s/sfPropelORMPlugin ; git submodule update --init --recursive ; cd -;', sfConfig::get('sf_plugins_dir')));
-sfSymfonyPluginManager::enablePlugin('sfPropelORMPlugin', sfConfig::get('sf_config_dir'));
+$fs->mkdirs(sfConfig::get('sf_plugins_dir') . DIRECTORY_SEPARATOR . 'sfPropelORMPlugin');
+
+$root_dir = realpath(sfConfig::get('sf_root_dir') . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR);
+$plugin_dir = realpath(sfConfig::get('sf_plugins_dir') . DIRECTORY_SEPARATOR . 'sfPropelORMPlugin');
+$finder = sfFinder::type('any')->ignore_version_control(false)->discard('mockproject')->prune('mockproject');
+$fs->mirror($root_dir, $plugin_dir, $finder);
+
+$fs->execute(sprintf('cd %s && git submodule update --init --recursive', $plugin_dir));
+sfSymfonyPluginManager::enablePlugin('sfPropelORMPlugin', sfConfig::get('sf_config_dir'));
$this->logSection('install', 'setup propel behavior');
-$ini_file = sfConfig::get('sf_config_dir').'/propel.ini';
+$ini_file = sfConfig::get('sf_config_dir'). DIRECTORY_SEPARATOR . 'propel.ini';
$content = file_get_contents($ini_file);
preg_replace('#^propel.behavior#', ';\1', $content);
$content .= <<<EOF
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
EOF;
file_put_contents($ini_file, $content);
Something went wrong with that request. Please try again.