- Add
encrypt_with_password()
,decrypt_with_password()
,encrypt_file_with_password()
, anddecrypt_file_with_password()
functions to encrypt and decrypt data - Add
AsPathArgument
andAsPathOption
attributes to handle autocompletion of paths in arguments and options
- Add more missing vendor classes into stubs
- Add support for disabling stubs generation (with
CASTOR_GENERATE_STUBS=0
environment variable)
- Document all the environment variables supported by Castor
- Better rendering of run errors
- Add
check()
function to ensure requirements are met - Add
ProblemException
to handle problems in a more structured way - Add official support for symfony/string and symfony/var-dumper functions
- Rework the releasing
- Add support for PHP 8.4
- Force fetching the last version when guard min is used to display more information for user
- Add the ability to set a default task when calling
castor
without any arguments
- Boot the kernel even when using composer command
- Update all PHP vendor
- Add GetRawTokenTrait definition in stubs
- Fix stubs to better support templates phpdoc and clean stubs file
- Fix deprecations when using ssh functions
- Add
Context::withVerboseArguments()
method to pass verbose arguments to the underlying process when needed - Add support for custom php.ini in compile command
- Do not validate commande options/args as soon as `#[AsRawTokens] is used
- Update all PHP vendor
- Add partial support for PHP 8.4 (
ssh_()
functions are not supported yet)
- Re-active
static-darwin-arm64
binary build - Fix stubs generation to use fully qualified class names even in phpdoc
- Update SPC version to v2.3.5
- Do not build static-darwin-arm64 binary anymore (may be temporary)
- Fix BC layer for
fingerprint()
function - Fix repack command work without .castor folder
- Add
Castor\CommandBuilder\CommandBuilderInterface
which allows to build nice API for command line software - Add
Context::toInteractive()
method - Add
Castor\Event\ContextCreatedEvent
to allow updating the context after it is created - Add
run_phar()
function to run a phar file in all contexts
- Update SPC version to 2.3.0
- Update all PHP vendor
- Add an id parameter to
fingerprint()
to avoid bad cache hit - Fix completion when update is available
- Fix repack when there is composer dependencies to castor
- Fix wait_for_docker_container example to avoid checking previous docker logs
- Deprecate all arguments in
run()
function that are already in the context. Examples:{ - run(['composer', 'install'], workingDirectory: __DIR__); + run(['composer', 'install'], context: context()->withWorkingDirectory(__DIR__)); }
- Deprecate
suggestedValues
property inAsArgument
andAsOption
attributes. Useautocomplete
property instead.
- Fix update instruction
- Add
Castor\Event\AfterBootEvent
to perform action when the application is ready - Add
Symfony\Component\Finder\SplFileInfo
to the stubs
- Map console verbosity level to default context, even when no context is defined
- Totally rework the import feature. Castor use special
castor.composer.json
file to handle imports. This fixes many bugs and issues with the previous - SSH
- Marked SSH features as stable
- Add
?callable $callback = null
param tossh_*
functions to manipulate output - Add support for SSH connection without specifying a user
- Add
context()
function in expression language to enable a task - Add
notificationTitle
property toContext
to set the application name for notifications title - Add
http_download()
function to simplify the process of downloading files
- Better handling of notification errors and exceptions
- Better log output in debug mode (
-vvv
) - Changed the behavior of
notify
parameter inContext
to be a nullable boolean.null
is now the default value (only user notifications are displayed).true
to enable notifications globally (user and Castor generated notifications)false
to disable them globally
.castor.stub.php
is now generated in same location wherecastor.php
is located
- Deprecate
Castor\GlobalHelper
class. There are no replacements. Use raw functions instead - Deprecate
AfterApplicationInitializationEvent
event. UseFunctionsResolvedEvent
instead - Deprecate
request()
in favor ofhttp_request()
for consistency with newly introducedhttp_*
function
- Fix root location when repacking application
- Add support for importing remote functions and tasks
- Add a bash installer to ease installation
- Distribute static binaries
castor.darwin-arm64
automatically with the release - Add support for running Castor on Linux arm64 and distribute the binary
castor.linux-arm64.phar
automatically with the release - Add an option
ignoreValidationErrors
onAsTask
attribute to ignore parameters & options validation errors - Add support for dynamic autocomplete task arguments/options
- Add support for merging an application
box.json
config file used bycastor:repack
command - Find root directory by looking for a
.castor/castor.php
file - Allow stub file to be in
.castor/.castor.stub.php
- Fix issue with PTY on windows, it's now always disabled
- Fix issue when finding root dir on windows
- Fix issue on SymfonyTask creation
- Deprecate loading all PHP files from
[ROOT_DIR]/castor
- Deprecate
Context::withPath()
in favor ofContext::withWorkingDirectory()
- Deprecate
path
argument incapture()
,exit_code()
,run()
,with()
in favor ofworkingDirectory
- Deprecate
Castor\TaskDescriptorCollection
in favor ofCastor\Descriptor\TaskDescriptorCollection
- Deprecate
Castor\HasherHelper
in favor ofCastor\Castor\HasherHelper
- Deprecate
Castor\PathHelper
in favor ofCastor\Castor\PathHelper
- Add a
yaml_dump()
function to dump any PHP value to a YAML string - Add a
yaml_parse()
function to parse a YAML string to a PHP value - Remove the default timeout of 60 seconds from the Context
- Add a
recursive
parameter to thewithData()
method ofContext
to allow recursive merging for nested arrays - Add an
open()
function to open a file or URL in the default application - Add
bool
return type tofingerprint()
function to indicate if the callable was run
- Fix instruction for downloading new castor version as a phar
- Add a
compile
command that puts together a customizable PHP binary with a repacked castor app into a static binary - Distribute static binaries
castor.linux.amd64
andcastor.darwin.amd64
automatically with the release - Compile watcher and phar for arm64 on macOS, and distribute them with the release
- Add
ProcessStartEvent
andProcessTerminateEvent
events - Allow to listen to the symfony console events
- Set the process title according to the current application name and task name
- Deprecates
add_context()
function, useAsContextGenerator
attribute instead - Allow to get null instead of throwing an exception when calling
task(true)
without a current task - Ignore some low level env vars in runnable command showed in logs
- Fix section output to work on Windows
- Fix issue with symfony console (color doesn't work in tmux or screen)
- Add a
debug
command - Add
guard_min_version()
function to ensure a minimum version of Castor is used - Add
wait_for_http_response()
function for a more generic response check - Add
wait_for_docker_container()
function to wait for a docker container to be ready - Add
AsSymfonyTask
attribute to map Symfony Command - Add
Context->name
property (automatically set by the application) - Add an error handler, and wire the logger to it so display deprecation notices
- Edited the duration of update check from
60 days
to24 hours
- Revise the usage of the terms
command
andtask
for consistency through code and docs. - [BC Break] Remove
callable $responseChecker
parameter fromwait_for_http_status()
- [BC Break] The event
AfterApplicationInitializationEvent
second arguments is now aTaskDescriptorCollection
, and the event is emitted after the context configuration
- Fix issue when using
ContextRegistry::getCurrentContext()
without setting first a context - Calling
ContextRegistry::getCurrentContext()
withoutsetCurrentContext()
is deprecated. Pass a$context
instead to the function, or set a current context before.
- Add
AsListener
attribute to register an event listener - Add
wait_for()
,wait_for_port()
,wait_for_url()
,wait_for_http_status()
functions - Allow to override
AsTask
andAsContext
attributes - Add
force
argument tofingerprint()
method to force run the callable, even if fingerprint is same - Fix directory for fingerprinted test
- [BC Break] Remove almost all setters in the GlobalHelper class
- Refactor the documentation
- Add
ssh_upload()
andssh_download()
functions to upload/download files via SSH - Rename
ssh()
tossh_run()
- Allow to set default context with an env variable
- Fix castor application version
- Fix typo in
run()
error message
- Add
fingerprint()
function to condition code execution based on some hash changes - Better handle default Symfony commands when no castor file exists yet
- Add
-c
option tocastor
command to specify a context
- Add
request()
andhttp_client()
functions to make HTTP requests - Add support for disabling task dynamically
- Add a
with
function to run logic with a specific context or parameters without passing them to eachrun
or other functions - Allow to get a context by its name using
$fooContext = context('foo')
- Experimental display with sections, allow better output when using parallel
function, enable it by by using
CASTOR_USE_SECTION=true castor [task]
- Display more information when running a process
- Rename
get_exit_code()
toexit_code()
- Rename
get_context()
tocontext()
- Rename
get_input()
toinput()
- Rename
get_output()
tooutput()
- Rename
get_application()
toapp()
- Rename
get_command()
totask()
- Fix parallel when one of the callback fails, wait for the others to finish to throw exception
- Fix the
castor --version
command when there is no.castor.php
file
- Add support for re-packing a castor application into a new phar file
- Fix the update command message to follow redirects with curl
- Add support for registering
Context
programmatically - Add
load_dot_env()
function for loading the context's environment from a dotenv file - Add support for multiple paths in
watch()
function - Add
get_exit_code()
function to get a process exit code, even if it failed
- Add documentation about installation in a Github Action
- Add more classes in stubs
- Fix curl download in installation instructions
- Fix code on initial castor.php creation
- Do not remove annotation from phar
- Add support for signals handling
- Add a way to type Context::$data
- Allow to use the cache in the context creator
- Add
onFailure
argument to thecapture()
function - Add
ExecutableFinder
in stubs
- [BC Break] replace specials helpers arguments by dedicated functions
- Add
capture()
function to easily run a process and returns the output - Add
cache()
andget_cache()
function to easily cache something - Add
ssh()
function to run commands on remote server via SSH - Display warning and update instructions when a new version is available
- Better error reporting when a call to
run()
fails or whenimport()
is not possible - Fix stubs generation
- Enhance the documentation
- Enhance the first run experience
- Add a way to get the
Command
instance in a task - Add support for better handling of option without value
- Fix the stubs generation when castor is installed via composer
- Fix the initial
castor.php
file generated for new projects - Fix
watch()
function
- Initial release