Added missing subdirectories

This commit is contained in:
Dennis Eichhorn 2017-03-11 14:30:01 +01:00
parent d9aafdfa43
commit 7a974c13bc
24 changed files with 532 additions and 4 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
**/

5
Configs/composer.json Normal file
View File

@ -0,0 +1,5 @@
{
"require-dev": {
"johnkary/phpunit-speedtrap": "^1.0"
}
}

102
Configs/phpcs.xml Normal file
View File

@ -0,0 +1,102 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="oms-rulesets">
<description>Orange Management ruleset! www.orange-management.de
</description>
<rule ref="Generic.Classes.DuplicateClassName"/>
<rule ref="Generic.CodeAnalysis.EmptyStatement"/>
<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.CodeAnalysis.UnusedFunctionParameter"/>
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
<rule ref="Generic.ControlStructures.InlineControlStructure"/>
<rule ref="Generic.Files.LineEndings"/>
<rule ref="Generic.Formatting.DisallowMultipleStatements"/>
<rule ref="Generic.Formatting.MultipleStatementAlignment"/>
<rule ref="Generic.Formatting.SpaceAfterCast"/>
<rule ref="Generic.Metrics.CyclomaticComplexity">
<properties>
<property name="complexity" value="10"/>
<property name="absoluteComplexity" value="20"/>
</properties>
</rule>
<rule ref="Generic.Metrics.NestingLevel">
<properties>
<property name="nestingLevel" value="5"/>
<property name="absoluteNestingLevel" value="10"/>
</properties>
</rule>
<rule ref="Generic.NamingConventions.ConstructorName"/>
<rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
<rule ref="Generic.NamingConventions.CamelCapsFunctionName"/>
<rule ref="Generic.PHP.DeprecatedFunctions"/>
<rule ref="Generic.PHP.DisallowShortOpenTag"/>
<rule ref="Generic.PHP.ForbiddenFunctions"/>
<rule ref="Generic.PHP.LowerCaseConstant"/>
<rule ref="Generic.PHP.NoSilencedErrors"/>
<rule ref="Generic.Strings.UnnecessaryStringConcat"/>
<rule ref="Generic.WhiteSpace.DisallowTabIndent"/>
<rule ref="Generic.WhiteSpace.ScopeIndent"/>
<rule ref="MySource.PHP.EvalObjectFactory"/>
<rule ref="MySource.PHP.GetRequestData"/>
<rule ref="PEAR.Classes.ClassDeclaration"/>
<rule ref="PEAR.Commenting.ClassComment"/>
<rule ref="PEAR.Commenting.FileComment"/>
<rule ref="PEAR.Commenting.FunctionComment"/>
<rule ref="PEAR.Commenting.InlineComment"/>
<rule ref="PEAR.ControlStructures.ControlSignature"/>
<rule ref="PEAR.Functions.FunctionCallSignature"/>
<rule ref="PEAR.Functions.ValidDefaultValue"/>
<rule ref="PEAR.NamingConventions.ValidClassName"/>
<rule ref="PEAR.WhiteSpace.ObjectOperatorIndent"/>
<rule ref="PEAR.WhiteSpace.ScopeClosingBrace"/>
<rule ref="PEAR.WhiteSpace.ScopeIndent"/>
<rule ref="PSR1.Classes.ClassDeclaration"/>
<rule ref="PSR1.Files.SideEffects"/>
<rule ref="PSR2.Classes.ClassDeclaration"/>
<rule ref="PSR2.Classes.PropertyDeclaration"/>
<rule ref="PSR2.ControlStructures.ControlStructureSpacing"/>
<rule ref="PSR2.ControlStructures.ElseIfDeclaration"/>
<rule ref="PSR2.ControlStructures.SwitchDeclaration"/>
<rule ref="PSR2.Files.EndFileNewline"/>
<rule ref="PSR2.Methods.MethodDeclaration"/>
<rule ref="PSR2.Namespaces.NamespaceDeclaration"/>
<rule ref="PSR2.Namespaces.UseDeclaration"/>
<rule ref="Squiz.PHP.CommentedOutCode">
<properties>
<property name="maxPercentage" value="30"/>
</properties>
</rule>
<rule ref="Squiz.PHP.DisallowSizeFunctionsInLoops"/>
<rule ref="Squiz.PHP.DiscouragedFunctions"/>
<rule ref="Squiz.PHP.Eval"/>
<rule ref="Squiz.PHP.ForbiddenFunctions"/>
<rule ref="Squiz.PHP.GlobalKeyword"/>
<rule ref="Squiz.PHP.Heredoc"/>
<rule ref="Squiz.PHP.InnerFunctions"/>
<rule ref="Squiz.PHP.LowercasePHPFunctions"/>
<rule ref="Squiz.PHP.NonExecutableCode"/>
<rule ref="Squiz.Scope.MemberVarScope"/>
<rule ref="Squiz.Scope.MethodScope"/>
<rule ref="Squiz.Scope.StaticThisUsage"/>
<rule ref="Squiz.WhiteSpace.CastSpacing"/>
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing"/>
<rule ref="Squiz.WhiteSpace.FunctionOpeningBraceSpace"/>
<rule ref="Squiz.WhiteSpace.FunctionSpacing">
<properties>
<property name="spacing" value="1"/>
</properties>
</rule>
<rule ref="Squiz.WhiteSpace.LanguageConstructSpacing"/>
<rule ref="Squiz.WhiteSpace.LogicalOperatorSpacing"/>
<rule ref="Squiz.WhiteSpace.MemberVarSpacing"/>
<rule ref="Squiz.WhiteSpace.OperatorSpacing"/>
<rule ref="Squiz.WhiteSpace.PropertyLabelSpacing"/>
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace"/>
<rule ref="Squiz.WhiteSpace.ScopeKeywordSpacing"/>
<rule ref="Squiz.WhiteSpace.SemicolonSpacing"/>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"/>
<rule ref="Zend.Files.ClosingTag"/>
</ruleset>

