Download the PHP package jtc-solutions/core without Composer

On this page you can find all versions of the php package jtc-solutions/core. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package core

JTC Solutions Core Bundle

This bundle provides a foundational set of services, base classes, and conventions used as a "skeleton" for most PHP Symfony projects developed at JTC Solutions. It aims to streamline development by offering reusable components for common tasks like CRUD operations, exception handling, and API documentation.

Installation

  1. Require the bundle using Composer:

  2. Enable the Bundle: Add the bundle to your config/bundles.php file:

Usage

  1. Entities:

    • Your application entities should implement JtcSolutions\Core\Entity\IEntity.
    • Use Ramsey\Uuid\UuidInterface for primary identifiers.
  2. Repositories:

    • Implement JtcSolutions\Core\Repository\IEntityRepository.
    • Extend JtcSolutions\Core\Repository\BaseRepository.
  3. Services:

    • Implement JtcSolutions\Core\Service\IEntityService for entities requiring CRUD operations.
    • Extend JtcSolutions\Core\Service\BaseEntityService to leverage built-in logic for handling creation, updates, and deletion via abstract methods (mapDataAndCallCreate, mapDataAndCallUpdate, delete).
    • Inject the corresponding repository into your service.
  4. Controllers:

    • Extend JtcSolutions\Core\Controller\BaseController for AbstractController from Symfony, with the possibility of future improvements.
    • For controllers handling standard entity CRUD, extend JtcSolutions\Core\Controller\BaseEntityCRUDController. Inject the corresponding IEntityService. This base controller provides protected methods (handleCreate, handleUpdate, handleDelete) that validate request DTOs and call the service.
  5. Request Data Transfer Objects (DTOs):

    • For request bodies used in create/update operations handled by BaseEntityCRUDController/BaseEntityService, implement JtcSolutions\Core\Dto\IEntityRequestBody.
    • Use Symfony's Validator component constraints on your DTO properties.
  6. Exception Handling & Translations:

    • The ExceptionListener is enabled by default and will catch exceptions.
    • It automatically converts TranslatableException types and standard HTTP exceptions into ErrorRequestJsonResponse.
    • Provide translations for the exception keys in the configured translation domain (default: exceptions). Keys follow the pattern core.<type>.title, core.<type>.message for standard HTTP errors and custom.<translation_code>.title, custom.<translation_code>.message for TranslatableException types. Example translation file (translations/exceptions.en.yaml):
  7. Parameter Resolvers:
    • Entity Resolver: If enabled (default), controller actions can directly type-hint arguments with an IEntity implementation (e.g., public function show(Product $product)). If a route parameter {product} exists, the resolver will fetch the Product using its repository's find() method.
    • UUID Resolver: If enabled (default), controller actions can type-hint arguments with UuidInterface (e.g., public function list(UuidInterface $categoryId)). The resolver will attempt to create a Uuid object from a query parameter with the same name (?categoryId=...).

Configuration

Configure the bundle under the jtc_solutions_core key in your config/packages/jtc_solutions_core.yaml (or any other config file).


# config/packages/jtc_solutions_core.yaml
jtc_solutions_core:
    # Parameter Resolver Configuration
    param_resolvers:
        uuid_resolver:
            # Enable/disable the UuidQueryParamResolver (default: true)
            enable: true
        entity_resolver:
            # Enable/disable the EntityParamResolver (default: true)
            enable: true

    # Listener Configuration
    listeners:
        exception_listener:
            # Enable/disable the ExceptionListener (default: true)
            enable: true
            # Set the translation domain for exception messages (default: 'exceptions')
            translation_domain: 'exceptions'

    # OpenAPI / NelmioApiDocBundle Integration
    open_api:
        property_describers:
            uuid_interface_property_describer:
                # Enable/disable the describer for UuidInterface (default: true)
                enable: true

All versions of core with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
symfony/framework-bundle Version 7.2.*
symfony/validator Version ^7.2
symfony/serializer Version ^7.2
symfony/http-foundation Version ^7.2
ramsey/uuid Version ^4.7
doctrine/orm Version ^3.3
jtc-solutions/helpers Version ^0.2.0
symfony/yaml Version ^7.2
symfony/translation Version ^7.2
symfony/property-info Version ^7.2
nelmio/api-doc-bundle Version ^5.0
symfony/messenger Version ^7.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package jtc-solutions/core contains the following files

Loading the files please wait ...