Permalink
Browse files

PHP7 support, updated Propel (1.7.1) & PHing (2.6.1)

  • Loading branch information...
1 parent 4a1b4c3 commit 5940424c118c64a49b255daed6d27af80f0308bf @rozwell rozwell committed Oct 29, 2016
View
@@ -3,10 +3,12 @@ language: php
php:
- 5.3
- 5.4
+ - 5.5
+ - 5.6
+ - 7.0
env:
- - SYMFONY_VERSION=symfony-1.4.17
- - SYMFONY_VERSION=symfony-1.4.20
+ - SYMFONY_BRANCH=propel SYMFONY_REPOSITORY=https://github.com/rozwell/symfony1.git
before_script:
- ./prepare_tests.sh
Submodule phing updated 1053 files
Submodule propel updated 367 files
View
@@ -1,7 +1,11 @@
#!/usr/bin/env bash
-if [ -z $SYMFONY_VERSION ] ; then
- SYMFONY_VERSION="symfony-1.4.20"
+if [ -z $SYMFONY_REPOSITORY ] ; then
+ SYMFONY_REPOSITORY="https://github.com/rozwell/symfony1.git"
+fi
+
+if [ -z $SYMFONY_BRANCH ] ; then
+ SYMFONY_BRANCH="propel"
fi
PROJECT_NAME=mockproject
@@ -10,19 +14,16 @@ if [ -d "$PROJECT_NAME" ] ; then
rm -rf "$PROJECT_NAME"
fi
-git submodule update --init
+git submodule update --init --recursive
mkdir "$PROJECT_NAME"
cd "$PROJECT_NAME"
-if [ ! -f "$SYMFONY_VERSION.tgz" ] ; then
- wget "http://www.symfony-project.org/get/$SYMFONY_VERSION.tgz"
-fi
-
-tar xvf "$SYMFONY_VERSION.tgz"
-rm "$SYMFONY_VERSION.tgz"
-
mkdir -p lib/vendor/
-mv "$SYMFONY_VERSION" lib/vendor/symfony
+git clone --branch=$SYMFONY_BRANCH $SYMFONY_REPOSITORY lib/vendor/symfony
+cd lib/vendor/symfony
+git submodule update --init --recursive
+cd ../../../
-php ./lib/vendor/symfony/data/bin/symfony generate:project --installer=../test/bin/installer.php --orm=Propel "$PROJECT_NAME"
+php ./lib/vendor/symfony/data/bin/symfony generate:project --installer=../test/bin/installer.php --orm=none "$PROJECT_NAME"
+php ./lib/vendor/symfony/data/bin/symfony propel:install
@@ -0,0 +1,40 @@
+<?php
+
+class PropelInstallTask extends sfBaseTask
+{
+ protected function configure()
+ {
+ $this->namespace = 'propel';
+ $this->name = 'install';
+ $this->briefDescription = '';
+ $this->detailedDescription = '';
+ }
+
+ protected function execute($arguments = array(), $options = array())
+ {
+ $this->logSection('install', 'default to sqlite');
+ $this->runTask('configure:database', sprintf("'sqlite:%s/propel.db'", sfConfig::get('sf_data_dir')));
+
+ $this->logSection('install', 'fix sqlite database permissions');
+ touch(sfConfig::get('sf_data_dir').'/propel.db');
+ chmod(sfConfig::get('sf_data_dir'), 0777);
+ chmod(sfConfig::get('sf_data_dir').'/propel.db', 0777);
+
+ $this->logSection('install', 'setup propel behavior');
+ $ini_file = sfConfig::get('sf_config_dir').'/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.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);
+
+ $this->runTask('cache:clear');
+ }
+}
@@ -4,43 +4,20 @@
* @see http://www.symfony-project.org/blog/2009/06/10/new-in-symfony-1-3-project-creation-customization
*/
$fs = new sfFilesystem();
-$this->logSection('install', 'default to propel');
-$this->logSection('install', 'default to sqlite');
-$this->runTask('configure:database', sprintf("'sqlite:%spropel.db'", sfConfig::get('sf_data_dir') . DIRECTORY_SEPARATOR));
+$fs->mkdirs(sfConfig::get('sf_plugins_dir').'/sfPropelORMPlugin');
-$this->logSection('install', 'fix sqlite database permissions');
-touch(sfConfig::get('sf_data_dir') . DIRECTORY_SEPARATOR .'propel.db');
-chmod(sfConfig::get('sf_data_dir'), 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->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');
+$root_dir = realpath(sfConfig::get('sf_root_dir').'/../');
+$plugin_dir = realpath(sfConfig::get('sf_plugins_dir').'/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'). 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.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;
+include dirname(__FILE__).'/../../config/installer.php';
-file_put_contents($ini_file, $content);
+$fs->mkdirs($task_dir = sfConfig::get('sf_lib_dir').'/task');
+$fs->copy(dirname(__FILE__).'/PropelInstallTask.class.php', $task_dir.'/PropelInstallTask.class.php');
$this->runTask('cache:clear');
@@ -12,7 +12,7 @@
require_once SF_DIR . 'test/bootstrap/unit.php';
require_once SF_DIR . 'lib/autoload/sfSimpleAutoload.class.php';
-$autoload = sfSimpleAutoload::getInstance(sys_get_temp_dir().DIRECTORY_SEPARATOR.sprintf('sf_autoload_unit_propel_%s.data', md5(__FILE__)));
+$autoload = sfSimpleAutoload::getInstance(sys_get_temp_dir().'/'.sprintf('sf_autoload_unit_propel_%s.data', md5(__FILE__)));
$autoload->addDirectory(realpath(dirname(__FILE__).'/../../lib'));
$autoload->addDirectory(realpath(dirname(__FILE__).'/../../lib/vendor/propel'));
$autoload->addDirectory(realpath(dirname(__FILE__).'/../../lib/vendor/phing/classes'));
@@ -14,7 +14,11 @@
class ProjectConfiguration extends sfProjectConfiguration
{
- protected $plugins = array('sfPropelPlugin');
+ public function setup()
+ {
+ $this->enablePlugins('sfPropelORMPlugin');
+ sfConfig::set('sf_plugins_dir', sfConfig::get('sf_root_dir').'/../../../');
+ }
}
new ProjectConfiguration();
@@ -40,6 +44,7 @@ class ProjectConfiguration extends sfProjectConfiguration
'queries' => array(),
),
),
+ 'slaves' => array(),
),
'default' => 'propel',
),
@@ -15,13 +15,16 @@ class MockModel extends BaseObject {
}
class MockPeer {
+ const TM_CLASS = 'MockModelTableMap';
static public function translateFieldName($name, $fromType, $toType)
{
$inflector = new sfInflector();
return ucfirst($inflector->camelize($name));
}
}
-class MockMergedPeer extends MockPeer {}
+class MockMergedPeer extends MockPeer {
+ const TM_CLASS = 'MockMergedTableMap';
+}
class MockEmbeddedPeer extends MockPeer {}
class MockModelPeer extends MockPeer {}

0 comments on commit 5940424

Please sign in to comment.