100
Configs/phpmd.xml Normal file
View File

@ -0,0 +1,100 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="oms-rulesets"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>Orange Management ruleset! www.orange-management.de
</description>
<rule ref="rulesets/codesize.xml/CyclomaticComplexity">
<properties>
<property name="reportLevel" value="10"/>
</properties>
</rule>
<rule ref="rulesets/codesize.xml/NPathComplexity">
<properties>
<property name="minimum" value="200"/>
</properties>
</rule>
<rule ref="rulesets/codesize.xml/ExcessiveMethodLength">
<properties>
<property name="minimum" value="100"/>
</properties>
</rule>
<rule ref="rulesets/codesize.xml/ExcessiveClassLength">
<properties>
<property name="minimum" value="1000"/>
</properties>
</rule>
<rule ref="rulesets/codesize.xml/ExcessiveParameterList">
<properties>
<property name="minimum" value="10"/>
</properties>
</rule>
<rule ref="rulesets/codesize.xml/ExcessivePublicCount">
<properties>
<property name="minimum" value="45"/>
</properties>
</rule>
<rule ref="rulesets/codesize.xml/TooManyFields">
<properties>
<property name="maxfields" value="15"/>
</properties>
</rule>
<rule ref="rulesets/codesize.xml/TooManyMethods">
<properties>
<property name="maxmethods" value="10"/>
</properties>
</rule>
<rule ref="rulesets/codesize.xml/ExcessiveClassComplexity">
<properties>
<property name="maximum" value="50"/>
</properties>
</rule>
<rule ref="rulesets/controversial.xml/Superglobals"/>
<rule ref="rulesets/controversial.xml/CamelCaseClassName"/>
<rule ref="rulesets/controversial.xml/CamelCasePropertyName"/>
<rule ref="rulesets/controversial.xml/CamelCaseMethodName"/>
<rule ref="rulesets/controversial.xml/CamelCaseParameterName"/>
<rule ref="rulesets/controversial.xml/CamelCaseVariableName"/>
<rule ref="rulesets/design.xml/ExitExpression"/>
<rule ref="rulesets/design.xml/EvalExpression"/>
<rule ref="rulesets/design.xml/GotoStatement"/>
<rule ref="rulesets/design.xml/NumberOfChildren">
<properties>
<property name="minimum" value="15"/>
</properties>
</rule>
<rule ref="rulesets/design.xml/DepthOfInheritance">
<properties>
<property name="minimum" value="6"/>
</properties>
</rule>
<rule ref="rulesets/design.xml/CouplingBetweenObjects">
<properties>
<property name="minimum" value="13"/>
</properties>
</rule>
<rule ref="rulesets/naming.xml/ShortVariable">
<properties>
<property name="minimum" value="3"/>
</properties>
</rule>
<rule ref="rulesets/naming.xml/LongVariable">
<properties>
<property name="maximum" value="20"/>
</properties>
</rule>
<rule ref="rulesets/naming.xml/ShortMethodName">
<properties>
<property name="minimum" value="3"/>
</properties>
</rule>
<rule ref="rulesets/naming.xml/ConstructorWithNameAsEnclosingClass"/>
<rule ref="rulesets/naming.xml/ConstantNamingConventions"/>
<rule ref="rulesets/naming.xml/BooleanGetMethodName"/>
<rule ref="rulesets/unusedcode.xml/UnusedPrivateField"/>
<rule ref="rulesets/unusedcode.xml/UnusedLocalVariable"/>
<rule ref="rulesets/unusedcode.xml/UnusedPrivateMethod"/>
<rule ref="rulesets/unusedcode.xml/UnusedFormalParameter"/>
</ruleset>

