diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 37a65d219e..c057a0b99f 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -21,7 +21,7 @@ on: jobs: run-on-linux: name: Run on Linux - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 strategy: fail-fast: false matrix: @@ -74,7 +74,7 @@ jobs: - name: Create ADMIN_DIR run: | - sudo apt-fast install -y sharutils + sudo apt install -y sharutils echo "ADMIN_DIR=$(head -c 10 < /dev/random | uuencode -m - | tail -n 2 |head -n 1 | sed 's,[/+],_,g' | head -c10)/" >> $GITHUB_ENV - name: Setup to EC-CUBE @@ -88,7 +88,7 @@ jobs: HTTP_URL: http://127.0.0.1:8085/ HTTPS_URL: http://127.0.0.1:8085/ run: | - sudo apt-fast install -y mysql-client postgresql-client + sudo apt install -y mysql-client postgresql-client ./eccube_install.sh ${DB} - name: Run to PHPUnit diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 77cf5c005d..3be0efd532 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -10,7 +10,7 @@ on: jobs: deploy: name: Deploy - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: PREVIOUS_TAG_NAME run: | diff --git a/.github/workflows/dockerbuild-and-push.yml b/.github/workflows/dockerbuild-and-push.yml index 125683f27b..393578a49f 100644 --- a/.github/workflows/dockerbuild-and-push.yml +++ b/.github/workflows/dockerbuild-and-push.yml @@ -14,14 +14,14 @@ env: jobs: dockerbuild: name: dockerbuild - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 permissions: contents: read packages: write strategy: fail-fast: false matrix: - php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4-rc' ] + php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ] steps: - name: downcase REPO diff --git a/.github/workflows/dockerbuild.yml b/.github/workflows/dockerbuild.yml index d2d4ec2a42..560a9b58c4 100644 --- a/.github/workflows/dockerbuild.yml +++ b/.github/workflows/dockerbuild.yml @@ -12,14 +12,14 @@ env: jobs: dockerbuild: name: dockerbuild - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 permissions: contents: read packages: write strategy: fail-fast: false matrix: - php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4-rc' ] + php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ] steps: - name: Checkout diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 1a114efb30..eea9090ba0 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -19,7 +19,7 @@ on: jobs: run-on-linux: name: Run on Linux - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 strategy: fail-fast: false matrix: @@ -30,7 +30,7 @@ jobs: - 'test/front_login' - 'test/front_guest' - 'test/admin' - php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4-rc' ] + php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ] db: [ mysql, pgsql ] steps: - name: Checkout @@ -43,7 +43,7 @@ jobs: # - name: Create ADMIN_DIR # run: | - # sudo apt-fast install -y sharutils + # sudo apt install -y sharutils # echo "ADMIN_DIR=$(head -c 10 < /dev/random | uuencode -m - | tail -n 2 |head -n 1 | sed 's,[/+],_,g' | head -c10)/" >> $GITHUB_ENV - name: Setup environment @@ -122,12 +122,12 @@ jobs: path: data/logs installer: name: Installer test - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 strategy: fail-fast: false matrix: db: [ 'pgsql', 'mysql' ] - php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4-rc' ] + php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ] include: - db: mysql dbport: '3306' diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e80a786676..8dbf6e157e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,13 +18,21 @@ jobs: with: event_name: ${{ github.event_name }} uses: ./.github/workflows/dockerbuild.yml - phpstan: + php-cs-fixer: with: ref_name: ${{ github.ref_name }} base_ref: ${{ github.base_ref }} event_name: ${{ github.event_name }} owner: ${{ github.repository_owner }} needs: [ dockerbuild ] + uses: ./.github/workflows/php-cs-fixer.yml + phpstan: + with: + ref_name: ${{ github.ref_name }} + base_ref: ${{ github.base_ref }} + event_name: ${{ github.event_name }} + owner: ${{ github.repository_owner }} + needs: [ php-cs-fixer ] uses: ./.github/workflows/phpstan.yml unit-tests: with: @@ -32,7 +40,7 @@ jobs: base_ref: ${{ github.base_ref }} event_name: ${{ github.event_name }} owner: ${{ github.repository_owner }} - needs: [ dockerbuild ] + needs: [ php-cs-fixer ] uses: ./.github/workflows/unit-tests.yml e2e-tests: with: @@ -40,7 +48,7 @@ jobs: base_ref: ${{ github.base_ref }} event_name: ${{ github.event_name }} owner: ${{ github.repository_owner }} - needs: [ dockerbuild ] + needs: [ php-cs-fixer ] uses: ./.github/workflows/e2e-tests.yml success: needs: diff --git a/.github/workflows/penetration-tests.yml b/.github/workflows/penetration-tests.yml index feb886e40d..cfcba8d0fa 100644 --- a/.github/workflows/penetration-tests.yml +++ b/.github/workflows/penetration-tests.yml @@ -6,7 +6,7 @@ on: jobs: PenetrationTest: name: Penetration testing - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 strategy: fail-fast: false matrix: @@ -25,7 +25,7 @@ jobs: # - name: Create ADMIN_DIR # run: | - # sudo apt-fast install -y sharutils + # sudo apt install -y sharutils # echo "ADMIN_DIR=$(head -c 10 < /dev/random | uuencode -m - | tail -n 2 |head -n 1 | sed 's,[/+],_,g' | head -c10)/" >> $GITHUB_ENV - name: Apply patchs diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml new file mode 100644 index 0000000000..8cdacb0c8a --- /dev/null +++ b/.github/workflows/php-cs-fixer.yml @@ -0,0 +1,53 @@ +name: php-cs-fixer dry-run +run-name: php-cs-fixer + +on: + workflow_call: + inputs: + ref_name: + required: false + type: string + base_ref: + required: false + type: string + event_name: + required: true + type: string + owner: + required: true + type: string +jobs: + php-cs-fixer: + name: php-cs-fixer + runs-on: ubuntu-latest + steps: + - name: "Checkout" + uses: actions/checkout@v4 + + - name: Build docker image + uses: ./.github/actions/dockerbuild + with: + php-version: '8.4' + + - name: Setup environment + env: + REF_NAME: ${{ inputs.ref_name }} + BASE_REF: ${{ inputs.base_ref }} + EVENT_NAME: ${{ inputs.event_name }} + OWNER: ${{ inputs.owner }} + run: | + echo "COMPOSE_FILE=docker-compose.yml:docker-compose.pgsql.yml:docker-compose.dev.yml" >> $GITHUB_ENV + echo "IMAGE_NAME=${OWNER,,}/ec-cube2-php" >> $GITHUB_ENV + if [ $EVENT_NAME = "pull_request" ]; then + if [ -n $DOCKER_METADATA_OUTPUT_VERSION ]; then + echo "TAG=${DOCKER_METADATA_OUTPUT_VERSION}" >> $GITHUB_ENV + else + echo "TAG=8.4-apache-${BASE_REF}" >> $GITHUB_ENV + fi + else + echo "TAG=8.4-apache-${REF_NAME}" >> $GITHUB_ENV + fi + - run: | + docker compose up -d --wait + docker compose exec -T ec-cube composer install + - run: docker compose exec -T -e PHP_CS_FIXER_IGNORE_ENV=1 ec-cube php data/vendor/bin/php-cs-fixer fix --diff --dry-run --allow-risky=yes diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 89b0a2a465..09a8bcea83 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -23,8 +23,8 @@ jobs: strategy: fail-fast: false matrix: - operating-system: [ ubuntu-22.04 ] - php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4-rc' ] + operating-system: [ ubuntu-24.04 ] + php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ] db: [ mysql, pgsql ] steps: @@ -38,7 +38,7 @@ jobs: - name: Create ADMIN_DIR run: | - sudo apt-fast install -y sharutils + sudo apt install -y sharutils echo "ADMIN_DIR=$(head -c 10 < /dev/random | uuencode -m - | tail -n 2 |head -n 1 | sed 's,[/+],_,g' | head -c10)/" >> $GITHUB_ENV - name: Setup environment diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index a329eff1c3..5d1ac769a6 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -16,6 +16,9 @@ 'no_superfluous_phpdoc_tags' => false, // 副作用があるため 'increment_style' => false, // 強制しなくて良い 'yoda_style' => false, // 強制しなくて良い + 'blank_line_after_opening_tag' => false, // 強制しなくて良い + 'fully_qualified_strict_types' => false, // 強制しなくて良い + 'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['arrays']], // elements で arrays 以外を指定するとPHP7.4でエラーになる // @Symfony:risky のうち、以下のルールを無効化 'psr_autoloading' => false, // PSR-4 に準拠していないため @@ -23,6 +26,7 @@ 'native_constant_invocation' => false, // namespace を使用していないため不要 'string_length_to_empty' => false, // 副作用があるため 'ternary_to_elvis_operator' => false, // 副作用があるため + 'get_class_to_class_keyword' => false, // 副作用があるため ]; $finder = \PhpCsFixer\Finder::create() @@ -31,6 +35,7 @@ ->in(__DIR__.'/data/module') ->in(__DIR__.'/data/smarty_extends') ->in(__DIR__.'/tests') + ->exclude('SOAP') ->name('*.php') ; $config = new \PhpCsFixer\Config(); diff --git a/composer.json b/composer.json index b8b5a7cf56..44eef74583 100644 --- a/composer.json +++ b/composer.json @@ -40,8 +40,11 @@ "mobiledetect/mobiledetectlib": "^3.74", "nanasess/mdb2": "^2.5", "nanasess/php8-compat": "^1.0", + "nobuhiko/calendar": "^1.0", "pear/archive_tar": "^1.4.3", "pear/mail": "*", + "pear/net_smtp": "^1.12", + "pear/net_socket": "^1.2", "pear/pear-core-minimal": "^1.10", "pear/xml_parser": "*", "pear/xml_serializer": "*", diff --git a/composer.lock b/composer.lock index 269124a6d6..c2283467a3 100644 --- a/composer.lock +++ b/composer.lock @@ -5,7 +5,7 @@ "This file is @generated automatically" ], "content-hash": "913b3fad812f8e13e42e3d0e9cbb40d3", - "packages": [ + "packages": [ { "name": "ezyang/htmlpurifier", "version": "v4.18.0", @@ -221,6 +221,55 @@ }, "time": "2020-12-08T04:46:03+00:00" }, + { + "name": "nobuhiko/calendar", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/nobuhiko/Calendar.git", + "reference": "a43c49fc4dd9c9f13f37e09ef5331d97057df21a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nobuhiko/Calendar/zipball/a43c49fc4dd9c9f13f37e09ef5331d97057df21a", + "reference": "a43c49fc4dd9c9f13f37e09ef5331d97057df21a", + "shasum": "" + }, + "require": { + "nanasess/php8-compat": "^1.0", + "pear/pear_exception": "*" + }, + "require-dev": { + "phpunit/phpunit": "^9.6" + }, + "suggest": { + "pear/date": "Install optionally via your project's composer.json" + }, + "type": "library", + "autoload": { + "psr-0": { + "Calendar": "./" + } + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "./" + ], + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "KIMOTO Nobuhiko", + "email": "nobuhiko.kimoto@gmail.com" + } + ], + "description": "More info available on: http://pear.php.net/package/Calendar", + "support": { + "source": "https://github.com/nobuhiko/Calendar/tree/1.0.0" + }, + "time": "2024-12-20T04:37:00+00:00" + }, { "name": "pear/archive_tar", "version": "1.5.0", @@ -409,6 +458,132 @@ }, "time": "2024-01-15T21:56:23+00:00" }, + { + "name": "pear/net_smtp", + "version": "1.12.1", + "source": { + "type": "git", + "url": "https://github.com/pear/Net_SMTP.git", + "reference": "5d7ba854d75a7c207d8581de1cc6fd2895ae2518" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pear/Net_SMTP/zipball/5d7ba854d75a7c207d8581de1cc6fd2895ae2518", + "reference": "5d7ba854d75a7c207d8581de1cc6fd2895ae2518", + "shasum": "" + }, + "require": { + "pear/net_socket": "@stable", + "pear/pear-core-minimal": "@stable", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "*" + }, + "suggest": { + "pear/auth_sasl": "Install optionally via your project's composer.json" + }, + "type": "library", + "autoload": { + "psr-0": { + "Net": "./" + } + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "./" + ], + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Jon Parise", + "email": "jon@php.net", + "homepage": "https://www.indelible.org", + "role": "Lead" + }, + { + "name": "Chuck Hagenbuch", + "email": "chuck@horde.org", + "role": "Lead" + }, + { + "name": "Armin Graefe", + "email": "schengawegga@gmail.com", + "role": "Lead" + } + ], + "description": "An implementation of the SMTP protocol", + "homepage": "https://pear.github.io/Net_SMTP/", + "keywords": [ + "email", + "mail", + "smtp" + ], + "support": { + "issues": "https://github.com/pear/Net_SMTP/issues", + "source": "https://github.com/pear/Net_SMTP" + }, + "time": "2024-04-15T19:42:15+00:00" + }, + { + "name": "pear/net_socket", + "version": "v1.2.2", + "source": { + "type": "git", + "url": "https://github.com/pear/Net_Socket.git", + "reference": "bbe6a12bb4f7059dba161f6ddd43f369c0ec8d09" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pear/Net_Socket/zipball/bbe6a12bb4f7059dba161f6ddd43f369c0ec8d09", + "reference": "bbe6a12bb4f7059dba161f6ddd43f369c0ec8d09", + "shasum": "" + }, + "require": { + "pear/pear_exception": "*" + }, + "require-dev": { + "phpunit/phpunit": "*" + }, + "type": "library", + "autoload": { + "psr-0": { + "Net": "./" + } + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "./" + ], + "license": [ + "PHP License" + ], + "authors": [ + { + "name": "Chuck Hagenbuch", + "email": "chuck@horde.org", + "role": "Lead" + }, + { + "name": "Aleksander Machniak", + "email": "alec@php.net", + "role": "Lead" + }, + { + "name": "Stig Bakken", + "email": "stig@php.net", + "role": "Lead" + } + ], + "description": "More info available on: http://pear.php.net/package/Net_Socket", + "support": { + "issues": "http://pear.php.net/bugs/search.php?cmd=display&package_name[]=Net_Socket", + "source": "https://github.com/pear/Net_Socket" + }, + "time": "2015-03-22T15:48:19+00:00" + }, { "name": "pear/pear-core-minimal", "version": "v1.10.15", @@ -1335,29 +1510,27 @@ }, { "name": "doctrine/deprecations", - "version": "1.1.3", + "version": "1.1.4", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab" + "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", - "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/31610dbb31faa98e6b5447b62340826f54fbc4e9", + "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9", - "phpstan/phpstan": "1.4.10 || 1.10.15", - "phpstan/phpstan-phpunit": "^1.0", + "doctrine/coding-standard": "^9 || ^12", + "phpstan/phpstan": "1.4.10 || 2.0.3", + "phpstan/phpstan-phpunit": "^1.0 || ^2", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "psalm/plugin-phpunit": "0.18.4", - "psr/log": "^1 || ^2 || ^3", - "vimeo/psalm": "4.30.0 || 5.12.0" + "psr/log": "^1 || ^2 || ^3" }, "suggest": { "psr/log": "Allows logging deprecations via PSR-3 logger implementation" @@ -1365,7 +1538,7 @@ "type": "library", "autoload": { "psr-4": { - "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + "Doctrine\\Deprecations\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -1376,9 +1549,9 @@ "homepage": "https://www.doctrine-project.org/", "support": { "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/1.1.3" + "source": "https://github.com/doctrine/deprecations/tree/1.1.4" }, - "time": "2024-01-30T19:34:25+00:00" + "time": "2024-12-07T21:18:45+00:00" }, { "name": "doctrine/instantiator", @@ -5778,5 +5951,5 @@ "platform-overrides": { "php": "7.4.0" }, - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.0.0" } diff --git a/data/Smarty/templates/admin/admin_popup_header.tpl b/data/Smarty/templates/admin/admin_popup_header.tpl index b114476a55..5957f0b97f 100644 --- a/data/Smarty/templates/admin/admin_popup_header.tpl +++ b/data/Smarty/templates/admin/admin_popup_header.tpl @@ -29,8 +29,7 @@ - - + diff --git a/data/Smarty/templates/admin/contents/file_manager.tpl b/data/Smarty/templates/admin/contents/file_manager.tpl index 59eb78c539..ccbc3b6240 100644 --- a/data/Smarty/templates/admin/contents/file_manager.tpl +++ b/data/Smarty/templates/admin/contents/file_manager.tpl @@ -22,6 +22,22 @@ */ *}--> + diff --git a/data/Smarty/templates/admin/main_frame.tpl b/data/Smarty/templates/admin/main_frame.tpl index e6d83c21de..0daa8774d7 100644 --- a/data/Smarty/templates/admin/main_frame.tpl +++ b/data/Smarty/templates/admin/main_frame.tpl @@ -29,9 +29,7 @@ - - - + diff --git a/data/class/SC_CartSession.php b/data/class/SC_CartSession.php index 645d997646..28837adb48 100644 --- a/data/class/SC_CartSession.php +++ b/data/class/SC_CartSession.php @@ -598,6 +598,7 @@ public function getQuantity($cart_no, $product_type_id) * @param int $quantity 設定する数量 * @param int $cart_no カート番号 * @param int $product_type_id 商品種別ID + * * @retrun void */ public function setQuantity($quantity, $cart_no, $product_type_id) diff --git a/data/class/SC_CheckError.php b/data/class/SC_CheckError.php index 184a7256ea..78e9036afb 100644 --- a/data/class/SC_CheckError.php +++ b/data/class/SC_CheckError.php @@ -1109,7 +1109,7 @@ public function IP_CHECK($value) // 改行コードが含まれている場合には配列に変換 $params = str_replace("\r", '', $this->arrParam[$keyname]); if (!empty($params)) { - if (strpos($params, "\n") === false) { + if (!str_contains($params, "\n")) { $params .= "\n"; } $params = explode("\n", $params); @@ -1224,7 +1224,7 @@ public function FILE_SIZE_CHECK($value) if ($_FILES[$keyname]['size'] > $max_file_size * 1024) { $byte = 'KB'; if ($max_file_size >= 1000) { - $max_file_size = $max_file_size / 1000; + $max_file_size /= 1000; $byte = 'MB'; } $this->arrErr[$keyname] = sprintf( diff --git a/data/class/SC_ClassAutoloader.php b/data/class/SC_ClassAutoloader.php index 73addec178..ec0c2007ea 100644 --- a/data/class/SC_ClassAutoloader.php +++ b/data/class/SC_ClassAutoloader.php @@ -47,7 +47,7 @@ public static function autoload($class, $plugin_upload_realdir = PLUGIN_UPLOAD_R } elseif (($arrClassNamePart[0] === 'SC' || $arrClassNamePart[0] === 'LC') && $is_ex === true && $count >= 4) { $arrClassNamePartTemp = $arrClassNamePart; // FIXME クラスファイルのディレクトリ命名が変。変な現状に合わせて強引な処理をしてる。 - $arrClassNamePartTemp[1] = $arrClassNamePartTemp[1].'_extends'; + $arrClassNamePartTemp[1] .= '_extends'; if ($count <= 5 && $arrClassNamePart[2] === 'Admin' && !in_array($arrClassNamePart[3], ['Home', 'Index', 'Logout'])) { $classpath .= strtolower(implode('/', array_slice($arrClassNamePartTemp, 1, -1))).'/'; } else { @@ -136,7 +136,7 @@ public static function autoload($class, $plugin_upload_realdir = PLUGIN_UPLOAD_R if ($is_ex) { // *_Ex ファイルが存在しない場合は、元クラスのエイリアスとする - if (!file_exists($classpath) && strpos($class, '_Ex') !== false) { + if (!file_exists($classpath) && str_contains($class, '_Ex')) { class_alias(preg_replace('/_Ex$/', '', $class), $class); } } diff --git a/data/class/SC_Customer.php b/data/class/SC_Customer.php index 1855dd6e46..02035b7930 100644 --- a/data/class/SC_Customer.php +++ b/data/class/SC_Customer.php @@ -386,8 +386,8 @@ public function doLogin($login_email, $login_pass) { switch (SC_Display_Ex::detectDevice()) { case DEVICE_TYPE_MOBILE: - if (!$this->getCustomerDataFromMobilePhoneIdPass($login_pass) && - !$this->getCustomerDataFromEmailPass($login_pass, $login_email, true) + if (!$this->getCustomerDataFromMobilePhoneIdPass($login_pass) + && !$this->getCustomerDataFromEmailPass($login_pass, $login_email, true) ) { return false; } else { diff --git a/data/class/SC_CustomerList.php b/data/class/SC_CustomerList.php index 21d536c9da..eca6bd8bdf 100644 --- a/data/class/SC_CustomerList.php +++ b/data/class/SC_CustomerList.php @@ -319,8 +319,8 @@ public function __construct($array, $mode = '') if (!isset($this->arrSql['search_end_day'])) { $this->arrSql['search_end_day'] = ''; } - if ((strlen($this->arrSql['search_start_year']) > 0 && strlen($this->arrSql['search_start_month']) > 0 && strlen($this->arrSql['search_start_day']) > 0) || - (strlen($this->arrSql['search_end_year']) > 0 && strlen($this->arrSql['search_end_month']) > 0 && strlen($this->arrSql['search_end_day']) > 0)) { + if ((strlen($this->arrSql['search_start_year']) > 0 && strlen($this->arrSql['search_start_month']) > 0 && strlen($this->arrSql['search_start_day']) > 0) + || (strlen($this->arrSql['search_end_year']) > 0 && strlen($this->arrSql['search_end_month']) > 0 && strlen($this->arrSql['search_end_day']) > 0)) { $arrRegistTime = $this->selectTermRange($this->arrSql['search_start_year'], $this->arrSql['search_start_month'], $this->arrSql['search_start_day'], $this->arrSql['search_end_year'], $this->arrSql['search_end_month'], $this->arrSql['search_end_day'], $regdate_col); foreach ($arrRegistTime as $data) { @@ -348,8 +348,8 @@ public function __construct($array, $mode = '') $this->arrSql['search_buy_end_day'] = ''; } - if ((strlen($this->arrSql['search_buy_start_year']) > 0 && strlen($this->arrSql['search_buy_start_month']) > 0 && strlen($this->arrSql['search_buy_start_day']) > 0) || - (strlen($this->arrSql['search_buy_end_year']) > 0 && strlen($this->arrSql['search_buy_end_month']) > 0 && strlen($this->arrSql['search_buy_end_day']) > 0)) { + if ((strlen($this->arrSql['search_buy_start_year']) > 0 && strlen($this->arrSql['search_buy_start_month']) > 0 && strlen($this->arrSql['search_buy_start_day']) > 0) + || (strlen($this->arrSql['search_buy_end_year']) > 0 && strlen($this->arrSql['search_buy_end_month']) > 0 && strlen($this->arrSql['search_buy_end_day']) > 0)) { $arrRegistTime = $this->selectTermRange($this->arrSql['search_buy_start_year'], $this->arrSql['search_buy_start_month'], $this->arrSql['search_buy_start_day'], $this->arrSql['search_buy_end_year'], $this->arrSql['search_buy_end_month'], $this->arrSql['search_buy_end_day'], 'last_buy_date'); foreach ($arrRegistTime as $data) { diff --git a/data/class/SC_Date.php b/data/class/SC_Date.php index 77a66f076e..68acaaf892 100644 --- a/data/class/SC_Date.php +++ b/data/class/SC_Date.php @@ -29,8 +29,8 @@ class SC_Date public $day; public $end_year; - public static $arrHoliday = null; - public static $arrRegularHoliday = null; + public static $arrHoliday; + public static $arrRegularHoliday; // コンストラクタ public function __construct($start_year = '', $end_year = '') diff --git a/data/class/SC_Fpdf.php b/data/class/SC_Fpdf.php index f3094b468b..ca2b5bb3a7 100644 --- a/data/class/SC_Fpdf.php +++ b/data/class/SC_Fpdf.php @@ -192,11 +192,11 @@ private function setOrderData() $this->lfText(27, $y, $line, 8); $cut = strlen($line); $text = substr($text, $cut, strlen($text) - $cut); - $y = $y + 3; + $y += 3; } if ($text != '') { $this->lfText(27, $y, $text, 8); - $y = $y + 3; + $y += 3; } $text = $this->arrDisp['order_addr02']; // 購入者住所2 @@ -206,11 +206,11 @@ private function setOrderData() $this->lfText(27, $y, $line, 8); $cut = strlen($line); $text = substr($text, $cut, strlen($text) - $cut); - $y = $y + 3; + $y += 3; } if ($text != '') { $this->lfText(27, $y, $text, 8); - $y = $y + 3; + $y += 3; } $text = $this->arrDisp['order_name01'].' '.$this->arrDisp['order_name02'].' 様'; diff --git a/data/class/SC_Initial.php b/data/class/SC_Initial.php index 95ca067ace..cd44a93fd4 100644 --- a/data/class/SC_Initial.php +++ b/data/class/SC_Initial.php @@ -194,8 +194,8 @@ public function defineDirectoryIndex() $useFilenameDirIndex = USE_FILENAME_DIR_INDEX; } else { if (isset($_SERVER['SERVER_SOFTWARE'])) { - if (strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== false - || strpos($_SERVER['SERVER_SOFTWARE'], 'Symfony') !== false) { + if (str_contains($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') + || str_contains($_SERVER['SERVER_SOFTWARE'], 'Symfony')) { $useFilenameDirIndex = true; } } diff --git a/data/class/SC_Product.php b/data/class/SC_Product.php index 1b48868562..d8a9a7e387 100644 --- a/data/class/SC_Product.php +++ b/data/class/SC_Product.php @@ -616,6 +616,7 @@ public static function setPriceTaxTo(&$arrProducts) $arrProduct['price02_min_tax_format'] = &$arrProduct['price02_min_inctax_format']; $arrProduct['price02_max_tax_format'] = &$arrProduct['price02_max_inctax_format']; } + // @deprecated 2.12.4 // 旧バージョン互換用 // 現在は参照渡しで戻せる diff --git a/data/class/SC_Response.php b/data/class/SC_Response.php index 331edd818b..47a49e88d3 100644 --- a/data/class/SC_Response.php +++ b/data/class/SC_Response.php @@ -133,6 +133,7 @@ public static function actionExit() * @param bool|null $useSsl true:HTTPSを強制, false:HTTPを強制, null:継承 * * @return void + * * @static */ public static function sendRedirect($location, $arrQueryString = [], $inheritQueryString = false, $useSsl = null) @@ -259,6 +260,7 @@ public static function sendRedirect($location, $arrQueryString = [], $inheritQue * @param string $location /html/ からのパス。先頭に / を含むかは任意。「../」の解釈は行なわない。 * * @return void + * * @static */ public static function sendRedirectFromUrlPath($location, $arrQueryString = [], $inheritQueryString = false, $useSsl = null) @@ -311,12 +313,13 @@ public function setStatusCode($statusCode = null) * @see http://ja.wikipedia.org/wiki/HTTP%E3%82%B9%E3%83%86%E3%83%BC%E3%82%BF%E3%82%B9%E3%82%B3%E3%83%BC%E3%83%89 (邦訳) * * @license http://www.gnu.org/licenses/fdl.html GFDL (邦訳) + * * @static */ public static function sendHttpStatus($statusCode) { $protocol = $_SERVER['SERVER_PROTOCOL']; - $httpVersion = (strpos($protocol, '1.1') !== false) ? '1.1' : '1.0'; + $httpVersion = (str_contains($protocol, '1.1')) ? '1.1' : '1.0'; $messages = [ // Informational 1xx // 【情報】 100 => 'Continue', // 継続 diff --git a/data/class/SC_SelectSql.php b/data/class/SC_SelectSql.php index 3e3f6986da..09a105892d 100644 --- a/data/class/SC_SelectSql.php +++ b/data/class/SC_SelectSql.php @@ -133,7 +133,7 @@ public function selectTermRange($from_year, $from_month, $from_day, $to_year, $t // @see http://svn.ec-cube.net/open_trac/ticket/328 // FIXME とりあえずintvalで対策... $date2 = mktime(0, 0, 0, (int) $to_month, (int) $to_day, (int) $to_year); - $date2 = $date2 + 86400; + $date2 += 86400; // SQL文のdate関数に与えるフォーマットは、yyyy/mm/ddで指定する。 $date2 = date('Y/m/d', $date2); diff --git a/data/class/SC_SendMail.php b/data/class/SC_SendMail.php index 64905df724..8bacdc1746 100644 --- a/data/class/SC_SendMail.php +++ b/data/class/SC_SendMail.php @@ -167,8 +167,8 @@ public function setHost($host) trigger_error('前方互換用メソッドが使用されました。', E_USER_WARNING); $this->host = $host; $arrHost = [ - 'host' => $this->host, - 'port' => $this->port, + 'host' => $this->host, + 'port' => $this->port, ]; // PEAR::Mailを使ってメール送信オブジェクト作成 $this->objMail = &Mail::factory('smtp', $arrHost); @@ -184,8 +184,8 @@ public function setPort($port) trigger_error('前方互換用メソッドが使用されました。', E_USER_WARNING); $this->port = $port; $arrHost = [ - 'host' => $this->host, - 'port' => $this->port, + 'host' => $this->host, + 'port' => $this->port, ]; // PEAR::Mailを使ってメール送信オブジェクト作成 $this->objMail = &Mail::factory('smtp', $arrHost); diff --git a/data/class/SC_SmartphoneUserAgent.php b/data/class/SC_SmartphoneUserAgent.php index 388a8da411..b413538aad 100644 --- a/data/class/SC_SmartphoneUserAgent.php +++ b/data/class/SC_SmartphoneUserAgent.php @@ -39,6 +39,7 @@ class SC_SmartphoneUserAgent public static function isSmartphone() { $detect = new MobileDetect(); + // SPでかつPC表示OFFの場合 // TabletはPC扱い return ($detect->isMobile() && !$detect->isTablet()) && !SC_SmartphoneUserAgent_Ex::getSmartphonePcFlag(); diff --git a/data/class/api/SC_Api_Operation.php b/data/class/api/SC_Api_Operation.php index ceef24d0e8..5515ddecb8 100644 --- a/data/class/api/SC_Api_Operation.php +++ b/data/class/api/SC_Api_Operation.php @@ -367,11 +367,12 @@ public static function doApiAction($arrPost) if (count($arrErr) == 0) { // 実行成功 - $arrResponseValidSection = ['Request' => [ - 'IsValid' => 'True', - $operation_name.'Request' => $arrOperationRequestValid, - ], - ]; + $arrResponseValidSection = [ + 'Request' => [ + 'IsValid' => 'True', + $operation_name.'Request' => $arrOperationRequestValid, + ], + ]; $response_outer = $operation_name.'Response'; SC_Api_Utils_Ex::printApiLog('Operation SUCCESS', $start_time, $response_outer); } else { @@ -380,11 +381,12 @@ public static function doApiAction($arrPost) foreach ($arrErr as $error_code => $error_msg) { $arrResponseErrorSection[] = ['Code' => $error_code, 'Message' => $error_msg]; } - $arrResponseValidSection = ['Request' => [ - 'IsValid' => 'False', - 'Errors' => ['Error' => $arrResponseErrorSection], - ], - ]; + $arrResponseValidSection = [ + 'Request' => [ + 'IsValid' => 'False', + 'Errors' => ['Error' => $arrResponseErrorSection], + ], + ]; if (is_object($objApiOperation)) { $response_outer = $operation_name.'Response'; } else { diff --git a/data/class/api/SC_Api_Utils.php b/data/class/api/SC_Api_Utils.php index 6d9a977353..826ddea0ef 100644 --- a/data/class/api/SC_Api_Utils.php +++ b/data/class/api/SC_Api_Utils.php @@ -113,7 +113,8 @@ public static function getApiConfig($operation_name) * * @param string $msg 出力文字列 * @param text $operation_name - @ @rturn void + * + * @return void */ public static function printApiLog($msg, $start_time = '', $operation_name = '') { diff --git a/data/class/api/operations/AddrFromZip.php b/data/class/api/operations/AddrFromZip.php index 632ca07b0f..119b0b9e25 100644 --- a/data/class/api/operations/AddrFromZip.php +++ b/data/class/api/operations/AddrFromZip.php @@ -45,10 +45,10 @@ public function doAction($arrParam) $arrAddrList = SC_Utils_Ex::sfGetAddress($zipcode); if (!SC_Utils_Ex::isBlank($arrAddrList)) { $this->setResponse('Address', [ - 'State' => $arrAddrList[0]['state'], - 'City' => $arrAddrList[0]['city'], - 'Town' => $arrAddrList[0]['town'], - ] + 'State' => $arrAddrList[0]['state'], + 'City' => $arrAddrList[0]['city'], + 'Town' => $arrAddrList[0]['town'], + ] ); return true; diff --git a/data/class/api/operations/BrowseNodeLookup.php b/data/class/api/operations/BrowseNodeLookup.php index 8be9786d19..a61d5c5d8e 100644 --- a/data/class/api/operations/BrowseNodeLookup.php +++ b/data/class/api/operations/BrowseNodeLookup.php @@ -91,7 +91,7 @@ public function doAction($arrParam) 'Name' => $category['category_name'], 'PageURL' => HTTP_URL.'products/list.php?category_id='.$category['category_id'], 'has_children' => $category['has_children'], - ]; + ]; } } $this->setResponse('BrowseNode', $arrData); diff --git a/data/class/api/operations/ItemSearch.php b/data/class/api/operations/ItemSearch.php index ca66ca55b5..18ff166998 100644 --- a/data/class/api/operations/ItemSearch.php +++ b/data/class/api/operations/ItemSearch.php @@ -76,7 +76,7 @@ public function doAction($arrParam) 'product_id' => $val['product_id'], 'DetailPageURL' => HTTP_URL.'products/detail.php?product_id='.$val['product_id'], 'ItemAttributes' => $val, - ]; + ]; } $this->setResponse('Item', $arrData); diff --git a/data/class/db/SC_DB_DBFactory.php b/data/class/db/SC_DB_DBFactory.php index d272e21e54..a9f09977cb 100644 --- a/data/class/db/SC_DB_DBFactory.php +++ b/data/class/db/SC_DB_DBFactory.php @@ -68,13 +68,13 @@ public function getDSN($dsn = '') if (empty($dsn)) { if (defined('DEFAULT_DSN')) { $dsn = ['phptype' => DB_TYPE, - 'username' => DB_USER, - 'password' => DB_PASSWORD, - 'protocol' => 'tcp', - 'hostspec' => DB_SERVER, - 'port' => DB_PORT, - 'database' => DB_NAME, - ]; + 'username' => DB_USER, + 'password' => DB_PASSWORD, + 'protocol' => 'tcp', + 'hostspec' => DB_SERVER, + 'port' => DB_PORT, + 'database' => DB_NAME, + ]; } else { return ''; } diff --git a/data/class/db/dbfactory/SC_DB_DBFactory_MYSQL.php b/data/class/db/dbfactory/SC_DB_DBFactory_MYSQL.php index 14e65da6e2..054c10d5e4 100644 --- a/data/class/db/dbfactory/SC_DB_DBFactory_MYSQL.php +++ b/data/class/db/dbfactory/SC_DB_DBFactory_MYSQL.php @@ -313,7 +313,7 @@ public function sfChangeTrunc($sql) */ public function sfChangeArrayToString($sql) { - if (strpos(strtoupper($sql), 'ARRAY_TO_STRING') !== false) { + if (str_contains(strtoupper($sql), 'ARRAY_TO_STRING')) { preg_match_all('/ARRAY_TO_STRING.*?\(.*?ARRAY\(.*?SELECT (.+?) FROM (.+?) WHERE (.+?)\).*?\,.*?\'(.+?)\'.*?\)/is', $sql, $match, PREG_SET_ORDER); foreach ($match as $item) { diff --git a/data/class/graph/SC_Graph_Pie.php b/data/class/graph/SC_Graph_Pie.php index 2cee0691c3..5c7f9f70b4 100644 --- a/data/class/graph/SC_Graph_Pie.php +++ b/data/class/graph/SC_Graph_Pie.php @@ -189,7 +189,7 @@ public function drawGraph() list($ax, $ay) = $this->lfGetArcPos($x, $y, $w, $h, $end); // ラインのずれを補正する if ($end > 180) { - $ax = $ax + 1; + ++$ax; } imageline($this->image, $ax, $ay, $ax, $ay + $z, $this->flame_color); } diff --git a/data/class/helper/SC_Helper_Bloc.php b/data/class/helper/SC_Helper_Bloc.php index 7d4e32a5af..95be9ce759 100644 --- a/data/class/helper/SC_Helper_Bloc.php +++ b/data/class/helper/SC_Helper_Bloc.php @@ -30,7 +30,7 @@ */ class SC_Helper_Bloc { - private $device_type_id = null; + private $device_type_id; public function __construct($devide_type_id = DEVICE_TYPE_PC) { diff --git a/data/class/helper/SC_Helper_CSV.php b/data/class/helper/SC_Helper_CSV.php index a1a8f1cc25..3948ab2ebd 100644 --- a/data/class/helper/SC_Helper_CSV.php +++ b/data/class/helper/SC_Helper_CSV.php @@ -1,411 +1,411 @@ init(); - } - - /** - * 項目情報を初期化する. - * - * @return void - */ - public function init() - { - $this->arrSubnavi = [ - 1 => 'product', - 2 => 'customer', - 3 => 'order', - 4 => 'review', - 5 => 'category', - ]; - - $this->arrSubnaviName = [ - 1 => '商品管理', - 2 => '会員管理', - 3 => '受注管理', - 4 => 'レビュー', - 5 => 'カテゴリ', - ]; - } - - /** - * CSVファイルを送信する - * - * @param int $csv_id CSVフォーマットID - * @param string $where WHERE条件文 - * @param array $arrVal プリペアドステートメントの実行時に使用される配列。配列の要素数は、クエリ内のプレースホルダの数と同じでなければなりません。 - * @param string $order ORDER文 - * @param bool $is_download true:ダウンロード用出力までさせる false:CSVの内容を返す(旧方式、メモリを食います。) - * - * @return bool|string $is_download = true時 成功失敗フラグ(boolean) 、$is_downalod = false時 string - */ - public function sfDownloadCsv($csv_id, $where = '', $arrVal = [], $order = '', $is_download = false) - { - $objQuery = SC_Query_Ex::getSingletonInstance(); - - // CSV出力タイトル行の作成 - $arrOutput = SC_Utils_Ex::sfSwapArray($this->sfGetCsvOutput($csv_id, 'status = '.CSV_COLUMN_STATUS_FLG_ENABLE)); - if (count($arrOutput) <= 0) { - return false; - } // 失敗終了 - $arrOutputCols = $arrOutput['col']; - - $cols = SC_Utils_Ex::sfGetCommaList($arrOutputCols, true); - - // 商品の場合 - $from = ''; - if ($csv_id == 1) { - // この WHERE 句を足さないと無効な規格も出力される。現行仕様と合わせる為追加。 - $inner_where = 'dtb_products_class.del_flg = 0'; - $from = SC_Product_Ex::prdclsSQL($inner_where); - // 会員の場合 - } elseif ($csv_id == 2) { - $from = 'dtb_customer'; - // 注文の場合 - } elseif ($csv_id == 3) { - $from = 'dtb_order'; - // レビューの場合 - } elseif ($csv_id == 4) { - $from = 'dtb_review AS A INNER JOIN dtb_products AS B on A.product_id = B.product_id'; - // カテゴリの場合 - } elseif ($csv_id == 5) { - $from = 'dtb_category'; - } - - $objQuery->setOrder($order); - $sql = $objQuery->getSql($cols, $from, $where); - - return $this->sfDownloadCsvFromSql($sql, $arrVal, $this->arrSubnavi[$csv_id], $arrOutput['disp_name'], $is_download); - } - - /** - * CSV 項目を出力する. - * - * @param int $csv_id CSV ID - * @param string $where SQL の WHERE 句 - * @param array $arrVal WHERE 句の要素 - * @param array $order SQL の ORDER BY 句 - * - * @return array CSV 項目の配列 - */ - public function sfGetCsvOutput($csv_id = '', $where = '', $arrVal = [], $order = 'rank, no') - { - $objQuery = SC_Query_Ex::getSingletonInstance(); - - $cols = 'no, csv_id, col, disp_name, rank, status, rw_flg, mb_convert_kana_option, size_const_type, error_check_types'; - $table = 'dtb_csv'; - - if (SC_Utils_Ex::sfIsInt($csv_id)) { - if ($where == '') { - $where = 'csv_id = ?'; - } else { - $where = "$where AND csv_id = ?"; - } - $arrVal[] = $csv_id; - } - $objQuery->setOrder($order); - - $arrRet = $objQuery->select($cols, $table, $where, $arrVal); - - return $arrRet; - } - - /** - * CSVが出力設定でインポート可能かのチェック - * - * @param array sfGetCsvOutputで取得した内容(またはそれと同等の配列) - * - * @return bool true:インポート可能、false:インポート不可 - */ - public function sfIsImportCSVFrame(&$arrCSVFrame) - { - $result = true; - foreach ($arrCSVFrame as $val) { - if ($val['status'] != CSV_COLUMN_STATUS_FLG_ENABLE - && $val['rw_flg'] == CSV_COLUMN_RW_FLG_READ_WRITE - && $val['error_check_types'] != '' - && strpos(strtoupper($val['error_check_types']), 'EXIST_CHECK') !== false - ) { - // 必須フィールド - $result = false; - } - } - - return $result; - } - - /** - * CSVが出力設定で更新可能かのチェック - * - * @param array sfGetCsvOutputで取得した内容(またはそれと同等の配列) - * - * @return bool true:更新可能、false:新規追加のみ不可 - */ - public function sfIsUpdateCSVFrame(&$arrCSVFrame) - { - $result = true; - foreach ($arrCSVFrame as $val) { - if ($val['status'] != CSV_COLUMN_STATUS_FLG_ENABLE - && $val['rw_flg'] == CSV_COLUMN_RW_FLG_KEY_FIELD - ) { - // キーフィールド - $result = false; - } - } - - return $result; - } - - /** - * CSVファイルのカウント数を得る. - * - * @param resource $fp fopenを使用して作成したファイルポインタ - * - * @return int CSV のカウント数 - */ - public function sfGetCSVRecordCount($fp) - { - $count = 0; - while (!feof($fp)) { - $arrCSV = fgetcsv($fp, CSV_LINE_MAX); - $count++; - } - // ファイルポインタを戻す - if (rewind($fp)) { - return $count - 1; - } else { - return false; - } - } - - /** - * CSV作成 テンポラリファイル出力 コールバック関数 - * - * @param mixed $data 出力データ - * - * @return bool true (true:固定 false:中断) - */ - public function cbOutputCSV($data) - { - // mb_convert_variablesで変換できない文字は"?"にする - mb_substitute_character(SUBSTITUTE_CHAR); - // 1行目のみヘッダーを出力する - if ($this->output_header) { - $header = array_keys($data); - mb_convert_variables('cp932', CHAR_CODE, $header); - fputcsv($this->fpOutput, $header); - $this->output_header = false; - } - mb_convert_variables('cp932', CHAR_CODE, $data); - fputcsv($this->fpOutput, $data); - SC_Utils_Ex::extendTimeOut(); - - return true; - } - - /** - * SQL文からクエリ実行し CSVファイルを送信する - * - * @param int $sql SQL文 - * @param array $arrVal プリペアドステートメントの実行時に使用される配列。配列の要素数は、クエリ内のプレースホルダの数と同じでなければなりません。 - * @param string ファイル名の頭に付ける文字列 - * @param array|null ヘッダ出力列配列。null の場合、SQL 文の列名を出力する。 - * @param bool true:ダウンロード用出力までさせる false:CSVの内容を返す(旧方式、メモリを食います。) - * - * @return bool|string $is_download = true時 成功失敗フラグ(boolean) 、$is_downalod = false時 string - */ - public function sfDownloadCsvFromSql($sql, $arrVal = [], $file_head = 'csv', $arrHeader = null, $is_download = false) - { - $objQuery = SC_Query_Ex::getSingletonInstance(); - - if (!$is_download) { - ob_start(); - } - - $this->fpOutput = &SC_Helper_CSV_Ex::fopen_for_output_csv(); - - // mb_convert_variablesで変換できない文字は"?"にする - mb_substitute_character(SUBSTITUTE_CHAR); - // ヘッダー構築 - $this->output_header = false; - if (is_array($arrHeader)) { - mb_convert_variables('cp932', CHAR_CODE, $arrHeader); - fputcsv($this->fpOutput, $arrHeader); - } elseif (is_null($arrHeader)) { - // ループバック内でヘッダーを出力する - $this->output_header = true; - } - - $objQuery->doCallbackAll([&$this, 'cbOutputCSV'], $sql, $arrVal); - - // コールバック内でヘッダー出力する場合、0行時にヘッダーを生成できない。 - // コールバックが呼ばれていない場合、念のため CRLF を出力しておく。 - // XXX WEB画面前提で、アラート表示する流れのほうが親切かもしれない。 - if ($this->output_header) { - fwrite($this->fpOutput, "\r\n"); - } - - fclose($this->fpOutput); - - // CSV 用の HTTP ヘッダーを送出する。 - if ($is_download) { - $file_name = $file_head.'_'.date('ymd_His').'.csv'; - SC_Response_Ex::headerForDownload($file_name); - $return = true; - } - // 戻り値にCSVデータをセットする - else { - $return = ob_get_clean(); - } - - return $return; - } - - /** - * 前方互換用 - * - * @deprecated 2.13.2 fputcsv を使うこと。(sfDownloadCsvFromSql や cbOutputCSV の実装を参照) - */ - public function sfArrayToCsv($fields, $delimiter = ',', $enclosure = '"', $arrayDelimiter = '|') - { - trigger_error('前方互換用メソッドが使用されました。', E_USER_WARNING); - if (strlen($delimiter) != 1) { - trigger_error('delimiter must be a single character', E_USER_WARNING); - - return ''; - } - - if (strlen($enclosure) < 1) { - trigger_error('enclosure must be a single character', E_USER_WARNING); - - return ''; - } - - foreach ($fields as $key => $value) { - $field = &$fields[$key]; - - // 配列を「|」区切りの文字列に変換する - if (is_array($field)) { - $field = implode($arrayDelimiter, $field); - } - - /* enclose a field that contains a delimiter, an enclosure character, or a newline */ - if (is_string($field) - && preg_match('/['.preg_quote($delimiter).preg_quote($enclosure).'\\s]/', $field) - ) { - $field = $enclosure.preg_replace('/'.preg_quote($enclosure).'/', $enclosure.$enclosure, $field).$enclosure; - } - } - - return implode($delimiter, $fields); - } - - /** - * 前方互換用 - * - * @deprecated 2.13.2 - */ - public function lfDownloadCsv($arrData, $prefix = '') - { - trigger_error('前方互換用メソッドが使用されました。', E_USER_WARNING); - if ($prefix == '') { - $dir_name = SC_Utils_Ex::sfUpDirName(); - $file_name = $dir_name.date('ymdHis').'.csv'; - } else { - $file_name = $prefix.date('ymdHis').'.csv'; - } - SC_Response_Ex::headerForDownload($file_name); - - /* データを出力 */ - $fp = &SC_Helper_CSV_Ex::fopen_for_output_csv(); - foreach ($arrData as $lineArray) { - fputcsv($fp, $lineArray); - } - fclose($fp); - } - - /** - * 前方互換用 - * - * @deprecated 2.13.2 - */ - public function lfDownloadCSVFile($filepath, $prefix = '') - { - trigger_error('前方互換用メソッドが使用されました。', E_USER_WARNING); - $file_name = $prefix.date('YmdHis').'.csv'; - SC_Response_Ex::headerForDownload($file_name); - - /* データを出力 */ - // file_get_contentsはメモリマッピングも自動的に使ってくれるので高速&省メモリ - echo file_get_contents($filepath); - } - - /** - * CSV 出力用のファイルポインタリソースを開く - * - * @return resource ファイルポインタリソース - */ - public static function &fopen_for_output_csv($filename = 'php://output') - { - $fp = fopen($filename, 'w'); - - stream_filter_append($fp, 'convert.eccube_lf2crlf'); - - return $fp; - } - } - - /** - * 改行コードを CRLF に変換するフィルター - * - * @author Seasoft 塚田将久 (新規作成) - * - * @version $Id$ - */ - class php_user_filter_lf2crlf extends php_user_filter - { - #[\ReturnTypeWillChange] - public function filter($in, $out, &$consumed, $closing) - { - while ($bucket = stream_bucket_make_writeable($in)) { - $bucket->data = preg_replace("/[\r\n]+$/", "\r\n", $bucket->data); - $consumed += $bucket->datalen; - stream_bucket_append($out, $bucket); - } - - return PSFS_PASS_ON; - } - } - - stream_filter_register('convert.eccube_lf2crlf', 'php_user_filter_lf2crlf'); +/* + * Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved. + * + * http://www.ec-cube.co.jp/ + */ + +/** + * CSV 関連 のヘルパークラス. + * + * @author EC-CUBE CO.,LTD. + * + * @version $Id$ + */ +class SC_Helper_CSV +{ + /** 項目英名 */ + public $arrSubnavi; + + /** 項目名 */ + public $arrSubnaviName; + + /** @var resource */ + public $fpOutput; + + /** ヘッダーを出力するか (cbOutputCSV 用) */ + private $output_header = false; + + /** + * デフォルトコンストラクタ. + */ + public function __construct() + { + $this->init(); + } + + /** + * 項目情報を初期化する. + * + * @return void + */ + public function init() + { + $this->arrSubnavi = [ + 1 => 'product', + 2 => 'customer', + 3 => 'order', + 4 => 'review', + 5 => 'category', + ]; + + $this->arrSubnaviName = [ + 1 => '商品管理', + 2 => '会員管理', + 3 => '受注管理', + 4 => 'レビュー', + 5 => 'カテゴリ', + ]; + } + + /** + * CSVファイルを送信する + * + * @param int $csv_id CSVフォーマットID + * @param string $where WHERE条件文 + * @param array $arrVal プリペアドステートメントの実行時に使用される配列。配列の要素数は、クエリ内のプレースホルダの数と同じでなければなりません。 + * @param string $order ORDER文 + * @param bool $is_download true:ダウンロード用出力までさせる false:CSVの内容を返す(旧方式、メモリを食います。) + * + * @return bool|string $is_download = true時 成功失敗フラグ(boolean) 、$is_downalod = false時 string + */ + public function sfDownloadCsv($csv_id, $where = '', $arrVal = [], $order = '', $is_download = false) + { + $objQuery = SC_Query_Ex::getSingletonInstance(); + + // CSV出力タイトル行の作成 + $arrOutput = SC_Utils_Ex::sfSwapArray($this->sfGetCsvOutput($csv_id, 'status = '.CSV_COLUMN_STATUS_FLG_ENABLE)); + if (count($arrOutput) <= 0) { + return false; + } // 失敗終了 + $arrOutputCols = $arrOutput['col']; + + $cols = SC_Utils_Ex::sfGetCommaList($arrOutputCols, true); + + // 商品の場合 + $from = ''; + if ($csv_id == 1) { + // この WHERE 句を足さないと無効な規格も出力される。現行仕様と合わせる為追加。 + $inner_where = 'dtb_products_class.del_flg = 0'; + $from = SC_Product_Ex::prdclsSQL($inner_where); + // 会員の場合 + } elseif ($csv_id == 2) { + $from = 'dtb_customer'; + // 注文の場合 + } elseif ($csv_id == 3) { + $from = 'dtb_order'; + // レビューの場合 + } elseif ($csv_id == 4) { + $from = 'dtb_review AS A INNER JOIN dtb_products AS B on A.product_id = B.product_id'; + // カテゴリの場合 + } elseif ($csv_id == 5) { + $from = 'dtb_category'; + } + + $objQuery->setOrder($order); + $sql = $objQuery->getSql($cols, $from, $where); + + return $this->sfDownloadCsvFromSql($sql, $arrVal, $this->arrSubnavi[$csv_id], $arrOutput['disp_name'], $is_download); + } + + /** + * CSV 項目を出力する. + * + * @param int $csv_id CSV ID + * @param string $where SQL の WHERE 句 + * @param array $arrVal WHERE 句の要素 + * @param array $order SQL の ORDER BY 句 + * + * @return array CSV 項目の配列 + */ + public function sfGetCsvOutput($csv_id = '', $where = '', $arrVal = [], $order = 'rank, no') + { + $objQuery = SC_Query_Ex::getSingletonInstance(); + + $cols = 'no, csv_id, col, disp_name, rank, status, rw_flg, mb_convert_kana_option, size_const_type, error_check_types'; + $table = 'dtb_csv'; + + if (SC_Utils_Ex::sfIsInt($csv_id)) { + if ($where == '') { + $where = 'csv_id = ?'; + } else { + $where = "$where AND csv_id = ?"; + } + $arrVal[] = $csv_id; + } + $objQuery->setOrder($order); + + $arrRet = $objQuery->select($cols, $table, $where, $arrVal); + + return $arrRet; + } + + /** + * CSVが出力設定でインポート可能かのチェック + * + * @param array sfGetCsvOutputで取得した内容(またはそれと同等の配列) + * + * @return bool true:インポート可能、false:インポート不可 + */ + public function sfIsImportCSVFrame(&$arrCSVFrame) + { + $result = true; + foreach ($arrCSVFrame as $val) { + if ($val['status'] != CSV_COLUMN_STATUS_FLG_ENABLE + && $val['rw_flg'] == CSV_COLUMN_RW_FLG_READ_WRITE + && $val['error_check_types'] != '' + && str_contains(strtoupper($val['error_check_types']), 'EXIST_CHECK') + ) { + // 必須フィールド + $result = false; + } + } + + return $result; + } + + /** + * CSVが出力設定で更新可能かのチェック + * + * @param array sfGetCsvOutputで取得した内容(またはそれと同等の配列) + * + * @return bool true:更新可能、false:新規追加のみ不可 + */ + public function sfIsUpdateCSVFrame(&$arrCSVFrame) + { + $result = true; + foreach ($arrCSVFrame as $val) { + if ($val['status'] != CSV_COLUMN_STATUS_FLG_ENABLE + && $val['rw_flg'] == CSV_COLUMN_RW_FLG_KEY_FIELD + ) { + // キーフィールド + $result = false; + } + } + + return $result; + } + + /** + * CSVファイルのカウント数を得る. + * + * @param resource $fp fopenを使用して作成したファイルポインタ + * + * @return int CSV のカウント数 + */ + public function sfGetCSVRecordCount($fp) + { + $count = 0; + while (!feof($fp)) { + $arrCSV = fgetcsv($fp, CSV_LINE_MAX); + $count++; + } + // ファイルポインタを戻す + if (rewind($fp)) { + return $count - 1; + } else { + return false; + } + } + + /** + * CSV作成 テンポラリファイル出力 コールバック関数 + * + * @param mixed $data 出力データ + * + * @return bool true (true:固定 false:中断) + */ + public function cbOutputCSV($data) + { + // mb_convert_variablesで変換できない文字は"?"にする + mb_substitute_character(SUBSTITUTE_CHAR); + // 1行目のみヘッダーを出力する + if ($this->output_header) { + $header = array_keys($data); + mb_convert_variables('cp932', CHAR_CODE, $header); + fputcsv($this->fpOutput, $header); + $this->output_header = false; + } + mb_convert_variables('cp932', CHAR_CODE, $data); + fputcsv($this->fpOutput, $data); + SC_Utils_Ex::extendTimeOut(); + + return true; + } + + /** + * SQL文からクエリ実行し CSVファイルを送信する + * + * @param int $sql SQL文 + * @param array $arrVal プリペアドステートメントの実行時に使用される配列。配列の要素数は、クエリ内のプレースホルダの数と同じでなければなりません。 + * @param string ファイル名の頭に付ける文字列 + * @param array|null ヘッダ出力列配列。null の場合、SQL 文の列名を出力する。 + * @param bool true:ダウンロード用出力までさせる false:CSVの内容を返す(旧方式、メモリを食います。) + * + * @return bool|string $is_download = true時 成功失敗フラグ(boolean) 、$is_downalod = false時 string + */ + public function sfDownloadCsvFromSql($sql, $arrVal = [], $file_head = 'csv', $arrHeader = null, $is_download = false) + { + $objQuery = SC_Query_Ex::getSingletonInstance(); + + if (!$is_download) { + ob_start(); + } + + $this->fpOutput = &SC_Helper_CSV_Ex::fopen_for_output_csv(); + + // mb_convert_variablesで変換できない文字は"?"にする + mb_substitute_character(SUBSTITUTE_CHAR); + // ヘッダー構築 + $this->output_header = false; + if (is_array($arrHeader)) { + mb_convert_variables('cp932', CHAR_CODE, $arrHeader); + fputcsv($this->fpOutput, $arrHeader); + } elseif (is_null($arrHeader)) { + // ループバック内でヘッダーを出力する + $this->output_header = true; + } + + $objQuery->doCallbackAll([&$this, 'cbOutputCSV'], $sql, $arrVal); + + // コールバック内でヘッダー出力する場合、0行時にヘッダーを生成できない。 + // コールバックが呼ばれていない場合、念のため CRLF を出力しておく。 + // XXX WEB画面前提で、アラート表示する流れのほうが親切かもしれない。 + if ($this->output_header) { + fwrite($this->fpOutput, "\r\n"); + } + + fclose($this->fpOutput); + + // CSV 用の HTTP ヘッダーを送出する。 + if ($is_download) { + $file_name = $file_head.'_'.date('ymd_His').'.csv'; + SC_Response_Ex::headerForDownload($file_name); + $return = true; + } + // 戻り値にCSVデータをセットする + else { + $return = ob_get_clean(); + } + + return $return; + } + + /** + * 前方互換用 + * + * @deprecated 2.13.2 fputcsv を使うこと。(sfDownloadCsvFromSql や cbOutputCSV の実装を参照) + */ + public function sfArrayToCsv($fields, $delimiter = ',', $enclosure = '"', $arrayDelimiter = '|') + { + trigger_error('前方互換用メソッドが使用されました。', E_USER_WARNING); + if (strlen($delimiter) != 1) { + trigger_error('delimiter must be a single character', E_USER_WARNING); + + return ''; + } + + if (strlen($enclosure) < 1) { + trigger_error('enclosure must be a single character', E_USER_WARNING); + + return ''; + } + + foreach ($fields as $key => $value) { + $field = &$fields[$key]; + + // 配列を「|」区切りの文字列に変換する + if (is_array($field)) { + $field = implode($arrayDelimiter, $field); + } + + /* enclose a field that contains a delimiter, an enclosure character, or a newline */ + if (is_string($field) + && preg_match('/['.preg_quote($delimiter).preg_quote($enclosure).'\\s]/', $field) + ) { + $field = $enclosure.preg_replace('/'.preg_quote($enclosure).'/', $enclosure.$enclosure, $field).$enclosure; + } + } + + return implode($delimiter, $fields); + } + + /** + * 前方互換用 + * + * @deprecated 2.13.2 + */ + public function lfDownloadCsv($arrData, $prefix = '') + { + trigger_error('前方互換用メソッドが使用されました。', E_USER_WARNING); + if ($prefix == '') { + $dir_name = SC_Utils_Ex::sfUpDirName(); + $file_name = $dir_name.date('ymdHis').'.csv'; + } else { + $file_name = $prefix.date('ymdHis').'.csv'; + } + SC_Response_Ex::headerForDownload($file_name); + + /* データを出力 */ + $fp = &SC_Helper_CSV_Ex::fopen_for_output_csv(); + foreach ($arrData as $lineArray) { + fputcsv($fp, $lineArray); + } + fclose($fp); + } + + /** + * 前方互換用 + * + * @deprecated 2.13.2 + */ + public function lfDownloadCSVFile($filepath, $prefix = '') + { + trigger_error('前方互換用メソッドが使用されました。', E_USER_WARNING); + $file_name = $prefix.date('YmdHis').'.csv'; + SC_Response_Ex::headerForDownload($file_name); + + /* データを出力 */ + // file_get_contentsはメモリマッピングも自動的に使ってくれるので高速&省メモリ + echo file_get_contents($filepath); + } + + /** + * CSV 出力用のファイルポインタリソースを開く + * + * @return resource ファイルポインタリソース + */ + public static function &fopen_for_output_csv($filename = 'php://output') + { + $fp = fopen($filename, 'w'); + + stream_filter_append($fp, 'convert.eccube_lf2crlf'); + + return $fp; + } +} + +/** + * 改行コードを CRLF に変換するフィルター + * + * @author Seasoft 塚田将久 (新規作成) + * + * @version $Id$ + */ +class php_user_filter_lf2crlf extends php_user_filter +{ + #[\ReturnTypeWillChange] + public function filter($in, $out, &$consumed, $closing) + { + while ($bucket = stream_bucket_make_writeable($in)) { + $bucket->data = preg_replace("/[\r\n]+$/", "\r\n", $bucket->data); + $consumed += $bucket->datalen; + stream_bucket_append($out, $bucket); + } + + return PSFS_PASS_ON; + } +} + +stream_filter_register('convert.eccube_lf2crlf', 'php_user_filter_lf2crlf'); diff --git a/data/class/helper/SC_Helper_DB.php b/data/class/helper/SC_Helper_DB.php index 469ade5d0f..21ef6390ba 100644 --- a/data/class/helper/SC_Helper_DB.php +++ b/data/class/helper/SC_Helper_DB.php @@ -256,6 +256,7 @@ public static function sfCreateBasisDataCache() // ファイル生成失敗 return false; } + // ファイル生成成功 return true; } @@ -412,6 +413,7 @@ public static function sfGetCatTree($parent_category_id, $count_check = false) * @param array カテゴリの配列 * @param int $parent 上位カテゴリID * @param array パンくずリスト用の配列 + * * @result void * * @see sfGetCatTree() diff --git a/data/class/helper/SC_Helper_FileManager.php b/data/class/helper/SC_Helper_FileManager.php index 876b168364..0dce690169 100644 --- a/data/class/helper/SC_Helper_FileManager.php +++ b/data/class/helper/SC_Helper_FileManager.php @@ -508,14 +508,14 @@ public static function convertToAbsolutePath($path) { $endsWithSlash = substr($path, -1) === '/'; // 絶対パスかどうか - if (strpos($path, '/') === 0 || preg_match('/^[a-z]:/i', $path)) { + if (str_starts_with($path, '/') || preg_match('/^[a-z]:/i', $path)) { $path = realpath($path); } else { $path = realpath(HTML_REALDIR.$path); } // USER_REALDIR 以下のパスかどうか - if ($path === false || strpos($path, realpath(USER_REALDIR)) === false) { + if ($path === false || !str_contains($path, realpath(USER_REALDIR))) { $path = realpath(USER_REALDIR); } diff --git a/data/class/helper/SC_Helper_Mobile.php b/data/class/helper/SC_Helper_Mobile.php index 11d1b5c83c..7a66326e8b 100644 --- a/data/class/helper/SC_Helper_Mobile.php +++ b/data/class/helper/SC_Helper_Mobile.php @@ -39,42 +39,42 @@ class SC_Helper_Mobile * Application/octet-streamで対応出来ないファイルタイプのみ拡張子をキーに記述する * 拡張子が本配列に存在しない場合は application/force-download を利用する */ public $arrMimetypes = [ - 'html' => 'text/html', - 'css' => 'text/css', - 'hdml' => 'text/x-hdml', - 'mmf' => 'application/x-smaf', - 'jpeg' => 'image/jpeg', - 'jpg' => 'image/jpeg', - 'gif' => 'image/gif', - 'png' => 'image/png', - 'bmp' => 'image/x-ms-bmp', - 'amc' => 'application/x-mpeg', - '3g2' => 'video/3gpp2', - '3gp' => 'video/3gpp', - 'jam' => 'application/x-jam', - 'kjx' => 'application/x-kjx', - 'jar' => 'application/java-archive', - 'jad' => 'text/vnd.sun.j2me.app-descriptor', - 'swf' => 'application/x-shockwave-flash', - 'dmt' => 'application/x-decomail-template', - 'khm' => 'application/x-kddi-htmlmail', - 'hmt' => 'application/x-htmlmail-template', - 'ucm' => 'application/x-ucf-package', - 'ucp' => 'application/x-ucf-package', - 'pdf' => 'application/pdf', - 'wma' => 'audio/x-ms-wma', - 'asf' => 'video/x-ms-asf', - 'wax' => 'audio/x-ms-wax', - 'wvx' => 'video/x-ms-wvx', - 'wmv' => 'video/x-ms-wmv', - 'asx' => 'video/asx', - 'txt' => 'text/plain', - 'exe' => 'application/octet-stream', - 'zip' => 'application/zip', - 'doc' => 'application/msword', - 'xls' => 'application/vnd.ms-excel', - 'ppt' => 'application/vnd.ms-powerpoint', - ]; + 'html' => 'text/html', + 'css' => 'text/css', + 'hdml' => 'text/x-hdml', + 'mmf' => 'application/x-smaf', + 'jpeg' => 'image/jpeg', + 'jpg' => 'image/jpeg', + 'gif' => 'image/gif', + 'png' => 'image/png', + 'bmp' => 'image/x-ms-bmp', + 'amc' => 'application/x-mpeg', + '3g2' => 'video/3gpp2', + '3gp' => 'video/3gpp', + 'jam' => 'application/x-jam', + 'kjx' => 'application/x-kjx', + 'jar' => 'application/java-archive', + 'jad' => 'text/vnd.sun.j2me.app-descriptor', + 'swf' => 'application/x-shockwave-flash', + 'dmt' => 'application/x-decomail-template', + 'khm' => 'application/x-kddi-htmlmail', + 'hmt' => 'application/x-htmlmail-template', + 'ucm' => 'application/x-ucf-package', + 'ucp' => 'application/x-ucf-package', + 'pdf' => 'application/pdf', + 'wma' => 'audio/x-ms-wma', + 'asf' => 'video/x-ms-asf', + 'wax' => 'audio/x-ms-wax', + 'wvx' => 'video/x-ms-wvx', + 'wmv' => 'video/x-ms-wmv', + 'asx' => 'video/asx', + 'txt' => 'text/plain', + 'exe' => 'application/octet-stream', + 'zip' => 'application/zip', + 'doc' => 'application/msword', + 'xls' => 'application/vnd.ms-excel', + 'ppt' => 'application/vnd.ms-powerpoint', + ]; /** * EC-CUBE がサポートする携帯端末かどうかをチェックする。 diff --git a/data/class/helper/SC_Helper_Purchase.php b/data/class/helper/SC_Helper_Purchase.php index 8f2d1be7c9..9f9bce70f0 100644 --- a/data/class/helper/SC_Helper_Purchase.php +++ b/data/class/helper/SC_Helper_Purchase.php @@ -260,7 +260,9 @@ public static function getOrderTemp($uniqId) { $objQuery = SC_Query_Ex::getSingletonInstance(); - return $objQuery->getRow('*', 'dtb_order_temp', 'order_temp_id = ?', [$uniqId]); + $result = $objQuery->getRow('*', 'dtb_order_temp', 'order_temp_id = ?', [$uniqId]); + + return is_array($result) ? $result : []; // 必ず配列を返す } /** @@ -572,10 +574,10 @@ public function copyFromOrder(&$dest, $src, $prefix = 'shipping', $src_prefix = $arrKey = $this->arrShippingKey; } if (!SC_Utils_Ex::isBlank($prefix)) { - $prefix = $prefix.'_'; + $prefix .= '_'; } if (!SC_Utils_Ex::isBlank($src_prefix)) { - $src_prefix = $src_prefix.'_'; + $src_prefix .= '_'; } foreach ($arrKey as $key) { if (isset($src[$src_prefix.$key])) { @@ -1314,6 +1316,7 @@ public static function sfUpdateOrderStatus($orderId, $newStatus = null, $newAddP * * @param int $order_id 更新対象の注文番号 * @param bool $temp_table 更新対象は「受注_Temp」か + * * @static */ public static function sfUpdateOrderNameCol($order_id, $temp_table = false) diff --git a/data/class/helper/SC_Helper_TaxRule.php b/data/class/helper/SC_Helper_TaxRule.php index ea4a1f6a46..db3dba9d5c 100644 --- a/data/class/helper/SC_Helper_TaxRule.php +++ b/data/class/helper/SC_Helper_TaxRule.php @@ -118,7 +118,7 @@ public static function getTaxPerTaxRate($arrTaxableTotal, $discount_total = 0) $result[$rate] = [ 'discount' => (int) $discount[$rate], 'total' => (int) $reduced_total, - 'tax' => (int) (static::roundByCalcRule($tax, $defaultTaxRule)), + 'tax' => (int) static::roundByCalcRule($tax, $defaultTaxRule), ]; } diff --git a/data/class/helper/SC_Helper_Transform.php b/data/class/helper/SC_Helper_Transform.php index 0f2b855386..2521b7da44 100644 --- a/data/class/helper/SC_Helper_Transform.php +++ b/data/class/helper/SC_Helper_Transform.php @@ -347,7 +347,7 @@ public function getHTML() $err_msg .= '
'.$arrErr['err_msg']; } else { if ($arrErr['type'] == self::ERR_TARGET_ELEMENT_NOT_FOUND) { - $err_msg .= "
${arrErr['selector']} が存在しません"; + $err_msg .= "
{$arrErr['selector']} が存在しません"; } else { $err_msg .= '
'.print_r($arrErr, true); } diff --git a/data/class/pages/LC_Page_Sitemap.php b/data/class/pages/LC_Page_Sitemap.php index dd24558c69..54ba9a7ca6 100644 --- a/data/class/pages/LC_Page_Sitemap.php +++ b/data/class/pages/LC_Page_Sitemap.php @@ -308,6 +308,7 @@ public function date2W3CDatetime($date) $arr = []; // 正規表現で文字列を抽出 preg_match('/^([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})/', $date, $arr); + // :TODO: time zone も取得するべき... return sprintf('%04d-%02d-%02dT%02d:%02d:%02d+09:00', $arr[1], $arr[2], $arr[3], $arr[4], $arr[5], $arr[6]); diff --git a/data/class/pages/admin/basis/LC_Page_Admin_Basis_Tax.php b/data/class/pages/admin/basis/LC_Page_Admin_Basis_Tax.php index 6ca0dcf7c7..ea6a96a9ce 100644 --- a/data/class/pages/admin/basis/LC_Page_Admin_Basis_Tax.php +++ b/data/class/pages/admin/basis/LC_Page_Admin_Basis_Tax.php @@ -249,7 +249,7 @@ public function doParamRegist($arrParam) $arrData['OPTION_PRODUCT_TAX_RULE'] = $val; break; default: - } + } } $masterData = new SC_DB_MasterData_Ex(); // DBのデータを更新 diff --git a/data/class/pages/admin/contents/LC_Page_Admin_Contents_CsvSql.php b/data/class/pages/admin/contents/LC_Page_Admin_Contents_CsvSql.php index d46e75d5af..69c846a81c 100644 --- a/data/class/pages/admin/contents/LC_Page_Admin_Contents_CsvSql.php +++ b/data/class/pages/admin/contents/LC_Page_Admin_Contents_CsvSql.php @@ -461,7 +461,7 @@ public function lfGetSqlDenyList() 'NOTIFY\s', 'PREPARE\s', 'REASSIGN\s', -// 'REINDEX\s', // REINDEXは許可で良いかなと + // 'REINDEX\s', // REINDEXは許可で良いかなと 'RELEASE\sSAVEPOINT', 'RENAME\s', 'REST\s', diff --git a/data/class/pages/admin/contents/LC_Page_Admin_Contents_RecommendSearch.php b/data/class/pages/admin/contents/LC_Page_Admin_Contents_RecommendSearch.php index bd76fac38a..8ea0910344 100644 --- a/data/class/pages/admin/contents/LC_Page_Admin_Contents_RecommendSearch.php +++ b/data/class/pages/admin/contents/LC_Page_Admin_Contents_RecommendSearch.php @@ -140,10 +140,10 @@ public function lfCheckError(&$objFormParam) /** * POSTされた値からSQLのWHEREとBINDを配列で返す。 * - * @return array ('where' => where string, 'bind' => databind array) - * * @param SC_FormParam $objFormParam * @param SC_Helper_DB_Ex $objDb + * + * @return array ('where' => where string, 'bind' => databind array) */ public function createWhere(&$objFormParam, &$objDb) { @@ -219,6 +219,7 @@ public function getProducts($whereAndBind, &$objProduct, $page_max, $startno) $objQuery->setWhere($where); // 取得範囲の指定(開始行番号、行数のセット) $objQuery->setLimitOffset($page_max, $startno); + // 検索結果の取得 return $objProduct->findProductIdsOrder($objQuery, $bind); } diff --git a/data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php b/data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php index 326f542baf..fd4da9ac63 100644 --- a/data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php +++ b/data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php @@ -808,16 +808,16 @@ public function doRegister($order_id, &$objPurchase, &$objFormParam, &$message, $order_id = $objPurchase->registerOrder($order_id, $arrValues); $arrDetail = $objFormParam->getSwapArray([ - 'product_id', - 'product_class_id', - 'product_code', - 'product_name', - 'price', 'quantity', - 'point_rate', - 'classcategory_name1', - 'classcategory_name2', - 'tax_rate', - 'tax_rule', + 'product_id', + 'product_class_id', + 'product_code', + 'product_name', + 'price', 'quantity', + 'point_rate', + 'classcategory_name1', + 'classcategory_name2', + 'tax_rate', + 'tax_rule', ]); // 変更しようとしている商品情報とDBに登録してある商品情報を比較することで、更新すべき数量を計算 @@ -1286,6 +1286,7 @@ public function deleteShipment(&$objFormParam, $arrShipmentDeleteKeys, $delete_s } } } + // $objFormParam->setParam($arrUpdateParams); return $arrUpdateParams; } diff --git a/data/class/pages/admin/order/LC_Page_Admin_Order_Mail.php b/data/class/pages/admin/order/LC_Page_Admin_Order_Mail.php index 26da547d60..4b974e5837 100644 --- a/data/class/pages/admin/order/LC_Page_Admin_Order_Mail.php +++ b/data/class/pages/admin/order/LC_Page_Admin_Order_Mail.php @@ -190,6 +190,7 @@ public function doSend(&$objFormParam) $objFormParam->getValue('header'), $objFormParam->getValue('footer')); } + // TODO $SC_SendMail から送信がちゃんと出来たか確認できたら素敵。 return true; } diff --git a/data/class/pages/admin/order/LC_Page_Admin_Order_ProductSelect.php b/data/class/pages/admin/order/LC_Page_Admin_Order_ProductSelect.php index 30345a0d7a..10d90e1696 100644 --- a/data/class/pages/admin/order/LC_Page_Admin_Order_ProductSelect.php +++ b/data/class/pages/admin/order/LC_Page_Admin_Order_ProductSelect.php @@ -212,10 +212,10 @@ public function getLineCount($whereAndBind, &$objProduct) /** * POSTされた値からSQLのWHEREとBINDを配列で返す。 * - * @return array ('where' => where string, 'bind' => databind array) - * * @param SC_FormParam $objFormParam * @param SC_Helper_DB_Ex $objDb + * + * @return array ('where' => where string, 'bind' => databind array) */ public function createWhere(&$objFormParam, &$objDb) { diff --git a/data/class/pages/admin/ownersstore/LC_Page_Admin_OwnersStore.php b/data/class/pages/admin/ownersstore/LC_Page_Admin_OwnersStore.php index b86c9c85d3..7081f41626 100644 --- a/data/class/pages/admin/ownersstore/LC_Page_Admin_OwnersStore.php +++ b/data/class/pages/admin/ownersstore/LC_Page_Admin_OwnersStore.php @@ -1113,7 +1113,7 @@ public function checkConflictPlugin($plugin_id) /** * エラー情報が格納されているか判定します. * - * @return boolean. + * @return bool */ public function isError($error) { diff --git a/data/class/pages/admin/products/LC_Page_Admin_Products_ProductClass.php b/data/class/pages/admin/products/LC_Page_Admin_Products_ProductClass.php index 676595e6b0..e6d70c37b9 100644 --- a/data/class/pages/admin/products/LC_Page_Admin_Products_ProductClass.php +++ b/data/class/pages/admin/products/LC_Page_Admin_Products_ProductClass.php @@ -375,9 +375,9 @@ public function lfCheckProductsClass(&$objFormParam) if (SC_Utils_Ex::isBlank($arrValues['down_realfilename'][$i])) { $arrErr['down_realfilename'][$i] = '※ ダウンロード商品の場合はダウンロード商品用ファイルをアップロードしてください。
'; } - /* - * 通常商品チェック - */ + /* + * 通常商品チェック + */ } elseif ($arrValues['product_type_id'][$i] != PRODUCT_TYPE_DOWNLOAD) { if (!SC_Utils_Ex::isBlank($arrValues['down_filename'][$i])) { $arrErr['down_filename'][$i] = '※ ダウンロード商品ではない場合、ダウンロードファイル名を設定できません。
'; @@ -602,7 +602,7 @@ public function doFileUpload(&$objFormParam) $size = DOWN_SIZE; $byte = 'KB'; if ($size >= 1000) { - $size = $size / 1000; + $size /= 1000; $byte = 'MB'; } $this->arrErr['down_realfilename'][$index] = '※ ダウンロード販売用ファイル名のファイルサイズは'.$size.$byte.'以下のものを使用してください。
'; diff --git a/data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSV.php b/data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSV.php index 1a9cf7712b..20d424dd46 100644 --- a/data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSV.php +++ b/data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSV.php @@ -334,7 +334,7 @@ public function lfInitParam(&$objFormParam, &$arrCSVFrame) $col = $item['col']; } // HTML_TAG_CHECKは別途実行なので除去し、別保存しておく - if (strpos(strtoupper($item['error_check_types']), 'HTML_TAG_CHECK') !== false) { + if (str_contains(strtoupper($item['error_check_types']), 'HTML_TAG_CHECK')) { $this->arrTagCheckItem[] = $item; $error_check_types = str_replace('HTML_TAG_CHECK', '', $item['error_check_types']); } else { diff --git a/data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSVCategory.php b/data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSVCategory.php index 11ecb6cefb..716062134f 100644 --- a/data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSVCategory.php +++ b/data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSVCategory.php @@ -293,7 +293,7 @@ public function lfInitParam(SC_FormParam &$objFormParam, &$arrCSVFrame) $col = $item['col']; } // HTML_TAG_CHECKは別途実行なので除去し、別保存しておく - if (strpos(strtoupper($item['error_check_types']), 'HTML_TAG_CHECK') !== false) { + if (str_contains(strtoupper($item['error_check_types']), 'HTML_TAG_CHECK')) { $this->arrTagCheckItem[] = $item; $error_check_types = str_replace('HTML_TAG_CHECK', '', $item['error_check_types']); } else { @@ -500,9 +500,12 @@ public function lfCheckErrorDetail($item, $arrErr) $where = 'parent_category_id = ? AND category_id <> ? AND category_name = ?'; $exists = $objQuery->exists('dtb_category', $where, - [$parent_category_id, - $item['category_id'], - $item['category_name'], ]); + [ + $parent_category_id, + $item['category_id'], + $item['category_name'], + ] + ); if ($exists) { $arrErr['category_name'] = '※ 既に同名のカテゴリが存在します。'; } diff --git a/data/class/pages/admin/system/LC_Page_Admin_System_AdminArea.php b/data/class/pages/admin/system/LC_Page_Admin_System_AdminArea.php index 81401d2ed5..2136fdf842 100644 --- a/data/class/pages/admin/system/LC_Page_Admin_System_AdminArea.php +++ b/data/class/pages/admin/system/LC_Page_Admin_System_AdminArea.php @@ -67,7 +67,7 @@ public function process() */ public function action() { - if (strpos(HTTPS_URL, 'https://') !== false) { + if (str_contains(HTTPS_URL, 'https://')) { $this->tpl_enable_ssl = true; } @@ -137,7 +137,7 @@ public function lfCheckAdminArea(&$arrForm, &$arrErr) $installData = file(CONFIG_REALFILE, FILE_IGNORE_NEW_LINES); foreach ($installData as $key => $line) { - if (strpos($line, 'ADMIN_DIR') !== false && ADMIN_DIR != $admin_dir) { + if (str_contains($line, 'ADMIN_DIR') && ADMIN_DIR != $admin_dir) { if ($admin_dir == 'admin/') { $arrErr['admin_dir'] .= '別のディレクトリ名を指定してください。'; } @@ -176,7 +176,7 @@ public function lfUpdateAdminData(&$arrForm) $installData = file(CONFIG_REALFILE, FILE_IGNORE_NEW_LINES); $diff = 0; foreach ($installData as $key => $line) { - if (strpos($line, 'ADMIN_DIR') !== false && ADMIN_DIR != $admin_dir) { + if (str_contains($line, 'ADMIN_DIR') && ADMIN_DIR != $admin_dir) { $installData[$key] = 'define("ADMIN_DIR", "'.$admin_dir.'");'; // 管理機能ディレクトリのリネーム if (!rename(HTML_REALDIR.ADMIN_DIR, HTML_REALDIR.$admin_dir)) { @@ -187,11 +187,11 @@ public function lfUpdateAdminData(&$arrForm) $diff++; } - if (strpos($line, 'ADMIN_FORCE_SSL') !== false) { + if (str_contains($line, 'ADMIN_FORCE_SSL')) { $installData[$key] = 'define("ADMIN_FORCE_SSL", '.$admin_force_ssl.');'; $diff++; } - if (strpos($line, 'ADMIN_ALLOW_HOSTS') !== false && ADMIN_ALLOW_HOSTS != $admin_allow_hosts) { + if (str_contains($line, 'ADMIN_ALLOW_HOSTS') && ADMIN_ALLOW_HOSTS != $admin_allow_hosts) { $installData[$key] = "define('ADMIN_ALLOW_HOSTS', '".$admin_allow_hosts."');"; $diff++; } diff --git a/data/class/pages/admin/system/LC_Page_Admin_System_Editdb.php b/data/class/pages/admin/system/LC_Page_Admin_System_Editdb.php index e94f1bc1d5..50de0ba67b 100644 --- a/data/class/pages/admin/system/LC_Page_Admin_System_Editdb.php +++ b/data/class/pages/admin/system/LC_Page_Admin_System_Editdb.php @@ -148,10 +148,12 @@ public function lfGetTargetData(&$objFormParam) // 変更されている対象を走査 for ($i = 1; $i <= count($arrIndexFlag); $i++) { // 入力値チェック - $param = ['indexflag' => $arrIndexFlag[$i], - 'indexflag_new' => $arrIndexFlagNew[$i], - 'table_name' => $arrTableName[$i], - 'column_name' => $arrColumnName[$i], ]; + $param = [ + 'indexflag' => $arrIndexFlag[$i], + 'indexflag_new' => $arrIndexFlagNew[$i], + 'table_name' => $arrTableName[$i], + 'column_name' => $arrColumnName[$i], + ]; $objErr = new SC_CheckError_Ex($param); $objErr->doFunc(['インデックス('.$i.')', 'indexflag', INT_LEN], ['NUM_CHECK']); $objErr->doFunc(['インデックス変更後('.$i.')', 'indexflag_new', INT_LEN], ['NUM_CHECK']); diff --git a/data/class/pages/admin/system/LC_Page_Admin_System_Parameter.php b/data/class/pages/admin/system/LC_Page_Admin_System_Parameter.php index 2a869cc12f..ccfcfce7e4 100644 --- a/data/class/pages/admin/system/LC_Page_Admin_System_Parameter.php +++ b/data/class/pages/admin/system/LC_Page_Admin_System_Parameter.php @@ -139,8 +139,12 @@ public function errorCheck(&$arrKeys, &$arrForm) { $objErr = new SC_CheckError_Ex($arrForm); for ($i = 0; $i < count($arrKeys); $i++) { - $objErr->doFunc([$arrKeys[$i], - $arrForm[$arrKeys[$i]], ], + $objErr->doFunc( + [ + $arrKeys[$i], + $arrForm[$arrKeys[$i] + ], + ], ['EXIST_CHECK_REVERSE', 'EVAL_CHECK']); } diff --git a/data/class/pages/api/LC_Page_Api.php b/data/class/pages/api/LC_Page_Api.php index 2c20367192..1ab54add7f 100644 --- a/data/class/pages/api/LC_Page_Api.php +++ b/data/class/pages/api/LC_Page_Api.php @@ -48,7 +48,7 @@ public function init() public function process() { $this->action(); -// $this->sendResponse(); + // $this->sendResponse(); } /** diff --git a/data/class/pages/api/LC_Page_Api_Json.php b/data/class/pages/api/LC_Page_Api_Json.php index 7479bdff83..f77215a921 100644 --- a/data/class/pages/api/LC_Page_Api_Json.php +++ b/data/class/pages/api/LC_Page_Api_Json.php @@ -48,7 +48,7 @@ public function init() public function process() { $this->action(); -// $this->sendResponse(); + // $this->sendResponse(); } /** diff --git a/data/class/pages/api/LC_Page_Api_Php.php b/data/class/pages/api/LC_Page_Api_Php.php index 5fb0b3497f..0bff94c58c 100644 --- a/data/class/pages/api/LC_Page_Api_Php.php +++ b/data/class/pages/api/LC_Page_Api_Php.php @@ -48,7 +48,7 @@ public function init() public function process() { $this->action(); -// $this->sendResponse(); + // $this->sendResponse(); } /** diff --git a/data/class/pages/api/LC_Page_Api_Xml.php b/data/class/pages/api/LC_Page_Api_Xml.php index 320b5cab6c..fa5f52f76d 100644 --- a/data/class/pages/api/LC_Page_Api_Xml.php +++ b/data/class/pages/api/LC_Page_Api_Xml.php @@ -48,7 +48,7 @@ public function init() public function process() { $this->action(); -// $this->sendResponse(); + // $this->sendResponse(); } /** diff --git a/data/class/pages/forgot/LC_Page_Forgot.php b/data/class/pages/forgot/LC_Page_Forgot.php index 9817d4ae5d..c1e38f9044 100644 --- a/data/class/pages/forgot/LC_Page_Forgot.php +++ b/data/class/pages/forgot/LC_Page_Forgot.php @@ -202,8 +202,10 @@ public function lfCheckForgotSecret(&$arrForm, &$arrReminder) $where = '(email = ? OR email_mobile = ?)' .' AND name01 = ? AND name02 = ?' .' AND status = 2 AND del_flg = 0'; - $arrVal = [$arrForm['email'], $arrForm['email'], - $arrForm['name01'], $arrForm['name02'], ]; + $arrVal = [ + $arrForm['email'], $arrForm['email'], + $arrForm['name01'], $arrForm['name02'], + ]; $result = $objQuery->select($cols, $table, $where, $arrVal); if (isset($result[0]['reminder']) && isset($arrReminder[$result[0]['reminder']]) && $result[0]['reminder'] == $arrForm['reminder']) { diff --git a/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Calendar.php b/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Calendar.php index aa477e9979..04dd272c6f 100644 --- a/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Calendar.php +++ b/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Calendar.php @@ -21,8 +21,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -defined('CALENDAR_ROOT') || define('CALENDAR_ROOT', DATA_REALDIR.'module/Calendar'.DIRECTORY_SEPARATOR); - /** * Calendar のページクラス. * diff --git a/data/class/pages/mypage/LC_Page_Mypage_DeliveryAddr.php b/data/class/pages/mypage/LC_Page_Mypage_DeliveryAddr.php index 96744c2401..24a7a3dc6f 100644 --- a/data/class/pages/mypage/LC_Page_Mypage_DeliveryAddr.php +++ b/data/class/pages/mypage/LC_Page_Mypage_DeliveryAddr.php @@ -49,9 +49,11 @@ public function init() $this->arrPref = $masterData->getMasterData('mtb_pref'); $this->arrCountry = $masterData->getMasterData('mtb_country'); $this->httpCacheControl('nocache'); - $this->validUrl = [MYPAGE_DELIVADDR_URLPATH, - DELIV_URLPATH, - MULTIPLE_URLPATH, ]; + $this->validUrl = [ + MYPAGE_DELIVADDR_URLPATH, + DELIV_URLPATH, + MULTIPLE_URLPATH, + ]; } /** diff --git a/data/class/pages/mypage/LC_Page_Mypage_DownLoad.php b/data/class/pages/mypage/LC_Page_Mypage_DownLoad.php index 5a3efff133..8eda75cd47 100644 --- a/data/class/pages/mypage/LC_Page_Mypage_DownLoad.php +++ b/data/class/pages/mypage/LC_Page_Mypage_DownLoad.php @@ -40,8 +40,8 @@ class LC_Page_Mypage_DownLoad extends LC_Page_Ex * Application/octet-streamで対応出来ないファイルタイプのみ拡張子をキーに記述する * 拡張子が本配列に存在しない場合は $defaultContentTypeを利用する */ public $arrContentType = ['apk' => 'application/vnd.android.package-archive', - 'pdf' => 'application/pdf', - ]; + 'pdf' => 'application/pdf', + ]; /** * Page を初期化する. diff --git a/data/class/pages/products/LC_Page_Products_Detail.php b/data/class/pages/products/LC_Page_Products_Detail.php index ea3afe3d46..b2c6c12977 100644 --- a/data/class/pages/products/LC_Page_Products_Detail.php +++ b/data/class/pages/products/LC_Page_Products_Detail.php @@ -443,6 +443,7 @@ public function lfInitParam(SC_FormParam &$objFormParam) $objFormParam->setParam($_REQUEST); // 入力値の変換 $objFormParam->convParam(); + // 入力情報を渡す return $objFormParam->getFormParamList(); } diff --git a/data/class/pages/shopping/LC_Page_Shopping_LoadPaymentModule.php b/data/class/pages/shopping/LC_Page_Shopping_LoadPaymentModule.php index 2ccda4f87a..73d0224994 100644 --- a/data/class/pages/shopping/LC_Page_Shopping_LoadPaymentModule.php +++ b/data/class/pages/shopping/LC_Page_Shopping_LoadPaymentModule.php @@ -99,7 +99,7 @@ public function getModulePath($order_id) $module_path = str_replace('\\', '/', $module_path); } $module_realdir = str_replace('\\', '/', realpath(MODULE_REALDIR).'/'); - if (strpos($module_path, $module_realdir) !== false) { + if (str_contains($module_path, $module_realdir)) { $module_path = str_replace($module_realdir, '', $module_path); } $module_path = $module_realdir.$module_path; diff --git a/data/class/plugin/SC_Plugin_Util.php b/data/class/plugin/SC_Plugin_Util.php index bb6ba47ba9..f44e221efb 100644 --- a/data/class/plugin/SC_Plugin_Util.php +++ b/data/class/plugin/SC_Plugin_Util.php @@ -221,10 +221,10 @@ public static function checkExtension($key) // プラグイン利用に必須のモジュール // 'EC-CUBEバージョン' => array('モジュール名') $arrRequireExtension = [ - '2.12.0' => ['dom'], - '2.12.1' => ['dom'], - '2.12.2' => ['dom'], - ]; + '2.12.0' => ['dom'], + '2.12.1' => ['dom'], + '2.12.2' => ['dom'], + ]; // 必須拡張モジュールのチェック $arrErr = []; if (is_array($arrRequireExtension[ECCUBE_VERSION])) { diff --git a/data/class/sessionfactory/SC_SessionFactory_UseCookie.php b/data/class/sessionfactory/SC_SessionFactory_UseCookie.php index 2062cb3ee5..1f5d908c6a 100644 --- a/data/class/sessionfactory/SC_SessionFactory_UseCookie.php +++ b/data/class/sessionfactory/SC_SessionFactory_UseCookie.php @@ -95,7 +95,7 @@ public function useCookie() */ protected function getSecureOption() { - return strpos(HTTP_URL, 'https') !== false && strpos(HTTPS_URL, 'https') !== false; + return str_contains(HTTP_URL, 'https') && str_contains(HTTPS_URL, 'https'); } } /* diff --git a/data/class/sessionfactory/SC_SessionFactory_UseRequest.php b/data/class/sessionfactory/SC_SessionFactory_UseRequest.php index c0e7494cca..5a6484b682 100644 --- a/data/class/sessionfactory/SC_SessionFactory_UseRequest.php +++ b/data/class/sessionfactory/SC_SessionFactory_UseRequest.php @@ -36,7 +36,7 @@ */ class SC_SessionFactory_UseRequest extends SC_SessionFactory_Ex { - public $state = null; + public $state; /** * PC/モバイルのセッション管理オブジェクトを切り替える diff --git a/data/class/util/GC_Utils.php b/data/class/util/GC_Utils.php index 01ed79cacb..9961efbeff 100644 --- a/data/class/util/GC_Utils.php +++ b/data/class/util/GC_Utils.php @@ -199,7 +199,7 @@ public static function gfPrintLog($msg, $path = '', $verbose = USE_VERBOSE_LOG) $msg .= 'customer_id = '.$_SESSION['customer']['customer_id']."\n"; } if (GC_Utils_Ex::isAdminFunction()) { - $msg .= 'login_id = '.$_SESSION['login_id'].'('.$_SESSION['authority'].')'.'['.substr(sha1(session_id()), 0, 8).']'."\n"; + $msg .= 'login_id = '.$_SESSION['login_id'].'('.$_SESSION['authority'].')['.substr(sha1(session_id()), 0, 8).']'."\n"; } $msg .= GC_Utils_Ex::toStringBacktrace(GC_Utils_Ex::getDebugBacktrace()); } diff --git a/data/class/util/SC_Utils.php b/data/class/util/SC_Utils.php index c58cafc6d5..f78045fb76 100755 --- a/data/class/util/SC_Utils.php +++ b/data/class/util/SC_Utils.php @@ -325,7 +325,7 @@ public static function sfIsInt($value) */ public static function sfIsZeroFilling($value) { - if (strlen($value) > 1 && (strpos($value, '0') === 0)) { + if (strlen($value) > 1 && str_starts_with($value, '0')) { return true; } @@ -1063,7 +1063,7 @@ public static function sfCutString($str, $len, $byte = true, $commadisp = true) } if ($commadisp) { - $ret = $ret.'...'; + $ret .= '...'; } return $ret; @@ -1268,13 +1268,13 @@ public static function sfCopyDir($src, $des, $mess = '', $override = false) if (is_array($fileArray)) { foreach ($fileArray as $data_) { // CVS管理ファイルはコピーしない - if (strpos($data_, '/CVS/Entries') !== false) { + if (str_contains($data_, '/CVS/Entries')) { break; } - if (strpos($data_, '/CVS/Repository') !== false) { + if (str_contains($data_, '/CVS/Repository')) { break; } - if (strpos($data_, '/CVS/Root') !== false) { + if (str_contains($data_, '/CVS/Root')) { break; } @@ -1346,7 +1346,7 @@ public static function sfGetFileVersion($path) if ($src_fp) { while (!feof($src_fp)) { $line = fgets($src_fp); - if (strpos($line, '@version') !== false) { + if (str_contains($line, '@version')) { $arrLine = explode(' ', $line); $version = $arrLine[5]; } @@ -1881,7 +1881,7 @@ public static function jsonDecode($json) */ public static function isAbsoluteRealPath($realpath) { - if (strpos(PHP_OS, 'WIN') === false) { + if (!str_contains(PHP_OS, 'WIN')) { return substr($realpath, 0, 1) == '/'; } else { return preg_match('/^[a-zA-Z]:(\\\|\/)/', $realpath) ? true : false; diff --git a/data/module/Calendar/Calendar.php b/data/module/Calendar/Calendar.php deleted file mode 100644 index 809df81759..0000000000 --- a/data/module/Calendar/Calendar.php +++ /dev/null @@ -1,739 +0,0 @@ - | -// | Lorenzo Alberton | -// +----------------------------------------------------------------------+ -// -// $Id: Calendar.php,v 1.3 2005/10/22 10:07:11 quipo Exp $ -// -/* - * @package Calendar - * @version $Id$ - */ - -/* - * Allows Calendar include path to be redefined - */ -if (!defined('CALENDAR_ROOT')) { - define('CALENDAR_ROOT', 'Calendar'.DIRECTORY_SEPARATOR); -} - -/* - * Constant which defines the calculation engine to use - */ -if (!defined('CALENDAR_ENGINE')) { - define('CALENDAR_ENGINE', 'UnixTS'); -} - -/* - * Define Calendar Month states - */ -define('CALENDAR_USE_MONTH', 1); -define('CALENDAR_USE_MONTH_WEEKDAYS', 2); -define('CALENDAR_USE_MONTH_WEEKS', 3); - -/** - * Contains a factory method to return a Singleton instance of a class - * implementing the Calendar_Engine_Interface.
- * Note: this class must be modified to "register" alternative - * Calendar_Engines. The engine used can be controlled with the constant - * CALENDAR_ENGINE - * - * @see Calendar_Engine_Interface - */ -class Calendar_Engine_Factory -{ - /** - * Returns an instance of the engine - * - * @return object instance of a calendar calculation engine - */ - public static function &getEngine() - { - static $engine = false; - switch (CALENDAR_ENGINE) { - case 'PearDate': - $class = 'Calendar_Engine_PearDate'; - break; - case 'UnixTS': - default: - $class = 'Calendar_Engine_UnixTS'; - break; - } - if (!$engine) { - if (!class_exists($class)) { - require_once CALENDAR_ROOT.'Engine'.DIRECTORY_SEPARATOR.CALENDAR_ENGINE.'.php'; - } - $engine = new $class(); - } - - return $engine; - } -} - -/** - * Base class for Calendar API. This class should not be instantiated - * directly. - * - * @abstract - */ -class Calendar -{ - /** - * Instance of class implementing calendar engine interface - * - * @var object - */ - public $cE; - - /** - * Instance of Calendar_Validator (lazy initialized when isValid() or - * getValidor() is called - * - * @var Calendar_Validator - */ - public $validator; - - /** - * Year for this calendar object e.g. 2003 - * - * @var int - */ - public $year; - - /** - * Month for this calendar object e.g. 9 - * - * @var int - */ - public $month; - - /** - * Day of month for this calendar object e.g. 23 - * - * @var int - */ - public $day; - - /** - * Hour of day for this calendar object e.g. 13 - * - * @var int - */ - public $hour; - - /** - * Minute of hour this calendar object e.g. 46 - * - * @var int - */ - public $minute; - - /** - * Second of minute this calendar object e.g. 34 - * - * @var int - */ - public $second; - - /** - * Marks this calendar object as selected (e.g. 'today') - * - * @var bool - */ - public $selected = false; - - /** - * Collection of child calendar objects created from subclasses - * of Calendar. Type depends on the object which created them. - * - * @var array - */ - public $children = []; - - /** - * Constructs the Calendar - * - * @param int year - * @param int month - * @param int day - * @param int hour - * @param int minute - * @param int second - */ - public function __construct($y = 2000, $m = 1, $d = 1, $h = 0, $i = 0, $s = 0) - { - static $cE = null; - if (!isset($cE)) { - $cE = &Calendar_Engine_Factory::getEngine(); - } - $this->cE = &$cE; - $this->year = (int) $y; - $this->month = (int) $m; - $this->day = (int) $d; - $this->hour = (int) $h; - $this->minute = (int) $i; - $this->second = (int) $s; - } - - /** - * Defines the calendar by a timestamp (Unix or ISO-8601), replacing values - * passed to the constructor - * - * @param int|string Unix or ISO-8601 timestamp - * - * @return void - */ - public function setTimestamp($ts) - { - $this->year = $this->cE->stampToYear($ts); - $this->month = $this->cE->stampToMonth($ts); - $this->day = $this->cE->stampToDay($ts); - $this->hour = $this->cE->stampToHour($ts); - $this->minute = $this->cE->stampToMinute($ts); - $this->second = $this->cE->stampToSecond($ts); - } - - /** - * Returns a timestamp from the current date / time values. Format of - * timestamp depends on Calendar_Engine implementation being used - * - * @return int|string timestamp - */ - public function getTimestamp() - { - return $this->cE->dateToStamp( - $this->year, $this->month, $this->day, - $this->hour, $this->minute, $this->second); - } - - /** - * Defines calendar object as selected (e.g. for today) - * - * @param bool state whether Calendar subclass - * - * @return void - */ - public function setSelected($state = true) - { - $this->selected = $state; - } - - /** - * True if the calendar subclass object is selected (e.g. today) - * - * @return bool - */ - public function isSelected() - { - return $this->selected; - } - - /** - * Adjusts the date (helper method) - * - * @return void - */ - public function adjust() - { - $stamp = $this->getTimeStamp(); - $this->year = $this->cE->stampToYear($stamp); - $this->month = $this->cE->stampToMonth($stamp); - $this->day = $this->cE->stampToDay($stamp); - $this->hour = $this->cE->stampToHour($stamp); - $this->minute = $this->cE->stampToMinute($stamp); - $this->second = $this->cE->stampToSecond($stamp); - } - - /** - * Returns the date as an associative array (helper method) - * - * @param mixed timestamp (leave empty for current timestamp) - * - * @return array - */ - public function toArray($stamp = null) - { - if (is_null($stamp)) { - $stamp = $this->getTimeStamp(); - } - - return [ - 'year' => $this->cE->stampToYear($stamp), - 'month' => $this->cE->stampToMonth($stamp), - 'day' => $this->cE->stampToDay($stamp), - 'hour' => $this->cE->stampToHour($stamp), - 'minute' => $this->cE->stampToMinute($stamp), - 'second' => $this->cE->stampToSecond($stamp), - ]; - } - - /** - * Returns the value as an associative array (helper method) - * - * @param string type of date object that return value represents - * @param string $format ['int' | 'array' | 'timestamp' | 'object'] - * @param mixed timestamp (depending on Calendar engine being used) - * @param int integer default value (i.e. give me the answer quick) - * - * @return mixed - */ - public function returnValue($returnType, $format, $stamp, $default) - { - switch (strtolower($format)) { - case 'int': - return $default; - case 'array': - return $this->toArray($stamp); - break; - case 'object': - require_once CALENDAR_ROOT.'Factory.php'; - - return Calendar_Factory::createByTimestamp($returnType, $stamp); - break; - case 'timestamp': - default: - return $stamp; - break; - } - } - - /** - * Abstract method for building the children of a calendar object. - * Implemented by Calendar subclasses - * - * @param array containing Calendar objects to select (optional) - * - * @return bool - * @abstract - */ - public function build($sDates = []) - { - require_once 'PEAR.php'; - PEAR::raiseError( - 'Calendar::build is abstract', null, PEAR_ERROR_TRIGGER, - E_USER_NOTICE, 'Calendar::build()'); - - return false; - } - - /** - * Abstract method for selected data objects called from build - * - * @param array - * - * @return bool - * @abstract - */ - public function setSelection($sDates) - { - require_once 'PEAR.php'; - PEAR::raiseError( - 'Calendar::setSelection is abstract', null, PEAR_ERROR_TRIGGER, - E_USER_NOTICE, 'Calendar::setSelection()'); - - return false; - } - - /** - * Iterator method for fetching child Calendar subclass objects - * (e.g. a minute from an hour object). On reaching the end of - * the collection, returns false and resets the collection for - * further iteratations. - * - * @return mixed either an object subclass of Calendar or false - */ - public function fetch() - { - $child = current($this->children); - next($this->children); - if ($child) { - return $child; - } else { - reset($this->children); - - return false; - } - } - - /** - * Fetches all child from the current collection of children - * - * @return array - */ - public function fetchAll() - { - return $this->children; - } - - /** - * Get the number Calendar subclass objects stored in the internal - * collection. - * - * @return int - */ - public function size() - { - return count($this->children); - } - - /** - * Determine whether this date is valid, with the bounds determined by - * the Calendar_Engine. The call is passed on to - * Calendar_Validator::isValid - * - * @return bool - */ - public function isValid() - { - $validator = &$this->getValidator(); - - return $validator->isValid(); - } - - /** - * Returns an instance of Calendar_Validator - * - * @return Calendar_Validator - */ - public function &getValidator() - { - if (!isset($this->validator)) { - require_once CALENDAR_ROOT.'Validator.php'; - $this->validator = new Calendar_Validator($this); - } - - return $this->validator; - } - - /** - * Returns a reference to the current Calendar_Engine being used. Useful - * for Calendar_Table_Helper and Calendar_Validator - * - * @return object implementing Calendar_Engine_Inteface - */ - public function &getEngine() - { - return $this->cE; - } - - /** - * Set the CALENDAR_FIRST_DAY_OF_WEEK constant to the $firstDay value - * if the constant is not set yet. - * - * @throws E_USER_WARNING this method throws a WARNING if the - * CALENDAR_FIRST_DAY_OF_WEEK constant is already defined and - * the $firstDay parameter is set to a different value - * - * @param int $firstDay first day of the week (0=sunday, 1=monday, ...) - * - * @return int - */ - public function defineFirstDayOfWeek($firstDay = null) - { - if (defined('CALENDAR_FIRST_DAY_OF_WEEK')) { - if (!is_null($firstDay) && ($firstDay != CALENDAR_FIRST_DAY_OF_WEEK)) { - $msg = 'CALENDAR_FIRST_DAY_OF_WEEK constant already defined.' - .' The $firstDay parameter will be ignored.'; - trigger_error($msg, E_USER_WARNING); - } - - return CALENDAR_FIRST_DAY_OF_WEEK; - } - if (is_null($firstDay)) { - $firstDay = $this->cE->getFirstDayOfWeek( - $this->thisYear(), - $this->thisMonth(), - $this->thisDay() - ); - } - define('CALENDAR_FIRST_DAY_OF_WEEK', $firstDay); - - return CALENDAR_FIRST_DAY_OF_WEEK; - } - - /** - * Returns the value for the previous year - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 2002 or timestamp - */ - public function prevYear($format = 'int') - { - $ts = $this->cE->dateToStamp($this->year - 1, 1, 1, 0, 0, 0); - - return $this->returnValue('Year', $format, $ts, $this->year - 1); - } - - /** - * Returns the value for this year - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 2003 or timestamp - */ - public function thisYear($format = 'int') - { - $ts = $this->cE->dateToStamp($this->year, 1, 1, 0, 0, 0); - - return $this->returnValue('Year', $format, $ts, $this->year); - } - - /** - * Returns the value for next year - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 2004 or timestamp - */ - public function nextYear($format = 'int') - { - $ts = $this->cE->dateToStamp($this->year + 1, 1, 1, 0, 0, 0); - - return $this->returnValue('Year', $format, $ts, $this->year + 1); - } - - /** - * Returns the value for the previous month - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 4 or Unix timestamp - */ - public function prevMonth($format = 'int') - { - $ts = $this->cE->dateToStamp($this->year, $this->month - 1, 1, 0, 0, 0); - - return $this->returnValue('Month', $format, $ts, $this->cE->stampToMonth($ts)); - } - - /** - * Returns the value for this month - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 5 or timestamp - */ - public function thisMonth($format = 'int') - { - $ts = $this->cE->dateToStamp($this->year, $this->month, 1, 0, 0, 0); - - return $this->returnValue('Month', $format, $ts, $this->month); - } - - /** - * Returns the value for next month - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 6 or timestamp - */ - public function nextMonth($format = 'int') - { - $ts = $this->cE->dateToStamp($this->year, $this->month + 1, 1, 0, 0, 0); - - return $this->returnValue('Month', $format, $ts, $this->cE->stampToMonth($ts)); - } - - /** - * Returns the value for the previous day - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 10 or timestamp - */ - public function prevDay($format = 'int') - { - $ts = $this->cE->dateToStamp( - $this->year, $this->month, $this->day - 1, 0, 0, 0); - - return $this->returnValue('Day', $format, $ts, $this->cE->stampToDay($ts)); - } - - /** - * Returns the value for this day - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 11 or timestamp - */ - public function thisDay($format = 'int') - { - $ts = $this->cE->dateToStamp( - $this->year, $this->month, $this->day, 0, 0, 0); - - return $this->returnValue('Day', $format, $ts, $this->day); - } - - /** - * Returns the value for the next day - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 12 or timestamp - */ - public function nextDay($format = 'int') - { - $ts = $this->cE->dateToStamp( - $this->year, $this->month, $this->day + 1, 0, 0, 0); - - return $this->returnValue('Day', $format, $ts, $this->cE->stampToDay($ts)); - } - - /** - * Returns the value for the previous hour - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 13 or timestamp - */ - public function prevHour($format = 'int') - { - $ts = $this->cE->dateToStamp( - $this->year, $this->month, $this->day, $this->hour - 1, 0, 0); - - return $this->returnValue('Hour', $format, $ts, $this->cE->stampToHour($ts)); - } - - /** - * Returns the value for this hour - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 14 or timestamp - */ - public function thisHour($format = 'int') - { - $ts = $this->cE->dateToStamp( - $this->year, $this->month, $this->day, $this->hour, 0, 0); - - return $this->returnValue('Hour', $format, $ts, $this->hour); - } - - /** - * Returns the value for the next hour - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 14 or timestamp - */ - public function nextHour($format = 'int') - { - $ts = $this->cE->dateToStamp( - $this->year, $this->month, $this->day, $this->hour + 1, 0, 0); - - return $this->returnValue('Hour', $format, $ts, $this->cE->stampToHour($ts)); - } - - /** - * Returns the value for the previous minute - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 23 or timestamp - */ - public function prevMinute($format = 'int') - { - $ts = $this->cE->dateToStamp( - $this->year, $this->month, $this->day, - $this->hour, $this->minute - 1, 0); - - return $this->returnValue('Minute', $format, $ts, $this->cE->stampToMinute($ts)); - } - - /** - * Returns the value for this minute - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 24 or timestamp - */ - public function thisMinute($format = 'int') - { - $ts = $this->cE->dateToStamp( - $this->year, $this->month, $this->day, - $this->hour, $this->minute, 0); - - return $this->returnValue('Minute', $format, $ts, $this->minute); - } - - /** - * Returns the value for the next minute - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 25 or timestamp - */ - public function nextMinute($format = 'int') - { - $ts = $this->cE->dateToStamp( - $this->year, $this->month, $this->day, - $this->hour, $this->minute + 1, 0); - - return $this->returnValue('Minute', $format, $ts, $this->cE->stampToMinute($ts)); - } - - /** - * Returns the value for the previous second - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 43 or timestamp - */ - public function prevSecond($format = 'int') - { - $ts = $this->cE->dateToStamp( - $this->year, $this->month, $this->day, - $this->hour, $this->minute, $this->second - 1); - - return $this->returnValue('Second', $format, $ts, $this->cE->stampToSecond($ts)); - } - - /** - * Returns the value for this second - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 44 or timestamp - */ - public function thisSecond($format = 'int') - { - $ts = $this->cE->dateToStamp( - $this->year, $this->month, $this->day, - $this->hour, $this->minute, $this->second); - - return $this->returnValue('Second', $format, $ts, $this->second); - } - - /** - * Returns the value for the next second - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 45 or timestamp - */ - public function nextSecond($format = 'int') - { - $ts = $this->cE->dateToStamp( - $this->year, $this->month, $this->day, - $this->hour, $this->minute, $this->second + 1); - - return $this->returnValue('Second', $format, $ts, $this->cE->stampToSecond($ts)); - } -} diff --git a/data/module/Calendar/Day.php b/data/module/Calendar/Day.php deleted file mode 100644 index 909edd6e7b..0000000000 --- a/data/module/Calendar/Day.php +++ /dev/null @@ -1,199 +0,0 @@ - | -// +----------------------------------------------------------------------+ -// -// $Id: Day.php,v 1.1 2004/05/24 22:25:42 quipo Exp $ -// -/* - * @package Calendar - * @version $Id$ - */ - -/* - * Allows Calendar include path to be redefined - * @ignore - */ -if (!defined('CALENDAR_ROOT')) { - define('CALENDAR_ROOT', 'Calendar'.DIRECTORY_SEPARATOR); -} - -/** - * Load Calendar base class - */ -require_once CALENDAR_ROOT.'Calendar.php'; - -/** - * Represents a Day and builds Hours. - * - * require_once 'Calendar'.DIRECTORY_SEPARATOR.'Day.php'; - * $Day = & new Calendar_Day(2003, 10, 21); // Oct 21st 2003 - * while ($Hour = & $Day->fetch()) { - * echo $Hour->thisHour().'
'; - * } - *
- */ -class Calendar_Day extends Calendar -{ - /** - * Marks the Day at the beginning of a week - * - * @var bool - */ - public $first = false; - - /** - * Marks the Day at the end of a week - * - * @var bool - */ - public $last = false; - - /** - * Used for tabular calendars - * - * @var bool - */ - public $empty = false; - - /** - * Constructs Calendar_Day - * - * @param int year e.g. 2003 - * @param int month e.g. 8 - * @param int day e.g. 15 - */ - public function __construct($y, $m, $d) - { - parent::__construct($y, $m, $d); - } - - /** - * Builds the Hours of the Day - * - * @param array (optional) Caledar_Hour objects representing selected dates - * - * @return bool - */ - public function build($sDates = []) - { - require_once CALENDAR_ROOT.'Hour.php'; - - $hID = $this->cE->getHoursInDay($this->year, $this->month, $this->day); - for ($i = 0; $i < $hID; $i++) { - $this->children[$i] = - new Calendar_Hour($this->year, $this->month, $this->day, $i); - } - if (count($sDates) > 0) { - $this->setSelection($sDates); - } - - return true; - } - - /** - * Called from build() - * - * @param array - * - * @return void - */ - public function setSelection($sDates) - { - foreach ($sDates as $sDate) { - if ($this->year == $sDate->thisYear() - && $this->month == $sDate->thisMonth() - && $this->day == $sDate->thisDay()) { - $key = (int) $sDate->thisHour(); - if (isset($this->children[$key])) { - $sDate->setSelected(); - $this->children[$key] = $sDate; - } - } - } - } - - /** - * Defines Day object as first in a week - * Only used by Calendar_Month_Weekdays::build() - * - * @param bool state - * - * @return void - */ - public function setFirst($state = true) - { - $this->first = $state; - } - - /** - * Defines Day object as last in a week - * Used only following Calendar_Month_Weekdays::build() - * - * @param bool state - * - * @return void - */ - public function setLast($state = true) - { - $this->last = $state; - } - - /** - * Returns true if Day object is first in a Week - * Only relevant when Day is created by Calendar_Month_Weekdays::build() - * - * @return bool - */ - public function isFirst() - { - return $this->first; - } - - /** - * Returns true if Day object is last in a Week - * Only relevant when Day is created by Calendar_Month_Weekdays::build() - * - * @return bool - */ - public function isLast() - { - return $this->last; - } - - /** - * Defines Day object as empty - * Only used by Calendar_Month_Weekdays::build() - * - * @param bool state - * - * @return void - */ - public function setEmpty($state = true) - { - $this->empty = $state; - } - - /** - * @return bool - */ - public function isEmpty() - { - return $this->empty; - } -} diff --git a/data/module/Calendar/Decorator.php b/data/module/Calendar/Decorator.php deleted file mode 100644 index a826e85c43..0000000000 --- a/data/module/Calendar/Decorator.php +++ /dev/null @@ -1,598 +0,0 @@ - | -// +----------------------------------------------------------------------+ -// -// $Id: Decorator.php,v 1.3 2005/10/22 10:29:46 quipo Exp $ -// -/** - * @version $Id$ - */ -/** - * Decorates any calendar class. - * Create a subclass of this class for your own "decoration". - * Used for "selections" - * - * class DayDecorator extends Calendar_Decorator - * { - * function thisDay($format = 'int') - * { -.* $day = parent::thisDay('timestamp'); -.* return date('D', $day); - * } - * } - * $Day = & new Calendar_Day(2003, 10, 25); - * $DayDecorator = & new DayDecorator($Day); - * echo $DayDecorator->thisDay(); // Outputs "Sat" - * - * - * @abstract - */ -class Calendar_Decorator -{ - /** - * Subclass of Calendar being decorated - * - * @var object - */ - public $calendar; - - /** - * Constructs the Calendar_Decorator - * - * @param object subclass to Calendar to decorate - */ - public function __construct(&$calendar) - { - $this->calendar = &$calendar; - } - - /** - * Defines the calendar by a Unix timestamp, replacing values - * passed to the constructor - * - * @param int Unix timestamp - * - * @return void - */ - public function setTimestamp($ts) - { - $this->calendar->setTimestamp($ts); - } - - /** - * Returns a timestamp from the current date / time values. Format of - * timestamp depends on Calendar_Engine implementation being used - * - * @return int timestamp - */ - public function getTimestamp() - { - return $this->calendar->getTimeStamp(); - } - - /** - * Defines calendar object as selected (e.g. for today) - * - * @param bool state whether Calendar subclass - * - * @return void - */ - public function setSelected($state = true) - { - $this->calendar->setSelected($state = true); - } - - /** - * True if the calendar subclass object is selected (e.g. today) - * - * @return bool - */ - public function isSelected() - { - return $this->calendar->isSelected(); - } - - /** - * Adjusts the date (helper method) - * - * @return void - */ - public function adjust() - { - $this->calendar->adjust(); - } - - /** - * Returns the date as an associative array (helper method) - * - * @param mixed timestamp (leave empty for current timestamp) - * - * @return array - */ - public function toArray($stamp = null) - { - return $this->calendar->toArray($stamp); - } - - /** - * Returns the value as an associative array (helper method) - * - * @param string type of date object that return value represents - * @param string $format ['int' | 'array' | 'timestamp' | 'object'] - * @param mixed timestamp (depending on Calendar engine being used) - * @param int integer default value (i.e. give me the answer quick) - * - * @return mixed - */ - public function returnValue($returnType, $format, $stamp, $default) - { - return $this->calendar->returnValue($returnType, $format, $stamp, $default); - } - - /** - * Defines Day object as first in a week - * Only used by Calendar_Month_Weekdays::build() - * - * @param bool state - * - * @return void - */ - public function setFirst($state = true) - { - if (method_exists($this->calendar, 'setFirst')) { - $this->calendar->setFirst($state); - } - } - - /** - * Defines Day object as last in a week - * Used only following Calendar_Month_Weekdays::build() - * - * @param bool state - * - * @return void - */ - public function setLast($state = true) - { - if (method_exists($this->calendar, 'setLast')) { - $this->calendar->setLast($state); - } - } - - /** - * Returns true if Day object is first in a Week - * Only relevant when Day is created by Calendar_Month_Weekdays::build() - * - * @return bool - */ - public function isFirst() - { - if (method_exists($this->calendar, 'isFirst')) { - return $this->calendar->isFirst(); - } - - return false; - } - - /** - * Returns true if Day object is last in a Week - * Only relevant when Day is created by Calendar_Month_Weekdays::build() - * - * @return bool - */ - public function isLast() - { - if (method_exists($this->calendar, 'isLast')) { - return $this->calendar->isLast(); - } - - return false; - } - - /** - * Defines Day object as empty - * Only used by Calendar_Month_Weekdays::build() - * - * @param bool state - * - * @return void - */ - public function setEmpty($state = true) - { - if (method_exists($this->calendar, 'setEmpty')) { - $this->calendar->setEmpty($state); - } - } - - /** - * @return bool - */ - public function isEmpty() - { - if (method_exists($this->calendar, 'isEmpty')) { - return $this->calendar->isEmpty(); - } - - return false; - } - - /** - * Build the children - * - * @param array containing Calendar objects to select (optional) - * - * @return bool - * @abstract - */ - public function build($sDates = []) - { - return $this->calendar->build($sDates); - } - - /** - * Iterator method for fetching child Calendar subclass objects - * (e.g. a minute from an hour object). On reaching the end of - * the collection, returns false and resets the collection for - * further iteratations. - * - * @return mixed either an object subclass of Calendar or false - */ - public function fetch($decorator = null) - { - return $this->calendar->fetch(); - } - - /** - * Fetches all child from the current collection of children - * - * @return array - */ - public function fetchAll($decorator = null) - { - return $this->calendar->fetchAll(); - } - - /** - * Get the number Calendar subclass objects stored in the internal - * collection. - * - * @return int - */ - public function size() - { - return $this->calendar->size(); - } - - /** - * Determine whether this date is valid, with the bounds determined by - * the Calendar_Engine. The call is passed on to - * Calendar_Validator::isValid - * - * @return bool - */ - public function isValid() - { - return $this->calendar->isValid(); - } - - /** - * Returns an instance of Calendar_Validator - * - * @return Calendar_Validator - */ - public function &getValidator() - { - $validator = $this->calendar->getValidator(); - - return $validator; - } - - /** - * Returns a reference to the current Calendar_Engine being used. Useful - * for Calendar_Table_Helper and Calendar_Validator - * - * @return object implementing Calendar_Engine_Inteface - */ - public function &getEngine() - { - return $this->calendar->getEngine(); - } - - /** - * Returns the value for the previous year - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 2002 or timestamp - */ - public function prevYear($format = 'int') - { - return $this->calendar->prevYear($format); - } - - /** - * Returns the value for this year - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 2003 or timestamp - */ - public function thisYear($format = 'int') - { - return $this->calendar->thisYear($format); - } - - /** - * Returns the value for next year - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 2004 or timestamp - */ - public function nextYear($format = 'int') - { - return $this->calendar->nextYear($format); - } - - /** - * Returns the value for the previous month - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 4 or Unix timestamp - */ - public function prevMonth($format = 'int') - { - return $this->calendar->prevMonth($format); - } - - /** - * Returns the value for this month - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 5 or timestamp - */ - public function thisMonth($format = 'int') - { - return $this->calendar->thisMonth($format); - } - - /** - * Returns the value for next month - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 6 or timestamp - */ - public function nextMonth($format = 'int') - { - return $this->calendar->nextMonth($format); - } - - /** - * Returns the value for the previous week - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 4 or Unix timestamp - */ - public function prevWeek($format = 'n_in_month') - { - if (method_exists($this->calendar, 'prevWeek')) { - return $this->calendar->prevWeek($format); - } else { - require_once 'PEAR.php'; - PEAR::raiseError( - 'Cannot call prevWeek on Calendar object of type: '. - get_class($this->calendar), 133, PEAR_ERROR_TRIGGER, - E_USER_NOTICE, 'Calendar_Decorator::prevWeek()'); - - return false; - } - } - - /** - * Returns the value for this week - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 5 or timestamp - */ - public function thisWeek($format = 'n_in_month') - { - if (method_exists($this->calendar, 'thisWeek')) { - return $this->calendar->thisWeek($format); - } else { - require_once 'PEAR.php'; - PEAR::raiseError( - 'Cannot call thisWeek on Calendar object of type: '. - get_class($this->calendar), 133, PEAR_ERROR_TRIGGER, - E_USER_NOTICE, 'Calendar_Decorator::thisWeek()'); - - return false; - } - } - - /** - * Returns the value for next week - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 6 or timestamp - */ - public function nextWeek($format = 'n_in_month') - { - if (method_exists($this->calendar, 'nextWeek')) { - return $this->calendar->nextWeek($format); - } else { - require_once 'PEAR.php'; - PEAR::raiseError( - 'Cannot call thisWeek on Calendar object of type: '. - get_class($this->calendar), 133, PEAR_ERROR_TRIGGER, - E_USER_NOTICE, 'Calendar_Decorator::nextWeek()'); - - return false; - } - } - - /** - * Returns the value for the previous day - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 10 or timestamp - */ - public function prevDay($format = 'int') - { - return $this->calendar->prevDay($format); - } - - /** - * Returns the value for this day - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 11 or timestamp - */ - public function thisDay($format = 'int') - { - return $this->calendar->thisDay($format); - } - - /** - * Returns the value for the next day - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 12 or timestamp - */ - public function nextDay($format = 'int') - { - return $this->calendar->nextDay($format); - } - - /** - * Returns the value for the previous hour - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 13 or timestamp - */ - public function prevHour($format = 'int') - { - return $this->calendar->prevHour($format); - } - - /** - * Returns the value for this hour - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 14 or timestamp - */ - public function thisHour($format = 'int') - { - return $this->calendar->thisHour($format); - } - - /** - * Returns the value for the next hour - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 14 or timestamp - */ - public function nextHour($format = 'int') - { - return $this->calendar->nextHour($format); - } - - /** - * Returns the value for the previous minute - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 23 or timestamp - */ - public function prevMinute($format = 'int') - { - return $this->calendar->prevMinute($format); - } - - /** - * Returns the value for this minute - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 24 or timestamp - */ - public function thisMinute($format = 'int') - { - return $this->calendar->thisMinute($format); - } - - /** - * Returns the value for the next minute - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 25 or timestamp - */ - public function nextMinute($format = 'int') - { - return $this->calendar->nextMinute($format); - } - - /** - * Returns the value for the previous second - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 43 or timestamp - */ - public function prevSecond($format = 'int') - { - return $this->calendar->prevSecond($format); - } - - /** - * Returns the value for this second - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 44 or timestamp - */ - public function thisSecond($format = 'int') - { - return $this->calendar->thisSecond($format); - } - - /** - * Returns the value for the next second - * - * @param string return value format ['int' | 'timestamp' | 'object' | 'array'] - * - * @return int e.g. 45 or timestamp - */ - public function nextSecond($format = 'int') - { - return $this->calendar->nextSecond($format); - } -} diff --git a/data/module/Calendar/Decorator/Textual.php b/data/module/Calendar/Decorator/Textual.php deleted file mode 100644 index 1fffc79b0d..0000000000 --- a/data/module/Calendar/Decorator/Textual.php +++ /dev/null @@ -1,176 +0,0 @@ - | -// | Lorenzo Alberton | -// +----------------------------------------------------------------------+ -// -// $Id: Textual.php,v 1.3 2004/08/16 13:02:44 hfuecks Exp $ -// -/* - * @package Calendar - * @version $Id$ - */ - -/* - * Allows Calendar include path to be redefined - * @ignore - */ -if (!defined('CALENDAR_ROOT')) { - define('CALENDAR_ROOT', 'Calendar'.DIRECTORY_SEPARATOR); -} - -/** - * Load Calendar decorator base class - */ -require_once CALENDAR_ROOT.'Decorator.php'; - -/** - * Load the Uri utility - */ -require_once CALENDAR_ROOT.'Util'.DIRECTORY_SEPARATOR.'Textual.php'; - -/** - * Decorator to help with fetching textual representations of months and - * days of the week. - * Note: for performance you should prefer Calendar_Util_Textual unless you - * have a specific need to use a decorator - */ -class Calendar_Decorator_Textual extends Calendar_Decorator -{ - /** - * Constructs Calendar_Decorator_Textual - * - * @param object subclass of Calendar - */ - public function __construct(&$Calendar) - { - parent::__construct($Calendar); - } - - /** - * Returns an array of 12 month names (first index = 1) - * - * @param string (optional) format of returned months (one,two,short or long) - * - * @return array - * @static - */ - public function monthNames($format = 'long') - { - return Calendar_Util_Textual::monthNames($format); - } - - /** - * Returns an array of 7 week day names (first index = 0) - * - * @param string (optional) format of returned days (one,two,short or long) - * - * @return array - * @static - */ - public function weekdayNames($format = 'long') - { - return Calendar_Util_Textual::weekdayNames($format); - } - - /** - * Returns textual representation of the previous month of the decorated calendar object - * - * @param string (optional) format of returned months (one,two,short or long) - * - * @return string - */ - public function prevMonthName($format = 'long') - { - return Calendar_Util_Textual::prevMonthName($this->calendar, $format); - } - - /** - * Returns textual representation of the month of the decorated calendar object - * - * @param string (optional) format of returned months (one,two,short or long) - * - * @return string - */ - public function thisMonthName($format = 'long') - { - return Calendar_Util_Textual::thisMonthName($this->calendar, $format); - } - - /** - * Returns textual representation of the next month of the decorated calendar object - * - * @param string (optional) format of returned months (one,two,short or long) - * - * @return string - */ - public function nextMonthName($format = 'long') - { - return Calendar_Util_Textual::nextMonthName($this->calendar, $format); - } - - /** - * Returns textual representation of the previous day of week of the decorated calendar object - * - * @param string (optional) format of returned months (one,two,short or long) - * - * @return string - */ - public function prevDayName($format = 'long') - { - return Calendar_Util_Textual::prevDayName($this->calendar, $format); - } - - /** - * Returns textual representation of the day of week of the decorated calendar object - * - * @param string (optional) format of returned months (one,two,short or long) - * - * @return string - */ - public function thisDayName($format = 'long') - { - return Calendar_Util_Textual::thisDayName($this->calendar, $format); - } - - /** - * Returns textual representation of the next day of week of the decorated calendar object - * - * @param string (optional) format of returned months (one,two,short or long) - * - * @return string - */ - public function nextDayName($format = 'long') - { - return Calendar_Util_Textual::nextDayName($this->calendar, $format); - } - - /** - * Returns the days of the week using the order defined in the decorated - * calendar object. Only useful for Calendar_Month_Weekdays, Calendar_Month_Weeks - * and Calendar_Week. Otherwise the returned array will begin on Sunday - * - * @param string (optional) format of returned months (one,two,short or long) - * - * @return array ordered array of week day names - */ - public function orderedWeekdays($format = 'long') - { - return Calendar_Util_Textual::orderedWeekdays($this->calendar, $format); - } -} diff --git a/data/module/Calendar/Decorator/Uri.php b/data/module/Calendar/Decorator/Uri.php deleted file mode 100644 index 0fd7a6b54f..0000000000 --- a/data/module/Calendar/Decorator/Uri.php +++ /dev/null @@ -1,154 +0,0 @@ - | -// | Lorenzo Alberton | -// +----------------------------------------------------------------------+ -// -// $Id: Uri.php,v 1.3 2004/08/16 09:04:20 hfuecks Exp $ -// -/* - * @package Calendar - * @version $Id$ - */ - -/* - * Allows Calendar include path to be redefined - * @ignore - */ -if (!defined('CALENDAR_ROOT')) { - define('CALENDAR_ROOT', 'Calendar'.DIRECTORY_SEPARATOR); -} - -/** - * Load Calendar decorator base class - */ -require_once CALENDAR_ROOT.'Decorator.php'; - -/** - * Load the Uri utility - */ -require_once CALENDAR_ROOT.'Util'.DIRECTORY_SEPARATOR.'Uri.php'; - -/** - * Decorator to help with building HTML links for navigating the calendar
- * Note: for performance you should prefer Calendar_Util_Uri unless you - * have a specific need to use a decorator - * - * $Day = new Calendar_Day(2003, 10, 23); - * $Uri = & new Calendar_Decorator_Uri($Day); - * $Uri->setFragments('year', 'month', 'day'); - * echo $Uri->getPrev(); // Displays year=2003&month=10&day=22 - * - * - * @see Calendar_Util_Uri - */ -class Calendar_Decorator_Uri extends Calendar_Decorator -{ - /** - * @var Calendar_Util_Uri - */ - public $Uri; - - /** - * Constructs Calendar_Decorator_Uri - * - * @param object subclass of Calendar - */ - public function __construct(&$Calendar) - { - parent::__construct($Calendar); - } - - /** - * Sets the URI fragment names - * - * @param string URI fragment for year - * @param string (optional) URI fragment for month - * @param string (optional) URI fragment for day - * @param string (optional) URI fragment for hour - * @param string (optional) URI fragment for minute - * @param string (optional) URI fragment for second - * - * @return void - */ - public function setFragments($y, $m = null, $d = null, $h = null, $i = null, $s = null) - { - $this->Uri = new Calendar_Util_Uri($y, $m, $d, $h, $i, $s); - } - - /** - * Sets the separator string between fragments - * - * @param string separator e.g. / - * - * @return void - */ - public function setSeparator($separator) - { - $this->Uri->separator = $separator; - } - - /** - * Puts Uri decorator into "scalar mode" - URI variable names are not - * returned - * - * @param bool (optional) - * - * @return void - */ - public function setScalar($state = true) - { - $this->Uri->scalar = $state; - } - - /** - * Gets the URI string for the previous calendar unit - * - * @param string calendar unit to fetch uri for (year,month,week or day etc) - * - * @return string - */ - public function prev($method) - { - return $this->Uri->prev($this, $method); - } - - /** - * Gets the URI string for the current calendar unit - * - * @param string calendar unit to fetch uri for (year,month,week or day etc) - * - * @return string - */ - public function this($method) - { - return $this->Uri->this($this, $method); - } - - /** - * Gets the URI string for the next calendar unit - * - * @param string calendar unit to fetch uri for (year,month,week or day etc) - * - * @return string - */ - public function next($method) - { - return $this->Uri->next($this, $method); - } -} diff --git a/data/module/Calendar/Decorator/Weekday.php b/data/module/Calendar/Decorator/Weekday.php deleted file mode 100644 index 9506b5fdbe..0000000000 --- a/data/module/Calendar/Decorator/Weekday.php +++ /dev/null @@ -1,156 +0,0 @@ - | -// | Lorenzo Alberton | -// +----------------------------------------------------------------------+ -// -// $Id: Weekday.php,v 1.3 2004/08/16 12:25:15 hfuecks Exp $ -// -/* - * @package Calendar - * @version $Id$ - */ - -/* - * Allows Calendar include path to be redefined - * @ignore - */ -if (!defined('CALENDAR_ROOT')) { - define('CALENDAR_ROOT', 'Calendar'.DIRECTORY_SEPARATOR); -} - -/** - * Load Calendar decorator base class - */ -require_once CALENDAR_ROOT.'Decorator.php'; - -/** - * Load a Calendar_Day - */ -require_once CALENDAR_ROOT.'Day.php'; -/** - * Decorator for fetching the day of the week - * - * $Day = new Calendar_Day(2003, 10, 23); - * $Weekday = & new Calendar_Decorator_Weekday($Day); - * $Weekday->setFirstDay(0); // Set first day of week to Sunday (default Mon) - * echo $Weekday->thisWeekDay(); // Displays 5 - fifth day of week relative to Sun - * - */ -class Calendar_Decorator_Weekday extends Calendar_Decorator -{ - /** - * First day of week - * - * @var int (default = 1 for Monday) - */ - public $firstDay = 1; - - /** - * Constructs Calendar_Decorator_Weekday - * - * @param object subclass of Calendar - */ - public function __construct(&$Calendar) - { - parent::__construct($Calendar); - } - - /** - * Sets the first day of the week (0 = Sunday, 1 = Monday (default) etc) - * - * @param int first day of week - * - * @return void - */ - public function setFirstDay($firstDay) - { - $this->firstDay = (int) $firstDay; - } - - /** - * Returns the previous weekday - * - * @param string (default = 'int') return value format - * - * @return int numeric day of week or timestamp - */ - public function prevWeekDay($format = 'int') - { - $ts = $this->calendar->prevDay('timestamp'); - $Day = new Calendar_Day(2000, 1, 1); - $Day->setTimeStamp($ts); - $day = $this->calendar->cE->getDayOfWeek($Day->thisYear(), $Day->thisMonth(), $Day->thisDay()); - $day = $this->adjustWeekScale($day); - - return $this->returnValue('Day', $format, $ts, $day); - } - - /** - * Returns the current weekday - * - * @param string (default = 'int') return value format - * - * @return int numeric day of week or timestamp - */ - public function thisWeekDay($format = 'int') - { - $ts = $this->calendar->thisDay('timestamp'); - $day = $this->calendar->cE->getDayOfWeek($this->calendar->year, $this->calendar->month, $this->calendar->day); - $day = $this->adjustWeekScale($day); - - return $this->returnValue('Day', $format, $ts, $day); - } - - /** - * Returns the next weekday - * - * @param string (default = 'int') return value format - * - * @return int numeric day of week or timestamp - */ - public function nextWeekDay($format = 'int') - { - $ts = $this->calendar->nextDay('timestamp'); - $Day = new Calendar_Day(2000, 1, 1); - $Day->setTimeStamp($ts); - $day = $this->calendar->cE->getDayOfWeek($Day->thisYear(), $Day->thisMonth(), $Day->thisDay()); - $day = $this->adjustWeekScale($day); - - return $this->returnValue('Day', $format, $ts, $day); - } - - /** - * Adjusts the day of the week relative to the first day of the week - * - * @param int day of week calendar from Calendar_Engine - * - * @return int day of week adjusted to first day - */ - public function adjustWeekScale($dayOfWeek) - { - $dayOfWeek = $dayOfWeek - $this->firstDay; - if ($dayOfWeek >= 0) { - return $dayOfWeek; - } else { - return $this->calendar->cE->getDaysInWeek( - $this->calendar->year, $this->calendar->month, $this->calendar->day - ) + $dayOfWeek; - } - } -} diff --git a/data/module/Calendar/Decorator/Wrapper.php b/data/module/Calendar/Decorator/Wrapper.php deleted file mode 100644 index ba6c816775..0000000000 --- a/data/module/Calendar/Decorator/Wrapper.php +++ /dev/null @@ -1,92 +0,0 @@ - | -// | Lorenzo Alberton | -// +----------------------------------------------------------------------+ -// -// $Id: Wrapper.php,v 1.2 2005/11/03 20:35:03 quipo Exp $ -// -/* - * @package Calendar - * @version $Id$ - */ - -/* - * Allows Calendar include path to be redefined - * @ignore - */ -if (!defined('CALENDAR_ROOT')) { - define('CALENDAR_ROOT', 'Calendar'.DIRECTORY_SEPARATOR); -} - -/** - * Load Calendar decorator base class - */ -require_once CALENDAR_ROOT.'Decorator.php'; - -/** - * Decorator to help with wrapping built children in another decorator - */ -class Calendar_Decorator_Wrapper extends Calendar_Decorator -{ - /** - * Constructs Calendar_Decorator_Wrapper - * - * @param object subclass of Calendar - */ - public function __construct(&$Calendar) - { - parent::__construct($Calendar); - } - - /** - * Wraps objects returned from fetch in the named Decorator class - * - * @param string name of Decorator class to wrap with - * - * @return object instance of named decorator - */ - public function &fetch($decorator = null) - { - $Calendar = parent::fetch(); - if ($Calendar) { - $ret = new $decorator($Calendar); - } else { - $ret = false; - } - - return $ret; - } - - /** - * Wraps the returned calendar objects from fetchAll in the named decorator - * - * @param string name of Decorator class to wrap with - * - * @return array - */ - public function fetchAll($decorator = null) - { - $children = parent::fetchAll(); - foreach ($children as $key => $Calendar) { - $children[$key] = new $decorator($Calendar); - } - - return $children; - } -} diff --git a/data/module/Calendar/Engine/Interface.php b/data/module/Calendar/Engine/Interface.php deleted file mode 100644 index 7e0e19582f..0000000000 --- a/data/module/Calendar/Engine/Interface.php +++ /dev/null @@ -1,335 +0,0 @@ - | -// +----------------------------------------------------------------------+ -// -// $Id: Interface.php,v 1.5 2004/08/16 12:29:18 hfuecks Exp $ -// -/** - * @version $Id$ - */ -/** - * The methods the classes implementing the Calendar_Engine must implement. - * Note this class is not used but simply to help development - */ -class Calendar_Engine_Interface -{ - /** - * Provides a mechansim to make sure parsing of timestamps - * into human dates is only performed once per timestamp. - * Typically called "internally" by methods like stampToYear. - * Return value can vary, depending on the specific implementation - * - * @param int timestamp (depending on implementation) - * - * @return mixed - */ - public function stampCollection($stamp) - { - return 0; - } - - /** - * Returns a numeric year given a timestamp - * - * @param int timestamp (depending on implementation) - * - * @return int year (e.g. 2003) - */ - public function stampToYear($stamp) - { - return 0; - } - - /** - * Returns a numeric month given a timestamp - * - * @param int timestamp (depending on implementation) - * - * @return int month (e.g. 9) - */ - public function stampToMonth($stamp) - { - return 0; - } - - /** - * Returns a numeric day given a timestamp - * - * @param int timestamp (depending on implementation) - * - * @return int day (e.g. 15) - */ - public function stampToDay($stamp) - { - return 0; - } - - /** - * Returns a numeric hour given a timestamp - * - * @param int timestamp (depending on implementation) - * - * @return int hour (e.g. 13) - */ - public function stampToHour($stamp) - { - return 0; - } - - /** - * Returns a numeric minute given a timestamp - * - * @param int timestamp (depending on implementation) - * - * @return int minute (e.g. 34) - */ - public function stampToMinute($stamp) - { - return 0; - } - - /** - * Returns a numeric second given a timestamp - * - * @param int timestamp (depending on implementation) - * - * @return int second (e.g. 51) - */ - public function stampToSecond($stamp) - { - return 0; - } - - /** - * Returns a timestamp. Can be worth "caching" generated - * timestamps in a static variable, identified by the - * params this method accepts, to timestamp will only - * be calculated once. - * - * @param int year (e.g. 2003) - * @param int month (e.g. 9) - * @param int day (e.g. 13) - * @param int hour (e.g. 13) - * @param int minute (e.g. 34) - * @param int second (e.g. 53) - * - * @return int (depends on implementation) - */ - public function dateToStamp($y, $m, $d, $h, $i, $s) - { - return 0; - } - - /** - * The upper limit on years that the Calendar Engine can work with - * - * @return int (e.g. 2037) - */ - public function getMaxYears() - { - return 0; - } - - /** - * The lower limit on years that the Calendar Engine can work with - * - * @return int (e.g 1902) - */ - public function getMinYears() - { - return 0; - } - - /** - * Returns the number of months in a year - * - * @param int (optional) year to get months for - * - * @return int (e.g. 12) - */ - public function getMonthsInYear($y = null) - { - return 0; - } - - /** - * Returns the number of days in a month, given year and month - * - * @param int year (e.g. 2003) - * @param int month (e.g. 9) - * - * @return int days in month - */ - public function getDaysInMonth($y, $m) - { - return 0; - } - - /** - * Returns numeric representation of the day of the week in a month, - * given year and month - * - * @param int year (e.g. 2003) - * @param int month (e.g. 9) - * - * @return int - */ - public function getFirstDayInMonth($y, $m) - { - return 0; - } - - /** - * Returns the number of days in a week - * - * @param int year (2003) - * @param int month (9) - * @param int day (4) - * - * @return int (e.g. 7) - */ - public function getDaysInWeek($y = null, $m = null, $d = null) - { - return 0; - } - - /** - * Returns the number of the week in the year (ISO-8601), given a date - * - * @param int year (2003) - * @param int month (9) - * @param int day (4) - * - * @return int week number - */ - public function getWeekNInYear($y, $m, $d) - { - return 0; - } - - /** - * Returns the number of the week in the month, given a date - * - * @param int year (2003) - * @param int month (9) - * @param int day (4) - * @param int first day of the week (default: 1 - monday) - * - * @return int week number - */ - public function getWeekNInMonth($y, $m, $d, $firstDay = 1) - { - return 0; - } - - /** - * Returns the number of weeks in the month - * - * @param int year (2003) - * @param int month (9) - * @param int first day of the week (default: 1 - monday) - * - * @return int weeks number - */ - public function getWeeksInMonth($y, $m) - { - return 0; - } - - /** - * Returns the number of the day of the week (0=sunday, 1=monday...) - * - * @param int year (2003) - * @param int month (9) - * @param int day (4) - * - * @return int weekday number - */ - public function getDayOfWeek($y, $m, $d) - { - return 0; - } - - /** - * Returns the numeric values of the days of the week. - * - * @param int year (2003) - * @param int month (9) - * @param int day (4) - * - * @return array list of numeric values of days in week, beginning 0 - */ - public function getWeekDays($y = null, $m = null, $d = null) - { - return 0; - } - - /** - * Returns the default first day of the week as an integer. Must be a - * member of the array returned from getWeekDays - * - * @param int year (2003) - * @param int month (9) - * @param int day (4) - * - * @return int (e.g. 1 for Monday) - * - * @see getWeekDays - */ - public function getFirstDayOfWeek($y = null, $m = null, $d = null) - { - return 0; - } - - /** - * Returns the number of hours in a day
- * - * @param int (optional) day to get hours for - * - * @return int (e.g. 24) - */ - public function getHoursInDay($y = null, $m = null, $d = null) - { - return 0; - } - - /** - * Returns the number of minutes in an hour - * - * @param int (optional) hour to get minutes for - * - * @return int - */ - public function getMinutesInHour($y = null, $m = null, $d = null, $h = null) - { - return 0; - } - - /** - * Returns the number of seconds in a minutes - * - * @param int (optional) minute to get seconds for - * - * @return int - */ - public function getSecondsInMinute($y = null, $m = null, $d = null, $h = null, $i = null) - { - return 0; - } -} diff --git a/data/module/Calendar/Engine/PearDate.php b/data/module/Calendar/Engine/PearDate.php deleted file mode 100644 index d9d8357d4e..0000000000 --- a/data/module/Calendar/Engine/PearDate.php +++ /dev/null @@ -1,435 +0,0 @@ - | -// +----------------------------------------------------------------------+ -// -// $Id: PearDate.php,v 1.8 2004/08/20 20:00:55 quipo Exp $ -// -/** - * @version $Id$ - * - * @deprecated 本体で使用されていないため非推奨 - */ -/** - * Load PEAR::Date class - */ -// require_once 'Date.php'; - -/** - * Performs calendar calculations based on the PEAR::Date class - * Timestamps are in the ISO-8601 format (YYYY-MM-DD HH:MM:SS) - */ -class Calendar_Engine_PearDate /* implements Calendar_Engine_Interface */ -{ - /** - * Makes sure a given timestamp is only ever parsed once - * Uses a static variable to prevent date() being used twice - * for a date which is already known - * - * @param mixed Any timestamp format recognized by Pear::Date - * - * @return object Pear::Date object - */ - public function stampCollection($stamp) - { - static $stamps = []; - if (!isset($stamps[$stamp])) { - $stamps[$stamp] = new Date($stamp); - } - - return $stamps[$stamp]; - } - - /** - * Returns a numeric year given a iso-8601 datetime - * - * @param string iso-8601 datetime (YYYY-MM-DD HH:MM:SS) - * - * @return int year (e.g. 2003) - */ - public function stampToYear($stamp) - { - $date = self::stampCollection($stamp); - - return (int) $date->year; - } - - /** - * Returns a numeric month given a iso-8601 datetime - * - * @param string iso-8601 datetime (YYYY-MM-DD HH:MM:SS) - * - * @return int month (e.g. 9) - */ - public function stampToMonth($stamp) - { - $date = self::stampCollection($stamp); - - return (int) $date->month; - } - - /** - * Returns a numeric day given a iso-8601 datetime - * - * @param string iso-8601 datetime (YYYY-MM-DD HH:MM:SS) - * - * @return int day (e.g. 15) - */ - public function stampToDay($stamp) - { - $date = self::stampCollection($stamp); - - return (int) $date->day; - } - - /** - * Returns a numeric hour given a iso-8601 datetime - * - * @param string iso-8601 datetime (YYYY-MM-DD HH:MM:SS) - * - * @return int hour (e.g. 13) - */ - public function stampToHour($stamp) - { - $date = self::stampCollection($stamp); - - return (int) $date->hour; - } - - /** - * Returns a numeric minute given a iso-8601 datetime - * - * @param string iso-8601 datetime (YYYY-MM-DD HH:MM:SS) - * - * @return int minute (e.g. 34) - */ - public function stampToMinute($stamp) - { - $date = self::stampCollection($stamp); - - return (int) $date->minute; - } - - /** - * Returns a numeric second given a iso-8601 datetime - * - * @param string iso-8601 datetime (YYYY-MM-DD HH:MM:SS) - * - * @return int second (e.g. 51) - */ - public function stampToSecond($stamp) - { - $date = self::stampCollection($stamp); - - return (int) $date->second; - } - - /** - * Returns a iso-8601 datetime - * - * @param int year (2003) - * @param int month (9) - * @param int day (13) - * @param int hour (13) - * @param int minute (34) - * @param int second (53) - * - * @return string iso-8601 datetime - */ - public function dateToStamp($y, $m, $d, $h = 0, $i = 0, $s = 0) - { - $r = []; - self::adjustDate($y, $m, $d, $h, $i, $s); - $key = $y.$m.$d.$h.$i.$s; - if (!isset($r[$key])) { - $r[$key] = sprintf('%04d-%02d-%02d %02d:%02d:%02d', - $y, $m, $d, $h, $i, $s); - } - - return $r[$key]; - } - - /** - * Set the correct date values (useful for math operations on dates) - * - * @param int year (2003) - * @param int month (9) - * @param int day (13) - * @param int hour (13) - * @param int minute (34) - * @param int second (53) - */ - public function adjustDate(&$y, &$m, &$d, &$h, &$i, &$s) - { - if ($s < 0) { - $m -= floor($s / 60); - $s = -$s % 60; - } - if ($s > 60) { - $m += floor($s / 60); - $s %= 60; - } - if ($i < 0) { - $h -= floor($i / 60); - $i = -$i % 60; - } - if ($i > 60) { - $h += floor($i / 60); - $i %= 60; - } - if ($h < 0) { - $d -= floor($h / 24); - $h = -$h % 24; - } - if ($h > 24) { - $d += floor($h / 24); - $h %= 24; - } - for (; $m < 1; $y--, $m += 12) { - } - for (; $m > 12; $y++, $m -= 12) { - } - - while ($d < 1) { - if ($m > 1) { - $m--; - } else { - $m = 12; - $y--; - } - $d += Date_Calc::daysInMonth($m, $y); - } - for ($max_days = Date_Calc::daysInMonth($m, $y); $d > $max_days;) { - $d -= $max_days; - if ($m < 12) { - $m++; - } else { - $m = 1; - $y++; - } - } - } - - /** - * The upper limit on years that the Calendar Engine can work with - * - * @return int 9999 - */ - public function getMaxYears() - { - return 9999; - } - - /** - * The lower limit on years that the Calendar Engine can work with - * - * @return int 0 - */ - public function getMinYears() - { - return 0; - } - - /** - * Returns the number of months in a year - * - * @return int (12) - */ - public function getMonthsInYear($y = null) - { - return 12; - } - - /** - * Returns the number of days in a month, given year and month - * - * @param int year (2003) - * @param int month (9) - * - * @return int days in month - */ - public function getDaysInMonth($y, $m) - { - return (int) Date_Calc::daysInMonth($m, $y); - } - - /** - * Returns numeric representation of the day of the week in a month, - * given year and month - * - * @param int year (2003) - * @param int month (9) - * - * @return int from 0 to 7 - */ - public function getFirstDayInMonth($y, $m) - { - return (int) Date_Calc::dayOfWeek(1, $m, $y); - } - - /** - * Returns the number of days in a week - * - * @param int year (2003) - * @param int month (9) - * @param int day (4) - * - * @return int (7) - */ - public function getDaysInWeek($y = null, $m = null, $d = null) - { - return 7; - } - - /** - * Returns the number of the week in the year (ISO-8601), given a date - * - * @param int year (2003) - * @param int month (9) - * @param int day (4) - * - * @return int week number - */ - public function getWeekNInYear($y, $m, $d) - { - return Date_Calc::weekOfYear($d, $m, $y); // beware, Date_Calc doesn't follow ISO-8601 standard! - } - - /** - * Returns the number of the week in the month, given a date - * - * @param int year (2003) - * @param int month (9) - * @param int day (4) - * @param int first day of the week (default: monday) - * - * @return int week number - */ - public function getWeekNInMonth($y, $m, $d, $firstDay = 1) - { - $weekEnd = ($firstDay == 0) ? $this->getDaysInWeek() - 1 : $firstDay - 1; - $end_of_week = (int) Date_Calc::nextDayOfWeek($weekEnd, 1, $m, $y, '%e', true); - $w = 1; - while ($d > $end_of_week) { - ++$w; - $end_of_week += $this->getDaysInWeek(); - } - - return $w; - } - - /** - * Returns the number of weeks in the month - * - * @param int year (2003) - * @param int month (9) - * @param int first day of the week (default: monday) - * - * @return int weeks number - */ - public function getWeeksInMonth($y, $m, $firstDay = 1) - { - $FDOM = Date_Calc::firstOfMonthWeekday($m, $y); - if ($FDOM == 0) { - $FDOM = $this->getDaysInWeek(); - } - if ($FDOM > $firstDay) { - $daysInTheFirstWeek = $this->getDaysInWeek() - $FDOM + $firstDay; - $weeks = 1; - } else { - $daysInTheFirstWeek = $firstDay - $FDOM; - $weeks = 0; - } - $daysInTheFirstWeek %= $this->getDaysInWeek(); - - return (int) (ceil(($this->getDaysInMonth($y, $m) - $daysInTheFirstWeek) / - $this->getDaysInWeek()) + $weeks); - } - - /** - * Returns the number of the day of the week (0=sunday, 1=monday...) - * - * @param int year (2003) - * @param int month (9) - * @param int day (4) - * - * @return int weekday number - */ - public function getDayOfWeek($y, $m, $d) - { - return Date_Calc::dayOfWeek($d, $m, $y); - } - - /** - * Returns a list of integer days of the week beginning 0 - * - * @param int year (2003) - * @param int month (9) - * @param int day (4) - * - * @return array (0, 1, 2, 3, 4, 5, 6) 1 = Monday - */ - public function getWeekDays($y = null, $m = null, $d = null) - { - return [0, 1, 2, 3, 4, 5, 6]; - } - - /** - * Returns the default first day of the week - * - * @param int year (2003) - * @param int month (9) - * @param int day (4) - * - * @return int (default 1 = Monday) - */ - public function getFirstDayOfWeek($y = null, $m = null, $d = null) - { - return 1; - } - - /** - * Returns the number of hours in a day - * - * @return int (24) - */ - public function getHoursInDay($y = null, $m = null, $d = null) - { - return 24; - } - - /** - * Returns the number of minutes in an hour - * - * @return int (60) - */ - public function getMinutesInHour($y = null, $m = null, $d = null, $h = null) - { - return 60; - } - - /** - * Returns the number of seconds in a minutes - * - * @return int (60) - */ - public function getSecondsInMinute($y = null, $m = null, $d = null, $h = null, $i = null) - { - return 60; - } -} diff --git a/data/module/Calendar/Engine/UnixTS.php b/data/module/Calendar/Engine/UnixTS.php deleted file mode 100644 index a85a5fd19e..0000000000 --- a/data/module/Calendar/Engine/UnixTS.php +++ /dev/null @@ -1,393 +0,0 @@ - | -// +----------------------------------------------------------------------+ -// -// $Id: UnixTS.php,v 1.9 2004/08/20 20:00:55 quipo Exp $ -// -/** - * @version $Id$ - */ -/** - * Performs calendar calculations based on the PHP date() function and - * Unix timestamps (using PHP's mktime() function). - */ -class Calendar_Engine_UnixTS /* implements Calendar_Engine_Interface */ -{ - /** - * Makes sure a given timestamp is only ever parsed once - *
-     * array (
-     *  [0] => year (e.g 2003),
-     *  [1] => month (e.g 9),
-     *  [2] => day (e.g 6),
-     *  [3] => hour (e.g 14),
-     *  [4] => minute (e.g 34),
-     *  [5] => second (e.g 45),
-     *  [6] => num days in month (e.g. 31),
-     *  [7] => week in year (e.g. 50),
-     *  [8] => day in week (e.g. 0 for Sunday)
-     * )
-     * 
- * Uses a static variable to prevent date() being used twice - * for a date which is already known - * - * @param int Unix timestamp - * - * @return array - */ - public function stampCollection($stamp) - { - static $stamps = []; - if (!isset($stamps[$stamp])) { - $date = @date('Y n j H i s t W w', $stamp); - $stamps[$stamp] = sscanf($date, '%d %d %d %d %d %d %d %d %d'); - } - - return $stamps[$stamp]; - } - - /** - * Returns a numeric year given a timestamp - * - * @param int Unix timestamp - * - * @return int year (e.g. 2003) - */ - public function stampToYear($stamp) - { - $date = self::stampCollection($stamp); - - return (int) $date[0]; - } - - /** - * Returns a numeric month given a timestamp - * - * @param int Unix timestamp - * - * @return int month (e.g. 9) - */ - public function stampToMonth($stamp) - { - $date = self::stampCollection($stamp); - - return (int) $date[1]; - } - - /** - * Returns a numeric day given a timestamp - * - * @param int Unix timestamp - * - * @return int day (e.g. 15) - */ - public function stampToDay($stamp) - { - $date = self::stampCollection($stamp); - - return (int) $date[2]; - } - - /** - * Returns a numeric hour given a timestamp - * - * @param int Unix timestamp - * - * @return int hour (e.g. 13) - */ - public function stampToHour($stamp) - { - $date = self::stampCollection($stamp); - - return (int) $date[3]; - } - - /** - * Returns a numeric minute given a timestamp - * - * @param int Unix timestamp - * - * @return int minute (e.g. 34) - */ - public function stampToMinute($stamp) - { - $date = self::stampCollection($stamp); - - return (int) $date[4]; - } - - /** - * Returns a numeric second given a timestamp - * - * @param int Unix timestamp - * - * @return int second (e.g. 51) - */ - public function stampToSecond($stamp) - { - $date = self::stampCollection($stamp); - - return (int) $date[5]; - } - - /** - * Returns a timestamp - * - * @param int year (2003) - * @param int month (9) - * @param int day (13) - * @param int hour (13) - * @param int minute (34) - * @param int second (53) - * - * @return int Unix timestamp - */ - public function dateToStamp($y, $m, $d, $h = 0, $i = 0, $s = 0) - { - static $dates = []; - if (!isset($dates[$y][$m][$d][$h][$i][$s])) { - $dates[$y][$m][$d][$h][$i][$s] = @mktime($h, $i, $s, $m, $d, $y); - } - - return $dates[$y][$m][$d][$h][$i][$s]; - } - - /** - * The upper limit on years that the Calendar Engine can work with - * - * @return int (2037) - */ - public function getMaxYears() - { - return 2037; - } - - /** - * The lower limit on years that the Calendar Engine can work with - * - * @return int (1970 if it's Windows and 1902 for all other OSs) - */ - public function getMinYears() - { - return $min = strpos(PHP_OS, 'WIN') === false ? 1902 : 1970; - } - - /** - * Returns the number of months in a year - * - * @return int (12) - */ - public function getMonthsInYear($y = null) - { - return 12; - } - - /** - * Returns the number of days in a month, given year and month - * - * @param int year (2003) - * @param int month (9) - * - * @return int days in month - */ - public function getDaysInMonth($y, $m) - { - $stamp = self::dateToStamp($y, $m, 1); - $date = self::stampCollection($stamp); - - return $date[6]; - } - - /** - * Returns numeric representation of the day of the week in a month, - * given year and month - * - * @param int year (2003) - * @param int month (9) - * - * @return int from 0 to 6 - */ - public function getFirstDayInMonth($y, $m) - { - $stamp = self::dateToStamp($y, $m, 1); - $date = self::stampCollection($stamp); - - return $date[8]; - } - - /** - * Returns the number of days in a week - * - * @param int year (2003) - * @param int month (9) - * @param int day (4) - * - * @return int (7) - */ - public function getDaysInWeek($y = null, $m = null, $d = null) - { - return 7; - } - - /** - * Returns the number of the week in the year (ISO-8601), given a date - * - * @param int year (2003) - * @param int month (9) - * @param int day (4) - * - * @return int week number - */ - public function getWeekNInYear($y, $m, $d) - { - $stamp = self::dateToStamp($y, $m, $d); - $date = self::stampCollection($stamp); - - return $date[7]; - } - - /** - * Returns the number of the week in the month, given a date - * - * @param int year (2003) - * @param int month (9) - * @param int day (4) - * @param int first day of the week (default: monday) - * - * @return int week number - */ - public function getWeekNInMonth($y, $m, $d, $firstDay = 1) - { - $weekEnd = ($firstDay == 0) ? $this->getDaysInWeek() - 1 : $firstDay - 1; - $end_of_week = 1; - while (@date('w', @mktime(0, 0, 0, $m, $end_of_week, $y)) != $weekEnd) { - ++$end_of_week; // find first weekend of the month - } - $w = 1; - while ($d > $end_of_week) { - ++$w; - $end_of_week += $this->getDaysInWeek(); - } - - return $w; - } - - /** - * Returns the number of weeks in the month - * - * @param int year (2003) - * @param int month (9) - * @param int first day of the week (default: monday) - * - * @return int weeks number - */ - public function getWeeksInMonth($y, $m, $firstDay = 1) - { - $FDOM = $this->getFirstDayInMonth($y, $m); - if ($FDOM == 0) { - $FDOM = $this->getDaysInWeek(); - } - if ($FDOM > $firstDay) { - $daysInTheFirstWeek = $this->getDaysInWeek() - $FDOM + $firstDay; - $weeks = 1; - } else { - $daysInTheFirstWeek = $firstDay - $FDOM; - $weeks = 0; - } - $daysInTheFirstWeek %= $this->getDaysInWeek(); - - return (int) (ceil(($this->getDaysInMonth($y, $m) - $daysInTheFirstWeek) / - $this->getDaysInWeek()) + $weeks); - } - - /** - * Returns the number of the day of the week (0=sunday, 1=monday...) - * - * @param int year (2003) - * @param int month (9) - * @param int day (4) - * - * @return int weekday number - */ - public function getDayOfWeek($y, $m, $d) - { - $stamp = self::dateToStamp($y, $m, $d); - $date = self::stampCollection($stamp); - - return $date[8]; - } - - /** - * Returns a list of integer days of the week beginning 0 - * - * @param int year (2003) - * @param int month (9) - * @param int day (4) - * - * @return array (0,1,2,3,4,5,6) 1 = Monday - */ - public function getWeekDays($y = null, $m = null, $d = null) - { - return [0, 1, 2, 3, 4, 5, 6]; - } - - /** - * Returns the default first day of the week - * - * @param int year (2003) - * @param int month (9) - * @param int day (4) - * - * @return int (default 1 = Monday) - */ - public function getFirstDayOfWeek($y = null, $m = null, $d = null) - { - return 1; - } - - /** - * Returns the number of hours in a day - * - * @return int (24) - */ - public function getHoursInDay($y = null, $m = null, $d = null) - { - return 24; - } - - /** - * Returns the number of minutes in an hour - * - * @return int (60) - */ - public function getMinutesInHour($y = null, $m = null, $d = null, $h = null) - { - return 60; - } - - /** - * Returns the number of seconds in a minutes - * - * @return int (60) - */ - public function getSecondsInMinute($y = null, $m = null, $d = null, $h = null, $i = null) - { - return 60; - } -} diff --git a/data/module/Calendar/Factory.php b/data/module/Calendar/Factory.php deleted file mode 100644 index 0a07635fb5..0000000000 --- a/data/module/Calendar/Factory.php +++ /dev/null @@ -1,155 +0,0 @@ - | -// | Lorenzo Alberton | -// +----------------------------------------------------------------------+ -// -// $Id: Factory.php,v 1.3 2005/10/22 10:08:47 quipo Exp $ -// -/* - * @package Calendar - * @version $Id$ - */ - -/* - * Allows Calendar include path to be redefined - * @ignore - */ -if (!defined('CALENDAR_ROOT')) { - define('CALENDAR_ROOT', 'Calendar'.DIRECTORY_SEPARATOR); -} - -/** - * Load Calendar base class - */ -require_once CALENDAR_ROOT.'Calendar.php'; - -/** - * Contains a factory method to return a Singleton instance of a class - * implementing the Calendar_Engine_Interface.
- * For Month objects, to control type of month returned, use CALENDAR_MONTH_STATE - * constact e.g.; - * - * require_once 'Calendar/Factory.php'; - * define ('CALENDAR_MONTH_STATE',CALENDAR_USE_MONTH_WEEKDAYS); // Use Calendar_Month_Weekdays - * // define ('CALENDAR_MONTH_STATE',CALENDAR_USE_MONTH_WEEKS); // Use Calendar_Month_Weeks - * // define ('CALENDAR_MONTH_STATE',CALENDAR_USE_MONTH); // Use Calendar_Month - * - * It defaults to building Calendar_Month objects.
- * Use the constract CALENDAR_FIRST_DAY_OF_WEEK to control the first day of the week - * for Month or Week objects (e.g. 0 = Sunday, 6 = Saturday) - */ -class Calendar_Factory -{ - /** - * Creates a calendar object given the type and units - * - * @param string class of calendar object to create - * @param int year - * @param int month - * @param int day - * @param int hour - * @param int minute - * @param int second - * - * @return object subclass of Calendar - * @static - */ - public static function create($type, $y = 2000, $m = 1, $d = 1, $h = 0, $i = 0, $s = 0) - { - $firstDay = defined('CALENDAR_FIRST_DAY_OF_WEEK') ? CALENDAR_FIRST_DAY_OF_WEEK : 1; - switch ($type) { - case 'Day': - require_once CALENDAR_ROOT.'Day.php'; - - return new Calendar_Day($y, $m, $d); - case 'Month': - // Set default state for which month type to build - if (!defined('CALENDAR_MONTH_STATE')) { - define('CALENDAR_MONTH_STATE', CALENDAR_USE_MONTH); - } - switch (CALENDAR_MONTH_STATE) { - case CALENDAR_USE_MONTH_WEEKDAYS: - require_once CALENDAR_ROOT.'Month/Weekdays.php'; - $class = 'Calendar_Month_Weekdays'; - break; - case CALENDAR_USE_MONTH_WEEKS: - require_once CALENDAR_ROOT.'Month/Weeks.php'; - $class = 'Calendar_Month_Weeks'; - break; - case CALENDAR_USE_MONTH: - default: - require_once CALENDAR_ROOT.'Month.php'; - $class = 'Calendar_Month'; - break; - } - - return new $class($y, $m, $firstDay); - case 'Week': - require_once CALENDAR_ROOT.'Week.php'; - - return new Calendar_Week($y, $m, $d, $firstDay); - case 'Hour': - require_once CALENDAR_ROOT.'Hour.php'; - - return new Calendar_Hour($y, $m, $d, $h); - case 'Minute': - require_once CALENDAR_ROOT.'Minute.php'; - - return new Calendar_Minute($y, $m, $d, $h, $i); - case 'Second': - require_once CALENDAR_ROOT.'Second.php'; - - return new Calendar_Second($y, $m, $d, $h, $i, $s); - case 'Year': - require_once CALENDAR_ROOT.'Year.php'; - - return new Calendar_Year($y); - default: - require_once 'PEAR.php'; - PEAR::raiseError( - 'Calendar_Factory::create() unrecognised type: '.$type, null, PEAR_ERROR_TRIGGER, - E_USER_NOTICE, 'Calendar_Factory::create()'); - - return false; - } - } - - /** - * Creates an instance of a calendar object, given a type and timestamp - * - * @param string type of object to create - * @param mixed timestamp (depending on Calendar engine being used) - * - * @return object subclass of Calendar - * @static - */ - public static function &createByTimestamp($type, $stamp) - { - $cE = &Calendar_Engine_Factory::getEngine(); - $y = $cE->stampToYear($stamp); - $m = $cE->stampToMonth($stamp); - $d = $cE->stampToDay($stamp); - $h = $cE->stampToHour($stamp); - $i = $cE->stampToMinute($stamp); - $s = $cE->stampToSecond($stamp); - $cal = self::create($type, $y, $m, $d, $h, $i, $s); - - return $cal; - } -} diff --git a/data/module/Calendar/Hour.php b/data/module/Calendar/Hour.php deleted file mode 100644 index 09e01918ae..0000000000 --- a/data/module/Calendar/Hour.php +++ /dev/null @@ -1,113 +0,0 @@ - | -// +----------------------------------------------------------------------+ -// -// $Id: Hour.php,v 1.1 2004/05/24 22:25:42 quipo Exp $ -// -/* - * @package Calendar - * @version $Id$ - */ - -/* - * Allows Calendar include path to be redefined - * @ignore - */ -if (!defined('CALENDAR_ROOT')) { - define('CALENDAR_ROOT', 'Calendar'.DIRECTORY_SEPARATOR); -} - -/** - * Load Calendar base class - */ -require_once CALENDAR_ROOT.'Calendar.php'; - -/** - * Represents an Hour and builds Minutes - * - * require_once 'Calendar'.DIRECTORY_SEPARATOR.'Hour.php'; - * $Hour = & new Calendar_Hour(2003, 10, 21, 15); // Oct 21st 2003, 3pm - * $Hour->build(); // Build Calendar_Minute objects - * while ($Minute = & $Hour->fetch()) { - * echo $Minute->thisMinute().'
'; - * } - *
- */ -class Calendar_Hour extends Calendar -{ - /** - * Constructs Calendar_Hour - * - * @param int year e.g. 2003 - * @param int month e.g. 5 - * @param int day e.g. 11 - * @param int hour e.g. 13 - */ - public function __construct($y, $m, $d, $h) - { - parent::__construct($y, $m, $d, $h); - } - - /** - * Builds the Minutes in the Hour - * - * @param array (optional) Calendar_Minute objects representing selected dates - * - * @return bool - */ - public function build($sDates = []) - { - require_once CALENDAR_ROOT.'Minute.php'; - $mIH = $this->cE->getMinutesInHour($this->year, $this->month, $this->day, - $this->hour); - for ($i = 0; $i < $mIH; $i++) { - $this->children[$i] = - new Calendar_Minute($this->year, $this->month, $this->day, - $this->hour, $i); - } - if (count($sDates) > 0) { - $this->setSelection($sDates); - } - - return true; - } - - /** - * Called from build() - * - * @param array - * - * @return void - */ - public function setSelection($sDates) - { - foreach ($sDates as $sDate) { - if ($this->year == $sDate->thisYear() - && $this->month == $sDate->thisMonth() - && $this->day == $sDate->thisDay() - && $this->hour == $sDate->thisHour()) { - $key = (int) $sDate->thisMinute(); - if (isset($this->children[$key])) { - $sDate->setSelected(); - $this->children[$key] = $sDate; - } - } - } - } -} diff --git a/data/module/Calendar/Minute.php b/data/module/Calendar/Minute.php deleted file mode 100644 index a02f046843..0000000000 --- a/data/module/Calendar/Minute.php +++ /dev/null @@ -1,114 +0,0 @@ - | -// +----------------------------------------------------------------------+ -// -// $Id: Minute.php,v 1.1 2004/05/24 22:25:42 quipo Exp $ -// -/* - * @package Calendar - * @version $Id$ - */ - -/* - * Allows Calendar include path to be redefined - * @ignore - */ -if (!defined('CALENDAR_ROOT')) { - define('CALENDAR_ROOT', 'Calendar'.DIRECTORY_SEPARATOR); -} - -/** - * Load Calendar base class - */ -require_once CALENDAR_ROOT.'Calendar.php'; - -/** - * Represents a Minute and builds Seconds - * - * require_once 'Calendar'.DIRECTORY_SEPARATOR.'Minute.php'; - * $Minute = & new Calendar_Minute(2003, 10, 21, 15, 31); // Oct 21st 2003, 3:31pm - * $Minute->build(); // Build Calendar_Second objects - * while ($Second = & $Minute->fetch()) { - * echo $Second->thisSecond().'
'; - * } - *
- */ -class Calendar_Minute extends Calendar -{ - /** - * Constructs Minute - * - * @param int year e.g. 2003 - * @param int month e.g. 5 - * @param int day e.g. 11 - * @param int hour e.g. 13 - * @param int minute e.g. 31 - */ - public function __construct($y, $m, $d, $h, $i) - { - parent::__construct($y, $m, $d, $h, $i); - } - - /** - * Builds the Calendar_Second objects - * - * @param array (optional) Calendar_Second objects representing selected dates - * - * @return bool - */ - public function build($sDates = []) - { - require_once CALENDAR_ROOT.'Second.php'; - $sIM = $this->cE->getSecondsInMinute($this->year, $this->month, - $this->day, $this->hour, $this->minute); - for ($i = 0; $i < $sIM; $i++) { - $this->children[$i] = new Calendar_Second($this->year, $this->month, - $this->day, $this->hour, $this->minute, $i); - } - if (count($sDates) > 0) { - $this->setSelection($sDates); - } - - return true; - } - - /** - * Called from build() - * - * @param array - * - * @return void - */ - public function setSelection($sDates) - { - foreach ($sDates as $sDate) { - if ($this->year == $sDate->thisYear() - && $this->month == $sDate->thisMonth() - && $this->day == $sDate->thisDay() - && $this->hour == $sDate->thisHour() - && $this->minute == $sDate->thisMinute()) { - $key = (int) $sDate->thisSecond(); - if (isset($this->children[$key])) { - $sDate->setSelected(); - $this->children[$key] = $sDate; - } - } - } - } -} diff --git a/data/module/Calendar/Month.php b/data/module/Calendar/Month.php deleted file mode 100644 index 1bcd398d46..0000000000 --- a/data/module/Calendar/Month.php +++ /dev/null @@ -1,118 +0,0 @@ - | -// +----------------------------------------------------------------------+ -// -// $Id: Month.php,v 1.3 2005/10/22 10:10:26 quipo Exp $ -// -/* - * @package Calendar - * @version $Id$ - */ - -/* - * Allows Calendar include path to be redefined - * @ignore - */ -if (!defined('CALENDAR_ROOT')) { - define('CALENDAR_ROOT', 'Calendar'.DIRECTORY_SEPARATOR); -} - -/** - * Load Calendar base class - */ -require_once CALENDAR_ROOT.'Calendar.php'; - -/** - * Represents a Month and builds Days - * - * require_once 'Calendar/Month.php'; - * $Month = & new Calendar_Month(2003, 10); // Oct 2003 - * $Month->build(); // Build Calendar_Day objects - * while ($Day = & $Month->fetch()) { - * echo $Day->thisDay().'
'; - * } - *
- */ -class Calendar_Month extends Calendar -{ - /** @var int */ - public $firstDay; - - /** - * Constructs Calendar_Month - * - * @param int $y year e.g. 2003 - * @param int $m month e.g. 5 - * @param int $firstDay first day of the week [optional] - */ - public function __construct($y, $m, $firstDay = null) - { - parent::__construct($y, $m); - $this->firstDay = $this->defineFirstDayOfWeek($firstDay); - } - - /** - * Builds Day objects for this Month. Creates as many Calendar_Day objects - * as there are days in the month - * - * @param array (optional) Calendar_Day objects representing selected dates - * - * @return bool - */ - public function build($sDates = []) - { - require_once CALENDAR_ROOT.'Day.php'; - $daysInMonth = $this->cE->getDaysInMonth($this->year, $this->month); - for ($i = 1; $i <= $daysInMonth; $i++) { - $this->children[$i] = new Calendar_Day($this->year, $this->month, $i); - } - if (count($sDates) > 0) { - $this->setSelection($sDates); - } - - return true; - } - - /** - * Called from build() - * - * @param array - * - * @return void - */ - public function setSelection($sDates) - { - foreach ($sDates as $sDate) { - if ($this->year == $sDate->thisYear() - && $this->month == $sDate->thisMonth() - ) { - $key = $sDate->thisDay(); - if (isset($this->children[$key])) { - $sDate->setSelected(); - $class = strtolower(get_class($sDate)); - if ($class == 'calendar_day' || $class == 'calendar_decorator') { - $sDate->setFirst($this->children[$key]->isFirst()); - $sDate->setLast($this->children[$key]->isLast()); - } - $this->children[$key] = $sDate; - } - } - } - } -} diff --git a/data/module/Calendar/Month/Weekdays.php b/data/module/Calendar/Month/Weekdays.php deleted file mode 100644 index 98e2d34576..0000000000 --- a/data/module/Calendar/Month/Weekdays.php +++ /dev/null @@ -1,190 +0,0 @@ - | -// +----------------------------------------------------------------------+ -// -// $Id: Weekdays.php,v 1.4 2005/10/22 10:28:49 quipo Exp $ -// -/* - * @package Calendar - * @version $Id$ - */ - -/* - * Allows Calendar include path to be redefined - * @ignore - */ -if (!defined('CALENDAR_ROOT')) { - define('CALENDAR_ROOT', 'Calendar'.DIRECTORY_SEPARATOR); -} - -/** - * Load Calendar base class - */ -require_once CALENDAR_ROOT.'Calendar.php'; - -/** - * Load base month - */ -require_once CALENDAR_ROOT.'Month.php'; - -/** - * Represents a Month and builds Days in tabular form
- * - * require_once 'Calendar/Month/Weekdays.php'; - * $Month = & new Calendar_Month_Weekdays(2003, 10); // Oct 2003 - * $Month->build(); // Build Calendar_Day objects - * while ($Day = & $Month->fetch()) { - * if ($Day->isFirst()) { - * echo ''; - * } - * if ($Day->isEmpty()) { - * echo ' '; - * } else { - * echo ''.$Day->thisDay().''; - * } - * if ($Day->isLast()) { - * echo ''; - * } - * } - * - */ -class Calendar_Month_Weekdays extends Calendar_Month -{ - /** - * Instance of Calendar_Table_Helper - * - * @var Calendar_Table_Helper - */ - public $tableHelper; - - /** - * First day of the week - * - * @var string - */ - public $firstDay; - - /** - * Constructs Calendar_Month_Weekdays - * - * @param int year e.g. 2003 - * @param int month e.g. 5 - * @param int (optional) first day of week (e.g. 0 for Sunday, 2 for Tuesday etc.) - */ - public function __construct($y, $m, $firstDay = null) - { - parent::__construct($y, $m, $firstDay); - } - - /** - * Builds Day objects in tabular form, to allow display of calendar month - * with empty cells if the first day of the week does not fall on the first - * day of the month. - * - * @see Calendar_Day::isEmpty() - * @see Calendar_Day_Base::isFirst() - * @see Calendar_Day_Base::isLast() - * - * @param array (optional) Calendar_Day objects representing selected dates - * - * @return bool - */ - public function build($sDates = []) - { - require_once CALENDAR_ROOT.'Table/Helper.php'; - $this->tableHelper = new Calendar_Table_Helper($this, $this->firstDay); - Calendar_Month::build($sDates); - $this->buildEmptyDaysBefore(); - $this->shiftDays(); - $this->buildEmptyDaysAfter(); - $this->setWeekMarkers(); - - return true; - } - - /** - * Prepends empty days before the real days in the month - * - * @return void - */ - public function buildEmptyDaysBefore() - { - $eBefore = $this->tableHelper->getEmptyDaysBefore(); - for ($i = 0; $i < $eBefore; $i++) { - $stamp = $this->cE->dateToStamp($this->year, $this->month, -$i); - $Day = new Calendar_Day( - $this->cE->stampToYear($stamp), - $this->cE->stampToMonth($stamp), - $this->cE->stampToDay($stamp)); - $Day->setEmpty(); - $Day->adjust(); - array_unshift($this->children, $Day); - } - } - - /** - * Shifts the array of children forward, if necessary - * - * @return void - */ - public function shiftDays() - { - if (isset($this->children[0])) { - array_unshift($this->children, null); - unset($this->children[0]); - } - } - - /** - * Appends empty days after the real days in the month - * - * @return void - */ - public function buildEmptyDaysAfter() - { - $eAfter = $this->tableHelper->getEmptyDaysAfter(); - $sDOM = $this->tableHelper->getNumTableDaysInMonth(); - for ($i = 1; $i <= $sDOM - $eAfter; $i++) { - $Day = new Calendar_Day($this->year, $this->month + 1, $i); - $Day->setEmpty(); - $Day->adjust(); - $this->children[] = $Day; - } - } - - /** - * Sets the "markers" for the beginning and of a of week, in the - * built Calendar_Day children - * - * @return void - */ - public function setWeekMarkers() - { - $dIW = $this->cE->getDaysInWeek( - $this->thisYear(), - $this->thisMonth(), - $this->thisDay() - ); - $sDOM = $this->tableHelper->getNumTableDaysInMonth(); - for ($i = 1; $i <= $sDOM; $i += $dIW) { - $this->children[$i]->setFirst(); - $this->children[$i + ($dIW - 1)]->setLast(); - } - } -} diff --git a/data/module/Calendar/Month/Weeks.php b/data/module/Calendar/Month/Weeks.php deleted file mode 100644 index ded5db1536..0000000000 --- a/data/module/Calendar/Month/Weeks.php +++ /dev/null @@ -1,139 +0,0 @@ - | -// | Lorenzo Alberton | -// +----------------------------------------------------------------------+ -// -// $Id: Weeks.php,v 1.3 2005/10/22 10:28:49 quipo Exp $ -// -/* - * @package Calendar - * @version $Id$ - */ - -/* - * Allows Calendar include path to be redefined - * @ignore - */ -if (!defined('CALENDAR_ROOT')) { - define('CALENDAR_ROOT', 'Calendar'.DIRECTORY_SEPARATOR); -} - -/** - * Load Calendar base class - */ -require_once CALENDAR_ROOT.'Calendar.php'; - -/** - * Load base month - */ -require_once CALENDAR_ROOT.'Month.php'; - -/** - * Represents a Month and builds Weeks - * - * require_once 'Calendar'.DIRECTORY_SEPARATOR.'Month'.DIRECTORY_SEPARATOR.'Weeks.php'; - * $Month = & new Calendar_Month_Weeks(2003, 10); // Oct 2003 - * $Month->build(); // Build Calendar_Day objects - * while ($Week = & $Month->fetch()) { - * echo $Week->thisWeek().'
'; - * } - *
- */ -class Calendar_Month_Weeks extends Calendar_Month -{ - /** - * Instance of Calendar_Table_Helper - * - * @var Calendar_Table_Helper - */ - public $tableHelper; - - /** - * First day of the week - * - * @var string - */ - public $firstDay; - - /** - * Constructs Calendar_Month_Weeks - * - * @param int year e.g. 2003 - * @param int month e.g. 5 - * @param int (optional) first day of week (e.g. 0 for Sunday, 2 for Tuesday etc.) - */ - public function __construct($y, $m, $firstDay = null) - { - parent::__construct($y, $m, $firstDay); - } - - /** - * Builds Calendar_Week objects for the Month. Note that Calendar_Week - * builds Calendar_Day object in tabular form (with Calendar_Day->empty) - * - * @param array (optional) Calendar_Week objects representing selected dates - * - * @return bool - */ - public function build($sDates = []) - { - require_once CALENDAR_ROOT.'Table/Helper.php'; - $this->tableHelper = new Calendar_Table_Helper($this, $this->firstDay); - require_once CALENDAR_ROOT.'Week.php'; - $numWeeks = $this->tableHelper->getNumWeeks(); - for ($i = 1, $d = 1; $i <= $numWeeks; $i++, - $d += $this->cE->getDaysInWeek( - $this->thisYear(), - $this->thisMonth(), - $this->thisDay())) { - $this->children[$i] = new Calendar_Week( - $this->year, $this->month, $d, $this->tableHelper->getFirstDay()); - } - // used to set empty days - $this->children[1]->setFirst(true); - $this->children[$numWeeks]->setLast(true); - - // Handle selected weeks here - if (count($sDates) > 0) { - $this->setSelection($sDates); - } - - return true; - } - - /** - * Called from build() - * - * @param array - * - * @return void - */ - public function setSelection($sDates) - { - foreach ($sDates as $sDate) { - if ($this->year == $sDate->thisYear() - && $this->month == $sDate->thisMonth()) { - $key = $sDate->thisWeek('n_in_month'); - if (isset($this->children[$key])) { - $this->children[$key]->setSelected(); - } - } - } - } -} diff --git a/data/module/Calendar/Second.php b/data/module/Calendar/Second.php deleted file mode 100644 index ae86eb8acf..0000000000 --- a/data/module/Calendar/Second.php +++ /dev/null @@ -1,102 +0,0 @@ - | -// +----------------------------------------------------------------------+ -// -// $Id: Second.php,v 1.1 2004/05/24 22:25:42 quipo Exp $ -// -/* - * @package Calendar - * @version $Id$ - */ - -/* - * Allows Calendar include path to be redefined - * @ignore - */ -if (!defined('CALENDAR_ROOT')) { - define('CALENDAR_ROOT', 'Calendar'.DIRECTORY_SEPARATOR); -} - -/** - * Load Calendar base class - */ -require_once CALENDAR_ROOT.'Calendar.php'; - -/** - * Represents a Second
- * Note: Seconds do not build other objects - * so related methods are overridden to return NULL - */ -class Calendar_Second extends Calendar -{ - /** - * Constructs Second - * - * @param int year e.g. 2003 - * @param int month e.g. 5 - * @param int day e.g. 11 - * @param int hour e.g. 13 - * @param int minute e.g. 31 - * @param int second e.g. 45 - */ - public function __construct($y, $m, $d, $h, $i, $s) - { - parent::__construct($y, $m, $d, $h, $i, $s); - } - - /** - * Overwrite build - * - * @return null - */ - public function build($sDates = []) - { - return null; - } - - /** - * Overwrite fetch - * - * @return null - */ - public function fetch($decorator = null) - { - return null; - } - - /** - * Overwrite fetchAll - * - * @return null - */ - public function fetchAll($decorator = null) - { - return null; - } - - /** - * Overwrite size - * - * @return null - */ - public function size() - { - return null; - } -} diff --git a/data/module/Calendar/Table/Helper.php b/data/module/Calendar/Table/Helper.php deleted file mode 100644 index 68f9c1ba15..0000000000 --- a/data/module/Calendar/Table/Helper.php +++ /dev/null @@ -1,281 +0,0 @@ - | -// +----------------------------------------------------------------------+ -// -// $Id: Helper.php,v 1.5 2005/10/22 09:51:53 quipo Exp $ -// -/** - * @version $Id$ - */ - -/** - * Used by Calendar_Month_Weekdays, Calendar_Month_Weeks and Calendar_Week to - * help with building the calendar in tabular form - */ -class Calendar_Table_Helper -{ - /** - * Instance of the Calendar object being helped. - * - * @var object - */ - public $calendar; - - /** - * Instance of the Calendar_Engine - * - * @var object - */ - public $cE; - - /** - * First day of the week - * - * @var string - */ - public $firstDay; - - /** - * The seven days of the week named - * - * @var array - */ - public $weekDays; - - /** - * Days of the week ordered with $firstDay at the beginning - * - * @var array - */ - public $daysOfWeek = []; - - /** - * Days of the month built from days of the week - * - * @var array - */ - public $daysOfMonth = []; - - /** - * Number of weeks in month - * - * @var int - */ - public $numWeeks = null; - - /** - * Number of emtpy days before real days begin in month - * - * @var int - */ - public $emptyBefore = 0; - - /** - * Constructs Calendar_Table_Helper - * - * @param object Calendar_Month_Weekdays, Calendar_Month_Weeks, Calendar_Week - * @param int (optional) first day of the week e.g. 1 for Monday - */ - public function __construct(&$calendar, $firstDay = null) - { - $this->calendar = &$calendar; - $this->cE = &$calendar->getEngine(); - if (is_null($firstDay)) { - $firstDay = $this->cE->getFirstDayOfWeek( - $this->calendar->thisYear(), - $this->calendar->thisMonth(), - $this->calendar->thisDay() - ); - } - $this->firstDay = $firstDay; - $this->setFirstDay(); - $this->setDaysOfMonth(); - } - - /** - * Constructs $this->daysOfWeek based on $this->firstDay - * - * @return void - */ - public function setFirstDay() - { - $weekDays = $this->cE->getWeekDays( - $this->calendar->thisYear(), - $this->calendar->thisMonth(), - $this->calendar->thisDay() - ); - $endDays = []; - $tmpDays = []; - $begin = false; - foreach ($weekDays as $day) { - if ($begin) { - $endDays[] = $day; - } elseif ($day === $this->firstDay) { - $begin = true; - $endDays[] = $day; - } else { - $tmpDays[] = $day; - } - } - $this->daysOfWeek = array_merge($endDays, $tmpDays); - } - - /** - * Constructs $this->daysOfMonth - * - * @return void - */ - public function setDaysOfMonth() - { - $this->daysOfMonth = $this->daysOfWeek; - $daysInMonth = $this->cE->getDaysInMonth( - $this->calendar->thisYear(), $this->calendar->thisMonth()); - $firstDayInMonth = $this->cE->getFirstDayInMonth( - $this->calendar->thisYear(), $this->calendar->thisMonth()); - $this->emptyBefore = 0; - foreach ($this->daysOfMonth as $dayOfWeek) { - if ($firstDayInMonth == $dayOfWeek) { - break; - } - $this->emptyBefore++; - } - $this->numWeeks = ceil( - ($daysInMonth + $this->emptyBefore) - / - $this->cE->getDaysInWeek( - $this->calendar->thisYear(), - $this->calendar->thisMonth(), - $this->calendar->thisDay() - ) - ); - for ($i = 1; $i < $this->numWeeks; $i++) { - $this->daysOfMonth = - array_merge($this->daysOfMonth, $this->daysOfWeek); - } - } - - /** - * Returns the first day of the month - * - * @see Calendar_Engine_Interface::getFirstDayOfWeek() - * - * @return int - */ - public function getFirstDay() - { - return $this->firstDay; - } - - /** - * Returns the order array of days in a week - * - * @return int - */ - public function getDaysOfWeek() - { - return $this->daysOfWeek; - } - - /** - * Returns the number of tabular weeks in a month - * - * @return int - */ - public function getNumWeeks() - { - return $this->numWeeks; - } - - /** - * Returns the number of real days + empty days - * - * @return int - */ - public function getNumTableDaysInMonth() - { - return count($this->daysOfMonth); - } - - /** - * Returns the number of empty days before the real days begin - * - * @return int - */ - public function getEmptyDaysBefore() - { - return $this->emptyBefore; - } - - /** - * Returns the index of the last real day in the month - * - * @todo Potential performance optimization with static - * - * @return int - */ - public function getEmptyDaysAfter() - { - // Causes bug when displaying more than one month -// static $index; -// if (!isset($index)) { - $index = $this->getEmptyDaysBefore() + $this->cE->getDaysInMonth( - $this->calendar->thisYear(), $this->calendar->thisMonth()); -// } - return $index; - } - - /** - * Returns the index of the last real day in the month, relative to the - * beginning of the tabular week it is part of - * - * @return int - */ - public function getEmptyDaysAfterOffset() - { - $eAfter = $this->getEmptyDaysAfter(); - - return $eAfter - ( - $this->cE->getDaysInWeek( - $this->calendar->thisYear(), - $this->calendar->thisMonth(), - $this->calendar->thisDay() - ) * ($this->numWeeks - 1)); - } - - /** - * Returns the timestamp of the first day of the current week - */ - public function getWeekStart($y, $m, $d, $firstDay = 1) - { - $dow = $this->cE->getDayOfWeek($y, $m, $d); - if ($dow > $firstDay) { - $d -= ($dow - $firstDay); - } - if ($dow < $firstDay) { - $d -= ( - $this->cE->getDaysInWeek( - $this->calendar->thisYear(), - $this->calendar->thisMonth(), - $this->calendar->thisDay() - ) - $firstDay + $dow); - } - - return $this->cE->dateToStamp($y, $m, $d); - } -} diff --git a/data/module/Calendar/Util/Textual.php b/data/module/Calendar/Util/Textual.php deleted file mode 100644 index 1d93aaf009..0000000000 --- a/data/module/Calendar/Util/Textual.php +++ /dev/null @@ -1,254 +0,0 @@ - | -// | Lorenzo Alberton | -// +----------------------------------------------------------------------+ -// -// $Id: Textual.php,v 1.2 2004/08/16 13:13:09 hfuecks Exp $ -// -/* - * @package Calendar - * @version $Id$ - */ - -/* - * Allows Calendar include path to be redefined - * @ignore - */ -if (!defined('CALENDAR_ROOT')) { - define('CALENDAR_ROOT', 'Calendar'.DIRECTORY_SEPARATOR); -} - -/** - * Load Calendar decorator base class - */ -require_once CALENDAR_ROOT.'Decorator.php'; - -/** - * Static utlities to help with fetching textual representations of months and - * days of the week. - */ -class Calendar_Util_Textual -{ - /** - * Returns an array of 12 month names (first index = 1) - * - * @param string (optional) format of returned months (one,two,short or long) - * - * @return array - * @static - */ - public static function monthNames($format = 'long') - { - $formats = ['one' => '%b', 'two' => '%b', 'short' => '%b', 'long' => '%B']; - if (!array_key_exists($format, $formats)) { - $format = 'long'; - } - $months = []; - for ($i = 1; $i <= 12; $i++) { - $stamp = mktime(0, 0, 0, $i, 1, 2003); - $month = strftime($formats[$format], $stamp); - switch ($format) { - case 'one': - $month = substr($month, 0, 1); - break; - case 'two': - $month = substr($month, 0, 2); - break; - } - $months[$i] = $month; - } - - return $months; - } - - /** - * Returns an array of 7 week day names (first index = 0) - * - * @param string (optional) format of returned days (one,two,short or long) - * - * @return array - * @static - */ - public static function weekdayNames($format = 'long') - { - $formats = ['one' => '%a', 'two' => '%a', 'short' => '%a', 'long' => '%A']; - if (!array_key_exists($format, $formats)) { - $format = 'long'; - } - $days = []; - for ($i = 0; $i <= 6; $i++) { - $stamp = mktime(0, 0, 0, 11, $i + 2, 2003); - $day = strftime($formats[$format], $stamp); - switch ($format) { - case 'one': - $day = substr($day, 0, 1); - break; - case 'two': - $day = substr($day, 0, 2); - break; - } - $days[$i] = $day; - } - - return $days; - } - - /** - * Returns textual representation of the previous month of the decorated calendar object - * - * @param object subclass of Calendar e.g. Calendar_Month - * @param string (optional) format of returned months (one,two,short or long) - * - * @return string - * @static - */ - public static function prevMonthName($Calendar, $format = 'long') - { - $months = self::monthNames($format); - - return $months[$Calendar->prevMonth()]; - } - - /** - * Returns textual representation of the month of the decorated calendar object - * - * @param object subclass of Calendar e.g. Calendar_Month - * @param string (optional) format of returned months (one,two,short or long) - * - * @return string - * @static - */ - public static function thisMonthName($Calendar, $format = 'long') - { - $months = self::monthNames($format); - - return $months[$Calendar->thisMonth()]; - } - - /** - * Returns textual representation of the next month of the decorated calendar object - * - * @param object subclass of Calendar e.g. Calendar_Month - * @param string (optional) format of returned months (one,two,short or long) - * - * @return string - * @static - */ - public static function nextMonthName($Calendar, $format = 'long') - { - $months = self::monthNames($format); - - return $months[$Calendar->nextMonth()]; - } - - /** - * Returns textual representation of the previous day of week of the decorated calendar object - * Note: Requires PEAR::Date - * - * @param object subclass of Calendar e.g. Calendar_Month - * @param string (optional) format of returned months (one,two,short or long) - * - * @return string - * @static - */ - public static function prevDayName($Calendar, $format = 'long') - { - $days = self::weekdayNames($format); - $stamp = $Calendar->prevDay('timestamp'); - $cE = $Calendar->getEngine(); - require_once 'Date/Calc.php'; - $day = Date_Calc::dayOfWeek($cE->stampToDay($stamp), - $cE->stampToMonth($stamp), $cE->stampToYear($stamp)); - - return $days[$day]; - } - - /** - * Returns textual representation of the day of week of the decorated calendar object - * Note: Requires PEAR::Date - * - * @param object subclass of Calendar e.g. Calendar_Month - * @param string (optional) format of returned months (one,two,short or long) - * - * @return string - * @static - */ - public static function thisDayName($Calendar, $format = 'long') - { - $days = self::weekdayNames($format); - require_once 'Date/Calc.php'; - $day = Date_Calc::dayOfWeek($Calendar->thisDay(), $Calendar->thisMonth(), $Calendar->thisYear()); - - return $days[$day]; - } - - /** - * Returns textual representation of the next day of week of the decorated calendar object - * - * @param object subclass of Calendar e.g. Calendar_Month - * @param string (optional) format of returned months (one,two,short or long) - * - * @return string - * @static - */ - public static function nextDayName($Calendar, $format = 'long') - { - $days = self::weekdayNames($format); - $stamp = $Calendar->nextDay('timestamp'); - $cE = $Calendar->getEngine(); - require_once 'Date/Calc.php'; - $day = Date_Calc::dayOfWeek($cE->stampToDay($stamp), - $cE->stampToMonth($stamp), $cE->stampToYear($stamp)); - - return $days[$day]; - } - - /** - * Returns the days of the week using the order defined in the decorated - * calendar object. Only useful for Calendar_Month_Weekdays, Calendar_Month_Weeks - * and Calendar_Week. Otherwise the returned array will begin on Sunday - * - * @param object subclass of Calendar e.g. Calendar_Month - * @param string (optional) format of returned months (one,two,short or long) - * - * @return array ordered array of week day names - * @static - */ - public static function orderedWeekdays($Calendar, $format = 'long') - { - $days = self::weekdayNames($format); - - // Not so good - need methods to access this information perhaps... - if (isset($Calendar->tableHelper)) { - $ordereddays = $Calendar->tableHelper->daysOfWeek; - } else { - $ordereddays = [0, 1, 2, 3, 4, 5, 6]; - } - - $ordereddays = array_flip($ordereddays); - $i = 0; - $returndays = []; - foreach ($ordereddays as $key => $value) { - $returndays[$i] = $days[$key]; - $i++; - } - - return $returndays; - } -} diff --git a/data/module/Calendar/Util/Uri.php b/data/module/Calendar/Util/Uri.php deleted file mode 100644 index de31513aca..0000000000 --- a/data/module/Calendar/Util/Uri.php +++ /dev/null @@ -1,190 +0,0 @@ - | -// | Lorenzo Alberton | -// +----------------------------------------------------------------------+ -// -// $Id: Uri.php,v 1.1 2004/08/16 09:03:55 hfuecks Exp $ -// -/** - * @version $Id$ - */ - -/** - * Utility to help building HTML links for navigating the calendar
- * - * $Day = new Calendar_Day(2003, 10, 23); - * $Uri = & new Calendar_Util_Uri('year', 'month', 'day'); - * echo $Uri->prev($Day,'month'); // Displays year=2003&month=10 - * echo $Uri->prev($Day,'day'); // Displays year=2003&month=10&day=22 - * $Uri->seperator = '/'; - * $Uri->scalar = true; - * echo $Uri->prev($Day,'month'); // Displays 2003/10 - * echo $Uri->prev($Day,'day'); // Displays 2003/10/22 - * - */ -class Calendar_Util_Uri -{ - /** - * Uri fragments for year, month, day etc. - * - * @var array - */ - public $uris = []; - - /** - * String to separate fragments with. - * Set to just & for HTML. - * For a scalar URL you might use / as the seperator - * - * @var string (default XHTML &) - */ - public $separator = '&'; - - /** - * To output a "scalar" string - variable names omitted. - * Used for urls like index.php/2004/8/12 - * - * @var bool (default false) - */ - public $scalar = false; - - /** - * Constructs Calendar_Decorator_Uri - * The term "fragment" means name of a calendar GET variables in the URL - * - * @param string URI fragment for year - * @param string (optional) URI fragment for month - * @param string (optional) URI fragment for day - * @param string (optional) URI fragment for hour - * @param string (optional) URI fragment for minute - * @param string (optional) URI fragment for second - */ - public function __construct($y, $m = null, $d = null, $h = null, $i = null, $s = null) - { - $this->setFragments($y, $m, $d, $h, $i, $s); - } - - /** - * Sets the URI fragment names - * - * @param string URI fragment for year - * @param string (optional) URI fragment for month - * @param string (optional) URI fragment for day - * @param string (optional) URI fragment for hour - * @param string (optional) URI fragment for minute - * @param string (optional) URI fragment for second - * - * @return void - */ - public function setFragments($y, $m = null, $d = null, $h = null, $i = null, $s = null) - { - if (!is_null($y)) { - $this->uris['Year'] = $y; - } - if (!is_null($m)) { - $this->uris['Month'] = $m; - } - if (!is_null($d)) { - $this->uris['Day'] = $d; - } - if (!is_null($h)) { - $this->uris['Hour'] = $h; - } - if (!is_null($i)) { - $this->uris['Minute'] = $i; - } - if (!is_null($s)) { - $this->uris['Second'] = $s; - } - } - - /** - * Gets the URI string for the previous calendar unit - * - * @param object subclassed from Calendar e.g. Calendar_Month - * @param string calendar unit ( must be year, month, week, day, hour, minute or second) - * - * @return string - */ - public function prev($Calendar, $unit) - { - $method = 'prev'.$unit; - $stamp = $Calendar->{$method}('timestamp'); - - return $this->buildUriString($Calendar, $method, $stamp); - } - - /** - * Gets the URI string for the current calendar unit - * - * @param object subclassed from Calendar e.g. Calendar_Month - * @param string calendar unit ( must be year, month, week, day, hour, minute or second) - * - * @return string - */ - public function this($Calendar, $unit) - { - $method = 'this'.$unit; - $stamp = $Calendar->{$method}('timestamp'); - - return $this->buildUriString($Calendar, $method, $stamp); - } - - /** - * Gets the URI string for the next calendar unit - * - * @param object subclassed from Calendar e.g. Calendar_Month - * @param string calendar unit ( must be year, month, week, day, hour, minute or second) - * - * @return string - */ - public function next($Calendar, $unit) - { - $method = 'next'.$unit; - $stamp = $Calendar->{$method}('timestamp'); - - return $this->buildUriString($Calendar, $method, $stamp); - } - - /** - * Build the URI string - * - * @param string method substring - * @param int timestamp - * - * @return string build uri string - */ - public function buildUriString($Calendar, $method, $stamp) - { - $uriString = ''; - $cE = &$Calendar->getEngine(); - $separator = ''; - foreach ($this->uris as $unit => $uri) { - $call = 'stampTo'.$unit; - $uriString .= $separator; - if (!$this->scalar) { - $uriString .= $uri.'='; - } - $uriString .= $cE->{$call}($stamp); - $separator = $this->separator; - } - - return $uriString; - } -} diff --git a/data/module/Calendar/Validator.php b/data/module/Calendar/Validator.php deleted file mode 100644 index bbb561d2ec..0000000000 --- a/data/module/Calendar/Validator.php +++ /dev/null @@ -1,354 +0,0 @@ - | -// +----------------------------------------------------------------------+ -// -// $Id: Validator.php,v 1.1 2004/05/24 22:25:42 quipo Exp $ -// -/* - * @package Calendar - * @version $Id$ - */ - -/* - * Validation Error Messages - */ -if (!defined('CALENDAR_VALUE_TOOSMALL')) { - define('CALENDAR_VALUE_TOOSMALL', 'Too small: min = '); -} -if (!defined('CALENDAR_VALUE_TOOLARGE')) { - define('CALENDAR_VALUE_TOOLARGE', 'Too large: max = '); -} - -/** - * Used to validate any given Calendar date object. Instances of this class - * can be obtained from any data object using the getValidator method - * - * @see Calendar::getValidator() - */ -class Calendar_Validator -{ - /** - * Instance of the Calendar date object to validate - * - * @var object - */ - public $calendar; - - /** - * Instance of the Calendar_Engine - * - * @var object - */ - public $cE; - - /** - * Array of errors for validation failures - * - * @var array - */ - public $errors = []; - - /** - * Constructs Calendar_Validator - * - * @param object subclass of Calendar - */ - public function __construct(&$calendar) - { - $this->calendar = &$calendar; - $this->cE = &$calendar->getEngine(); - } - - /** - * Calls all the other isValidXXX() methods in the validator - * - * @return bool - */ - public function isValid() - { - $checks = ['isValidYear', 'isValidMonth', 'isValidDay', - 'isValidHour', 'isValidMinute', 'isValidSecond', ]; - $valid = true; - foreach ($checks as $check) { - if (!$this->{$check}()) { - $valid = false; - } - } - - return $valid; - } - - /** - * Check whether this is a valid year - * - * @return bool - */ - public function isValidYear() - { - $y = $this->calendar->thisYear(); - $min = $this->cE->getMinYears(); - if ($min > $y) { - $this->errors[] = new Calendar_Validation_Error( - 'Year', $y, CALENDAR_VALUE_TOOSMALL.$min); - - return false; - } - $max = $this->cE->getMaxYears(); - if ($y > $max) { - $this->errors[] = new Calendar_Validation_Error( - 'Year', $y, CALENDAR_VALUE_TOOLARGE.$max); - - return false; - } - - return true; - } - - /** - * Check whether this is a valid month - * - * @return bool - */ - public function isValidMonth() - { - $m = $this->calendar->thisMonth(); - $min = 1; - if ($min > $m) { - $this->errors[] = new Calendar_Validation_Error( - 'Month', $m, CALENDAR_VALUE_TOOSMALL.$min); - - return false; - } - $max = $this->cE->getMonthsInYear($this->calendar->thisYear()); - if ($m > $max) { - $this->errors[] = new Calendar_Validation_Error( - 'Month', $m, CALENDAR_VALUE_TOOLARGE.$max); - - return false; - } - - return true; - } - - /** - * Check whether this is a valid day - * - * @return bool - */ - public function isValidDay() - { - $d = $this->calendar->thisDay(); - $min = 1; - if ($min > $d) { - $this->errors[] = new Calendar_Validation_Error( - 'Day', $d, CALENDAR_VALUE_TOOSMALL.$min); - - return false; - } - $max = $this->cE->getDaysInMonth( - $this->calendar->thisYear(), $this->calendar->thisMonth()); - if ($d > $max) { - $this->errors[] = new Calendar_Validation_Error( - 'Day', $d, CALENDAR_VALUE_TOOLARGE.$max); - - return false; - } - - return true; - } - - /** - * Check whether this is a valid hour - * - * @return bool - */ - public function isValidHour() - { - $h = $this->calendar->thisHour(); - $min = 0; - if ($min > $h) { - $this->errors[] = new Calendar_Validation_Error( - 'Hour', $h, CALENDAR_VALUE_TOOSMALL.$min); - - return false; - } - $max = ($this->cE->getHoursInDay($this->calendar->thisDay()) - 1); - if ($h > $max) { - $this->errors[] = new Calendar_Validation_Error( - 'Hour', $h, CALENDAR_VALUE_TOOLARGE.$max); - - return false; - } - - return true; - } - - /** - * Check whether this is a valid minute - * - * @return bool - */ - public function isValidMinute() - { - $i = $this->calendar->thisMinute(); - $min = 0; - if ($min > $i) { - $this->errors[] = new Calendar_Validation_Error( - 'Minute', $i, CALENDAR_VALUE_TOOSMALL.$min); - - return false; - } - $max = ($this->cE->getMinutesInHour($this->calendar->thisHour()) - 1); - if ($i > $max) { - $this->errors[] = new Calendar_Validation_Error( - 'Minute', $i, CALENDAR_VALUE_TOOLARGE.$max); - - return false; - } - - return true; - } - - /** - * Check whether this is a valid second - * - * @return bool - */ - public function isValidSecond() - { - $s = $this->calendar->thisSecond(); - $min = 0; - if ($min > $s) { - $this->errors[] = new Calendar_Validation_Error( - 'Second', $s, CALENDAR_VALUE_TOOSMALL.$min); - - return false; - } - $max = ($this->cE->getSecondsInMinute($this->calendar->thisMinute()) - 1); - if ($s > $max) { - $this->errors[] = new Calendar_Validation_Error( - 'Second', $s, CALENDAR_VALUE_TOOLARGE.$max); - - return false; - } - - return true; - } - - /** - * Iterates over any validation errors - * - * @return mixed either Calendar_Validation_Error or false - */ - public function fetch() - { - $error = current($this->errors); - next($this->errors); - if ($error) { - return $error['value']; - } else { - reset($this->errors); - - return false; - } - } -} - -/** - * For Validation Error messages - * - * @see Calendar::fetch() - */ -class Calendar_Validation_Error -{ - /** - * Date unit (e.g. month,hour,second) which failed test - * - * @var string - */ - public $unit; - - /** - * Value of unit which failed test - * - * @var int - */ - public $value; - - /** - * Validation error message - * - * @var string - */ - public $message; - - /** - * Constructs Calendar_Validation_Error - * - * @param string Date unit (e.g. month,hour,second) - * @param int Value of unit which failed test - * @param string Validation error message - */ - public function __construct($unit, $value, $message) - { - $this->unit = $unit; - $this->value = $value; - $this->message = $message; - } - - /** - * Returns the Date unit - * - * @return string - */ - public function getUnit() - { - return $this->unit; - } - - /** - * Returns the value of the unit - * - * @return int - */ - public function getValue() - { - return $this->value; - } - - /** - * Returns the validation error message - * - * @return string - */ - public function getMessage() - { - return $this->message; - } - - /** - * Returns a string containing the unit, value and error message - * - * @return string - */ - public function toString() - { - return $this->unit.' = '.$this->value.' ['.$this->message.']'; - } -} diff --git a/data/module/Calendar/Week.php b/data/module/Calendar/Week.php deleted file mode 100644 index aa48fcc812..0000000000 --- a/data/module/Calendar/Week.php +++ /dev/null @@ -1,400 +0,0 @@ - | -// | Lorenzo Alberton | -// +----------------------------------------------------------------------+ -// -// $Id: Week.php,v 1.7 2005/10/22 10:26:49 quipo Exp $ -// -/* - * @package Calendar - * @version $Id$ - */ - -/* - * Allows Calendar include path to be redefined - * @ignore - */ -if (!defined('CALENDAR_ROOT')) { - define('CALENDAR_ROOT', 'Calendar'.DIRECTORY_SEPARATOR); -} - -/** - * Load Calendar base class - */ -require_once CALENDAR_ROOT.'Calendar.php'; - -/** - * Represents a Week and builds Days in tabular format
- * - * require_once 'Calendar'.DIRECTORY_SEPARATOR.'Week.php'; - * $Week = & new Calendar_Week(2003, 10, 1); Oct 2003, 1st tabular week - * echo ''; - * while ($Day = & $Week->fetch()) { - * if ($Day->isEmpty()) { - * echo ' '; - * } else { - * echo ''.$Day->thisDay().''; - * } - * } - * echo ''; - * - */ -class Calendar_Week extends Calendar -{ - /** - * Instance of Calendar_Table_Helper - * - * @var Calendar_Table_Helper - */ - public $tableHelper; - - /** - * Stores the timestamp of the first day of this week - * - * @var object - */ - public $thisWeek; - - /** - * Stores the timestamp of first day of previous week - * - * @var object - */ - public $prevWeek; - - /** - * Stores the timestamp of first day of next week - * - * @var object - */ - public $nextWeek; - - /** - * Used by build() to set empty days - * - * @var bool - */ - public $firstWeek = false; - - /** - * Used by build() to set empty days - * - * @var bool - */ - public $lastWeek = false; - - /** - * First day of the week (0=sunday, 1=monday...) - * - * @var bool - */ - public $firstDay = 1; - - /** - * Constructs Week - * - * @param int year e.g. 2003 - * @param int month e.g. 5 - * @param int a day of the desired week - * @param int (optional) first day of week (e.g. 0 for Sunday, 2 for Tuesday etc.) - */ - public function __construct($y, $m, $d, $firstDay = null) - { - require_once CALENDAR_ROOT.'Table/Helper.php'; - parent::__construct($y, $m, $d); - $this->firstDay = $this->defineFirstDayOfWeek($firstDay); - $this->tableHelper = new Calendar_Table_Helper($this, $this->firstDay); - $this->thisWeek = $this->tableHelper->getWeekStart($y, $m, $d, $this->firstDay); - $this->prevWeek = $this->tableHelper->getWeekStart($y, $m, $d - $this->cE->getDaysInWeek( - $this->thisYear(), - $this->thisMonth(), - $this->thisDay()), $this->firstDay); - $this->nextWeek = $this->tableHelper->getWeekStart($y, $m, $d + $this->cE->getDaysInWeek( - $this->thisYear(), - $this->thisMonth(), - $this->thisDay()), $this->firstDay); - } - - /** - * Defines the calendar by a timestamp (Unix or ISO-8601), replacing values - * passed to the constructor - * - * @param int|string Unix or ISO-8601 timestamp - * - * @return void - */ - public function setTimestamp($ts) - { - parent::setTimestamp($ts); - $this->thisWeek = $this->tableHelper->getWeekStart( - $this->year, $this->month, $this->day, $this->firstDay - ); - $this->prevWeek = $this->tableHelper->getWeekStart( - $this->year, $this->month, $this->day - $this->cE->getDaysInWeek( - $this->thisYear(), - $this->thisMonth(), - $this->thisDay()), $this->firstDay - ); - $this->nextWeek = $this->tableHelper->getWeekStart( - $this->year, $this->month, $this->day + $this->cE->getDaysInWeek( - $this->thisYear(), - $this->thisMonth(), - $this->thisDay()), $this->firstDay - ); - } - - /** - * Builds Calendar_Day objects for this Week - * - * @param array (optional) Calendar_Day objects representing selected dates - * - * @return bool - */ - public function build($sDates = []) - { - require_once CALENDAR_ROOT.'Day.php'; - $year = $this->cE->stampToYear($this->thisWeek); - $month = $this->cE->stampToMonth($this->thisWeek); - $day = $this->cE->stampToDay($this->thisWeek); - $end = $this->cE->getDaysInWeek( - $this->thisYear(), - $this->thisMonth(), - $this->thisDay() - ); - - for ($i = 1; $i <= $end; $i++) { - $stamp = $this->cE->dateToStamp($year, $month, $day++); - $this->children[$i] = new Calendar_Day( - $this->cE->stampToYear($stamp), - $this->cE->stampToMonth($stamp), - $this->cE->stampToDay($stamp)); - } - - // set empty days (@see Calendar_Month_Weeks::build()) - if ($this->firstWeek) { - $eBefore = $this->tableHelper->getEmptyDaysBefore(); - for ($i = 1; $i <= $eBefore; $i++) { - $this->children[$i]->setEmpty(); - } - } - if ($this->lastWeek) { - $eAfter = $this->tableHelper->getEmptyDaysAfterOffset(); - for ($i = $eAfter + 1; $i <= $end; $i++) { - $this->children[$i]->setEmpty(); - } - } - - if (count($sDates) > 0) { - $this->setSelection($sDates); - } - - return true; - } - - /** - * @param bool - * - * @return void - */ - public function setFirst($state = true) - { - $this->firstWeek = $state; - } - - /** - * @param bool - * - * @return void - */ - public function setLast($state = true) - { - $this->lastWeek = $state; - } - - /** - * Called from build() - * - * @param array - * - * @return void - */ - public function setSelection($sDates) - { - foreach ($sDates as $sDate) { - foreach ($this->children as $key => $child) { - if ($child->thisDay() == $sDate->thisDay() && - $child->thisMonth() == $sDate->thisMonth() && - $child->thisYear() == $sDate->thisYear() - ) { - $this->children[$key] = $sDate; - $this->children[$key]->setSelected(); - } - } - } - reset($this->children); - } - - /** - * Gets the value of the previous week, according to the requested format - * - * @param string $format ['timestamp' | 'n_in_month' | 'n_in_year' | 'array'] - * - * @return mixed - */ - public function prevWeek($format = 'n_in_month') - { - switch (strtolower($format)) { - case 'int': - case 'n_in_month': - return ($this->firstWeek) ? null : $this->thisWeek('n_in_month') - 1; - break; - case 'n_in_year': - return $this->cE->getWeekNInYear( - $this->cE->stampToYear($this->prevWeek), - $this->cE->stampToMonth($this->prevWeek), - $this->cE->stampToDay($this->prevWeek)); - break; - case 'array': - return $this->toArray($this->prevWeek); - break; - case 'object': - require_once CALENDAR_ROOT.'Factory.php'; - - return Calendar_Factory::createByTimestamp('Week', $this->prevWeek); - break; - case 'timestamp': - default: - return $this->prevWeek; - break; - } - } - - /** - * Gets the value of the current week, according to the requested format - * - * @param string $format ['timestamp' | 'n_in_month' | 'n_in_year' | 'array'] - * - * @return mixed - */ - public function thisWeek($format = 'n_in_month') - { - switch (strtolower($format)) { - case 'int': - case 'n_in_month': - if ($this->firstWeek) { - return 1; - } - if ($this->lastWeek) { - return $this->cE->getWeeksInMonth( - $this->thisYear(), - $this->thisMonth(), - $this->firstDay); - } - - return $this->cE->getWeekNInMonth( - $this->thisYear(), - $this->thisMonth(), - $this->thisDay(), - $this->firstDay); - break; - case 'n_in_year': - return $this->cE->getWeekNInYear( - $this->cE->stampToYear($this->thisWeek), - $this->cE->stampToMonth($this->thisWeek), - $this->cE->stampToDay($this->thisWeek)); - break; - case 'array': - return $this->toArray($this->thisWeek); - break; - case 'object': - require_once CALENDAR_ROOT.'Factory.php'; - - return Calendar_Factory::createByTimestamp('Week', $this->thisWeek); - break; - case 'timestamp': - default: - return $this->thisWeek; - break; - } - } - - /** - * Gets the value of the following week, according to the requested format - * - * @param string $format ['timestamp' | 'n_in_month' | 'n_in_year' | 'array'] - * - * @return mixed - */ - public function nextWeek($format = 'n_in_month') - { - switch (strtolower($format)) { - case 'int': - case 'n_in_month': - return ($this->lastWeek) ? null : $this->thisWeek('n_in_month') + 1; - break; - case 'n_in_year': - return $this->cE->getWeekNInYear( - $this->cE->stampToYear($this->nextWeek), - $this->cE->stampToMonth($this->nextWeek), - $this->cE->stampToDay($this->nextWeek)); - break; - case 'array': - return $this->toArray($this->nextWeek); - break; - case 'object': - require_once CALENDAR_ROOT.'Factory.php'; - - return Calendar_Factory::createByTimestamp('Week', $this->nextWeek); - break; - case 'timestamp': - default: - return $this->nextWeek; - break; - } - } - - /** - * Returns the instance of Calendar_Table_Helper. - * Called from Calendar_Validator::isValidWeek - * - * @return Calendar_Table_Helper - */ - public function &getHelper() - { - return $this->tableHelper; - } - - /** - * Makes sure theres a value for $this->day - * - * @return void - */ - public function findFirstDay() - { - if (!count($this->children) > 0) { - $this->build(); - foreach ($this->children as $Day) { - if (!$Day->isEmpty()) { - $this->day = $Day->thisDay(); - break; - } - } - } - } -} diff --git a/data/module/Calendar/Year.php b/data/module/Calendar/Year.php deleted file mode 100644 index 77a55f4188..0000000000 --- a/data/module/Calendar/Year.php +++ /dev/null @@ -1,118 +0,0 @@ - | -// +----------------------------------------------------------------------+ -// -// $Id: Year.php,v 1.4 2005/10/22 10:25:39 quipo Exp $ -// -/* - * @package Calendar - * @version $Id$ - */ - -/* - * Allows Calendar include path to be redefined - * @ignore - */ -if (!defined('CALENDAR_ROOT')) { - define('CALENDAR_ROOT', 'Calendar'.DIRECTORY_SEPARATOR); -} - -/** - * Load Calendar base class - */ -require_once CALENDAR_ROOT.'Calendar.php'; - -/** - * Represents a Year and builds Months
- * - * require_once 'Calendar'.DIRECTORY_SEPARATOR.'Year.php'; - * $Year = & new Calendar_Year(2003, 10, 21); // 21st Oct 2003 - * $Year->build(); // Build Calendar_Month objects - * while ($Month = & $Year->fetch()) { - * echo $Month->thisMonth().'
'; - * } - *
- */ -class Calendar_Year extends Calendar -{ - /** @var string */ - public $firstDay; - - /** - * Constructs Calendar_Year - * - * @param int year e.g. 2003 - */ - public function __construct($y) - { - parent::__construct($y); - } - - /** - * Builds the Months of the Year.
- * Note: by defining the constant CALENDAR_MONTH_STATE you can - * control what class of Calendar_Month is built e.g.; - * - * require_once 'Calendar/Calendar_Year.php'; - * define ('CALENDAR_MONTH_STATE',CALENDAR_USE_MONTH_WEEKDAYS); // Use Calendar_Month_Weekdays - * // define ('CALENDAR_MONTH_STATE',CALENDAR_USE_MONTH_WEEKS); // Use Calendar_Month_Weeks - * // define ('CALENDAR_MONTH_STATE',CALENDAR_USE_MONTH); // Use Calendar_Month - * - * It defaults to building Calendar_Month objects. - * - * @param array (optional) array of Calendar_Month objects representing selected dates - * @param int (optional) first day of week (e.g. 0 for Sunday, 2 for Tuesday etc.) - * - * @return bool - */ - public function build($sDates = [], $firstDay = null) - { - require_once CALENDAR_ROOT.'Factory.php'; - $this->firstDay = $this->defineFirstDayOfWeek($firstDay); - $monthsInYear = $this->cE->getMonthsInYear($this->thisYear()); - for ($i = 1; $i <= $monthsInYear; $i++) { - $this->children[$i] = Calendar_Factory::create('Month', $this->year, $i); - } - if (count($sDates) > 0) { - $this->setSelection($sDates); - } - - return true; - } - - /** - * Called from build() - * - * @param array - * - * @return void - */ - public function setSelection($sDates) - { - foreach ($sDates as $sDate) { - if ($this->year == $sDate->thisYear()) { - $key = $sDate->thisMonth(); - if (isset($this->children[$key])) { - $sDate->setSelected(); - $this->children[$key] = $sDate; - } - } - } - } -} diff --git a/data/module/HTTP/Request.php b/data/module/HTTP/Request.php index b55823bfbd..25a304f7e3 100644 --- a/data/module/HTTP/Request.php +++ b/data/module/HTTP/Request.php @@ -302,14 +302,14 @@ class HTTP_Request * * @var array */ - public $_readTimeout = null; + public $_readTimeout; /** * Options to pass to Net_Socket::connect. See stream_context_create * * @var array */ - public $_socketOptions = null; + public $_socketOptions; /**#@-*/ /** @@ -401,7 +401,7 @@ public function _generateHostHeader() $host = $this->_url->host.':'.$this->_url->port; } elseif ($this->_url->port != 443 && strcasecmp($this->_url->protocol, 'https') == 0) { $host = $this->_url->host.':'.$this->_url->port; - } elseif ($this->_url->port == 443 && strcasecmp($this->_url->protocol, 'https') == 0 && strpos($this->_url->url, ':443') !== false) { + } elseif ($this->_url->port == 443 && strcasecmp($this->_url->protocol, 'https') == 0 && str_contains($this->_url->url, ':443')) { $host = $this->_url->host.':'.$this->_url->port; } else { $host = $this->_url->host; @@ -733,20 +733,20 @@ public function sendRequest($saveBody = true) // RFC 2068, section 19.7.1: A client MUST NOT send the Keep-Alive // connection token to a proxy server... - if (isset($this->_proxy_host) && !empty($this->_requestHeaders['connection']) && - 'Keep-Alive' == $this->_requestHeaders['connection']) { + if (isset($this->_proxy_host) && !empty($this->_requestHeaders['connection']) + && 'Keep-Alive' == $this->_requestHeaders['connection']) { $this->removeHeader('connection'); } - $keepAlive = (HTTP_REQUEST_HTTP_VER_1_1 == $this->_http && empty($this->_requestHeaders['connection'])) || - (!empty($this->_requestHeaders['connection']) && 'Keep-Alive' == $this->_requestHeaders['connection']); + $keepAlive = (HTTP_REQUEST_HTTP_VER_1_1 == $this->_http && empty($this->_requestHeaders['connection'])) + || (!empty($this->_requestHeaders['connection']) && 'Keep-Alive' == $this->_requestHeaders['connection']); $sockets = &PEAR::getStaticProperty('HTTP_Request', 'sockets'); $sockKey = $host.':'.$port; unset($this->_sock); // There is a connected socket in the "static" property? - if ($keepAlive && !empty($sockets[$sockKey]) && - !empty($sockets[$sockKey]->fp)) { + if ($keepAlive && !empty($sockets[$sockKey]) + && !empty($sockets[$sockKey]->fp)) { $this->_sock = &$sockets[$sockKey]; $err = null; } else { @@ -810,7 +810,7 @@ public function sendRequest($saveBody = true) $this->_url = new Net_URL($redirect); $this->addHeader('Host', $this->_generateHostHeader()); // Absolute path - } elseif (strpos($redirect, '/') === 0) { + } elseif (str_starts_with($redirect, '/')) { $this->_url->path = $redirect; // Relative path @@ -938,9 +938,9 @@ public function _buildRequest() $request = $this->_method.' '.$url.' HTTP/'.$this->_http."\r\n"; - if (in_array($this->_method, $this->_bodyDisallowed) || - (0 == strlen($this->_body) && (HTTP_REQUEST_METHOD_POST != $this->_method || - (empty($this->_postData) && empty($this->_postFiles))))) { + if (in_array($this->_method, $this->_bodyDisallowed) + || (0 == strlen($this->_body) && (HTTP_REQUEST_METHOD_POST != $this->_method + || (empty($this->_postData) && empty($this->_postFiles))))) { $this->removeHeader('Content-Type'); } else { if (empty($this->_requestHeaders['content-type'])) { @@ -965,8 +965,8 @@ public function _buildRequest() $request .= "\r\n"; // Post data if it's an array - } elseif (HTTP_REQUEST_METHOD_POST == $this->_method && - (!empty($this->_postData) || !empty($this->_postFiles))) { + } elseif (HTTP_REQUEST_METHOD_POST == $this->_method + && (!empty($this->_postData) || !empty($this->_postFiles))) { // "normal" POST request if (!isset($boundary)) { $postdata = implode('&', array_map( @@ -1100,8 +1100,8 @@ public function attach(&$listener) */ public function detach(&$listener) { - if (!is_a($listener, 'HTTP_Request_Listener') || - !isset($this->_listeners[$listener->getId()])) { + if (!is_a($listener, 'HTTP_Request_Listener') + || !isset($this->_listeners[$listener->getId()])) { return false; } unset($this->_listeners[$listener->getId()]); @@ -1231,9 +1231,9 @@ public function __construct(&$sock, &$listeners) * @param bool Whether the response can actually have a message-body. * Will be set to false for HEAD requests. * - * @throws PEAR_Error - * * @return mixed true on success, PEAR_Error in case of malformed response + * + * @throws PEAR_Error */ public function process($saveBody = true, $canHaveBody = true) { @@ -1259,15 +1259,15 @@ public function process($saveBody = true, $canHaveBody = true) // 3. ... If a message is received with both a // Transfer-Encoding header field and a Content-Length header field, // the latter MUST be ignored. - $canHaveBody = $canHaveBody && $this->_code >= 200 && - $this->_code != 204 && $this->_code != 304; + $canHaveBody = $canHaveBody && $this->_code >= 200 + && $this->_code != 204 && $this->_code != 304; // If response body is present, read it and decode $chunked = isset($this->_headers['transfer-encoding']) && ('chunked' == $this->_headers['transfer-encoding']); $gzipped = isset($this->_headers['content-encoding']) && ('gzip' == $this->_headers['content-encoding']); $hasBody = false; - if ($canHaveBody && ($chunked || !isset($this->_headers['content-length']) || - 0 != $this->_headers['content-length'])) { + if ($canHaveBody && ($chunked || !isset($this->_headers['content-length']) + || 0 != $this->_headers['content-length'])) { if ($chunked || !isset($this->_headers['content-length'])) { $this->_toRead = null; } else { @@ -1318,7 +1318,7 @@ public function process($saveBody = true, $canHaveBody = true) */ public function _processHeader($header) { - if (false === strpos($header, ':')) { + if (!str_contains($header, ':')) { return; } list($headername, $headervalue) = explode(':', $header, 2); @@ -1364,7 +1364,7 @@ public function _parseCookie($headervalue) $cookie['value'] = trim(substr($elements[0], $pos + 1)); for ($i = 1; $i < count($elements); $i++) { - if (false === strpos($elements[$i], '=')) { + if (!str_contains($elements[$i], '=')) { $elName = trim($elements[$i]); $elValue = null; } else { diff --git a/data/module/HTTP/Request/Listener.php b/data/module/HTTP/Request/Listener.php index ce21a4630a..b6ec46c90d 100644 --- a/data/module/HTTP/Request/Listener.php +++ b/data/module/HTTP/Request/Listener.php @@ -90,6 +90,7 @@ public function getId() * @param object an object the listener is attached to * @param string Event name * @param mixed Additional data + * * @abstract */ public function update(&$subject, $event, $data = null) diff --git a/data/module/Net/SMTP.php b/data/module/Net/SMTP.php deleted file mode 100644 index cc043618c6..0000000000 --- a/data/module/Net/SMTP.php +++ /dev/null @@ -1,1210 +0,0 @@ - | -// | Jon Parise | -// | Damian Alejandro Fernandez Sosa | -// +----------------------------------------------------------------------+ -// -// $Id: SMTP.php 304535 2010-10-20 06:48:06Z jon $ - -require_once 'PEAR.php'; -require_once 'Net/Socket.php'; - -/** - * Provides an implementation of the SMTP protocol using PEAR's - * Net_Socket:: class. - * - * @author Chuck Hagenbuch - * @author Jon Parise - * @author Damian Alejandro Fernandez Sosa - * - * @example basic.php A basic implementation of the Net_SMTP package. - */ -class Net_SMTP -{ - /** - * The server to connect to. - * - * @var string - */ - public $host = 'localhost'; - - /** - * The port to connect to. - * - * @var int - */ - public $port = 25; - - /** - * The value to give when sending EHLO or HELO. - * - * @var string - */ - public $localhost = 'localhost'; - - /** - * List of supported authentication methods, in preferential order. - * - * @var array - */ - public $auth_methods = ['DIGEST-MD5', 'CRAM-MD5', 'LOGIN', 'PLAIN']; - - /** - * Use SMTP command pipelining (specified in RFC 2920) if the SMTP - * server supports it. - * - * When pipeling is enabled, rcptTo(), mailFrom(), sendFrom(), - * somlFrom() and samlFrom() do not wait for a response from the - * SMTP server but return immediately. - * - * @var bool - */ - public $pipelining = false; - - /** - * Number of pipelined commands. - * - * @var int - */ - public $_pipelined_commands = 0; - - /** - * Should debugging output be enabled? - * - * @var bool - */ - public $_debug = false; - - /** - * Debug output handler. - * - * @var callable - */ - public $_debug_handler = null; - - /** - * The socket resource being used to connect to the SMTP server. - * - * @var resource - */ - public $_socket = null; - - /** - * The most recent server response code. - * - * @var int - */ - public $_code = -1; - - /** - * The most recent server response arguments. - * - * @var array - */ - public $_arguments = []; - - /** - * Stores the SMTP server's greeting string. - * - * @var string - */ - public $_greeting = null; - - /** - * Stores detected features of the SMTP server. - * - * @var array - */ - public $_esmtp = []; - - /** - * Instantiates a new Net_SMTP object, overriding any defaults - * with parameters that are passed in. - * - * If you have SSL support in PHP, you can connect to a server - * over SSL using an 'ssl://' prefix: - * - * // 465 is a common smtps port. - * $smtp = new Net_SMTP('ssl://mail.host.com', 465); - * $smtp->connect(); - * - * @param string $host The server to connect to. - * @param int $port The port to connect to. - * @param string $localhost The value to give when sending EHLO or HELO. - * @param bool $pipeling Use SMTP command pipelining - * - * @since 1.0 - */ - public function __construct($host = null, $port = null, $localhost = null, $pipelining = false) - { - if (isset($host)) { - $this->host = $host; - } - if (isset($port)) { - $this->port = $port; - } - if (isset($localhost)) { - $this->localhost = $localhost; - } - $this->pipelining = $pipelining; - - $this->_socket = new Net_Socket(); - - /* Include the Auth_SASL package. If the package is not - * available, we disable the authentication methods that - * depend upon it. */ - if ((@include_once 'Auth/SASL.php') === false) { - $pos = array_search('DIGEST-MD5', $this->auth_methods); - unset($this->auth_methods[$pos]); - $pos = array_search('CRAM-MD5', $this->auth_methods); - unset($this->auth_methods[$pos]); - } - } - - /** - * Set the value of the debugging flag. - * - * @param bool $debug New value for the debugging flag. - * - * @since 1.1.0 - */ - public function setDebug($debug, $handler = null) - { - $this->_debug = $debug; - $this->_debug_handler = $handler; - } - - /** - * Write the given debug text to the current debug output handler. - * - * @param string $message Debug mesage text. - * - * @since 1.3.3 - */ - public function _debug($message) - { - if ($this->_debug) { - if ($this->_debug_handler) { - call_user_func_array($this->_debug_handler, - [&$this, $message]); - } else { - echo "DEBUG: $message\n"; - } - } - } - - /** - * Send the given string of data to the server. - * - * @param string $data The string of data to send. - * - * @return mixed True on success or a PEAR_Error object on failure. - * - * @since 1.1.0 - */ - public function _send($data) - { - $this->_debug("Send: $data"); - - $error = $this->_socket->write($data); - if ($error === false || PEAR::isError($error)) { - $msg = ($error) ? $error->getMessage() : 'unknown error'; - - return PEAR::raiseError("Failed to write to socket: $msg"); - } - - return true; - } - - /** - * Send a command to the server with an optional string of - * arguments. A carriage return / linefeed (CRLF) sequence will - * be appended to each command string before it is sent to the - * SMTP server - an error will be thrown if the command string - * already contains any newline characters. Use _send() for - * commands that must contain newlines. - * - * @param string $command The SMTP command to send to the server. - * @param string $args A string of optional arguments to append - * to the command. - * - * @return mixed The result of the _send() call. - * - * @since 1.1.0 - */ - public function _put($command, $args = '') - { - if (!empty($args)) { - $command .= ' '.$args; - } - - if (strcspn($command, "\r\n") !== strlen($command)) { - return PEAR::raiseError('Commands cannot contain newlines'); - } - - return $this->_send($command."\r\n"); - } - - /** - * Read a reply from the SMTP server. The reply consists of a response - * code and a response message. - * - * @param mixed $valid The set of valid response codes. These - * may be specified as an array of integer - * values or as a single integer value. - * @param bool $later Do not parse the response now, but wait - * until the last command in the pipelined - * command group - * - * @return mixed True if the server returned a valid response code or - * a PEAR_Error object is an error condition is reached. - * - * @since 1.1.0 - * @see getResponse - */ - public function _parseResponse($valid, $later = false) - { - $this->_code = -1; - $this->_arguments = []; - - if ($later) { - $this->_pipelined_commands++; - - return true; - } - - for ($i = 0; $i <= $this->_pipelined_commands; $i++) { - while ($line = $this->_socket->readLine()) { - $this->_debug("Recv: $line"); - - /* If we receive an empty line, the connection has been closed. */ - if (empty($line)) { - $this->disconnect(); - - return PEAR::raiseError('Connection was unexpectedly closed'); - } - - /* Read the code and store the rest in the arguments array. */ - $code = substr($line, 0, 3); - $this->_arguments[] = trim(substr($line, 4)); - - /* Check the syntax of the response code. */ - if (is_numeric($code)) { - $this->_code = (int) $code; - } else { - $this->_code = -1; - break; - } - - /* If this is not a multiline response, we're done. */ - if (substr($line, 3, 1) != '-') { - break; - } - } - } - - $this->_pipelined_commands = 0; - - /* Compare the server's response code with the valid code/codes. */ - if (is_int($valid) && ($this->_code === $valid)) { - return true; - } elseif (is_array($valid) && in_array($this->_code, $valid, true)) { - return true; - } - - return PEAR::raiseError('Invalid response code received from server', - $this->_code); - } - - /** - * Return a 2-tuple containing the last response from the SMTP server. - * - * @return array A two-element array: the first element contains the - * response code as an integer and the second element - * contains the response's arguments as a string. - * - * @since 1.1.0 - */ - public function getResponse() - { - return [$this->_code, implode("\n", $this->_arguments)]; - } - - /** - * Return the SMTP server's greeting string. - * - * @return string A string containing the greeting string, or null if a - * greeting has not been received. - * - * @since 1.3.3 - */ - public function getGreeting() - { - return $this->_greeting; - } - - /** - * Attempt to connect to the SMTP server. - * - * @param int $timeout The timeout value (in seconds) for the - * socket connection. - * @param bool $persistent Should a persistent socket connection - * be used? - * - * @return mixed Returns a PEAR_Error with an error message on any - * kind of failure, or true on success. - * - * @since 1.0 - */ - public function connect($timeout = null, $persistent = false) - { - $this->_greeting = null; - $result = $this->_socket->connect($this->host, $this->port, - $persistent, $timeout); - if (PEAR::isError($result)) { - return PEAR::raiseError('Failed to connect socket: '. - $result->getMessage()); - } - - if (PEAR::isError($error = $this->_parseResponse(220))) { - return $error; - } - - /* Extract and store a copy of the server's greeting string. */ - list(, $this->_greeting) = $this->getResponse(); - - if (PEAR::isError($error = $this->_negotiate())) { - return $error; - } - - return true; - } - - /** - * Attempt to disconnect from the SMTP server. - * - * @return mixed Returns a PEAR_Error with an error message on any - * kind of failure, or true on success. - * - * @since 1.0 - */ - public function disconnect() - { - if (PEAR::isError($error = $this->_put('QUIT'))) { - return $error; - } - if (PEAR::isError($error = $this->_parseResponse(221))) { - return $error; - } - if (PEAR::isError($error = $this->_socket->disconnect())) { - return PEAR::raiseError('Failed to disconnect socket: '. - $error->getMessage()); - } - - return true; - } - - /** - * Attempt to send the EHLO command and obtain a list of ESMTP - * extensions available, and failing that just send HELO. - * - * @return mixed Returns a PEAR_Error with an error message on any - * kind of failure, or true on success. - * - * @since 1.1.0 - */ - public function _negotiate() - { - if (PEAR::isError($error = $this->_put('EHLO', $this->localhost))) { - return $error; - } - - if (PEAR::isError($this->_parseResponse(250))) { - /* If we receive a 503 response, we're already authenticated. */ - if ($this->_code === 503) { - return true; - } - - /* If the EHLO failed, try the simpler HELO command. */ - if (PEAR::isError($error = $this->_put('HELO', $this->localhost))) { - return $error; - } - if (PEAR::isError($this->_parseResponse(250))) { - return PEAR::raiseError('HELO was not accepted: ', $this->_code); - } - - return true; - } - - foreach ($this->_arguments as $argument) { - $verb = strtok($argument, ' '); - $arguments = substr($argument, strlen($verb) + 1, - strlen($argument) - strlen($verb) - 1); - $this->_esmtp[$verb] = $arguments; - } - - if (!isset($this->_esmtp['PIPELINING'])) { - $this->pipelining = false; - } - - return true; - } - - /** - * Returns the name of the best authentication method that the server - * has advertised. - * - * @return mixed Returns a string containing the name of the best - * supported authentication method or a PEAR_Error object - * if a failure condition is encountered. - * - * @since 1.1.0 - */ - public function _getBestAuthMethod() - { - $available_methods = explode(' ', $this->_esmtp['AUTH']); - - foreach ($this->auth_methods as $method) { - if (in_array($method, $available_methods)) { - return $method; - } - } - - return PEAR::raiseError('No supported authentication methods'); - } - - /** - * Attempt to do SMTP authentication. - * - * @param string The userid to authenticate as. - * @param string The password to authenticate with. - * @param string The requested authentication method. If none is - * specified, the best supported method will be used. - * @param bool Flag indicating whether or not TLS should be attempted. - * @param string An optional authorization identifier. If specified, this - * identifier will be used as the authorization proxy. - * - * @return mixed Returns a PEAR_Error with an error message on any - * kind of failure, or true on success. - * - * @since 1.0 - */ - public function auth($uid, $pwd, $method = '', $tls = true, $authz = '') - { - /* We can only attempt a TLS connection if one has been requested, - * we're running PHP 5.1.0 or later, have access to the OpenSSL - * extension, are connected to an SMTP server which supports the - * STARTTLS extension, and aren't already connected over a secure - * (SSL) socket connection. */ - if ($tls && version_compare(PHP_VERSION, '5.1.0', '>=') && - extension_loaded('openssl') && isset($this->_esmtp['STARTTLS']) && - strncasecmp($this->host, 'ssl://', 6) !== 0) { - /* Start the TLS connection attempt. */ - if (PEAR::isError($result = $this->_put('STARTTLS'))) { - return $result; - } - if (PEAR::isError($result = $this->_parseResponse(220))) { - return $result; - } - if (PEAR::isError($result = $this->_socket->enableCrypto(true, STREAM_CRYPTO_METHOD_TLS_CLIENT))) { - return $result; - } elseif ($result !== true) { - return PEAR::raiseError('STARTTLS failed'); - } - - /* Send EHLO again to recieve the AUTH string from the - * SMTP server. */ - $this->_negotiate(); - } - - if (empty($this->_esmtp['AUTH'])) { - return PEAR::raiseError('SMTP server does not support authentication'); - } - - /* If no method has been specified, get the name of the best - * supported method advertised by the SMTP server. */ - if (empty($method)) { - if (PEAR::isError($method = $this->_getBestAuthMethod())) { - /* Return the PEAR_Error object from _getBestAuthMethod(). */ - return $method; - } - } else { - $method = strtoupper($method); - if (!in_array($method, $this->auth_methods)) { - return PEAR::raiseError("$method is not a supported authentication method"); - } - } - - switch ($method) { - case 'DIGEST-MD5': - $result = $this->_authDigest_MD5($uid, $pwd, $authz); - break; - - case 'CRAM-MD5': - $result = $this->_authCRAM_MD5($uid, $pwd); - break; - - case 'LOGIN': - $result = $this->_authLogin($uid, $pwd); - break; - - case 'PLAIN': - $result = $this->_authPlain($uid, $pwd, $authz); - break; - - default: - $result = PEAR::raiseError("$method is not a supported authentication method"); - break; - } - - /* If an error was encountered, return the PEAR_Error object. */ - if (PEAR::isError($result)) { - return $result; - } - - return true; - } - - /** - * Authenticates the user using the DIGEST-MD5 method. - * - * @param string The userid to authenticate as. - * @param string The password to authenticate with. - * @param string The optional authorization proxy identifier. - * - * @return mixed Returns a PEAR_Error with an error message on any - * kind of failure, or true on success. - * - * @since 1.1.0 - * @deprecated 本体で使用されていないため非推奨 - */ - public function _authDigest_MD5($uid, $pwd, $authz = '') - { - if (PEAR::isError($error = $this->_put('AUTH', 'DIGEST-MD5'))) { - return $error; - } - /* 334: Continue authentication request */ - if (PEAR::isError($error = $this->_parseResponse(334))) { - /* 503: Error: already authenticated */ - if ($this->_code === 503) { - return true; - } - - return $error; - } - - $challenge = base64_decode($this->_arguments[0]); - $digest = &Auth_SASL::factory('digestmd5'); - $auth_str = base64_encode($digest->getResponse($uid, $pwd, $challenge, - $this->host, 'smtp')); - - if (PEAR::isError($error = $this->_put($auth_str))) { - return $error; - } - /* 334: Continue authentication request */ - if (PEAR::isError($error = $this->_parseResponse(334))) { - return $error; - } - - /* We don't use the protocol's third step because SMTP doesn't - * allow subsequent authentication, so we just silently ignore - * it. */ - if (PEAR::isError($error = $this->_put(''))) { - return $error; - } - /* 235: Authentication successful */ - if (PEAR::isError($error = $this->_parseResponse(235))) { - return $error; - } - } - - /** - * Authenticates the user using the CRAM-MD5 method. - * - * @param string The userid to authenticate as. - * @param string The password to authenticate with. - * - * @return mixed Returns a PEAR_Error with an error message on any - * kind of failure, or true on success. - * - * @since 1.1.0 - * @deprecated 本体で使用されていないため非推奨 - */ - public function _authCRAM_MD5($uid, $pwd) - { - if (PEAR::isError($error = $this->_put('AUTH', 'CRAM-MD5'))) { - return $error; - } - /* 334: Continue authentication request */ - if (PEAR::isError($error = $this->_parseResponse(334))) { - /* 503: Error: already authenticated */ - if ($this->_code === 503) { - return true; - } - - return $error; - } - - $challenge = base64_decode($this->_arguments[0]); - $cram = &Auth_SASL::factory('crammd5'); - $auth_str = base64_encode($cram->getResponse($uid, $pwd, $challenge)); - - if (PEAR::isError($error = $this->_put($auth_str))) { - return $error; - } - - /* 235: Authentication successful */ - if (PEAR::isError($error = $this->_parseResponse(235))) { - return $error; - } - } - - /** - * Authenticates the user using the LOGIN method. - * - * @param string The userid to authenticate as. - * @param string The password to authenticate with. - * - * @return mixed Returns a PEAR_Error with an error message on any - * kind of failure, or true on success. - * - * @since 1.1.0 - */ - public function _authLogin($uid, $pwd) - { - if (PEAR::isError($error = $this->_put('AUTH', 'LOGIN'))) { - return $error; - } - /* 334: Continue authentication request */ - if (PEAR::isError($error = $this->_parseResponse(334))) { - /* 503: Error: already authenticated */ - if ($this->_code === 503) { - return true; - } - - return $error; - } - - if (PEAR::isError($error = $this->_put(base64_encode($uid)))) { - return $error; - } - /* 334: Continue authentication request */ - if (PEAR::isError($error = $this->_parseResponse(334))) { - return $error; - } - - if (PEAR::isError($error = $this->_put(base64_encode($pwd)))) { - return $error; - } - - /* 235: Authentication successful */ - if (PEAR::isError($error = $this->_parseResponse(235))) { - return $error; - } - - return true; - } - - /** - * Authenticates the user using the PLAIN method. - * - * @param string The userid to authenticate as. - * @param string The password to authenticate with. - * @param string The optional authorization proxy identifier. - * - * @return mixed Returns a PEAR_Error with an error message on any - * kind of failure, or true on success. - * - * @since 1.1.0 - */ - public function _authPlain($uid, $pwd, $authz = '') - { - if (PEAR::isError($error = $this->_put('AUTH', 'PLAIN'))) { - return $error; - } - /* 334: Continue authentication request */ - if (PEAR::isError($error = $this->_parseResponse(334))) { - /* 503: Error: already authenticated */ - if ($this->_code === 503) { - return true; - } - - return $error; - } - - $auth_str = base64_encode($authz.chr(0).$uid.chr(0).$pwd); - - if (PEAR::isError($error = $this->_put($auth_str))) { - return $error; - } - - /* 235: Authentication successful */ - if (PEAR::isError($error = $this->_parseResponse(235))) { - return $error; - } - - return true; - } - - /** - * Send the HELO command. - * - * @param string The domain name to say we are. - * - * @return mixed Returns a PEAR_Error with an error message on any - * kind of failure, or true on success. - * - * @since 1.0 - */ - public function helo($domain) - { - if (PEAR::isError($error = $this->_put('HELO', $domain))) { - return $error; - } - if (PEAR::isError($error = $this->_parseResponse(250))) { - return $error; - } - - return true; - } - - /** - * Return the list of SMTP service extensions advertised by the server. - * - * @return array The list of SMTP service extensions. - * - * @since 1.3 - */ - public function getServiceExtensions() - { - return $this->_esmtp; - } - - /** - * Send the MAIL FROM: command. - * - * @param string $sender The sender (reverse path) to set. - * @param string $params String containing additional MAIL parameters, - * such as the NOTIFY flags defined by RFC 1891 - * or the VERP protocol. - * - * If $params is an array, only the 'verp' option - * is supported. If 'verp' is true, the XVERP - * parameter is appended to the MAIL command. If - * the 'verp' value is a string, the full - * XVERP=value parameter is appended. - * - * @return mixed Returns a PEAR_Error with an error message on any - * kind of failure, or true on success. - * - * @since 1.0 - */ - public function mailFrom($sender, $params = null) - { - $args = "FROM:<$sender>"; - - /* Support the deprecated array form of $params. */ - if (is_array($params) && isset($params['verp'])) { - /* XVERP */ - if ($params['verp'] === true) { - $args .= ' XVERP'; - - /* XVERP=something */ - } elseif (trim($params['verp'])) { - $args .= ' XVERP='.$params['verp']; - } - } elseif (is_string($params)) { - $args .= ' '.$params; - } - - if (PEAR::isError($error = $this->_put('MAIL', $args))) { - return $error; - } - if (PEAR::isError($error = $this->_parseResponse(250, $this->pipelining))) { - return $error; - } - - return true; - } - - /** - * Send the RCPT TO: command. - * - * @param string $recipient The recipient (forward path) to add. - * @param string $params String containing additional RCPT parameters, - * such as the NOTIFY flags defined by RFC 1891. - * - * @return mixed Returns a PEAR_Error with an error message on any - * kind of failure, or true on success. - * - * @since 1.0 - */ - public function rcptTo($recipient, $params = null) - { - $args = "TO:<$recipient>"; - if (is_string($params)) { - $args .= ' '.$params; - } - - if (PEAR::isError($error = $this->_put('RCPT', $args))) { - return $error; - } - if (PEAR::isError($error = $this->_parseResponse([250, 251], $this->pipelining))) { - return $error; - } - - return true; - } - - /** - * Quote the data so that it meets SMTP standards. - * - * This is provided as a separate public function to facilitate - * easier overloading for the cases where it is desirable to - * customize the quoting behavior. - * - * @param string $data The message text to quote. The string must be passed - * by reference, and the text will be modified in place. - * - * @since 1.2 - */ - public function quotedata(&$data) - { - /* Change Unix (\n) and Mac (\r) linefeeds into - * Internet-standard CRLF (\r\n) linefeeds. */ - $data = preg_replace(['/(?_esmtp['SIZE'])) ? $this->_esmtp['SIZE'] : 0; - if ($limit > 0 && $size >= $limit) { - $this->disconnect(); - - return PEAR::raiseError('Message size exceeds server limit'); - } - - /* Initiate the DATA command. */ - if (PEAR::isError($error = $this->_put('DATA'))) { - return $error; - } - if (PEAR::isError($error = $this->_parseResponse(354))) { - return $error; - } - - /* If we have a separate headers string, send it first. */ - if (!is_null($headers)) { - $this->quotedata($headers); - if (PEAR::isError($result = $this->_send($headers."\r\n\r\n"))) { - return $result; - } - } - - /* Now we can send the message body data. */ - if (is_resource($data)) { - /* Stream the contents of the file resource out over our socket - * connection, line by line. Each line must be run through the - * quoting routine. */ - while ($line = fgets($data, 1024)) { - $this->quotedata($line); - if (PEAR::isError($result = $this->_send($line))) { - return $result; - } - } - } else { - /* - * Break up the data by sending one chunk (up to 512k) at a time. - * This approach reduces our peak memory usage. - */ - for ($offset = 0; $offset < $size;) { - $end = $offset + 512000; - - /* - * Ensure we don't read beyond our data size or span multiple - * lines. quotedata() can't properly handle character data - * that's split across two line break boundaries. - */ - if ($end >= $size) { - $end = $size; - } else { - for (; $end < $size; $end++) { - if ($data[$end] != "\n") { - break; - } - } - } - - /* Extract our chunk and run it through the quoting routine. */ - $chunk = substr($data, $offset, $end - $offset); - $this->quotedata($chunk); - - /* If we run into a problem along the way, abort. */ - if (PEAR::isError($result = $this->_send($chunk))) { - return $result; - } - - /* Advance the offset to the end of this chunk. */ - $offset = $end; - } - } - - /* Finally, send the DATA terminator sequence. */ - if (PEAR::isError($result = $this->_send("\r\n.\r\n"))) { - return $result; - } - - /* Verify that the data was successfully received by the server. */ - if (PEAR::isError($error = $this->_parseResponse(250, $this->pipelining))) { - return $error; - } - - return true; - } - - /** - * Send the SEND FROM: command. - * - * @param string The reverse path to send. - * - * @return mixed Returns a PEAR_Error with an error message on any - * kind of failure, or true on success. - * - * @since 1.2.6 - */ - public function sendFrom($path) - { - if (PEAR::isError($error = $this->_put('SEND', "FROM:<$path>"))) { - return $error; - } - if (PEAR::isError($error = $this->_parseResponse(250, $this->pipelining))) { - return $error; - } - - return true; - } - - /** - * Backwards-compatibility wrapper for sendFrom(). - * - * @param string The reverse path to send. - * - * @return mixed Returns a PEAR_Error with an error message on any - * kind of failure, or true on success. - * - * @since 1.0 - * @deprecated 1.2.6 - */ - public function send_from($path) - { - return self::sendFrom($path); - } - - /** - * Send the SOML FROM: command. - * - * @param string The reverse path to send. - * - * @return mixed Returns a PEAR_Error with an error message on any - * kind of failure, or true on success. - * - * @since 1.2.6 - */ - public function somlFrom($path) - { - if (PEAR::isError($error = $this->_put('SOML', "FROM:<$path>"))) { - return $error; - } - if (PEAR::isError($error = $this->_parseResponse(250, $this->pipelining))) { - return $error; - } - - return true; - } - - /** - * Backwards-compatibility wrapper for somlFrom(). - * - * @param string The reverse path to send. - * - * @return mixed Returns a PEAR_Error with an error message on any - * kind of failure, or true on success. - * - * @since 1.0 - * @deprecated 1.2.6 - */ - public function soml_from($path) - { - return self::somlFrom($path); - } - - /** - * Send the SAML FROM: command. - * - * @param string The reverse path to send. - * - * @return mixed Returns a PEAR_Error with an error message on any - * kind of failure, or true on success. - * - * @since 1.2.6 - */ - public function samlFrom($path) - { - if (PEAR::isError($error = $this->_put('SAML', "FROM:<$path>"))) { - return $error; - } - if (PEAR::isError($error = $this->_parseResponse(250, $this->pipelining))) { - return $error; - } - - return true; - } - - /** - * Backwards-compatibility wrapper for samlFrom(). - * - * @param string The reverse path to send. - * - * @return mixed Returns a PEAR_Error with an error message on any - * kind of failure, or true on success. - * - * @since 1.0 - * @deprecated 1.2.6 - */ - public function saml_from($path) - { - return self::samlFrom($path); - } - - /** - * Send the RSET command. - * - * @return mixed Returns a PEAR_Error with an error message on any - * kind of failure, or true on success. - * - * @since 1.0 - */ - public function rset() - { - if (PEAR::isError($error = $this->_put('RSET'))) { - return $error; - } - if (PEAR::isError($error = $this->_parseResponse(250, $this->pipelining))) { - return $error; - } - - return true; - } - - /** - * Send the VRFY command. - * - * @param string The string to verify - * - * @return mixed Returns a PEAR_Error with an error message on any - * kind of failure, or true on success. - * - * @since 1.0 - */ - public function vrfy($string) - { - /* Note: 251 is also a valid response code */ - if (PEAR::isError($error = $this->_put('VRFY', $string))) { - return $error; - } - if (PEAR::isError($error = $this->_parseResponse([250, 252]))) { - return $error; - } - - return true; - } - - /** - * Send the NOOP command. - * - * @return mixed Returns a PEAR_Error with an error message on any - * kind of failure, or true on success. - * - * @since 1.0 - */ - public function noop() - { - if (PEAR::isError($error = $this->_put('NOOP'))) { - return $error; - } - if (PEAR::isError($error = $this->_parseResponse(250))) { - return $error; - } - - return true; - } - - /** - * Backwards-compatibility method. identifySender()'s functionality is - * now handled internally. - * - * @return bool This method always return true. - * - * @since 1.0 - */ - public function identifySender() - { - return true; - } -} diff --git a/data/module/Net/Socket.php b/data/module/Net/Socket.php deleted file mode 100644 index 871ea7cd57..0000000000 --- a/data/module/Net/Socket.php +++ /dev/null @@ -1,657 +0,0 @@ - - * Chuck Hagenbuch - * - * @category Net - * - * @author Stig Bakken - * @author Chuck Hagenbuch - * @copyright 1997-2003 The PHP Group - * @license http://www.php.net/license/2_02.txt PHP 2.02 - * - * @version CVS: $Id$ - * - * @see http://pear.php.net/packages/Net_Socket - */ -require_once 'PEAR.php'; - -define('NET_SOCKET_READ', 1); -define('NET_SOCKET_WRITE', 2); -define('NET_SOCKET_ERROR', 4); - -/** - * Generalized Socket class. - * - * @category Net - * - * @author Stig Bakken - * @author Chuck Hagenbuch - * @copyright 1997-2003 The PHP Group - * @license http://www.php.net/license/2_02.txt PHP 2.02 - * - * @see http://pear.php.net/packages/Net_Socket - */ -class Net_Socket extends PEAR -{ - /** - * Socket file pointer. - * - * @var resource - */ - public $fp = null; - - /** - * Whether the socket is blocking. Defaults to true. - * - * @var bool - */ - public $blocking = true; - - /** - * Whether the socket is persistent. Defaults to false. - * - * @var bool - */ - public $persistent = false; - - /** - * The IP address to connect to. - * - * @var string - */ - public $addr = ''; - - /** - * The port number to connect to. - * - * @var int - */ - public $port = 0; - - /** - * Number of seconds to wait on socket connections before assuming - * there's no more data. Defaults to no timeout. - * - * @var int - */ - public $timeout = false; - - /** - * Number of bytes to read at a time in readLine() and - * readAll(). Defaults to 2048. - * - * @var int - */ - public $lineLength = 2048; - - /** - * The string to use as a newline terminator. Usually "\r\n" or "\n". - * - * @var string - */ - public $newline = "\r\n"; - - /** - * Connect to the specified port. If called when the socket is - * already connected, it disconnects and connects again. - * - * @param string $addr IP address or host name. - * @param int $port TCP port number. - * @param bool $persistent (optional) Whether the connection is - * persistent (kept open between requests - * by the web server). - * @param int $timeout (optional) How long to wait for data. - * @param array $options See options for stream_context_create. - * - * @return bool|PEAR_Error True on success or a PEAR_Error on failure. - */ - public function connect($addr, $port = 0, $persistent = null, - $timeout = null, $options = null) - { - if (is_resource($this->fp)) { - @fclose($this->fp); - $this->fp = null; - } - - if (!$addr) { - return $this->raiseError('$addr cannot be empty'); - } elseif (strspn($addr, '.0123456789') == strlen($addr) || - strstr($addr, '/') !== false) { - $this->addr = $addr; - } else { - $this->addr = @gethostbyname($addr); - } - - $this->port = $port % 65536; - - if ($persistent !== null) { - $this->persistent = $persistent; - } - - if ($timeout !== null) { - $this->timeout = $timeout; - } - - $openfunc = $this->persistent ? 'pfsockopen' : 'fsockopen'; - $errno = 0; - $errstr = ''; - - $old_track_errors = @ini_set('track_errors', 1); - - if ($options && function_exists('stream_context_create')) { - if ($this->timeout) { - $timeout = $this->timeout; - } else { - $timeout = 0; - } - $context = stream_context_create($options); - - // Since PHP 5 fsockopen doesn't allow context specification - if (function_exists('stream_socket_client')) { - $flags = STREAM_CLIENT_CONNECT; - - if ($this->persistent) { - $flags = STREAM_CLIENT_PERSISTENT; - } - - $addr = $this->addr.':'.$this->port; - $fp = stream_socket_client($addr, $errno, $errstr, - $timeout, $flags, $context); - } else { - $fp = @$openfunc($this->addr, $this->port, $errno, - $errstr, $timeout, $context); - } - } else { - if ($this->timeout) { - $fp = @$openfunc($this->addr, $this->port, $errno, - $errstr, $this->timeout); - } else { - $fp = @$openfunc($this->addr, $this->port, $errno, $errstr); - } - } - - if (!$fp) { - $error = error_get_last(); - if ($errno == 0 && !strlen($errstr) && isset($error)) { - $errstr = $error['message']; - } - @ini_set('track_errors', $old_track_errors); - - return $this->raiseError($errstr, $errno); - } - - @ini_set('track_errors', $old_track_errors); - $this->fp = $fp; - - return $this->setBlocking($this->blocking); - } - - /** - * Disconnects from the peer, closes the socket. - * - * @return mixed true on success or a PEAR_Error instance otherwise - */ - public function disconnect() - { - if (!is_resource($this->fp)) { - return $this->raiseError('not connected'); - } - - @fclose($this->fp); - $this->fp = null; - - return true; - } - - /** - * Set the newline character/sequence to use. - * - * @param string $newline Newline character(s) - * - * @return bool True - */ - public function setNewline($newline) - { - $this->newline = $newline; - - return true; - } - - /** - * Find out if the socket is in blocking mode. - * - * @return bool The current blocking mode. - */ - public function isBlocking() - { - return $this->blocking; - } - - /** - * Sets whether the socket connection should be blocking or - * not. A read call to a non-blocking socket will return immediately - * if there is no data available, whereas it will block until there - * is data for blocking sockets. - * - * @param bool $mode True for blocking sockets, false for nonblocking. - * - * @return mixed true on success or a PEAR_Error instance otherwise - */ - public function setBlocking($mode) - { - if (!is_resource($this->fp)) { - return $this->raiseError('not connected'); - } - - $this->blocking = $mode; - stream_set_blocking($this->fp, (int) $this->blocking); - - return true; - } - - /** - * Sets the timeout value on socket descriptor, - * expressed in the sum of seconds and microseconds - * - * @param int $seconds Seconds. - * @param int $microseconds Microseconds. - * - * @return mixed true on success or a PEAR_Error instance otherwise - */ - public function setTimeout($seconds, $microseconds) - { - if (!is_resource($this->fp)) { - return $this->raiseError('not connected'); - } - - return stream_set_timeout($this->fp, $seconds, $microseconds); - } - - /** - * Sets the file buffering size on the stream. - * See php's stream_set_write_buffer for more information. - * - * @param int $size Write buffer size. - * - * @return mixed on success or an PEAR_Error object otherwise - */ - public function setWriteBuffer($size) - { - if (!is_resource($this->fp)) { - return $this->raiseError('not connected'); - } - - $returned = stream_set_write_buffer($this->fp, $size); - if ($returned == 0) { - return true; - } - - return $this->raiseError('Cannot set write buffer.'); - } - - /** - * Returns information about an existing socket resource. - * Currently returns four entries in the result array: - * - *

- * timed_out (bool) - The socket timed out waiting for data
- * blocked (bool) - The socket was blocked
- * eof (bool) - Indicates EOF event
- * unread_bytes (int) - Number of bytes left in the socket buffer
- *

- * - * @return mixed Array containing information about existing socket - * resource or a PEAR_Error instance otherwise - */ - public function getStatus() - { - if (!is_resource($this->fp)) { - return $this->raiseError('not connected'); - } - - return stream_get_meta_data($this->fp); - } - - /** - * Get a specified line of data - * - * @param int $size ?? - * - * @return $size bytes of data from the socket, or a PEAR_Error if - * not connected. - */ - public function gets($size = null) - { - if (!is_resource($this->fp)) { - return $this->raiseError('not connected'); - } - - if (is_null($size)) { - return @fgets($this->fp); - } else { - return @fgets($this->fp, $size); - } - } - - /** - * Read a specified amount of data. This is guaranteed to return, - * and has the added benefit of getting everything in one fread() - * chunk; if you know the size of the data you're getting - * beforehand, this is definitely the way to go. - * - * @param int $size The number of bytes to read from the socket. - * - * @return $size bytes of data from the socket, or a PEAR_Error if - * not connected. - */ - public function read($size) - { - if (!is_resource($this->fp)) { - return $this->raiseError('not connected'); - } - - return @fread($this->fp, $size); - } - - /** - * Write a specified amount of data. - * - * @param string $data Data to write. - * @param int $blocksize Amount of data to write at once. - * NULL means all at once. - * - * @return mixed If the socket is not connected, returns an instance of - * PEAR_Error - * If the write succeeds, returns the number of bytes written - * If the write fails, returns false. - */ - public function write($data, $blocksize = null) - { - if (!is_resource($this->fp)) { - return $this->raiseError('not connected'); - } - - if (is_null($blocksize) && !OS_WINDOWS) { - return @fwrite($this->fp, $data); - } else { - if (is_null($blocksize)) { - $blocksize = 1024; - } - - $pos = 0; - $size = strlen($data); - while ($pos < $size) { - $written = @fwrite($this->fp, substr($data, $pos, $blocksize)); - if (!$written) { - return $written; - } - $pos += $written; - } - - return $pos; - } - } - - /** - * Write a line of data to the socket, followed by a trailing newline. - * - * @param string $data Data to write - * - * @return mixed fputs result, or an error - */ - public function writeLine($data) - { - if (!is_resource($this->fp)) { - return $this->raiseError('not connected'); - } - - return fwrite($this->fp, $data.$this->newline); - } - - /** - * Tests for end-of-file on a socket descriptor. - * - * Also returns true if the socket is disconnected. - * - * @return bool - */ - public function eof() - { - return !is_resource($this->fp) || feof($this->fp); - } - - /** - * Reads a byte of data - * - * @return 1 byte of data from the socket, or a PEAR_Error if - * not connected. - */ - public function readByte() - { - if (!is_resource($this->fp)) { - return $this->raiseError('not connected'); - } - - return ord(@fread($this->fp, 1)); - } - - /** - * Reads a word of data - * - * @return 1 word of data from the socket, or a PEAR_Error if - * not connected. - */ - public function readWord() - { - if (!is_resource($this->fp)) { - return $this->raiseError('not connected'); - } - - $buf = @fread($this->fp, 2); - - return ord($buf[0]) + (ord($buf[1]) << 8); - } - - /** - * Reads an int of data - * - * @return int 1 int of data from the socket, or a PEAR_Error if - * not connected. - */ - public function readInt() - { - if (!is_resource($this->fp)) { - return $this->raiseError('not connected'); - } - - $buf = @fread($this->fp, 4); - - return ord($buf[0]) + (ord($buf[1]) << 8) + - (ord($buf[2]) << 16) + (ord($buf[3]) << 24); - } - - /** - * Reads a zero-terminated string of data - * - * @return string, or a PEAR_Error if - * not connected. - */ - public function readString() - { - if (!is_resource($this->fp)) { - return $this->raiseError('not connected'); - } - - $string = ''; - while (($char = @fread($this->fp, 1)) != "\x00") { - $string .= $char; - } - - return $string; - } - - /** - * Reads an IP Address and returns it in a dot formatted string - * - * @return Dot formatted string, or a PEAR_Error if - * not connected. - */ - public function readIPAddress() - { - if (!is_resource($this->fp)) { - return $this->raiseError('not connected'); - } - - $buf = @fread($this->fp, 4); - - return sprintf('%d.%d.%d.%d', ord($buf[0]), ord($buf[1]), - ord($buf[2]), ord($buf[3])); - } - - /** - * Read until either the end of the socket or a newline, whichever - * comes first. Strips the trailing newline from the returned data. - * - * @return All available data up to a newline, without that - * newline, or until the end of the socket, or a PEAR_Error if - * not connected. - */ - public function readLine() - { - if (!is_resource($this->fp)) { - return $this->raiseError('not connected'); - } - - $line = ''; - - $timeout = time() + $this->timeout; - - while (!feof($this->fp) && (!$this->timeout || time() < $timeout)) { - $line .= @fgets($this->fp, $this->lineLength); - if (substr($line, -1) == "\n") { - return rtrim($line, $this->newline); - } - } - - return $line; - } - - /** - * Read until the socket closes, or until there is no more data in - * the inner PHP buffer. If the inner buffer is empty, in blocking - * mode we wait for at least 1 byte of data. Therefore, in - * blocking mode, if there is no data at all to be read, this - * function will never exit (unless the socket is closed on the - * remote end). - * - * @return string All data until the socket closes, or a PEAR_Error if - * not connected. - */ - public function readAll() - { - if (!is_resource($this->fp)) { - return $this->raiseError('not connected'); - } - - $data = ''; - while (!feof($this->fp)) { - $data .= @fread($this->fp, $this->lineLength); - } - - return $data; - } - - /** - * Runs the equivalent of the select() system call on the socket - * with a timeout specified by tv_sec and tv_usec. - * - * @param int $state Which of read/write/error to check for. - * @param int $tv_sec Number of seconds for timeout. - * @param int $tv_usec Number of microseconds for timeout. - * - * @return false if select fails, integer describing which of read/write/error - * are ready, or PEAR_Error if not connected. - */ - public function select($state, $tv_sec, $tv_usec = 0) - { - if (!is_resource($this->fp)) { - return $this->raiseError('not connected'); - } - - $read = null; - $write = null; - $except = null; - if ($state & NET_SOCKET_READ) { - $read[] = $this->fp; - } - if ($state & NET_SOCKET_WRITE) { - $write[] = $this->fp; - } - if ($state & NET_SOCKET_ERROR) { - $except[] = $this->fp; - } - if (false === ($sr = stream_select($read, $write, $except, - $tv_sec, $tv_usec))) { - return false; - } - - $result = 0; - if (count($read)) { - $result |= NET_SOCKET_READ; - } - if (count($write)) { - $result |= NET_SOCKET_WRITE; - } - if (count($except)) { - $result |= NET_SOCKET_ERROR; - } - - return $result; - } - - /** - * Turns encryption on/off on a connected socket. - * - * @param bool $enabled Set this parameter to true to enable encryption - * and false to disable encryption. - * @param int $type Type of encryption. See stream_socket_enable_crypto() - * for values. - * - * @see http://se.php.net/manual/en/function.stream-socket-enable-crypto.php - * - * @return false on error, true on success and 0 if there isn't enough data - * and the user should try again (non-blocking sockets only). - * A PEAR_Error object is returned if the socket is not - * connected - */ - public function enableCrypto($enabled, $type) - { - if (version_compare(PHP_VERSION, '5.1.0', '>=')) { - if (!is_resource($this->fp)) { - return $this->raiseError('not connected'); - } - stream_context_set_option($this->fp, 'ssl', 'verify_peer_name', false); - - return @stream_socket_enable_crypto($this->fp, $enabled, $type); - } else { - $msg = 'Net_Socket::enableCrypto() requires php version >= 5.1.0'; - - return $this->raiseError($msg); - } - } -} diff --git a/data/module/Net/URL.php b/data/module/Net/URL.php index 057c68a4be..e39e732e69 100644 --- a/data/module/Net/URL.php +++ b/data/module/Net/URL.php @@ -154,8 +154,8 @@ public function initialize() /* * Figure out host/port */ - if (!empty($HTTP_SERVER_VARS['HTTP_HOST']) && - preg_match('/^(.*)(:([0-9]+))?$/U', $HTTP_SERVER_VARS['HTTP_HOST'], $matches)) { + if (!empty($HTTP_SERVER_VARS['HTTP_HOST']) + && preg_match('/^(.*)(:([0-9]+))?$/U', $HTTP_SERVER_VARS['HTTP_HOST'], $matches)) { $host = $matches[1]; if (!empty($matches[3])) { $port = $matches[3]; @@ -195,7 +195,7 @@ public function initialize() break; case 'path': - if (strpos($value, '/') === 0) { + if (str_starts_with($value, '/')) { $this->path = $value; } else { $path = dirname($this->path) == DIRECTORY_SEPARATOR ? '' : dirname($this->path); @@ -328,7 +328,7 @@ public function _parseRawQuerystring($querystring) $return = []; foreach ($parts as $part) { - if (strpos($part, '=') !== false) { + if (str_contains($part, '=')) { $value = substr($part, strpos($part, '=') + 1); $key = substr($part, 0, strpos($part, '=')); } else { diff --git a/data/module/gdthumb.php b/data/module/gdthumb.php index 95a7d19563..aa4af01abe 100644 --- a/data/module/gdthumb.php +++ b/data/module/gdthumb.php @@ -148,7 +148,7 @@ public function Main($path, $width, $height, $dst_file, $header = false) return ''; } else { - $dst_file = $dst_file.'.gif'; + $dst_file .= '.gif'; if ($re_size[0] == $size[0] && $re_size[1] == $size[1]) { // サイズが同じ場合には、そのままコピーする。(画質劣化を防ぐ) copy($path, $dst_file); @@ -165,7 +165,7 @@ public function Main($path, $width, $height, $dst_file, $header = false) return ''; } else { - $dst_file = $dst_file.'.png'; + $dst_file .= '.png'; if ($re_size[0] == $size[0] && $re_size[1] == $size[1]) { // サイズが同じ場合には、そのままコピーする。(画質劣化を防ぐ) copy($path, $dst_file); @@ -195,7 +195,7 @@ public function Main($path, $width, $height, $dst_file, $header = false) return ''; } else { - $dst_file = $dst_file.'.png'; + $dst_file .= '.png'; imagepng($dst_im, $dst_file); } imagedestroy($dst_im); @@ -216,7 +216,7 @@ public function Main($path, $width, $height, $dst_file, $header = false) return ''; } else { - $dst_file = $dst_file.'.jpg'; + $dst_file .= '.jpg'; if ($re_size[0] == $size[0] && $re_size[1] == $size[1]) { // サイズが同じ場合には、そのままコピーする。(画質劣化を防ぐ) @@ -263,7 +263,7 @@ public function Main($path, $width, $height, $dst_file, $header = false) return ''; } else { - $dst_file = $dst_file.'.png'; + $dst_file .= '.png'; if ($re_size[0] == $size[0] && $re_size[1] == $size[1]) { // サイズが同じ場合には、そのままコピーする。(画質劣化を防ぐ) copy($path, $dst_file); diff --git a/eccube_install.sh b/eccube_install.sh index 6aa5fbc35e..8e16a1b24e 100755 --- a/eccube_install.sh +++ b/eccube_install.sh @@ -232,29 +232,29 @@ case "${DBTYPE}" in "heroku" ) # PostgreSQL echo "create table..." - ${PSQL} -h ${DBSERVER} -U ${DBUSER} -p ${DBPORT} -f ${SQL_DIR}/create_table_pgsql.sql ${DBNAME} + ${PSQL} -h ${DBSERVER} -U ${DBUSER} -p ${DBPORT} -v ON_ERROR_STOP=1 -f ${SQL_DIR}/create_table_pgsql.sql ${DBNAME} echo "insert data..." - ${PSQL} -h ${DBSERVER} -U ${DBUSER} -p ${DBPORT} -f ${SQL_DIR}/insert_data.sql ${DBNAME} + ${PSQL} -h ${DBSERVER} -U ${DBUSER} -p ${DBPORT} -v ON_ERROR_STOP=1 -f ${SQL_DIR}/insert_data.sql ${DBNAME} echo "create sequence table..." create_sequence_tables echo "execute optional SQL..." - get_optional_sql | ${PSQL} -h ${DBSERVER} -U ${DBUSER} -p ${DBPORT} ${DBNAME} + get_optional_sql | ${PSQL} -h ${DBSERVER} -U ${DBUSER} -p ${DBPORT} -v ON_ERROR_STOP=1 ${DBNAME} DBTYPE="pgsql" ;; "appveyor" | "pgsql" ) # PostgreSQL echo "dropdb..." - ${PSQL} -h ${DBSERVER} -U ${DBUSER} -p ${DBPORT} -c "DROP DATABASE IF EXISTS ${DBNAME};" template1 + ${PSQL} -h ${DBSERVER} -U ${DBUSER} -p ${DBPORT} -v ON_ERROR_STOP=1 -c "DROP DATABASE IF EXISTS ${DBNAME};" template1 echo "createdb..." - ${PSQL} -h ${DBSERVER} -U ${DBUSER} -p ${DBPORT} -c "CREATE DATABASE ${DBNAME};" template1 + ${PSQL} -h ${DBSERVER} -U ${DBUSER} -p ${DBPORT} -v ON_ERROR_STOP=1 -c "CREATE DATABASE ${DBNAME};" template1 echo "create table..." - ${PSQL} -h ${DBSERVER} -U ${DBUSER} -p ${DBPORT} -f ${SQL_DIR}/create_table_pgsql.sql ${DBNAME} + ${PSQL} -h ${DBSERVER} -U ${DBUSER} -p ${DBPORT} -v ON_ERROR_STOP=1 -f ${SQL_DIR}/create_table_pgsql.sql ${DBNAME} echo "insert data..." - ${PSQL} -h ${DBSERVER} -U ${DBUSER} -p ${DBPORT} -f ${SQL_DIR}/insert_data.sql ${DBNAME} + ${PSQL} -h ${DBSERVER} -U ${DBUSER} -p ${DBPORT} -v ON_ERROR_STOP=1 -f ${SQL_DIR}/insert_data.sql ${DBNAME} echo "create sequence table..." create_sequence_tables echo "execute optional SQL..." - get_optional_sql | ${PSQL} -h ${DBSERVER} -U ${DBUSER} -p ${DBPORT} ${DBNAME} + get_optional_sql | ${PSQL} -h ${DBSERVER} -U ${DBUSER} -p ${DBPORT} -v ON_ERROR_STOP=1 ${DBNAME} DBTYPE="pgsql" ;; "mysql" ) diff --git a/html/admin/css/common.css b/html/admin/css/common.css deleted file mode 100644 index 739a87bbf5..0000000000 --- a/html/admin/css/common.css +++ /dev/null @@ -1,37 +0,0 @@ -/* - * This file is part of EC-CUBE - * - * Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved. - * - * http://www.ec-cube.co.jp/ - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -@charset ""; -.fs10 {font-size: 62.5%; line-height: 150%;} -.fs12 {font-size: 75%; line-height: 150%;} -.fs14 {font-size: 87.5%; line-height: 150%;} -.fs18 {font-size: 117.5%; line-height: 150%;} -.fs22 {font-size: 137.5%; line-height: 130%;} -.fs24 {font-size: 150%; line-height: 130%;} -.fs30 {font-size: 187.5%; line-height: 125%;} -.fs10n {font-size: 62.5%;} -.fs12n {font-size: 75%;} -.fs14n {font-size: 87.5%;} -.fs18n {font-size: 117.5%;} -.fs22n {font-size: 137.5%;} -.fs24n {font-size: 150%;} -.fs30n {font-size: 187.5%;} -.fs12st {font-size: 75%; line-height: 150%; font-weight: bold;} diff --git a/html/admin/css/install.css b/html/admin/css/install.css deleted file mode 100644 index 1d7ed13ebb..0000000000 --- a/html/admin/css/install.css +++ /dev/null @@ -1,123 +0,0 @@ -/* - * This file is part of EC-CUBE - * - * Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved. - * - * http://www.ec-cube.co.jp/ - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -@charset "utf-8"; - -input,select,option,textarea { - font-family:"�l�r �o�S�V�b�N","Hiragino Maru Gothic Pro","�q���M�m�ۃS Pro W4",Osaka,sans-serif; - font-size: 13px; -} - - -/*LINK*/ -a:link { color: #006699; text-decoration: none; } -a:visited { color: #006699; text-decoration: none; } -a:hover { color: #f9a406; text-decoration: underline; } - - -/*FORM*/ -.box3 { width: 33px; } /*W3*/ -.box6 { width: 54px; } /*W6*/ -.box10 { width: 82px; } /*W10*/ -.box20 { width: 152px; } /*W20*/ -.box25 { width: 187px; } /*W25*/ -.box30 { width: 222px; } /*W30*/ -.box33 { width: 243px; } /*W33*/ -.box35 { width: 257px; } /*W35*/ -.box40 { width: 292px; } /*W40*/ -.box45 { width: 341px; } /*W45*/ -.box50 { width: 362px; } /*W50*/ -.box52 { width: 376px; } /*W52*/ -.box54 { width: 390px; } /*W54*/ -.box60 { width: 432px; } /*W60*/ -.box65 { width: 467px; } /*W65*/ -.box68 { width: 488px; } /*W68*/ -.box76 { width: 544px; } /*W76*/ - -.area40 { width: 302px; height: 134px; } /*W40�~H8*/ -.area45 { width: 337px; height: 290px; } /*W40�~H20*/ -.area46 { width: 337px; height: 134px; } /*W40�~H8*/ -.area50 { width: 372px; height: 82px; } /*W50�~H4*/ -.area55 { width: 407px; height: 82px; } /*W50�~H4*/ -.area59 { width: 432px; height: 134px; } /*W59�~H8*/ -.area60 { width: 433px; height: 134px; } /*W60�~H8*/ -.area61 { width: 433px; height: 82px; } /*W60�~H4*/ -.area65 { width: 444px; height: 290px; } /*W65�~H20*/ -.area70 { width: 512px; height: 186px; } /*W70�~H12*/ -.area75 { width: 547px; height: 186px; } /*W75�~H12*/ -.area80 { width: 572px; height: 134px; } /*W80�~H8*/ -.area90 { width: 650px; height: 420px; } -.area96 { width: 694px; height: 420px; } /*W80�~H30*/ -.area96_2 { width: 694px; height: 160px; } /*W80�~H10*/ -.area99 { width: 715px; height: 523px; } /*W99�~H40*/ - -/*COLOR*/ -.ast { color: #cc0000; font-size: 90%; } -.darkred { color: #cc0000; } -.gray { color: #b6b7ba; } -.white { color: #ffffff; } -.whitest { color: #ffffff; font-weight: bold; } -.white10 { color: #ffffff; font-size: 62.5%;} -.red { color: #ff0000; } -.red10 { color:#ff0000; font-size: 10px; } -.red12 { color:#cc0000; font-size: 12px; } -.reselt { color: #ffcc00; font-size: 120%; font-weight: bold; } - - -.infodate { - color: #cccccc; font-size: 62.5%; font-weight: bold; - padding: 0 0 0 8px; -} - -.infottl { - color: #ffffff; - font-size: 62.5%; - line-height: 150%; -} - -.info { - padding: 0 4px; - display: block; -} - -.title { - padding: 0px 0px 20px 25px; - color: #ffffff; - font-weight: bold; - line-height: 120%; -} - -/*IMG*/ -img { - border: 0; -} - -#agreement{ - height: 120px; - width: 480px; - overflow: auto; - margin: 0px; - background-color : #FFFFFF; - border-style: solid; - border-color: #C0C0C0; - border-width: 1px -} diff --git a/html/admin/load_module_config.php b/html/admin/load_module_config.php index f3acba0830..4155d796bd 100644 --- a/html/admin/load_module_config.php +++ b/html/admin/load_module_config.php @@ -39,7 +39,7 @@ if (!empty($module_id) && is_numeric($module_id)) { GC_Utils_Ex::gfPrintLog('loading module ====> module_id = ' . $module_id); - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = SC_Query_Ex::getSingletonInstance(); $arrRet = $objQuery->select('module_code', 'dtb_module', 'module_id = ?', array($module_id)); if (isset($arrRet[0]['module_code'])) { diff --git a/html/install/sql/drop_table.sql b/html/install/sql/drop_table.sql index 8d8166a684..ddd8ccd152 100644 --- a/html/install/sql/drop_table.sql +++ b/html/install/sql/drop_table.sql @@ -1,98 +1,95 @@ -DROP TABLE dtb_kiyaku; -DROP TABLE mtb_zip; -DROP TABLE dtb_update; -DROP TABLE dtb_baseinfo; -DROP TABLE dtb_deliv; -DROP TABLE dtb_delivtime; -DROP TABLE dtb_delivfee; -DROP TABLE dtb_payment; -DROP TABLE dtb_mailtemplate; -DROP TABLE dtb_send_history; -DROP TABLE dtb_send_customer; -DROP TABLE dtb_product_categories; -DROP TABLE dtb_products_class; -DROP TABLE dtb_products; -DROP TABLE dtb_product_status; -DROP TABLE dtb_class; -DROP TABLE dtb_classcategory; -DROP TABLE dtb_category; -DROP TABLE dtb_recommend_products; -DROP TABLE dtb_review; -DROP TABLE dtb_category_count; -DROP TABLE dtb_category_total_count; -DROP TABLE dtb_customer_reading; -DROP TABLE mtb_customer_status; -DROP TABLE dtb_news; -DROP TABLE dtb_best_products; -DROP TABLE dtb_mail_history; -DROP TABLE dtb_customer; -DROP TABLE dtb_order; -DROP TABLE dtb_order_temp; -DROP TABLE dtb_shipping; -DROP TABLE dtb_shipment_item; -DROP TABLE dtb_other_deliv; -DROP TABLE dtb_order_detail; -DROP TABLE mtb_pref; -DROP TABLE dtb_member; -DROP TABLE dtb_pagelayout; -DROP TABLE dtb_bloc; -DROP TABLE dtb_blocposition; -DROP TABLE dtb_csv; -DROP TABLE dtb_csv_sql; -DROP TABLE dtb_templates; -DROP TABLE dtb_ownersstore_settings; -DROP TABLE dtb_module_update_logs; -DROP TABLE mtb_work; -DROP TABLE mtb_wday; -DROP TABLE mtb_taxrule; -DROP TABLE mtb_target; -DROP TABLE mtb_status_image; -DROP TABLE mtb_status; -DROP TABLE mtb_sex; -DROP TABLE mtb_review_deny_url; -DROP TABLE mtb_reminder; -DROP TABLE mtb_recommend; -DROP TABLE mtb_product_status_color; -DROP TABLE mtb_product_list_max; -DROP TABLE mtb_permission; -DROP TABLE mtb_page_max; -DROP TABLE mtb_order_status_color; -DROP TABLE mtb_order_status; -DROP TABLE mtb_customer_order_status; -DROP TABLE mtb_mail_type; -DROP TABLE mtb_mail_tpl_path; -DROP TABLE mtb_mail_template; -DROP TABLE mtb_mail_magazine_type; -DROP TABLE mtb_magazine_type; -DROP TABLE mtb_mobile_domain; -DROP TABLE mtb_job; -DROP TABLE mtb_disp; -DROP TABLE mtb_disable_logout; -DROP TABLE mtb_delivery_date; -DROP TABLE mtb_db; -DROP TABLE mtb_convenience; -DROP TABLE mtb_conveni_message; -DROP TABLE mtb_constants; -DROP TABLE mtb_authority; -DROP TABLE mtb_allowed_tag; -DROP TABLE mtb_ownersstore_err; -DROP TABLE dtb_maker; -DROP TABLE dtb_maker_count; -DROP TABLE dtb_holiday; -DROP TABLE dtb_customer_favorite_products; -DROP TABLE mtb_product_type; -DROP TABLE mtb_device_type; -DROP TABLE dtb_module; -DROP TABLE dtb_session; -DROP TABLE dtb_mobile_ext_session_id; -DROP TABLE dtb_bkup; -DROP TABLE dtb_plugin; -DROP TABLE dtb_index_list; -DROP TABLE dtb_payment_options; -DROP TABLE dtb_mailmaga_template; -DROP TABLE mtb_auth_excludes; -DROP TABLE dtb_plugin_hookpoint; -DROP TABLE dtb_api_config; -DROP TABLE dtb_api_account; -DROP TABLE dtb_tax_rule; -DROP TABLE mtb_country; +DROP TABLE IF EXISTS dtb_kiyaku; +DROP TABLE IF EXISTS mtb_zip; +DROP TABLE IF EXISTS dtb_update; +DROP TABLE IF EXISTS dtb_baseinfo; +DROP TABLE IF EXISTS dtb_deliv; +DROP TABLE IF EXISTS dtb_delivtime; +DROP TABLE IF EXISTS dtb_delivfee; +DROP TABLE IF EXISTS dtb_payment; +DROP TABLE IF EXISTS dtb_mailtemplate; +DROP TABLE IF EXISTS dtb_send_history; +DROP TABLE IF EXISTS dtb_send_customer; +DROP TABLE IF EXISTS dtb_product_categories; +DROP TABLE IF EXISTS dtb_products_class; +DROP TABLE IF EXISTS dtb_products; +DROP TABLE IF EXISTS dtb_product_status; +DROP TABLE IF EXISTS dtb_class; +DROP TABLE IF EXISTS dtb_classcategory; +DROP TABLE IF EXISTS dtb_category; +DROP TABLE IF EXISTS dtb_recommend_products; +DROP TABLE IF EXISTS dtb_review; +DROP TABLE IF EXISTS dtb_category_count; +DROP TABLE IF EXISTS dtb_category_total_count; +DROP TABLE IF EXISTS mtb_customer_status; +DROP TABLE IF EXISTS dtb_news; +DROP TABLE IF EXISTS dtb_best_products; +DROP TABLE IF EXISTS dtb_mail_history; +DROP TABLE IF EXISTS dtb_customer; +DROP TABLE IF EXISTS dtb_order; +DROP TABLE IF EXISTS dtb_order_temp; +DROP TABLE IF EXISTS dtb_shipping; +DROP TABLE IF EXISTS dtb_shipment_item; +DROP TABLE IF EXISTS dtb_other_deliv; +DROP TABLE IF EXISTS dtb_order_detail; +DROP TABLE IF EXISTS mtb_pref; +DROP TABLE IF EXISTS dtb_member; +DROP TABLE IF EXISTS dtb_pagelayout; +DROP TABLE IF EXISTS dtb_bloc; +DROP TABLE IF EXISTS dtb_blocposition; +DROP TABLE IF EXISTS dtb_csv; +DROP TABLE IF EXISTS dtb_csv_sql; +DROP TABLE IF EXISTS dtb_templates; +DROP TABLE IF EXISTS dtb_ownersstore_settings; +DROP TABLE IF EXISTS dtb_module_update_logs; +DROP TABLE IF EXISTS mtb_work; +DROP TABLE IF EXISTS mtb_wday; +DROP TABLE IF EXISTS mtb_taxrule; +DROP TABLE IF EXISTS mtb_target; +DROP TABLE IF EXISTS mtb_status_image; +DROP TABLE IF EXISTS mtb_status; +DROP TABLE IF EXISTS mtb_sex; +DROP TABLE IF EXISTS mtb_review_deny_url; +DROP TABLE IF EXISTS mtb_reminder; +DROP TABLE IF EXISTS mtb_recommend; +DROP TABLE IF EXISTS mtb_product_status_color; +DROP TABLE IF EXISTS mtb_product_list_max; +DROP TABLE IF EXISTS mtb_permission; +DROP TABLE IF EXISTS mtb_page_max; +DROP TABLE IF EXISTS mtb_order_status_color; +DROP TABLE IF EXISTS mtb_order_status; +DROP TABLE IF EXISTS mtb_customer_order_status; +DROP TABLE IF EXISTS mtb_mail_type; +DROP TABLE IF EXISTS mtb_mail_tpl_path; +DROP TABLE IF EXISTS mtb_mail_template; +DROP TABLE IF EXISTS mtb_mail_magazine_type; +DROP TABLE IF EXISTS mtb_magazine_type; +DROP TABLE IF EXISTS mtb_mobile_domain; +DROP TABLE IF EXISTS mtb_job; +DROP TABLE IF EXISTS mtb_disp; +DROP TABLE IF EXISTS mtb_disable_logout; +DROP TABLE IF EXISTS mtb_delivery_date; +DROP TABLE IF EXISTS mtb_db; +DROP TABLE IF EXISTS mtb_constants; +DROP TABLE IF EXISTS mtb_authority; +DROP TABLE IF EXISTS mtb_allowed_tag; +DROP TABLE IF EXISTS mtb_ownersstore_err; +DROP TABLE IF EXISTS dtb_maker; +DROP TABLE IF EXISTS dtb_maker_count; +DROP TABLE IF EXISTS dtb_holiday; +DROP TABLE IF EXISTS dtb_customer_favorite_products; +DROP TABLE IF EXISTS mtb_product_type; +DROP TABLE IF EXISTS mtb_device_type; +DROP TABLE IF EXISTS dtb_module; +DROP TABLE IF EXISTS dtb_session; +DROP TABLE IF EXISTS dtb_mobile_ext_session_id; +DROP TABLE IF EXISTS dtb_bkup; +DROP TABLE IF EXISTS dtb_plugin; +DROP TABLE IF EXISTS dtb_index_list; +DROP TABLE IF EXISTS dtb_payment_options; +DROP TABLE IF EXISTS dtb_mailmaga_template; +DROP TABLE IF EXISTS mtb_auth_excludes; +DROP TABLE IF EXISTS dtb_plugin_hookpoint; +DROP TABLE IF EXISTS dtb_api_config; +DROP TABLE IF EXISTS dtb_api_account; +DROP TABLE IF EXISTS dtb_tax_rule; +DROP TABLE IF EXISTS mtb_country; diff --git a/html/test/upgrade/index.php b/html/test/upgrade/index.php index 6cd47ca40e..06e7050a68 100644 --- a/html/test/upgrade/index.php +++ b/html/test/upgrade/index.php @@ -56,13 +56,13 @@ ); switch (getMode()) { -case 'products_list': - displayProductsList(); - break; + case 'products_list': + displayProductsList(); + break; -default: - displayProductsList(); - break; + default: + displayProductsList(); + break; } /** @@ -106,7 +106,7 @@ function updateModuleTable($arrProductsList) { $table = 'dtb_module'; $where = 'module_id = ?'; - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = SC_Query_Ex::getSingletonInstance(); $objQuery->begin(); foreach ($arrProductsList as $arrProduct) { diff --git a/html/user_data/packages/admin/css/admin.css b/html/user_data/packages/admin/css/admin.css new file mode 100644 index 0000000000..1e1af7a10a --- /dev/null +++ b/html/user_data/packages/admin/css/admin.css @@ -0,0 +1,1846 @@ +@charset "utf-8"; + +/************************************************ + ブラウザリセット +************************************************ */ + +html, +body, +div, +span, +applet, +object, +iframe, +h1, +h2, +h3, +h4, +h5, +h6, +p, +blockquote, +pre, +a, +abbr, +acronym, +address, +big, +cite, +code, +del, +dfn, +em, +font, +img, +ins, +kbd, +q, +s, +samp, +small, +strike, +strong, +sub, +sup, +tt, +var, +dl, +dt, +dd, +ol, +ul, +li, +fieldset, +form, +label, +legend, +table, +caption, +tbody, +tfoot, +thead, +tr, +th, +td { + margin: 0; + padding: 0; + border: 0; +} + +table, +caption, +th, +td { + margin: 0; + padding: 0; + border: 0; + border-collapse: collapse; + border-spacing: 0px; + empty-cells: show; + text-align: left; + font-weight: normal; +} + +a img, +iframe { + border: none; +} + +ol, +ul, +li { + list-style: none; +} + +input, +textarea, +select, +button { + font-size: 100%; + font-family: inherit; +} + +html { + height: 100%; +} + +body { + width: 100%; + height: 100%; + background: #fff; + font-family: "MS Pゴシック", "Hiragino Maru Gothic Pro", "ヒラギノ丸ゴ Pro W4", Osaka, sans-serif; + font-size: 80%; + line-height: 120%; +} + +option { + margin-right: 3px; + font-size: 100%; +} + +input, +textarea { + margin-right: 3px; +} + +select { + font-size: 100%; + + &.top { + margin-bottom: 5px; + } +} + +input.top, +textarea.top { + margin-bottom: 5px; +} + +.page_rows { + margin-bottom: 20px; +} + +hr { + display: none; +} + +h1 { + border-top: 1px solid #b3b4bd; + border-bottom: 1px solid #d9dadf; + height: 30px; + line-height: 30px; + color: #444757; + background: url('../img/contents/subtitle_back_02.jpg') repeat-x; + font-size: 130%; + + span { + &.title { + display: block; + padding-top: 2px; + padding-left: 20px; + background: url('../img/contents/subtitle_back.gif') no-repeat; + } + + &.subtitle { + display: block; + padding-top: 2px; + padding-left: 10px; + } + } +} + +h2 { + margin: 0 0 10px 0; + padding: 5px 0; + border-bottom: 3px solid #ccc; + color: #444757; + font-size: 100%; +} + +h3 { + margin-bottom: 20px; + padding: 5px; + color: #fff; + background: #999; + font-size: 90%; +} + +/*テーブル設定*/ + +table { + margin: 0 0 20px; + border-collapse: collapse; + width: 100%; + font-size: 100%; +} + +th, +td { + padding: 5px; + border: 1px solid #ccc; +} + +th { + width: 240px; + background: url('../img/contents/table_back.png') repeat-x #f4f5f5; + font-weight: normal; + text-align: left; +} + +table { + &.list { + th { + background: url('../img/contents/table_back.png') repeat-x #b4b4b4; + text-align: center; + + &.column { + background: url('../img/contents/table_back.png') repeat-x #f4f5f5; + text-align: left; + } + } + + .edit, + .delete { + width: 10%; + } + + width: 100%; + + th { + &.left { + text-align: left; + } + + &.right { + text-align: right; + } + } + + td { + + &.id, + &.thumbnail { + text-align: center; + } + + &.menu { + vertical-align: middle; + text-align: center; + } + } + } + + &.form th { + width: 240px; + text-align: left; + } + + tr.last { + background: #ffffdf; + } +} + +#popup-container table th.column { + width: 200px; +} + +.contents-main .btn-area, +#popup .btn-area, +#form_edit .btn-area { + margin: 0 0 60px 0; + padding: 20px 0; + clear: both; + width: 100%; + background: #f5f5f5; + text-align: center; +} + +.contents-main .btn-area li, +#popup .btn-area li, +.btn-area li { + margin-right: 10px; + display: inline; +} + +.addnew { + margin-bottom: 20px; +} + +/*おすすめ商品管理*/ + +table.recommend-table { + border-collapse: collapse; + font-size: 100%; + margin: 0 0 50px; + width: 100%; +} + +.recommend-product.hidden td { + background: #C9C9C9; +} + +div.table-wrap { + margin-top: 6px; + + div { + &.table-img { + float: left; + padding-left: 6px; + } + + &.table-detail { + float: left; + text-align: left; + padding-left: 11px; + + div.detail-name { + margin-bottom: 5px; + } + } + } +} + +td.AlignLeft { + text-align: left; + padding-left: 11px; +} + +/*おすすめ商品検索画面*/ + +#recommend-search-results .hidden { + + td, + th { + background: #C9C9C9; + } +} + +/*通常ボタン*/ + +.btn-normal { + margin-right: 5px; + padding: 2px 10px; + border: solid 1px #bcbecb; + display: inline-block; + color: #444757; + background-image: url('../img/button/white-grad.png'); + background-attachment: scroll; + background-clip: border-box; + background-color: #eee; + font-weight: normal; + font-size: 90%; + text-decoration: none; + white-space: nowrap; + cursor: pointer; + + /* CSS3 radius */ + border-radius: 5px; + + /* Safari, Chrome radius */ + -webkit-box-sizing: content-box; + -webkit-border-radius: 5px; + + /* Firefox radius */ + -moz-border-radius: 5px; + + /* Safari, Chrome radius */ + -webkit-box-sizing: content-box; + -webkit-border-radius: 5px; + + /* Firefox radius */ + -moz-border-radius: 5px; +} + +a.btn-normal { + + &:link, + &:visited { + margin-right: 5px; + padding: 2px 10px; + border: solid 1px #bcbecb; + display: inline-block; + color: #444757; + background-image: url('../img/button/white-grad.png'); + background-attachment: scroll; + background-clip: border-box; + background-color: #eee; + font-weight: normal; + font-size: 90%; + text-decoration: none; + white-space: nowrap; + cursor: pointer; + + /* CSS3 radius */ + border-radius: 5px; + + /* Safari, Chrome radius */ + -webkit-box-sizing: content-box; + -webkit-border-radius: 5px; + + /* Firefox radius */ + -moz-border-radius: 5px; + + /* Safari, Chrome radius */ + -webkit-box-sizing: content-box; + -webkit-border-radius: 5px; + + /* Firefox radius */ + -moz-border-radius: 5px; + } +} + +/*ツールボタン 共通部分*/ + +.btn-tool-format { + padding: 0 6px; + border: solid 1px #6b6d87; + display: inline-block; + color: #444757; + background: url('../img/button/white-grad03.png') repeat-x #eee; + background-origin: padding-box; + background-attachment: scroll; + background-clip: border-box; + background-color: #c9cbcb; + font-weight: bold; + font-size: 90%; + text-decoration: none; + cursor: pointer; + + /* CSS3 radius */ + border-radius: 4px; + + /* Safari, Chrome radius */ + -webkit-box-sizing: content-box; + -webkit-border-radius: 4px; + + /* Firefox radius */ + -moz-border-radius: 4px; + + /* Safari, Chrome radius */ + -webkit-box-sizing: content-box; + -webkit-border-radius: 4px; + + /* Firefox radius */ + -moz-border-radius: 4px; +} + +a.btn-tool-format { + + &:link, + &:visited { + padding: 0 6px; + border: solid 1px #6b6d87; + display: inline-block; + color: #444757; + background: url('../img/button/white-grad03.png') repeat-x #eee; + background-origin: padding-box; + background-attachment: scroll; + background-clip: border-box; + background-color: #c9cbcb; + font-weight: bold; + font-size: 90%; + text-decoration: none; + cursor: pointer; + + /* CSS3 radius */ + border-radius: 4px; + + /* Safari, Chrome radius */ + -webkit-box-sizing: content-box; + -webkit-border-radius: 4px; + + /* Firefox radius */ + -moz-border-radius: 4px; + + /* Safari, Chrome radius */ + -webkit-box-sizing: content-box; + -webkit-border-radius: 4px; + + /* Firefox radius */ + -moz-border-radius: 4px; + } +} + +/*ツールボタン コンテンツ*/ + +.btn-tool { + padding: 0 6px; + border: solid 1px #999; + display: inline-block; + color: #444757; + background: url('../img/button/white-grad.png') repeat-x #eee; + background-origin: padding-box; + background-attachment: scroll; + background-clip: border-box; + background-color: #c9cbcb; + font-size: 100%; + text-decoration: none; + cursor: pointer; + + /* CSS3 radius */ + border-radius: 4px; + + /* Safari, Chrome radius */ + -webkit-box-sizing: content-box; + -webkit-border-radius: 4px; + + /* Firefox radius */ + -moz-border-radius: 4px; + + /* Safari, Chrome radius */ + -webkit-box-sizing: content-box; + -webkit-border-radius: 4px; + + /* Firefox radius */ + -moz-border-radius: 4px; +} + +a.btn-tool { + + &:link, + &:visited { + padding: 0 6px; + border: solid 1px #999; + display: inline-block; + color: #444757; + background: url('../img/button/white-grad.png') repeat-x #eee; + background-origin: padding-box; + background-attachment: scroll; + background-clip: border-box; + background-color: #c9cbcb; + font-size: 100%; + text-decoration: none; + cursor: pointer; + + /* CSS3 radius */ + border-radius: 4px; + + /* Safari, Chrome radius */ + -webkit-box-sizing: content-box; + -webkit-border-radius: 4px; + + /* Firefox radius */ + -moz-border-radius: 4px; + + /* Safari, Chrome radius */ + -webkit-box-sizing: content-box; + -webkit-border-radius: 4px; + + /* Firefox radius */ + -moz-border-radius: 4px; + } +} + +/*登録する・検索するボタン*/ + +.btn-action { + padding: 5px 10px; + border: solid 1px #bcbecb; + display: inline-block; + color: #444757; + background: url('../img/button/white-grad04.png') top repeat-x #eee; + background-attachment: scroll; + background-clip: border-box; + font-weight: normal; + font-size: 80%; + text-decoration: none; + white-space: nowrap; + cursor: pointer; + + /* CSS3 radius */ + border-radius: 5px; + + /* Safari, Chrome radius */ + -webkit-box-sizing: content-box; + -webkit-border-radius: 5px; + + /* Firefox radius */ + -moz-border-radius: 5px; + + /* Safari, Chrome radius */ + -webkit-box-sizing: content-box; + -webkit-border-radius: 5px; + + /* Firefox radius */ + -moz-border-radius: 5px; +} + +a.btn-action { + + &:link, + &:visited { + padding: 5px 10px; + border: solid 1px #bcbecb; + display: inline-block; + color: #444757; + background: url('../img/button/white-grad04.png') top repeat-x #eee; + background-attachment: scroll; + background-clip: border-box; + font-weight: normal; + font-size: 80%; + text-decoration: none; + white-space: nowrap; + cursor: pointer; + + /* CSS3 radius */ + border-radius: 5px; + + /* Safari, Chrome radius */ + -webkit-box-sizing: content-box; + -webkit-border-radius: 5px; + + /* Firefox radius */ + -moz-border-radius: 5px; + + /* Safari, Chrome radius */ + -webkit-box-sizing: content-box; + -webkit-border-radius: 5px; + + /* Firefox radius */ + -moz-border-radius: 5px; + } +} + +/* 商品を選択するボタン */ + +.btn-action-m { + padding: 3px 10px; + border: solid 1px #bcbecb; + display: inline-block; + color: #444757; + background: url('../img/button/white-grad04.png') top repeat-x #eee; + background-attachment: scroll; + background-clip: border-box; + font-weight: normal; + font-size: 90%; + text-decoration: none; + white-space: nowrap; + cursor: pointer; + + /* CSS3 radius */ + border-radius: 5px; + + /* Safari, Chrome radius */ + -webkit-box-sizing: content-box; + -webkit-border-radius: 5px; + + /* Firefox radius */ + -moz-border-radius: 5px; + + /* Safari, Chrome radius */ + -webkit-box-sizing: content-box; + -webkit-border-radius: 5px; + + /* Firefox radius */ + -moz-border-radius: 5px; +} + +a.btn-action-m { + + &:link, + &:visited { + padding: 3px 10px; + border: solid 1px #bcbecb; + display: inline-block; + color: #444757; + background: url('../img/button/white-grad04.png') top repeat-x #eee; + background-attachment: scroll; + background-clip: border-box; + font-weight: normal; + font-size: 90%; + text-decoration: none; + white-space: nowrap; + cursor: pointer; + + /* CSS3 radius */ + border-radius: 5px; + + /* Safari, Chrome radius */ + -webkit-box-sizing: content-box; + -webkit-border-radius: 5px; + + /* Firefox radius */ + -moz-border-radius: 5px; + + /* Safari, Chrome radius */ + -webkit-box-sizing: content-box; + -webkit-border-radius: 5px; + + /* Firefox radius */ + -moz-border-radius: 5px; + } +} + + +.btn-action { + + /*戻るボタン*/ + .btn-prev { + padding: 0 0 0 20px; + display: inline-block; + background: url('../img/button/ico_prev.gif') left no-repeat; + font-weight: bold; + font-size: 114%; + } + + /*進むボタン*/ + .btn-next { + padding: 0 20px 0 0; + display: inline-block; + background: url('../img/button/ico_next.gif') right no-repeat; + font-weight: bold; + font-size: 114%; + } +} + +/*LINK*/ +a { + + &.btn-normal:hover, + &.btn-action:hover, + &.btn-tool:hover { + border: solid 1px #d5d7df; + color: #6d728b; + } + + &.btn-tool-format:hover { + border: solid 1px #363a47; + color: #6b728b; + } + + &.btn:active, + &.btn-normal:active { + background-image: url('../img/button/white-grad-active.png'); + } + + &:link, + &:visited { + color: #39c; + text-decoration: none; + } + + &:link:hover, + &[href]:hover { + color: #74badc; + text-decoration: none; + } +} + +.left { + text-align: left; +} + +.center { + text-align: center; +} + +.right { + text-align: right; +} + +.attention { + color: #f00; +} + +/* ヘッダー +----------------------------------------------- */ + +#errorHeader { + color: #F00; + font-weight: bold; + font-size: 12px; + background-color: #FEB; + text-align: center; + padding: 5px; +} + +#header { + width: 100%; + height: 51px; + background: url('../img/header/header_back.jpg') 0 0 repeat-x; +} + +#header-contents { + width: 1030px; +} + +#logo { + padding: 12px 0 0 12px; + float: left; + width: 184px; +} + +#site-check { + float: right; + width: 820px; + + p.info { + padding-top: 16px; + float: left; + width: 580px; + color: #fff; + font-size: 80%; + } + + ul { + padding-top: 14px; + float: right; + + li { + margin-right: 10px; + float: left; + } + } +} + +/* ヘッダーナビ +----------------------------------------------- */ + +#navi-wrap { + width: 1030px; +} + +#navi { + z-index: 90; + background: url('../img/header/navi_back.jpg') top left repeat-x; + font-size: 100%; + line-height: 100%; + * { + box-sizing: border-box; + } + + li { + background: url('../img/header/navi_back_line.jpg') no-repeat right; + display: block; + float: left; + cursor: pointer; + position: relative; + + > div { + display: block; + cursor: pointer; + text-decoration: none; + } + } + + > li { + height: 28px; + + /* 横並びメニューのみ適用 */ + > div { + color: #2d2f39; + font-weight: bold; + height: 100%; + padding: 7px 10px 0; + + :not(:has(.sfhover)) .on > &, + .sfhover > & { + background: url('../img/header/navi_on.jpg') left 0 repeat-x; + } + } + } + + > li ul { + /* プルダウンメニュー 第1階層以下共通 */ + position: absolute; + clear: both; + display: none; + > li { + margin-left: 0; + display: block; + width: 180px; + height: 27px; + line-height: 24px; + background: url('../img/header/subnavi_bak.gif') top left no-repeat #787878; + text-indent: 8px; + &.sfhover { + background: url('../img/header/subnavi_bak_on.gif') top left no-repeat #474747; + } + a, + div { + color: #fff; + display: block; + padding: 2px 0 0 8px; + } + } + .sfhover > & { + display: block; + } + } + + > li > ul { + /* プルダウンメニュー 第1階層 */ + z-index: 91; + top: 28px; + + > li { + border: solid #888; + border-width: 0 0 1px 0; + &:has(ul) > div { + /* 既存画像を使いまわしたためトリッキー */ + background: url('../img/header/subnavi_bak_l2_on.gif') top left no-repeat; + mix-blend-mode: lighten; + } + } + + /* プルダウンメニュー 第2階層 */ + > li > ul { + z-index: 92; + top: 0; + left: 180px; + } + } +} + + +/*subnavi*/ + +.subnavi a { + padding: 6px 5px 4px 5px; + display: block; + width: 140px; + color: #fff; + background-color: #666; + text-decoration: none; + + &:visited { + color: #fff; + text-decoration: none; + } + + &:hover { + color: #000; + background-color: #666; + text-decoration: none; + } +} + +.subnavi_text { + padding: 0 0 0 8px; + font-size: 71%; +} + +.subnavi-on a { + padding: 6px 5px 4px 5px; + display: block; + width: 140px; + color: #000; + background-color: #666; + text-decoration: none; + + &:visited { + color: #000; + text-decoration: none; + } + + &:hover { + color: #000; + background-color: #666; + text-decoration: none; + } +} + +.number-on a:visited, +.number a:visited { + color: #fff; + text-decoration: none; +} + +#agreement { + margin: 0; + border-width: 1px; + border-color: #c0c0c0; + border-style: solid; + width: 480px; + height: 120px; + overflow: auto; + background-color: #fff; +} + +/* ページャ */ + +#contents .pager ul { + margin: 10px 0; + list-style-type: none; +} + +.pager li { + display: inline; + + a { + padding: 3px 5px; + border: 1px solid #999; + } + + &.on a { + background: #f4f5f5; + } + + a:hover, + &.on a:hover { + background: #f8f8f8; + border: 1px solid #ccc; + } +} + +/* コンテンツ +----------------------------------------------- */ + +* html div#container { + position: relative; + height: 100%; + min-height: 100%; +} + +body>#container { + height: auto; +} + +#container { + position: relative; + min-height: 100%; +} + +#contents { + padding: 20px 20px 100px; + width: 1000px; +} + +#footer { + margin-top: 30px; + position: fixed; + bottom: 0; + width: 100%; + height: 40px; + background: url('../img/contents/footer_back.jpg') 0 0 repeat-x; +} + +#footer-contents { + padding-top: 10px; + width: 1020px; + text-align: right; +} + +#footer { + #copyright { + margin-left: 20px; + float: left; + color: #fff; + font-size: 85%; + text-align: left; + } + + #topagetop { + float: right; + } +} + +/* ログイン +----------------------------------------------- */ + +#login { + margin: 0 auto; + padding: 0; + width: 100%; + text-align: center; +} + +#login-wrap { + margin: 150px auto 0; + padding: 0; + border: 0; + text-align: left; + width: 556px; + z-index: 2; + background: url('../img/contents/admin_login_bg.jpg') center top repeat-x; + -moz-box-shadow: 0 0 5px #000; + + /* Firefox */ + -webkit-box-shadow: 0 0 5px #000; + + /* Safari and Chrome */ +} + +#login-form h1 { + margin: 46px auto 20px; + padding-left: 50px; + padding-bottom: 40px; + border: none; + float: left; + width: 140px; + height: 150px; + background: none; +} + +#input-form { + margin-top: 40px; + padding-right: 30px; + float: right; + width: 255px; + + p { + margin-top: 10px; + color: #fff; + font-size: 100%; + } + + .btn-tool { + margin-top: 5px; + } +} + +#login #copyright { + margin: 0 auto; + padding-top: 10px; + width: 556px; + color: #000000; + font-size: 80%; + text-align: left; +} + +/* エラーメッセージ +----------------------------------------------- */ + +/*以下インストールページと共通■触るべからず*/ + +#out-wrap { + margin: 100px auto; + width: 560px; + + .logo { + padding-bottom: 5px; + float: right; + } +} + +#out { + margin: 0 auto; + width: 560px; +} + +#error { + .out-top { + clear: both; + width: 560px; + height: 10px; + background: url('../img/contents/login_back_top.jpg') bottom left no-repeat; + } + + .contents { + border-right: solid 1px #d9dadf; + border-left: solid 1px #d9dadf; + + .message { + padding: 20px 30px; + text-align: center; + } + } + + .btn-area-top { + width: 560px; + height: 10px; + background: url('../img/contents/login_back_btn_top.jpg') left no-repeat; + } + + .btn-area ul { + padding: 20px 0 10px 0; + width: 560px; + background: url('../img/contents/login_back_btn_contents.jpg') top left no-repeat #f4f5f5; + + li { + text-align: center; + } + } + + .btn-area-bottom { + width: 560px; + height: 10px; + background: url('../img/contents/login_back_btn_bottom.jpg') bottom left no-repeat #eeeff0; + } +} + +/*以上インストールページと共通■触るべからず*/ + +/* 完了メッセージ +----------------------------------------------- */ + +#complete { + margin: 40px 0 0 80px; + width: 560px; + + .complete-top { + clear: both; + width: 560px; + height: 10px; + background: url('../img/contents/login_back_top.jpg') bottom left no-repeat; + } + + .contents { + border-right: solid 1px #d9dadf; + border-left: solid 1px #d9dadf; + + .message { + padding: 20px 30px; + color: #b77615; + font-weight: bold; + text-align: center; + } + } + + .btn-area-top { + width: 560px; + height: 10px; + background: url('../img/contents/login_back_btn_top.jpg') left no-repeat; + } + + .btn-area ul { + margin: 0; + padding: 20px 0 10px 0; + width: 560px; + background: url('../img/contents/login_back_btn_contents.jpg') top left no-repeat #f4f5f5; + text-align: center; + + li { + margin-right: 10px; + display: inline; + } + } + + .btn-area-bottom { + clear: both; + width: 560px; + height: 10px; + background: url('../img/contents/login_back_btn_bottom.jpg') bottom left no-repeat #eeeff0; + } +} + +/* メインページ +----------------------------------------------- */ + +#home-main { + margin-right: 300px; + + table { + width: 100%; + } +} + +* html #home-main table { + width: 99%; +} + +#home .shop-info { + margin: 0 0 20px; + + td { + width: 60%; + text-align: right; + } +} + +#home-info { + border-left: 1px solid #ccc; + float: right; + width: 280px; +} + +.home-info-item { + margin: 0 0 15px 20px; + width: 260px; + line-height: 14px; + font-size: 85%; + + .body { + margin: 5px 0 0 0; + } + + .date { + background: #ddd; + padding: 5px 10px 0px; + } + + .title { + padding: 0 10px 5px; + background: #ddd; + } +} + +/* 基本情報管理 +----------------------------------------------- */ +/* SHOPマスター */ + +#maparea { + padding: 30px; + background: #FFFFFF; + + .btn-area { + text-align: center; + } +} + +#maps { + margin: 0 auto 1em; +} + +/* 郵便番号DB登録 */ + +.basis-zip-item { + margin-bottom: 30px; + + &.end { + margin-bottom: 60px; + } + + &.info { + padding-top: 20px; + } + + p { + margin-bottom: 10px; + } +} + +/* 商品管理 +----------------------------------------------- */ + +#products-category-left, +#products-rank-left { + float: left; + width: 285px; + min-height: 200px; +} + +#products-category-right, +#products-rank-right { + margin-left: 285px; +} + +#products-class-list .action { + width: 100px; +} + +#contents-filemanager-tree #tree { + float: left; + min-height: 200px; +} + +#products-category-left, +#products-rank-left { + min-height: 200px; + padding: 10px; + border: 3px solid #ddd; + width: 230px; + background-color: #f3f3f3; +} + +#products-category-left li ul, +#products-rank-left li ul { + margin-left: 20px; +} + +#products-category-right .now_dir { + margin-bottom: 20px; + padding: 10px; + border: 1px solid #ccc; +} + +#products { + .class-payment { + padding-top: 15px; + font-size: 88%; + } + + label { + white-space: nowrap; + } + + .class-product-type label { + white-space: normal; + } + + .list-info { + padding-top: 10px; + border-top: solid 1px #ccc; + + .btn { + float: left; + margin-right: 20px; + } + + p { + float: right; + color: #444757; + } + } +} + +/* 受注管理 +----------------------------------------------- */ +/* 対応状況管理 */ + +#order-status-list th.id { + width: 40px; +} + +/* 期間別集計 +----------------------------------------------- */ + +#graph-image { + margin: 0 0 20px 0; +} + +/* デザイン管理 +----------------------------------------------- */ +/* レイアウト設定 */ + +.design-layout { + table-layout: fixed; + + th, + td { + vertical-align: top; + text-align: center; + } +} + +#design-layout-used { + width: 525px; +} + +#design-layout-unused { + width: 175px; +} + +.design-layout { + + #LeftNavi, + #MainHead, + #RightNavi { + width: 33.33%; + } + + #TopNavi, + #HeadNavi, + #HeaderTopNavi, + #LeftNavi, + #MainHead, + #MainFoot, + #RightNavi, + #BottomNavi, + #FooterBottomNavi, + #HeaderInternalNavi, + #Unused { + padding-bottom: 20px; + height: 10px; /* IE6応急処置 */ + } + + div.sort { + margin: 5px 0; + padding: 5px 2px; + border: 1px solid #000; + color: #333; + background: #eee; + font-size: 100%; + } + + .anywherecheck { + white-space: nowrap; + } +} + +.placeholder { + border: 1px dashed #aaa; + height: 20px; +} + +#layout-header { + vertical-align: middle; +} + +/* コンテンツ管理 +----------------------------------------------- */ + +#contents-csv-sqltbl { + margin-bottom: 40px; +} + +/* システム設定 +----------------------------------------------- */ +/* プラグイン管理 */ + +td { + &.plugin_img { + border-width: 1px 0px 1px 1px; + } + + &.plugin_info { + border-width: 1px 1px 1px 0px; + + p.description { + margin: 8px 0 10px 5px; + } + + span { + &.ec_cube_version { + font-style: italic; + font-size: 80%; + } + + &.plugin_name { + font-weight: bold; + } + } + } + + &.attention_fookpoint { + background-color: #FEB; + } +} + +/* フォーム +----------------------------------------------- */ + +div.btn, +p.remark { + margin: 0 0 20px 0; +} + +/*FORM*/ +/*W3*/ +.box3 { + width: 33px; +} + + +/*W6*/ +.box6 { + width: 54px; +} + +/*W10*/ +.box10 { + width: 82px; +} + +/*W20*/ +.box20 { + width: 152px; +} + +/*W25*/ +.box25 { + width: 187px; +} + +/*W30*/ +.box30 { + width: 222px; +} + +/*W33*/ +.box33 { + width: 243px; +} + +/*W35*/ +.box35 { + width: 257px; +} + +/*W40*/ +.box40 { + width: 276px; +} + +/*W45*/ +.box45 { + width: 341px; +} + +/*W50*/ +.box50 { + width: 362px; +} + +/*W52*/ +.box52 { + width: 376px; +} + +/*W54*/ +.box54 { + width: 390px; +} + +/*W60*/ +.box60 { + width: 432px; +} + +/*W65*/ +.box65 { + width: 467px; +} + +/*W68*/ +.box68 { + width: 488px; +} + +/*W76*/ +.box76 { + width: 544px; +} + +/*W40×H8*/ +.area40 { + width: 302px; + height: 134px; +} + +/*W40×H20*/ +.area45 { + width: 337px; + height: 290px; +} + +/*W40×H8*/ +.area46 { + width: 337px; + height: 134px; +} + +/*W50?H4*/ +.area50 { + width: 372px; + height: 82px; +} + +/*W50?H4*/ +.area55 { + width: 407px; + height: 82px; +} + +/*W59×H8*/ +.area59 { + width: 432px; + height: 134px; +} + +/*W60?H8*/ +.area60 { + width: 433px; + height: 134px; +} + +/*W60?H4*/ +.area61 { + width: 433px; + height: 82px; +} + +/*W65×H20*/ +.area65 { + width: 444px; + height: 290px; +} + +/*W70?H12*/ +.area70 { + width: 512px; + height: 186px; +} + +/*W75?H12*/ +.area75 { + width: 547px; + height: 186px; +} + +/*W80×H8*/ +.area80 { + width: 572px; + height: 134px; +} + +.area90 { + width: 650px; + height: 420px; +} + +/*W80×H30*/ +.area96 { + width: 694px; + height: 420px; +} + +/*W80×H10*/ +.area96_2 { + width: 694px; + height: 160px; +} + +/*W99?H40*/ +.area99 { + width: 715px; + height: 523px; +} + +/*COLOR*/ + +.red { + color: #f00; +} + +/*FONT*/ + +.bold { + font-weight: bold; +} + +/* フロート解除 */ + +.clearfix:after { + display: block; + clear: both; + height: 0; + line-height: 0; + visibility: hidden; + content: "."; +} + +/* 権限 */ + +x-dummy { + /* display: none; --- IE で不具合 */ + border: none; + width: 0; + height: 0; + overflow: hidden; + visibility: hidden; +} + +.authority_1 { + + #navi-basis-masterdata, + #navi-contents-file, + #navi-design-bloc, + #navi-design-template, + #navi-design-add, + #navi-system, + #navi-ownersstore { + /* display: none; --- IE で不具合 */ + border: none; + width: 0; + height: 0; + overflow: hidden; + visibility: hidden; + } +} + +/* DnD並び替え系の設定 */ + +tr.movingHandle td { + background-color: #eee; +} + +/* ハンドルの設定 */ + +.dragHandle { + font-weight: bold; + text-align: center; + cursor: n-resize; +} + +/* アクティブハンドルの設定 */ + +.activeHandle { + color: #f9a406; +} + +table.layout { + margin: 0; + padding: 0; + border: none; + width: auto; + vertical-align: top; + + th, + td { + margin: 0; + padding: 0; + border: none; + width: auto; + vertical-align: top; + } +} + +/* ログ表示用 */ + +.log { + td { + padding-top: 0; + padding-bottom: 0; + vertical-align: top; + } + + .date { + white-space: nowrap; + } +} + +/* ポップアップ画面用 */ + +body#popup { + width: 100%; +} + +#popup-header { + margin-bottom: 30px; + width: 100%; + height: 35px; + background: url('../img/header/popup_back.jpg') repeat-x; + text-align: right; +} + +#popup-logo { + padding: 10px 10px 0 0; +} + +#popup-container { + margin: 0 auto; + padding: 0 20px; + width: 560px; +} + +/*以下インストールページと共通■触るべからず*/ + +#outside { + margin: 0 auto; + padding: 0; + text-align: center; + width: 100%; +} + +/*以上インストールページと共通■触るべからず*/ diff --git a/html/user_data/packages/admin/css/admin_contents.css b/html/user_data/packages/admin/css/admin_contents.css deleted file mode 100644 index f037a366c7..0000000000 --- a/html/user_data/packages/admin/css/admin_contents.css +++ /dev/null @@ -1,1610 +0,0 @@ -@charset "utf-8"; - -html { - height: 100%; -} - -body { - width: 100%; - height: 100%; - background: #fff; - font-family: "MS Pゴシック","Hiragino Maru Gothic Pro","ヒラギノ丸ゴ Pro W4",Osaka,sans-serif; - font-size: 80%; - line-height: 120%; -} - -option { - margin-right: 3px; - font-size: 100%; -} - -input, -textarea { - margin-right: 3px; -} - -select { - font-size: 100%; -} -select.top, -input.top, -textarea.top { - margin-bottom: 5px; -} - -.page_rows { - margin-bottom: 20px; -} - -hr { - display: none; -} - -h1 { - border-top: 1px solid #b3b4bd; - border-bottom: 1px solid #d9dadf; - height: 30px; - line-height: 30px; - color: #444757; - background: url('../img/contents/subtitle_back_02.jpg') repeat-x; - font-size: 130%; -} - -h1 span.title { - display: block; - padding-top: 2px; - padding-left: 20px; - background: url('../img/contents/subtitle_back.gif') no-repeat; -} - -h1 span.subtitle { - display: block; - padding-top: 2px; - padding-left: 10px; -} - -h2 { - margin: 0 0 10px 0; - padding: 5px 0; - border-bottom: 3px solid #ccc; - color: #444757; - font-size: 100%; -} - -h3 { - margin-bottom: 20px; - padding: 5px; - color : #fff; - background: #999; - font-size: 90%; -} - - -/*テーブル設定*/ -table { - margin: 0 0 20px; - border-collapse: collapse; - width: 100%; - font-size: 100%; -} - -th, -td { - padding: 5px; - border: 1px solid #ccc; -} - -th { - width: 240px; - background: url('../img/contents/table_back.png') repeat-x #f4f5f5; - font-weight: normal; - text-align: left; -} - -table.list th { - background: url('../img/contents/table_back.png') repeat-x #b4b4b4; - text-align: center; -} - -table.list th.column { - background: url('../img/contents/table_back.png') repeat-x #f4f5f5; - text-align: left; -} - -table.list .edit, -table.list .delete { - width: 10%; -} - -table.list { - width: 100%; -} - -table.list th.left { - text-align: left; -} - -table.list th.right { - text-align: right; -} - -table.list td.id, -table.list td.thumbnail { - text-align: center; -} - -table.list td.menu { - vertical-align: middle; - text-align: center; -} - -table.form th { - width: 240px; - text-align: left; -} - -table tr.last { - background: #ffffdf; -} - -#popup-container table th.column { - width: 200px; -} - -.contents-main .btn-area, -#popup .btn-area, -#form_edit .btn-area { - margin : 0 0 60px 0; - padding: 20px 0; - clear: both; - width: 100%; - background: #f5f5f5; - text-align: center; -} - -.contents-main .btn-area li, -#popup .btn-area li, -.btn-area li { - margin-right: 10px; - display: inline; -} - -.addnew { - margin-bottom: 20px; -} - - -/*おすすめ商品管理*/ - -table.recommend-table { - border-collapse: collapse; - font-size: 100%; - margin: 0 0 50px; - width: 100%; -} - -.recommend-product.hidden td{ - background: #C9C9C9; -} - -div.table-wrap { - margin-top: 6px; -} - -div.table-wrap div.table-img { - float: left; - padding-left: 6px; -} - -div.table-wrap div.table-detail { - float: left; - text-align: left; - padding-left: 11px; -} - -div.table-wrap div.table-detail div.detail-name { - margin-bottom: 5px; -} - -td.AlignLeft { - text-align: left; - padding-left: 11px; -} - -/*おすすめ商品検索画面*/ - -#recommend-search-results .hidden td, -#recommend-search-results .hidden th{ - background: #C9C9C9; -} - -/*通常ボタン*/ -.btn-normal, -a.btn-normal:link, -a.btn-normal:visited { - margin-right: 5px; - padding: 2px 10px; - border: solid 1px #bcbecb; - display: inline-block; - color: #444757; - background-image: url('../img/button/white-grad.png'); - background-attachment: scroll; - background-clip: border-box; - background-color: #eee; - font-weight: normal; - font-size: 90%; - text-decoration: none; - white-space: nowrap; - cursor: pointer; - - /* CSS3 radius */ - border-radius: 5px; - /* Safari, Chrome radius */ - -webkit-box-sizing: content-box; - -webkit-border-radius: 5px; - /* Firefox radius */ - -moz-border-radius: 5px; - /* Safari, Chrome radius */ - -webkit-box-sizing: content-box; - -webkit-border-radius: 5px; - /* Firefox radius */ - -moz-border-radius: 5px; -} - - -/*ツールボタン 共通部分*/ -.btn-tool-format, -a.btn-tool-format:link, -a.btn-tool-format:visited { - padding: 0 6px; - border: solid 1px #6b6d87; - display: inline-block; - color: #444757; - background: url('../img/button/white-grad03.png') repeat-x #eee; - background-origin: padding-box; - background-attachment: scroll; - background-clip: border-box; - background-color: #c9cbcb; - font-weight: bold; - font-size: 90%; - text-decoration: none; - cursor: pointer; - - /* CSS3 radius */ - border-radius: 4px; - /* Safari, Chrome radius */ - -webkit-box-sizing: content-box; - -webkit-border-radius: 4px; - /* Firefox radius */ - -moz-border-radius: 4px; - /* Safari, Chrome radius */ - -webkit-box-sizing: content-box; - -webkit-border-radius: 4px; - /* Firefox radius */ - -moz-border-radius: 4px; -} - - -/*ツールボタン コンテンツ*/ -.btn-tool, -a.btn-tool:link, -a.btn-tool:visited { - padding: 0 6px; - border: solid 1px #999; - display: inline-block; - color: #444757; - background: url('../img/button/white-grad.png') repeat-x #eee; - background-origin: padding-box; - background-attachment: scroll; - background-clip: border-box; - background-color: #c9cbcb; - font-size: 100%; - text-decoration: none; - cursor: pointer; - - /* CSS3 radius */ - border-radius: 4px; - /* Safari, Chrome radius */ - -webkit-box-sizing: content-box; - -webkit-border-radius: 4px; - /* Firefox radius */ - -moz-border-radius: 4px; - /* Safari, Chrome radius */ - -webkit-box-sizing: content-box; - -webkit-border-radius: 4px; - /* Firefox radius */ - -moz-border-radius: 4px; -} - - -/*登録する・検索するボタン*/ -.btn-action, -a.btn-action:link, -a.btn-action:visited { - padding: 5px 10px; - border: solid 1px #bcbecb; - display: inline-block; - color: #444757; - background: url('../img/button/white-grad04.png') top repeat-x #eee; - background-attachment: scroll; - background-clip: border-box; - font-weight: normal; - font-size: 80%; - text-decoration: none; - white-space: nowrap; - cursor: pointer; - - /* CSS3 radius */ - border-radius: 5px; - /* Safari, Chrome radius */ - -webkit-box-sizing: content-box; - -webkit-border-radius: 5px; - /* Firefox radius */ - -moz-border-radius: 5px; - /* Safari, Chrome radius */ - -webkit-box-sizing: content-box; - -webkit-border-radius: 5px; - /* Firefox radius */ - -moz-border-radius: 5px; -} - -/*商品を選択するボタン(2/18追加)*/ -.btn-action-m, -a.btn-action-m:link, -a.btn-action-m:visited { - padding: 3px 10px; - border: solid 1px #bcbecb; - display: inline-block; - color: #444757; - background: url('../img/button/white-grad04.png') top repeat-x #eee; - background-attachment: scroll; - background-clip: border-box; - font-weight: normal; - font-size: 90%; - text-decoration: none; - white-space: nowrap; - cursor: pointer; - - /* CSS3 radius */ - border-radius: 5px; - /* Safari, Chrome radius */ - -webkit-box-sizing: content-box; - -webkit-border-radius: 5px; - /* Firefox radius */ - -moz-border-radius: 5px; - /* Safari, Chrome radius */ - -webkit-box-sizing: content-box; - -webkit-border-radius: 5px; - /* Firefox radius */ - -moz-border-radius: 5px; -} - - -/*戻るボタン*/ -.btn-action .btn-prev { - padding: 0 0 0 20px; - display: inline-block; - background: url('../img/button/ico_prev.gif') left no-repeat; - font-weight: bold; - font-size: 114%; -} - - -/*進むボタン*/ -.btn-action .btn-next { - padding: 0 20px 0 0; - display: inline-block; - background: url('../img/button/ico_next.gif') right no-repeat; - font-weight: bold; - font-size: 114%; -} - -a.btn-normal:hover, -a.btn-action:hover, -a.btn-tool:hover { - border: solid 1px #d5d7df; - color: #6d728b; -} - -a.btn-tool-format:hover { - border: solid 1px #363a47; - color: #6b728b; -} - -a.btn:active, -a.btn-normal:active { - background-image: url('../img/button/white-grad-active.png'); -} - - -/*LINK*/ -a:link, -a:visited { - color: #39c; - text-decoration: none; -} - -a:link:hover, -a[href]:hover { - color: #74badc; - text-decoration: none; -} - -.left { - text-align: left; -} - -.center { - text-align: center; -} - -.right { - text-align: right; -} - -.attention { - color: #f00; -} - - -/* ヘッダー ------------------------------------------------ */ -#errorHeader { - color: #F00; - font-weight: bold; - font-size: 12px; - background-color: #FEB; - text-align: center; - padding: 5px; -} -#header { - width: 100%; - height: 51px; - background: url('../img/header/header_back.jpg') 0 0 repeat-x; -} - -#header-contents { - width: 1030px; -} - -#logo { - padding: 12px 0 0 12px; - float: left; - width: 184px; -} - -#site-check { - float: right; - width: 820px; -} -#site-check p.info { - padding-top: 16px; - float: left; - width: 580px; - color: #fff; - font-size: 80%; -} - -#site-check ul { - padding-top: 14px; - float: right; -} - -#site-check ul li { - margin-right: 10px; - float: left; -} - - -/* ヘッダーナビ ------------------------------------------------ */ -#navi-wrap { - width: 1030px; -} -#navi { - z-index: 90; - height: 28px; - background: url('../img/header/navi_back.jpg') top left repeat-x; - font-size: 100%; - line-height: 100%; -} - -#navi li { - background: url('../img/header/navi_back_line.jpg') no-repeat right; - display: block; - float: left; - cursor: pointer; - height: 28px; - position: relative; -} - -#navi li div, -#navi li div span { - display: block; - _float: left;/*IE6対策*/ - cursor: pointer; -} - -#navi li div { - color: #2d2f39; - height: 28px; - font-weight: bold; - text-decoration: none; -} - -#navi li div span { - padding: 7px 10px; - _padding: 9px 10px 5px;/*IE6対策*/ - height: 15px; - _height: 13px;/*IE6対策*/ -} - -#navi li div:hover { - background: url('../img/header/navi_on.jpg') left 0 repeat-x; -} - -#navi li div:hover span { - background: url('../img/header/navi_on.jpg') left 0 repeat-x; -} - -#navi li.on div { - background: url('../img/header/navi_on.jpg') left 0 repeat-x; -} - -#navi li.on div span { - background: url('../img/header/navi_on.jpg') left 0 repeat-x; -} - -#navi li.sfhover div { - background: url('../img/header/navi_on.jpg') left 0 repeat-x; -} - -#navi li.sfhover div span { - background: url('../img/header/navi_on.jpg') left 0 repeat-x; -} - -#navi li ul { - position: absolute; - top: 26px; - left: -9999px; - width: 14px; - font-weight: normal; - clear: both; -} - - -/*プルダウンメニュー 第1階層*/ -#navi li li { - display: block; - top: 2px; - width: 180px; - height: 27px; - line-height: 24px; - color: #fff; - background: url('../img/header/subnavi_bak.gif') top left no-repeat #787878; - font-weight: normal; -} - -#navi li li a, -#navi li li div { - display: block; - top: 2px; - width: 180px; - height: 27px; - line-height: 24px; - color: #fff; - background: url('../img/header/subnavi_bak.gif') top left no-repeat #787878; - font-weight: normal; -} - -#navi li li a span, -#navi li li div span { - display: block; - top: 2px; - width: 180px; - height: 27px; - line-height: 24px; - color: #fff; - background: url('../img/header/subnavi_bak.gif') top left no-repeat #787878; - font-weight: normal; -} - -#navi li li { - border: solid #888; - border-width: 0 0 1px 0; -} - -#navi li li a span, -#navi li li div span { - padding: 2px 0 0 8px; - text-indent: 8px; -} - -#navi li li a:hover, -#navi li li div:hover { - background: url('../img/header/subnavi_bak_on.gif') top left no-repeat #474747; -} - -#navi li li a:hover span, -#navi li li div:hover span { - background: #666; -} - -#navi li.on li a, -#navi li.on li a span, -#navi li li.on a, -#navi li li.on a span, -#navi li.on li div, -#navi li.on li div span, -#navi li li.on div, -#navi li li.on div span { - background: transparent; -} - -#navi li.sfhover li a, -#navi li.sfhover li a span, -#navi li li.sfhover a, -#navi li li.sfhover a span, -#navi li.sfhover li div, -#navi li.sfhover li div span, -#navi li li.sfhover div, -#navi li li.sfhover div span { - background: transparent; -} - -#navi li.sfhover li a:hover, -#navi li.sfhover li div:hover { - background: url('../img/header/subnavi_bak_on.gif') top left no-repeat #474747; -} - -#navi li li.sfhover a:hover, -#navi li li.sfhover div:hover { - background: url('../img/header/subnavi_bak_on.gif') top left no-repeat #474747; -} - - -/*プルダウンメニュー 第2階層*/ -#navi li ul.level2 { - position: absolute; - top: 27px; - left: -9999px; - width: 14px; - font-weight: normal; -} - -#navi li li li, -#navi li li a, -#navi li li li a span, -#navi li li div, -#navi li li li div span { - margin-left: 0; - display: block; - width: 180px; - top: 1px; - height: 27px; - line-height: 24px; - color: #fff; - background: #787878; - font-weight: normal; - background: url('../img/header/subnavi_bak.gif') top left no-repeat #787878; -} - -#navi li li li.sfhover div:hover, -#navi li li li.sfhover a:hover { - width: 180px; - top: 1px; - height: 27px; - color: #fff; - background: url('../img/header/ico_sub_navi.gif') no-repeat left #474747; -} - -#navi li ul ul { - margin: -28px 0 0 180px; - _margin: -28px 0 0 187px;/*IE6応急 */ -} - -#navi li.sfhover ul ul, -#navi li.sfhover ul ul ul { - left: -9999px; -} - -#navi li.sfhover ul, -#navi li li.sfhover ul, -#navi li li li.sfhover ul { - left: auto; -} - -#navi ul.level1 li.on_level2 { - background: url('../img/header/subnavi_bak_l2.gif') top left no-repeat #787878; -} - -#navi ul.level1 li.on_level2 a:hover, -#navi ul.level1 li.on_level2 div:hover { - background: url('../img/header/subnavi_bak_l2_on.gif') top left no-repeat #787878; -} - -#navi ul.level1 li.on_level2 ul.level2 li a:hover, -#navi ul.level1 li.on_level2 ul.level2 li div:hover { - background: url('../img/header/subnavi_bak_on.gif') top left no-repeat #474747; -} - -/*subnavi*/ -.subnavi a { - padding: 6px 5px 4px 5px; - display: block; - width: 140px; - color: #fff; - background-color: #666; - text-decoration: none; -} -.subnavi a:visited { - color: #fff; - text-decoration: none; -} -.subnavi a:hover { - color: #000; - background-color: #666; - text-decoration: none; -} -.subnavi_text { - padding: 0 0 0 8px; - font-size: 71%; -} -.subnavi-on a { - padding: 6px 5px 4px 5px; - display: block; - width: 140px; - color: #000; - background-color: #666; - text-decoration: none; -} -.subnavi-on a:visited { - color: #000; - text-decoration: none; -} -.subnavi-on a:hover { - color: #000; - background-color: #666; - text-decoration: none; -} -.number-on a:visited { - color: #fff; - text-decoration: none; -} -.number a:visited { - color: #fff; - text-decoration: none; -} - -#agreement { - margin: 0; - border-width: 1px; - border-color: #c0c0c0; - border-style: solid; - width: 480px; - height: 120px; - overflow: auto; - background-color : #fff; -} - - -/* ページャ */ -#contents .pager ul { - margin: 10px 0; - list-style-type: none; -} - -.pager li { - display: inline; -} - -.pager li a { - padding: 3px 5px; - border: 1px solid #999; -} - -.pager li.on a { - background: #f4f5f5; -} - -.pager li a:hover, -.pager li.on a:hover { - background: #f8f8f8; - border: 1px solid #ccc; -} - - -/* コンテンツ ------------------------------------------------ */ -* html div#container { - position: relative; - height: 100%; - min-height: 100%; -} - -body > #container { - height: auto; -} - -#container { - position: relative; - min-height: 100%; -} - -#contents { - padding: 20px 20px 100px; - width: 1000px; -} - -#footer { - margin-top: 30px; - position: fixed; - bottom: 0; - width: 100%; - height: 40px; - background: url('../img/contents/footer_back.jpg') 0 0 repeat-x; -} - -#footer-contents { - padding-top: 10px; - width: 1020px; - text-align: right; -} - -#footer #copyright { - margin-left: 20px; - float: left; - color: #fff; - font-size: 85%; - text-align: left; -} - -#footer #topagetop { - float: right; -} - - -/* ログイン ------------------------------------------------ */ -#login { - margin: 0 auto; - padding: 0; - width: 100%; - text-align: center; -} - -#login-wrap { - margin: 150px auto 0; - padding: 0; - border: 0; - text-align: left; - width: 556px; - z-index: 2; - background: url('../img/contents/admin_login_bg.jpg') center top repeat-x; - -moz-box-shadow: 0 0 5px #000;/* Firefox */ - -webkit-box-shadow: 0 0 5px #000;/* Safari and Chrome */ -} - -#login-form h1 { - margin: 46px auto 20px; - padding-left: 50px; - padding-bottom: 40px; - border: none; - float: left; - width: 140px; - height: 150px; - background: none; -} - -#input-form { - margin-top: 40px; - padding-right: 30px; - float: right; - width: 255px; -} - -#input-form p { - margin-top: 10px; - color: #fff; - font-size: 100%; -} - -#input-form .btn-tool { - margin-top: 5px; -} - -#login #copyright { - margin: 0 auto; - padding-top: 10px; - width: 556px; - color: #000000; - font-size: 80%; - text-align: left; -} - - -/* エラーメッセージ ------------------------------------------------ */ - - -/*以下インストールページと共通■触るべからず*/ - -#out-wrap { - margin: 100px auto; - width: 560px; -} - -#out-wrap .logo { - padding-bottom: 5px; - float: right; -} - -#out { - margin: 0 auto; - width: 560px; -} - -#error .out-top { - clear: both; - width: 560px; - height: 10px; - background: url('../img/contents/login_back_top.jpg') bottom left no-repeat; -} - -/*以上インストールページと共通■触るべからず*/ - - -#error .contents { - border-right: solid 1px #d9dadf; - border-left: solid 1px #d9dadf; -} - -#error .contents .message { - padding: 20px 30px; - text-align: center; -} - -#error .btn-area-top { - width: 560px; - height: 10px; - background: url('../img/contents/login_back_btn_top.jpg') left no-repeat; -} - -#error .btn-area ul { - padding: 20px 0 10px 0; - width: 560px; - background: url('../img/contents/login_back_btn_contents.jpg') top left no-repeat #f4f5f5; -} - -#error .btn-area ul li { - text-align: center; -} - -#error .btn-area-bottom { - width: 560px; - height: 10px; - background: url('../img/contents/login_back_btn_bottom.jpg') bottom left no-repeat #eeeff0; -} - - -/* 完了メッセージ ------------------------------------------------ */ -#complete { - margin: 40px 0 0 80px; - width: 560px; -} - -#complete .complete-top { - clear: both; - width: 560px; - height: 10px; - background: url('../img/contents/login_back_top.jpg') bottom left no-repeat; -} - -#complete .contents { - border-right: solid 1px #d9dadf; - border-left: solid 1px #d9dadf; -} - -#complete .contents .message { - padding: 20px 30px; - color: #b77615; - font-weight: bold; - text-align: center; -} - -#complete .btn-area-top { - width: 560px; - height: 10px; - background: url('../img/contents/login_back_btn_top.jpg') left no-repeat; -} - -#complete .btn-area ul { - margin: 0; - padding: 20px 0 10px 0; - width: 560px; - background: url('../img/contents/login_back_btn_contents.jpg') top left no-repeat #f4f5f5; - text-align: center; -} - -#complete .btn-area ul li { - margin-right: 10px; - display: inline; -} - -#complete .btn-area-bottom { - clear: both; - width: 560px; - height: 10px; - background: url('../img/contents/login_back_btn_bottom.jpg') bottom left no-repeat #eeeff0; -} - - -/* メインページ ------------------------------------------------ */ -#home-main { - margin-right: 300px; -} - -#home-main table { - width: 100%; -} - -* html #home-main table { - width: 99%; -} - -#home .shop-info { - margin: 0 0 20px; -} - -#home .shop-info td { - width: 60%; - text-align: right; -} - -#home-info { - border-left: 1px solid #ccc; - float: right; - width: 280px; -} - -.home-info-item { - margin: 0 0 15px 20px; - width: 260px; - line-height: 14px; - font-size: 85%; -} - -.home-info-item .body { - margin: 5px 0 0 0; -} - -.home-info-item .date { - background: #ddd; - padding: 5px 10px 0px; -} - -.home-info-item .title { - padding: 0 10px 5px; - background: #ddd; -} - - -/* 基本情報管理 ------------------------------------------------ */ -/* SHOPマスター */ -#maparea { - padding: 30px; - background: #FFFFFF; -} -#maparea .btn-area { - text-align: center; -} -#maps { - margin: 0 auto 1em; -} - -/* 郵便番号DB登録 */ -.basis-zip-item { - margin-bottom: 30px; -} - -.basis-zip-item.end { - margin-bottom: 60px; -} - -.basis-zip-item.info { - padding-top: 20px; -} - -.basis-zip-item p { - margin-bottom: 10px; -} - - -/* 商品管理 ------------------------------------------------ */ -#products-category-left, -#products-rank-left { - float: left; - width: 285px; - min-height: 200px; -} - -#products-category-right, -#products-rank-right { - margin-left: 285px; -} - -#products-class-list .action { - width: 100px; -} - -#contents-filemanager-tree #tree { - float: left; - min-height: 200px; -} - -#products-category-left, -#products-rank-left { - min-height: 200px; - padding: 10px; - border: 3px solid #ddd; - width: 230px; - background-color: #f3f3f3; -} - -#products-category-left li ul, -#products-rank-left li ul { - margin-left: 20px; -} - -#products-category-right .now_dir { - margin-bottom: 20px; - padding: 10px; - border: 1px solid #ccc; -} - -#products .class-payment { - padding-top: 15px; - font-size: 88%; -} -#products label { - white-space: nowrap; -} -#products .class-product-type label { - white-space: normal; -} -#products .list-info { - padding-top: 10px; - border-top: solid 1px #ccc; -} -#products .list-info .btn { - float: left; - margin-right: 20px; -} -#products .list-info p { - float: right; - color: #444757; -} - - -/* 受注管理 ------------------------------------------------ */ -/* 対応状況管理 */ -#order-status-list th.id { - width: 40px; -} - - -/* 期間別集計 ------------------------------------------------ */ -#graph-image { - margin: 0 0 20px 0; -} - - -/* デザイン管理 ------------------------------------------------ */ -/* レイアウト設定 */ -.design-layout { - table-layout: fixed; -} - -.design-layout th, -.design-layout td { - vertical-align: top; - text-align: center; -} - -#design-layout-used { - width: 525px; -} - -#design-layout-unused { - width: 175px; -} - -.design-layout #LeftNavi, -.design-layout #MainHead, -.design-layout #RightNavi { - width: 33.33%; -} - -.design-layout #TopNavi, -.design-layout #HeadNavi, -.design-layout #HeaderTopNavi, -.design-layout #LeftNavi, -.design-layout #MainHead, -.design-layout #MainFoot, -.design-layout #RightNavi, -.design-layout #BottomNavi, -.design-layout #FooterBottomNavi, -.design-layout #HeaderInternalNavi, -.design-layout #Unused { - padding-bottom: 20px; - height: 10px; /*IE6応急処置 */ -} - -.design-layout div.sort { - margin: 5px 0; - padding: 5px 2px; - border: 1px solid #000; - color: #333; - background: #eee; - font-size: 100%; -} - -.design-layout .anywherecheck { - white-space: nowrap; -} - -.placeholder { - border: 1px dashed #aaa; - height: 20px; -} - -#layout-header { - vertical-align: middle; -} - - -/* コンテンツ管理 ------------------------------------------------ */ -#contents-csv-sqltbl { - margin-bottom: 40px; -} - -/* システム設定 ------------------------------------------------ */ -/* プラグイン管理 */ -td.plugin_img { - border-width: 1px 0px 1px 1px; -} -td.plugin_info { - border-width: 1px 1px 1px 0px; -} -td.plugin_info p.description { - margin: 8px 0 10px 5px; -} - -td.plugin_info span.ec_cube_version { - font-style: italic; - font-size: 80%; -} - -td.plugin_info span.plugin_name { - font-weight: bold; -} - -td.attention_fookpoint { - background-color: #FEB; -} - -/* フォーム ------------------------------------------------ */ -div.btn, -p.remark { - margin: 0 0 20px 0; -} - -/*FORM*/ -.box3 { - width: 33px; -} -/*W3*/ - -.box6 { - width: 54px; -} -/*W6*/ - -.box10 { - width: 82px; -} -/*W10*/ - -.box20 { - width: 152px; -} -/*W20*/ - -.box25 { - width: 187px; -} -/*W25*/ - -.box30 { - width: 222px; -} -/*W30*/ - -.box33 { - width: 243px; -} -/*W33*/ - -.box35 { - width: 257px; -} -/*W35*/ - -.box40 { - width: 276px; -} -/*W40*/ - -.box45 { - width: 341px; -} -/*W45*/ - -.box50 { - width: 362px; -} -/*W50*/ - -.box52 { - width: 376px; -} -/*W52*/ - -.box54 { - width: 390px; -} -/*W54*/ - -.box60 { - width: 432px; -} -/*W60*/ - -.box65 { - width: 467px; -} -/*W65*/ - -.box68 { - width: 488px; -} -/*W68*/ - -.box76 { - width: 544px; -} -/*W76*/ - -.area40 { - width: 302px; - height: 134px; -} -/*W40×H8*/ - -.area45 { - width: 337px; - height: 290px; -} -/*W40×H20*/ - -.area46 { - width: 337px; - height: 134px; -} -/*W40×H8*/ - -.area50 { - width: 372px; - height: 82px; -} -/*W50?H4*/ - -.area55 { - width: 407px; - height: 82px; -} -/*W50?H4*/ - -.area59 { - width: 432px; - height: 134px; -} -/*W59×H8*/ - -.area60 { - width: 433px; - height: 134px; -} -/*W60?H8*/ - -.area61 { - width: 433px; - height: 82px; -} -/*W60?H4*/ - -.area65 { - width: 444px; - height: 290px; -} -/*W65×H20*/ - -.area70 { - width: 512px; - height: 186px; -} -/*W70?H12*/ - -.area75 { - width: 547px; - height: 186px; -} -/*W75?H12*/ - -.area80 { - width: 572px; - height: 134px; -} -/*W80×H8*/ - -.area90 { - width: 650px; - height: 420px; -} - -.area96 { - width: 694px; - height: 420px; -} -/*W80×H30*/ - -.area96_2 { - width: 694px; - height: 160px; -} -/*W80×H10*/ - -.area99 { - width: 715px; - height: 523px; -} -/*W99?H40*/ - -/*COLOR*/ -.red { - color: #f00; -} - - -/*FONT*/ -.bold { - font-weight: bold; -} - - -/* フロート解除 */ -.clearfix:after { - display: block; - clear: both; - height: 0; - line-height: 0; - visibility: hidden; - content: "."; -} - - -/* 権限 */ -x-dummy, -.authority_1 #navi-basis-masterdata, -.authority_1 #navi-contents-file, -.authority_1 #navi-design-bloc, -.authority_1 #navi-design-template, -.authority_1 #navi-design-add, -.authority_1 #navi-system, -.authority_1 #navi-ownersstore { - /* display: none; --- IE で不具合 */ - border: none; - width: 0; - height: 0; - overflow: hidden; - visibility: hidden; -} - - -/* DnD並び替え系の設定 */ -tr.movingHandle td { - background-color: #eee; -} - - -/* ハンドルの設定 */ -.dragHandle { - font-weight: bold; - text-align: center; - cursor: n-resize; -} - - -/* アクティブハンドルの設定 */ -.activeHandle { - color: #f9a406; -} - - -table.layout, -table.layout th, -table.layout td { - margin: 0; - padding: 0; - border: none; - width: auto; - vertical-align: top; -} - - -/* ログ表示用 */ -.log td { - padding-top: 0; - padding-bottom: 0; - vertical-align: top; -} - -.log .date { - white-space: nowrap; -} - - -/* ポップアップ画面用 */ -body#popup { - width: 100%; -} - -#popup-header { - margin-bottom: 30px; - width: 100%; - height: 35px; - background: url('../img/header/popup_back.jpg') repeat-x; - text-align: right; -} - -#popup-logo { - padding: 10px 10px 0 0; -} - -#popup-container { - margin: 0 auto; - padding: 0 20px; - width: 560px; -} - - -/*以下インストールページと共通■触るべからず*/ - -#outside { - margin: 0 auto; - padding: 0; - text-align: center; - width: 100%; -} - -/*以上インストールページと共通■触るべからず*/ diff --git a/html/user_data/packages/admin/css/admin_file_manager.css b/html/user_data/packages/admin/css/admin_file_manager.css deleted file mode 100644 index 0434dcfbd8..0000000000 --- a/html/user_data/packages/admin/css/admin_file_manager.css +++ /dev/null @@ -1,35 +0,0 @@ -#contents-filemanager-tree { - float: left; - height: 430px; -} -#contents-filemanager-right { - width: 720px; - float: right; -} - -#tree { - width: 230px; - border: 3px solid #ddd; - padding: 10px; - background-color: #F3F3F3; -} -#contents-filemanager-nowdir { - margin: 0 0 20px 0; -} -#file_view { - overflow: auto; -} -#file_view td.file-name { - cursor: pointer; -} -#now_dir { - height: 20px; - width: 300px; - padding-left: 3px; - margin: 0 0 10px 0; - overflow: hidden; - background-color : #FFFFFF; - border-style: solid; - border-color: #C0C0C0; - border-width: 1px -} diff --git a/html/user_data/packages/admin/css/reset.css b/html/user_data/packages/admin/css/reset.css deleted file mode 100644 index 0e974c9bcc..0000000000 --- a/html/user_data/packages/admin/css/reset.css +++ /dev/null @@ -1,99 +0,0 @@ -@charset "utf-8"; - -/************************************************ - ブラウザリセット -************************************************ */ -html, -body, -div, -span, -applet, -object, -iframe, -h1, -h2, -h3, -h4, -h5, -h6, -p, -blockquote, -pre, -a, -abbr, -acronym, -address, -big, -cite, -code, -del, -dfn, -em, -font, -img, -ins, -kbd, -q, -s, -samp, -small, -strike, -strong, -sub, -sup, -tt, -var, -dl, -dt, -dd, -ol, -ul, -li, -fieldset, -form, -label, -legend, -table, -caption, -tbody, -tfoot, -thead, -tr, -th, -td { - margin: 0; - padding: 0; - border: 0; -} - -table, -caption, -th, -td { - margin: 0; - padding: 0; - border: 0; - border-collapse : collapse ; - border-spacing: 0px; - empty-cells: show; - text-align: left; - font-weight: normal; -} - -a img, -iframe { - border: none; -} -ol, -ul, -li { - list-style: none; -} - -input, -textarea, -select, -button { - font-size: 100%; - font-family: inherit; -} diff --git a/package.json b/package.json index 07acd5bfed..a9f20820e0 100644 --- a/package.json +++ b/package.json @@ -17,12 +17,12 @@ "slick-carousel": "^1.8.1", "style-loader": "^4.0.0", "url-loader": "^4.1.1", - "webpack": "^5.95.0" + "webpack": "^5.97.1" }, "devDependencies": { "@babel/core": "^7.26.0", "@babel/preset-env": "^7.26.0", - "@faker-js/faker": "^9.2.0", + "@faker-js/faker": "^9.3.0", "@playwright/test": "^1.48.2", "@types/date-fns": "^2.6.3", "@types/faker": "^6.6.11", @@ -37,7 +37,7 @@ "eslint-plugin-import": "^2.31.0", "expose-loader": "^5.0.0", "tar": "^7.4.3", - "typescript": "^5.6.3", + "typescript": "^5.7.2", "webpack-cli": "^5.1.4", "zaproxy": "^1.0.1" }, diff --git a/phpstan.neon.dist b/phpstan.neon.dist index fedf1b2161..c5be551971 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -7,7 +7,6 @@ parameters: - data/module/SOAP/* - data/vendor/* - data/downloads/* - - data/module/Calendar/Engine/PearDate.php - data/class/helper/SC_Helper_Mobile.php - data/class/SC_MobileEmoji.php - data/class/SC_MobileImage.php @@ -15,48 +14,14 @@ parameters: analyseAndScan: - *.tpl.php ignoreErrors: + # - + # message: "#^Constant SMARTY_PLUGINS_DIR not found\\.$#" + # path: data/smarty_extends/* - message: "#^Call to an undefined static method PEAR\\:\\:raiseError\\(\\)\\.$#" paths: - data/module/HTTP/Request.php - - data/module/Net/SMTP.php - - data/module/Calendar/Calendar.php - - data/module/Calendar/Decorator.php - - data/module/Calendar/Factory.php - - - message: "#^Call to an undefined method Net_Socket\\:\\:raiseError\\(\\)\\.$#" - path: data/module/Net/Socket.php - - - message: "#^Call to static method factory\\(\\) on an unknown class Auth_SASL\\.$#" - path: data/module/Net/SMTP.php - - - message: "#^Call to static method dayOfWeek\\(\\) on an unknown class Date_Calc\\.#" - path: data/module/Calendar/Util/Textual.php - # - - # message: "#^Constant SMARTY_PLUGINS_DIR not found\\.$#" - # path: data/smarty_extends/* + - message: "#^Variable \\$SJIS_widths might not be defined\\.$#" path: data/class/helper/SC_Helper_FPDI.php - - - message: '#^Path in include_once\(\) "Auth/SASL.php" is not a file or it does not exist.#' - path: data/module/Net/SMTP.php - - - message: '#^Path in require_once\(\) ".*\.php" is not a file or it does not exist\.$#' - paths: - - data/module/Calendar/Calendar.php - - data/module/Calendar/Day.php - - data/module/Calendar/Decorator/Textual.php - - data/module/Calendar/Decorator/Uri.php - - data/module/Calendar/Decorator/Weekday.php - - data/module/Calendar/Decorator/Wrapper.php - - data/module/Calendar/Factory.php - - data/module/Calendar/Hour.php - - data/module/Calendar/Minute.php - - data/module/Calendar/Month.php - - data/module/Calendar/Month/Weekdays.php - - data/module/Calendar/Month/Weeks.php - - data/module/Calendar/Second.php - - data/module/Calendar/Util/Textual.php - - data/module/Calendar/Week.php - - data/module/Calendar/Year.php diff --git a/tests/class/SC_CheckError/SC_CheckError_createParamTest.php b/tests/class/SC_CheckError/SC_CheckError_createParamTest.php index 4ab97712e6..80dc78730a 100644 --- a/tests/class/SC_CheckError/SC_CheckError_createParamTest.php +++ b/tests/class/SC_CheckError/SC_CheckError_createParamTest.php @@ -47,8 +47,10 @@ public function testArrParamIsCaracter() { $this->objErr->doFunc(['EXIST_CHECK', 'aabbcc_1234'], ['EXIST_CHECK']); - $this->expected = [self::FORM_NAME => [0 => 'A', 1 => 'B', 2 => 'C'], - 'aabbcc_1234' => '', ]; + $this->expected = [ + self::FORM_NAME => [0 => 'A', 1 => 'B', 2 => 'C'], + 'aabbcc_1234' => '', + ]; $this->actual = $this->objErr->arrParam; $this->assertEquals($this->expected, $this->actual); } diff --git a/tests/class/SC_Date/SC_Date_getZeroMonthTest.php b/tests/class/SC_Date/SC_Date_getZeroMonthTest.php index 6e1ff0b649..8c4416c368 100644 --- a/tests/class/SC_Date/SC_Date_getZeroMonthTest.php +++ b/tests/class/SC_Date/SC_Date_getZeroMonthTest.php @@ -49,8 +49,9 @@ public function testGetZeroMonth要素の数が12の配列を返す() public function testGetZeroMonth0をつけた月の配列を返す() { - $this->expected = ['01' => '01', '02' => '02', '03' => '03', '04' => '04', '05' => '05', '06' => '06', '07' => '07', '08' => '08', '09' => '09', '10' => '10', '11' => '11', '12' => '12', - ]; + $this->expected = [ + '01' => '01', '02' => '02', '03' => '03', '04' => '04', '05' => '05', '06' => '06', '07' => '07', '08' => '08', '09' => '09', '10' => '10', '11' => '11', '12' => '12', + ]; $this->actual = $this->objDate->getZeroMonth(); $this->verify('配列の最低値'); diff --git a/tests/class/SC_Date/SC_Date_isHolidayTest.php b/tests/class/SC_Date/SC_Date_isHolidayTest.php index 1c321ba5a0..f256130568 100644 --- a/tests/class/SC_Date/SC_Date_isHolidayTest.php +++ b/tests/class/SC_Date/SC_Date_isHolidayTest.php @@ -43,7 +43,7 @@ protected function setUp(): void 'create_date' => '2013-02-14 11:22:33', 'update_date' => '2013-02-14 22:11:33', 'del_flg' => '0', - ], + ], [ 'holiday_id' => '2', 'title' => 'TEST HOLIDAY2', @@ -54,8 +54,8 @@ protected function setUp(): void 'create_date' => '2013-02-15 11:22:33', 'update_date' => '2013-02-16 22:11:33', 'del_flg' => '0', - ], - ]; + ], + ]; // 休みの曜日を登録 $baseInfo = [ 'id' => '1', diff --git a/tests/class/SC_FpdfTest.php b/tests/class/SC_FpdfTest.php index 411360c6d7..4e13971af1 100644 --- a/tests/class/SC_FpdfTest.php +++ b/tests/class/SC_FpdfTest.php @@ -9,6 +9,7 @@ protected function setUp(): void /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function test正しいMediaBox情報が出力される() diff --git a/tests/class/SC_Product/SC_Product_TestBase.php b/tests/class/SC_Product/SC_Product_TestBase.php index 908dbd6c01..60125afa40 100644 --- a/tests/class/SC_Product/SC_Product_TestBase.php +++ b/tests/class/SC_Product/SC_Product_TestBase.php @@ -34,7 +34,7 @@ protected function setUpProductClass() 'stock' => '99', 'creator_id' => '1', 'del_flg' => '0', - ], + ], [ 'update_date' => 'CURRENT_TIMESTAMP', 'product_class_id' => '1002', @@ -45,7 +45,7 @@ protected function setUpProductClass() 'creator_id' => '1', 'stock_unlimited' => '1', 'del_flg' => '0', - ], + ], [ 'update_date' => 'CURRENT_TIMESTAMP', 'product_class_id' => '2001', @@ -56,8 +56,8 @@ protected function setUpProductClass() 'creator_id' => '1', 'stock_unlimited' => '1', 'del_flg' => '1', - ], - ]; + ], + ]; $this->objQuery->delete('dtb_products_class'); foreach ($product_class as $key => $item) { @@ -105,7 +105,7 @@ protected function setUpClassCategory() 'creator_id' => '1', 'name' => 'cat1001', 'rank' => 1, - ], + ], [ 'update_date' => 'CURRENT_TIMESTAMP', 'classcategory_id' => '1002', @@ -113,8 +113,8 @@ protected function setUpClassCategory() 'creator_id' => '1', 'name' => 'cat1002', 'rank' => 2, - ], - ]; + ], + ]; // classcategory_id=0のものは削除しない $this->objQuery->delete('dtb_classcategory', 'classcategory_id <> 0'); @@ -144,7 +144,7 @@ protected function setUpProducts() 'del_flg' => '0', 'creator_id' => '1', 'status' => '1', - ], + ], [ 'update_date' => 'CURRENT_TIMESTAMP', 'product_id' => '1002', @@ -159,7 +159,7 @@ protected function setUpProducts() 'del_flg' => '0', 'creator_id' => '1', 'status' => '2', - ], + ], [ 'update_date' => 'CURRENT_TIMESTAMP', 'product_id' => '2001', @@ -175,8 +175,8 @@ protected function setUpProducts() 'del_flg' => '1', 'creator_id' => '1', 'status' => '1', - ], - ]; + ], + ]; $this->objQuery->delete('dtb_products'); foreach ($products as $key => $item) { @@ -196,15 +196,15 @@ protected function setUpProductStatus() 'product_id' => '1001', 'creator_id' => '1', 'del_flg' => '0', - ], + ], [ 'update_date' => 'CURRENT_TIMESTAMP', 'product_status_id' => '1', 'product_id' => '1002', 'creator_id' => '1', 'del_flg' => '0', - ], - ]; + ], + ]; $this->objQuery->delete('dtb_product_status'); foreach ($class_category as $key => $item) { diff --git a/tests/class/SC_Product/SC_Product_getDetailAndProductsClassTest.php b/tests/class/SC_Product/SC_Product_getDetailAndProductsClassTest.php index ccb454674f..4a940af7a7 100644 --- a/tests/class/SC_Product/SC_Product_getDetailAndProductsClassTest.php +++ b/tests/class/SC_Product/SC_Product_getDetailAndProductsClassTest.php @@ -25,7 +25,7 @@ public function testGetDetailAndProductsClass商品規格IDの商品情報と規 $arrRet = $this->objQuery->getCol('update_date', 'dtb_products', 'product_id = 1001'); $this->expected = [ - 'product_id' => '1001', 'product_code_min' => 'code1001', 'product_code_max' => 'code1001', 'name' => '製品名1001', 'comment1' => 'コメント10011', 'comment2' => 'コメント10012', 'comment3' => 'コメント10013', 'main_list_comment' => 'リストコメント1001', 'main_image' => '1001.jpg', 'main_list_image' => '1001-main.jpg', 'price01_min' => '1500', 'price01_max' => '1500', 'price02_min' => '1500', 'price02_max' => '1500', 'stock_min' => '99', 'stock_max' => '99', 'stock_unlimited_min' => '0', 'stock_unlimited_max' => '0', 'deliv_date_id' => '1', 'status' => '1', 'del_flg' => '0', 'update_date' => $arrRet[0], 'price01_min_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax(1500), 'price01_max_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax(1500), 'price02_min_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax(1500), 'price02_max_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax(1500), 'maker_id' => null, 'comment4' => null, 'comment5' => null, 'comment6' => null, 'note' => null, 'main_comment' => 'メインコメント1001', 'main_large_image' => null, 'sub_title1' => null, 'sub_comment1' => null, 'sub_image1' => null, 'sub_large_image1' => null, 'sub_title2' => null, 'sub_comment2' => null, 'sub_image2' => null, 'sub_large_image2' => null, 'sub_title3' => null, 'sub_comment3' => null, 'sub_image3' => null, 'sub_large_image3' => null, 'sub_title4' => null, 'sub_comment4' => null, 'sub_image4' => null, 'sub_large_image4' => null, 'sub_title5' => null, 'sub_comment5' => null, 'sub_image5' => null, 'sub_large_image5' => null, 'sub_title6' => null, 'sub_comment6' => null, 'sub_image6' => null, 'sub_large_image6' => null, 'creator_id' => '1', 'create_date' => $arrRet[0], 'point_rate' => '0', 'deliv_fee' => null, 'maker_name' => null, 'stock' => '99', 'stock_unlimited' => '0', 'sale_limit' => null, 'price01' => '1500', 'price02' => '1500', 'product_code' => 'code1001', 'product_class_id' => '1001', 'product_type_id' => '1', 'down_filename' => null, 'down_realfilename' => null, 'classcategory_name1' => 'cat1001', 'rank1' => '1', 'class_name1' => '味', 'class_id1' => '1', 'classcategory_id1' => '1001', 'classcategory_id2' => '1002', 'classcategory_name2' => 'cat1002', 'rank2' => '2', 'class_name2' => '味', 'class_id2' => '1', 'price01_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax(1500), 'price02_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax(1500), + 'product_id' => '1001', 'product_code_min' => 'code1001', 'product_code_max' => 'code1001', 'name' => '製品名1001', 'comment1' => 'コメント10011', 'comment2' => 'コメント10012', 'comment3' => 'コメント10013', 'main_list_comment' => 'リストコメント1001', 'main_image' => '1001.jpg', 'main_list_image' => '1001-main.jpg', 'price01_min' => '1500', 'price01_max' => '1500', 'price02_min' => '1500', 'price02_max' => '1500', 'stock_min' => '99', 'stock_max' => '99', 'stock_unlimited_min' => '0', 'stock_unlimited_max' => '0', 'deliv_date_id' => '1', 'status' => '1', 'del_flg' => '0', 'update_date' => $arrRet[0], 'price01_min_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax(1500), 'price01_max_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax(1500), 'price02_min_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax(1500), 'price02_max_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax(1500), 'maker_id' => null, 'comment4' => null, 'comment5' => null, 'comment6' => null, 'note' => null, 'main_comment' => 'メインコメント1001', 'main_large_image' => null, 'sub_title1' => null, 'sub_comment1' => null, 'sub_image1' => null, 'sub_large_image1' => null, 'sub_title2' => null, 'sub_comment2' => null, 'sub_image2' => null, 'sub_large_image2' => null, 'sub_title3' => null, 'sub_comment3' => null, 'sub_image3' => null, 'sub_large_image3' => null, 'sub_title4' => null, 'sub_comment4' => null, 'sub_image4' => null, 'sub_large_image4' => null, 'sub_title5' => null, 'sub_comment5' => null, 'sub_image5' => null, 'sub_large_image5' => null, 'sub_title6' => null, 'sub_comment6' => null, 'sub_image6' => null, 'sub_large_image6' => null, 'creator_id' => '1', 'create_date' => $arrRet[0], 'point_rate' => '0', 'deliv_fee' => null, 'maker_name' => null, 'stock' => '99', 'stock_unlimited' => '0', 'sale_limit' => null, 'price01' => '1500', 'price02' => '1500', 'product_code' => 'code1001', 'product_class_id' => '1001', 'product_type_id' => '1', 'down_filename' => null, 'down_realfilename' => null, 'classcategory_name1' => 'cat1001', 'rank1' => '1', 'class_name1' => '味', 'class_id1' => '1', 'classcategory_id1' => '1001', 'classcategory_id2' => '1002', 'classcategory_name2' => 'cat1002', 'rank2' => '2', 'class_name2' => '味', 'class_id2' => '1', 'price01_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax(1500), 'price02_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax(1500), ]; $this->actual = $this->objProducts->getDetailAndProductsClass('1001'); diff --git a/tests/class/SC_Product/SC_Product_getDetailTest.php b/tests/class/SC_Product/SC_Product_getDetailTest.php index 113a88c222..0f85b733d7 100644 --- a/tests/class/SC_Product/SC_Product_getDetailTest.php +++ b/tests/class/SC_Product/SC_Product_getDetailTest.php @@ -25,7 +25,7 @@ public function testGetDetail商品IDの詳細情報を返す() $arrRet = $this->objQuery->getCol('update_date', 'dtb_products', 'product_id = 1001'); $this->expected = [ - 'product_id' => '1001', 'product_code_min' => 'code1001', 'product_code_max' => 'code1001', 'name' => '製品名1001', 'comment1' => 'コメント10011', 'comment2' => 'コメント10012', 'comment3' => 'コメント10013', 'main_list_comment' => 'リストコメント1001', 'main_image' => '1001.jpg', 'main_list_image' => '1001-main.jpg', 'price01_min' => '1500', 'price01_max' => '1500', 'price02_min' => '1500', 'price02_max' => '1500', 'stock_min' => '99', 'stock_max' => '99', 'stock_unlimited_min' => '0', 'stock_unlimited_max' => '0', 'deliv_date_id' => '1', 'status' => '1', 'del_flg' => '0', 'update_date' => $arrRet[0], 'price01_min_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax(1500), 'price01_max_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax(1500), 'price02_min_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax(1500), 'price02_max_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax(1500), 'maker_id' => null, 'comment4' => null, 'comment5' => null, 'comment6' => null, 'note' => null, 'main_comment' => 'メインコメント1001', 'main_large_image' => null, 'sub_title1' => null, 'sub_comment1' => null, 'sub_image1' => null, 'sub_large_image1' => null, 'sub_title2' => null, 'sub_comment2' => null, 'sub_image2' => null, 'sub_large_image2' => null, 'sub_title3' => null, 'sub_comment3' => null, 'sub_image3' => null, 'sub_large_image3' => null, 'sub_title4' => null, 'sub_comment4' => null, 'sub_image4' => null, 'sub_large_image4' => null, 'sub_title5' => null, 'sub_comment5' => null, 'sub_image5' => null, 'sub_large_image5' => null, 'sub_title6' => null, 'sub_comment6' => null, 'sub_image6' => null, 'sub_large_image6' => null, 'creator_id' => '1', 'create_date' => $arrRet[0], 'point_rate' => '0', 'deliv_fee' => null, 'maker_name' => null, + 'product_id' => '1001', 'product_code_min' => 'code1001', 'product_code_max' => 'code1001', 'name' => '製品名1001', 'comment1' => 'コメント10011', 'comment2' => 'コメント10012', 'comment3' => 'コメント10013', 'main_list_comment' => 'リストコメント1001', 'main_image' => '1001.jpg', 'main_list_image' => '1001-main.jpg', 'price01_min' => '1500', 'price01_max' => '1500', 'price02_min' => '1500', 'price02_max' => '1500', 'stock_min' => '99', 'stock_max' => '99', 'stock_unlimited_min' => '0', 'stock_unlimited_max' => '0', 'deliv_date_id' => '1', 'status' => '1', 'del_flg' => '0', 'update_date' => $arrRet[0], 'price01_min_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax(1500), 'price01_max_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax(1500), 'price02_min_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax(1500), 'price02_max_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax(1500), 'maker_id' => null, 'comment4' => null, 'comment5' => null, 'comment6' => null, 'note' => null, 'main_comment' => 'メインコメント1001', 'main_large_image' => null, 'sub_title1' => null, 'sub_comment1' => null, 'sub_image1' => null, 'sub_large_image1' => null, 'sub_title2' => null, 'sub_comment2' => null, 'sub_image2' => null, 'sub_large_image2' => null, 'sub_title3' => null, 'sub_comment3' => null, 'sub_image3' => null, 'sub_large_image3' => null, 'sub_title4' => null, 'sub_comment4' => null, 'sub_image4' => null, 'sub_large_image4' => null, 'sub_title5' => null, 'sub_comment5' => null, 'sub_image5' => null, 'sub_large_image5' => null, 'sub_title6' => null, 'sub_comment6' => null, 'sub_image6' => null, 'sub_large_image6' => null, 'creator_id' => '1', 'create_date' => $arrRet[0], 'point_rate' => '0', 'deliv_fee' => null, 'maker_name' => null, ]; $this->actual = $this->objProducts->getDetail('1001'); diff --git a/tests/class/SC_Product/SC_Product_getProductsClassTest.php b/tests/class/SC_Product/SC_Product_getProductsClassTest.php index 4a2c780e28..812db4c907 100644 --- a/tests/class/SC_Product/SC_Product_getProductsClassTest.php +++ b/tests/class/SC_Product/SC_Product_getProductsClassTest.php @@ -22,7 +22,7 @@ protected function tearDown(): void public function testGetProductsClass商品規格IDから規格情報を返す() { $this->expected = [ - 'product_id' => '1001', 'del_flg' => '0', 'point_rate' => '0', 'stock' => '99', 'stock_unlimited' => '0', 'sale_limit' => null, 'price01' => '1500', 'price02' => '1500', 'product_code' => 'code1001', 'product_class_id' => '1001', 'product_type_id' => '1', 'down_filename' => null, 'down_realfilename' => null, 'classcategory_name1' => 'cat1001', 'rank1' => '1', 'class_name1' => '味', 'class_id1' => '1', 'classcategory_id1' => '1001', 'classcategory_id2' => '1002', 'classcategory_name2' => 'cat1002', 'rank2' => '2', 'class_name2' => '味', 'class_id2' => '1', 'price01_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax(1500), 'price02_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax(1500), + 'product_id' => '1001', 'del_flg' => '0', 'point_rate' => '0', 'stock' => '99', 'stock_unlimited' => '0', 'sale_limit' => null, 'price01' => '1500', 'price02' => '1500', 'product_code' => 'code1001', 'product_class_id' => '1001', 'product_type_id' => '1', 'down_filename' => null, 'down_realfilename' => null, 'classcategory_name1' => 'cat1001', 'rank1' => '1', 'class_name1' => '味', 'class_id1' => '1', 'classcategory_id1' => '1001', 'classcategory_id2' => '1002', 'classcategory_name2' => 'cat1002', 'rank2' => '2', 'class_name2' => '味', 'class_id2' => '1', 'price01_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax(1500), 'price02_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax(1500), ]; $this->actual = $this->objProducts->getProductsClass('1001'); diff --git a/tests/class/SC_Query_Test.php b/tests/class/SC_Query_Test.php index a2a5a286ae..7977f62a3b 100644 --- a/tests/class/SC_Query_Test.php +++ b/tests/class/SC_Query_Test.php @@ -103,9 +103,9 @@ public function testGetAll() $result = $this->setTestData(1, '2', 'f'); $this->expected = [['id' => '1', - 'column1' => '1', - 'column2' => '2', - 'column3' => 'f', ]]; + 'column1' => '1', + 'column2' => '2', + 'column3' => 'f', ]]; $this->actual = $this->objQuery->getAll('SELECT * FROM test_table WHERE id = ?', [1]); $this->verify(); @@ -120,9 +120,9 @@ public function testSelect() $result = $this->setTestData(1, '2', 'f'); $this->expected = [['id' => '1', - 'column1' => '1', - 'column2' => '2', - 'column3' => 'f', ]]; + 'column1' => '1', + 'column2' => '2', + 'column3' => 'f', ]]; $this->actual = $this->objQuery->setWhere('id = ?') ->setOrder('id') @@ -190,9 +190,9 @@ public function testQuery1() $this->objQuery->query($sql, $data); $this->expected = [['id' => '1', - 'column1' => '1', - 'column2' => '1', - 'column3' => 'f', ]]; + 'column1' => '1', + 'column2' => '1', + 'column3' => 'f', ]]; $this->actual = $this->objQuery->getAll('SELECT * FROM test_table'); @@ -205,14 +205,14 @@ public function testInsert() $this->objQuery->insert('test_table', ['id' => '1', - 'column1' => '1', - 'column2' => '1', - 'column3' => 'f', ]); + 'column1' => '1', + 'column2' => '1', + 'column3' => 'f', ]); $this->expected = [['id' => '1', - 'column1' => '1', - 'column2' => '1', - 'column3' => 'f', ]]; + 'column1' => '1', + 'column2' => '1', + 'column3' => 'f', ]]; $this->actual = $this->objQuery->getAll('SELECT * FROM test_table'); @@ -233,9 +233,9 @@ public function testQuery2() $this->objQuery->query($sql, $data); $this->expected = [['id' => '1', - 'column1' => '2', - 'column2' => '2', - 'column3' => 'f', ]]; + 'column1' => '2', + 'column2' => '2', + 'column3' => 'f', ]]; $this->actual = $this->objQuery->getAll('SELECT * FROM test_table'); @@ -248,15 +248,21 @@ public function testUpdate() $this->setTestData(1, '2', 'f'); $this->objQuery->update('test_table', - ['id' => '1', - 'column1' => '2', - 'column2' => '2', - 'column3' => 'f', ], + [ + 'id' => '1', + 'column1' => '2', + 'column2' => '2', + 'column3' => 'f', + ], 'id = ?', [1]); - $this->expected = [['id' => '1', - 'column1' => '2', - 'column2' => '2', - 'column3' => 'f', ]]; + $this->expected = [ + [ + 'id' => '1', + 'column1' => '2', + 'column2' => '2', + 'column3' => 'f', + ], + ]; $this->actual = $this->objQuery->getAll('SELECT * FROM test_table'); diff --git a/tests/class/SC_SendMailTest.php b/tests/class/SC_SendMailTest.php index 20016880ba..5b15864466 100644 --- a/tests/class/SC_SendMailTest.php +++ b/tests/class/SC_SendMailTest.php @@ -144,6 +144,7 @@ public function testGetRecip() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testGetBackendParams() diff --git a/tests/class/SC_SessionFactoryTest.php b/tests/class/SC_SessionFactoryTest.php index d94aa692ff..d9f10592ec 100644 --- a/tests/class/SC_SessionFactoryTest.php +++ b/tests/class/SC_SessionFactoryTest.php @@ -13,7 +13,7 @@ public function testGetInstance() $refClass = new ReflectionClass($sessionFactory); $refMethod = $refClass->getMethod('getSecureOption'); $refMethod->setAccessible(true); - if (strpos(HTTP_URL, 'https') !== false) { + if (str_contains(HTTP_URL, 'https')) { $this->assertTrue($refMethod->invoke($sessionFactory)); } else { $this->markTestIncomplete(); diff --git a/tests/class/fixtures/plugin/PrefilterTransformPlugin/PrefilterTransformPlugin.php b/tests/class/fixtures/plugin/PrefilterTransformPlugin/PrefilterTransformPlugin.php index 1b0614f291..20a3e68f8f 100644 --- a/tests/class/fixtures/plugin/PrefilterTransformPlugin/PrefilterTransformPlugin.php +++ b/tests/class/fixtures/plugin/PrefilterTransformPlugin/PrefilterTransformPlugin.php @@ -9,7 +9,7 @@ public function prefilterTransform(&$source, LC_Page_Ex $objPage, $filename) case DEVICE_TYPE_SMARTPHONE: case DEVICE_TYPE_PC: // 商品一覧画面 - if (strpos($filename, 'products/list.tpl') !== false) { + if (str_contains($filename, 'products/list.tpl')) { // see http://downloads.ec-cube.net/manual/12.0_plugin/plugin.pdf $objTransform->select('h2.title')->insertBefore('

プラグイン仕様書の記述方法

'); } @@ -19,7 +19,7 @@ public function prefilterTransform(&$source, LC_Page_Ex $objPage, $filename) break; case DEVICE_TYPE_ADMIN: default: - } + } $source = $objTransform->getHTML(); } } diff --git a/tests/class/helper/SC_Helper_Address/SC_Helper_Address_TestBase.php b/tests/class/helper/SC_Helper_Address/SC_Helper_Address_TestBase.php index 01bde11e48..bd711ebe7b 100644 --- a/tests/class/helper/SC_Helper_Address/SC_Helper_Address_TestBase.php +++ b/tests/class/helper/SC_Helper_Address/SC_Helper_Address_TestBase.php @@ -20,7 +20,7 @@ protected function tearDown(): void */ protected function setUpAddress() { - $objQuery = &SC_Query_Ex::getSingletonInstance(); + $objQuery = SC_Query_Ex::getSingletonInstance(); // シーケンス初期化 $kiyaku = [ @@ -42,7 +42,7 @@ protected function setUpAddress() 'fax01' => '111', 'fax02' => '1111', 'fax03' => '1111', - ], + ], [ 'other_deliv_id' => '1001', 'customer_id' => '1', @@ -61,8 +61,8 @@ protected function setUpAddress() 'fax01' => '111', 'fax02' => '1111', 'fax03' => '1111', - ], - ]; + ], + ]; $this->objQuery->delete('dtb_other_deliv'); foreach ($kiyaku as $key => $item) { diff --git a/tests/class/helper/SC_Helper_Address/SC_Helper_Address_deleteAddressTest.php b/tests/class/helper/SC_Helper_Address/SC_Helper_Address_deleteAddressTest.php index 49c5783e3d..b8b2de74c4 100644 --- a/tests/class/helper/SC_Helper_Address/SC_Helper_Address_deleteAddressTest.php +++ b/tests/class/helper/SC_Helper_Address/SC_Helper_Address_deleteAddressTest.php @@ -25,7 +25,7 @@ public function testdeleteAddressTest会員の登録配送先を削除する() $customer_id = 1; $this->expected = null; $this->objAddress->deleteAddress($other_deliv_id, $customer_id); - $objQuery = &SC_Query_Ex::getSingletonInstance(); + $objQuery = SC_Query_Ex::getSingletonInstance(); $select = '*'; $from = 'dtb_other_deliv'; $where = 'other_deliv_id = ? AND customer_id = ?'; diff --git a/tests/class/helper/SC_Helper_Address/SC_Helper_Address_getAddressTest.php b/tests/class/helper/SC_Helper_Address/SC_Helper_Address_getAddressTest.php index e3ceade30f..713069045b 100644 --- a/tests/class/helper/SC_Helper_Address/SC_Helper_Address_getAddressTest.php +++ b/tests/class/helper/SC_Helper_Address/SC_Helper_Address_getAddressTest.php @@ -45,27 +45,27 @@ public function testgetAddressTest会員の登録配送先が該当テーブル $other_deliv_id = '1001'; $customer_id = 1; $this->expected = [ - 'other_deliv_id' => '1001', - 'customer_id' => '1', - 'name01' => 'テスト', - 'name02' => 'に', - 'kana01' => 'テスト', - 'kana02' => 'ニ', - 'zip01' => '222', - 'zip02' => '2222', - 'pref' => '2', - 'addr01' => 'テスト1', - 'addr02' => 'テスト2', - 'tel01' => '000', - 'tel02' => '0000', - 'tel03' => '0000', - 'fax01' => '111', - 'fax02' => '1111', - 'fax03' => '1111', - 'country_id' => null, - 'company_name' => null, - 'zipcode' => null, - ]; + 'other_deliv_id' => '1001', + 'customer_id' => '1', + 'name01' => 'テスト', + 'name02' => 'に', + 'kana01' => 'テスト', + 'kana02' => 'ニ', + 'zip01' => '222', + 'zip02' => '2222', + 'pref' => '2', + 'addr01' => 'テスト1', + 'addr02' => 'テスト2', + 'tel01' => '000', + 'tel02' => '0000', + 'tel03' => '0000', + 'fax01' => '111', + 'fax02' => '1111', + 'fax03' => '1111', + 'country_id' => null, + 'company_name' => null, + 'zipcode' => null, + ]; $this->actual = $this->objAddress->getAddress($other_deliv_id, $customer_id); $this->verify('登録配送先取得'); diff --git a/tests/class/helper/SC_Helper_Address/SC_Helper_Address_getListTest.php b/tests/class/helper/SC_Helper_Address/SC_Helper_Address_getListTest.php index 1efba72da7..2366608579 100644 --- a/tests/class/helper/SC_Helper_Address/SC_Helper_Address_getListTest.php +++ b/tests/class/helper/SC_Helper_Address/SC_Helper_Address_getListTest.php @@ -44,8 +44,8 @@ public function testgetListTest会員が該当テーブルに存在するかつs 'country_id' => null, 'company_name' => null, 'zipcode' => null, - ], - ]; + ], + ]; $this->actual = $this->objAddress->getList($customer_id, $startno); $this->verify('配送先一覧取得'); @@ -56,7 +56,7 @@ public function testgetListTest会員が該当テーブルに存在する場合 $this->setUpAddress(); $customer_id = '1'; $this->expected = [ - [ + [ 'other_deliv_id' => '1001', 'customer_id' => '1', 'name01' => 'テスト', @@ -77,7 +77,7 @@ public function testgetListTest会員が該当テーブルに存在する場合 'country_id' => null, 'company_name' => null, 'zipcode' => null, - ], + ], [ 'other_deliv_id' => '1000', 'customer_id' => '1', @@ -99,8 +99,8 @@ public function testgetListTest会員が該当テーブルに存在する場合 'country_id' => null, 'company_name' => null, 'zipcode' => null, - ], - ]; + ], + ]; $this->actual = $this->objAddress->getList($customer_id); $this->verify('配送先一覧取得'); diff --git a/tests/class/helper/SC_Helper_Address/SC_Helper_Address_registAddressTest.php b/tests/class/helper/SC_Helper_Address/SC_Helper_Address_registAddressTest.php index 50a2d8f4cc..800fb41e7c 100644 --- a/tests/class/helper/SC_Helper_Address/SC_Helper_Address_registAddressTest.php +++ b/tests/class/helper/SC_Helper_Address/SC_Helper_Address_registAddressTest.php @@ -22,7 +22,7 @@ protected function tearDown(): void /* public function testregistAddressTest_顧客idが無い場合_システムエラーを返す() { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = SC_Query_Ex::getSingletonInstance(); $this->setUpAddress(); //$this->expected = "1"; $this->objAddress->registAddress(null); @@ -56,7 +56,7 @@ public function testregistAddressTest_会員の登録配送先を追加する() 'fax03' => '1114', 'country_id' => null ); - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = SC_Query_Ex::getSingletonInstance(); $this->expected = '1002'; $this->objAddress->registAddress($arrSql); $col = 'other_deliv_id'; @@ -96,7 +96,7 @@ public function testregistAddressTest会員の登録配送先を更新する() 'company_name' => null, 'zipcode' => null, ]; - $objQuery = &SC_Query_Ex::getSingletonInstance(); + $objQuery = SC_Query_Ex::getSingletonInstance(); $this->objAddress->registAddress($arrSql); $this->expected = $arrSql; diff --git a/tests/class/helper/SC_Helper_DB/SC_Helper_DB_TestBase.php b/tests/class/helper/SC_Helper_DB/SC_Helper_DB_TestBase.php index a0e580e133..8be6678a82 100644 --- a/tests/class/helper/SC_Helper_DB/SC_Helper_DB_TestBase.php +++ b/tests/class/helper/SC_Helper_DB/SC_Helper_DB_TestBase.php @@ -49,28 +49,28 @@ protected function setUpNews() { $news = [ [ - 'update_date' => '2000-01-01 00:00:00', - 'news_id' => '1', - 'news_title' => 'ニュース情報01', - 'rank' => '1', - 'creator_id' => '1', - 'del_flg' => '0', + 'update_date' => '2000-01-01 00:00:00', + 'news_id' => '1', + 'news_title' => 'ニュース情報01', + 'rank' => '1', + 'creator_id' => '1', + 'del_flg' => '0', ], [ - 'update_date' => '2000-01-01 00:00:00', - 'news_id' => '2', - 'news_title' => 'ニュース情報02', - 'rank' => '2', - 'creator_id' => '1', - 'del_flg' => '0', + 'update_date' => '2000-01-01 00:00:00', + 'news_id' => '2', + 'news_title' => 'ニュース情報02', + 'rank' => '2', + 'creator_id' => '1', + 'del_flg' => '0', ], [ - 'update_date' => '2000-01-01 00:00:00', - 'news_id' => '3', - 'news_title' => 'ニュース情報03', - 'rank' => '3', - 'creator_id' => '1', - 'del_flg' => '0', + 'update_date' => '2000-01-01 00:00:00', + 'news_id' => '3', + 'news_title' => 'ニュース情報03', + 'rank' => '3', + 'creator_id' => '1', + 'del_flg' => '0', ], ]; diff --git a/tests/class/helper/SC_Helper_DB/SC_Helper_DB_sfGetAddPointTest.php b/tests/class/helper/SC_Helper_DB/SC_Helper_DB_sfGetAddPointTest.php index 53197f8746..96c65149e0 100644 --- a/tests/class/helper/SC_Helper_DB/SC_Helper_DB_sfGetAddPointTest.php +++ b/tests/class/helper/SC_Helper_DB/SC_Helper_DB_sfGetAddPointTest.php @@ -13,6 +13,7 @@ protected function setUp(): void /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testSfGetAddPoint() @@ -28,6 +29,7 @@ public function testSfGetAddPoint() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testSfGetAddPointWithMinus() diff --git a/tests/class/helper/SC_Helper_DB/SC_Helper_DB_sfGetBasisCountTest.php b/tests/class/helper/SC_Helper_DB/SC_Helper_DB_sfGetBasisCountTest.php index 787aa760ab..634835e670 100644 --- a/tests/class/helper/SC_Helper_DB/SC_Helper_DB_sfGetBasisCountTest.php +++ b/tests/class/helper/SC_Helper_DB/SC_Helper_DB_sfGetBasisCountTest.php @@ -59,7 +59,7 @@ public function testSfGetBasisCount_baseinfoのデータが2行の場合_2を返 $baseinfo = [ 'id' => 2, 'update_date' => 'CURRENT_TIMESTAMP', - ]; + ]; $this->objQuery->insert('dtb_baseinfo', $baseinfo); $this->expected = 2; $this->actual = $this->helper->sfGetBasisCount(); diff --git a/tests/class/helper/SC_Helper_Kiyaku/SC_Helper_Kiyaku_TestBase.php b/tests/class/helper/SC_Helper_Kiyaku/SC_Helper_Kiyaku_TestBase.php index 3845d6c618..12dcfa8efd 100755 --- a/tests/class/helper/SC_Helper_Kiyaku/SC_Helper_Kiyaku_TestBase.php +++ b/tests/class/helper/SC_Helper_Kiyaku/SC_Helper_Kiyaku_TestBase.php @@ -20,7 +20,7 @@ protected function tearDown(): void */ protected function setUpKiyaku() { - $objQuery = &SC_Query_Ex::getSingletonInstance(); + $objQuery = SC_Query_Ex::getSingletonInstance(); $kiyaku = [ [ @@ -32,7 +32,7 @@ protected function setUpKiyaku() 'create_date' => '2000-01-01 00:00:00', 'update_date' => '2000-01-01 00:00:00', 'del_flg' => '0', - ], + ], [ 'kiyaku_id' => '1001', 'kiyaku_title' => 'test2', @@ -42,7 +42,7 @@ protected function setUpKiyaku() 'create_date' => '2000-01-01 00:00:00', 'update_date' => '2000-01-01 00:00:00', 'del_flg' => '0', - ], + ], [ 'kiyaku_id' => '1002', 'kiyaku_title' => 'test3', @@ -52,8 +52,8 @@ protected function setUpKiyaku() 'create_date' => '2000-01-01 00:00:00', 'update_date' => '2000-01-01 00:00:00', 'del_flg' => '1', - ], - ]; + ], + ]; $this->objQuery->delete('dtb_kiyaku'); foreach ($kiyaku as $key => $item) { diff --git a/tests/class/helper/SC_Helper_Kiyaku/SC_Helper_Kiyaku_deleteKiyakuTest.php b/tests/class/helper/SC_Helper_Kiyaku/SC_Helper_Kiyaku_deleteKiyakuTest.php index 1bb11dc65b..8f6972d714 100644 --- a/tests/class/helper/SC_Helper_Kiyaku/SC_Helper_Kiyaku_deleteKiyakuTest.php +++ b/tests/class/helper/SC_Helper_Kiyaku/SC_Helper_Kiyaku_deleteKiyakuTest.php @@ -20,7 +20,7 @@ protected function tearDown(): void public function testdeleteKiyakuTest削除ができた場合DelFlgの1を返す() { - $objQuery = &SC_Query_Ex::getSingletonInstance(); + $objQuery = SC_Query_Ex::getSingletonInstance(); $this->setUpKiyaku(); $kiyaku_id = 1001; diff --git a/tests/class/helper/SC_Helper_Kiyaku/SC_Helper_Kiyaku_getKiyakuTest.php b/tests/class/helper/SC_Helper_Kiyaku/SC_Helper_Kiyaku_getKiyakuTest.php index 728d7c3095..277cf20138 100644 --- a/tests/class/helper/SC_Helper_Kiyaku/SC_Helper_Kiyaku_getKiyakuTest.php +++ b/tests/class/helper/SC_Helper_Kiyaku/SC_Helper_Kiyaku_getKiyakuTest.php @@ -20,7 +20,7 @@ protected function tearDown(): void public function testgetKiyakuTest規約情報を取得できた場合規約のarrayを返す() { - $objQuery = &SC_Query_Ex::getSingletonInstance(); + $objQuery = SC_Query_Ex::getSingletonInstance(); $this->setUpKiyaku(); $has_deleted = false; $kiyaku_id = 1000; @@ -34,7 +34,7 @@ public function testgetKiyakuTest規約情報を取得できた場合規約のar 'create_date' => '2000-01-01 00:00:00', 'update_date' => '2000-01-01 00:00:00', 'del_flg' => '0', - ]; + ]; $this->actual = $this->objKiyaku->getKiyaku($kiyaku_id, $has_deleted); $this->verify('規約詳細取得'); @@ -42,7 +42,7 @@ public function testgetKiyakuTest規約情報を取得できた場合規約のar public function testgetKiyakuTest規約情報を規約idから取得する際削除された規約を指定した場合Nullを返す() { - $objQuery = &SC_Query_Ex::getSingletonInstance(); + $objQuery = SC_Query_Ex::getSingletonInstance(); $this->setUpKiyaku(); $has_deleted = false; $kiyaku_id = 1002; @@ -55,21 +55,21 @@ public function testgetKiyakuTest規約情報を規約idから取得する際削 public function testgetKiyakuTest削除された情報を含む規約情報を規約idから取得する際削除された規約を指定した場合Nullを返す() { - $objQuery = &SC_Query_Ex::getSingletonInstance(); + $objQuery = SC_Query_Ex::getSingletonInstance(); $this->setUpKiyaku(); $has_deleted = true; $kiyaku_id = 1002; // 期待値 $this->expected = [ - 'kiyaku_id' => '1002', - 'kiyaku_title' => 'test3', - 'kiyaku_text' => 'test_text', - 'rank' => '10', - 'creator_id' => '0', - 'create_date' => '2000-01-01 00:00:00', - 'update_date' => '2000-01-01 00:00:00', - 'del_flg' => '1', - ]; + 'kiyaku_id' => '1002', + 'kiyaku_title' => 'test3', + 'kiyaku_text' => 'test_text', + 'rank' => '10', + 'creator_id' => '0', + 'create_date' => '2000-01-01 00:00:00', + 'update_date' => '2000-01-01 00:00:00', + 'del_flg' => '1', + ]; $this->actual = $this->objKiyaku->getKiyaku($kiyaku_id, $has_deleted); $this->verify('規約詳細取得'); diff --git a/tests/class/helper/SC_Helper_Kiyaku/SC_Helper_Kiyaku_getListTest.php b/tests/class/helper/SC_Helper_Kiyaku/SC_Helper_Kiyaku_getListTest.php index a493ce3af2..a86dd4d7d2 100644 --- a/tests/class/helper/SC_Helper_Kiyaku/SC_Helper_Kiyaku_getListTest.php +++ b/tests/class/helper/SC_Helper_Kiyaku/SC_Helper_Kiyaku_getListTest.php @@ -20,7 +20,7 @@ protected function tearDown(): void public function testgetListTest削除した商品も含んだ一覧を取得できた場合一覧のarrayを返す() { - $objQuery = &SC_Query_Ex::getSingletonInstance(); + $objQuery = SC_Query_Ex::getSingletonInstance(); $this->setUpKiyaku(); $has_deleted = true; // 期待値 @@ -29,18 +29,18 @@ public function testgetListTest削除した商品も含んだ一覧を取得で 'kiyaku_id' => '1000', 'kiyaku_title' => 'test1', 'kiyaku_text' => 'test_text', - ], + ], [ 'kiyaku_id' => '1001', 'kiyaku_title' => 'test2', 'kiyaku_text' => 'test_text2', - ], + ], [ 'kiyaku_id' => '1002', 'kiyaku_title' => 'test3', 'kiyaku_text' => 'test_text', - ], - ]; + ], + ]; $this->actual = $this->objKiyaku->getList($has_deleted); $this->verify('規約一覧取得'); @@ -48,7 +48,7 @@ public function testgetListTest削除した商品も含んだ一覧を取得で public function testgetListTest一覧を取得できた場合削除した商品は取得しない一覧のarrayを返す() { - $objQuery = &SC_Query_Ex::getSingletonInstance(); + $objQuery = SC_Query_Ex::getSingletonInstance(); $this->setUpKiyaku(); $has_deleted = false; // 期待値 @@ -57,13 +57,13 @@ public function testgetListTest一覧を取得できた場合削除した商品 'kiyaku_id' => '1000', 'kiyaku_title' => 'test1', 'kiyaku_text' => 'test_text', - ], + ], [ 'kiyaku_id' => '1001', 'kiyaku_title' => 'test2', 'kiyaku_text' => 'test_text2', - ], - ]; + ], + ]; $this->actual = $this->objKiyaku->getList($has_deleted); $this->verify('規約一覧取得'); diff --git a/tests/class/helper/SC_Helper_Kiyaku/SC_Helper_Kiyaku_rankDownTest.php b/tests/class/helper/SC_Helper_Kiyaku/SC_Helper_Kiyaku_rankDownTest.php index dcaf5e18a6..3b2ff94065 100644 --- a/tests/class/helper/SC_Helper_Kiyaku/SC_Helper_Kiyaku_rankDownTest.php +++ b/tests/class/helper/SC_Helper_Kiyaku/SC_Helper_Kiyaku_rankDownTest.php @@ -20,7 +20,7 @@ protected function tearDown(): void public function testrankDownTestランクダウンができた場合ランクを返す() { - $objQuery = &SC_Query_Ex::getSingletonInstance(); + $objQuery = SC_Query_Ex::getSingletonInstance(); $this->setUpKiyaku(); $kiyaku_id = 1000; diff --git a/tests/class/helper/SC_Helper_Kiyaku/SC_Helper_Kiyaku_rankUpTest.php b/tests/class/helper/SC_Helper_Kiyaku/SC_Helper_Kiyaku_rankUpTest.php index 4011159452..2504fef7c4 100644 --- a/tests/class/helper/SC_Helper_Kiyaku/SC_Helper_Kiyaku_rankUpTest.php +++ b/tests/class/helper/SC_Helper_Kiyaku/SC_Helper_Kiyaku_rankUpTest.php @@ -20,7 +20,7 @@ protected function tearDown(): void public function testrankUpTestランクアップができた場合ランクを返す() { - $objQuery = &SC_Query_Ex::getSingletonInstance(); + $objQuery = SC_Query_Ex::getSingletonInstance(); $this->setUpKiyaku(); $kiyaku_id = 1001; diff --git a/tests/class/helper/SC_Helper_Kiyaku/SC_Helper_Kiyaku_saveKiyakuTest.php b/tests/class/helper/SC_Helper_Kiyaku/SC_Helper_Kiyaku_saveKiyakuTest.php index c798b15f8c..daf8acaa31 100644 --- a/tests/class/helper/SC_Helper_Kiyaku/SC_Helper_Kiyaku_saveKiyakuTest.php +++ b/tests/class/helper/SC_Helper_Kiyaku/SC_Helper_Kiyaku_saveKiyakuTest.php @@ -24,7 +24,7 @@ public function testsaveKiyakuTest_新規で規約を登録する場合_1003を if(DB_TYPE != 'pgsql') { //postgresqlだとどうしてもDBエラーになるのでとりいそぎ回避 - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = SC_Query_Ex::getSingletonInstance(); $this->setUpKiyaku(); $this->expected = '1003'; @@ -54,7 +54,7 @@ public function testsaveKiyakuTest_規約を更新する場合_1001を返す() { if(DB_TYPE != 'pgsql') { //postgresqlだとどうしてもDBエラーになるのでとりいそぎ回避 - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = SC_Query_Ex::getSingletonInstance(); $this->setUpKiyaku(); $sqlval = array( 'kiyaku_id' => '1001', diff --git a/tests/class/helper/SC_Helper_News/SC_Helper_News_TestBase.php b/tests/class/helper/SC_Helper_News/SC_Helper_News_TestBase.php index 6bab18076f..068526078a 100644 --- a/tests/class/helper/SC_Helper_News/SC_Helper_News_TestBase.php +++ b/tests/class/helper/SC_Helper_News/SC_Helper_News_TestBase.php @@ -48,37 +48,37 @@ protected function tearDown(): void protected function setUpNews() { $news = [ - [ - 'update_date' => '2000-01-01 00:00:00', - 'news_id' => '1001', - 'news_title' => 'ニュース情報01', - 'rank' => '1', - 'creator_id' => '1', - 'del_flg' => '0', + [ + 'update_date' => '2000-01-01 00:00:00', + 'news_id' => '1001', + 'news_title' => 'ニュース情報01', + 'rank' => '1', + 'creator_id' => '1', + 'del_flg' => '0', ], - [ - 'update_date' => '2000-01-01 00:00:00', - 'news_id' => '1002', - 'news_title' => 'ニュース情報02', - 'rank' => '2', - 'creator_id' => '1', - 'del_flg' => '0', + [ + 'update_date' => '2000-01-01 00:00:00', + 'news_id' => '1002', + 'news_title' => 'ニュース情報02', + 'rank' => '2', + 'creator_id' => '1', + 'del_flg' => '0', ], - [ - 'update_date' => '2000-01-01 00:00:00', - 'news_id' => '1003', - 'news_title' => 'ニュース情報03', - 'rank' => '3', - 'creator_id' => '1', - 'del_flg' => '1', + [ + 'update_date' => '2000-01-01 00:00:00', + 'news_id' => '1003', + 'news_title' => 'ニュース情報03', + 'rank' => '3', + 'creator_id' => '1', + 'del_flg' => '1', ], - [ - 'update_date' => '2000-01-01 00:00:00', - 'news_id' => '1004', - 'news_title' => 'ニュース情報04', - 'rank' => '4', - 'creator_id' => '1', - 'del_flg' => '0', + [ + 'update_date' => '2000-01-01 00:00:00', + 'news_id' => '1004', + 'news_title' => 'ニュース情報04', + 'rank' => '4', + 'creator_id' => '1', + 'del_flg' => '0', ], ]; diff --git a/tests/class/helper/SC_Helper_News/SC_Helper_News_deleteNewsTest.php b/tests/class/helper/SC_Helper_News/SC_Helper_News_deleteNewsTest.php index 4bd5450554..89a9b22b6a 100644 --- a/tests/class/helper/SC_Helper_News/SC_Helper_News_deleteNewsTest.php +++ b/tests/class/helper/SC_Helper_News/SC_Helper_News_deleteNewsTest.php @@ -20,7 +20,7 @@ protected function tearDown(): void public function testDeleteNewsTestニュースIDを指定した場合対象のニュース情報が削除される() { - $objQuery = &SC_Query_Ex::getSingletonInstance(); + $objQuery = SC_Query_Ex::getSingletonInstance(); $this->setUpNews(); $news_id = 1002; diff --git a/tests/class/helper/SC_Helper_News/SC_Helper_News_getListTest.php b/tests/class/helper/SC_Helper_News/SC_Helper_News_getListTest.php index 0b67af39db..d775a8e2eb 100644 --- a/tests/class/helper/SC_Helper_News/SC_Helper_News_getListTest.php +++ b/tests/class/helper/SC_Helper_News/SC_Helper_News_getListTest.php @@ -20,42 +20,42 @@ protected function tearDown(): void public function testGetList削除されたニュースも含む場合全てのニュース一覧が取得できる() { - $objQuery = &SC_Query_Ex::getSingletonInstance(); + $objQuery = SC_Query_Ex::getSingletonInstance(); $this->setUpNews(); $dispNumber = 0; $pageNumber = 0; $has_deleted = true; $this->expected = [ - [ - 'update_date' => '2000-01-01 00:00:00', - 'news_id' => '1004', - 'news_title' => 'ニュース情報04', - 'creator_id' => '1', - 'del_flg' => '0', + [ + 'update_date' => '2000-01-01 00:00:00', + 'news_id' => '1004', + 'news_title' => 'ニュース情報04', + 'creator_id' => '1', + 'del_flg' => '0', ], - [ - 'update_date' => '2000-01-01 00:00:00', - 'news_id' => '1003', - 'news_title' => 'ニュース情報03', - 'creator_id' => '1', - 'del_flg' => '1', + [ + 'update_date' => '2000-01-01 00:00:00', + 'news_id' => '1003', + 'news_title' => 'ニュース情報03', + 'creator_id' => '1', + 'del_flg' => '1', ], - [ - 'update_date' => '2000-01-01 00:00:00', - 'news_id' => '1002', - 'news_title' => 'ニュース情報02', - 'creator_id' => '1', - 'del_flg' => '0', + [ + 'update_date' => '2000-01-01 00:00:00', + 'news_id' => '1002', + 'news_title' => 'ニュース情報02', + 'creator_id' => '1', + 'del_flg' => '0', ], - [ - 'update_date' => '2000-01-01 00:00:00', - 'news_id' => '1001', - 'news_title' => 'ニュース情報01', - 'creator_id' => '1', - 'del_flg' => '0', + [ + 'update_date' => '2000-01-01 00:00:00', + 'news_id' => '1001', + 'news_title' => 'ニュース情報01', + 'creator_id' => '1', + 'del_flg' => '0', ], - ]; + ]; $result = $this->objNews->getList($dispNumber, $pageNumber, $has_deleted); foreach ($result as $value) { $this->actual[] = Test_Utils::mapArray($value, ['update_date', 'news_id', 'news_title', 'creator_id', 'del_flg']); @@ -66,35 +66,35 @@ public function testGetList削除されたニュースも含む場合全ての public function testGetList削除されたニュースは含まない場合削除されていないニュース一覧が取得できる() { - $objQuery = &SC_Query_Ex::getSingletonInstance(); + $objQuery = SC_Query_Ex::getSingletonInstance(); $this->setUpNews(); $dispNumber = 0; $pageNumber = 0; $has_deleted = false; $this->expected = [ - [ - 'update_date' => '2000-01-01 00:00:00', - 'news_id' => '1004', - 'news_title' => 'ニュース情報04', - 'creator_id' => '1', - 'del_flg' => '0', + [ + 'update_date' => '2000-01-01 00:00:00', + 'news_id' => '1004', + 'news_title' => 'ニュース情報04', + 'creator_id' => '1', + 'del_flg' => '0', ], - [ - 'update_date' => '2000-01-01 00:00:00', - 'news_id' => '1002', - 'news_title' => 'ニュース情報02', - 'creator_id' => '1', - 'del_flg' => '0', + [ + 'update_date' => '2000-01-01 00:00:00', + 'news_id' => '1002', + 'news_title' => 'ニュース情報02', + 'creator_id' => '1', + 'del_flg' => '0', ], - [ - 'update_date' => '2000-01-01 00:00:00', - 'news_id' => '1001', - 'news_title' => 'ニュース情報01', - 'creator_id' => '1', - 'del_flg' => '0', + [ + 'update_date' => '2000-01-01 00:00:00', + 'news_id' => '1001', + 'news_title' => 'ニュース情報01', + 'creator_id' => '1', + 'del_flg' => '0', ], - ]; + ]; $result = $this->objNews->getList($dispNumber, $pageNumber, $has_deleted); foreach ($result as $value) { @@ -106,18 +106,18 @@ public function testGetList削除されたニュースは含まない場合削 public function testGetList表示件数1かつページ番号3の場合対象のニュースが取得できる() { - $objQuery = &SC_Query_Ex::getSingletonInstance(); + $objQuery = SC_Query_Ex::getSingletonInstance(); $this->setUpNews(); $dispNumber = 1; $pageNumber = 3; $has_deleted = false; $this->expected = [ - 'update_date' => '2000-01-01 00:00:00', - 'news_id' => '1001', - 'news_title' => 'ニュース情報01', - 'creator_id' => '1', - 'del_flg' => '0', + 'update_date' => '2000-01-01 00:00:00', + 'news_id' => '1001', + 'news_title' => 'ニュース情報01', + 'creator_id' => '1', + 'del_flg' => '0', ]; $result = $this->objNews->getList($dispNumber, $pageNumber, $has_deleted); @@ -128,18 +128,18 @@ public function testGetList表示件数1かつページ番号3の場合対象の public function testGetList表示件数1かつページ番号0の場合対象のニュースが取得できる() { - $objQuery = &SC_Query_Ex::getSingletonInstance(); + $objQuery = SC_Query_Ex::getSingletonInstance(); $this->setUpNews(); $dispNumber = 1; $pageNumber = 0; $has_deleted = false; $this->expected = [ - 'update_date' => '2000-01-01 00:00:00', - 'news_id' => '1004', - 'news_title' => 'ニュース情報04', - 'creator_id' => '1', - 'del_flg' => '0', + 'update_date' => '2000-01-01 00:00:00', + 'news_id' => '1004', + 'news_title' => 'ニュース情報04', + 'creator_id' => '1', + 'del_flg' => '0', ]; $result = $this->objNews->getList($dispNumber, $pageNumber, $has_deleted); diff --git a/tests/class/helper/SC_Helper_News/SC_Helper_News_getNewsTest.php b/tests/class/helper/SC_Helper_News/SC_Helper_News_getNewsTest.php index a630d1c7f5..1e9b202e3b 100644 --- a/tests/class/helper/SC_Helper_News/SC_Helper_News_getNewsTest.php +++ b/tests/class/helper/SC_Helper_News/SC_Helper_News_getNewsTest.php @@ -36,11 +36,11 @@ public function testGet存在するニュースIDを指定した場合対応す $news_id = '1001'; $this->expected = [ - 'update_date' => '2000-01-01 00:00:00', - 'news_id' => '1001', - 'news_title' => 'ニュース情報01', - 'creator_id' => '1', - 'del_flg' => '0', + 'update_date' => '2000-01-01 00:00:00', + 'news_id' => '1001', + 'news_title' => 'ニュース情報01', + 'creator_id' => '1', + 'del_flg' => '0', ]; $result = $this->objNews->getNews($news_id); diff --git a/tests/class/helper/SC_Helper_News/SC_Helper_News_moveRankTest.php b/tests/class/helper/SC_Helper_News/SC_Helper_News_moveRankTest.php index e10cb9b64b..b48232f26e 100644 --- a/tests/class/helper/SC_Helper_News/SC_Helper_News_moveRankTest.php +++ b/tests/class/helper/SC_Helper_News/SC_Helper_News_moveRankTest.php @@ -20,7 +20,7 @@ protected function tearDown(): void public function testMoveRankTestニュースIDと移動先ランクを指定した場合対象のランクが移動する() { - $objQuery = &SC_Query_Ex::getSingletonInstance(); + $objQuery = SC_Query_Ex::getSingletonInstance(); $this->setUpNews(); $news_id = 1001; $rank = 1; diff --git a/tests/class/helper/SC_Helper_News/SC_Helper_News_rankDownTest.php b/tests/class/helper/SC_Helper_News/SC_Helper_News_rankDownTest.php index 1e557b7d36..1ae36aecd2 100644 --- a/tests/class/helper/SC_Helper_News/SC_Helper_News_rankDownTest.php +++ b/tests/class/helper/SC_Helper_News/SC_Helper_News_rankDownTest.php @@ -20,7 +20,7 @@ protected function tearDown(): void public function testRankDownTestニュースIDを指定した場合対象のランクが1減少する() { - $objQuery = &SC_Query_Ex::getSingletonInstance(); + $objQuery = SC_Query_Ex::getSingletonInstance(); $this->setUpNews(); $news_id = 1003; diff --git a/tests/class/helper/SC_Helper_News/SC_Helper_News_rankUpTest.php b/tests/class/helper/SC_Helper_News/SC_Helper_News_rankUpTest.php index 67d2db3fc4..b0b1dc036c 100644 --- a/tests/class/helper/SC_Helper_News/SC_Helper_News_rankUpTest.php +++ b/tests/class/helper/SC_Helper_News/SC_Helper_News_rankUpTest.php @@ -20,7 +20,7 @@ protected function tearDown(): void public function testRankUpTestニュースIDを指定した場合対象のランクが1増加する() { - $objQuery = &SC_Query_Ex::getSingletonInstance(); + $objQuery = SC_Query_Ex::getSingletonInstance(); $this->setUpNews(); $news_id = 1002; diff --git a/tests/class/helper/SC_Helper_News/SC_Helper_News_saveNewsTest.php b/tests/class/helper/SC_Helper_News/SC_Helper_News_saveNewsTest.php index d92ca149a8..954a4dffc1 100644 --- a/tests/class/helper/SC_Helper_News/SC_Helper_News_saveNewsTest.php +++ b/tests/class/helper/SC_Helper_News/SC_Helper_News_saveNewsTest.php @@ -24,7 +24,7 @@ public function testSaveNewsTestNewsIdが空の場合新規登録される() $this->markTestSkipped('postgresqlだとどうしてもDBエラーになるのでスキップ'); } - $objQuery = &SC_Query_Ex::getSingletonInstance(); + $objQuery = SC_Query_Ex::getSingletonInstance(); $this->setUpNews(); $sqlval = [ @@ -48,7 +48,8 @@ public function testSaveNewsTestNewsIdが空の場合新規登録される() 'news_title, creator_id, del_flg', 'dtb_news', 'news_id = ?', - [$ret_id]); + [$ret_id] + ); $this->actual['content'] = $result[0]; $this->verify(); @@ -56,23 +57,23 @@ public function testSaveNewsTestNewsIdが空の場合新規登録される() public function testSaveNewsTestNewsIdが存在する場合対象のニュースが更新される() { - $objQuery = &SC_Query_Ex::getSingletonInstance(); + $objQuery = SC_Query_Ex::getSingletonInstance(); $this->setUpNews(); $sqlval = [ - 'news_id' => '1002', - 'news_title' => 'ニュース情報05更新', - 'creator_id' => '1', - 'del_flg' => '0', - ]; + 'news_id' => '1002', + 'news_title' => 'ニュース情報05更新', + 'creator_id' => '1', + 'del_flg' => '0', + ]; $this->expected['count'] = '4'; $this->expected['content'] = [ - 'news_id' => '1002', - 'news_title' => 'ニュース情報05更新', - 'creator_id' => '1', - 'del_flg' => '0', - ]; + 'news_id' => '1002', + 'news_title' => 'ニュース情報05更新', + 'creator_id' => '1', + 'del_flg' => '0', + ]; $ret_id = $this->objNews->saveNews($sqlval); @@ -81,7 +82,8 @@ public function testSaveNewsTestNewsIdが存在する場合対象のニュース 'news_id, news_title, creator_id, del_flg', 'dtb_news', 'news_id = ?', - [$ret_id]); + [$ret_id] + ); $this->actual['content'] = $result[0]; $this->verify(); diff --git a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_TestBase.php b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_TestBase.php index 1f8c90db38..e0ac78e25d 100644 --- a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_TestBase.php +++ b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_TestBase.php @@ -60,29 +60,29 @@ protected function setUpShipping($shipping) protected function getSingleShipping() { return [ - '00001' => [ - 'shipment_id' => '00001', - 'shipment_item' => '商品1', - 'shipping_pref' => '東京都', ], - ]; + '00001' => [ + 'shipment_id' => '00001', + 'shipment_item' => '商品1', + 'shipping_pref' => '東京都', ], + ]; } protected function getMultipleShipping() { return [ - '00001' => [ - 'shipment_id' => '00001', - 'shipment_item' => ['商品1'], - 'shipping_pref' => '東京都', ], - '00002' => [ - 'shipment_id' => '00002', - 'shipment_item' => ['商品2'], - 'shipping_pref' => '沖縄県', ], - '00003' => [ - 'shipment_id' => '00003', - 'shipment_item' => [], - 'shipping_pref' => '埼玉県', ], - ]; + '00001' => [ + 'shipment_id' => '00001', + 'shipment_item' => ['商品1'], + 'shipping_pref' => '東京都', ], + '00002' => [ + 'shipment_id' => '00002', + 'shipment_item' => ['商品2'], + 'shipping_pref' => '沖縄県', ], + '00003' => [ + 'shipment_id' => '00003', + 'shipment_item' => [], + 'shipping_pref' => '埼玉県', ], + ]; } /** @@ -91,28 +91,28 @@ protected function getMultipleShipping() protected function setUpShippingOnDb() { $shippings = [ - [ - 'update_date' => '2000-01-01 00:00:00', - 'shipping_id' => '1', - 'order_id' => '1001', - 'shipping_name01' => '配送情報01', - 'shipping_date' => '2012-01-12', - ], - [ - 'update_date' => '2000-01-01 00:00:00', - 'shipping_id' => '2', - 'order_id' => '2', - 'shipping_name01' => '配送情報02', - 'shipping_date' => '2011-10-01', - ], - [ - 'update_date' => '2000-01-01 00:00:00', - 'shipping_id' => '1002', - 'order_id' => '1002', - 'shipping_time' => '午後', - 'time_id' => '1', - ], - ]; + [ + 'update_date' => '2000-01-01 00:00:00', + 'shipping_id' => '1', + 'order_id' => '1001', + 'shipping_name01' => '配送情報01', + 'shipping_date' => '2012-01-12', + ], + [ + 'update_date' => '2000-01-01 00:00:00', + 'shipping_id' => '2', + 'order_id' => '2', + 'shipping_name01' => '配送情報02', + 'shipping_date' => '2011-10-01', + ], + [ + 'update_date' => '2000-01-01 00:00:00', + 'shipping_id' => '1002', + 'order_id' => '1002', + 'shipping_time' => '午後', + 'time_id' => '1', + ], + ]; $this->objQuery->delete('dtb_shipping'); foreach ($shippings as $key => $item) { @@ -126,24 +126,24 @@ protected function setUpShippingOnDb() protected function setUpOrder($customer_ids = [], $product_class_ids = []) { $orders = [ - [ - 'update_date' => '2000-01-01 00:00:00', - 'customer_id' => $customer_ids[0], - 'order_name01' => '受注情報01', - 'status' => '3', - 'payment_date' => '2032-12-31 01:20:30', // 日付が変わっても良いように、遠い未来に設定 - 'use_point' => '10', - 'add_point' => '20', - ], - [ - 'update_date' => '2000-01-01 00:00:00', - 'customer_id' => $customer_ids[1], - 'order_name01' => '受注情報02', - 'status' => '5', - 'use_point' => '10', - 'add_point' => '20', - ], - ]; + [ + 'update_date' => '2000-01-01 00:00:00', + 'customer_id' => $customer_ids[0], + 'order_name01' => '受注情報01', + 'status' => '3', + 'payment_date' => '2032-12-31 01:20:30', // 日付が変わっても良いように、遠い未来に設定 + 'use_point' => '10', + 'add_point' => '20', + ], + [ + 'update_date' => '2000-01-01 00:00:00', + 'customer_id' => $customer_ids[1], + 'order_name01' => '受注情報02', + 'status' => '5', + 'use_point' => '10', + 'add_point' => '20', + ], + ]; $this->objQuery->delete('dtb_order'); @@ -173,8 +173,8 @@ protected function setUpCustomer() $this->objQuery->delete('dtb_customer'); return [ - $this->objGenerator->createCustomer(null, ['point' => 100]), - $this->objGenerator->createCustomer(null, ['point' => 200]), - ]; + $this->objGenerator->createCustomer(null, ['point' => 100]), + $this->objGenerator->createCustomer(null, ['point' => 200]), + ]; } } diff --git a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_cancelOrderTest.php b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_cancelOrderTest.php index 963dc70bf7..151bb78c6e 100644 --- a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_cancelOrderTest.php +++ b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_cancelOrderTest.php @@ -67,22 +67,22 @@ public function testCancelOrderデフォルトの引数で呼び出した場合 }, $this->arrProductsClasses) ); $this->expected = [ - 'testResult' => [ - 'registerOrder' => [ - 'order_id' => '1001', - 'params' => [ - 'status' => ORDER_CANCEL, - ], - ], - 'getOrderDetail' => [ - 'order_id' => '1001', - ], - ], - 'productClass' => array_map(function ($productsClass) { - return ['stock' => $productsClass['stock']]; - }, $this->arrProductsClasses - ), - ]; + 'testResult' => [ + 'registerOrder' => [ + 'order_id' => '1001', + 'params' => [ + 'status' => ORDER_CANCEL, + ], + ], + 'getOrderDetail' => [ + 'order_id' => '1001', + ], + ], + 'productClass' => array_map(function ($productsClass) { + return ['stock' => $productsClass['stock']]; + }, $this->arrProductsClasses + ), + ]; $this->verify(); } @@ -102,22 +102,22 @@ public function testCancelOrderトランザクションが開始していない }, $this->arrProductsClasses) ); $this->expected = [ - 'testResult' => [ - 'registerOrder' => [ - 'order_id' => '1001', - 'params' => [ - 'status' => ORDER_NEW, - ], - ], - 'getOrderDetail' => [ - 'order_id' => '1001', - ], - ], - 'productClass' => array_map(function ($productsClass) { - return ['stock' => $productsClass['stock']]; - }, $this->arrProductsClasses - ), - ]; + 'testResult' => [ + 'registerOrder' => [ + 'order_id' => '1001', + 'params' => [ + 'status' => ORDER_NEW, + ], + ], + 'getOrderDetail' => [ + 'order_id' => '1001', + ], + ], + 'productClass' => array_map(function ($productsClass) { + return ['stock' => $productsClass['stock']]; + }, $this->arrProductsClasses + ), + ]; $this->verify(); } @@ -137,23 +137,23 @@ public function testCancelOrder削除フラグが立っている場合DB更新 }, $this->arrProductsClasses) ); $this->expected = [ - 'testResult' => [ - 'registerOrder' => [ - 'order_id' => '1001', - 'params' => [ - 'status' => ORDER_DELIV, - 'del_flg' => '1', - ], - ], - 'getOrderDetail' => [ - 'order_id' => '1001', - ], - ], - 'productClass' => array_map(function ($productsClass) { - return ['stock' => $productsClass['stock']]; - }, $this->arrProductsClasses - ), - ]; + 'testResult' => [ + 'registerOrder' => [ + 'order_id' => '1001', + 'params' => [ + 'status' => ORDER_DELIV, + 'del_flg' => '1', + ], + ], + 'getOrderDetail' => [ + 'order_id' => '1001', + ], + ], + 'productClass' => array_map(function ($productsClass) { + return ['stock' => $productsClass['stock']]; + }, $this->arrProductsClasses + ), + ]; $this->verify(); } @@ -166,26 +166,26 @@ class SC_Helper_Purchase_cancelOrderMock extends SC_Helper_Purchase public static function registerOrder($order_id, $params) { $_SESSION['testResult']['registerOrder'] = [ - 'order_id' => $order_id, - 'params' => $params, - ]; + 'order_id' => $order_id, + 'params' => $params, + ]; } public static function getOrderDetail($order_id, $has_order_status = true) { $_SESSION['testResult']['getOrderDetail'] = [ - 'order_id' => $order_id, - ]; + 'order_id' => $order_id, + ]; return [ - [ - 'product_class_id' => '1001', - 'quantity' => '5', - ], - [ - 'product_class_id' => '1002', - 'quantity' => '1', - ], - ]; + [ + 'product_class_id' => '1001', + 'quantity' => '5', + ], + [ + 'product_class_id' => '1002', + 'quantity' => '1', + ], + ]; } } diff --git a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_cleanupSessionTest.php b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_cleanupSessionTest.php index 6ac2ffc4c6..07fb099632 100644 --- a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_cleanupSessionTest.php +++ b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_cleanupSessionTest.php @@ -68,12 +68,12 @@ public function testCleanupSessionカートとセッションの配送情報が $helper->cleanupSession(1001, $cartSession, $customer, PRODUCT_TYPE_NORMAL); $this->expected = [ - 'cart_max_deleted' => 0, - 'cart_max_notdeleted' => 1, - 'uniqid' => '', - 'shipping' => null, - 'multiple_temp' => null, - ]; + 'cart_max_deleted' => 0, + 'cart_max_notdeleted' => 1, + 'uniqid' => '', + 'shipping' => null, + 'multiple_temp' => null, + ]; $this->actual['cart_max_deleted'] = $cartSession->getMax(PRODUCT_TYPE_NORMAL); $this->actual['cart_max_notdeleted'] = $cartSession->getMax(PRODUCT_TYPE_DOWNLOAD); diff --git a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_completeOrderTest.php b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_completeOrderTest.php index 2be95d5db5..a4be2e13d1 100644 --- a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_completeOrderTest.php +++ b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_completeOrderTest.php @@ -51,11 +51,11 @@ protected function setUp(): void $_SESSION['cartKey'] = '1'; $_SESSION['site'] = [ - 'pre_page' => 'pre', - 'now_page' => 'now', - 'regist_success' => true, - 'uniqid' => $this->order_temp_ids[0], - ]; + 'pre_page' => 'pre', + 'now_page' => 'now', + 'regist_success' => true, + 'uniqid' => $this->order_temp_ids[0], + ]; $this->helper = new SC_Helper_Purchase_completeOrderMock(); } @@ -73,32 +73,32 @@ public function testCompleteOrder顧客IDが指定されている場合購入日 $this->helper->completeOrder(ORDER_DELIV); $this->expected = [ - 'verifyChangeCart' => [ - 'uniqId' => $this->order_temp_ids[0], - ], - 'getOrderTemp' => [ - 'uniqId' => $this->order_temp_ids[0], - ], - 'registerOrderComplete' => [ - 'order_temp_id' => $this->order_temp_ids[0], - 'status' => ORDER_DELIV, - 'cartKey' => '1', - ], - 'registerShipmentItem' => [ - [ - 'order_id' => $this->order_ids[0], - 'shipping_id' => '00001', - 'shipment_item' => '商品1', - ], - ], - 'registerShipping' => [ - 'order_id' => $this->order_ids[0], - ], - 'cleanupSession' => [ - 'order_id' => $this->order_ids[0], - 'cartKey' => '1', - ], - ]; + 'verifyChangeCart' => [ + 'uniqId' => $this->order_temp_ids[0], + ], + 'getOrderTemp' => [ + 'uniqId' => $this->order_temp_ids[0], + ], + 'registerOrderComplete' => [ + 'order_temp_id' => $this->order_temp_ids[0], + 'status' => ORDER_DELIV, + 'cartKey' => '1', + ], + 'registerShipmentItem' => [ + [ + 'order_id' => $this->order_ids[0], + 'shipping_id' => '00001', + 'shipment_item' => '商品1', + ], + ], + 'registerShipping' => [ + 'order_id' => $this->order_ids[0], + ], + 'cleanupSession' => [ + 'order_id' => $this->order_ids[0], + 'cartKey' => '1', + ], + ]; $this->actual = $_SESSION['testResult']; $this->verify('適切なfunctionが呼ばれている'); $last_buy_date = $this->objQuery->get('last_buy_date', 'dtb_customer', 'customer_id = ?', $this->customer_ids[1]); @@ -110,32 +110,32 @@ public function testCompleteOrder顧客IDが指定されていない場合特に $this->helper->completeOrder(); // デフォルトのステータス(NEW) $this->expected = [ - 'verifyChangeCart' => [ - 'uniqId' => $this->order_temp_ids[0], - ], - 'getOrderTemp' => [ - 'uniqId' => $this->order_temp_ids[0], - ], - 'registerOrderComplete' => [ - 'order_temp_id' => $this->order_temp_ids[0], - 'status' => ORDER_NEW, - 'cartKey' => '1', - ], - 'registerShipmentItem' => [ - [ - 'order_id' => (string) $this->order_ids[0], - 'shipping_id' => '00001', - 'shipment_item' => '商品1', - ], - ], - 'registerShipping' => [ - 'order_id' => (string) $this->order_ids[0], - ], - 'cleanupSession' => [ - 'order_id' => (string) $this->order_ids[0], - 'cartKey' => '1', - ], - ]; + 'verifyChangeCart' => [ + 'uniqId' => $this->order_temp_ids[0], + ], + 'getOrderTemp' => [ + 'uniqId' => $this->order_temp_ids[0], + ], + 'registerOrderComplete' => [ + 'order_temp_id' => $this->order_temp_ids[0], + 'status' => ORDER_NEW, + 'cartKey' => '1', + ], + 'registerShipmentItem' => [ + [ + 'order_id' => (string) $this->order_ids[0], + 'shipping_id' => '00001', + 'shipment_item' => '商品1', + ], + ], + 'registerShipping' => [ + 'order_id' => (string) $this->order_ids[0], + ], + 'cleanupSession' => [ + 'order_id' => (string) $this->order_ids[0], + 'cartKey' => '1', + ], + ]; $this->actual = $_SESSION['testResult']; $this->verify('適切なfunctionが呼ばれている'); } @@ -160,10 +160,10 @@ public static function getOrderTemp($uniqId) public function registerOrderComplete($orderTemp, &$objCartSession, $cartKey) { $_SESSION['testResult']['registerOrderComplete'] = [ - 'order_temp_id' => $orderTemp['order_temp_id'], - 'status' => $orderTemp['status'], - 'cartKey' => $cartKey, - ]; + 'order_temp_id' => $orderTemp['order_temp_id'], + 'status' => $orderTemp['status'], + 'cartKey' => $cartKey, + ]; return parent::registerOrderComplete($orderTemp, $objCartSession, $cartKey); } @@ -171,24 +171,24 @@ public function registerOrderComplete($orderTemp, &$objCartSession, $cartKey) public static function registerShipmentItem($order_id, $shipping_id, $shipment_item) { $_SESSION['testResult']['registerShipmentItem'][] = [ - 'order_id' => $order_id, - 'shipping_id' => $shipping_id, - 'shipment_item' => $shipment_item, - ]; + 'order_id' => $order_id, + 'shipping_id' => $shipping_id, + 'shipment_item' => $shipment_item, + ]; } public static function registerShipping($order_id, $shipping_temp, $convert_shipping_date = true) { $_SESSION['testResult']['registerShipping'] = [ - 'order_id' => $order_id, - ]; + 'order_id' => $order_id, + ]; } public static function cleanupSession($order_id, &$objCartSesion, &$objCustomer, $cartKey) { $_SESSION['testResult']['cleanupSession'] = [ - 'order_id' => $order_id, - 'cartKey' => $cartKey, - ]; + 'order_id' => $order_id, + 'cartKey' => $cartKey, + ]; } } diff --git a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_copyFromCustomerTest.php b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_copyFromCustomerTest.php index ff77aa4584..4dbfbed38b 100644 --- a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_copyFromCustomerTest.php +++ b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_copyFromCustomerTest.php @@ -92,31 +92,31 @@ public function testCopyFromCustomerモバイルの場合モバイルのメー $this->customer->setValue('email_mobile', 'mobile@example.com'); $this->expected = [ - 'order_name01' => '姓01', - 'order_name02' => '名01', - 'order_kana01' => 'セイ01', - 'order_kana02' => 'メイ01', - 'order_sex' => '1', - 'order_zip01' => '123', - 'order_zip02' => '4567', - 'order_pref' => '東京都', - 'order_addr01' => 'abc市', - 'order_addr02' => 'def町', - 'order_tel01' => '01', - 'order_tel02' => '234', - 'order_tel03' => '5678', - 'order_fax01' => '02', - 'order_fax02' => '345', - 'order_fax03' => '6789', - 'order_job' => '会社員', - 'order_birth' => '2012-01-01', - 'order_email' => 'mobile@example.com', - 'customer_id' => '1001', - 'update_date' => 'CURRENT_TIMESTAMP', - 'order_country_id' => '', - 'order_company_name' => '', - 'order_zipcode' => '', - ]; + 'order_name01' => '姓01', + 'order_name02' => '名01', + 'order_kana01' => 'セイ01', + 'order_kana02' => 'メイ01', + 'order_sex' => '1', + 'order_zip01' => '123', + 'order_zip02' => '4567', + 'order_pref' => '東京都', + 'order_addr01' => 'abc市', + 'order_addr02' => 'def町', + 'order_tel01' => '01', + 'order_tel02' => '234', + 'order_tel03' => '5678', + 'order_fax01' => '02', + 'order_fax02' => '345', + 'order_fax03' => '6789', + 'order_job' => '会社員', + 'order_birth' => '2012-01-01', + 'order_email' => 'mobile@example.com', + 'customer_id' => '1001', + 'update_date' => 'CURRENT_TIMESTAMP', + 'order_country_id' => '', + 'order_company_name' => '', + 'order_zipcode' => '', + ]; $helper = new SC_Helper_Purchase_Ex(); $helper->copyFromCustomer($dest, $this->customer); $this->actual = $dest; @@ -134,11 +134,11 @@ public function testCopyFromCustomerモバイルかつモバイルのメール User_Utils::setDeviceType(DEVICE_TYPE_MOBILE); $this->expected = [ - 'order_name01' => '姓01', - 'order_email' => 'test@example.com', - 'customer_id' => '1001', - 'update_date' => 'CURRENT_TIMESTAMP', - ]; + 'order_name01' => '姓01', + 'order_email' => 'test@example.com', + 'customer_id' => '1001', + 'update_date' => 'CURRENT_TIMESTAMP', + ]; $helper = new SC_Helper_Purchase_Ex(); $helper->copyFromCustomer($dest, $this->customer, $prefix, $keys); $this->actual = $dest; @@ -157,11 +157,11 @@ public function testCopyFromCustomerモバイルでない場合通常のメー $this->customer->setValue('email_mobile', 'mobile@example.com'); $this->expected = [ - 'prefix_name01' => '姓01', - 'prefix_email' => 'test@example.com', - 'customer_id' => '1001', - 'update_date' => 'CURRENT_TIMESTAMP', - ]; + 'prefix_name01' => '姓01', + 'prefix_email' => 'test@example.com', + 'customer_id' => '1001', + 'update_date' => 'CURRENT_TIMESTAMP', + ]; $helper = new SC_Helper_Purchase_Ex(); $helper->copyFromCustomer($dest, $this->customer, $prefix, $keys); $this->actual = $dest; diff --git a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_copyFromOrderTest.php b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_copyFromOrderTest.php index 7f006732d6..96423f5440 100644 --- a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_copyFromOrderTest.php +++ b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_copyFromOrderTest.php @@ -48,42 +48,42 @@ public function testCopyFromOrder全てデフォルト設定にした場合デ { $dest = []; $src = [ - 'order_name01' => '姓', - 'order_name02' => '名', - 'order_kana01' => 'セイ', - 'order_kana02' => 'メイ', - 'order_sex' => '1', - 'order_zip01' => '012', - 'order_zip02' => '1234', - 'order_pref' => '北海道', - 'order_addr01' => '住所01', - 'order_addr02' => '住所02', - 'order_tel01' => '01', - 'order_tel02' => '1234', - 'order_tel03' => '5678', - 'order_fax01' => '02', - 'order_fax02' => '2345', - 'order_fax03' => '6789', - ]; + 'order_name01' => '姓', + 'order_name02' => '名', + 'order_kana01' => 'セイ', + 'order_kana02' => 'メイ', + 'order_sex' => '1', + 'order_zip01' => '012', + 'order_zip02' => '1234', + 'order_pref' => '北海道', + 'order_addr01' => '住所01', + 'order_addr02' => '住所02', + 'order_tel01' => '01', + 'order_tel02' => '1234', + 'order_tel03' => '5678', + 'order_fax01' => '02', + 'order_fax02' => '2345', + 'order_fax03' => '6789', + ]; $this->expected = [ - 'shipping_name01' => '姓', - 'shipping_name02' => '名', - 'shipping_kana01' => 'セイ', - 'shipping_kana02' => 'メイ', - 'shipping_sex' => '1', - 'shipping_zip01' => '012', - 'shipping_zip02' => '1234', - 'shipping_pref' => '北海道', - 'shipping_addr01' => '住所01', - 'shipping_addr02' => '住所02', - 'shipping_tel01' => '01', - 'shipping_tel02' => '1234', - 'shipping_tel03' => '5678', - 'shipping_fax01' => '02', - 'shipping_fax02' => '2345', - 'shipping_fax03' => '6789', - ]; + 'shipping_name01' => '姓', + 'shipping_name02' => '名', + 'shipping_kana01' => 'セイ', + 'shipping_kana02' => 'メイ', + 'shipping_sex' => '1', + 'shipping_zip01' => '012', + 'shipping_zip02' => '1234', + 'shipping_pref' => '北海道', + 'shipping_addr01' => '住所01', + 'shipping_addr02' => '住所02', + 'shipping_tel01' => '01', + 'shipping_tel02' => '1234', + 'shipping_tel03' => '5678', + 'shipping_fax01' => '02', + 'shipping_fax02' => '2345', + 'shipping_fax03' => '6789', + ]; $helper = new SC_Helper_Purchase_Ex(); $helper->copyFromOrder($dest, $src); $this->actual = $dest; @@ -95,15 +95,15 @@ public function testCopyFromOrder接頭辞・キーを設定した場合指定 { $dest = []; $src = [ - 'input_name01' => '姓', - 'input_name02' => '名', - 'input_zip01' => '012', // キーに含まれないもの - ]; + 'input_name01' => '姓', + 'input_name02' => '名', + 'input_zip01' => '012', // キーに含まれないもの + ]; $this->expected = [ - 'output_name01' => '姓', - 'output_name02' => '名', - ]; + 'output_name01' => '姓', + 'output_name02' => '名', + ]; $helper = new SC_Helper_Purchase_Ex(); $helper->copyFromOrder($dest, $src, 'output', 'input', ['name01', 'name02']); $this->actual = $dest; diff --git a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_extractShippingTest.php b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_extractShippingTest.php index d0a16df7b8..84a550d495 100644 --- a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_extractShippingTest.php +++ b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_extractShippingTest.php @@ -49,17 +49,17 @@ public function testExtractShipping予め指定されたキーだけが抽出さ $helper = new SC_Helper_Purchase_Ex(); $helper->arrShippingKey = ['id', 'name', 'code']; $arrSrc = [ - 'shipping_id' => '1001', - 'shipping_code' => 'cd1001', - 'shipping_detail' => 'dt1001', // 無視される - 'shipping_name' => '名称1001', - ]; + 'shipping_id' => '1001', + 'shipping_code' => 'cd1001', + 'shipping_detail' => 'dt1001', // 無視される + 'shipping_name' => '名称1001', + ]; $this->expected = [ - 'shipping_id' => '1001', - 'shipping_name' => '名称1001', - 'shipping_code' => 'cd1001', - ]; + 'shipping_id' => '1001', + 'shipping_name' => '名称1001', + 'shipping_code' => 'cd1001', + ]; $this->actual = $helper->extractShipping($arrSrc); $this->verify(); diff --git a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_getOrderDetailTest.php b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_getOrderDetailTest.php index c91b7f37ad..fdbab92fef 100644 --- a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_getOrderDetailTest.php +++ b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_getOrderDetailTest.php @@ -64,10 +64,10 @@ public function testGetOrderDetail存在しない受注IDを指定した場合 public function testGetOrderDetail存在する受注IDを指定した場合対応する受注詳細情報が取得できる() { $properties = [ - 'product_id', 'product_class_id', 'product_type_id', 'product_code', - 'product_name', 'classcategory_name1', 'classcategory_name2', 'price', - 'quantity', 'point_rate', 'status', 'payment_date', 'enable', 'effective', - 'tax_rate', 'tax_rule', ]; + 'product_id', 'product_class_id', 'product_type_id', 'product_code', + 'product_name', 'classcategory_name1', 'classcategory_name2', 'price', + 'quantity', 'point_rate', 'status', 'payment_date', 'enable', 'effective', + 'tax_rate', 'tax_rule', ]; $this->objQuery->setOrder('order_detail_id'); $arrOrderDetails = $this->objQuery->select('*', 'dtb_order_detail T1 JOIN dtb_order T2 ON T1.order_id = T2.order_id', 'T1.order_id = ?', [$this->order_ids[0]]); @@ -101,10 +101,10 @@ public function testGetOrderDetail存在する受注IDを指定した場合対 public function testGetOrderDetailステータス取得フラグがOFFのの場合ステータス以外の情報が取得できる() { $properties = [ - 'product_id', 'product_class_id', 'product_type_id', 'product_code', - 'product_name', 'classcategory_name1', 'classcategory_name2', 'price', - 'quantity', 'point_rate', 'enable', 'effective', - 'tax_rate', 'tax_rule', ]; + 'product_id', 'product_class_id', 'product_type_id', 'product_code', + 'product_name', 'classcategory_name1', 'classcategory_name2', 'price', + 'quantity', 'point_rate', 'enable', 'effective', + 'tax_rate', 'tax_rule', ]; $this->objQuery->setOrder('order_detail_id'); $arrOrderDetails = $this->objQuery->select('*', 'dtb_order_detail T1 JOIN dtb_order T2 ON T1.order_id = T2.order_id', 'T1.order_id = ?', [$this->order_ids[0]]); diff --git a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_getOrderTempTest.php b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_getOrderTempTest.php index ba100a8433..a1a9995750 100644 --- a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_getOrderTempTest.php +++ b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_getOrderTempTest.php @@ -58,7 +58,7 @@ public function testGetOrderTemp存在しない受注IDを指定した場合結 { $order_id = '9999'; - $this->expected = null; + $this->expected = []; $this->actual = SC_Helper_Purchase::getOrderTemp($order_id); $this->verify(); @@ -70,10 +70,10 @@ public function testGetOrderTemp存在する受注IDを指定した場合対応 $arrCustomer = $this->objQuery->getRow('*', 'dtb_customer', 'customer_id = ?', [$this->customer_ids[0]]); $this->expected = [ - 'order_temp_id' => $order_temp_id, - 'customer_id' => $this->customer_ids[0], - 'order_name01' => $arrCustomer['name01'], - ]; + 'order_temp_id' => $order_temp_id, + 'customer_id' => $this->customer_ids[0], + 'order_name01' => $arrCustomer['name01'], + ]; $result = SC_Helper_Purchase::getOrderTemp($order_temp_id); $this->actual = Test_Utils::mapArray($result, ['order_temp_id', 'customer_id', 'order_name01']); diff --git a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_getOrderTest.php b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_getOrderTest.php index 8a347979db..cb11252cce 100644 --- a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_getOrderTest.php +++ b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_getOrderTest.php @@ -77,10 +77,10 @@ public function testGetOrder顧客IDを指定しなかった場合受注IDに対 $order_id = $this->order_ids[1]; $this->expected = [ - 'order_id' => $order_id, - 'customer_id' => $this->customer_ids[1], - 'order_name01' => '受注情報02', - ]; + 'order_id' => $order_id, + 'customer_id' => $this->customer_ids[1], + 'order_name01' => '受注情報02', + ]; $result = SC_Helper_Purchase::getOrder($order_id); $this->actual = Test_Utils::mapArray($result, ['order_id', 'customer_id', 'order_name01']); @@ -93,10 +93,10 @@ public function testGetOrder存在する顧客IDを指定した場合対応す $customer_id = $this->customer_ids[1]; $this->expected = [ - 'order_id' => $order_id, - 'customer_id' => $customer_id, - 'order_name01' => '受注情報02', - ]; + 'order_id' => $order_id, + 'customer_id' => $customer_id, + 'order_name01' => '受注情報02', + ]; $result = SC_Helper_Purchase::getOrder($order_id, $customer_id); $this->actual = Test_Utils::mapArray($result, ['order_id', 'customer_id', 'order_name01']); diff --git a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_getShipmentItemsTest.php b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_getShipmentItemsTest.php index 3205bcccda..91413e8046 100644 --- a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_getShipmentItemsTest.php +++ b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_getShipmentItemsTest.php @@ -81,30 +81,36 @@ public function testGetShipmentItems存在する受注IDと配送先IDを指定 $this->expected['count'] = 2; $this->expected['second'] = [ - 'order_id' => (string) $order_id, - 'shipping_id' => '0', - 'product_class_id' => '2', - 'product_name' => 'アイスクリーム', - 'price' => '1008', - 'productsClass' => ['product_class_id' => '2', 'product_id' => '1'], - ]; + 'order_id' => (string) $order_id, + 'shipping_id' => '0', + 'product_class_id' => '2', + 'product_name' => 'アイスクリーム', + 'price' => '1008', + 'productsClass' => ['product_class_id' => '2', 'product_id' => '1'], + ]; $this->expected['first'] = [ - 'order_id' => (string) $order_id, - 'shipping_id' => '0', - 'product_class_id' => '1', - 'product_name' => 'アイスクリーム', - 'price' => '1008', - 'productsClass' => ['product_class_id' => '1', 'product_id' => '1'], - ]; + 'order_id' => (string) $order_id, + 'shipping_id' => '0', + 'product_class_id' => '1', + 'product_name' => 'アイスクリーム', + 'price' => '1008', + 'productsClass' => ['product_class_id' => '1', 'product_id' => '1'], + ]; $result = SC_Helper_Purchase::getShipmentItems($order_id, $shipping_id); $this->actual['count'] = count($result); - $this->actual['first'] = Test_Utils::mapArray($result[0], [ - 'order_id', 'shipping_id', 'product_class_id', 'product_name', 'price', 'productsClass', ]); + $this->actual['first'] = Test_Utils::mapArray($result[0], + [ + 'order_id', 'shipping_id', 'product_class_id', 'product_name', 'price', 'productsClass', + ] + ); $this->actual['first']['productsClass'] = Test_Utils::mapArray($this->actual['first']['productsClass'], ['product_class_id', 'product_id']); - $this->actual['second'] = Test_Utils::mapArray($result[1], [ - 'order_id', 'shipping_id', 'product_class_id', 'product_name', 'price', 'productsClass', ]); + $this->actual['second'] = Test_Utils::mapArray($result[1], + [ + 'order_id', 'shipping_id', 'product_class_id', 'product_name', 'price', 'productsClass', + ] + ); $this->actual['second']['productsClass'] = Test_Utils::mapArray($this->actual['second']['productsClass'], ['product_class_id', 'product_id']); $this->verify('配送情報'); } @@ -116,28 +122,30 @@ public function testGetShipmentItems詳細フラグをOFFにした場合結果 $this->expected['count'] = 2; $this->expected['second'] = [ - 'order_id' => (string) $order_id, - 'shipping_id' => '0', - 'product_class_id' => '2', - 'product_name' => 'アイスクリーム', - 'price' => '1008', - 'productsClass' => null, - ]; + 'order_id' => (string) $order_id, + 'shipping_id' => '0', + 'product_class_id' => '2', + 'product_name' => 'アイスクリーム', + 'price' => '1008', + 'productsClass' => null, + ]; $this->expected['first'] = [ - 'order_id' => (string) $order_id, - 'shipping_id' => '0', - 'product_class_id' => '1', - 'product_name' => 'アイスクリーム', - 'price' => '1008', - 'productsClass' => null, - ]; + 'order_id' => (string) $order_id, + 'shipping_id' => '0', + 'product_class_id' => '1', + 'product_name' => 'アイスクリーム', + 'price' => '1008', + 'productsClass' => null, + ]; $result = SC_Helper_Purchase::getShipmentItems($order_id, $shipping_id, false); $this->actual['count'] = count($result); $this->actual['first'] = Test_Utils::mapArray($result[0], [ - 'order_id', 'shipping_id', 'product_class_id', 'product_name', 'price', 'productsClass', ]); + 'order_id', 'shipping_id', 'product_class_id', 'product_name', 'price', 'productsClass', + ]); $this->actual['second'] = Test_Utils::mapArray($result[1], [ - 'order_id', 'shipping_id', 'product_class_id', 'product_name', 'price', 'productsClass', ]); + 'order_id', 'shipping_id', 'product_class_id', 'product_name', 'price', 'productsClass', + ]); $this->verify('配送情報'); } diff --git a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_getShippingTempTest.php b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_getShippingTempTest.php index a625c6775a..b1099094ce 100644 --- a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_getShippingTempTest.php +++ b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_getShippingTempTest.php @@ -59,15 +59,17 @@ public function testGetShippingTemp保有フラグがONの場合商品のある $this->setUpShipping($this->getMultipleShipping()); $this->expected = [ - '00001' => [ - 'shipment_id' => '00001', - 'shipment_item' => ['商品1'], - 'shipping_pref' => '東京都', ], - '00002' => [ - 'shipment_id' => '00002', - 'shipment_item' => ['商品2'], - 'shipping_pref' => '沖縄県', ], - ]; + '00001' => [ + 'shipment_id' => '00001', + 'shipment_item' => ['商品1'], + 'shipping_pref' => '東京都', + ], + '00002' => [ + 'shipment_id' => '00002', + 'shipment_item' => ['商品2'], + 'shipping_pref' => '沖縄県', + ], + ]; $this->actual = SC_Helper_Purchase::getShippingTemp(true); $this->verify('配送情報'); diff --git a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_getShippingsTest.php b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_getShippingsTest.php index 6486973ae0..7261d688d0 100644 --- a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_getShippingsTest.php +++ b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_getShippingsTest.php @@ -68,11 +68,11 @@ public function testGetShippings存在する受注IDを指定した場合結果 $arrCustomer = $this->objQuery->getRow('*', 'dtb_customer', 'customer_id = ?', [$this->customer_ids[0]]); $this->expected['count'] = 1; $this->expected['first'] = [ - 'order_id' => (string) $order_id, - 'shipping_id' => '0', - 'shipping_name01' => $arrCustomer['name01'], - 'shipping_date' => null, - ]; + 'order_id' => (string) $order_id, + 'shipping_id' => '0', + 'shipping_name01' => $arrCustomer['name01'], + 'shipping_date' => null, + ]; $this->expected['shipment_item_count'] = 3; $helper = new SC_Helper_Purchase_Ex(); @@ -81,7 +81,8 @@ public function testGetShippings存在する受注IDを指定した場合結果 $this->actual['count'] = count($result); // shipping_idごとの配列になっているのでshipping_idで抽出 $this->actual['first'] = Test_Utils::mapArray($result[0], [ - 'order_id', 'shipping_id', 'shipping_name01', 'shipping_date', ]); + 'order_id', 'shipping_id', 'shipping_name01', 'shipping_date', + ]); $this->actual['shipment_item_count'] = count($result[0]['shipment_item']); $this->verify('配送情報'); } @@ -93,11 +94,11 @@ public function testGetShippings商品取得フラグをOFFにした場合結果 $this->expected['count'] = 1; $this->expected['first'] = [ - 'order_id' => (string) $order_id, - 'shipping_id' => '0', - 'shipping_name01' => $arrCustomer['name01'], - 'shipping_date' => null, - ]; + 'order_id' => (string) $order_id, + 'shipping_id' => '0', + 'shipping_name01' => $arrCustomer['name01'], + 'shipping_date' => null, + ]; $this->expected['shipment_item_count'] = 0; $helper = new SC_Helper_Purchase_Ex(); @@ -105,7 +106,8 @@ public function testGetShippings商品取得フラグをOFFにした場合結果 $this->actual['count'] = count($result); // shipping_idごとの配列になっているのでshipping_idで抽出 $this->actual['first'] = Test_Utils::mapArray($result[0], [ - 'order_id', 'shipping_id', 'shipping_name01', 'shipping_date', ]); + 'order_id', 'shipping_id', 'shipping_name01', 'shipping_date', + ]); $this->actual['shipment_item_count'] = is_array($result['1']['shipment_item']) ? count($result['1']['shipment_item']) : 0; $this->verify('配送情報'); } diff --git a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_registerOrderCompleteTest.php b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_registerOrderCompleteTest.php index ff0e17ac97..412860357f 100644 --- a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_registerOrderCompleteTest.php +++ b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_registerOrderCompleteTest.php @@ -61,45 +61,45 @@ public function testRegisterOrderComplete不要な変数が含まれている場 { // 引数の準備 $orderParams = [ - 'order_id' => $this->order_ids[0], - 'status' => ORDER_PAY_WAIT, - 'mail_maga_flg' => '1', - 'order_tax_rate' => '5', - 'order_tax_rule' => '1', - ]; + 'order_id' => $this->order_ids[0], + 'status' => ORDER_PAY_WAIT, + 'mail_maga_flg' => '1', + 'order_tax_rate' => '5', + 'order_tax_rule' => '1', + ]; $cartSession = new SC_CartSession_registerOrderCompleteMock(); $_SESSION['site']['uniqid'] = $this->order_temp_ids[0]; $this->helper->registerOrderComplete($orderParams, $cartSession, '1'); $this->expected = [ - 'registerOrder' => [ - 'order_id' => $this->order_ids[0], - 'status' => ORDER_PAY_WAIT, - 'mailmaga_flg' => null, - ], - 'registerOrderDetail' => [ - 'order_id' => $this->order_ids[0], - 'params' => [ - [ - 'order_id' => $this->order_ids[0], - 'product_id' => '1002', - 'product_class_id' => '1002', - 'product_name' => '製品02', - 'product_code' => 'cd1002', - 'classcategory_name1' => 'cat01', - 'classcategory_name2' => 'cat02', - 'point_rate' => '5', - 'price' => '1000', - 'quantity' => '10', - 'tax_rate' => null, - 'tax_rule' => null, - 'tax_adjust' => null, - ], - ], - ], - 'del_flg' => '1', - ]; + 'registerOrder' => [ + 'order_id' => $this->order_ids[0], + 'status' => ORDER_PAY_WAIT, + 'mailmaga_flg' => null, + ], + 'registerOrderDetail' => [ + 'order_id' => $this->order_ids[0], + 'params' => [ + [ + 'order_id' => $this->order_ids[0], + 'product_id' => '1002', + 'product_class_id' => '1002', + 'product_name' => '製品02', + 'product_code' => 'cd1002', + 'classcategory_name1' => 'cat01', + 'classcategory_name2' => 'cat02', + 'point_rate' => '5', + 'price' => '1000', + 'quantity' => '10', + 'tax_rate' => null, + 'tax_rule' => null, + 'tax_adjust' => null, + ], + ], + ], + 'del_flg' => '1', + ]; $this->actual = $_SESSION['testResult']; $this->actual['del_flg'] = $this->objQuery->get('del_flg', 'dtb_order_temp', 'order_temp_id = ?', $this->order_temp_ids[0]); @@ -110,11 +110,11 @@ public function testRegisterOrderCompleteステータスの指定がない場合 { // 引数の準備 $orderParams = [ - 'order_id' => '1001', - // 'status' => ORDER_PAY_WAIT, - 'order_tax_rate' => '5', - 'order_tax_rule' => '1', - ]; + 'order_id' => '1001', + // 'status' => ORDER_PAY_WAIT, + 'order_tax_rate' => '5', + 'order_tax_rule' => '1', + ]; $cartSession = new SC_CartSession_registerOrderCompleteMock(); $_SESSION['site']['uniqid'] = '1001'; @@ -122,12 +122,12 @@ public function testRegisterOrderCompleteステータスの指定がない場合 // 上の条件と重複する部分は確認を省略 $this->expected = [ - 'registerOrder' => [ - 'order_id' => '1001', - 'status' => ORDER_NEW, - 'mailmaga_flg' => null, - ], - ]; + 'registerOrder' => [ + 'order_id' => '1001', + 'status' => ORDER_NEW, + 'mailmaga_flg' => null, + ], + ]; $this->actual['registerOrder'] = $_SESSION['testResult']['registerOrder']; $this->verify(); @@ -141,18 +141,18 @@ class SC_Helper_Purchase_registerOrderCompleteMock extends SC_Helper_Purchase public static function registerOrder($order_id, $params) { $_SESSION['testResult']['registerOrder'] = [ - 'order_id' => $order_id, - 'status' => $params['status'], - 'mailmaga_flg' => $params['mailmaga_flg'], - ]; + 'order_id' => $order_id, + 'status' => $params['status'], + 'mailmaga_flg' => $params['mailmaga_flg'], + ]; } public static function registerOrderDetail($order_id, $params) { $_SESSION['testResult']['registerOrderDetail'] = [ - 'order_id' => $order_id, - 'params' => $params, - ]; + 'order_id' => $order_id, + 'params' => $params, + ]; } public function setUniqId() @@ -166,19 +166,19 @@ class SC_CartSession_registerOrderCompleteMock extends SC_CartSession public function getCartList($cartKey, $pref_id = 0, $country_id = 0) { return [ - [ - 'productsClass' => [ - 'product_id' => '1002', - 'product_class_id' => '1002', - 'name' => '製品02', - 'product_code' => 'cd1002', - 'classcategory_name1' => 'cat01', - 'classcategory_name2' => 'cat02', - ], - 'point_rate' => '5', - 'price' => '1000', - 'quantity' => '10', - ], - ]; + [ + 'productsClass' => [ + 'product_id' => '1002', + 'product_class_id' => '1002', + 'name' => '製品02', + 'product_code' => 'cd1002', + 'classcategory_name1' => 'cat01', + 'classcategory_name2' => 'cat02', + ], + 'point_rate' => '5', + 'price' => '1000', + 'quantity' => '10', + ], + ]; } } diff --git a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_registerOrderDetailTest.php b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_registerOrderDetailTest.php index 90cc896aef..d878c72b75 100644 --- a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_registerOrderDetailTest.php +++ b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_registerOrderDetailTest.php @@ -54,24 +54,24 @@ protected function tearDown(): void public function testRegisterOrderDetail該当の受注が存在する場合削除後に新しい情報が登録される() { $params = [ - [ - 'order_id' => $this->order_ids[0], - 'hoge' => '999', // DBに存在しないカラム - 'product_id' => '9001', - 'product_class_id' => '9001', - 'product_name' => '製品名9001', - ], - ]; + [ + 'order_id' => $this->order_ids[0], + 'hoge' => '999', // DBに存在しないカラム + 'product_id' => '9001', + 'product_class_id' => '9001', + 'product_name' => '製品名9001', + ], + ]; SC_Helper_Purchase::registerOrderDetail($this->order_ids[0], $params); $this->expected['count'] = '1'; $this->expected['content'] = [ - 'order_id' => $this->order_ids[0], - 'product_id' => '9001', - 'product_class_id' => '9001', - 'product_name' => '製品名9001', - 'product_code' => null, // 古いデータにはあるが、deleteされたので消えている - ]; + 'order_id' => $this->order_ids[0], + 'product_id' => '9001', + 'product_class_id' => '9001', + 'product_name' => '製品名9001', + 'product_code' => null, // 古いデータにはあるが、deleteされたので消えている + ]; $this->actual['count'] = $this->objQuery->count('dtb_order_detail', 'order_id = ?', [$this->order_ids[0]]); $this->actual['content'] = $this->objQuery->getRow( @@ -87,24 +87,24 @@ public function testRegisterOrderDetail該当の受注が存在する場合削 public function testRegisterOrderDetail該当の受注が存在しない場合新しい情報が追加登録される() { $params = [ - [ - 'order_id' => '1003', - 'hoge' => '999', // DBに存在しないカラム - 'product_id' => '9003', - 'product_class_id' => '9003', - 'product_name' => '製品名9003', - ], - ]; + [ + 'order_id' => '1003', + 'hoge' => '999', // DBに存在しないカラム + 'product_id' => '9003', + 'product_class_id' => '9003', + 'product_name' => '製品名9003', + ], + ]; SC_Helper_Purchase::registerOrderDetail('1003', $params); $this->expected['count'] = '1'; $this->expected['content'] = [ - 'order_id' => '1003', - 'product_id' => '9003', - 'product_class_id' => '9003', - 'product_name' => '製品名9003', - 'product_code' => null, - ]; + 'order_id' => '1003', + 'product_id' => '9003', + 'product_class_id' => '9003', + 'product_name' => '製品名9003', + 'product_code' => null, + ]; $this->actual['count'] = $this->objQuery->count('dtb_order_detail', 'order_id = ?', [1003]); $result = $this->objQuery->select( diff --git a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_registerOrderTest.php b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_registerOrderTest.php index 0a754664ac..b86c05547e 100644 --- a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_registerOrderTest.php +++ b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_registerOrderTest.php @@ -67,20 +67,20 @@ public function testRegisterOrder既に受注IDが存在する場合情報が更 $this->expected = [ 'sfUpdateOrderStatus' => [ - 'order_id' => $order_id, - 'status' => '1', - 'add_point' => 10, - 'use_point' => 20, + 'order_id' => $order_id, + 'status' => '1', + 'add_point' => 10, + 'use_point' => 20, ], 'sfUpdateOrderNameCol' => $order_id, 'count' => '2', 'content' => [ - 'order_id' => $order_id, - 'customer_id' => $this->customer_ids[0], - 'status' => '1', - 'add_point' => '10', - 'use_point' => '20', - 'order_name01' => '受注情報01_更新', + 'order_id' => $order_id, + 'customer_id' => $this->customer_ids[0], + 'status' => '1', + 'add_point' => '10', + 'use_point' => '20', + 'order_name01' => '受注情報01_更新', ], ]; $this->actual = $_SESSION['testResult']; @@ -111,20 +111,20 @@ public function testRegisterOrder存在しない受注IDを指定した場合新 $this->expected = [ 'sfUpdateOrderStatus' => [ - 'order_id' => '1003', - 'status' => '2', - 'add_point' => 100, - 'use_point' => 200, + 'order_id' => '1003', + 'status' => '2', + 'add_point' => 100, + 'use_point' => 200, ], 'sfUpdateOrderNameCol' => '1003', 'count' => '3', 'content' => [ - 'order_id' => '1003', - 'customer_id' => '1003', - 'status' => null, // ここではsfUpdateOrderStatusをモックにしているので更新されない - 'add_point' => '100', - 'use_point' => '200', - 'order_name01' => '受注情報03', + 'order_id' => '1003', + 'customer_id' => '1003', + 'status' => null, // ここではsfUpdateOrderStatusをモックにしているので更新されない + 'add_point' => '100', + 'use_point' => '200', + 'order_name01' => '受注情報03', ], ]; $this->actual = $_SESSION['testResult']; diff --git a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_registerShipmentItemTest.php b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_registerShipmentItemTest.php index e6bd91ccab..e3ed6f7b2e 100644 --- a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_registerShipmentItemTest.php +++ b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_registerShipmentItemTest.php @@ -57,15 +57,15 @@ public function testRegisterShipmentItem製品クラスIDが入っていない $order_id = '1'; $shipping_id = '1'; $arrParams = [ - [ - // 'product_class_id' => '1', - 'product_name' => '追加製品名01', - 'product_code' => 'newcode01', - 'classcategory_name1' => 'newcat01', - 'classcategory_name2' => 'newcat02', - 'price' => '2500', - ], - ]; + [ + // 'product_class_id' => '1', + 'product_name' => '追加製品名01', + 'product_code' => 'newcode01', + 'classcategory_name1' => 'newcat01', + 'classcategory_name2' => 'newcat02', + 'price' => '2500', + ], + ]; // 期待値の設定 $this->expected['count'] = 0; @@ -89,26 +89,26 @@ public function testRegisterShipmentItem製品名等が指定されている場 $order_id = $this->order_ids[0]; $shipping_id = '0'; $arrParams = [ - [ - 'product_class_id' => '1', - 'product_name' => '追加製品名01', - 'product_code' => 'newcode01', - 'classcategory_name1' => 'newcat01', - 'classcategory_name2' => 'newcat02', - 'price' => '2500', - ], - ]; + [ + 'product_class_id' => '1', + 'product_name' => '追加製品名01', + 'product_code' => 'newcode01', + 'classcategory_name1' => 'newcat01', + 'classcategory_name2' => 'newcat02', + 'price' => '2500', + ], + ]; // 期待値の設定 $this->expected['count'] = 1; $this->expected['first'] = [ - 'product_class_id' => '1', - 'product_name' => '追加製品名01', - 'product_code' => 'newcode01', - 'classcategory_name1' => 'newcat01', - 'classcategory_name2' => 'newcat02', - 'price' => '2500', - ]; + 'product_class_id' => '1', + 'product_name' => '追加製品名01', + 'product_code' => 'newcode01', + 'classcategory_name1' => 'newcat01', + 'classcategory_name2' => 'newcat02', + 'price' => '2500', + ]; // 対象functionの呼び出し SC_Helper_Purchase::registerShipmentItem($order_id, $shipping_id, $arrParams); @@ -131,28 +131,28 @@ public function testRegisterShipmentItem製品名等が指定されていない $order_id = $this->order_ids[0]; $shipping_id = '1'; $arrParams = [ - [ - 'product_class_id' => '1', - // 'product_name' => '追加製品名01', - // 'product_code' => 'newcode01', - // 'classcategory_name1' => 'newcat01', - // 'classcategory_name2' => 'newcat02', - // 'price' => '2500' - ], - ]; + [ + 'product_class_id' => '1', + // 'product_name' => '追加製品名01', + // 'product_code' => 'newcode01', + // 'classcategory_name1' => 'newcat01', + // 'classcategory_name2' => 'newcat02', + // 'price' => '2500' + ], + ]; // 期待値の設定 $this->expected['count'] = 1; $this->expected['first'] = [ - 'product_class_id' => '1', - 'product_name' => 'アイスクリーム', - 'product_code' => 'ice-01', - 'classcategory_name1' => '抹茶', - 'classcategory_name2' => 'S', - // TODO 要確認price01, price02を設定しても価格が取れない。実際にはDBから取るケースが無い? - // 'price' => '1500' - 'price' => null, - ]; + 'product_class_id' => '1', + 'product_name' => 'アイスクリーム', + 'product_code' => 'ice-01', + 'classcategory_name1' => '抹茶', + 'classcategory_name2' => 'S', + // TODO 要確認price01, price02を設定しても価格が取れない。実際にはDBから取るケースが無い? + // 'price' => '1500' + 'price' => null, + ]; // 対象functionの呼び出し SC_Helper_Purchase::registerShipmentItem($order_id, $shipping_id, $arrParams); @@ -174,27 +174,27 @@ public function testRegisterShipmentItemDBに存在しないカラムを指定 $order_id = '1'; $shipping_id = '1'; $arrParams = [ - [ - 'product_class_id' => '1', - 'product_name' => '追加製品名01', - 'product_code' => 'newcode01', - 'classcategory_name1' => 'newcat01', - 'classcategory_name2' => 'newcat02', - 'price' => '2500', - 'xxxx' => 'yyyyyy', // 存在しないカラム - ], - ]; + [ + 'product_class_id' => '1', + 'product_name' => '追加製品名01', + 'product_code' => 'newcode01', + 'classcategory_name1' => 'newcat01', + 'classcategory_name2' => 'newcat02', + 'price' => '2500', + 'xxxx' => 'yyyyyy', // 存在しないカラム + ], + ]; // 期待値の設定 $this->expected['count'] = 1; $this->expected['first'] = [ - 'product_class_id' => '1', - 'product_name' => '追加製品名01', - 'product_code' => 'newcode01', - 'classcategory_name1' => 'newcat01', - 'classcategory_name2' => 'newcat02', - 'price' => '2500', - ]; + 'product_class_id' => '1', + 'product_name' => '追加製品名01', + 'product_code' => 'newcode01', + 'classcategory_name1' => 'newcat01', + 'classcategory_name2' => 'newcat02', + 'price' => '2500', + ]; // 対象functionの呼び出し SC_Helper_Purchase::registerShipmentItem($order_id, $shipping_id, $arrParams); diff --git a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_registerShippingTest.php b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_registerShippingTest.php index 238f7eaed5..4c53264dc1 100644 --- a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_registerShippingTest.php +++ b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_registerShippingTest.php @@ -49,21 +49,21 @@ public function testRegisterShipping元々存在しない受注IDの場合新規 { $order_id = '10'; $arrParams = [ - '20' => [ - 'order_id' => '10', - 'shipping_id' => '20', - 'shipping_name01' => '配送情報10', - 'shipping_date' => '2012/01/12', - ], - ]; + '20' => [ + 'order_id' => '10', + 'shipping_id' => '20', + 'shipping_name01' => '配送情報10', + 'shipping_date' => '2012/01/12', + ], + ]; $this->expected['count'] = '4'; // 1件増える $this->expected['content'] = [ - 'order_id' => '10', - 'shipping_id' => '20', - 'shipping_name01' => '配送情報10', - 'shipping_date' => '2012-01-12 00:00:00', - ]; + 'order_id' => '10', + 'shipping_id' => '20', + 'shipping_name01' => '配送情報10', + 'shipping_date' => '2012-01-12 00:00:00', + ]; SC_Helper_Purchase::registerShipping($order_id, $arrParams); @@ -86,21 +86,21 @@ public function testRegisterShipping元々存在する受注IDの場合既存の { $order_id = '2'; $arrParams = [ - '30' => [ - 'order_id' => '2', - 'shipping_id' => '30', - 'shipping_name01' => '配送情報02-update', - 'shipping_date' => '2013/12/03', - ], - ]; + '30' => [ + 'order_id' => '2', + 'shipping_id' => '30', + 'shipping_name01' => '配送情報02-update', + 'shipping_date' => '2013/12/03', + ], + ]; $this->expected['count'] = '3'; // 件数が変わらない $this->expected['content'] = [ - 'order_id' => '2', - 'shipping_id' => '30', - 'shipping_name01' => '配送情報02-update', - 'shipping_date' => '2013-12-03 00:00:00', - ]; + 'order_id' => '2', + 'shipping_id' => '30', + 'shipping_name01' => '配送情報02-update', + 'shipping_date' => '2013-12-03 00:00:00', + ]; SC_Helper_Purchase::registerShipping($order_id, $arrParams); @@ -123,21 +123,21 @@ public function testRegisterShipping配送日付が空の場合エラーが起 { $order_id = '2'; $arrParams = [ - '30' => [ - 'order_id' => '2', - 'shipping_id' => '30', - 'shipping_name01' => '配送情報02-update', - // 'shipping_date' => '2013/12/03 00:00:00' - ], - ]; + '30' => [ + 'order_id' => '2', + 'shipping_id' => '30', + 'shipping_name01' => '配送情報02-update', + // 'shipping_date' => '2013/12/03 00:00:00' + ], + ]; $this->expected['count'] = '3'; $this->expected['content'] = [ - 'order_id' => '2', - 'shipping_id' => '30', - 'shipping_name01' => '配送情報02-update', - 'shipping_date' => null, - ]; + 'order_id' => '2', + 'shipping_id' => '30', + 'shipping_name01' => '配送情報02-update', + 'shipping_date' => null, + ]; SC_Helper_Purchase::registerShipping($order_id, $arrParams); @@ -160,21 +160,21 @@ public function testRegisterShipping非会員購入の場合配送IDが設定さ { $order_id = '2'; $arrParams = [ - '30' => [ - 'order_id' => '2', - // 'shipping_id' => '30', - 'shipping_name01' => '配送情報02-update', - 'shipping_date' => '2013/12/03 00:00:00', - ], - ]; + '30' => [ + 'order_id' => '2', + // 'shipping_id' => '30', + 'shipping_name01' => '配送情報02-update', + 'shipping_date' => '2013/12/03 00:00:00', + ], + ]; $this->expected['count'] = '3'; // 件数が変わらない $this->expected['content'] = [ - 'order_id' => '2', - 'shipping_id' => '30', - 'shipping_name01' => '配送情報02-update', - 'shipping_date' => '2013-12-03 00:00:00', - ]; + 'order_id' => '2', + 'shipping_id' => '30', + 'shipping_name01' => '配送情報02-update', + 'shipping_date' => '2013-12-03 00:00:00', + ]; SC_Helper_Purchase::registerShipping($order_id, $arrParams); diff --git a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_rollbackOrderTest.php b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_rollbackOrderTest.php index 37e3fe6596..6696c8c149 100644 --- a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_rollbackOrderTest.php +++ b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_rollbackOrderTest.php @@ -58,28 +58,28 @@ public function testRollbackOrderデフォルトの引数で呼び出した場 $this->actual['testResult'] = $_SESSION['testResult']; $this->actual['siteRegist'] = $_SESSION['site']['regist_success']; $this->expected = [ - 'testResult' => [ - 'cancelOrder' => [ - 'order_id' => '1001', - 'orderStatus' => ORDER_CANCEL, - 'is_delete' => false, - ], - 'getOrderTempByOrderId' => [ - 'order_id' => '1001', - ], - 'saveOrderTemp' => [ - 'uniqid' => $uniqid, - 'arrOrderTemp' => [ - 'customer_id' => '2001', - 'del_flg' => '0', - ], - ], - 'verifyChangeCart' => [ - 'uniqid' => $uniqid, - ], - ], - 'siteRegist' => true, - ]; + 'testResult' => [ + 'cancelOrder' => [ + 'order_id' => '1001', + 'orderStatus' => ORDER_CANCEL, + 'is_delete' => false, + ], + 'getOrderTempByOrderId' => [ + 'order_id' => '1001', + ], + 'saveOrderTemp' => [ + 'uniqid' => $uniqid, + 'arrOrderTemp' => [ + 'customer_id' => '2001', + 'del_flg' => '0', + ], + ], + 'verifyChangeCart' => [ + 'uniqid' => $uniqid, + ], + ], + 'siteRegist' => true, + ]; $this->verify(); } @@ -96,28 +96,28 @@ public function testRollbackOrderトランザクションが開始していな $this->actual['testResult'] = $_SESSION['testResult']; $this->actual['siteRegist'] = $_SESSION['site']['regist_success']; $this->expected = [ - 'testResult' => [ - 'cancelOrder' => [ - 'order_id' => '1001', - 'orderStatus' => ORDER_DELIV, - 'is_delete' => true, - ], - 'getOrderTempByOrderId' => [ - 'order_id' => '1001', - ], - 'saveOrderTemp' => [ - 'uniqid' => $uniqid, - 'arrOrderTemp' => [ - 'customer_id' => '2001', - 'del_flg' => '0', - ], - ], - 'verifyChangeCart' => [ - 'uniqid' => $uniqid, - ], - ], - 'siteRegist' => true, - ]; + 'testResult' => [ + 'cancelOrder' => [ + 'order_id' => '1001', + 'orderStatus' => ORDER_DELIV, + 'is_delete' => true, + ], + 'getOrderTempByOrderId' => [ + 'order_id' => '1001', + ], + 'saveOrderTemp' => [ + 'uniqid' => $uniqid, + 'arrOrderTemp' => [ + 'customer_id' => '2001', + 'del_flg' => '0', + ], + ], + 'verifyChangeCart' => [ + 'uniqid' => $uniqid, + ], + ], + 'siteRegist' => true, + ]; $this->verify(); } // //////////////////////////////////////// @@ -130,35 +130,35 @@ class SC_Helper_Purchase_rollbackOrderMock extends SC_Helper_Purchase public static function cancelOrder($order_id, $orderStatus = ORDER_CANCEL, $is_delete = false) { $_SESSION['testResult']['cancelOrder'] = [ - 'order_id' => $order_id, - 'orderStatus' => $orderStatus, - 'is_delete' => $is_delete, - ]; + 'order_id' => $order_id, + 'orderStatus' => $orderStatus, + 'is_delete' => $is_delete, + ]; } public static function getOrderTempByOrderId($order_id) { $_SESSION['testResult']['getOrderTempByOrderId'] = [ - 'order_id' => $order_id, - ]; + 'order_id' => $order_id, + ]; return [ - 'customer_id' => '2001', - ]; + 'customer_id' => '2001', + ]; } public static function saveOrderTemp($uniqid, $arrOrderTemp, &$objCustomer = null) { $_SESSION['testResult']['saveOrderTemp'] = [ - 'uniqid' => $uniqid, - 'arrOrderTemp' => $arrOrderTemp, - ]; + 'uniqid' => $uniqid, + 'arrOrderTemp' => $arrOrderTemp, + ]; } public static function verifyChangeCart($uniqid, &$objCartSession) { $_SESSION['testResult']['verifyChangeCart'] = [ - 'uniqid' => $uniqid, - ]; + 'uniqid' => $uniqid, + ]; } } diff --git a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_saveOrderTempTest.php b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_saveOrderTempTest.php index c319e9a9c0..49ef66078b 100644 --- a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_saveOrderTempTest.php +++ b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_saveOrderTempTest.php @@ -61,9 +61,9 @@ public function testSaveOrderTemp受注一時情報IDが空の場合何もしな { $this->helper->saveOrderTemp(null, [ - 'customer_id' => '1003', - 'order_name01' => '受注情報03', - 'update_date' => 'CURRENT_TIMESTAMP', + 'customer_id' => '1003', + 'order_name01' => '受注情報03', + 'update_date' => 'CURRENT_TIMESTAMP', ] ); @@ -77,20 +77,20 @@ public function testSaveOrderTemp既存の情報がない場合情報が新規 { $this->helper->saveOrderTemp('1003', [ - 'customer_id' => '1003', - 'order_name01' => '受注情報03', - 'update_date' => 'CURRENT_TIMESTAMP', + 'customer_id' => '1003', + 'order_name01' => '受注情報03', + 'update_date' => 'CURRENT_TIMESTAMP', ] ); $this->expected['count'] = '3'; $this->expected['content'] = [ - [ - 'order_temp_id' => '1003', - 'customer_id' => '1003', - 'order_name01' => '受注情報03', - ], - ]; + [ + 'order_temp_id' => '1003', + 'customer_id' => '1003', + 'order_name01' => '受注情報03', + ], + ]; $this->actual['count'] = $this->objQuery->count('dtb_order_temp'); $this->actual['content'] = $this->objQuery->select( 'order_temp_id, customer_id, order_name01', @@ -103,20 +103,20 @@ public function testSaveOrderTemp既存の情報がある場合情報が更新 { $this->helper->saveOrderTemp($this->order_temp_ids[0], [ - 'customer_id' => '2002', - 'order_name01' => '受注情報92', - 'update_date' => 'CURRENT_TIMESTAMP', + 'customer_id' => '2002', + 'order_name01' => '受注情報92', + 'update_date' => 'CURRENT_TIMESTAMP', ] ); $this->expected['count'] = '2'; $this->expected['content'] = [ - [ - 'order_temp_id' => $this->order_temp_ids[0], - 'customer_id' => '2002', - 'order_name01' => '受注情報92', - ], - ]; + [ + 'order_temp_id' => $this->order_temp_ids[0], + 'customer_id' => '2002', + 'order_name01' => '受注情報92', + ], + ]; $this->actual['count'] = $this->objQuery->count('dtb_order_temp'); $this->actual['content'] = $this->objQuery->select( 'order_temp_id, customer_id, order_name01', @@ -129,10 +129,10 @@ public function testSaveOrderTemp注文者情報がある場合情報がコピ { $this->helper->saveOrderTemp('1003', [ - 'order_temp_id' => '1003', - 'customer_id' => '1003', - 'order_name01' => '受注情報03', - 'update_date' => 'CURRENT_TIMESTAMP', + 'order_temp_id' => '1003', + 'customer_id' => '1003', + 'order_name01' => '受注情報03', + 'update_date' => 'CURRENT_TIMESTAMP', ], new SC_Customer_Ex() ); diff --git a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_saveShippingTempTest.php b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_saveShippingTempTest.php index 08a9efdf23..7ea2189462 100644 --- a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_saveShippingTempTest.php +++ b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_saveShippingTempTest.php @@ -53,11 +53,11 @@ public function testSaveShippingTemp元々存在しない配送先IDの場合新 ); $this->expected = [ - 'count' => 4, // 配送情報全体の件数 - 'shipping_id' => 0, - 'shipment_item' => null, - 'shipping_pref' => '大阪府', - ]; + 'count' => 4, // 配送情報全体の件数 + 'shipping_id' => 0, + 'shipment_item' => null, + 'shipping_pref' => '大阪府', + ]; $this->actual['count'] = count($_SESSION['shipping']); $this->actual['shipping_id'] = $_SESSION['shipping']['0']['shipping_id']; $this->actual['shipment_item'] = $_SESSION['shipping']['0']['shipment_item']; @@ -76,11 +76,11 @@ public function testSaveShippingTemp元々存在する配送先IDの場合情報 ); $this->expected = [ - 'count' => 3, // 配送情報全体の件数 - 'shipping_id' => '00001', - 'shipment_item' => ['商品1'], - 'shipping_pref' => '大阪府', - ]; + 'count' => 3, // 配送情報全体の件数 + 'shipping_id' => '00001', + 'shipment_item' => ['商品1'], + 'shipping_pref' => '大阪府', + ]; $this->actual['count'] = count($_SESSION['shipping']); $this->actual['shipping_id'] = $_SESSION['shipping']['00001']['shipping_id']; $this->actual['shipment_item'] = $_SESSION['shipping']['00001']['shipment_item']; diff --git a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_setDownloadableFlgToTest.php b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_setDownloadableFlgToTest.php index 1d80d03846..393323f016 100644 --- a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_setDownloadableFlgToTest.php +++ b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_setDownloadableFlgToTest.php @@ -47,8 +47,8 @@ protected function tearDown(): void public function testSetDownloadableFlgTo販売価格が0円の場合フラグがONになる() { $input = [ - '1001' => ['price' => 0], - ]; + '1001' => ['price' => 0], + ]; $this->expected = true; SC_Helper_Purchase::setDownloadableFlgTo($input); @@ -60,8 +60,8 @@ public function testSetDownloadableFlgTo販売価格が0円の場合フラグが public function testSetDownloadableFlgToダウンロード期限内かつ入金日ありの場合フラグがONになる() { $input = [ - '1001' => ['price' => 1000, 'effective' => '1', 'payment_date' => '2012-12-12'], - ]; + '1001' => ['price' => 1000, 'effective' => '1', 'payment_date' => '2012-12-12'], + ]; $this->expected = true; SC_Helper_Purchase::setDownloadableFlgTo($input); @@ -73,8 +73,8 @@ public function testSetDownloadableFlgToダウンロード期限内かつ入金 public function testSetDownloadableFlgToダウンロード期限内かつ入金日なしの場合フラグがOFFになる() { $input = [ - '1001' => ['price' => 1000, 'effective' => '1', 'payment_date' => null], - ]; + '1001' => ['price' => 1000, 'effective' => '1', 'payment_date' => null], + ]; $this->expected = false; SC_Helper_Purchase::setDownloadableFlgTo($input); @@ -86,8 +86,8 @@ public function testSetDownloadableFlgToダウンロード期限内かつ入金 public function testSetDownloadableFlgToダウンロード期限外かつ入金日ありの場合フラグがOFFになる() { $input = [ - '1001' => ['price' => 1000, 'effective' => '0', 'payment_date' => '2012-12-12'], - ]; + '1001' => ['price' => 1000, 'effective' => '0', 'payment_date' => '2012-12-12'], + ]; $this->expected = false; SC_Helper_Purchase::setDownloadableFlgTo($input); @@ -99,8 +99,8 @@ public function testSetDownloadableFlgToダウンロード期限外かつ入金 public function testSetDownloadableFlgToダウンロード期限外かつ入金日なしの場合フラグがOFFになる() { $input = [ - '1001' => ['price' => 1000, 'effective' => '0', 'payment_date' => null], - ]; + '1001' => ['price' => 1000, 'effective' => '0', 'payment_date' => null], + ]; $this->expected = false; SC_Helper_Purchase::setDownloadableFlgTo($input); diff --git a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_setShipmentItemTempForSoleTest.php b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_setShipmentItemTempForSoleTest.php index 1bd95d7e7f..db19e6c106 100644 --- a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_setShipmentItemTempForSoleTest.php +++ b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_setShipmentItemTempForSoleTest.php @@ -54,12 +54,12 @@ public function testSetShipmentItemTempForSoleいったん配送情報がクリ $helper->setShipmentItemTempForSole($cartSession, $shipping_id); $this->expected = [ - 'clearShipmentItemTemp' => true, - 'shipmentItemTemp' => [ - ['shipping_id' => '1001', 'id' => '1', 'quantity' => '10'], - ['shipping_id' => '1001', 'id' => '2', 'quantity' => '5'], - ], - ]; + 'clearShipmentItemTemp' => true, + 'shipmentItemTemp' => [ + ['shipping_id' => '1001', 'id' => '1', 'quantity' => '10'], + ['shipping_id' => '1001', 'id' => '2', 'quantity' => '5'], + ], + ]; $this->actual = $_SESSION['testResult']; $this->verify(); @@ -87,9 +87,9 @@ class SC_CartSession_setShipmentItemTempForSoleMock extends SC_CartSession public function getCartList($key, $pref_id = 0, $country_id = 0) { return [ - ['id' => '1', 'quantity' => '10'], - ['id' => '2', 'quantity' => '5'], - ['id' => '3', 'quantity' => '0'], - ]; + ['id' => '1', 'quantity' => '10'], + ['id' => '2', 'quantity' => '5'], + ['id' => '3', 'quantity' => '0'], + ]; } } diff --git a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_sfUpdateOrderStatusTest.php b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_sfUpdateOrderStatusTest.php index 2b468908be..4942a3a1c8 100644 --- a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_sfUpdateOrderStatusTest.php +++ b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_sfUpdateOrderStatusTest.php @@ -65,15 +65,15 @@ public function testSfUpdateOrderStatusオプションの引数が未指定の SC_Helper_Purchase_sfUpdateOrderStatusMock::sfUpdateOrderStatus($order_id); // 引数は最低限だけ指定 $this->expected = [ - 'order' => [ - 'status' => '3', - 'add_point' => '20', - 'use_point' => '10', - ], - 'customer' => [ - 'point' => $customer_point, - ], - ]; + 'order' => [ + 'status' => '3', + 'add_point' => '20', + 'use_point' => '10', + ], + 'customer' => [ + 'point' => $customer_point, + ], + ]; $this->actual['order'] = array_shift($this->objQuery->select( 'status, use_point, add_point', 'dtb_order', 'order_id = ?', [$order_id])); @@ -87,14 +87,11 @@ public function testSfUpdateOrderStatusオプションの引数が未指定の } // TODO 定数を変更できないためテスト不可 - /** - public function testSfUpdateOrderStatus_ポイント使用しない設定の場合_ポイントに関する処理が行われない() - { - + // public function testSfUpdateOrderStatus_ポイント使用しない設定の場合_ポイントに関する処理が行われない() + // { + // $this->verify(); + // } - $this->verify(); - } - */ public function testSfUpdateOrderStatus対応状況が発送済みに変更された場合発送日が更新される() { $order_id = $this->order_ids[0]; @@ -108,15 +105,15 @@ public function testSfUpdateOrderStatus対応状況が発送済みに変更さ SC_Helper_Purchase_sfUpdateOrderStatusMock::sfUpdateOrderStatus($order_id, ORDER_DELIV, 50, 45); $this->expected = [ - 'order' => [ - 'status' => ORDER_DELIV, - 'add_point' => '50', // 引数の設定どおりになる - 'use_point' => '45', // 引数の設定どおりになる - ], - 'customer' => [ - 'point' => $customer_point, // ポイントを使わない - ], - ]; + 'order' => [ + 'status' => ORDER_DELIV, + 'add_point' => '50', // 引数の設定どおりになる + 'use_point' => '45', // 引数の設定どおりになる + ], + 'customer' => [ + 'point' => $customer_point, // ポイントを使わない + ], + ]; $this->actual['order'] = array_shift($this->objQuery->select( 'status, use_point, add_point', 'dtb_order', 'order_id = ?', [$order_id])); @@ -145,12 +142,12 @@ public function testSfUpdateOrderStatus対応状況が入金済みに変更さ SC_Helper_Purchase_sfUpdateOrderStatusMock::sfUpdateOrderStatus($order_id, ORDER_PRE_END, 50, 45); $this->expected = [ - 'order' => [ - 'status' => ORDER_PRE_END, - 'add_point' => '50', // 引数の設定どおりになる - 'use_point' => '45', // 引数の設定どおりになる - ], - ]; + 'order' => [ + 'status' => ORDER_PRE_END, + 'add_point' => '50', // 引数の設定どおりになる + 'use_point' => '45', // 引数の設定どおりになる + ], + ]; $this->actual['order'] = array_shift($this->objQuery->select( 'status, use_point, add_point', 'dtb_order', 'order_id = ?', [$order_id])); @@ -178,15 +175,15 @@ public function testSfUpdateOrderStatus変更前の対応状況が利用対象 SC_Helper_Purchase_sfUpdateOrderStatusMock::sfUpdateOrderStatus($order_id, ORDER_CANCEL, 0, 45); $this->expected = [ - 'order' => [ - 'status' => ORDER_CANCEL, - 'add_point' => '0', // 引数の設定どおりになる - 'use_point' => '45', // 引数の設定どおりになる - ], - 'customer' => [ - 'point' => '210', // 元々200pt+10pt戻す - ], - ]; + 'order' => [ + 'status' => ORDER_CANCEL, + 'add_point' => '0', // 引数の設定どおりになる + 'use_point' => '45', // 引数の設定どおりになる + ], + 'customer' => [ + 'point' => '210', // 元々200pt+10pt戻す + ], + ]; $this->actual['order'] = array_shift($this->objQuery->select( 'status, use_point, add_point', 'dtb_order', 'order_id = ?', [$order_id])); @@ -208,15 +205,15 @@ public function testSfUpdateOrderStatus変更後の対応状況が利用対象 SC_Helper_Purchase_sfUpdateOrderStatusMock::sfUpdateOrderStatus($order_id, ORDER_NEW, 50, 45); $this->expected = [ - 'order' => [ - 'status' => ORDER_NEW, - 'add_point' => '50', // 引数の設定どおりになる - 'use_point' => '45', // 引数の設定どおりになる - ], - 'customer' => [ - 'point' => '55', // 元々100pt→45pt引く - ], - ]; + 'order' => [ + 'status' => ORDER_NEW, + 'add_point' => '50', // 引数の設定どおりになる + 'use_point' => '45', // 引数の設定どおりになる + ], + 'customer' => [ + 'point' => '55', // 元々100pt→45pt引く + ], + ]; $this->actual['order'] = array_shift($this->objQuery->select( 'status, use_point, add_point', 'dtb_order', 'order_id = ?', [$order_id])); @@ -238,15 +235,15 @@ public function testSfUpdateOrderStatus変更前の対応状況が加算対象 SC_Helper_Purchase_sfUpdateOrderStatusMock::sfUpdateOrderStatus($order_id, ORDER_CANCEL, 50, 45); $this->expected = [ - 'order' => [ - 'status' => ORDER_CANCEL, - 'add_point' => '50', // 引数の設定どおりになる - 'use_point' => '45', // 引数の設定どおりになる - ], - 'customer' => [ - 'point' => '180', // 元々200pt→20pt引く - ], - ]; + 'order' => [ + 'status' => ORDER_CANCEL, + 'add_point' => '50', // 引数の設定どおりになる + 'use_point' => '45', // 引数の設定どおりになる + ], + 'customer' => [ + 'point' => '180', // 元々200pt→20pt引く + ], + ]; $this->actual['order'] = array_shift($this->objQuery->select( 'status, use_point, add_point', 'dtb_order', 'order_id = ?', [$order_id])); @@ -268,15 +265,15 @@ public function testSfUpdateOrderStatus変更後の対応状況が加算対象 SC_Helper_Purchase_sfUpdateOrderStatusMock::sfUpdateOrderStatus($order_id, ORDER_DELIV, 50, 0); $this->expected = [ - 'order' => [ - 'status' => ORDER_DELIV, - 'add_point' => '50', // 引数の設定どおりになる - 'use_point' => '0', // 引数の設定どおりになる - ], - 'customer' => [ - 'point' => '150', // 元々100pt→50pt足す - ], - ]; + 'order' => [ + 'status' => ORDER_DELIV, + 'add_point' => '50', // 引数の設定どおりになる + 'use_point' => '0', // 引数の設定どおりになる + ], + 'customer' => [ + 'point' => '150', // 元々100pt→50pt足す + ], + ]; $this->actual['order'] = array_shift($this->objQuery->select( 'status, use_point, add_point', 'dtb_order', 'order_id = ?', [$order_id])); @@ -298,15 +295,15 @@ public function testSfUpdateOrderStatus加算ポイントがプラスの場合 SC_Helper_Purchase_sfUpdateOrderStatusMock::sfUpdateOrderStatus($order_id, ORDER_PRE_END, 40, 25); $this->expected = [ - 'order' => [ - 'status' => ORDER_PRE_END, - 'add_point' => '40', // 引数の設定どおりになる - 'use_point' => '25', // 引数の設定どおりになる - ], - 'customer' => [ - 'point' => '105', // 変更前の状態で-10pt,変更後の状態で+15pt - ], - ]; + 'order' => [ + 'status' => ORDER_PRE_END, + 'add_point' => '40', // 引数の設定どおりになる + 'use_point' => '25', // 引数の設定どおりになる + ], + 'customer' => [ + 'point' => '105', // 変更前の状態で-10pt,変更後の状態で+15pt + ], + ]; $this->actual['order'] = array_shift($this->objQuery->select( 'status, use_point, add_point', 'dtb_order', 'order_id = ?', [$order_id])); @@ -328,15 +325,15 @@ public function testSfUpdateOrderStatus加算ポイントが負でポイント SC_Helper_Purchase_sfUpdateOrderStatusMock::sfUpdateOrderStatus($order_id, ORDER_PRE_END, 0, 50); $this->expected = [ - 'order' => [ - 'status' => ORDER_PRE_END, - 'add_point' => '0', // 引数の設定どおりになる - 'use_point' => '50', // 引数の設定どおりになる - ], - 'customer' => [ - 'point' => '40', // 変更前の状態で-10pt,変更後の状態で-50pt - ], - ]; + 'order' => [ + 'status' => ORDER_PRE_END, + 'add_point' => '0', // 引数の設定どおりになる + 'use_point' => '50', // 引数の設定どおりになる + ], + 'customer' => [ + 'point' => '40', // 変更前の状態で-10pt,変更後の状態で-50pt + ], + ]; $this->actual['order'] = array_shift($this->objQuery->select( 'status, use_point, add_point', 'dtb_order', 'order_id = ?', [$order_id])); @@ -346,11 +343,9 @@ public function testSfUpdateOrderStatus加算ポイントが負でポイント } // TODO ロールバックされる場合はexitするためテスト不可. - /** - public function testSfUpdateOrderStatus_加算ポイントが負でポイントが足りていない場合_会員テーブルがロールバックされエラーとなる() - { - } - */ + // public function testSfUpdateOrderStatus_加算ポイントが負でポイントが足りていない場合_会員テーブルがロールバックされエラーとなる() + // { + // } // //////////////////////////////////////// diff --git a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_unsetOneShippingTest.php b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_unsetOneShippingTest.php index 012e8c7ca8..3aabc14752 100644 --- a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_unsetOneShippingTest.php +++ b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_unsetOneShippingTest.php @@ -51,15 +51,15 @@ public function testUnsetOneShippingTemp指定したIDの配送情報のみが SC_Helper_Purchase::unsetOneShippingTemp('00002'); $this->expected = [ - '00001' => [ - 'shipment_id' => '00001', - 'shipment_item' => ['商品1'], - 'shipping_pref' => '東京都', ], - '00003' => [ - 'shipment_id' => '00003', - 'shipment_item' => [], - 'shipping_pref' => '埼玉県', ], - ]; + '00001' => [ + 'shipment_id' => '00001', + 'shipment_item' => ['商品1'], + 'shipping_pref' => '東京都', ], + '00003' => [ + 'shipment_id' => '00003', + 'shipment_item' => [], + 'shipping_pref' => '埼玉県', ], + ]; $this->actual = $_SESSION['shipping']; $this->verify('配送情報'); diff --git a/tests/class/helper/SC_Helper_TaxRule/SC_Helper_TaxRule_getTaxDetailTest.php b/tests/class/helper/SC_Helper_TaxRule/SC_Helper_TaxRule_getTaxDetailTest.php index f9b0adbdce..2df59906d5 100644 --- a/tests/class/helper/SC_Helper_TaxRule/SC_Helper_TaxRule_getTaxDetailTest.php +++ b/tests/class/helper/SC_Helper_TaxRule/SC_Helper_TaxRule_getTaxDetailTest.php @@ -112,6 +112,7 @@ public function testGetTaxPerTaxRateWithZero() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testGetTaxPerTaxRateWithFloor() @@ -161,6 +162,7 @@ public function testGetTaxPerTaxRateWithFloor() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testGetTaxPerTaxRateWithCeil() @@ -262,7 +264,9 @@ public function testGetTaxPerTaxRateWithRound2() /** * @see https://github.com/EC-CUBE/ec-cube2/pull/762#issuecomment-1897799676 + * * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testGetTaxPerTaxRateWithFloor2() @@ -312,7 +316,9 @@ public function testGetTaxPerTaxRateWithFloor2() /** * @see https://github.com/EC-CUBE/ec-cube2/pull/762#issuecomment-1897799676 + * * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testGetTaxPerTaxRateWithCeil2() diff --git a/tests/class/helper/SC_Helper_TaxRule/SC_Helper_TaxRule_getTaxRuleTest.php b/tests/class/helper/SC_Helper_TaxRule/SC_Helper_TaxRule_getTaxRuleTest.php index fb3747f3be..b4bdf59fcc 100644 --- a/tests/class/helper/SC_Helper_TaxRule/SC_Helper_TaxRule_getTaxRuleTest.php +++ b/tests/class/helper/SC_Helper_TaxRule/SC_Helper_TaxRule_getTaxRuleTest.php @@ -23,6 +23,7 @@ protected function tearDown(): void /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function test定数が正しく設定されているかのテスト() @@ -34,6 +35,7 @@ public function test定数が正しく設定されているかのテスト() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function test引数が空の場合税率設定で設定かつ適用日時内の最新の値が返される() @@ -60,6 +62,7 @@ public function test引数が空の場合税率設定で設定かつ適用日時 /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function test商品idを指定した場合税率設定で設定かつ適用日時内の最新の値が返される() @@ -86,6 +89,7 @@ public function test商品idを指定した場合税率設定で設定かつ適 /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function test商品規格idを指定した場合税率設定で設定かつ適用日時内の最新の値が返される() diff --git a/tests/class/helper/SC_Helper_TaxRule/SC_Helper_TaxRule_getTaxRule_OptionProductTaxRuleTest.php b/tests/class/helper/SC_Helper_TaxRule/SC_Helper_TaxRule_getTaxRule_OptionProductTaxRuleTest.php index c244d302ed..e7c0bfd0d0 100644 --- a/tests/class/helper/SC_Helper_TaxRule/SC_Helper_TaxRule_getTaxRule_OptionProductTaxRuleTest.php +++ b/tests/class/helper/SC_Helper_TaxRule/SC_Helper_TaxRule_getTaxRule_OptionProductTaxRuleTest.php @@ -25,6 +25,7 @@ protected function tearDown(): void /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function test引数が空の場合税率設定で設定かつ適用日時内の最新の値が返される() @@ -51,6 +52,7 @@ public function test引数が空の場合税率設定で設定かつ適用日時 /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function test商品idを指定した場合商品に設定かつ適用日時内の最新の値が返される() @@ -77,6 +79,7 @@ public function test商品idを指定した場合商品に設定かつ適用日 /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function test商品規格idを指定した場合商品に登録かつ適用日時内の最新の値が返される() @@ -103,6 +106,7 @@ public function test商品規格idを指定した場合商品に登録かつ適 /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function test商品規格idのみを指定した場合税率設定に登録かつ適用日時内の最新の値が返される() @@ -129,6 +133,7 @@ public function test商品規格idのみを指定した場合税率設定に登 /** * @runInSeparateProcess + * * @preserveGlobalState disabled * * 基本税率と同じ税率を設定すると商品別税率を削除する diff --git a/tests/class/plugin/LoadClassFileChangeCustomDirTest.php b/tests/class/plugin/LoadClassFileChangeCustomDirTest.php index 44788e3a83..f89cbe007c 100644 --- a/tests/class/plugin/LoadClassFileChangeCustomDirTest.php +++ b/tests/class/plugin/LoadClassFileChangeCustomDirTest.php @@ -37,6 +37,7 @@ protected function setUp(): void /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testLOading() diff --git a/tests/class/plugin/LoadClassFileChangeTest.php b/tests/class/plugin/LoadClassFileChangeTest.php index da09c22c02..174c33d66f 100644 --- a/tests/class/plugin/LoadClassFileChangeTest.php +++ b/tests/class/plugin/LoadClassFileChangeTest.php @@ -38,6 +38,7 @@ protected function tearDown(): void * loadClassFileChange で拡張したクラスのテストケース. * * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testLoadExtendedClass() diff --git a/tests/class/util/SC_Utils/SC_Utils_arrayDefineIndexesTest.php b/tests/class/util/SC_Utils/SC_Utils_arrayDefineIndexesTest.php index 73ea917125..1b26ab6313 100644 --- a/tests/class/util/SC_Utils/SC_Utils_arrayDefineIndexesTest.php +++ b/tests/class/util/SC_Utils/SC_Utils_arrayDefineIndexesTest.php @@ -61,12 +61,12 @@ public function testArrayDefineIndexesチェック対象のキーが一部存在 $defineIndexes = ['tomato', 'banana', 'kiwi']; $this->expected = [ - 'apple' => 'りんご', - 'banana' => 'バナナ', - 'orange' => 'オレンジ', - 'tomato' => '', - 'kiwi' => '', - ]; + 'apple' => 'りんご', + 'banana' => 'バナナ', + 'orange' => 'オレンジ', + 'tomato' => '', + 'kiwi' => '', + ]; $this->actual = SC_Utils::arrayDefineIndexes($input_array, $defineIndexes); $this->verify(); diff --git a/tests/class/util/SC_Utils/SC_Utils_isAbsoluteRealPathTest.php b/tests/class/util/SC_Utils/SC_Utils_isAbsoluteRealPathTest.php index 147023471c..d178f1323a 100644 --- a/tests/class/util/SC_Utils/SC_Utils_isAbsoluteRealPathTest.php +++ b/tests/class/util/SC_Utils/SC_Utils_isAbsoluteRealPathTest.php @@ -47,7 +47,7 @@ protected function tearDown(): void // /////////////////////////////////////// public function testIsAbsoluteRealPath絶対パスの場合Trueが返る() { - if (strpos(PHP_OS, 'WIN') !== false) { + if (str_contains(PHP_OS, 'WIN')) { $input = 'C:/Program Files/username/hoge/hoge.txt'; $this->markTestSkipped( 'Appveyorが落ちるので暫定スキップしています' @@ -63,7 +63,7 @@ public function testIsAbsoluteRealPath絶対パスの場合Trueが返る() public function testIsAbsoluteRealPath相対パスの場合Trueが返る() { - if (strpos(PHP_OS, 'WIN') !== false) { + if (str_contains(PHP_OS, 'WIN')) { $input = './system32/hoge/hoge.txt'; } else { $input = '../etc/php.ini'; diff --git a/tests/class/util/SC_Utils/SC_Utils_isAppInnerUrlTest.php b/tests/class/util/SC_Utils/SC_Utils_isAppInnerUrlTest.php index 114b1fd81b..edcb14a868 100644 --- a/tests/class/util/SC_Utils/SC_Utils_isAppInnerUrlTest.php +++ b/tests/class/util/SC_Utils/SC_Utils_isAppInnerUrlTest.php @@ -48,43 +48,41 @@ protected function tearDown(): void } // /////////////////////////////////////// - /** - public function testIsAppInnerUrl_非SSLかつアプリ内URLの場合_trueが返る() - { - $input = 'http://sample.eccube.jp/admin/'; - $this->expected = true; - $this->actual = SC_Utils::isAppInnerUrl($input); + // public function testIsAppInnerUrl_非SSLかつアプリ内URLの場合_trueが返る() + // { + // $input = 'http://sample.eccube.jp/admin/'; + // $this->expected = true; + // $this->actual = SC_Utils::isAppInnerUrl($input); - $this->verify(); - } + // $this->verify(); + // } - public function testIsAppInnerUrl_非SSLかつアプリ外URLの場合_falseが返る() - { - $input = 'http://outside.eccube.jp/admin/'; - $this->expected = false; - $this->actual = SC_Utils::isAppInnerUrl($input); + // public function testIsAppInnerUrl_非SSLかつアプリ外URLの場合_falseが返る() + // { + // $input = 'http://outside.eccube.jp/admin/'; + // $this->expected = false; + // $this->actual = SC_Utils::isAppInnerUrl($input); - $this->verify(); - } + // $this->verify(); + // } - public function testIsAppInnerUrl_SSLかつアプリ内URLの場合_trueが返る() - { - $input = 'https://sample.eccube.jp/admin/'; - $this->expected = true; - $this->actual = SC_Utils::isAppInnerUrl($input); + // public function testIsAppInnerUrl_SSLかつアプリ内URLの場合_trueが返る() + // { + // $input = 'https://sample.eccube.jp/admin/'; + // $this->expected = true; + // $this->actual = SC_Utils::isAppInnerUrl($input); - $this->verify(); - } + // $this->verify(); + // } - public function testIsAppInnerUrl_SSLかつアプリ外URLの場合_falseが返る() - { - $input = 'https://outside.eccube.jp/admin/'; - $this->expected = false; - $this->actual = SC_Utils::isAppInnerUrl($input); + // public function testIsAppInnerUrl_SSLかつアプリ外URLの場合_falseが返る() + // { + // $input = 'https://outside.eccube.jp/admin/'; + // $this->expected = false; + // $this->actual = SC_Utils::isAppInnerUrl($input); - $this->verify(); - } - */ + // $this->verify(); + // } // //////////////////////////////////////// public function testDummyTest() diff --git a/tests/class/util/SC_Utils/SC_Utils_sfArrCombineTest.php b/tests/class/util/SC_Utils/SC_Utils_sfArrCombineTest.php index 4c3cc6be3e..42fd0f284d 100644 --- a/tests/class/util/SC_Utils/SC_Utils_sfArrCombineTest.php +++ b/tests/class/util/SC_Utils/SC_Utils_sfArrCombineTest.php @@ -62,10 +62,10 @@ public function testSfArrCombine入力のキー配列の方が短い場合余っ $values = ['りんご', 'バナナ', 'オレンジ', '梨']; $this->expected = [ - 'apple' => 'りんご', - 'banana' => 'バナナ', - null => '梨', - ]; + 'apple' => 'りんご', + 'banana' => 'バナナ', + null => '梨', + ]; $this->actual = SC_Utils::sfArrCombine($keys, $values); $this->verify(); @@ -77,11 +77,11 @@ public function testSfArrCombine入力のキー配列の方が長い場合余っ $values = ['りんご', 'バナナ']; $this->expected = [ - 'apple' => 'りんご', - 'banana' => 'バナナ', - 'orange' => null, - 'pear' => null, - ]; + 'apple' => 'りんご', + 'banana' => 'バナナ', + 'orange' => null, + 'pear' => null, + ]; $this->actual = SC_Utils::sfArrCombine($keys, $values); $this->verify(); diff --git a/tests/class/util/SC_Utils/SC_Utils_sfArrKeyValueTest.php b/tests/class/util/SC_Utils/SC_Utils_sfArrKeyValueTest.php index 13a4ca0653..fbcde121a7 100644 --- a/tests/class/util/SC_Utils/SC_Utils_sfArrKeyValueTest.php +++ b/tests/class/util/SC_Utils/SC_Utils_sfArrKeyValueTest.php @@ -42,11 +42,11 @@ protected function setUp(): void // parent::setUp(); $this->arrList = [ - ['testkey' => '1011', 'testvalue' => '2001', 'key' => '3001'], - ['testkey' => '2022', 'testvalue' => '2002', 'key' => '3002'], - ['testkey' => '3033', 'testvalue' => '2003', 'key' => '3003'], - ['testkey' => '4044', 'testvalue' => '2004', 'key' => '3004'], - ]; + ['testkey' => '1011', 'testvalue' => '2001', 'key' => '3001'], + ['testkey' => '2022', 'testvalue' => '2002', 'key' => '3002'], + ['testkey' => '3033', 'testvalue' => '2003', 'key' => '3003'], + ['testkey' => '4044', 'testvalue' => '2004', 'key' => '3004'], + ]; $this->keyname = 'testkey'; $this->valuename = 'testvalue'; } @@ -62,10 +62,10 @@ public function testSfArrKeyValue最大長が配列より短い場合最大長 $len_max = 3; $this->expected = [ - '1011' => '2001', - '2022' => '2002', - '3033' => '2003', - ]; + '1011' => '2001', + '2022' => '2002', + '3033' => '2003', + ]; $this->actual = SC_Utils::sfArrKeyValue($this->arrList, $this->keyname, $this->valuename, $len_max); $this->verify(); @@ -74,11 +74,11 @@ public function testSfArrKeyValue最大長が配列より短い場合最大長 public function testSfArrKeyValue最大長が指定されていない場合全要素が出力される() { $this->expected = [ - '1011' => '2001', - '2022' => '2002', - '3033' => '2003', - '4044' => '2004', - ]; + '1011' => '2001', + '2022' => '2002', + '3033' => '2003', + '4044' => '2004', + ]; $this->actual = SC_Utils::sfArrKeyValue($this->arrList, $this->keyname, $this->valuename, $len_max); $this->verify(); @@ -90,11 +90,11 @@ public function testSfArrKeyValueキーサイズが短い場合キーサイズ $keysize = 1; $this->expected = [ - '1...' => '2001', - '2...' => '2002', - '3...' => '2003', - '4...' => '2004', - ]; + '1...' => '2001', + '2...' => '2002', + '3...' => '2003', + '4...' => '2004', + ]; $this->actual = SC_Utils::sfArrKeyValue($this->arrList, $this->keyname, $this->valuename, $len_max, $keysize); $this->verify(); diff --git a/tests/class/util/SC_Utils/SC_Utils_sfCopyDirtest.php b/tests/class/util/SC_Utils/SC_Utils_sfCopyDirtest.php index 1d6c1389a6..8e509c9f18 100644 --- a/tests/class/util/SC_Utils/SC_Utils_sfCopyDirtest.php +++ b/tests/class/util/SC_Utils/SC_Utils_sfCopyDirtest.php @@ -60,9 +60,9 @@ public function testSfCopyDirディレクトリでない場合Falseを返し何 $dst = self::$TMP_DIR.'/dst/'; $this->expected = [ - 'result' => false, - 'file_exists' => false, - ]; + 'result' => false, + 'file_exists' => false, + ]; $this->actual['result'] = SC_Utils::sfCopyDir($src, $dst); $this->actual['file_exists'] = file_exists($dst); @@ -80,9 +80,9 @@ public function testSfCopyDirコピー先のディレクトリが存在しない $dst = self::$TMP_DIR.'/dst/'; $this->expected = [ - 'dir_exists' => true, - 'files' => ['test.txt'], - ]; + 'dir_exists' => true, + 'files' => ['test.txt'], + ]; SC_Utils::sfCopyDir($src, $dst); $this->actual['dir_exists'] = is_dir($dst); $this->actual['files'] = Test_Utils::mapCols(SC_Helper_FileManager::sfGetFileList($dst), 'file_name'); @@ -117,12 +117,12 @@ public function testSfCopyDirコピー先のディレクトリが存在する場 $dst = self::$TMP_DIR.'/dst/'; $this->expected = [ - 'dir_exists' => true, - 'files' => ['CVS', 'dir1', 'test.txt'], - 'files_2' => ['dir12'], - 'files_3' => ['dir123'], - 'file_content' => 'good morning', - ]; + 'dir_exists' => true, + 'files' => ['CVS', 'dir1', 'test.txt'], + 'files_2' => ['dir12'], + 'files_3' => ['dir123'], + 'file_content' => 'good morning', + ]; SC_Utils::sfCopyDir($src, $dst); $this->actual['dir_exists'] = is_dir($dst); $this->actual['files'] = Test_Utils::mapCols(SC_Helper_FileManager::sfGetFileList($dst), 'file_name'); @@ -151,10 +151,10 @@ public function testSfCopyDir上書きフラグがONの場合同名ファイル $dst = self::$TMP_DIR.'/dst/'; $this->expected = [ - 'dir_exists' => true, - 'files' => ['test.txt'], - 'file_content' => 'hello', - ]; + 'dir_exists' => true, + 'files' => ['test.txt'], + 'file_content' => 'hello', + ]; SC_Utils::sfCopyDir($src, $dst, '', true); $this->actual['dir_exists'] = is_dir($dst); $this->actual['files'] = Test_Utils::mapCols(SC_Helper_FileManager::sfGetFileList($dst), 'file_name'); @@ -183,10 +183,10 @@ public function testSfCopyDir上書きフラグがONかつ書き込み権限が $dst = self::$TMP_DIR.'/dst/'; $this->expected = [ - 'dir_exists' => true, - 'files' => ['test.txt'], - 'file_content' => 'good morning', - ]; + 'dir_exists' => true, + 'files' => ['test.txt'], + 'file_content' => 'good morning', + ]; SC_Utils::sfCopyDir($src, $dst, '', true); $this->actual['dir_exists'] = is_dir($dst); $this->actual['files'] = Test_Utils::mapCols(SC_Helper_FileManager::sfGetFileList($dst), 'file_name'); diff --git a/tests/class/util/SC_Utils/SC_Utils_sfEncodeFileTest.php b/tests/class/util/SC_Utils/SC_Utils_sfEncodeFileTest.php index ff9a464821..19006419e1 100644 --- a/tests/class/util/SC_Utils/SC_Utils_sfEncodeFileTest.php +++ b/tests/class/util/SC_Utils/SC_Utils_sfEncodeFileTest.php @@ -60,9 +60,9 @@ public function testSfEncodeFileファイルが正常に開けた場合ファイ fclose($fp_out); $this->expected = [ - 'filename' => $outdir.'enc_test.txt', - 'content' => 'こんにちは', - ]; + 'filename' => $outdir.'enc_test.txt', + 'content' => 'こんにちは', + ]; $this->actual['filename'] = SC_Utils::sfEncodeFile($filepath, 'euc-jp', $outdir); @@ -75,5 +75,5 @@ public function testSfEncodeFileファイルが正常に開けた場合ファイ // TODO ファイルが開けなかった場合はexitするためテスト不可 - // //////////////////////////////////////// + // //////////////////////////////////////// } diff --git a/tests/class/util/SC_Utils/SC_Utils_sfGetAddressTest.php b/tests/class/util/SC_Utils/SC_Utils_sfGetAddressTest.php index 6d34029bd4..7a5aaadf94 100644 --- a/tests/class/util/SC_Utils/SC_Utils_sfGetAddressTest.php +++ b/tests/class/util/SC_Utils/SC_Utils_sfGetAddressTest.php @@ -58,12 +58,12 @@ public function test住所がヒットしない場合空の配列が返る() public function test住所が一件だけヒットする場合住所データが取得できる() { $this->expected = [ - [ - 'state' => '1', // 北海道 - 'city' => '札幌市中央区', - 'town' => '大通東', - ], - ]; + [ + 'state' => '1', // 北海道 + 'city' => '札幌市中央区', + 'town' => '大通東', + ], + ]; $this->actual = SC_Utils::sfGetAddress('0600041'); $this->verify('郵便番号検索結果'); @@ -72,35 +72,34 @@ public function test住所が一件だけヒットする場合住所データが // TODO 二件目に関しては件名のIDへの変換と町名の削除が行われない。 // 今の仕様ではこれでOKかもしれないが、そもそも一件目しか使わないのなら // $data_list[0]を返した方が良いのでは? - /** - public function test_住所が二件以上ヒットする場合_町名を消した住所データが取得できる() - { - $this->expected = array( - array( - 'state' => '5', // 秋田県 - 'city' => '秋田市', - 'town' => '' - ), - array( - 'state' => '5', - 'city' => '秋田市', - 'town' => '' - ) - ); - $this->actual = SC_Utils::sfGetAddress('0110951'); - - $this->verify('郵便番号検索結果'); - } - */ + // public function test_住所が二件以上ヒットする場合_町名を消した住所データが取得できる() + // { + // $this->expected = array( + // array( + // 'state' => '5', // 秋田県 + // 'city' => '秋田市', + // 'town' => '' + // ), + // array( + // 'state' => '5', + // 'city' => '秋田市', + // 'town' => '' + // ) + // ); + // $this->actual = SC_Utils::sfGetAddress('0110951'); + // + // $this->verify('郵便番号検索結果'); + // } + public function test住所に但し書きが含まれる場合但し書きが消去される() { $this->expected = [ - [ - 'state' => '1', // 北海道 - 'city' => '札幌市中央区', - 'town' => '大通西', - ], - ]; + [ + 'state' => '1', // 北海道 + 'city' => '札幌市中央区', + 'town' => '大通西', + ], + ]; $this->actual = SC_Utils::sfGetAddress('0600042'); $this->verify('郵便番号検索結果'); @@ -109,12 +108,12 @@ public function test住所に但し書きが含まれる場合但し書きが消 public function test住所に注意文言がある場合町名が消去される() { $this->expected = [ - [ - 'state' => '1', // 北海道 - 'city' => '札幌市中央区', - 'town' => '', - ], - ]; + [ + 'state' => '1', // 北海道 + 'city' => '札幌市中央区', + 'town' => '', + ], + ]; $this->actual = SC_Utils::sfGetAddress('0600000'); $this->verify('郵便番号検索結果'); @@ -123,12 +122,12 @@ public function test住所に注意文言がある場合町名が消去される public function test住所に番地の説明が含まれる場合町名が消去される() { $this->expected = [ - [ - 'state' => '8', // 茨城県 - 'city' => '猿島郡堺町', - 'town' => '', - ], - ]; + [ + 'state' => '8', // 茨城県 + 'city' => '猿島郡堺町', + 'town' => '', + ], + ]; $this->actual = SC_Utils::sfGetAddress('3060433'); $this->verify('郵便番号検索結果'); @@ -139,49 +138,49 @@ public function test住所に番地の説明が含まれる場合町名が消去 protected function setUpAddress() { $address = [ - [ - 'zip_id' => '2', - 'zipcode' => '0600041', - 'state' => '北海道', - 'city' => '札幌市中央区', - 'town' => '大通東', - ], - [ - 'zip_id' => '3', - 'zipcode' => '0600042', - 'state' => '北海道', - 'city' => '札幌市中央区', - 'town' => '大通西(1〜19丁目)', - ], - [ - 'zip_id' => '0', - 'zipcode' => '0600000', - 'state' => '北海道', - 'city' => '札幌市中央区', - 'town' => '以下に掲載がない場合', - ], - [ - 'zip_id' => '26867', - 'zipcode' => '3060433', - 'state' => '茨城県', - 'city' => '猿島郡堺町', - 'town' => '堺町の次に番地がくる場合', - ], - [ - 'zip_id' => '16223', - 'zipcode' => '0110951', - 'state' => '秋田県', - 'city' => '秋田市', - 'town' => '土崎港相染町', - ], - [ - 'zip_id' => '16226', - 'zipcode' => '0110951', - 'state' => '秋田県', - 'city' => '秋田市', - 'town' => '土崎港古川町', - ], - ]; + [ + 'zip_id' => '2', + 'zipcode' => '0600041', + 'state' => '北海道', + 'city' => '札幌市中央区', + 'town' => '大通東', + ], + [ + 'zip_id' => '3', + 'zipcode' => '0600042', + 'state' => '北海道', + 'city' => '札幌市中央区', + 'town' => '大通西(1〜19丁目)', + ], + [ + 'zip_id' => '0', + 'zipcode' => '0600000', + 'state' => '北海道', + 'city' => '札幌市中央区', + 'town' => '以下に掲載がない場合', + ], + [ + 'zip_id' => '26867', + 'zipcode' => '3060433', + 'state' => '茨城県', + 'city' => '猿島郡堺町', + 'town' => '堺町の次に番地がくる場合', + ], + [ + 'zip_id' => '16223', + 'zipcode' => '0110951', + 'state' => '秋田県', + 'city' => '秋田市', + 'town' => '土崎港相染町', + ], + [ + 'zip_id' => '16226', + 'zipcode' => '0110951', + 'state' => '秋田県', + 'city' => '秋田市', + 'town' => '土崎港古川町', + ], + ]; $this->objQuery->delete('mtb_zip'); foreach ($address as $item) { diff --git a/tests/class/util/SC_Utils/SC_Utils_sfGetClassCatCountTest.php b/tests/class/util/SC_Utils/SC_Utils_sfGetClassCatCountTest.php index 977cc444e3..b77413e274 100644 --- a/tests/class/util/SC_Utils/SC_Utils_sfGetClassCatCountTest.php +++ b/tests/class/util/SC_Utils/SC_Utils_sfGetClassCatCountTest.php @@ -50,9 +50,9 @@ protected function tearDown(): void public function testSfGetClassCatCount規格分類の件数がIDごとに取得できる() { $this->expected = [ - '1001' => '2', - '1002' => '1', - ]; + '1001' => '2', + '1002' => '1', + ]; $this->actual = SC_Utils::sfGetClassCatCount(); $this->verify('規格分類の件数'); @@ -63,69 +63,69 @@ public function testSfGetClassCatCount規格分類の件数がIDごとに取得 protected function setUpClassCat() { $classes = [ - [ - 'class_id' => '1001', - 'name' => '味', - 'creator_id' => '1', - 'update_date' => 'CURRENT_TIMESTAMP', - 'del_flg' => '0', - ], - [ - 'class_id' => '1002', - 'name' => '大きさ', - 'creator_id' => '1', - 'update_date' => 'CURRENT_TIMESTAMP', - 'del_flg' => '0', - ], - // 削除フラグが立っているので検索されない - [ - 'class_id' => '1003', - 'name' => '匂い', - 'creator_id' => '1', - 'update_date' => 'CURRENT_TIMESTAMP', - 'del_flg' => '1', - ], - ]; + [ + 'class_id' => '1001', + 'name' => '味', + 'creator_id' => '1', + 'update_date' => 'CURRENT_TIMESTAMP', + 'del_flg' => '0', + ], + [ + 'class_id' => '1002', + 'name' => '大きさ', + 'creator_id' => '1', + 'update_date' => 'CURRENT_TIMESTAMP', + 'del_flg' => '0', + ], + // 削除フラグが立っているので検索されない + [ + 'class_id' => '1003', + 'name' => '匂い', + 'creator_id' => '1', + 'update_date' => 'CURRENT_TIMESTAMP', + 'del_flg' => '1', + ], + ]; $this->objQuery->delete('dtb_class'); foreach ($classes as $item) { $this->objQuery->insert('dtb_class', $item); } $class_categories = [ - [ - 'classcategory_id' => '1011', - 'class_id' => '1001', - 'creator_id' => '1', - 'update_date' => 'CURRENT_TIMESTAMP', - ], - // 削除フラグが立っているので検索されない - [ - 'classcategory_id' => '1012', - 'class_id' => '1001', - 'creator_id' => '1', - 'update_date' => 'CURRENT_TIMESTAMP', - 'del_flg' => '1', - ], - [ - 'classcategory_id' => '1013', - 'class_id' => '1001', - 'creator_id' => '1', - 'update_date' => 'CURRENT_TIMESTAMP', - ], - [ - 'classcategory_id' => '1021', - 'class_id' => '1002', - 'creator_id' => '1', - 'update_date' => 'CURRENT_TIMESTAMP', - ], - // dtb_classでdel_flgが立っているので検索されない - [ - 'classcategory_id' => '1031', - 'class_id' => '1003', - 'creator_id' => '1', - 'update_date' => 'CURRENT_TIMESTAMP', - ], - ]; + [ + 'classcategory_id' => '1011', + 'class_id' => '1001', + 'creator_id' => '1', + 'update_date' => 'CURRENT_TIMESTAMP', + ], + // 削除フラグが立っているので検索されない + [ + 'classcategory_id' => '1012', + 'class_id' => '1001', + 'creator_id' => '1', + 'update_date' => 'CURRENT_TIMESTAMP', + 'del_flg' => '1', + ], + [ + 'classcategory_id' => '1013', + 'class_id' => '1001', + 'creator_id' => '1', + 'update_date' => 'CURRENT_TIMESTAMP', + ], + [ + 'classcategory_id' => '1021', + 'class_id' => '1002', + 'creator_id' => '1', + 'update_date' => 'CURRENT_TIMESTAMP', + ], + // dtb_classでdel_flgが立っているので検索されない + [ + 'classcategory_id' => '1031', + 'class_id' => '1003', + 'creator_id' => '1', + 'update_date' => 'CURRENT_TIMESTAMP', + ], + ]; // classcategory_id=0のものは削除しない $this->objQuery->delete('dtb_classcategory', 'classcategory_id <> 0'); foreach ($class_categories as $item) { diff --git a/tests/class/util/SC_Utils/SC_Utils_sfGetHashString_authTypePlainTest.php b/tests/class/util/SC_Utils/SC_Utils_sfGetHashString_authTypePlainTest.php index 6016bc39ce..8ee6559ec5 100644 --- a/tests/class/util/SC_Utils/SC_Utils_sfGetHashString_authTypePlainTest.php +++ b/tests/class/util/SC_Utils/SC_Utils_sfGetHashString_authTypePlainTest.php @@ -47,17 +47,16 @@ protected function tearDown(): void } // /////////////////////////////////////// - /** - public function testSfGetHashString_暗号化なしの設定になっている場合_文字列が変換されない() - { - $input = 'hello, world'; + // public function testSfGetHashString_暗号化なしの設定になっている場合_文字列が変換されない() + // { + // $input = 'hello, world'; - $this->expected = $input; - $this->actual = SC_Utils::sfGetHashString($input); + // $this->expected = $input; + // $this->actual = SC_Utils::sfGetHashString($input); + + // $this->verify(); + // } - $this->verify(); - } - */ public function testDummyTest() { // Warning が出るため空のテストを作成 diff --git a/tests/class/util/SC_Utils/SC_Utils_sfGetProductClassIdTest.php b/tests/class/util/SC_Utils/SC_Utils_sfGetProductClassIdTest.php index 79038e5061..5d7216c6e3 100644 --- a/tests/class/util/SC_Utils/SC_Utils_sfGetProductClassIdTest.php +++ b/tests/class/util/SC_Utils/SC_Utils_sfGetProductClassIdTest.php @@ -93,33 +93,33 @@ public function testSfGetProductClassId存在しない製品IDを指定した場 protected function setUpProductsClass() { $products_class = [ - [ - 'product_class_id' => '2001', - 'product_id' => '2001', - 'product_code' => 'code2001', - 'price02' => '1000', - 'creator_id' => '1', - 'update_date' => 'CURRENT_TIMESTAMP', - ], - [ - 'product_class_id' => '1001', - 'product_id' => '1001', - 'product_code' => 'code1001', - 'price02' => '1000', - 'classcategory_id1' => '1', - 'creator_id' => '1', - 'update_date' => 'CURRENT_TIMESTAMP', - ], - [ - 'product_class_id' => '1002', - 'product_id' => '1001', - 'product_code' => 'code1002', - 'price02' => '1000', - 'classcategory_id1' => '2', - 'creator_id' => '1', - 'update_date' => 'CURRENT_TIMESTAMP', - ], - ]; + [ + 'product_class_id' => '2001', + 'product_id' => '2001', + 'product_code' => 'code2001', + 'price02' => '1000', + 'creator_id' => '1', + 'update_date' => 'CURRENT_TIMESTAMP', + ], + [ + 'product_class_id' => '1001', + 'product_id' => '1001', + 'product_code' => 'code1001', + 'price02' => '1000', + 'classcategory_id1' => '1', + 'creator_id' => '1', + 'update_date' => 'CURRENT_TIMESTAMP', + ], + [ + 'product_class_id' => '1002', + 'product_id' => '1001', + 'product_code' => 'code1002', + 'price02' => '1000', + 'classcategory_id1' => '2', + 'creator_id' => '1', + 'update_date' => 'CURRENT_TIMESTAMP', + ], + ]; $this->objQuery->delete('dtb_products_class'); foreach ($products_class as $item) { diff --git a/tests/class/util/SC_Utils/SC_Utils_sfGetUnderChildrenArrayTest.php b/tests/class/util/SC_Utils/SC_Utils_sfGetUnderChildrenArrayTest.php index 20d0b01b43..a088a194c3 100644 --- a/tests/class/util/SC_Utils/SC_Utils_sfGetUnderChildrenArrayTest.php +++ b/tests/class/util/SC_Utils/SC_Utils_sfGetUnderChildrenArrayTest.php @@ -47,12 +47,12 @@ protected function tearDown(): void public function testSfGetUnderChildrenArray与えられた親IDを持つ要素だけが抽出される() { $input_array = [ - ['parent_id' => '1001', 'child_id' => '1001001'], - ['parent_id' => '1002', 'child_id' => '1002001'], - ['parent_id' => '1002', 'child_id' => '1002002'], - ['parent_id' => '1003', 'child_id' => '1003001'], - ['parent_id' => '1004', 'child_id' => '1004001'], - ]; + ['parent_id' => '1001', 'child_id' => '1001001'], + ['parent_id' => '1002', 'child_id' => '1002001'], + ['parent_id' => '1002', 'child_id' => '1002002'], + ['parent_id' => '1003', 'child_id' => '1003001'], + ['parent_id' => '1004', 'child_id' => '1004001'], + ]; $this->expected = ['1002001', '1002002']; $this->actual = SC_Utils::sfGetUnderChildrenArray( $input_array, diff --git a/tests/class/util/SC_Utils/SC_Utils_sfIsIntTest.php b/tests/class/util/SC_Utils/SC_Utils_sfIsIntTest.php index bcfe5877bc..c72bc4f9f8 100644 --- a/tests/class/util/SC_Utils/SC_Utils_sfIsIntTest.php +++ b/tests/class/util/SC_Utils/SC_Utils_sfIsIntTest.php @@ -93,15 +93,14 @@ public function testSfIsInt正の整数の場合TRUEが返る() } // TODO 「整数かどうか」という関数名なのでここはFALSEになるべきでは? - /** - public function testSfIsInt_正の小数の場合_FALSEが返る() - { - $this->expected = FALSE; - $this->actual = SC_Utils::sfIsInt('123.456'); + // public function testSfIsInt_正の小数の場合_FALSEが返る() + // { + // $this->expected = FALSE; + // $this->actual = SC_Utils::sfIsInt('123.456'); + + // $this->verify('整数かどうか'); + // } - $this->verify('整数かどうか'); - } - */ public function testSfIsInt負の整数の場合TRUEが返る() { $this->expected = true; @@ -111,13 +110,13 @@ public function testSfIsInt負の整数の場合TRUEが返る() } // TODO 文字列長でチェックしているので負の場合は範囲が小さくなっている - /* - public function testSfIsInt_負の整数で桁数が最大の場合_TRUEが返る() - { - $this->expected = TRUE; - $this->actual = SC_Utils::sfIsInt('-123456789'); - - $this->verify('整数かどうか'); - } - */ + /* + public function testSfIsInt_負の整数で桁数が最大の場合_TRUEが返る() + { + $this->expected = TRUE; + $this->actual = SC_Utils::sfIsInt('-123456789'); + + $this->verify('整数かどうか'); + } + */ } diff --git a/tests/class/util/SC_Utils/SC_Utils_sfIsMatchHashPassword_authTypePlainTest.php b/tests/class/util/SC_Utils/SC_Utils_sfIsMatchHashPassword_authTypePlainTest.php index d92c3c694c..63d67685c7 100644 --- a/tests/class/util/SC_Utils/SC_Utils_sfIsMatchHashPassword_authTypePlainTest.php +++ b/tests/class/util/SC_Utils/SC_Utils_sfIsMatchHashPassword_authTypePlainTest.php @@ -47,29 +47,29 @@ protected function tearDown(): void } // /////////////////////////////////////// - /** - public function testSfIsMatchHashPassword_文字列が一致する場合_trueが返る() - { - $pass = 'ec-cube'; - $hashpass = 'ec-cube'; - $this->expected = TRUE; - $this->actual = SC_Utils::sfIsMatchHashPassword($pass, $hashpass); + // public function testSfIsMatchHashPassword_文字列が一致する場合_trueが返る() + // { + // $pass = 'ec-cube'; + // $hashpass = 'ec-cube'; - $this->verify('パスワード文字列比較結果'); - } + // $this->expected = TRUE; + // $this->actual = SC_Utils::sfIsMatchHashPassword($pass, $hashpass); - public function testSfIsMatchHashPassword_文字列が一致しない場合_falseが返る() - { - $pass = 'ec-cube'; - $hashpass = 'EC-cube'; + // $this->verify('パスワード文字列比較結果'); + // } - $this->expected = FALSE; - $this->actual = SC_Utils::sfIsMatchHashPassword($pass, $hashpass); + // public function testSfIsMatchHashPassword_文字列が一致しない場合_falseが返る() + // { + // $pass = 'ec-cube'; + // $hashpass = 'EC-cube'; + + // $this->expected = FALSE; + // $this->actual = SC_Utils::sfIsMatchHashPassword($pass, $hashpass); + + // $this->verify('パスワード文字列比較結果'); + // } - $this->verify('パスワード文字列比較結果'); - } - */ public function testDummyTest() { // Warning が出るため空のテストを作成 diff --git a/tests/class/util/SC_Utils/SC_Utils_sfMakeHiddenArrayTest.php b/tests/class/util/SC_Utils/SC_Utils_sfMakeHiddenArrayTest.php index 27055ae2b2..81061fa6f0 100644 --- a/tests/class/util/SC_Utils/SC_Utils_sfMakeHiddenArrayTest.php +++ b/tests/class/util/SC_Utils/SC_Utils_sfMakeHiddenArrayTest.php @@ -48,27 +48,27 @@ protected function tearDown(): void public function testSfMakeHiddenArray多段配列が1次元配列に変換される() { $input_array = [ - 'vegetable' => '野菜', - 'fruit' => [ - 'apple' => 'りんご', - 'banana' => 'バナナ', - ], - 'drink' => [ - 'alcohol' => [ - 'beer' => 'ビール', - ], - 'water' => '水', - ], - 'rice' => '米', - ]; + 'vegetable' => '野菜', + 'fruit' => [ + 'apple' => 'りんご', + 'banana' => 'バナナ', + ], + 'drink' => [ + 'alcohol' => [ + 'beer' => 'ビール', + ], + 'water' => '水', + ], + 'rice' => '米', + ]; $this->expected = [ - 'vegetable' => '野菜', - 'fruit[apple]' => 'りんご', - 'fruit[banana]' => 'バナナ', - 'drink[alcohol][beer]' => 'ビール', - 'drink[water]' => '水', - 'rice' => '米', - ]; + 'vegetable' => '野菜', + 'fruit[apple]' => 'りんご', + 'fruit[banana]' => 'バナナ', + 'drink[alcohol][beer]' => 'ビール', + 'drink[water]' => '水', + 'rice' => '米', + ]; $this->actual = SC_Utils::sfMakeHiddenArray($input_array); $this->verify(); } diff --git a/tests/class/util/SC_Utils/SC_Utils_sfPrePointTest.php b/tests/class/util/SC_Utils/SC_Utils_sfPrePointTest.php index 2c35b80317..2c55046cf3 100644 --- a/tests/class/util/SC_Utils/SC_Utils_sfPrePointTest.php +++ b/tests/class/util/SC_Utils/SC_Utils_sfPrePointTest.php @@ -90,9 +90,9 @@ public function testSfPrePoint丸め方法の指定がない場合定数で指 { $this->expected = [9, 9]; $this->actual = [ - SC_Utils::sfPrePoint(100, 9.4), - SC_Utils::sfPrePoint(100, 9.5), - ]; + SC_Utils::sfPrePoint(100, 9.4), + SC_Utils::sfPrePoint(100, 9.5), + ]; $this->verify(); } diff --git a/tests/class/util/SC_Utils/SC_Utils_sfPrintRTest.php b/tests/class/util/SC_Utils/SC_Utils_sfPrintRTest.php index 954527915d..4685f59983 100644 --- a/tests/class/util/SC_Utils/SC_Utils_sfPrintRTest.php +++ b/tests/class/util/SC_Utils/SC_Utils_sfPrintRTest.php @@ -45,18 +45,17 @@ protected function tearDown(): void // /////////////////////////////////////// // TODO 環境により出力形式が異なるため、テスト不可(デバッグ用なので、テストしなくてもよさそう) - /** - public function testSfPrintR__指定したオブジェクトの情報が出力される() - { - $output = '
' . "\n" - . '**デバッグ中**
' . "\n" - . '' . "\n" - . '**デバッグ中**
' . "\n"; + // public function testSfPrintR__指定したオブジェクトの情報が出力される() + // { + // $output = '
' . "\n" + // . '**デバッグ中**
' . "\n" + // . '' . "\n" + // . '**デバッグ中**
' . "\n"; + + // $this->expectOutputString($output); + // SC_Utils::sfPrintR(array('test'=>'TEST')); + // } - $this->expectOutputString($output); - SC_Utils::sfPrintR(array('test'=>'TEST')); - } - */ // //////////////////////////////////////// public function testDummyTest() { diff --git a/tests/class/util/SC_Utils/SC_Utils_sfSwapArrayTest.php b/tests/class/util/SC_Utils/SC_Utils_sfSwapArrayTest.php index 60d05ad078..0d777fa82a 100644 --- a/tests/class/util/SC_Utils/SC_Utils_sfSwapArrayTest.php +++ b/tests/class/util/SC_Utils/SC_Utils_sfSwapArrayTest.php @@ -47,14 +47,14 @@ protected function tearDown(): void public function testSfSwapArrayカラム名ありの指定の場合キーに名称が入る() { $input_array = [ - ['id' => '1001', 'name' => 'name1001'], - ['id' => '1002', 'name' => 'name1002'], - ]; + ['id' => '1001', 'name' => 'name1001'], + ['id' => '1002', 'name' => 'name1002'], + ]; $this->expected = [ - 'id' => ['1001', '1002'], - 'name' => ['name1001', 'name1002'], - ]; + 'id' => ['1001', '1002'], + 'name' => ['name1001', 'name1002'], + ]; $this->actual = SC_Utils::sfSwapArray($input_array); $this->verify(); @@ -63,14 +63,14 @@ public function testSfSwapArrayカラム名ありの指定の場合キーに名 public function testSfSwapArrayカラム名なしの指定の場合キーに名称が入らない() { $input_array = [ - ['id' => '1001', 'name' => 'name1001'], - ['id' => '1002', 'name' => 'name1002'], - ]; + ['id' => '1001', 'name' => 'name1001'], + ['id' => '1002', 'name' => 'name1002'], + ]; $this->expected = [ - ['1001', '1002'], - ['name1001', 'name1002'], - ]; + ['1001', '1002'], + ['name1001', 'name1002'], + ]; $this->actual = SC_Utils::sfSwapArray($input_array, false); $this->verify(); diff --git a/tests/require.php b/tests/require.php index fc6e779263..0e216392fd 100644 --- a/tests/require.php +++ b/tests/require.php @@ -5,7 +5,7 @@ /* テスト中 */ define('TEST_FUNCTION', true); -if (strpos($_SERVER['SCRIPT_FILENAME'], 'phpunit') !== false && !class_exists('\Eccube2\Tests\Fixture\Generator')) { +if (str_contains($_SERVER['SCRIPT_FILENAME'], 'phpunit') && !class_exists('\Eccube2\Tests\Fixture\Generator')) { echo 'You must set up the project dependencies, run the following commands:'.PHP_EOL. 'composer require nanasess/eccube2-fixture-generator --dev --ignore-platform-req=php'.PHP_EOL; exit(1); diff --git a/yarn.lock b/yarn.lock index 88f525b8f8..5312d922f4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -862,10 +862,10 @@ resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.57.1.tgz#de633db3ec2ef6a3c89e2f19038063e8a122e2c2" integrity sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q== -"@faker-js/faker@^9.2.0": - version "9.2.0" - resolved "https://registry.yarnpkg.com/@faker-js/faker/-/faker-9.2.0.tgz#269ee3a5d2442e88e10d984e106028422bcb9551" - integrity sha512-ulqQu4KMr1/sTFIYvqSdegHT8NIkt66tFAkugGnHA+1WAfEn6hMzNR+svjXGFRVLnapxvej67Z/LwchFrnLBUg== +"@faker-js/faker@^9.3.0": + version "9.3.0" + resolved "https://registry.yarnpkg.com/@faker-js/faker/-/faker-9.3.0.tgz#ef398dab34c67faaa0e348318c905eae3564fa58" + integrity sha512-r0tJ3ZOkMd9xsu3VRfqlFR6cz0V/jFYRswAIpC+m/DIfAUXq7g8N7wTAlhSANySXYGKzGryfDXwtwsY8TxEIDw== "@humanwhocodes/config-array@^0.13.0": version "0.13.0" @@ -990,7 +990,23 @@ dependencies: date-fns "*" -"@types/estree@^1.0.5": +"@types/eslint-scope@^3.7.7": + version "3.7.7" + resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.7.tgz#3108bd5f18b0cdb277c867b3dd449c9ed7079ac5" + integrity sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg== + dependencies: + "@types/eslint" "*" + "@types/estree" "*" + +"@types/eslint@*": + version "9.6.1" + resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-9.6.1.tgz#d5795ad732ce81715f27f75da913004a56751584" + integrity sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag== + dependencies: + "@types/estree" "*" + "@types/json-schema" "*" + +"@types/estree@*", "@types/estree@^1.0.6": version "1.0.6" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.6.tgz#628effeeae2064a1b4e79f78e81d87b7e5fc7b50" integrity sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw== @@ -1002,7 +1018,7 @@ dependencies: faker "*" -"@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": +"@types/json-schema@*", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": version "7.0.15" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== @@ -1121,125 +1137,125 @@ resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== -"@webassemblyjs/ast@1.12.1", "@webassemblyjs/ast@^1.12.1": - version "1.12.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.12.1.tgz#bb16a0e8b1914f979f45864c23819cc3e3f0d4bb" - integrity sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg== +"@webassemblyjs/ast@1.14.1", "@webassemblyjs/ast@^1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.14.1.tgz#a9f6a07f2b03c95c8d38c4536a1fdfb521ff55b6" + integrity sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ== dependencies: - "@webassemblyjs/helper-numbers" "1.11.6" - "@webassemblyjs/helper-wasm-bytecode" "1.11.6" + "@webassemblyjs/helper-numbers" "1.13.2" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" -"@webassemblyjs/floating-point-hex-parser@1.11.6": - version "1.11.6" - resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.6.tgz#dacbcb95aff135c8260f77fa3b4c5fea600a6431" - integrity sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw== +"@webassemblyjs/floating-point-hex-parser@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.13.2.tgz#fcca1eeddb1cc4e7b6eed4fc7956d6813b21b9fb" + integrity sha512-6oXyTOzbKxGH4steLbLNOu71Oj+C8Lg34n6CqRvqfS2O71BxY6ByfMDRhBytzknj9yGUPVJ1qIKhRlAwO1AovA== -"@webassemblyjs/helper-api-error@1.11.6": - version "1.11.6" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.6.tgz#6132f68c4acd59dcd141c44b18cbebbd9f2fa768" - integrity sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q== +"@webassemblyjs/helper-api-error@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.13.2.tgz#e0a16152248bc38daee76dd7e21f15c5ef3ab1e7" + integrity sha512-U56GMYxy4ZQCbDZd6JuvvNV/WFildOjsaWD3Tzzvmw/mas3cXzRJPMjP83JqEsgSbyrmaGjBfDtV7KDXV9UzFQ== -"@webassemblyjs/helper-buffer@1.12.1": - version "1.12.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.12.1.tgz#6df20d272ea5439bf20ab3492b7fb70e9bfcb3f6" - integrity sha512-nzJwQw99DNDKr9BVCOZcLuJJUlqkJh+kVzVl6Fmq/tI5ZtEyWT1KZMyOXltXLZJmDtvLCDgwsyrkohEtopTXCw== +"@webassemblyjs/helper-buffer@1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.14.1.tgz#822a9bc603166531f7d5df84e67b5bf99b72b96b" + integrity sha512-jyH7wtcHiKssDtFPRB+iQdxlDf96m0E39yb0k5uJVhFGleZFoNw1c4aeIcVUPPbXUVJ94wwnMOAqUHyzoEPVMA== -"@webassemblyjs/helper-numbers@1.11.6": - version "1.11.6" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.6.tgz#cbce5e7e0c1bd32cf4905ae444ef64cea919f1b5" - integrity sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g== +"@webassemblyjs/helper-numbers@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-numbers/-/helper-numbers-1.13.2.tgz#dbd932548e7119f4b8a7877fd5a8d20e63490b2d" + integrity sha512-FE8aCmS5Q6eQYcV3gI35O4J789wlQA+7JrqTTpJqn5emA4U2hvwJmvFRC0HODS+3Ye6WioDklgd6scJ3+PLnEA== dependencies: - "@webassemblyjs/floating-point-hex-parser" "1.11.6" - "@webassemblyjs/helper-api-error" "1.11.6" + "@webassemblyjs/floating-point-hex-parser" "1.13.2" + "@webassemblyjs/helper-api-error" "1.13.2" "@xtuc/long" "4.2.2" -"@webassemblyjs/helper-wasm-bytecode@1.11.6": - version "1.11.6" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.6.tgz#bb2ebdb3b83aa26d9baad4c46d4315283acd51e9" - integrity sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA== +"@webassemblyjs/helper-wasm-bytecode@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.13.2.tgz#e556108758f448aae84c850e593ce18a0eb31e0b" + integrity sha512-3QbLKy93F0EAIXLh0ogEVR6rOubA9AoZ+WRYhNbFyuB70j3dRdwH9g+qXhLAO0kiYGlg3TxDV+I4rQTr/YNXkA== -"@webassemblyjs/helper-wasm-section@1.12.1": - version "1.12.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.12.1.tgz#3da623233ae1a60409b509a52ade9bc22a37f7bf" - integrity sha512-Jif4vfB6FJlUlSbgEMHUyk1j234GTNG9dBJ4XJdOySoj518Xj0oGsNi59cUQF4RRMS9ouBUxDDdyBVfPTypa5g== +"@webassemblyjs/helper-wasm-section@1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.14.1.tgz#9629dda9c4430eab54b591053d6dc6f3ba050348" + integrity sha512-ds5mXEqTJ6oxRoqjhWDU83OgzAYjwsCV8Lo/N+oRsNDmx/ZDpqalmrtgOMkHwxsG0iI//3BwWAErYRHtgn0dZw== dependencies: - "@webassemblyjs/ast" "1.12.1" - "@webassemblyjs/helper-buffer" "1.12.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.6" - "@webassemblyjs/wasm-gen" "1.12.1" + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-buffer" "1.14.1" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" + "@webassemblyjs/wasm-gen" "1.14.1" -"@webassemblyjs/ieee754@1.11.6": - version "1.11.6" - resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.11.6.tgz#bb665c91d0b14fffceb0e38298c329af043c6e3a" - integrity sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg== +"@webassemblyjs/ieee754@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.13.2.tgz#1c5eaace1d606ada2c7fd7045ea9356c59ee0dba" + integrity sha512-4LtOzh58S/5lX4ITKxnAK2USuNEvpdVV9AlgGQb8rJDHaLeHciwG4zlGr0j/SNWlr7x3vO1lDEsuePvtcDNCkw== dependencies: "@xtuc/ieee754" "^1.2.0" -"@webassemblyjs/leb128@1.11.6": - version "1.11.6" - resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.11.6.tgz#70e60e5e82f9ac81118bc25381a0b283893240d7" - integrity sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ== +"@webassemblyjs/leb128@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.13.2.tgz#57c5c3deb0105d02ce25fa3fd74f4ebc9fd0bbb0" + integrity sha512-Lde1oNoIdzVzdkNEAWZ1dZ5orIbff80YPdHx20mrHwHrVNNTjNr8E3xz9BdpcGqRQbAEa+fkrCb+fRFTl/6sQw== dependencies: "@xtuc/long" "4.2.2" -"@webassemblyjs/utf8@1.11.6": - version "1.11.6" - resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.11.6.tgz#90f8bc34c561595fe156603be7253cdbcd0fab5a" - integrity sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA== - -"@webassemblyjs/wasm-edit@^1.12.1": - version "1.12.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.12.1.tgz#9f9f3ff52a14c980939be0ef9d5df9ebc678ae3b" - integrity sha512-1DuwbVvADvS5mGnXbE+c9NfA8QRcZ6iKquqjjmR10k6o+zzsRVesil54DKexiowcFCPdr/Q0qaMgB01+SQ1u6g== - dependencies: - "@webassemblyjs/ast" "1.12.1" - "@webassemblyjs/helper-buffer" "1.12.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.6" - "@webassemblyjs/helper-wasm-section" "1.12.1" - "@webassemblyjs/wasm-gen" "1.12.1" - "@webassemblyjs/wasm-opt" "1.12.1" - "@webassemblyjs/wasm-parser" "1.12.1" - "@webassemblyjs/wast-printer" "1.12.1" - -"@webassemblyjs/wasm-gen@1.12.1": - version "1.12.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.12.1.tgz#a6520601da1b5700448273666a71ad0a45d78547" - integrity sha512-TDq4Ojh9fcohAw6OIMXqiIcTq5KUXTGRkVxbSo1hQnSy6lAM5GSdfwWeSxpAo0YzgsgF182E/U0mDNhuA0tW7w== - dependencies: - "@webassemblyjs/ast" "1.12.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.6" - "@webassemblyjs/ieee754" "1.11.6" - "@webassemblyjs/leb128" "1.11.6" - "@webassemblyjs/utf8" "1.11.6" - -"@webassemblyjs/wasm-opt@1.12.1": - version "1.12.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.12.1.tgz#9e6e81475dfcfb62dab574ac2dda38226c232bc5" - integrity sha512-Jg99j/2gG2iaz3hijw857AVYekZe2SAskcqlWIZXjji5WStnOpVoat3gQfT/Q5tb2djnCjBtMocY/Su1GfxPBg== - dependencies: - "@webassemblyjs/ast" "1.12.1" - "@webassemblyjs/helper-buffer" "1.12.1" - "@webassemblyjs/wasm-gen" "1.12.1" - "@webassemblyjs/wasm-parser" "1.12.1" - -"@webassemblyjs/wasm-parser@1.12.1", "@webassemblyjs/wasm-parser@^1.12.1": - version "1.12.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.12.1.tgz#c47acb90e6f083391e3fa61d113650eea1e95937" - integrity sha512-xikIi7c2FHXysxXe3COrVUPSheuBtpcfhbpFj4gmu7KRLYOzANztwUU0IbsqvMqzuNK2+glRGWCEqZo1WCLyAQ== - dependencies: - "@webassemblyjs/ast" "1.12.1" - "@webassemblyjs/helper-api-error" "1.11.6" - "@webassemblyjs/helper-wasm-bytecode" "1.11.6" - "@webassemblyjs/ieee754" "1.11.6" - "@webassemblyjs/leb128" "1.11.6" - "@webassemblyjs/utf8" "1.11.6" - -"@webassemblyjs/wast-printer@1.12.1": - version "1.12.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.12.1.tgz#bcecf661d7d1abdaf989d8341a4833e33e2b31ac" - integrity sha512-+X4WAlOisVWQMikjbcvY2e0rwPsKQ9F688lksZhBcPycBBuii3O7m8FACbDMWDojpAqvjIncrG8J0XHKyQfVeA== - dependencies: - "@webassemblyjs/ast" "1.12.1" +"@webassemblyjs/utf8@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.13.2.tgz#917a20e93f71ad5602966c2d685ae0c6c21f60f1" + integrity sha512-3NQWGjKTASY1xV5m7Hr0iPeXD9+RDobLll3T9d2AO+g3my8xy5peVyjSag4I50mR1bBSN/Ct12lo+R9tJk0NZQ== + +"@webassemblyjs/wasm-edit@^1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.14.1.tgz#ac6689f502219b59198ddec42dcd496b1004d597" + integrity sha512-RNJUIQH/J8iA/1NzlE4N7KtyZNHi3w7at7hDjvRNm5rcUXa00z1vRz3glZoULfJ5mpvYhLybmVcwcjGrC1pRrQ== + dependencies: + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-buffer" "1.14.1" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" + "@webassemblyjs/helper-wasm-section" "1.14.1" + "@webassemblyjs/wasm-gen" "1.14.1" + "@webassemblyjs/wasm-opt" "1.14.1" + "@webassemblyjs/wasm-parser" "1.14.1" + "@webassemblyjs/wast-printer" "1.14.1" + +"@webassemblyjs/wasm-gen@1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.14.1.tgz#991e7f0c090cb0bb62bbac882076e3d219da9570" + integrity sha512-AmomSIjP8ZbfGQhumkNvgC33AY7qtMCXnN6bL2u2Js4gVCg8fp735aEiMSBbDR7UQIj90n4wKAFUSEd0QN2Ukg== + dependencies: + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" + "@webassemblyjs/ieee754" "1.13.2" + "@webassemblyjs/leb128" "1.13.2" + "@webassemblyjs/utf8" "1.13.2" + +"@webassemblyjs/wasm-opt@1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.14.1.tgz#e6f71ed7ccae46781c206017d3c14c50efa8106b" + integrity sha512-PTcKLUNvBqnY2U6E5bdOQcSM+oVP/PmrDY9NzowJjislEjwP/C4an2303MCVS2Mg9d3AJpIGdUFIQQWbPds0Sw== + dependencies: + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-buffer" "1.14.1" + "@webassemblyjs/wasm-gen" "1.14.1" + "@webassemblyjs/wasm-parser" "1.14.1" + +"@webassemblyjs/wasm-parser@1.14.1", "@webassemblyjs/wasm-parser@^1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.14.1.tgz#b3e13f1893605ca78b52c68e54cf6a865f90b9fb" + integrity sha512-JLBl+KZ0R5qB7mCnud/yyX08jWFw5MsoalJ1pQ4EdFlgj9VdXKGuENGsiCIjegI1W7p91rUlcB/LB5yRJKNTcQ== + dependencies: + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-api-error" "1.13.2" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" + "@webassemblyjs/ieee754" "1.13.2" + "@webassemblyjs/leb128" "1.13.2" + "@webassemblyjs/utf8" "1.13.2" + +"@webassemblyjs/wast-printer@1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.14.1.tgz#3bb3e9638a8ae5fdaf9610e7a06b4d9f9aa6fe07" + integrity sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw== + dependencies: + "@webassemblyjs/ast" "1.14.1" "@xtuc/long" "4.2.2" "@webpack-cli/configtest@^2.1.1": @@ -1267,20 +1283,15 @@ resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== -acorn-import-attributes@^1.9.5: - version "1.9.5" - resolved "https://registry.yarnpkg.com/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz#7eb1557b1ba05ef18b5ed0ec67591bfab04688ef" - integrity sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ== - acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== -acorn@^8.7.1, acorn@^8.8.2, acorn@^8.9.0: - version "8.13.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.13.0.tgz#2a30d670818ad16ddd6a35d3842dacec9e5d7ca3" - integrity sha512-8zSiw54Oxrdym50NlZ9sUusyO1Z1ZchgRLWRaK6c86XJFClyCgFKetdowBg5bKxyp/u+CDBJG4Mpp0m3HLZl9w== +acorn@^8.14.0, acorn@^8.8.2, acorn@^8.9.0: + version "8.14.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.14.0.tgz#063e2c70cac5fb4f6467f0b11152e04c682795b0" + integrity sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA== ajv-formats@^2.1.1: version "2.1.1" @@ -1543,7 +1554,7 @@ browser-sync-webpack-plugin@^2.3.0: dependencies: lodash "^4" -browserslist@^4.21.10, browserslist@^4.23.3, browserslist@^4.24.0: +browserslist@^4.23.3, browserslist@^4.24.0: version "4.24.2" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.24.2.tgz#f5845bc91069dbd55ee89faf9822e1d885d16580" integrity sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg== @@ -3928,10 +3939,10 @@ typed-array-length@^1.0.6: is-typed-array "^1.1.13" possible-typed-array-names "^1.0.0" -typescript@^5.6.3: - version "5.6.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.6.3.tgz#5f3449e31c9d94febb17de03cc081dd56d81db5b" - integrity sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw== +typescript@^5.7.2: + version "5.7.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.7.2.tgz#3169cf8c4c8a828cde53ba9ecb3d2b1d5dd67be6" + integrity sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg== unbox-primitive@^1.0.2: version "1.0.2" @@ -4055,18 +4066,18 @@ webpack-sources@^3.2.3: resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde" integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== -webpack@^5.95.0: - version "5.95.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.95.0.tgz#8fd8c454fa60dad186fbe36c400a55848307b4c0" - integrity sha512-2t3XstrKULz41MNMBF+cJ97TyHdyQ8HCt//pqErqDvNjU9YQBnZxIHa11VXsi7F3mb5/aO2tuDxdeTPdU7xu9Q== - dependencies: - "@types/estree" "^1.0.5" - "@webassemblyjs/ast" "^1.12.1" - "@webassemblyjs/wasm-edit" "^1.12.1" - "@webassemblyjs/wasm-parser" "^1.12.1" - acorn "^8.7.1" - acorn-import-attributes "^1.9.5" - browserslist "^4.21.10" +webpack@^5.97.1: + version "5.97.1" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.97.1.tgz#972a8320a438b56ff0f1d94ade9e82eac155fa58" + integrity sha512-EksG6gFY3L1eFMROS/7Wzgrii5mBAFe4rIr3r2BTfo7bcc+DWwFZ4OJ/miOuHJO/A85HwyI4eQ0F6IKXesO7Fg== + dependencies: + "@types/eslint-scope" "^3.7.7" + "@types/estree" "^1.0.6" + "@webassemblyjs/ast" "^1.14.1" + "@webassemblyjs/wasm-edit" "^1.14.1" + "@webassemblyjs/wasm-parser" "^1.14.1" + acorn "^8.14.0" + browserslist "^4.24.0" chrome-trace-event "^1.0.2" enhanced-resolve "^5.17.1" es-module-lexer "^1.2.1"