xcart / xcart-tools
Allows you to perform various development actions from CLI, e.g. redeploying X-Cart. Install it via `composer global require xcart/xcart-tools` command
Requires
- php: ^7.1
- ext-json: *
- ext-pdo: *
- phpseclib/phpseclib: ~2.0
- symfony/config: ^4.3
- symfony/console: ^4.3
- symfony/dependency-injection: ^4.3
- symfony/event-dispatcher: ^4.3
- symfony/expression-language: ^4.3
- symfony/filesystem: ^4.3
- symfony/finder: ^4.3
- symfony/http-foundation: ^4.3
- symfony/process: ^4.3
- symfony/proxy-manager-bridge: ^4.3
- symfony/yaml: ^4.3
- dev-master
- v1.3.17
- v1.3.16
- v1.3.15
- v1.3.14
- v1.3.13
- v1.3.12
- v1.3.11
- v1.3.10
- v1.3.9
- v1.3.8
- v1.3.7
- v1.3.6
- v1.3.5
- v1.3.4
- v1.3.3
- v1.3.2
- 1.3.1
- 1.2.0
- v1.1.1
- v1.1.0
- v1.0.0
- dev-feature/convertto55
- dev-feature/deploy_from_remote
- dev-feature/stand-upload
- dev-mod/db-dump-command
- dev-feature/hosting
- dev-Vladimir-Mityukov/add-masterdev-to-the-end-of-installation-1568630951091
This package is auto-updated.
Last update: 2025-03-29 00:49:55 UTC
README
Allows you to perform various development actions from CLI. Current list of commands is:
admin
- Creates administrator profile using X-Cart DB connectionconfig
- Creates X-Cart config by asking you a few questionsdeploy
- Deployes X-Cart from different sources. Available sources are repo, latest version and external server.doctor
- Checks & fixes X-Cart 5 storedump
- Creates database dump. Can be run on remote host. Use -m param to set dump mode.module
- Creates new empty module. Can be run on remote host.pack
- Creates module package by specified AuthorID-ModuleId nameproduct
- Generates product entities into X-Cart DBredeploy
- Recreates X-Cart code cache and applies migrations\hooksstandUpload
- [BETA] Uploads X-Cart project to stand. Not for production usage
Global command parameters
-s, --ssh_string[=SSH_STRING]
- SSH user@host string to use in command-P, --ssh_port[=SSH_PORT]
- SSH port [default: 22]
Example
Change working directory to the X-Cart installation or development repository and run:
> php <path-to-tools>/tools.php <command>
# e.g.
> php <path-to-tools>/tools.php redeploy
Remote command execution
To execute a command via SSH, you must have your public key on the remote server, and then you can run command as in example:
> tools <command> -s remote_user@remote_host
For instance, dump
command will create a dump on the remote server and then automatically download it to the local machine.
How to install globally via Composer
Add the following line to your ~/.bash_profile script:
export PATH="$HOME/.composer/vendor/bin:$PATH"
And then simply run
> composer global require xcart/xcart-tools
After that the tools will be available in CLI as
> tools <command>
# e.g.
> tools redeploy
To view help on every command run
> tools <command> -h
#e.g.
> tools admin -h
Commands description and examples
admin
Creates administrator profile using X-Cart DB connection.
Supports execution via SSH.
> tools admin
# with parameters
> tools admin -u admin@example.com -p master2356
# via SSH
> tools admin -u admin@example.com -p master2356 -s user@remote.com -P 22
# remove
> tools admin -u admin@example.com --remove=1
config
Creates X-Cart config by asking you a few questions.
Supports execution via SSH.
> tools config
# with parameters
> tools config -d my-store.com -w my_store
# via SSH
> tools config -s user@remote.com
deploy
Deployes X-Cart from different sources. Available sources are repo, latest version and external server. Command interacts with user by serveral questions
# deploy from latest or repo
> tools deploy
# deploy from remote server
> tools deploy -s user@remote.com
doctor
Checks & fixes X-Cart 5 store
The only action is available now is 'clear_rebuild'. It clears all the temporary files created by crashed rebuild process.
> tools doctor
# with parameters
> tools doctor -m clear_rebuild
dump
Creates database dump. Can be run on remote host. Use -m param to set dump mode.
Supports execution via SSH.
> tools dump
# dump from remote server
> tools dump -s user@remote.com
module
Creates new empty module. Can be run on remote host.
Command interacts with user by serveral questions
Supports execution via SSH.
> tools module
# create new module on remote server
> tools module -s user@remote.com
pack
Creates module package by specified AuthorID-ModuleId name
> tools pack <AuthorId>-<ModuleId>
# e.g.
> tools pack Qualiteam-MyModule
product
Generates product entities into X-Cart DB
> tools product
> tools product -a 5
redeploy
Recreates X-Cart code cache and applies migrations\hooks
> tools redeploy