View File

@ -0,0 +1,19 @@
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$fh = fopen('GeoIPCountryWhois.csv', 'r');
$fo = fopen('output.csv', 'w');
function ip2int(string $ip) : float {
$split = explode('.', $ip);
return $split[0] * (256 ** 3) + $split[1] * (256 ** 2) + $split[2] * (256 ** 1) + $split[3];
}
while (($data = fgetcsv($fh, 150, ",")) !== FALSE) {
fputcsv($fo, [ip2int($data[0]), ip2int($data[1]), $data[4]]);
}
fclose($fo);
fclose($fh);

13
Helper/pre_commit.sh Normal file
View File

@ -0,0 +1,13 @@
#!/bin/bash
git diff --cached --name-only | while read FILE; do
if [[ "$FILE" =~ ^.+(php)$ ]]; then
if [[ -f ${FILE} ]]; then
php -l "$FILE" 1> /dev/null
if [ $? -ne 0 ]; then
echo -e "\e[1;31m\tAborting commit due to files with syntax errors.\e[0m" >&2
exit 1
fi
fi
fi
done || exit $?

129
Helper/testGenerator.php Normal file
View File

@ -0,0 +1,129 @@
<?php
function endsWith($haystack, $needle)
{
return $needle === '' || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== false);
}
function listFolderFiles($dir, $extension)
{
$files = [];
$ffs = scandir($dir);
foreach ($ffs as $ff) {
if ($ff !== '.' && $ff !== '..') {
if (is_dir($dir . '/' . $ff)) {
$files = array_merge($files, listFolderFiles($dir . '/' . $ff, $extension));
} else {
if (endsWith($ff, $extension)) {
$files[] = $dir . '/' . $ff;
}
}
}
}
return $files;
}
// PHP tests
$base = __DIR__ . '/../phpOMS';
$files = listFolderFiles($base, '.php');
$testBase = __DIR__ . '/../Tests/PHPUnit/Framework';
foreach ($files as $file) {
$file = str_replace($base, '', $file);
$subdir = trim($file, '/');
$split = explode('.', $file);
$testPath = $testBase . '/' . $split[0] . 'Test.' . $split[1];
if (stripos($subdir, 'Interface') === false
&& stripos($subdir, 'Trait') === false
&& stripos($subdir, 'Abstract') === false
) {
if (!file_exists($testPath)) {
$namespace = str_replace('/', '\\', $split[0]);
$namespace = explode('\\', $namespace);
$classnameSrc = $namespace[count($namespace) - 1];
$classname = $classnameSrc . 'Test';
unset($namespace[count($namespace) - 1]);
$use = trim('phpOMS\\' . trim(implode('\\', $namespace), '\\') . '\\' . $classnameSrc, '\\');
$namespace = trim('Tests\PHPUnit\Framework\\' . trim(implode('\\', $namespace), '\\'), '\\');
$autoloader = str_repeat('/..', count(explode('\\', $namespace)));
if(!file_exists(dirname($testPath))) {
mkdir(dirname($testPath), 0777, true);
}
file_put_contents($testPath,
'<?php' . PHP_EOL
. '/**' . PHP_EOL
. ' * Orange Management' . PHP_EOL
. ' *' . PHP_EOL
. ' * PHP Version 7.1' . PHP_EOL
. ' *' . PHP_EOL
. ' * @category TBD' . PHP_EOL
. ' * @package TBD' . PHP_EOL
. ' * @author OMS Development Team <dev@oms.com>' . PHP_EOL
. ' * @author Dennis Eichhorn <d.eichhorn@oms.com>' . PHP_EOL
. ' * @copyright Dennis Eichhorn' . PHP_EOL
. ' * @license OMS License 1.0' . PHP_EOL
. ' * @version 1.0.0' . PHP_EOL
. ' * @link http://orange-management.com' . PHP_EOL
. ' */' . PHP_EOL
. '' . PHP_EOL
. 'namespace ' . $namespace . ';' . PHP_EOL
. '' . PHP_EOL
. 'require_once __DIR__ . \'' . $autoloader . '/phpOMS/Autoloader.php\';' . PHP_EOL
. '' . PHP_EOL
. 'use ' . $use . ';' . PHP_EOL
. '' . PHP_EOL
. 'class ' . $classname . ' extends \PHPUnit_Framework_TestCase' . PHP_EOL
. '{' . PHP_EOL
. ' public function testPlaceholder()' . PHP_EOL
. ' {' . PHP_EOL
. ' self::markTestIncomplete();' . PHP_EOL
. ' }' . PHP_EOL
. '}' . PHP_EOL
);
}
}
}
// JS tests
$base = __DIR__ . '/../jsOMS';
$files = listFolderFiles($base, '.js');
$testBase = __DIR__ . '/../Tests/JS/Framework';
foreach ($files as $file) {
$file = str_replace($base, '', $file);
$subdir = trim($file, '/');
$split = explode('.', $file);
$testPath = $testBase . '/' . $split[0] . 'Test.' . $split[1];
if (stripos($subdir, 'Interface') === false
&& stripos($subdir, 'Trait') === false
&& stripos($subdir, 'Abstract') === false
) {
if (!file_exists($testPath)) {
$name = explode('/', $split[0]);
if(!file_exists(dirname($testPath))) {
mkdir(dirname($testPath), 0777, true);
}
file_put_contents($testPath,
'describe(\'' . $name[count($name) - 1] . 'Test\', function ()' . PHP_EOL
. '{' . PHP_EOL
. ' "use strict";' . PHP_EOL
. '' . PHP_EOL
. ' beforeEach(function ()' . PHP_EOL
. ' {' . PHP_EOL
. ' });' . PHP_EOL
. '' . PHP_EOL
. ' afterEach(function ()' . PHP_EOL
. ' {' . PHP_EOL
. ' });' . PHP_EOL
. '}' . PHP_EOL
);
}
}
}

18
Helper/watcher.sh Normal file
View File

@ -0,0 +1,18 @@
#!/bin/bash
DIRECTORY_TO_OBSERVE="cssOMS jsOMS"
function watcher {
inotifywait -r -e modify,move,create,delete \
--exclude ".*(\.css|\.php|\.json|\.md|\.sh|\.txt|\.log|\.min\.js)" \
${DIRECTORY_TO_OBSERVE}
}
BUILD_SCRIPT=build_frontend.sh
function build {
bash ${BUILD_SCRIPT}
}
build
while watcher; do
build
done

View File

@ -0,0 +1,12 @@
#!/bin/bash
. ../../config.sh
# Find empty attributes
grep -rln "=\"\"" --include \*.tpl.php ${ROOT_PATH} > ${INSPECTION_PATH}/Modules/html/attributes_empty.log
# Find invalid attributes
find ${ROOT_PATH} -name "*tpl.php" | xargs -0 grep '(id=")([\ ]*)(")' >> ${INSPECTION_PATH}/Modules/html/attributes_invalid.log
find ${ROOT_PATH} -name "*tpl.php" | xargs -0 grep '(min=")([a-zA-Z]*)(")' >> ${INSPECTION_PATH}/Modules/html/attributes_invalid.log
find ${ROOT_PATH} -name "*tpl.php" | xargs -0 grep '(max=")([a-zA-Z]*)(")' >> ${INSPECTION_PATH}/Modules/html/attributes_invalid.log
find ${ROOT_PATH} -name "*tpl.php" | xargs -0 grep '(=")([#$%^&*\(\)\\/]*)(")' >> ${INSPECTION_PATH}/Modules/html/attributes_invalid.log

30
Inspection/Html/tags.sh Normal file
View File

@ -0,0 +1,30 @@
#!/bin/bash
. ../../config.s
# Html tag inspection
TAG[0]="<\/html>"
TAG[1]="<\/body>"
TAG[2]="<\/head>"
TAG[3]="<\/thead>"
TAG[4]="<\/tbody>"
TAG[5]="<\/tfoot>"
TAG[6]="<\/tr>"
TAG[7]="<\/th>"
TAG[8]="<\/td>"
TAG[9]="<\/option>"
TAG[10]="<\/li>"
TAG[11]="<br\s*\/>"
TAG[12]="<meta.*\/>"
TAG[13]="<input.*\/>"
TAG[14]="<hr.*\/>"
TAG[15]="<img.*\/>"
TAG[16]="<link.*\/>"
TAG[17]="<source.*\/>"
TAG[18]="<embed.*\/>"
for i in "${TAG[@]}"
do
grep -rln "$i" --include \*.tpl.php ${ROOT_PATH}/phpOMS >> ${INSPECTION_PATH}/Framework/html/tags.log
grep -rln "$i" --include \*.tpl.php ${ROOT_PATH}/Modules >> ${INSPECTION_PATH}/Modules/html/tags.log
done

