Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .php-cs-fixer.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"php":"8.1.9","version":"3.10.0:v3.10.0#76d7da666e66d83a1dc27a9d1c625c80cc4ac1fe","indent":" ","lineEnding":"\n","rules":{"blank_line_after_namespace":true,"braces":{"allow_single_line_anonymous_class_with_empty_body":true,"allow_single_line_closure":true},"class_definition":{"single_line":true},"constant_case":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ignore"},"no_break_comment":true,"no_closing_tag":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":true,"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"visibility_required":true,"encoding":true,"full_opening_tag":true,"blank_line_after_opening_tag":true,"blank_line_between_import_groups":true,"compact_nullable_typehint":true,"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"new_with_braces":true,"no_blank_lines_after_class_opening":true,"no_leading_import_slash":true,"no_whitespace_in_blank_line":true,"ordered_class_elements":{"order":["use_trait"]},"ordered_imports":true,"return_type_declaration":true,"short_scalar_cast":true,"single_blank_line_before_namespace":true,"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"array_syntax":{"syntax":"short"},"backtick_to_shell_exec":true,"binary_operator_spaces":true,"blank_line_before_statement":{"statements":["return"]},"cast_spaces":{"space":"none"},"class_attributes_separation":{"elements":{"method":"one"}},"class_reference_name_casing":true,"clean_namespace":true,"concat_space":{"spacing":"one"},"echo_tag_syntax":true,"empty_loop_body":{"style":"braces"},"empty_loop_condition":true,"fully_qualified_strict_types":true,"function_typehint_space":true,"general_phpdoc_tag_rename":{"replacements":{"inheritDocs":"inheritDoc"}},"include":true,"integer_literal_case":true,"lambda_not_used_import":true,"linebreak_after_opening_tag":true,"magic_constant_casing":true,"magic_method_casing":true,"native_function_casing":true,"native_function_type_declaration_casing":true,"no_alias_language_construct_call":true,"no_alternative_syntax":true,"no_binary_string":true,"no_blank_lines_after_phpdoc":true,"no_empty_comment":true,"no_empty_phpdoc":true,"no_empty_statement":true,"no_extra_blank_lines":{"tokens":["attribute","case","continue","curly_brace_block","default","extra","parenthesis_brace_block","square_brace_block","switch","throw","use"]},"no_leading_namespace_whitespace":true,"no_mixed_echo_print":true,"no_multiline_whitespace_around_double_arrow":true,"no_short_bool_cast":true,"no_singleline_whitespace_before_semicolons":true,"no_spaces_around_offset":true,"no_trailing_comma_in_list_call":true,"no_trailing_comma_in_singleline_array":true,"no_trailing_comma_in_singleline_function_call":true,"no_unneeded_control_parentheses":{"statements":["break","clone","continue","echo_print","others","return","switch_case","yield","yield_from"]},"no_unneeded_curly_braces":{"namespaces":true},"no_unneeded_import_alias":true,"no_unset_cast":true,"no_unused_imports":true,"no_useless_nullsafe_operator":true,"no_whitespace_before_comma_in_array":true,"normalize_index_brace":true,"object_operator_without_whitespace":true,"php_unit_fqcn_annotation":true,"php_unit_method_casing":true,"phpdoc_align":{"align":"left"},"phpdoc_annotation_without_dot":true,"phpdoc_indent":true,"phpdoc_inline_tag_normalizer":true,"phpdoc_no_access":true,"phpdoc_no_alias_tag":true,"phpdoc_no_package":true,"phpdoc_no_useless_inheritdoc":true,"phpdoc_order":{"order":["param","return","throws"]},"phpdoc_return_self_reference":true,"phpdoc_scalar":true,"phpdoc_single_line_var_spacing":true,"phpdoc_tag_type":{"tags":{"inheritDoc":"inline"}},"phpdoc_to_comment":true,"phpdoc_trim":true,"phpdoc_trim_consecutive_blank_line_separation":true,"phpdoc_types":true,"phpdoc_types_order":{"null_adjustment":"always_last","sort_algorithm":"none"},"phpdoc_var_without_name":true,"protected_to_private":true,"semicolon_after_instruction":true,"simple_to_complex_string_variable":true,"single_line_comment_spacing":true,"single_line_comment_style":{"comment_types":["hash"]},"single_line_throw":true,"single_quote":true,"single_space_after_construct":{"constructs":["abstract","as","attribute","break","case","catch","class","clone","comment","const","const_import","continue","do","echo","else","elseif","enum","extends","final","finally","for","foreach","function","function_import","global","goto","if","implements","include","include_once","instanceof","insteadof","interface","match","named_argument","namespace","new","open_tag_with_echo","php_doc","php_open","print","private","protected","public","readonly","require","require_once","return","static","switch","throw","trait","try","type_colon","use","use_lambda","use_trait","var","while","yield","yield_from"]},"space_after_semicolon":{"remove_in_empty_for_expressions":true},"standardize_increment":true,"standardize_not_equals":true,"switch_continue_to_break":true,"trailing_comma_in_multiline":true,"trim_array_spaces":true,"types_spaces":true,"unary_operator_spaces":true,"whitespace_after_comma_in_array":true,"general_phpdoc_annotation_remove":{"annotations":["author","category","see","since","version"]}},"hashes":{"system\/user\/addons\/cartthrob_order_loader\/addon.setup.php":1531618901,"system\/user\/addons\/cartthrob_order_loader\/pi.cartthrob_order_loader.php":4187454962}}
34 changes: 34 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

ini_set('memory_limit', '2048M');

$finder = PhpCsFixer\Finder::create()
->exclude('automation')
->exclude('build')
->name('*.php')
->in(__DIR__)
->ignoreDotFiles(true)
->ignoreVCS(true);

$config = new PhpCsFixer\Config();
return $config
->setRules([
'@PSR2' => true,
'@PSR12' => true,
'@Symfony' => true,
'array_syntax' => ['syntax' => 'short'],
'cast_spaces' => ['space' => 'none'],
'concat_space' => ['spacing' => 'one'],
'general_phpdoc_annotation_remove' => [
'annotations' => ['author', 'category', 'see', 'since', 'version'],
],
'increment_style' => false,
'linebreak_after_opening_tag' => true,
'no_superfluous_phpdoc_tags' => false,
'ordered_imports' => true,
'phpdoc_align' => ['align' => 'left'],
'phpdoc_separation' => false,
'phpdoc_summary' => false,
'yoda_style' => false,
])
->setFinder($finder);
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
plugin-load-order
=================
# CartThrobOrderLoader

Loads a previous order into the cart.
* [Build Process](/documentation/build.md)
* [Release Process](/documentation/release.md)
* [Changelog](/documentation/changelog.md)

Installation: move file to system > expressionengine > third_party
## Code Quality

This add-on is provided as-is at no cost with no warranty expressed or implied. Support is not included.
* Prior to committing, run `php-cs-fixer fix` to validate code formatting.
26 changes: 13 additions & 13 deletions automation/make_addon.command
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/bin/bash

# the EE5 branch
EE5BRANCH="develop"
# the EE branch
EEBRANCH="develop"

# allow branch override
while getopts "e:" OPTION; do
while getopts "b:" OPTION; do
case $OPTION in
e)
EE5BRANCH=$OPTARG
b)
EEBRANCH=$OPTARG
;;
esac
done
Expand All @@ -19,30 +19,30 @@ DIR=$(cd "$(dirname "$0")/.."; pwd)
BASENAME=$(basename $DIR)

