Skip to content

Commit

Permalink
Merge pull request #13 from dachcom-digital/p11
Browse files Browse the repository at this point in the history
Pimcore 11 Support
  • Loading branch information
solverat authored Nov 7, 2023
2 parents be14e81 + 673cb31 commit 1b24a77
Show file tree
Hide file tree
Showing 165 changed files with 394 additions and 503 deletions.
32 changes: 21 additions & 11 deletions .github/workflows/codeception.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
TEST_PROJECT_ROOT_DIR: "${{ github.workspace }}"

PIMCORE_CODECEPTION_FRAMEWORK: "${{ github.workspace }}/pimcore-codeception-framework"
PIMCORE_CODECEPTION_VERSION: "2.0"
PIMCORE_CODECEPTION_VERSION: "3.0"

APP_ENV: test
PIMCORE_TEST_DB_DSN: "mysql://root:root@127.0.0.1:3306/dachcom_bundle_test"
PIMCORE_TEST_DB_DSN: "mysql://test:test@127.0.0.1:3306/dachcom_bundle_test"
PIMCORE_TEST_URL: "http://localhost"
PIMCORE_CLASS_DIRECTORY: "${{ github.workspace }}/lib/test-bundle/tests/_output/var/classes/DataObject"
PIMCORE_CLASS_DIRECTORY: "${{ github.workspace }}/lib/test-bundle/tests/_output/var/classes"

SYMFONY_DEPRECATIONS_HELPER: "weak"
PIMCORE_PHP_ERROR_REPORTING: 32767
Expand All @@ -38,12 +38,12 @@ jobs:
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
matrix:
php: [ 8.1 ]
symfony: [ ^5.4 ]
pimcore: [ ~10.6.0 ]
php: [ 8.2 ]
symfony: [ ^6.2 ]
pimcore: [ ~11.0.0 ]
include:
- pimcore: ~10.6.0
template_tag: v10.2.5
- pimcore: ~11.0.0
template_tag: v11.0.0
steps:
- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -82,9 +82,19 @@ jobs:
run: php -v

- name: Setup MySql
run: |
sudo systemctl start mysql
mysql -uroot -proot -h127.0.0.1 -e "CREATE DATABASE dachcom_bundle_test CHARSET=utf8mb4;"
uses: shogo82148/actions-setup-mysql@v1
with:
mysql-version: '8.0'
user: test
password: test
root-password: root
auto-start: true
my-cnf: |
max_allowed_packet=32505856
max_connections=1000
- name: Initial Database
run: mysql -utest -ptest -h127.0.0.1 -e 'CREATE DATABASE dachcom_bundle_test CHARSET=utf8mb4;'

- name: Setup Chromium
run: |
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/ecs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
TEST_PROJECT_ROOT_DIR: "${{ github.workspace }}"

PIMCORE_CODECEPTION_FRAMEWORK: "${{ github.workspace }}/pimcore-codeception-framework"
PIMCORE_CODECEPTION_VERSION: "2.0"
PIMCORE_CODECEPTION_VERSION: "3.0"

APP_ENV: test
PIMCORE_TEST_DB_DSN: "mysql://root:[email protected]:3306/dachcom_bundle_test"
Expand All @@ -37,12 +37,12 @@ jobs:
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
matrix:
php: [ 8.1 ]
symfony: [ ^5.4 ]
pimcore: [ ~10.6.0 ]
php: [ 8.2 ]
symfony: [ ^6.2 ]
pimcore: [ ~11.0.0 ]
include:
- pimcore: ~10.6.0
template_tag: v10.2.5
- pimcore: ~11.0.0
template_tag: v11.0.0
steps:
- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -114,4 +114,4 @@ jobs:
continue-on-error: true
run: |
bin/console cache:warmup --env=test
vendor/bin/ecs check ${{ github.workspace }}/lib/test-bundle/src/SocialDataBundle --config ${{ github.workspace }}/lib/test-bundle/ecs.php
vendor/bin/ecs check ${{ github.workspace }}/lib/test-bundle/src --config ${{ github.workspace }}/lib/test-bundle/ecs.php
12 changes: 6 additions & 6 deletions .github/workflows/php-stan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
TEST_PROJECT_ROOT_DIR: "${{ github.workspace }}"