0
Inspection/Js/linting.sh Normal file
View File

0
Inspection/Js/tests.sh Normal file
View File

View File

@ -0,0 +1,5 @@
#!/bin/bash
. ../../config.s
find ${ROOT_PATH} -name "*.json" | xargs -L1 jsonlint -q > ${INSPECTION_PATH}/Modules/linting/linting_json.log

View File

View File

View File

11
Inspection/Php/linting.sh Normal file
View File

@ -0,0 +1,11 @@
#!/bin/bash
. ../../config.s
find ${ROOT_PATH}/phpOMS -name "*.php" | xargs -L1 php -l > ${INSPECTION_PATH}/logs/temp.log
sed '/^No syntax.*/ d' < ${INSPECTION_PATH}/logs/temp.log > ${INSPECTION_PATH}/Framework/linting/linting_php.log
find ${ROOT_PATH}/Modules -name "*.php" | xargs -L1 php -l > ${INSPECTION_PATH}/logs/temp.log
sed '/^No syntax.*/ d' < ${INSPECTION_PATH}/logs/temp.log > ${INSPECTION_PATH}/Modules/linting/linting_php.log
rm ${INSPECTION_PATH}/logs/temp.log

View File

@ -0,0 +1,42 @@
#!/bin/bash
. ../../config.s
# PHP code inspection
CODE[0]="file_get_content"
CODE[1]="fopen"
CODE[2]="include"
CODE[3]="require"
CODE[4]="file_put_content"
CODE[5]="fread"
CODE[6]="fwrite"
CODE[7]="fget"
CODE[8]="fput"
CODE[9]="chmod"
CODE[10]="eval"
CODE[11]="delete"
CODE[12]="mkdir"
CODE[13]="move_uploaded_file"
CODE[14]="mkdir"
CODE[15]="copy"
CODE[16]="chown"
CODE[17]="touch"
CODE[18]="exec"
CODE[19]="_GET"
CODE[20]="_POST"
CODE[21]="_SESSION"
CODE[22]="_REQUEST"
CODE[23]="_SERVER"
CODE[24]="_COOKIE"
CODE[25]="_FILES"
CODE[26]="unlink"
CODE[27]="action=\""
for i in "${CODE[@]}"
do
grep -rln "$i" --include \*.php ${ROOT_PATH}/phpOMS >> ${INSPECTION_PATH}/Framework/critical_php.log
grep -rln "$i" --include \*.php ${ROOT_PATH}/Modules >> ${INSPECTION_PATH}/Modules/citical_php.log
done
# PHP strict type
grep -r -L "declare\(\ *strict_types\ *=\ *1\ *\);" --include=*.php ${ROOT_PATH}/phpOMS > ${INSPECTION_PATH}/Framework/strict_missing.log

12
Inspection/Php/stats.sh Normal file
View File

@ -0,0 +1,12 @@
#!/bin/bash
. ../../config.s
php ${TOOLS_PATH}/phploc.phar ${ROOT_PATH}/phpOMS/ > ${INSPECTION_PATH}/Framework/phploc.log
php ${TOOLS_PATH}/phploc.phar ${ROOT_PATH}/Modules/ > ${INSPECTION_PATH}/Modules/phploc.log
php ${TOOLS_PATH}/phpmetrics.phar --report-html=${INSPECTION_PATH}/Framework/metrics/metrics.html ${ROOT_PATH}/phpOMS/ >> ${INSPECTION_PATH}/Framework/build.log
php ${TOOLS_PATH}/phpmetrics.phar --report-html=${INSPECTION_PATH}/Modules/metrics/metrics.html ${ROOT_PATH}/Modules/ >> ${INSPECTION_PATH}/Modules/build.log
php ${TOOLS_PATH}/pdepend.phar --summary-xml=${INSPECTION_PATH}/Framework/pdepend/pdepend.xml --jdepend-chart=${INSPECTION_PATH}/Framework/pdepend/chart.svg --overview-pyramid=${INSPECTION_PATH}/Framework/pdepend/pyramid.svg ${ROOT_PATH}/phpOMS
php ${TOOLS_PATH}/pdepend.phar --summary-xml=${INSPECTION_PATH}/Modules/pdepend/pdepend.xml --jdepend-chart=${INSPECTION_PATH}/Modules/pdepend/chart.svg --overview-pyramid=${INSPECTION_PATH}/Modules/pdepend/pyramid.svg ${ROOT_PATH}/Modules