# check out EE5 branch
git checkout $EE5BRANCH || { echo "Could'nt check out $EE5BRANCH branch"; exit 1; }
git checkout $EE5RANCH || { echo "Couldn't check out $EEBRANCH branch"; exit 1; }

# get version number from config.php file
EE5VERSION=$(php -r "include '$DIR/system/user/addons/cartthrob_order_loader/addon.setup.php'; echo \CARTTHROB_ORDER_LOADER_VERSION;")
EEVERSION=$(php -r "include '$DIR/system/user/addons/cartthrob_order_loader/addon.setup.php'; echo \CARTTHROB_ORDER_LOADER_VERSION;")

# go to the directory above the repo
cd ..

# temporarily rename the repo directory to EE5
mv $BASENAME cartthrob_order_loader_$EE5VERSION
mv $BASENAME cartthrob_order_loader_$EEVERSION

ARTIFACTSDIR=cartthrob_order_loader-build
ARTIFACTSDIR=cartthrob_order_loader-build/

mkdir -p $ARTIFACTSDIR

# add EE5 version to zip
zip -r $ARTIFACTSDIR/cartthrob_order_loader_$EE5VERSION.zip cartthrob_order_loader_$EE5VERSION/system -x "*.DS_Store" -x "__MACOSX*" -x "*composer.lock" -x "*composer.json" -x "*.orig" -x "*.git*"
zip -r $ARTIFACTSDIR/cartthrob_order_loader_$EEVERSION.zip cartthrob_order_loader_$EEVERSION/system -x "*.DS_Store" -x "__MACOSX*" -x "*composer.lock" -x "*composer.json" -x "*.orig" -x "*.git*"

# move the build directory into the project directory
rm -rf cartthrob_order_loader_$EE5VERSION/build
mv $ARTIFACTSDIR cartthrob_order_loader_$EE5VERSION/build
rm -rf cartthrob_order_loader_$EEVERSION/build
mv $ARTIFACTSDIR cartthrob_order_loader_$EEVERSION/build

