Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Base Command Bundle Laravel Package

afrihost/base-command-bundle

Symfony bundle providing an opinionated base class for console commands to reduce boilerplate. Adds built-in initialization for common needs like logging and locking, with global defaults via config and per-command or runtime overrides for flexible behavior.

View on GitHub
Deep Wiki
Context7
v1.1.1

Overview

Patch release to enforce dropping of support for PHP 7.0

v1.1.0

Overview

Symfony 4 support!

Details

This release introduced support for Symfony 4 while still maintaining support for Symfony 3. In the process we have dropped support for PHP 7.0 and HHVM but added Travis CI test coverage for PHP 7.3 and 7.4

v1.0.0

Overview

Symfony 3 support!

Details

With this major version bump, we now support Symfony 3. In the process, we have have removed support for PHP 5 and Symfony 2 on the latest version. If you still require these, you can continue to use the Zero Version (~0.6) which will get important bug and security fixes but will not have features backported

v0.6.3

Overview

Stable release supporting Symfony 2 and PHP 5.

Details

Note: Support for Symfony 2 and PHP 5 is still available under version zero (~0.6). We will continue to publish any important bug and security fixes as point releases on this version, however, new features will not be backported. The current version supports Symfony ~3.0 and PHP ~7.0

v0.6.2

Overview

This point release removes test files from the distributed version of the library.

Details

If composer is run with the --prefer-dist parameter, our Tests directory will not be included in the vendors directory of your project. This should help with some IDEs that are confused by the bundled test Symfony Application.

v0.6.1

This point release changes the name of lock files from being based on the name of the implementing class to being based on the name of the log file.

The premise is that if a command is logging to a separate file, it likely has its own purpose and thus needs its own lock. An example might be is a command spawns copies of itself to do processing in parallel.

The functionality will be made more configurable in a minor release

v0.6.0

This release adds functionality configure whether line breaks are stripped from log entries

Logging

  • Add global allow_line_breaks configuration option for each hander strategy
  • Getters and Setters for the above

General

v0.5.0

This release is the result of a refactoring of the locking functionality and some nice community contributions.

Output Icons

  • A new feature has been added that provides a fluent interface for building Unicode icons to use in your logs, output and anywhere else you'd like to add some flair to your test
  • There is a choice of thirty icons (including 💩 :) which can be styled with colour and background colour.
  • This functionality fails gracefully if your PHP environment does not support Unicode

General

  • You no longer need to call parent::configure() when providing your own configure() function. This was achieved via moving the logic in to an onConsoleCommand event. This fixes a range of errors resulting from inconsistent configuration
  • [BC] An exception is now explicitly thrown after execution if you have attempted to catch an exception during initialization and continue execution as this behaviour cannot be supported going forward

Locking

  • Support for tildes (~) in the lock file folder has been fixed. The tilde was previously not being expand to the user's home directory properly
  • Added support for absolute paths for the lock file folder under Windows
  • [BC] If the configured lock file folder is outside of the project directory, an exception will be thrown if it does not already exist as a safety precaution

Development

  • A console entry point to the bundled test Application has been added. This allows the Symfony cache to be cleared and for fixture commands to be run outside of PHPUnit
v0.4.0

This release contains a bunch of features that were a result of a refactor of the logging functionality to achieve configuration consistency.

General

  • Errors that are focused at the user of the bundle are now all thrown as the new BaseCommandException
  • [BC] A BaseCommandException is now thrown if the same command object is executed twice. This is a protection mechanism as the configuration and class variables are not reset in between executions and thus unintentionally running the same object twice will likely have unintended results.
  • The above protection mechanism can be explicitly disabled through the setAllowMultipleExecution() function
  • It is now explicitly checked that the BaseCommand's version of the configure() function is called in overridden versions of the function
  • Similarly it is checked the the initialize() function in BaseCommand is also called to help the user in debugging why the bundle's functionality is not working
  • [BC] functions that are intended to only be used in the user's subclass (such as setLogFilename()) have all had their visibility updated to protected to make the public interface of your command cleaner

Logging

  • getLogFilename() now takes an optional boolean parameter to return just the filename. Previously it also included the full path to the file which meant that is was to symmetric with setLogFilename()
  • the default file extension can be set per command using setDefaultLogFileExtension()
  • logging to file can be disabled per command using setLogToFile()
  • The log LineFormat can be defined per command using setFileLogLineFormat() and setConsoleLogLineFormat(). NULL is a valid value for both functions if you would like to revert of Monolog's default format
  • [BC] The misspelt file_extention configuration option has been fixed to be file_extension
  • [BC] The node for configuring logging to file has been renamed from default to file_stream
  • The name of the log file can be changed for a single execution using the --log-filename parameter
v0.3.0

This minor release contains a large number or changes focused around new functionality. The highlights include

PHP Config

  • PHP Memory Limit for command execution is configurable globally in config or per command via setter

Logging

  • LineFormatter format can be defined in the config (instead of being stuck with our default)
  • Logging to file can be disabled globally in config if you don't need this
  • Logging to Console now goes via the command’s OutputInterface object instead of directly to STDOUT for better compatibility with Symfony's other features and with external tools
  • [BC] setDefaultLocking() and getDefaultLocking() have been replaced by setLocking() and isLocking() for consistency with the rest of the interface

Locking

  • Exception is thrown after an attempt to enable or disable locking after the lock has been acquired to better reflect that this has no effect
  • The folder in whcih lockfiles are stored can now be defined in config
  • Lock is explicitly released after execution instead of waiting for the PHP process to end

Miscellaneous

  • Test coverage added (including functional tests without dependency on an external Symfony application)
  • TravisCI Integration
  • Setters now provide a fluent interface
  • Composer Minimum Stability changed from ‘dev’ to ‘stable’
v0.2.0

Locking gives you the ability to avoid two things running the same command at the same time. It uses the Symfony LockHandler

v0.1.1

Main feature addition is configurability via config.yml

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky