Skip to content
This repository has been archived by the owner on Aug 12, 2024. It is now read-only.

Commit

Permalink
Bug #10/#14, Add open-media-player-core to composer [iet:3633574]
Browse files Browse the repository at this point in the history
* Plus coding-standard integration/tweaks - `phpcs.xml`
* Use `composer-suggest` & `composer-merge-plugin`
  • Loading branch information
nfreear committed Jun 25, 2015
1 parent f164b41 commit 9f0db80
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 114 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

.env
version.json

/composer.lock
Expand Down
42 changes: 42 additions & 0 deletions composer-shared/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "iet-ou/open-media-player-shared",
"description": "Shared packages & repositories. ©2015 The Open University, UK.",
"license": "proprietary",

"repositories": [
{
"type": "package",
"package": {
"name": "johndyer/mediaelement",
"version": "2.17.0",
"license": "MIT",
"dist": {
"url": "https://github.com/johndyer/mediaelement/archive/2.17.0.zip",
"type": "zip"
},
"// - source": {
"url": "https://github.com/johndyer/mediaelement.git",
"type": "git",
"reference": "2.17.0"
}
}
},
{
"type": "vcs",
"url": "https://github.com/IET-OU/open-media-player-core"
},
{
"type": "vcs",
"url": "https://github.com/IET-OU/open-oembed-providers"
}
],
"extra": {
"//": [
"http://mediaplayer.open.ac.uk/demo/info#php - 5.4.36",
"http://embed.open.ac.uk/demo/info#php - 5.3.3",
"https://github.com/IET-OU/ouplayer ../system/core/CodeIgniter.php#L36 - CI 2.1.3",
"http://iet-embed-acct.open.ac.uk/docs/CREDITS.txt",
"https://gist.github.com/nfreear/57262e040d49b2f212ec"
]
}
}
65 changes: 18 additions & 47 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,55 +17,37 @@
"issues": "https://github.com/IET-OU/ouplayer/issues",
"source": "https://github.com/IET-OU/ouplayer"
},
"repositories": [
{
"type": "package",
"package": {
"name": "johndyer/mediaelement",
"version": "2.17.0",
"license": "MIT",
"dist": {
"url": "https://github.com/johndyer/mediaelement/archive/2.17.0.zip",
"type": "zip"
},
"// - source": {
"url": "https://github.com/johndyer/mediaelement.git",
"type": "git",
"reference": "2.17.0"
}
}
}
],
"require": {
"php": ">=5.3.3",
"ext-curl": "*",
"ext-xml": "*",
"mnsami/composer-custom-directory-installer": "1.0.*",
"johndyer/mediaelement": "2.17.0"
"wikimedia/composer-merge-plugin": "1.0.0",
"nfreear/composer-suggest": "^1.1",
"johndyer/mediaelement": "2.17.0",
"iet-ou/open-media-player-core": "dev-master"
},
"require-dev": {
"squizlabs/php_codesniffer": "~2.1.0",
"jakub-onderka/php-parallel-lint": "~0.8"
},
"suggest": {
"iet-ou/ou-media-player-base": "*; Base classes for themes, providers & extensions",
"iet-ou/ou-media-player-ou": "*; OU-only - theme, SAMS auth ...",
"iet-ou/ou-embed-providers": "*; oEmbed providers - Google Docs, Prezi ...",
"iet-ou/open-media-player-theme-x": "*; OU-only - theme ...",
"iet-ou/sams-auth": "*; OU-only - SAMS authentication",
"iet-ou/open-oembed-providers": "*; oEmbed providers - Google Docs, Prezi ...",

"nfreear/ou-media-player-test": "*; Remote integration tests.",
"IET-OU/mediaelement-demo": "*; Demos for IET-OU enhancements & fixes to MediaElement.js",

"wikimedia/composer-merge-plugin": "v1.0.0",
"nfreear/composer-suggest": "^1.1"
"iet-ou/mediaelement-demo": "*; Demos for IET-OU enhancements & fixes to MediaElement.js"
},
"scripts": {
"test": [
"#echo $1",
"#export F=application/$1 ;",
"#composer validate #--no-interaction",
"composer validate --no-interaction",
"composer validate --no-interaction --working-dir composer-shared",
"#parallel-lint application/*",
"phpcs --standard=./phpcs.xml -n --encoding=utf-8 --extensions=php application/core/*"
"phpcs --standard=./phpcs.xml -n --encoding=utf-8 --extensions=php application/*"
],
"test-psr2": [
"phpcs --standard=PSR2 -n --encoding=utf-8 --extensions=php application/core/MY_Co*"
"phpcs --standard=PSR2 -n --encoding=utf-8 --extensions=php application/core/*"
],

"test-v": [
Expand All @@ -76,31 +58,20 @@
"phpcbf --standard=PSR2 -n -l --encoding=utf-8 --extensions=php application/core/MY_Co*"
],
"fix-oump": [
"phpcbf --standard=./phpcs.xml -n -l --encoding=utf-8 --extensions=php application/core/*"
"phpcbf --standard=./phpcs.xml -n -l --encoding=utf-8 --extensions=php application/help*"
]
},
"config": {
"preferred-install": "source"
},
"extra": {

"installer-paths": {
"./application/engines/mediaelement-x": [ "johndyer/mediaelement" ]
},

"merge-plugin": {
"include": [
"./shared/composer.json"
"./composer-shared/composer.json"
]
},

"//": [
"http://mediaplayer.open.ac.uk/demo/info#php - 5.4.36",
"http://embed.open.ac.uk/demo/info#php - 5.3.3",
"https://github.com/IET-OU/ouplayer ../system/core/CodeIgniter.php#L36 - CI 2.1.3",
"http://iet-embed-acct.open.ac.uk/docs/CREDITS.txt",

"https://gist.github.com/nfreear/57262e040d49b2f212ec"
]
}
}
}
}
70 changes: 3 additions & 67 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@
<ruleset name="mediaplayer-open-ac-uk">
<description>OU Media Player coding standard - PSR2, almost!</description>

