Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stevotvr committed Sep 8, 2017
0 parents commit 1f70f36
Show file tree
Hide file tree
Showing 14 changed files with 783 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
engines:
csslint:
enabled: true
duplication:
enabled: true
config:
languages:
- ruby
- javascript
- python
- php
eslint:
enabled: true
fixme:
enabled: true
phpmd:
enabled: true
checks:
Controversial/CamelCaseClassName:
enabled: false
Controversial/CamelCaseMethodName:
enabled: false
Controversial/CamelCaseParameterName:
enabled: false
Controversial/CamelCasePropertyName:
enabled: false
Controversial/CamelCaseVariableName:
enabled: false
Naming/ShortVariable:
enabled: false
ratings:
paths:
- "**.css"
- "**.inc"
- "**.js"
- "**.jsx"
- "**.module"
- "**.php"
- "**.py"
- "**.rb"
exclude_paths:
- config/
- tests/
- travis/
2 changes: 2 additions & 0 deletions .csslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--exclude-exts=.min.css
--ignore=adjoining-classes,box-model,ids,order-alphabetical,unqualified-attributes
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file is for standardising the coding style between different editors
# http://editorconfig.org/

root = true

[*]
end_of_line = lf
indent_size = 4
indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_size = 4
indent_style = space
11 changes: 11 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
travis/ export-ignore
.travis.yml export-ignore
.gitignore export-ignore
.gitattributes export-ignore
composer.lock export-ignore
build.xml export-ignore
.csslintrc export-ignore
.editorconfig export-ignore
.jscsrc export-ignore
.jshintrc export-ignore
.codeclimate.yml export-ignore
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/build/
/vendor/
77 changes: 77 additions & 0 deletions .jscsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"excludeFiles": ["node_modules/**", "**/build/**"],
"requireCurlyBraces": [
"if", "else", "for", "while", "do", "try", "catch"
],
"requireSpaceBeforeKeywords": [
"else", "while", "catch"
],
"requireSpaceAfterKeywords": [
"do", "for", "if", "else", "switch", "case", "try", "catch", "while", "return", "typeof"
],
"requireSpaceBeforeBlockStatements": true,
"requireParenthesesAroundIIFE": true,
"requireSpacesInConditionalExpression": {
"afterTest": true,
"beforeConsequent": true,
"afterConsequent": true,
"beforeAlternate": true
},
"requireSpacesInAnonymousFunctionExpression": {
"beforeOpeningCurlyBrace": true
},
"disallowSpacesInNamedFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"requireSpacesInFunction": {
"beforeOpeningCurlyBrace": true
},
"disallowSpacesInCallExpression": true,
"requireBlocksOnNewline": true,
"requirePaddingNewlinesBeforeKeywords": ["case"],
"disallowEmptyBlocks": true,
"disallowSpacesInsideArrayBrackets": "nested",
"disallowSpacesInsideParentheses": true,
"requireSpacesInsideObjectBrackets": "all",
"disallowQuotedKeysInObjects": "allButReserved",
"disallowSpaceAfterObjectKeys": true,
"requireSpaceBeforeObjectValues": true,
"requireCommaBeforeLineBreak": true,
"requireOperatorBeforeLineBreak": [
"?", "=", "+", "-", "/", "*", "===", "!==", ">", ">=", "<", "<="
],
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
"requireSpaceBeforeBinaryOperators": [
"=", "+", "+=", "-", "-=", "/", "/=", "*", "*=", "===", "!==", "<", "<=", ">", ">="
],
"requireSpaceAfterBinaryOperators": [
"=", "+", "+=", "-", "-=", "/", "/=", "*", "*=", "===", "!==", "<", "<=", ">", ">="
],
"disallowKeywords": ["with"],
"disallowMultipleLineStrings": true,
"disallowMixedSpacesAndTabs": "smart",
"disallowTrailingWhitespace": true,
"disallowTrailingComma": true,
"disallowKeywordsOnNewLine": ["else"],
"requireLineFeedAtFileEnd": true,
"maximumLineLength": {
"value": 120,
"tabSize": 4,
"allowUrlComments": true,
"allowRegex": true
},
"requireCapitalizedConstructors": true,
"requireDotNotation": true,
"disallowYodaConditions": true,
"requireSpaceAfterLineComment": {
"allExcept": ["#", "="]
},
"disallowNewlineBeforeBlockStatements": true,
"validateQuoteMarks": {
"mark": "'",
"escape": true
},
"validateParameterSeparator": ", ",
"safeContextKeyword": ["that"]
}
24 changes: 24 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"bitwise": true,
"curly": true,
"eqeqeq": true,
"es3": true,
"forin": false,
"freeze": true,
"newcap": true,
"noarg": true,
"noempty": true,
"nonbsp": true,
"undef": true,
"unused": true,
"strict": true,

