diff --git a/.github/ci/files/config/bundles.php b/.github/ci/files/config/bundles.php index 3a4f51529..a2e0070be 100644 --- a/.github/ci/files/config/bundles.php +++ b/.github/ci/files/config/bundles.php @@ -1,5 +1,5 @@ ['all' => true], + 'Pimcore\\Bundle\\StudioApiBundle\\PimcoreStudioApiBundle' => ['all' => true], ]; diff --git a/.github/ci/files/config/services.yaml b/.github/ci/files/config/services.yaml index 23f348848..6645972f9 100644 --- a/.github/ci/files/config/services.yaml +++ b/.github/ci/files/config/services.yaml @@ -10,14 +10,14 @@ services: # # INSTALLER # - Pimcore\Bundle\xTemplateBundlex\Installer: + Pimcore\Bundle\StudioApiBundle\Installer: public: true arguments: - $bundle: "@=service('kernel').getBundle('PimcorexTemplateBundlex')" + $bundle: "@=service('kernel').getBundle('PimcoreStudioApiBundle')" # controllers are imported separately to make sure they're public # and have a tag that allows actions to type-hint services - Pimcore\Bundle\xTemplateBundlex\Controller\: + Pimcore\Bundle\StudioApiBundle\Controller\: resource: '../src/Controller' public: true tags: [ 'controller.service_arguments' ] \ No newline at end of file diff --git a/README.md b/README.md index b7824b59e..50dba93b4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# x Template x +# Studio Api todo ## Features in a Nutshell diff --git a/codeception.dist.yml b/codeception.dist.yml index 475b188be..e0a17def9 100644 --- a/codeception.dist.yml +++ b/codeception.dist.yml @@ -1,4 +1,4 @@ -namespace: Pimcore\Bundle\xTemplateBundlex\Tests +namespace: Pimcore\Bundle\StudioApiBundle\Tests bootstrap: _bootstrap.php settings: @@ -21,4 +21,4 @@ coverage: - src/DependencyInjection/* - src/Repository/* - src/Installer.php - - src/PimcorexTemplateBundlex.php \ No newline at end of file + - src/PimcoreStudioApiBundle.php \ No newline at end of file diff --git a/composer.json b/composer.json index efa2a141e..6502f7459 100644 --- a/composer.json +++ b/composer.json @@ -1,8 +1,8 @@ { - "name": "pimcore/x-template-name-bundle-x", + "name": "pimcore/studio-api-bundle", "license": "Pimcore Enterprise License (PEL)", "type": "pimcore-bundle", - "description": "Pimcore xTemplate Bundlex", + "description": "Pimcore Studio Api Bundle", "config": { "discard-changes": true, "sort-packages": true, @@ -36,19 +36,19 @@ }, "autoload": { "psr-4": { - "Pimcore\\Bundle\\xTemplateBundlex\\": "src/", + "Pimcore\\Bundle\\StudioApiBundle\\": "src/", "Pimcore\\": "core-extension/Pimcore/" } }, "autoload-dev": { "psr-4": { - "Pimcore\\Bundle\\xTemplateBundlex\\Tests\\": "tests" + "Pimcore\\Bundle\\StudioApiBundle\\Tests\\": "tests" } }, "extra": { "pimcore": { "bundles": [ - "Pimcore\\Bundle\\xTemplateBundlex\\PimcorexTemplateBundlex" + "Pimcore\\Bundle\\StudioApiBundle\\PimcoreStudioApiBundle" ] } } diff --git a/config/services.yaml b/config/services.yaml index 3667ee694..8c98cca77 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -7,14 +7,14 @@ services: # # INSTALLER # - Pimcore\Bundle\xTemplateBundlex\Installer: + Pimcore\Bundle\StudioApiBundle\Installer: public: true arguments: - $bundle: "@=service('kernel').getBundle('PimcorexTemplateBundlex')" + $bundle: "@=service('kernel').getBundle('PimcoreStudioApiBundle')" # controllers are imported separately to make sure they're public # and have a tag that allows actions to type-hint services - Pimcore\Bundle\xTemplateBundlex\Controller\: + Pimcore\Bundle\StudioApiBundle\Controller\: resource: '../src/Controller' public: true tags: [ 'controller.service_arguments' ] \ No newline at end of file diff --git a/doc/01_Installation.md b/doc/01_Installation.md index 7d1b7fb92..ad670aaa6 100644 --- a/doc/01_Installation.md +++ b/doc/01_Installation.md @@ -1,4 +1,4 @@ -# Installation of the xTemplate Bundlex +# Installation of the Studio Api Bundle :::info @@ -8,21 +8,21 @@ ## Bundle Installation -To install the xTemplate Bundlex, follow the three steps below: +To install the Studio Api Bundle, follow the three steps below: 1) Install the required dependencies: ```bash -composer require pimcore/x-template-name-bundle-x +composer require pimcore/studio-api-bundle ``` 2) Make sure the bundle is enabled in the `config/bundles.php` file. The following lines should be added: ```php -use Pimcore\Bundle\xTemplateBundlex\PimcorexTemplateBundlex; +use Pimcore\Bundle\StudioApiBundle\PimcoreStudioApiBundle; // ... return [ // ... - xTemplateBundlex::class => ['all' => true], + StudioApiBundle::class => ['all' => true], // ... ]; ``` @@ -30,5 +30,5 @@ return [ 3) Install the bundle: ```bash -bin/console pimcore:bundle:install PimcorexTemplateBundlex +bin/console pimcore:bundle:install PimcoreStudioApiBundle ``` \ No newline at end of file diff --git a/placeholderReplace.sh b/placeholderReplace.sh deleted file mode 100644 index 1e86e60f7..000000000 --- a/placeholderReplace.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/bash - -# Array of all target strings -TARGET_STRINGS=( - "x-template-name-bundle-x" - "x_template_bundle_x" - "xTemplateBundlex" - "xTemplate Bundlex" - "xtemplate-bundlex" - "x_template_x" - "xtemplatex" - "x Template x" -) - - -# Check if sufficient arguments are provided -if [ "$#" -ne 1 ]; then - echo "Usage: $0 " - exit 1 -fi - -REAL_NAME_BUNDLE="$1" - -# Extract different components -NAME=$(echo "$REAL_NAME_BUNDLE" | awk -F"_bundle" '{print $1}') -BUNDLE="bundle$(echo "$REAL_NAME_BUNDLE" | awk -F"_bundle" '{if (NF>1) print "_" $2}')" - -# Derived formats -UPPER_CAMEL_NAME=$(echo "$NAME" | sed -r 's/(^|_)([a-z])/\U\2/g') -UPPER_CAMEL_BUNDLE=$(echo "$BUNDLE" | sed -r 's/(^|_)([a-z])/\U\2/g') - -SPACE_NAME=$(echo "$NAME" | sed 's/_/ /g') -SPACE_BUNDLE=$(echo "$BUNDLE" | sed 's/_/ /g') -CAPITALIZED_SPACE_NAME=$(echo "$SPACE_NAME" | awk '{ for(i=1;i<=NF;i++) $i=toupper(substr($i,1,1)) tolower(substr($i,2)); }1') - -DASH_NAME=$(echo "$NAME" | sed 's/_/-/g') -DASH_BUNDLE=$(echo "$BUNDLE" | sed 's/_/-/g') - -# Function to perform the replacements -perform_replacements() { - local FILE=$1 - sed -i -e "s/x-template-name-bundle-x/$(echo $NAME | sed 's/_/-/g')-bundle/g" "$FILE" - sed -i -e "s/xTemplateBundlex/${UPPER_CAMEL_NAME}Bundle/g" "$FILE" - sed -i -e "s/xTemplate Bundlex/${CAPITALIZED_SPACE_NAME} Bundle/g" "$FILE" - sed -i -e "s/xtemplate-bundlex/${NAME}-bundle/g" "$FILE" - sed -i -e "s/x_template_bundle_x/${REAL_NAME_BUNDLE}/g" "$FILE" - sed -i -e "s/x_template_x/${NAME}/g" "$FILE" - sed -i -e "s/xtemplatex/$(echo $NAME | sed 's/_//g')/g" "$FILE" - sed -i -e "s/x Template x/${CAPITALIZED_SPACE_NAME}/g" "$FILE" -} - - -# Check if a file contains any of the target strings -file_contains_target() { - local FILE=$1 - for target in "${TARGET_STRINGS[@]}"; do - grep -q "$target" "$FILE" && return 0 - done - return 1 -} - -# Find all files in the directory and perform replacements -# Only on files that contain the target strings -find . -type f | while read -r FILE; do - if file_contains_target "$FILE"; then - perform_replacements "$FILE" - fi - - # Rename files - if [[ "$FILE" == "./src/PimcorexTemplateBundlex.php" ]]; then - mv "$FILE" "./src/Pimcore${UPPER_CAMEL_NAME}Bundle.php"; - fi - -done - -echo "Replacements done!" diff --git a/src/Controller/DefaultController.php b/src/Controller/DefaultController.php index 450cdf060..04188c368 100644 --- a/src/Controller/DefaultController.php +++ b/src/Controller/DefaultController.php @@ -11,7 +11,7 @@ * @license http://www.pimcore.org/license PCL */ -namespace Pimcore\Bundle\xTemplateBundlex\Controller; +namespace Pimcore\Bundle\StudioApiBundle\Controller; use Symfony\Component\HttpFoundation\Response; diff --git a/src/Installer.php b/src/Installer.php index 33eeafcfb..ea5a77483 100644 --- a/src/Installer.php +++ b/src/Installer.php @@ -11,7 +11,7 @@ * @license http://www.pimcore.org/license PCL */ -namespace Pimcore\Bundle\xTemplateBundlex; +namespace Pimcore\Bundle\StudioApiBundle; use Pimcore\Extension\Bundle\Installer\SettingsStoreAwareInstaller; diff --git a/src/PimcorexTemplateBundlex.php b/src/PimcoreStudioApiBundle.php similarity index 92% rename from src/PimcorexTemplateBundlex.php rename to src/PimcoreStudioApiBundle.php index 04ba4149e..df3ce447c 100644 --- a/src/PimcorexTemplateBundlex.php +++ b/src/PimcoreStudioApiBundle.php @@ -11,14 +11,14 @@ * @license http://www.pimcore.org/license PCL */ -namespace Pimcore\Bundle\xTemplateBundlex; +namespace Pimcore\Bundle\StudioApiBundle; use Pimcore\Bundle\EnterpriseSubscriptionToolsBundle\Bundle\EnterpriseBundleInterface; use Pimcore\Bundle\EnterpriseSubscriptionToolsBundle\PimcoreEnterpriseSubscriptionToolsBundle; use Pimcore\Extension\Bundle\AbstractPimcoreBundle; use Pimcore\HttpKernel\BundleCollection\BundleCollection; -class PimcorexTemplateBundlex extends AbstractPimcoreBundle implements +class PimcoreStudioApiBundle extends AbstractPimcoreBundle implements EnterpriseBundleInterface { private const ENTERPRISE_BUNDLE_LICENSE_ID = 'xLicensex'; diff --git a/tests/Unit.suite.dist.yml b/tests/Unit.suite.dist.yml index f23e4f557..e28e40175 100644 --- a/tests/Unit.suite.dist.yml +++ b/tests/Unit.suite.dist.yml @@ -1 +1 @@ -suite_namespace: Pimcore\Bundle\xTemplateBundlex\Tests \ No newline at end of file +suite_namespace: Pimcore\Bundle\StudioApiBundle\Tests \ No newline at end of file diff --git a/tests/Unit/DefaultTest.php b/tests/Unit/DefaultTest.php index 79e0be7c4..446f94ed6 100644 --- a/tests/Unit/DefaultTest.php +++ b/tests/Unit/DefaultTest.php @@ -11,7 +11,7 @@ * @license http://www.pimcore.org/license PCL */ -namespace Pimcore\Bundle\xTemplateBundlex\Tests\Unit; +namespace Pimcore\Bundle\StudioApiBundle\Tests\Unit; use Codeception\Test\Unit;