PIMCORE_CODECEPTION_FRAMEWORK: "${{ github.workspace }}/pimcore-codeception-framework"
PIMCORE_CODECEPTION_VERSION: "2.0"
PIMCORE_CODECEPTION_VERSION: "3.0"

APP_ENV: test
PIMCORE_TEST_DB_DSN: "mysql://root:[email protected]:3306/dachcom_bundle_test"
Expand All @@ -37,12 +37,12 @@ jobs:
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
matrix:
php: [ 8.1 ]
symfony: [ ^5.4 ]
pimcore: [ ~10.6.0 ]
php: [ 8.2 ]
symfony: [ ^6.2 ]
pimcore: [ ~11.0.0 ]
include:
- pimcore: ~10.6.0
template_tag: v10.2.5
- pimcore: ~11.0.0
template_tag: v11.0.0
steps:
- uses: actions/checkout@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ php-cgi.core
/tests/_output/*
/tests/_data/*
!/tests/_data/.gitkeep
/tests/_support/_generated/*
/tests/Support/_generated/*
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# License
Copyright (C) 2022 DACHCOM.DIGITAL
Copyright (C) 2023 DACHCOM.DIGITAL

This software is available under the GNU General Public License version 3 (GPLv3).

Expand Down
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,25 @@ This Bundles allows you to load social data from different networks like Faceboo
### Release Plan
| Release | Supported Pimcore Versions | Supported Symfony Versions | Release Date | Maintained | Branch |
|---------|----------------------------|----------------------------|--------------|----------------|------------------------------------------------------------------------|
| **2.x** | `10.1` - `10.6` | `5.4` | 05.01.2022 | Feature Branch | master |
| **3.x** | `11.0` | `6.2` | -- | Feature Branch | master |
| **2.x** | `10.1` - `10.6` | `5.4` | 05.01.2022 | Unsupported | [2.x](https://github.com/dachcom-digital/pimcore-social-data/tree/2.x) |
| **1.x** | `6.0` - `6.9` | `3.4`, `^4.4` | 27.04.2020 | Unsupported | [1.x](https://github.com/dachcom-digital/pimcore-social-data/tree/1.x) |

## Installation

```json
"require" : {
"dachcom-digital/social-data" : "~2.0.0",
"dachcom-digital/social-data" : "~3.0.0",
}
```

- Execute: `$ bin/console pimcore:bundle:enable SocialDataBundle`
Add Bundle to `bundles.php`:
```php
return [
SocialDataBundle\SocialDataBundle::class => ['all' => true],
];
```

- Execute: `$ bin/console pimcore:bundle:install SocialDataBundle`

## Upgrading
Expand Down
5 changes: 2 additions & 3 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Upgrade Notes

## Migrating from Version 1.x to Version 2.0.0
## Migrating from Version 2.x to Version 3.0.0

### Global Changes
- PHP8 return type declarations added: you may have to adjust your extensions accordingly
- Re-save `SocialPost` data object to add/update type declarations
- Recommended folder structure by symfony adopted
9 changes: 5 additions & 4 deletions codeception.dist.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
namespace: DachcomBundle\Test
support_namespace: Support
actor: Tester
paths:
tests: tests
output: tests/_output
data: tests/_data
support: tests/_support
envs: tests/_envs
output: tests/_output
log: tests/_output/var/logs
data: tests/_data
support: tests/Support
bootstrap: _bootstrap.php
settings:
bootstrap: _bootstrap.php
memory_limit: -1
colors: true
params:
Expand Down
13 changes: 7 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"autoload": {
"psr-4": {
"SocialDataBundle\\": "src/SocialDataBundle"
"SocialDataBundle\\": "src/"
}
},
"autoload-dev": {
Expand All @@ -30,17 +30,18 @@
]
},
"branch-alias": {
"dev-master": "2.x-dev"
"dev-master": "3.x-dev"
}
},
"require": {
"pimcore/pimcore": "^10.1",
"pimcore/pimcore": "^11.0",
"symfony/form": "^6.2",
"doctrine/orm": "^2.7"
},
"require-dev": {
"codeception/codeception": "^4.1",
"codeception/module-webdriver": "^1.4",
"codeception/module-symfony": "^1.6",
"codeception/codeception": "^5.0",
"codeception/module-symfony": "^3.1",
"codeception/module-webdriver": "^4.0",
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-symfony": "^1.0",
"symplify/easy-coding-standard": "^9.0"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"bodyStyle": null,
"datatype": "layout",
"permissions": null,
"childs": [
"children": [
{
"fieldtype": "panel",
"labelWidth": 100,
Expand All @@ -41,7 +41,7 @@
"bodyStyle": "",
"datatype": "layout",
"permissions": null,
"childs": [
"children": [
{
"fieldtype": "input",
"width": null,
Expand Down Expand Up @@ -166,7 +166,7 @@
"bodyStyle": "",
"datatype": "layout",
"permissions": null,
"childs": [
"children": [
{
"fieldtype": "textarea",
"width": 250,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
doctrine_migrations:
migrations_paths:
'SocialDataBundle\Migrations': '@SocialDataBundle/src/Migrations'

doctrine:
orm:
auto_generate_proxy_classes: '%kernel.debug%'
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions config/services.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
imports:
- { resource: services/*.yaml }
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
public: true

SocialDataBundle\Controller\:
resource: '../../Controller'
resource: '../../src/Controller'
public: true
autowire: true
autoconfigure: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ services:
autoconfigure: true
public: false

SocialDataBundle\EventListener\Admin\AssetListener:
tags:
- { name: kernel.event_subscriber }

SocialDataBundle\EventListener\FeedPostListener:
tags:
- { name: kernel.event_subscriber }
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ parameters:
symfony:
container_xml_path: %currentWorkingDirectory%/var/cache/test/TestKernelTestDebugContainer.xml
constant_hassers: false
excludes_analyse: []
excludePaths: []
ignoreErrors: []
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,34 +1,27 @@
pimcore.registerNS('pimcore.plugin.SocialData');
class SocialDataCore {

pimcore.plugin.SocialData = Class.create(pimcore.plugin.admin, {
constructor() {

getClassName: function () {
return 'pimcore.plugin.SocialData';
},
if (String.prototype.format) {
return;
}

initialize: function () {
pimcore.plugin.broker.registerPlugin(this);
String.prototype.format = function () {

if (!String.prototype.format) {
String.prototype.format = function () {
var args = arguments;
return this.replace(/{(\d+)}/g, function (match, number) {
return typeof args[number] != 'undefined'
? args[number]
: match
;
});
};
}
},
let args = arguments;

uninstall: function () {
// void
},
return this.replace(/{(\d+)}/g, function (match, number) {
return typeof args[number] != 'undefined'
? args[number]
: match
;
});
};
}

pimcoreReady: function (params, broker) {
init() {

var subMenu = [],
let subMenu = [],
user = pimcore.globalmanager.get('user');

if (user.isAllowed('social_data_bundle_menu_settings')) {
Expand Down Expand Up @@ -61,24 +54,25 @@ pimcore.plugin.SocialData = Class.create(pimcore.plugin.admin, {
}
});
}
},
}

openSettingsPanel: function () {
openSettingsPanel() {
try {
pimcore.globalmanager.get('social_data_bundle_settings').activate();
} catch (e) {
pimcore.globalmanager.add('social_data_bundle_settings', new SocialData.SettingsPanel());
}
},
}

openWallsPanel: function () {
openWallsPanel() {
try {
pimcore.globalmanager.get('social_data_bundle_walls').activate();
} catch (e) {
pimcore.globalmanager.add('social_data_bundle_walls', new SocialData.WallsPanel());
}
}
}

});
const socialDataCoreHandler = new SocialDataCore();

new pimcore.plugin.SocialData();
document.addEventListener(pimcore.events.pimcoreReady, socialDataCoreHandler.init.bind(socialDataCoreHandler));
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,8 @@ class FetchSocialPostsCommand extends Command
protected static $defaultName = 'social-data:fetch:social-posts';
protected static $defaultDescription = 'Fetch Social Posts';

protected SocialPostBuilderProcessor $socialPostBuilderProcessor;

public function __construct(SocialPostBuilderProcessor $socialPostBuilderProcessor)
public function __construct(protected SocialPostBuilderProcessor $socialPostBuilderProcessor)
{
$this->socialPostBuilderProcessor = $socialPostBuilderProcessor;

parent::__construct();
}

Expand Down
Loading

0 comments on commit 1b24a77

Please sign in to comment.