"browser": true,
"devel": true,
"jquery": true,

"globals": {
"JSON": true,
"phpbb": true
}
}
66 changes: 66 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
sudo: required

language: php

matrix:
include:
- php: 5.5
env: DB=none;NOTESTS=1
- php: 5.4
env: DB=mysqli #myisam
- php: 5.4
env: DB=mysql
- php: 5.4
env: DB=mariadb
dist: precise
- php: 5.4
env: DB=postgres
- php: 5.4
env: DB=sqlite3
- php: 5.5
env: DB=mysqli
- php: 5.6
env: DB=mysqli
- php: 7.0
env: DB=mysqli
- php: 7.1
env: DB=mysqli
- php: nightly
env: DB=mysqli
- php: hhvm
env: DB=mysqli
allow_failures:
- php: nightly
- php: hhvm
fast_finish: true

env:
global:
- EXTNAME="stevotvr/groupsub" # CHANGE name of the extension HERE
- SNIFF="1" # Should we run code sniffer on your code?
- IMAGE_ICC="1" # Should we run icc profile sniffer on your images?
- EPV="1" # Should we run EPV (Extension Pre Validator) on your code?
- PHPBB_BRANCH="3.2.x"

branches:
only:
- master
- develop
- /^develop-.*$/
- /^\d+(\.\d+)?\.x$/

install:
- travis/prepare-phpbb.sh $EXTNAME $PHPBB_BRANCH
- cd ../../phpBB3
- travis/prepare-extension.sh $EXTNAME $PHPBB_BRANCH
- travis/setup-phpbb.sh $DB $TRAVIS_PHP_VERSION $NOTESTS
- ../stevotvr/phpbb-groupsub/travis/prepare-epv.sh $EPV $NOTESTS

before_script:
- travis/setup-database.sh $DB $TRAVIS_PHP_VERSION $NOTESTS

script:
- sh -c "if [ '$SNIFF' != '0' ]; then travis/ext-sniff.sh $DB $TRAVIS_PHP_VERSION $EXTNAME $NOTESTS; fi"
- sh -c "if [ '$IMAGE_ICC' != '0' ]; then travis/check-image-icc-profiles.sh $DB $TRAVIS_PHP_VERSION $NOTESTS; fi"
- sh -c "if [ '$EPV' != '0' ] && [ '$NOTESTS' = '1' ]; then phpBB/vendor/bin/EPV.php run --dir='phpBB/ext/$EXTNAME/'; fi"
- sh -c "if [ '$NOTESTS' != '1' ]; then phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/travis/phpunit-$DB-travis.xml --bootstrap ./tests/bootstrap.php; fi"
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# phpBB Group Subscription Extension

This is a extension for phpBB 3.2 that allows you to create paid subscriptions for members to gain access to usergroups.