8
Inspection/Php/tests.sh Normal file
View File

@ -0,0 +1,8 @@
#!/bin/bash
. ../../config.s
php ${TOOLS_PATH}/phpunit.phar --configuration ${TEST_PATH}/PHPUnit/phpunit_default.xml > ${INSPECTION_PATH}/logs/phpunit.log
#phpdbg -qrr phpunit.phar --configuration Tests/PHPUnit/phpunit_default.xml
#php Documentor/src/index.php -s C:\Users\coyle\Desktop\Orange-Management\phpOMS -d C:\Users\coyle\Desktop\outtest -c C:\Users\coyle\Desktop\Orange-Management\Build\log\coverage.xml -u C:\Users\coyle\Desktop\Orange-Management\Build\log\test.xml -g C:\Users\coyle\Desktop\Orange-Management\Developer-Guide
#phpdbg -qrr phpunit.phar Tests/PHPUnit/Framework/Math/Matrix/MatrixTest.php --bootstrap Tests/PHPUnit/Bootstrap.php

10
Inspection/Php/tools.sh Normal file
View File

@ -0,0 +1,10 @@
#!/bin/bash
. ../../config.s
php ${TOOLS_PATH}/phpcs.phar --report-file=${INSPECTION_PATH}/Framework/phpcs/phpcs.log --ignore=${ROOT_PATH}/phpOMS/Localization --standard=${INSPECTION_PATH}/Configs/phpcs.xml ${ROOT_PATH}/phpOMS
php ${TOOLS_PATH}/phpcs.phar --report-file=${INSPECTION_PATH}/Modules/phpcs/phpcs.log --standard=${INSPECTION_PATH}/Configs/phpcs.xml ${ROOT_PATH}/Modules
#php ${TOOLS_PATH}/phpmd.phar ${ROOT_PATH}/phpOMS xml ${INSPECTION_PATH}/Configs/phpmd.xml --reportfile ${INSPECTION_PATH}/logs/phpmdFramework.log -- bzip missing
#php ${TOOLS_PATH}/phpmd.phar ${ROOT_PATH}/Modules xml ${INSPECTION_PATH}/Configs/phpmd.xml --reportfile ${INSPECTION_PATH}/logs/phpmdModules.log -- bzip missing
php ${TOOLS_PATH}/phpcpd.phar ${ROOT_PATH}/phpOMS --exclude Localization --no-interaction > ${INSPECTION_PATH}/Framework/phpcpd/phpcpd.log
php ${TOOLS_PATH}/phpcpd.phar ${ROOT_PATH}/Modules --no-interaction > ${INSPECTION_PATH}/Modules/phpcpd/phpcpd.log

View File

@ -15,6 +15,18 @@ The last feature is the backend and documentation generation based on the DocBlo
* Modify the `config.sh` file to your needs
* Run `setup.sh`
## Dependencies
The build system will take care of most requirements, the following tools and commands have to be available on the system.
* npm
* git
* wget
* curl
* grep
* xargs
* sed
# Usage
* Run `build_dev.sh`

View File

@ -3,6 +3,7 @@
# Paths
BASE_PATH="/var/www/html"
ROOT_PATH="/var/www/html/Orange-Management"
BUILD_PATH="/var/www/Build"
TOOLS_PATH="/var/www/html/Tools"
RELEASE_PATH="/var/www/html/Release"

View File

@ -12,9 +12,6 @@ mkdir -p ${INSPECTION_PATH}
rm -r -f ${TOOLS_PATH}
mkdir -p ${TOOLS_PATH}
rm -r -f ${BUILD_PATH}
mkdir -p ${BUILD_PATH}
# Handling git
c=0;
for i in "${GITHUB_URL[@]}"
@ -76,6 +73,8 @@ wget -nc https://phar.phpunit.de/phpcpd.phar
wget -nc http://dl.google.com/closure-compiler/compiler-latest.tar.gz
tar -zxvf compiler-latest.tar.gz
cp ${BUILD_PATH}/Configs/composer.json ${TOOLS_PATH}/composer.json
php composer.phar install
# Installing tools