# rename the repo back to its original name
mv cartthrob_order_loader_$EE5VERSION $BASENAME
mv cartthrob_order_loader_$EEVERSION $BASENAME

# change directory back to repo
cd $DIR
Binary file modified build/cartthrob_order_loader_2.0.0.zip
Binary file not shown.
26 changes: 7 additions & 19 deletions RELEASE.MD → documentation/build.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
## CartThrob Order Loader

### Build Process
# CartThrob CartThrobOrderLoader: Build Process

1. From the terminal, make sure you are in the project root directory
2. Update and commit the version number bump
Expand All @@ -10,26 +8,16 @@
* PATCH version when you make backwards-compatible bug fixes. A PATCH number should be excluded if it equals '0'
* Update `CARTTHROB_ORDER_LOADER_VERSION` constant in `system/user/addons/cartthrob_order_loader/addon.setup.php`
* `$ git commit -am "Bumping version"`
3. Merge `develop` branch into `master` branch
3. Merge `develop` branch into `main` branch
* `$ git checkout develop && git pull origin develop && git push origin develop`
* `$ git checkout master && git pull origin master`
* `$ git checkout main && git pull origin main`
* `$ git merge develop`
4. Tag the version in git
* `$ git tag v<version-number>`
* For example – `$ git tag v4.3` or `$ git tag v4.3.1`
5. Push all changes to GitHub
* `$ git push --tags origin master`
6. Build CartThrob Order Loader ZIP
* `$ git push --tags origin main`
6. Build CartThrob CartThrobOrderLoader Zip
* `$ npm run build-addon`
* Built CartThrob Order Loader ZIP files will be added to the `./build` folder
1. Publish a release on GitHub
* [Draft a New Release](https://github.com/CartThrob/Cart-LoadOrder/releases/new) on GitHub
* Type the tag name from the tagging step above into the "Tag version" field
* Repeat the tag name in the "Release title" field
* Upload the built ZIP file by dropping it into the Dropzone uploader.
* Publish the release

### Release Process
1. Update the CartThrob website. Follow CartThrob update process.
2. Update the ExpressionEngine website. Follow CartThrob update process.
3. Announcements. Follow CartThrob update process.
* Built CartThrob CartThrobOrderLoader ZIP files will be added to the `./build` folder
7. [Publish the release](release.md)
5 changes: 5 additions & 0 deletions documentation/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Change Log

### Version 3.0.0

* UPDATED: CartThrob 8 Support
20 changes: 20 additions & 0 deletions documentation/release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# CartThrob CartThrobOrderLoader: Release Process

## Publish a release on GitHub
1. [Draft a New Release](https://github.com/CartThrob/CartThrobOrderLoader/releases/new) on GitHub
2. Type the tag name from the tagging step above into the "Tag version" field
3. Repeat the tag name in the "Release title" field
4. Upload the built ZIP file by dropping it into the Dropzone uploader.
5. Publish the release

## Update the ExpressionEngine website
1. Login to the [EE addon portal](https://expressionengine.com/forums/member/profile) (see 1Password)
2. Visit the [Edit the addon](---) page
3. In the "Latest Version" field, change the version to match your release
4. In the "Zip File" field, remove the existing file and upload your ZIP file
5. In the "Latest Update" field, update the date to match the release date
6. Save the entry

## Announcement
1. [Twitter](https://twitter.com/cartthrob)
2. [Mailchimp](https://us7.admin.mailchimp.com/campaigns/#f_list:all;t:campaigns-list)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/CartThrob/Cart-LoadOrder"
"url": "git+https://github.com/CartThrob/CartThrobOrderLoader"
},
"private": true
}
16 changes: 8 additions & 8 deletions system/user/addons/cartthrob_order_loader/addon.setup.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

define('CARTTHROB_ORDER_LOADER_NAME', 'CartThrob Order Loader');
define('CARTTHROB_ORDER_LOADER_VERSION', '2.0.0');
const CARTTHROB_ORDER_LOADER_NAME = 'CartThrob Order Loader';
const CARTTHROB_ORDER_LOADER_VERSION = '2.0.0';

return [
'author' => 'Foster Made',
'author_url' => 'https://cartthrob.com',
'docs_url' => '',
'name' => CARTTHROB_ORDER_LOADER_NAME,
'author' => 'Foster Made',
'author_url' => 'https://cartthrob.com',
'docs_url' => '',
'name' => CARTTHROB_ORDER_LOADER_NAME,
'description' => 'This reloads an existing order to the cart. This does not reload subscriptions or permissions attached to items.',
'version' => CARTTHROB_ORDER_LOADER_VERSION,
'namespace' => 'Cartthrob\OrderLoader',
'version' => CARTTHROB_ORDER_LOADER_VERSION,
'namespace' => 'Cartthrob\OrderLoader',
];
Loading