[![Build Status](https://travis-ci.org/stevotvr/phpbb-groupsub.svg)](https://travis-ci.org/stevotvr/phpbb-groupsub)
[![Code Climate](https://codeclimate.com/github/stevotvr/phpbb-groupsub/badges/gpa.svg)](https://codeclimate.com/github/stevotvr/phpbb-groupsub)

## License
[GNU General Public License v2](http://opensource.org/licenses/GPL-2.0)
114 changes: 114 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="Profile Flair Extension Builder" description="Builds an extension.zip from a git repository" default="all">
<property name="vendor-name" value="stevotvr" />
<property name="extension-name" value="groupsub" />
<!--
Only set this to "true" if you have dependencies in the composer.json,
otherwise use "false".
-->
<property name="has-dependencies" value="false" />

<target name="clean-package">
<!--
Remove some unnecessary files/directories
${dir}/ is the folder of your extension, e.g. ext/nickvergessen/newspage/
-->
<delete dir="${dir}/tests" />
<delete dir="${dir}/travis" />
<delete dir="${dir}/vendor" />

<delete file="${dir}/.gitignore" />
<delete file="${dir}/.gitattributes" />
<delete file="${dir}/.travis.yml" />
<delete file="${dir}/.codeclimate.yml" />
<delete file="${dir}/.csslintrc" />
<delete file="${dir}/.editorconfig" />
<delete file="${dir}/.jscsrc" />
<delete file="${dir}/.jshintrc" />
<delete file="${dir}/build.xml" />
<delete file="${dir}/composer.lock" />
<delete file="${dir}/README.md" />
</target>

<!--
DO NOT EDIT BELOW THIS LINE!!!!
-->

<property name="version" value="HEAD" override="true" />
<property name="build-directory" value="build" override="true" />
<property name="package-directory" value="${build-directory}/package/${vendor-name}/${extension-name}" />

<!-- These are the main targets which you will probably want to use -->
<target name="all" depends="prepare-structure,package" />

<!--
Clean up the build directory
-->
<target name="clean">
<delete dir="${build-directory}" />
</target>

<!--
Recreate the necessary folders
-->
<target name="prepare-structure" depends="clean">
<mkdir dir="${build-directory}" />
<mkdir dir="${build-directory}/checkout" />
<mkdir dir="${build-directory}/package" />
<mkdir dir="${build-directory}/package/${vendor-name}" />
<mkdir dir="${build-directory}/package/${vendor-name}/${extension-name}" />
<mkdir dir="${build-directory}/upload" />
</target>

<!--
The real packaging
-->
<target name="package">
<echo msg="Extracting ${version}" />

<phingcall target="git-checkout">
<property name="archive-version" value="${version}" />
</phingcall>

<if>
<equals arg1="${has-dependencies}" arg2="1" />
<then>
<exec dir="${package-directory}" command="php composer.phar install --no-dev"
checkreturn="true" />
</then>
</if>

<phingcall target="clean-package">
<property name="dir" value="${package-directory}" />
</phingcall>

<!-- Try setting the package version property from composer.json -->
<exec dir="${package-directory}"
command='php -r "\$j = json_decode(file_get_contents(\"composer.json\")); echo (isset(\$j->version) ? \$j->version : \"${version}\");"'
checkreturn="true"
outputProperty='package-version' />

<phingcall target="wrap-package">
<property name="destination-filename" value="${build-directory}/upload/${vendor-name}_${extension-name}_${package-version}" />
</phingcall>
</target>

<!--
Checkout a given version and install/clean the dependencies
-->
<target name="git-checkout">
<echo msg="Getting archive for ${archive-version}" />

<exec command="git archive ${archive-version} --format zip --output ${build-directory}/checkout/${archive-version}.zip"
checkreturn="true" />
<unzip file="${build-directory}/checkout/${archive-version}.zip" todir="${package-directory}" />
</target>

<!--
Create the zip and tar ball
-->
<target name="wrap-package">
<echo msg="Creating archives (${vendor-name}/${extension-name} ${version})" />
<zip basedir="${build-directory}/package/" destfile="${destination-filename}.zip" />
</target>
</project>
Loading

0 comments on commit 1f70f36

Please sign in to comment.