https://github.com/murilochianfa/ioncube-encoder-action
Github action to automate IonCube encoding for your PHP project.
https://github.com/murilochianfa/ioncube-encoder-action
actions encryption ioncube ioncube-encoder ioncube-php laravel php php-encoder pipeline
Last synced: 16 days ago
JSON representation
Github action to automate IonCube encoding for your PHP project.
- Host: GitHub
- URL: https://github.com/murilochianfa/ioncube-encoder-action
- Owner: MuriloChianfa
- License: mit
- Created: 2023-12-07T01:15:51.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-23T04:10:39.000Z (over 1 year ago)
- Last Synced: 2025-01-04T12:55:44.060Z (over 1 year ago)
- Topics: actions, encryption, ioncube, ioncube-encoder, ioncube-php, laravel, php, php-encoder, pipeline
- Language: JavaScript
- Homepage: https://www.ioncube.com
- Size: 345 KB
- Stars: 4
- Watchers: 1
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README


[](https://opensource.org/licenses/MIT)
[](https://github.com/MuriloChianfa/ioncube-encoder-action/releases)
[](https://github.com/MuriloChianfa/ioncube-encoder-action/actions/workflows/ci.yml)
[](https://github.com/MuriloChianfa/ioncube-encoder-action/actions/workflows/linter.yml)
[](https://github.com/MuriloChianfa/ioncube-encoder-action/actions/workflows/codeql-analysis.yml)
Automate and streamline IonCube encoding for your PHP project under Laravel,
Joomla, WordPress frameworks with this powerful GitHub Action. Encode your
source code effortlessly, ensuring an extra layer of security for your
proprietary codebase.
## Features
- **Seamless Integration:** Easily integrate IonCube encoding into your CI/CD
workflows with a straightforward setup using this GitHub Action.
- **Version Control:** Specify the IonCube version to use for encoding, ensuring
compatibility with your project requirements.
- **Flexible Configuration:** Customize the source and output directories,
making it adaptable to various project structures.
- **Efficient Workflow:** Save time and resources by automating the encoding
process, allowing you to focus on building and deploying your applications.
## Getting Started
- **Configure Workflow**: Copy the example workflow into your project's
.github/workflows directory, adjusting parameters as needed.
- **Setup secrets**: Setup the needed action secrets into your repository
.github/workflows directory, adjusting parameters as needed.
- **Run Workflow**: Push your changes to trigger the IonCube encoding workflow
and enjoy the automated process.
### Usage
> For vanilla PHP projects:
```yaml
name: Encode with IonCube
on: [push]
jobs:
encode:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: IonCube Encode
uses: MuriloChianfa/ioncube-encoder-action@v3.0.1
# If you're dont using trial version you need to setup the ioncube download url
# env:
# IONCUBE_DOWNLOAD_URL: ${{ secrets.IONCUBE_DOWNLOAD_URL }}
with:
source: 'src'
output: 'encrypted'
```
> For Laravel projects:
- **Setup Secrets**: Create a secret named IONCUBE_PASSPHRASE containing the
passphrase to encode files.
- **Install composer packages**: Sometimes you need to install the composer
packages before of project encode.
```yaml
name: Encode Laravel with IonCube
on: [push]
jobs:
encode:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: IonCube Encode Project
uses: MuriloChianfa/ioncube-encoder-action@v3.0.1
# If you're dont using trial version you need to setup the ioncube download url
# env:
# IONCUBE_DOWNLOAD_URL: ${{ secrets.IONCUBE_DOWNLOAD_URL }}
with:
source: 'src'
output: 'encrypted'
passphrase: ${{ secrets.IONCUBE_PASSPHRASE }}
# License file path in runtime
with-license: /opt/project/license
# Callback file path in runtime
callback-file: /opt/project/public/ioncube.php
- name: IonCube Encode Callback File
uses: MuriloChianfa/ioncube-encoder-action@v3.0.1
# If you're dont using trial version you need to setup the ioncube download url
# env:
# IONCUBE_DOWNLOAD_URL: ${{ secrets.IONCUBE_DOWNLOAD_URL }}
with:
source: 'src/public/ioncube.php'
output: 'encrypted/public/ioncube.php'
passphrase: ${{ secrets.IONCUBE_PASSPHRASE }}
```
### Inputs
- **_trial_**: Encode file with trial version of ioncube. _(default: true)_
- **_template_**: The template to choose the best parameters for type of
projects. _(default: php)_
- **_source_**: The file or directory containing your PHP project. _(default:
src)_
- **_output_**: The file or directory where the encoded project will be saved.
_(default: encrypted)_
- **_encoder-version_**: The Ioncube encoder version. _(default: current)_
- **_php-target-version_**: The PHP encoded files target version. _(default:
8.2)_
- **_arch_**: Architecture of target environment runner. _(default: 64)_
- **_allow-reflection_**: Names or globs for functions or classes to allow the
reflection API. Supports multiple values (space-separated). _(default: false)_
- **_allow-reflection-all_**: Allow the reflection API at all the PHP code.
_(default: false)_
- **_encrypt_**: Names or globs to files to encrypt. Supports multiple values
(space-separated). _(default: false)_
- **_binary_**: Encode files in binary format. _(default: false)_
- **_optimize_**: Level of encoding performance. _(default: more)_
- **_no-doc-comments_**: Not allow doc comments on encoded files. _(default:
false)_
- **_without-loader-check_**: Disable the ioncube loader installation
verification. _(default: false)_
- **_preamble-file_**: File for insert into header of all encoded files.
_(default: false)_
- **_passphrase_**: Text to identify and encode the project unically. _(default:
false)_
- **_license-check_**: Mode of license validation for encoded files. _(default:
auto)_
- **_with-license_**: The license file path at runtime environment. _(default:
false)_
- **_callback-file_**: File to validate manually when license is invalid.
_(default: false)_
- **_create-target_**: Mode to create target file/directory if not exists.
_(default: false)_
- **_replace-target_**: Mode to replace target file/directory if not exists.
_(default: false)_
- **_copy_**: Patterns of files to copy without encrypt or encode. Supports
multiple values (space-separated). _(default: '')_
- **_ignore_**: Patterns of files to ignore on ioncube walkthrough. Supports
multiple values (space-separated). _(default: '')_
- **_skip_**: Patterns of files to skip on ioncube walkthrough. Supports
multiple values (space-separated). _(default: '')_
- **_obfuscate_**: PHP entities to obfuscate:
all,locals,functions,methods,classes,linenos,none. _(default: 'none')_
- **_obfuscation-key_**: Key to obfuscation method to apply on PHP entities.
_(default: '')_
#### Using Multiple Values
Several inputs support multiple values (`copy`, `ignore`, `skip`, `encrypt`,
`allow-reflection`). You can provide multiple patterns using different formats:
**Newline-separated (YAML multiline syntax):**
```yaml
with:
copy: |
*.txt
*.md
*.json
ignore: |
*/cache/*
*/logs/*
*/temp/*
```
**Comma-separated:**
```yaml
with:
copy: '*.txt,*.md,*.json'
ignore: '*/cache/*,*/logs/*'
```
When multiple values are provided, each pattern is passed as a separate flag to
the IonCube encoder.
> [!IMPORTANT]
>
> Make sure to ignore the commits for encrypted files. After encrypt your
> project, test them for make sure your correct functionality.
## Example
Explore a complete example of a workflow that utilizes this action in the
example
project.
## Testing this package
```bash
npm install
```
```bash
npm run lint
npm run test
npm run bundle
# or simple
npm run all
```
### Dependencies
- _Node.js 20.8.0 or higher._
- _NPM 10.1.0 or higher._
## Commitment to Quality
During package development, try as best as possible to embrace good design and
development practices to try to ensure that this package is as good as it can
be. The checklist for package development includes:
- ✅ Have no linting warnings throughout all code.
- ✅ Include comprehensive documentation in README.md.
## Contributions
We welcome contributions! Feel free to open issues for suggestions or bug
reports, and pull requests are highly appreciated.
## Security
If you discover any security related issues, please email
murilo.chianfa@outlook.com instead of using the issue tracker.
## Credits
- [Murilo Chianfa](https://github.com/MuriloChianfa)
- [All Contributors](../../contributors)
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE.md)
file for details.
## Acknowledgments
Special thanks to IonCube for providing
robust encoding technology.