Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade/propel beta1 #7272

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ module.exports = function (grunt) {
"!Images/Person/thumbnails/*.jpg",
"!composer.lock",
"!Include/Config.php",
"!propel/propel.php",
"!propel/config.php",
"!integrityCheck.json",
],
dest: "churchcrm/",
Expand Down
11 changes: 6 additions & 5 deletions src/ChurchCRM/Bootstrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,15 @@ private static function initPropel(): void
// ==== ORM
self::$dbClassName = '\\' . ConnectionWrapper::class;
self::$serviceContainer = Propel::getServiceContainer();
self::$serviceContainer->checkVersion('2.0.0-dev');
self::$serviceContainer->checkVersion(2);
self::$serviceContainer->setAdapterClass('default', 'mysql');
self::$manager = new ConnectionManagerSingle();
self::$manager = new ConnectionManagerSingle('default');
self::$manager->setConfiguration(self::buildConnectionManagerConfig());
self::$manager->setName('default');
self::$serviceContainer->setConnectionManager('default', self::$manager);
self::$serviceContainer->setDefaultDatasource('default');
self::$bootStrapLogger->debug("Initialized Propel ORM");

require_once __DIR__ . '/loadDatabase.php';
}
private static function isDatabaseEmpty(): bool
{
Expand Down Expand Up @@ -262,10 +263,10 @@ private static function buildConnectionManagerConfig(): array
'dsn' => Bootstrapper::getDSN(),
'user' => self::$databaseUser,
'password' => self::$databasePassword,
'settings' => [
'settings' => array (
'charset' => 'utf8mb4',
'queries' => ["SET sql_mode=(SELECT REPLACE(REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''),'NO_ZERO_DATE',''))"],
],
),
'classname' => self::$dbClassName,
'model_paths' => [
0 => 'src',
Expand Down
54 changes: 54 additions & 0 deletions src/ChurchCRM/loadDatabase.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?php

$serviceContainer = \Propel\Runtime\Propel::getServiceContainer();
$serviceContainer->initDatabaseMaps(array(
'default' =>
array(
0 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\CalendarEventTableMap',
1 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\CalendarTableMap',
2 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\ConfigTableMap',
3 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\DepositTableMap',
4 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\DonatedItemTableMap',
5 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\DonationFundTableMap',
6 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\EgiveTableMap',
7 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\EmailMessagePendingTableMap',
8 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\EmailRecipientPendingTableMap',
9 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\EventAttendTableMap',
10 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\EventAudienceTableMap',
11 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\EventCountNameTableMap',
12 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\EventCountsTableMap',
13 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\EventTableMap',
14 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\EventTypeTableMap',
15 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\FamilyCustomMasterTableMap',
16 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\FamilyCustomTableMap',
17 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\FamilyTableMap',
18 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\FundRaiserTableMap',
19 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\GroupPropMasterTableMap',
20 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\GroupTableMap',
21 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\KioskAssignmentTableMap',
22 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\KioskDeviceTableMap',
23 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\ListOptionTableMap',
24 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\LocationTableMap',
25 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\MenuLinkTableMap',
26 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\NoteTableMap',
27 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\Person2group2roleP2g2rTableMap',
28 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\PersonCustomMasterTableMap',
29 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\PersonCustomTableMap',
30 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\PersonTableMap',
31 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\PersonVolunteerOpportunityTableMap',
32 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\PledgeTableMap',
33 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\PredefinedReportsTableMap',
34 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\PropertyTableMap',
35 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\PropertyTypeTableMap',
36 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\QueryParameterOptionsTableMap',
37 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\QueryParametersTableMap',
38 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\RecordPropertyTableMap',
39 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\TokenTableMap',
40 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\UserConfigTableMap',
41 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\UserSettingTableMap',
42 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\UserTableMap',
43 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\VersionTableMap',
44 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\VolunteerOpportunityTableMap',
45 => '\\ChurchCRM\\model\\ChurchCRM\\Map\\WhyCameTableMap',
),
));
2 changes: 1 addition & 1 deletion src/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"php-http/message": "^1.11.1",
"phpmailer/phpmailer": "^6.9.1",
"pragmarx/google2fa": "^8.0.1",
"propel/propel": "2.0.0-alpha12",
"propel/propel": "2.0.0-beta1",
"setasign/fpdf": "^1.8.6",
"slim/http-cache": "^1.1.0",
"slim/php-view": "^3.2.0",
Expand Down
16 changes: 8 additions & 8 deletions src/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions src/propel/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

use Propel\Runtime\Propel;
use Propel\Runtime\Connection\ConnectionManagerSingle;

$serviceContainer = Propel::getServiceContainer();
$serviceContainer->checkVersion(2);
$serviceContainer->setAdapterClass('default', 'mysql');
$manager = new ConnectionManagerSingle("default");
$manager->setName('dattabase');
$manager->setConfiguration(array(
'dsn' => 'mysql:host=database;port=3306;dbname=churchcrm',
'user' => 'churchcrm',
'password' => 'changeme',
'settings' =>
array(
'charset' => 'utf8',
'queries' =>
array(
),
),
'classname' => '\\Propel\\Runtime\\Connection\\ConnectionWrapper',
'model_paths' =>
array(
0 => 'src',
1 => 'vendor',
),
));
$serviceContainer->setConnectionManager($manager);
$serviceContainer->setDefaultDatasource('default');
require_once __DIR__ . '/./loadDatabase.php';
24 changes: 0 additions & 24 deletions src/propel/propel.php

This file was deleted.

35 changes: 0 additions & 35 deletions src/propel/propel.php.dist

This file was deleted.

4 changes: 2 additions & 2 deletions src/propel/schema.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<database name="default" defaultIdMethod="native" defaultPhpNamingMethod="underscore" nameSpace="ChurchCRM\model\ChurchCRM">
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<database name="churchcrm" defaultIdMethod="native" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" defaultPhpNamingMethod="underscore" nameSpace="ChurchCRM\model\ChurchCRM">

<table name="version_ver" idMethod="native" phpName="Version" description="History of all version upgrades applied to this database">
<column name="ver_ID" phpName="Id" type="SMALLINT" size="9" sqlType="mediumint(9) unsigned" primaryKey="true"
Expand Down
Loading