Skip to content

Commit 0d439fa

Browse files
authored
Merge pull request #5 from dachcom-digital/p11
2 parents a50b677 + b92ccfd commit 0d439fa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2928
-231
lines changed

.github/workflows/codeception.yml

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ jobs:
1515
TEST_PROJECT_ROOT_DIR: "${{ github.workspace }}"
1616

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

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

2525
SYMFONY_DEPRECATIONS_HELPER: "weak"
2626
PIMCORE_PHP_ERROR_REPORTING: 32767
@@ -38,12 +38,12 @@ jobs:
3838
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
3939
strategy:
4040
matrix:
41-
php: [ 8.1 ]
42-
symfony: [ ^5.4 ]
43-
pimcore: [ ~10.6.0 ]
41+
php: [ 8.2 ]
42+
symfony: [ ^6.2 ]
43+
pimcore: [ ~11.0.0 ]
4444
include:
45-
- pimcore: ~10.6.0
46-
template_tag: v10.2.5
45+
- pimcore: ~11.0.0
46+
template_tag: v11.0.0
4747
steps:
4848
- uses: actions/checkout@v2
4949
with:
@@ -82,9 +82,19 @@ jobs:
8282
run: php -v
8383

8484
- name: Setup MySql
85-
run: |
86-
sudo systemctl start mysql
87-
mysql -uroot -proot -h127.0.0.1 -e "CREATE DATABASE dachcom_bundle_test CHARSET=utf8mb4;"
85+
uses: shogo82148/actions-setup-mysql@v1
86+
with:
87+
mysql-version: '8.0'
88+
user: test
89+
password: test
90+
root-password: root
91+
auto-start: true
92+
my-cnf: |
93+
max_allowed_packet=32505856
94+
max_connections=1000
95+
96+
- name: Initial Database
97+
run: mysql -utest -ptest -h127.0.0.1 -e 'CREATE DATABASE dachcom_bundle_test CHARSET=utf8mb4;'
8898

8999
- name: Setup Chromium
90100
run: |
@@ -115,7 +125,7 @@ jobs:
115125
run: |
116126
composer config "minimum-stability" "dev"
117127
composer config "prefer-stable" true
118-
sed -i 's,\("dachcom-digital\/social-data"\): "\(.*\)",\1: "2.x-dev",g' ${{ github.workspace }}/lib/test-bundle/composer.json
128+
sed -i 's,\("dachcom-digital\/social-data"\): "\(.*\)",\1: "3.x-dev",g' ${{ github.workspace }}/lib/test-bundle/composer.json
119129
chmod +x ./pimcore-codeception-framework/src/_etc/scripts/composer.sh
120130
./pimcore-codeception-framework/src/_etc/scripts/composer.sh
121131

.github/workflows/ecs.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
TEST_PROJECT_ROOT_DIR: "${{ github.workspace }}"
1616

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

2020
APP_ENV: test
2121
PIMCORE_TEST_DB_DSN: "mysql://root:root@127.0.0.1:3306/dachcom_bundle_test"
@@ -37,12 +37,12 @@ jobs:
3737
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
3838
strategy:
3939
matrix:
40-
php: [ 8.1 ]
41-
symfony: [ ^5.4 ]
42-
pimcore: [ ~10.6.0 ]
40+
php: [ 8.2 ]
41+
symfony: [ ^6.2 ]
42+
pimcore: [ ~11.0.0 ]
4343
include:
44-
- pimcore: ~10.6.0
45-
template_tag: v10.2.5
44+
- pimcore: ~11.0.0
45+
template_tag: v11.0.0
4646
steps:
4747
- uses: actions/checkout@v2
4848
with:
@@ -105,7 +105,7 @@ jobs:
105105
run: |
106106
composer config "minimum-stability" "dev"
107107
composer config "prefer-stable" true
108-
sed -i 's,\("dachcom-digital\/social-data"\): "\(.*\)",\1: "2.x-dev",g' ${{ github.workspace }}/lib/test-bundle/composer.json
108+
sed -i 's,\("dachcom-digital\/social-data"\): "\(.*\)",\1: "3.x-dev",g' ${{ github.workspace }}/lib/test-bundle/composer.json
109109
chmod +x ./pimcore-codeception-framework/src/_etc/scripts/composer.sh
110110
./pimcore-codeception-framework/src/_etc/scripts/composer.sh
111111