<!--
Stay as close to PSR-2 as possible, but account for CodeIgniter conventions.
http://edorian.github.io/php-coding-standard-generator/#phpcs
-->

<exclude-pattern>\.git</exclude-pattern>
<exclude-pattern>/application/assets/</exclude-pattern>
<exclude-pattern>/application/cli/</exclude-pattern>
Expand All @@ -25,77 +19,19 @@
<exclude-pattern>/application/libraries/class.pdf2text.php</exclude-pattern>
<exclude-pattern>/application/libraries/POParser.php</exclude-pattern>

<!-- Why does `phpcbf` fail on http.php ?? -->
<exclude-pattern>/application/libraries/ht--tp.php</exclude-pattern>

<!-- Temporarily exclude all views and provider-libraries. -->
<exclude-pattern>*/views/*</exclude-pattern>
<exclude-pattern>/application/libraries/providers/</exclude-pattern>
<exclude-pattern>/application/libraries/</exclude-pattern>


<rule ref="PSR2">
<exclude name="PSR2.Methods.MethodDeclaration"/>
<!--<exclude name="PSR2.Classes.PropertyDeclaration"/>-->
</rule>
<rule ref="./vendor/iet-ou/open-media-player-core/phpcs.xml"/>

<rule ref="PSR1">
<exclude name="PSR1.Methods.CamelCapsMethodName"/>

<!--
For the moment, don't require namespaces.
Relax standard: don't require namespaces for CodeIgniter controllers, etc.
-->
<exclude name="PSR1.Classes.ClassDeclaration"/>

<!--<exclude name="PSR1.Files.SideEffects"/>-->
</rule>

<rule ref="Squiz.Classes">
<exclude name="Squiz.Classes.ValidClassName"/>
</rule>

<!-- "%s name doesn't match filename; expected"-->
<rule ref="Squiz.Classes">
<exclude-pattern>/application/controllers/</exclude-pattern>

<exclude name="Squiz.Classes.ValidClassName"/>
<!--<exclude name="Squiz.Classes.ClassFileName"/>-->
</rule>

<!--
Accept class names like "MY_Controller".
-->
<rule ref="PEAR.NamingConventions.ValidClassName"/>


<!--<rule ref="Squiz.Arrays.ArrayBracketSpacing"/>-->

<!--<rule ref="Squiz.Classes.LowercaseClassKeywords"/>-->

<rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop"/>
<rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall"/>
<rule ref="Generic.CodeAnalysis.JumbledIncrementer"/>
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>

<rule ref="Generic.Commenting.Todo"/>

<rule ref="Generic.Files.LineEndings"/>

<rule ref="Generic.PHP.DeprecatedFunctions"/>
<rule ref="Squiz.PHP.DisallowSizeFunctionsInLoops"/>
<rule ref="Squiz.PHP.Eval"/>
<rule ref="Generic.PHP.ForbiddenFunctions"/>
<rule ref="Squiz.PHP.NonExecutableCode"/>
<!--<rule ref="Generic.PHP.NoSilencedErrors"/>-->

<rule ref="Squiz.Scope.MemberVarScope"/>
<rule ref="Squiz.Scope.StaticThisUsage"/>

<rule ref="Squiz.WhiteSpace.CastSpacing"/>
<rule ref="Squiz.WhiteSpace.LanguageConstructSpacing"/>
<rule ref="Squiz.WhiteSpace.LogicalOperatorSpacing"/>
<rule ref="Squiz.WhiteSpace.SemicolonSpacing"/>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"/>

<!-- All rules in ./Sniffs are included automatically -->
</ruleset>

0 comments on commit 9f0db80

Please sign in to comment.