Download the PHP package keboola/php-component without Composer

On this page you can find all versions of the php package keboola/php-component. 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 php-component

Keboola PHP Component

General library for php component running in KBC. The library provides function related to Docker Runner.

Installation

Usage

Create a subclass of BaseComponent.

Use this src/run.php template.

Sync actions support

Sync actions can be called directly via API. API will block and wait for the result. The correct action is selected based on the action key of config. BaseComponent class handles the selection automatically. Also it handles serialization and output of the action result - sync actions must output valid JSON.

To implement a sync action

Customizing config

Custom getters in config

You might want to add getter methods for custom parameters in the config. That way you don't need to remember exact keys (parameters.customKey.customSubKey), but instead use a method to retrieve the value ($config->getCustomSubKey()).

Simply create your own Config class, that extends BaseConfig and override \Keboola\Component\BaseComponent::getConfigClass() method to return your new class name.

and

Custom parameters validation

To validate input parameters extend \Keboola\Component\Config\BaseConfigDefinition class. By overriding the getParametersDefinition() method, you can validate the parameters part of the config. Make sure that you return the actual node you add, not TreeBuilder. You can use parent::getParametersDefinition() to get the default node or you can build it yourself.

If you need to validate other parts of config as well, you can override getRootDefinition() method. Again, make sure that you return the actual node, not the TreeBuilder.

Note: Your build may fail if you use PhpStan because of complicated type behavior of the \Symfony\Component\Config\Definition\Builder\ExprBuilder::end() method, so you may need to ignore some errors.

Again you need to supply the new class name in your component

If any constraint of config definition is not met a UserException is thrown. That means you don't need to handle the messages yourself.

Migration from version 6 to version 7

The default entrypoint of component (in index.php) changed from BaseComponent::run() to BaseComponent::execute(). Please also note, that the run method can no longer be public and can only be called from inside the component now.

More reading

For more information, please refer to the generated docs. See development guide for help with KBC integration.

License

MIT licensed, see LICENSE file.


All versions of php-component with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-json Version *
keboola/common-exceptions Version ^1.2
monolog/monolog Version ^2.3
symfony/config Version ^5.4|^6.0
symfony/filesystem Version ^5.4|^6.0
symfony/finder Version ^5.4|^6.0
symfony/property-access Version ^5.4|^6.0
symfony/serializer Version ^5.4|^6.0
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 keboola/php-component contains the following files

Loading the files please wait ....