.github/workflows/php-stan.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
TEST_PROJECT_ROOT_DIR: "${{ github.workspace }}"
1616

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

2020
APP_ENV: test
2121
PIMCORE_TEST_DB_DSN: "mysql://root:root@127.0.0.1:3306/dachcom_bundle_test"
@@ -37,12 +37,12 @@ jobs:
3737
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
3838
strategy:
3939
matrix:
40-
php: [ 8.1 ]
41-
symfony: [ ^5.4 ]
42-
pimcore: [ ~10.6.0 ]
40+
php: [ 8.2 ]
41+
symfony: [ ^6.2 ]
42+
pimcore: [ ~11.0.0 ]
4343
include:
44-
- pimcore: ~10.6.0
45-
template_tag: v10.2.5
44+
- pimcore: ~11.0.0
45+
template_tag: v11.0.0
4646
steps:
4747
- uses: actions/checkout@v2
4848
with:
@@ -105,7 +105,7 @@ jobs:
105105
run: |
106106
composer config "minimum-stability" "dev"
107107
composer config "prefer-stable" true
108-
sed -i 's,\("dachcom-digital\/social-data"\): "\(.*\)",\1: "2.x-dev",g' ${{ github.workspace }}/lib/test-bundle/composer.json
108+
sed -i 's,\("dachcom-digital\/social-data"\): "\(.*\)",\1: "3.x-dev",g' ${{ github.workspace }}/lib/test-bundle/composer.json
109109
chmod +x ./pimcore-codeception-framework/src/_etc/scripts/composer.sh
110110
./pimcore-codeception-framework/src/_etc/scripts/composer.sh
111111

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# License
2-
Copyright (C) 2020 DACHCOM.DIGITAL
2+
Copyright (C) 2023 DACHCOM.DIGITAL
33

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

