Skip to content

Commit

Permalink
composer configuration & remove /vendor
Browse files Browse the repository at this point in the history
  • Loading branch information
pifou25 committed Jun 8, 2024
1 parent 72f2683 commit 61e789c
Show file tree
Hide file tree
Showing 2,249 changed files with 21,313 additions and 213,080 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"bacon/bacon-qr-code": "^2.0",
"guzzlehttp/guzzle" : "^6.5.8",
"http-interop/http-factory-guzzle": "^1.2",
"symfony/http-client": "^7.0",
"symfony/http-client": "^5.4",
"nyholm/psr7": "^1.8"
},
"config": {
Expand Down
2,552 changes: 1,863 additions & 689 deletions composer.lock

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions install/backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,9 @@
'core/config/common.config.php',
'data/imgOs',
'python_venv',
'vendor',
config::byKey('backup::path'),
);
if (version_compare(PHP_VERSION, '8.0.0') >= 0) {
$excludes[] = '/vendor';
}

if (config::byKey('recordDir', 'camera') != '') {
$excludes[] = config::byKey('recordDir', 'camera');
Expand Down
15 changes: 6 additions & 9 deletions install/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -318,17 +318,14 @@ step_9_jeedom_configuration() {
step_10_jeedom_installation() {
echo "---------------------------------------------------------------------"
echo "${YELLOW}Starting step 10 - Jeedom install${NORMAL}"
// install composer
chmod +x ${WEBSERVER_HOME}/resources/install_composer.sh
${WEBSERVER_HOME}/resources/install_composer.sh
PHP_VERSION=$(php -r "echo PHP_VERSION;")
if [ $(version $PHP_VERSION) -ge $(version "8.0.0") ]; then
echo "PHP version highter than 8.0.0, need to reinstall composer dependancy"
rm -rf ${WEBSERVER_HOME}/vendor
rm -rf ${WEBSERVER_HOME}/composer.lock
export COMPOSER_ALLOW_SUPERUSER=1
cd ${WEBSERVER_HOME}
composer install --no-ansi --no-dev --no-interaction --no-plugins --no-progress --no-scripts --optimize-autoloader
fi
export COMPOSER_ALLOW_SUPERUSER=1
cd ${WEBSERVER_HOME}
// install php dependencies into /vendor
composer install --no-progress --no-interaction --no-dev

mkdir -p /tmp/jeedom
chmod 777 -R /tmp/jeedom
chown www-data:www-data -R /tmp/jeedom
Expand Down
34 changes: 15 additions & 19 deletions install/restore.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,9 @@
'.git',
'.log',
'core/config/common.config.php',
'vendor/',
config::byKey('backup::path'),
);
if(version_compare(PHP_VERSION, '8.0.0') >= 0){
$excludes[] = '/vendor';
}
$exclude = '';
foreach ($excludes as $folder) {
$exclude .= ' --exclude="' . $folder . '"';
Expand All @@ -124,24 +122,22 @@
system('cd ' . $jeedom_dir . '; tar xfz "' . $backup . '" ' . $exclude);
echo "OK\n";

if(version_compare(PHP_VERSION, '8.0.0') >= 0){
if (exec('which composer | wc -l') == 0) {
echo "\nNeed to install composer...";
echo shell_exec('sudo ' . __DIR__ . '/../resources/install_composer.sh');
echo "OK\n";
}
echo "Update composer file...\n";
if (exec('which composer | wc -l') > 0) {
shell_exec('export COMPOSER_HOME="/tmp/composer";export COMPOSER_ALLOW_SUPERUSER=1;'.system::getCmdSudo().' composer self-update > /dev/null 2>&1');
shell_exec('cd ' . __DIR__ . '/../;export COMPOSER_ALLOW_SUPERUSER=1;export COMPOSER_HOME="/tmp/composer";'.system::getCmdSudo().' composer update --no-interaction --no-plugins --no-scripts --no-ansi --no-dev --no-progress --optimize-autoloader --with-all-dependencies --no-cache > /dev/null 2>&1');
shell_exec(system::getCmdSudo().' rm /tmp/composer 2>/dev/null');
if(method_exists('jeedom','cleanFileSystemRight')){
jeedom::cleanFileSystemRight();
}
}
if (exec('which composer | wc -l') == 0) {
echo "\nNeed to install composer...";
echo shell_exec('sudo ' . __DIR__ . '/../resources/install_composer.sh');
echo "OK\n";
echo "[PROGRESS][58]\n";
}
echo "Update composer file...\n";
if (exec('which composer | wc -l') > 0) {
shell_exec('export COMPOSER_HOME="/tmp/composer";export COMPOSER_ALLOW_SUPERUSER=1;'.system::getCmdSudo().' composer self-update > /dev/null 2>&1');
shell_exec('cd ' . __DIR__ . '/../;export COMPOSER_ALLOW_SUPERUSER=1;export COMPOSER_HOME="/tmp/composer";'.system::getCmdSudo().' composer update --no-interaction --no-plugins --no-scripts --no-ansi --no-dev --no-progress --optimize-autoloader --with-all-dependencies --no-cache > /dev/null 2>&1');
shell_exec(system::getCmdSudo().' rm /tmp/composer 2>/dev/null');
if(method_exists('jeedom','cleanFileSystemRight')){
jeedom::cleanFileSystemRight();
}
}
echo "OK\n";
echo "[PROGRESS][58]\n";

if (!file_exists($jeedom_dir . "/DB_backup.sql")) {
throw new Exception('Cannot find database backup file : DB_backup.sql');
Expand Down
2 changes: 0 additions & 2 deletions vendor/.htaccess

This file was deleted.

21 changes: 13 additions & 8 deletions vendor/abbadon1334/sun-position-spa-php/.travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
language: php

php:
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3

before_script:
- composer self-update
- composer install --prefer-source --dev
- curl -s http://getcomposer.org/installer | php
- php composer.phar install -n
- composer require satooshi/php-coveralls:~1.0@stable # Require phpCoveralls
- mkdir -p coverage/xml # Create a folder to store clover files #1
- mkdir -p build/logs # Create a folder to store clover files #2
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build

script:
- phpunit
- php vendor/bin/phpunit --coverage-clover build/logs/clover.xml

notifications:
email: false
after_script:
- php vendor/bin/codacycoverage clover build/logs/clover.xml
- sh -c 'if( [ "$TRAVIS_PHP_VERSION" != "hhvm" ] ); then php vendor/bin/coveralls -v; fi;'
- ./cc-test-reporter after-build --coverage-input-type clover --exit-code $TRAVIS_TEST_RESULT
5 changes: 4 additions & 1 deletion vendor/abbadon1334/sun-position-spa-php/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Sun-Position-SPA-php
SPA Sun Position Calc Library for PHP

PHPUNIT TEST PHP 5.6 - 7.0 ![Alt text](https://travis-ci.org/abbadon1334/sun-position-spa-php.svg?branch=master)
[![Build Status](https://travis-ci.org/abbadon1334/sun-position-spa-php.svg?branch=master)](https://travis-ci.org/abbadon1334/sun-position-spa-php)
[![Coverage Status](https://coveralls.io/repos/github/abbadon1334/sun-position-spa-php/badge.svg?branch=upgrade-to-unit-8)](https://coveralls.io/github/abbadon1334/sun-position-spa-php?branch=upgrade-to-unit-8)
[![Maintainability](https://api.codeclimate.com/v1/badges/fe0c85053b434e296254/maintainability)](https://codeclimate.com/github/abbadon1334/sun-position-spa-php/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/fe0c85053b434e296254/test_coverage)](https://codeclimate.com/github/abbadon1334/sun-position-spa-php/test_coverage)

This library is based on the work of Ibrahim Reda and Afshin Andreas
(SPA) Solar Position Algorithm for Solar Radiation Applications ( 2008 National Renewable Energy Laboratory )
Expand Down
54 changes: 51 additions & 3 deletions vendor/abbadon1334/sun-position-spa-php/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,71 @@
"name": "abbadon1334/sun-position-spa-php",
"description": "solar data calculation and sun position",
"type": "library",
"license": "MIT",
"authors": [
{
"name": "Francesco Danti",
"email": "fdanti@gmail.com"
}
],
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=7.2"
},
"require-dev": {
"kint-php/kint": "2.2.0",
"phpunit/phpunit": "3.7.14"
"codacy/coverage": "dev-master",
"friendsofphp/php-cs-fixer": "dev-master@dev",
"phpmd/phpmd": "2.6.0",
"phpmetrics/phpmetrics": "dev-master@dev",
"phpstan/phpstan": "0.11.5",
"phpunit/phpunit": "*",
"squizlabs/php_codesniffer": "3.4.2",
"symfony/yaml": "~2.1|~3.0|~4.0"
},
"config": {
"sort-packages": true
},
"autoload": {
"psr-4": {
"SolarData\\": "src/",
"SolarData\\Tests\\": "tests/"
}
}
},
"scripts": {
"fix": "php-cs-fixer fix src",
"stan": "phpstan analyse src",
"stan1": "phpstan analyse --level 1 src",
"stan2": "phpstan analyse --level 2 src",
"stan3": "phpstan analyse --level 3 src",
"stan4": "phpstan analyse --level 4 src",
"stan5": "phpstan analyse --level 5 src",
"stan6": "phpstan analyse --level 6 src",
"stan7": "phpstan analyse --level 7 src",
"metrics": [
"mkdir -p ./build/report",
"mv ./build/report ./build/report_$(date +\"%Y.%m.%d_%H%M%S\")",
"phpmetrics --config=./.phpmetrics.json .",
"firefox ./build/report/phpmetrics.html/index.html"
],
"metrics-clear": [
"rm -rf ./build/report_*",
"rm -rf ./build/report"
],
"unit": [
"mkdir -p ./build/coverage",
"mv ./build/coverage ./build/coverage_$(date +\"%Y.%m.%d_%H%M%S\")",
"phpunit --configuration phpunit.xml"
],
"unit-html": [
"mkdir -p ./build/coverage",
"mv ./build/coverage ./build/coverage_$(date +\"%Y.%m.%d_%H%M%S\")",
"phpunit --configuration phpunit.xml --coverage-html ./build/coverage",
"firefox ./build/coverage/index.html"
],
"unit-clear": [
"rm -rf ./build/coverage_*",
"rm -rf ./build/coverage"
]
}
}
27 changes: 14 additions & 13 deletions vendor/abbadon1334/sun-position-spa-php/phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit colors="true" bootstrap="vendor/autoload.php">
<testsuites>
<testsuite name="Test suite">
<directory>./tests/</directory>
</testsuite>
</testsuites>

<phpunit bootstrap="vendor/autoload.php" stderr="true" colors="true">
<filter>
<whitelist>
<directory suffix=".php">src</directory>

<whitelist addUncoveredFilesFromWhitelist="true" processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src</directory>
<exclude>
<directory suffix=".php">vendor</directory>
<directory suffix=".php">./tests</directory>
<directory suffix=".php">./vendor</directory>
</exclude>
</whitelist>
</filter>
</filter>
<testsuites>
<testsuite name="SUN SPA Calc">
<directory>./tests</directory>
</testsuite>
</testsuites>
<logging>
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>
</phpunit>
21 changes: 12 additions & 9 deletions vendor/abbadon1334/sun-position-spa-php/src/SunPosition.php
Original file line number Diff line number Diff line change
Expand Up @@ -422,10 +422,13 @@ public function calculate()
$T = $this->ObsTemperature;
$Δe° = ($P / 1010.0);
$Δe° *= (283.0 / (273.0 + $T));
$Δe° *= (1.02 / (60.0 * tan(
$Δe° *= (
1.02 / (
60.0 * tan(
// e0° is in degrees. Calculate the tangent argument in degrees,
// then convert to radians if required by calculator or computer.
$this->_toRadians($e0° + 10.3 / ($e0° + 5.11)))
$this->_toRadians($e0° + 10.3 / ($e0° + 5.11))
)
)
);

Expand Down Expand Up @@ -733,7 +736,7 @@ private function _convertHoursToTime($hours, $withMillisec = false)
{
$minutes = 60.0 * ($hours - (int) $hours);
$seconds = 60.0 * ($minutes - (int) $minutes);
if (!$withMillisec) {
if (! $withMillisec) {
$seconds = (int) $seconds;
}

Expand Down Expand Up @@ -765,7 +768,7 @@ public function getSurfaceIncidenceAngle($ω°, $γ°)
// Earth Heliocentric Longitude
private function _calculateEarthHeliocentricLongitude($JME)
{
$EHL = $this->_calculateEarthTerms($JME, self::EarthPeriodicTerms_L);
$EHL = $this->_calculateEarthTerms($JME, self::EARTH_PERIODIC_TERMS_L);
if ($this->DEBUG) {
$this->TEST_UNIT_L = $EHL;
}
Expand All @@ -780,7 +783,7 @@ private function _calculateEarthHeliocentricLongitude($JME)
// Earth Heliocentric Latitude
private function _calculateEarthHeliocentricLatitude($JME)
{
$EHB = $this->_calculateEarthTerms($JME, self::EarthPeriodicTerms_B);
$EHB = $this->_calculateEarthTerms($JME, self::EARTH_PERIODIC_TERMS_B);
if ($this->DEBUG) {
$this->TEST_UNIT_B = $EHB;
}
Expand All @@ -794,7 +797,7 @@ private function _calculateEarthHeliocentricLatitude($JME)

private function _calculateEarthRadiusVector($JME)
{
$R = $this->_calculateEarthTerms($JME, self::EarthPeriodicTerms_R);
$R = $this->_calculateEarthTerms($JME, self::EARTH_PERIODIC_TERMS_R);
if ($this->DEBUG) {
$this->TEST_UNIT_R = $R;
}
Expand Down Expand Up @@ -956,7 +959,7 @@ private function _calculatePolynomial($x, $array)
/* Table A4.2. Earth Periodic Terms */
// Earth longitude calculation

const EarthPeriodicTerms_L = [
const EARTH_PERIODIC_TERMS_L = [
//L0
[
[175347046.0, 0, 0],
Expand Down Expand Up @@ -1107,7 +1110,7 @@ private function _calculatePolynomial($x, $array)
];

// earth heliocentric latitude.
const EarthPeriodicTerms_B = [
const EARTH_PERIODIC_TERMS_B = [
//B0
[
[280.0, 3.199, 84334.662],
Expand All @@ -1124,7 +1127,7 @@ private function _calculatePolynomial($x, $array)
];

// earth radius vector.
const EarthPeriodicTerms_R = [
const EARTH_PERIODIC_TERMS_R = [
//R0
[
[100013989.0, 0, 0],
Expand Down
Loading

0 comments on commit 61e789c

Please sign in to comment.