README.md

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,42 +12,32 @@ This Connector allows you to fetch social posts from LinkedIn.
1212
### Release Plan
1313
| Release | Supported Pimcore Versions | Supported Symfony Versions | Release Date | Maintained | Branch |
1414
|---------|----------------------------|----------------------------|--------------|----------------|-------------------------------------------------------------------------------------------|
15-
| **2.x** | `10.1` - `10.6` | `5.4` | 05.01.2022 | Feature Branch | master |
15+
| **3.x** | `11.0` | `6.2` | 07.11.2023 | Feature Branch | master |
16+
| **2.x** | `10.1` - `10.6` | `5.4` | 05.01.2022 | Unsupported | [2.x](https://github.com/dachcom-digital/pimcore-social-data-linkedin-connector/tree/2.x) |
1617
| **1.x** | `6.0` - `6.9` | `3.4`, `^4.4` | 22.10.2020 | Unsupported | [1.x](https://github.com/dachcom-digital/pimcore-social-data-linkedin-connector/tree/1.x) |
1718

1819
## Installation
1920

20-
### I. Add Dependency
2121
```json
2222
"require" : {
23-
"dachcom-digital/social-data" : "~2.0.0",
24-
"dachcom-digital/social-data-linkedin-connector" : "~2.0.0",
23+
"dachcom-digital/social-data" : "~3.0.0",
24+
"dachcom-digital/social-data-linkedin-connector" : "~3.0.0"
2525
}
2626
```
2727

28-
### II. Register Connector Bundle
28+
Add Bundle to `bundles.php`:
2929
```php
30-
// src/Kernel.php
31-
namespace App;
32-
33-
use Pimcore\HttpKernel\BundleCollection\BundleCollection;
34-
35-
class Kernel extends \Pimcore\Kernel
36-
{
37-
public function registerBundlesToCollection(BundleCollection $collection)
38-
{
39-
$collection->addBundle(new SocialData\Connector\LinkedIn\SocialDataLinkedInConnectorBundle());
40-
}
41-
}
30+
return [
31+
SocialData\Connector\LinkedIn\SocialDataLinkedInConnectorBundle::class => ['all' => true],
32+
];
4233
```
4334

44-
### III. Install Assets
35+
### Install Assets
4536
```bash
4637
bin/console assets:install public --relative --symlink
4738
```
4839

4940
## Enable Connector
50-
5141
```yaml
5242
# config/packages/social_data.yaml
5343
social_data:
@@ -91,10 +81,10 @@ If everything worked out fine, the connection setup is complete after the popup
9181
Otherwise, you'll receive an error message. You may then need to repeat the connection step.
9282

9383
## Feed Configuration
94-
| Name | Description
95-
|------|----------------------|
96-
| `Company ID` | Set company id to fetch posts from |
97-
| `Limit` | Define a limit to restrict the amount of social posts to import (Default: 20) |
84+
| Name | Description |
85+
|--------------|-------------------------------------------------------------------------------|
86+
| `Company ID` | Set company id to fetch posts from |
87+
| `Limit` | Define a limit to restrict the amount of social posts to import (Default: 20) |
9888

9989
## Extended Connector Configuration
10090
Normally you don't need to modify connector (`connector_config`) configuration, so most of the time you can skip this step.

UPGRADE.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# Upgrade Notes
22

3-
## 2.0.1
4-
- [BUGFIX] fix assoc array check [#3](https://github.com/dachcom-digital/pimcore-social-data-linkedin-connector/pull/3)
5-
-
6-
## Migrating from Version 1.x to Version 2.0.0
3+
## Migrating from Version 2.x to Version 3.0.0
74

85
### Global Changes
9-
- PHP8 return type declarations added: you may have to adjust your extensions accordingly
6+
- Recommended folder structure by symfony adopted

codeception.dist.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
namespace: DachcomBundle\Test
2+
support_namespace: Support
23
actor: Tester
34
paths:
45
tests: tests
5-
output: tests/_output
6-
data: tests/_data
7-
support: tests/_support
86
envs: tests/_envs
7+
output: tests/_output
98
log: tests/_output/var/logs
9+
data: tests/_data
10+
support: tests/Support
11+
bootstrap: _bootstrap.php
1012
settings:
11-
bootstrap: _bootstrap.php
1213
memory_limit: -1
1314
colors: true
1415
params:

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@
3030
}
3131
},
3232
"require": {
33-
"dachcom-digital/social-data": "^2.0"
33+
"dachcom-digital/social-data": "^3.0"
3434
},
3535
"require-dev": {
36-
"codeception/codeception": "^4.1",
37-
"codeception/module-webdriver": "^1.4",
38-
"codeception/module-symfony": "^1.6",
36+
"codeception/codeception": "^5.0",
37+
"codeception/module-symfony": "^3.1",
38+
"codeception/module-webdriver": "^4.0",
3939
"phpstan/phpstan": "^1.0",
4040
"phpstan/phpstan-symfony": "^1.0",
4141
"symplify/easy-coding-standard": "^9.0"
File renamed without changes.

src/Resources/config/services.yml renamed to config/services.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,9 @@ services:
3737

3838
SocialData\Connector\LinkedIn\Controller\Admin\LinkedInController:
3939
tags: [ 'controller.service_arguments' ]
40+
41+
## Events
42+
43+
SocialData\Connector\LinkedIn\EventListener\Admin\AssetListener:
44+
tags:
45+
- { name: kernel.event_subscriber }

phpstan.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ parameters:
77
symfony:
88
container_xml_path: %currentWorkingDirectory%/var/cache/test/TestKernelTestDebugContainer.xml
99
constant_hassers: false
10-
excludes_analyse: []
10+
excludePaths: []
1111
ignoreErrors: []
File renamed without changes.
File renamed without changes.

src/Controller/Admin/LinkedInController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace SocialData\Connector\LinkedIn\Controller\Admin;
44

55
use Carbon\Carbon;
6-
use Pimcore\Bundle\AdminBundle\Controller\AdminController;
6+
use Pimcore\Bundle\AdminBundle\Controller\AdminAbstractController;
77
use SocialData\Connector\LinkedIn\Model\EngineConfiguration;
88
use SocialData\Connector\LinkedIn\Client\LinkedInClient;
99
use SocialDataBundle\Connector\ConnectorDefinitionInterface;
@@ -15,7 +15,7 @@
1515
use Symfony\Component\HttpFoundation\Response;
1616
use Symfony\Component\HttpKernel\Exception\HttpException;
1717

18-
class LinkedInController extends AdminController
18+
class LinkedInController extends AdminAbstractController
1919
{
2020
use ConnectResponseTrait;
2121

src/DependencyInjection/SocialDataLinkedInConnectorExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function load(array $configs, ContainerBuilder $container): void
1717
$configuration = new Configuration();
1818
$this->processConfiguration($configuration, $configs);
1919

20-
$loader = new YamlFileLoader($container, new FileLocator([__DIR__ . '/../Resources/config']));
21-
$loader->load('services.yml');
20+
$loader = new YamlFileLoader($container, new FileLocator([__DIR__ . '/../../config']));
21+
$loader->load('services.yaml');
2222
}
2323
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
namespace SocialData\Connector\LinkedIn\EventListener\Admin;
4+
5+
use Pimcore\Event\BundleManager\PathsEvent;
6+
use Pimcore\Event\BundleManagerEvents;
7+
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
8+
9+
class AssetListener implements EventSubscriberInterface
10+
{
11+
public static function getSubscribedEvents(): array
12+
{
13+
return [
14+
BundleManagerEvents::CSS_PATHS => 'addCssFiles',
15+
BundleManagerEvents::JS_PATHS => 'addJsFiles',
16+
];
17+
}
18+
19+
public function addCssFiles(PathsEvent $event): void
20+
{
21+
$event->addPaths([
22+
'/bundles/socialdatalinkedinconnector/css/admin.css'
23+
]);
24+
}
25+
26+
public function addJsFiles(PathsEvent $event): void
27+
{
28+
$event->addPaths([
29+
'/bundles/socialdatalinkedinconnector/js/connector/linkedin-connector.js',
30+
'/bundles/socialdatalinkedinconnector/js/feed/linkedin-feed.js',
31+
]);
32+
}
33+
}

src/SocialDataLinkedInConnectorBundle.php

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,22 @@
22

33
namespace SocialData\Connector\LinkedIn;
44

5-
use Pimcore\Extension\Bundle\AbstractPimcoreBundle;
65
use Pimcore\Extension\Bundle\Traits\PackageVersionTrait;
6+
use Symfony\Component\HttpKernel\Bundle\Bundle;
77

8-
class SocialDataLinkedInConnectorBundle extends AbstractPimcoreBundle
8+
class SocialDataLinkedInConnectorBundle extends Bundle
99
{
1010
use PackageVersionTrait;
1111

1212
public const PACKAGE_NAME = 'dachcom-digital/social-data-linkedin-connector';
1313

14-
protected function getComposerPackageName(): string
14+
public function getPath(): string
1515
{
16-
return self::PACKAGE_NAME;
16+
return \dirname(__DIR__);
1717
}
1818

19-
public function getCssPaths(): array
20-
{
21-
return [
22-
'/bundles/socialdatalinkedinconnector/css/admin.css'
23-
];
24-
}
25-
26-
public function getJsPaths(): array
19+
protected function getComposerPackageName(): string
2720
{
28-
return [
29-
'/bundles/socialdatalinkedinconnector/js/connector/linkedin-connector.js',
30-
'/bundles/socialdatalinkedinconnector/js/feed/linkedin-feed.js',
31-
];
21+
return self::PACKAGE_NAME;
3222
}
3323
}

tests/Functional.suite.dist.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
actor: FunctionalTester
2+
modules:
3+
enabled:
4+
- \Dachcom\Codeception\Support\Helper\PimcoreCore:
5+
connect_db: true
6+
rebootable_client: true
7+
- \Dachcom\Codeception\Support\Helper\PimcoreBundleCore:
8+
run_installer: true
9+
- \Dachcom\Codeception\Support\Helper\Browser\PhpBrowser:
10+
depends: \Dachcom\Codeception\Support\Helper\PimcoreCore
11+
- \Dachcom\Codeception\Support\Helper\PimcoreBackend
12+
- \Dachcom\Codeception\Support\Helper\PimcoreUser
File renamed without changes.

0 commit comments

Comments
 (0)