Changeset 3846961
- Timestamp:
- 12/06/2026 12:33:25 AM (11 hours ago)
- Location:
- qr-code-management/trunk
- Files:
-
- 76 added
- 35 deleted
- 31 edited
-
assets/css/admin.css (modified) (2 diffs)
-
assets/css/admin.css.map (deleted)
-
assets/css/admin.scss (deleted)
-
assets/images/sample_bg.png (deleted)
-
assets/js/block-editor.js (added)
-
assets/js/jsQR.js (deleted)
-
assets/js/jsQR.min.js (added)
-
assets/js/qr-scanner-redirect.js (modified) (1 diff)
-
includes/Admin.php (modified) (4 diffs)
-
includes/Block.php (added)
-
includes/Bulk_Download.php (added)
-
includes/CLI.php (added)
-
includes/Plugin.php (modified) (1 diff)
-
includes/Qr_Writer.php (added)
-
includes/Qrcode.php (modified) (14 diffs)
-
includes/Report.php (modified) (2 diffs)
-
includes/autoloader.php (modified) (2 diffs)
-
includes/compat (added)
-
includes/compat/ctype.php (added)
-
includes/compat/mbstring.php (added)
-
languages/qr-code-management-ja.mo (modified) ( previous)
-
languages/qr-code-management-ja.po (modified) (37 diffs)
-
languages/qr-code-management.pot (modified) (38 diffs)
-
qr-code-management.php (modified) (2 diffs)
-
readme.txt (modified) (4 diffs)
-
templates/admin-qrcm-setting.php (modified) (2 diffs)
-
templates/meta-box-qrcode-data.php (modified) (3 diffs)
-
vendor/bacon/bacon-qr-code/README.md (deleted)
-
vendor/bacon/bacon-qr-code/phpunit.xml.dist (deleted)
-
vendor/bacon/bacon-qr-code/test (deleted)
-
vendor/bin (deleted)
-
vendor/composer/autoload_classmap.php (modified) (1 diff)
-
vendor/composer/autoload_files.php (deleted)
-
vendor/composer/autoload_psr4.php (modified) (1 diff)
-
vendor/composer/autoload_real.php (modified) (1 diff)
-
vendor/composer/autoload_static.php (modified) (3 diffs)
-
vendor/composer/installed.json (modified) (4 diffs)
-
vendor/composer/installed.php (modified) (4 diffs)
-
vendor/dasprid/enum/README.md (deleted)
-
vendor/endroid/qr-code/.github (deleted)
-
vendor/endroid/qr-code/.gitignore (deleted)
-
vendor/endroid/qr-code/LICENSE (modified) (1 diff)
-
vendor/endroid/qr-code/README.md (deleted)
-
vendor/endroid/qr-code/assets/fonts (deleted)
-
vendor/endroid/qr-code/assets/images (deleted)
-
vendor/endroid/qr-code/assets/open_sans.ttf (added)
-
vendor/endroid/qr-code/composer.json (modified) (3 diffs)
-
vendor/endroid/qr-code/src/Bacon (added)
-
vendor/endroid/qr-code/src/Bacon/ErrorCorrectionLevelConverter.php (added)
-
vendor/endroid/qr-code/src/Bacon/MatrixFactory.php (added)
-
vendor/endroid/qr-code/src/Builder (added)
-
vendor/endroid/qr-code/src/Builder/Builder.php (added)
-
vendor/endroid/qr-code/src/Builder/BuilderInterface.php (added)
-
vendor/endroid/qr-code/src/Builder/BuilderRegistry.php (added)
-
vendor/endroid/qr-code/src/Builder/BuilderRegistryInterface.php (added)
-
vendor/endroid/qr-code/src/Color (added)
-
vendor/endroid/qr-code/src/Color/Color.php (added)
-
vendor/endroid/qr-code/src/Color/ColorInterface.php (added)
-
vendor/endroid/qr-code/src/Encoding (added)
-
vendor/endroid/qr-code/src/Encoding/Encoding.php (added)
-
vendor/endroid/qr-code/src/Encoding/EncodingInterface.php (added)
-
vendor/endroid/qr-code/src/ErrorCorrectionLevel (added)
-
vendor/endroid/qr-code/src/ErrorCorrectionLevel.php (deleted)
-
vendor/endroid/qr-code/src/ErrorCorrectionLevel/ErrorCorrectionLevelHigh.php (added)
-
vendor/endroid/qr-code/src/ErrorCorrectionLevel/ErrorCorrectionLevelInterface.php (added)
-
vendor/endroid/qr-code/src/ErrorCorrectionLevel/ErrorCorrectionLevelLow.php (added)
-
vendor/endroid/qr-code/src/ErrorCorrectionLevel/ErrorCorrectionLevelMedium.php (added)
-
vendor/endroid/qr-code/src/ErrorCorrectionLevel/ErrorCorrectionLevelQuartile.php (added)
-
vendor/endroid/qr-code/src/Exception/GenerateImageException.php (deleted)
-
vendor/endroid/qr-code/src/Exception/InvalidFontException.php (deleted)
-
vendor/endroid/qr-code/src/Exception/InvalidLogoException.php (deleted)
-
vendor/endroid/qr-code/src/Exception/InvalidWriterException.php (deleted)
-
vendor/endroid/qr-code/src/Exception/MissingExtensionException.php (deleted)
-
vendor/endroid/qr-code/src/Exception/MissingFunctionException.php (deleted)
-
vendor/endroid/qr-code/src/Exception/MissingLogoHeightException.php (deleted)
-
vendor/endroid/qr-code/src/Exception/QrCodeException.php (deleted)
-
vendor/endroid/qr-code/src/Exception/UnsupportedExtensionException.php (deleted)
-
vendor/endroid/qr-code/src/Exception/ValidationException.php (modified) (1 diff)
-
vendor/endroid/qr-code/src/Factory (deleted)
-
vendor/endroid/qr-code/src/ImageData (added)
-
vendor/endroid/qr-code/src/ImageData/LabelImageData.php (added)
-
vendor/endroid/qr-code/src/ImageData/LogoImageData.php (added)
-
vendor/endroid/qr-code/src/Label (added)
-
vendor/endroid/qr-code/src/Label/Alignment (added)
-
vendor/endroid/qr-code/src/Label/Alignment/LabelAlignmentCenter.php (added)
-
vendor/endroid/qr-code/src/Label/Alignment/LabelAlignmentInterface.php (added)
-
vendor/endroid/qr-code/src/Label/Alignment/LabelAlignmentLeft.php (added)
-
vendor/endroid/qr-code/src/Label/Alignment/LabelAlignmentRight.php (added)
-
vendor/endroid/qr-code/src/Label/Font (added)
-
vendor/endroid/qr-code/src/Label/Font/Font.php (added)
-
vendor/endroid/qr-code/src/Label/Font/FontInterface.php (added)
-
vendor/endroid/qr-code/src/Label/Font/NotoSans.php (added)
-
vendor/endroid/qr-code/src/Label/Font/OpenSans.php (added)
-
vendor/endroid/qr-code/src/Label/Label.php (added)
-
vendor/endroid/qr-code/src/Label/LabelInterface.php (added)
-
vendor/endroid/qr-code/src/Label/Margin (added)
-
vendor/endroid/qr-code/src/Label/Margin/Margin.php (added)
-
vendor/endroid/qr-code/src/Label/Margin/MarginInterface.php (added)
-
vendor/endroid/qr-code/src/LabelAlignment.php (deleted)
-
vendor/endroid/qr-code/src/Logo (added)
-
vendor/endroid/qr-code/src/Logo/Logo.php (added)
-
vendor/endroid/qr-code/src/Logo/LogoInterface.php (added)
-
vendor/endroid/qr-code/src/Matrix (added)
-
vendor/endroid/qr-code/src/Matrix/Matrix.php (added)
-
vendor/endroid/qr-code/src/Matrix/MatrixFactoryInterface.php (added)
-
vendor/endroid/qr-code/src/Matrix/MatrixInterface.php (added)
-
vendor/endroid/qr-code/src/QrCode.php (modified) (3 diffs)
-
vendor/endroid/qr-code/src/QrCodeInterface.php (modified) (2 diffs)
-
vendor/endroid/qr-code/src/RoundBlockSizeMode (added)
-
vendor/endroid/qr-code/src/RoundBlockSizeMode/RoundBlockSizeModeEnlarge.php (added)
-
vendor/endroid/qr-code/src/RoundBlockSizeMode/RoundBlockSizeModeInterface.php (added)
-
vendor/endroid/qr-code/src/RoundBlockSizeMode/RoundBlockSizeModeMargin.php (added)
-
vendor/endroid/qr-code/src/RoundBlockSizeMode/RoundBlockSizeModeNone.php (added)
-
vendor/endroid/qr-code/src/RoundBlockSizeMode/RoundBlockSizeModeShrink.php (added)
-
vendor/endroid/qr-code/src/WritableInterface.php (added)
-
vendor/endroid/qr-code/src/Writer/AbstractWriter.php (deleted)
-
vendor/endroid/qr-code/src/Writer/BinaryWriter.php (modified) (1 diff)
-
vendor/endroid/qr-code/src/Writer/ConsoleWriter.php (added)
-
vendor/endroid/qr-code/src/Writer/DebugWriter.php (modified) (1 diff)
-
vendor/endroid/qr-code/src/Writer/EpsWriter.php (modified) (1 diff)
-
vendor/endroid/qr-code/src/Writer/FpdfWriter.php (deleted)
-
vendor/endroid/qr-code/src/Writer/PdfWriter.php (added)
-
vendor/endroid/qr-code/src/Writer/PngWriter.php (modified) (2 diffs)
-
vendor/endroid/qr-code/src/Writer/Result (added)
-
vendor/endroid/qr-code/src/Writer/Result/AbstractResult.php (added)
-
vendor/endroid/qr-code/src/Writer/Result/BinaryResult.php (added)
-
vendor/endroid/qr-code/src/Writer/Result/ConsoleResult.php (added)
-
vendor/endroid/qr-code/src/Writer/Result/DebugResult.php (added)
-
vendor/endroid/qr-code/src/Writer/Result/EpsResult.php (added)
-
vendor/endroid/qr-code/src/Writer/Result/PdfResult.php (added)
-
vendor/endroid/qr-code/src/Writer/Result/PngResult.php (added)
-
vendor/endroid/qr-code/src/Writer/Result/ResultInterface.php (added)
-
vendor/endroid/qr-code/src/Writer/Result/SvgResult.php (added)
-
vendor/endroid/qr-code/src/Writer/SvgWriter.php (modified) (1 diff)
-
vendor/endroid/qr-code/src/Writer/ValidatingWriterInterface.php (added)
-
vendor/endroid/qr-code/src/Writer/WriterInterface.php (modified) (1 diff)
-
vendor/endroid/qr-code/src/WriterRegistry.php (deleted)
-
vendor/endroid/qr-code/src/WriterRegistryInterface.php (deleted)
-
vendor/endroid/qr-code/tests (deleted)
-
vendor/khanamiryan (deleted)
-
vendor/myclabs (deleted)
-
vendor/symfony (deleted)
Legend:
- Unmodified
- Added
- Removed
-
qr-code-management/trunk/assets/css/admin.css
r3610648 r3846961 82 82 #rwcqrcm_qrdata_contact:checked ~ #rwcqrcm_qrdata_contact_content, 83 83 #rwcqrcm_qrdata_event:checked ~ #rwcqrcm_qrdata_event_content, 84 #rwcqrcm_qrdata_free:checked ~ #rwcqrcm_qrdata_free_content { 84 #rwcqrcm_qrdata_free:checked ~ #rwcqrcm_qrdata_free_content, 85 #rwcqrcm_qrdata_wifi:checked ~ #rwcqrcm_qrdata_wifi_content { 85 86 display: block; 86 87 } … … 137 138 } 138 139 139 /*# sourceMappingURL=admin.css.map */ -
qr-code-management/trunk/assets/js/qr-scanner-redirect.js
r3787869 r3846961 3 3 * 4 4 * カメラで QR コードを読み取り、URL であれば確認のうえリダイレクトする。 5 * 読み取りには jsQR(assets/js/jsQR. js。enqueue の依存として先に読み込まれる)を使う。5 * 読み取りには jsQR(assets/js/jsQR.min.js。enqueue の依存として先に読み込まれる)を使う。 6 6 * 設定・文言はサーバー側(RWC_Qrcode::qrcm_scanner_shortcode)が 7 7 * window.qrcmscannerredirect.settings で渡す。 -
qr-code-management/trunk/includes/Admin.php
r3802279 r3846961 185 185 } 186 186 187 // 短縮 URL の転送先に付ける UTM(1.8.0〜)。有効は on のみ、値は 1 行・100 文字まで 188 if ( is_array( $value ) && isset( $value['redirect']['utm'] ) ) { 189 $utm = is_array( $value['redirect']['utm'] ) ? $value['redirect']['utm'] : array(); 190 191 $value['redirect']['utm'] = array( 192 'source' => isset( $utm['source'] ) ? RWC_Qrcode::sanitize_utm_value( $utm['source'] ) : '', 193 'medium' => isset( $utm['medium'] ) ? RWC_Qrcode::sanitize_utm_value( $utm['medium'] ) : '', 194 'campaign' => isset( $utm['campaign'] ) ? RWC_Qrcode::sanitize_utm_value( $utm['campaign'] ) : '', 195 ); 196 if ( isset( $utm['enabled'] ) && 'on' === $utm['enabled'] ) { 197 $value['redirect']['utm']['enabled'] = 'on'; 198 } 199 } 200 187 201 return $value; 188 202 } … … 277 291 278 292 /** 279 * 管理画面のスタイルを読み込む 280 */ 281 public function my_admin_style() { 282 wp_enqueue_style( 'wp-color-picker' ); 293 * この画面で読み込む管理画面のアセットの範囲を返す 294 * 295 * 以前はすべての管理画面で CSS・JS 5 本・メディアライブラリ・カラーピッカーを読み込んでいた。 296 * QR コードを編集する画面(対象の投稿タイプの編集・プロフィール・設定画面)だけで全部を、 297 * QR コードの列を出す一覧とレポート画面では CSS だけを読み込む。 298 * 299 * @param string $hook_suffix 画面のフック名(admin_enqueue_scripts の引数)。 300 * @return string full(CSS と JS)/ css(CSS のみ)/ 空(読み込まない)。 301 */ 302 public static function asset_scope( $hook_suffix ) { 303 $settings = self::get_settings(); 304 $post_types = isset( $settings['role']['post_type'] ) ? array_keys( (array) $settings['role']['post_type'] ) : array(); 305 // QR コード管理の投稿タイプ(独自の QR コード)は常に対象 306 $post_types[] = 'rwcqrcm'; 307 $profile = isset( $settings['role']['user']['profile'] ); 308 309 $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : null; 310 $post_type = $screen && isset( $screen->post_type ) ? (string) $screen->post_type : ''; 311 $screen_id = $screen && isset( $screen->id ) ? (string) $screen->id : ''; 312 313 if ( in_array( $hook_suffix, array( 'post.php', 'post-new.php' ), true ) && in_array( $post_type, $post_types, true ) ) { 314 return 'full'; 315 } 316 if ( $profile && in_array( $hook_suffix, array( 'profile.php', 'user-edit.php' ), true ) ) { 317 return 'full'; 318 } 319 if ( 'rwcqrcm_page_rwcqrcm-setting' === $screen_id ) { 320 return 'full'; 321 } 322 if ( 'edit.php' === $hook_suffix && in_array( $post_type, $post_types, true ) ) { 323 return 'css'; 324 } 325 if ( $profile && 'users.php' === $hook_suffix ) { 326 return 'css'; 327 } 328 if ( 'rwcqrcm_page_' . Report::PAGE_SLUG === $screen_id ) { 329 return 'css'; 330 } 331 332 return ''; 333 } 334 335 /** 336 * 管理画面のスタイルを読み込む(QR コードを扱う画面だけ) 337 * 338 * @param string $hook_suffix 画面のフック名。 339 */ 340 public function my_admin_style( $hook_suffix = '' ) { 341 $scope = self::asset_scope( (string) $hook_suffix ); 342 if ( '' === $scope ) { 343 return; 344 } 345 346 if ( 'full' === $scope ) { 347 wp_enqueue_style( 'wp-color-picker' ); 348 } 283 349 wp_enqueue_style( 284 350 'rwcqrcm-admin_style', … … 292 358 /** 293 359 * 管理画面のスクリプト(メディアアップローダー・カラーピッカー・QR エディター)を読み込む 294 */ 295 public function my_admin_scripts() { 360 * 361 * QR コードを編集する画面(対象の投稿タイプの編集・プロフィール・設定画面)だけで読み込む。 362 * 版は毎回の filemtime() ではなくプラグインの版にする。 363 * 364 * @param string $hook_suffix 画面のフック名。 365 */ 366 public function my_admin_scripts( $hook_suffix = '' ) { 367 if ( 'full' !== self::asset_scope( (string) $hook_suffix ) ) { 368 return; 369 } 370 296 371 wp_enqueue_media(); 297 372 wp_enqueue_script( 'wp-color-picker' ); … … 312 387 plugins_url( $file, Plugin::PLUGIN_BASEFILE ), 313 388 $deps, 314 filemtime( dirname( Plugin::PLUGIN_BASEFILE ) . $file ),389 RWCQRCM_VERSION, 315 390 true 316 391 ); -
qr-code-management/trunk/includes/Plugin.php
r3743259 r3846961 74 74 $this->report = new Report(); 75 75 76 // 投稿一覧の一括操作(ZIP)は管理画面でだけ使う 77 if ( is_admin() ) { 78 new Bulk_Download( $this->qrcode ); 79 } 80 new Block( $this->qrcode ); 81 82 if ( defined( 'WP_CLI' ) && WP_CLI ) { 83 \WP_CLI::add_command( 'qrcm', CLI::class ); 84 } 85 76 86 add_action( 'widgets_init', array( $this, 'register_widgets' ) ); 77 87 } -
qr-code-management/trunk/includes/Qrcode.php
r3845962 r3846961 4 4 5 5 use RWC\QRCM\Plugin; 6 use Endroid\QrCode\ErrorCorrectionLevel;7 use Endroid\QrCode\LabelAlignment;8 use Endroid\QrCode\QrCode;9 6 10 7 /** … … 43 40 /** 改行を保持したまま保存するフィールド名(テキストエリア) */ 44 41 const MULTILINE_KEYS = array( 'freeinput' ); 42 43 /** Wi-Fi の暗号方式(WIFI: 形式の T: の値) */ 44 const WIFI_ENCRYPTIONS = array( 'WPA', 'WEP', 'nopass' ); 45 46 /** Wi-Fi の SSID・パスワードの最大文字数(SSID は 32 バイト、WPA のパスフレーズは 63 文字まで) */ 47 const WIFI_MAX_LENGTH = 64; 48 49 /** UTM の値の最大文字数 */ 50 const UTM_MAX_LENGTH = 100; 45 51 46 52 /** QR コードデータのフィールド名(メタキー rwcqrcm_qrdata_* の接尾辞) */ … … 71 77 // free 72 78 'free_freeinput', 79 // wifi(1.8.0〜) 80 'wifi_ssid', 81 'wifi_encryption', 82 'wifi_password', 83 'wifi_hidden', 73 84 ); 74 85 … … 250 261 if ( ! $permalink ) { 251 262 // URL が未設定なら投稿者アーカイブへ戻す 252 wp_safe_redirect( get_author_posts_url( $target['id']) );263 wp_safe_redirect( $this->redirect_destination( get_author_posts_url( $target['id'] ), $target ) ); 253 264 exit; 254 265 } 255 266 // phpcs:ignore WordPress.Security.SafeRedirect.wp_redirect_wp_redirect -- QR コードの転送先は外部サイトを指定できる仕様のため wp_safe_redirect は使えない。URL は編集権限を持つユーザーが入力したもの。 256 wp_redirect( $ permalink, 302 );267 wp_redirect( $this->redirect_destination( $permalink, $target ), 302 ); 257 268 exit; 258 269 } … … 263 274 // URL が未設定(連絡先・フリー入力など URL 以外のデータ)なら空の転送で 264 275 // 白紙のページになるため、サイトのトップへ戻す 265 wp_safe_redirect( home_url( '/') );276 wp_safe_redirect( $this->redirect_destination( home_url( '/' ), $target ) ); 266 277 exit; 267 278 } 268 279 // phpcs:ignore WordPress.Security.SafeRedirect.wp_redirect_wp_redirect -- QR コードの転送先は外部サイトを指定できる仕様のため wp_safe_redirect は使えない。URL は編集権限を持つユーザーが入力したもの。 269 wp_redirect( $ permalink, 302 );280 wp_redirect( $this->redirect_destination( $permalink, $target ), 302 ); 270 281 exit; 271 282 } 272 283 273 284 $permalink = get_permalink( $target['id'] ); 274 wp_safe_redirect( $ permalink ? $permalink : home_url( '/') );285 wp_safe_redirect( $this->redirect_destination( $permalink ? $permalink : home_url( '/' ), $target ) ); 275 286 exit; 287 } 288 289 /** 290 * 転送先の URL を仕上げる(UTM パラメーターの付与とフィルター) 291 * 292 * 設定で UTM の付与を有効にしていれば utm_source / utm_medium / utm_campaign を付ける。 293 * 転送先の URL に同じ名前のパラメーターが既にあれば、そちらを優先して上書きしない。 294 * DB の読み書きはしない(設定は読み込み済みのオプション)。 295 * 296 * @param string $url 転送先の URL。 297 * @param array $target 転送元の対象(type: post / user、id)。 298 * @return string 転送先の URL。 299 */ 300 private function redirect_destination( $url, $target ) { 301 $url = self::add_utm_parameters( (string) $url, self::utm_settings( $this->option ) ); 302 303 /** 304 * 短縮 URL(?qrc=)の転送先を変える 305 * 306 * @since 1.8.0 307 * 308 * @param string $url 転送先の URL(UTM パラメーターを付けた後)。 309 * @param array $target 転送元の対象(type: post / user、id)。 310 */ 311 $filtered = apply_filters( 'rwcqrcm_redirect_url', $url, $target ); 312 313 return is_string( $filtered ) && '' !== $filtered ? $filtered : $url; 314 } 315 316 /** 317 * 設定から UTM の付与の設定を取り出す 318 * 319 * @param mixed $option プラグイン設定(rwc_qrcm オプション)。 320 * @return array|null 有効なら source / medium / campaign、無効なら null。 321 */ 322 public static function utm_settings( $option ) { 323 if ( ! is_array( $option ) || ! isset( $option['redirect']['utm']['enabled'] ) || 'on' !== $option['redirect']['utm']['enabled'] ) { 324 return null; 325 } 326 327 $utm = $option['redirect']['utm']; 328 329 return array( 330 'source' => isset( $utm['source'] ) ? self::sanitize_utm_value( $utm['source'] ) : 'qr', 331 'medium' => isset( $utm['medium'] ) ? self::sanitize_utm_value( $utm['medium'] ) : 'qrcode', 332 'campaign' => isset( $utm['campaign'] ) ? self::sanitize_utm_value( $utm['campaign'] ) : '', 333 ); 334 } 335 336 /** 337 * UTM の値を保存・使用できる形にする(1 行のテキスト、上限 100 文字) 338 * 339 * @param mixed $value 入力値。 340 * @return string 値。 341 */ 342 public static function sanitize_utm_value( $value ) { 343 if ( ! is_scalar( $value ) ) { 344 return ''; 345 } 346 $value = sanitize_text_field( (string) $value ); 347 348 return function_exists( 'mb_substr' ) ? mb_substr( $value, 0, self::UTM_MAX_LENGTH, 'UTF-8' ) : substr( $value, 0, self::UTM_MAX_LENGTH ); 349 } 350 351 /** 352 * URL に UTM パラメーターを付ける 353 * 354 * @param string $url URL。 355 * @param array|null $utm source / medium / campaign(null なら何もしない)。 356 * @return string URL。 357 */ 358 public static function add_utm_parameters( $url, $utm ) { 359 if ( ! $utm || '' === $url ) { 360 return $url; 361 } 362 363 $existing = array(); 364 $query = wp_parse_url( $url, PHP_URL_QUERY ); 365 if ( is_string( $query ) && '' !== $query ) { 366 parse_str( $query, $existing ); 367 } 368 369 $args = array(); 370 foreach ( array( 'source', 'medium', 'campaign' ) as $name ) { 371 if ( isset( $utm[ $name ] ) && '' !== $utm[ $name ] && ! isset( $existing[ 'utm_' . $name ] ) ) { 372 $args[ 'utm_' . $name ] = rawurlencode( $utm[ $name ] ); 373 } 374 } 375 376 return $args ? add_query_arg( $args, $url ) : $url; 276 377 } 277 378 … … 386 487 * @param int $post_id 投稿 ID またはユーザー ID。 387 488 * @param string $type post または user。 489 * @return string fresh(最新のため生成しなかった)/ created(生成した)/ failed(生成に失敗・前回も失敗)。 388 490 */ 389 491 public function ensure_qrcode( $post_id, $type ) { … … 393 495 $stored = $this->get_qrcode_meta( $post_id, self::HASH_META_KEY, $type ); 394 496 if ( $stored === $signature && $this->qrcode_files_exist( $post_id, $type ) ) { 395 return ;497 return 'fresh'; 396 498 } 397 499 // 前回と同じ内容で生成に失敗している(データが大きすぎる等)なら再試行しない 398 500 if ( 'error:' . $signature === $stored ) { 399 return; 400 } 401 402 $this->create_qrcode( $post_id, $type ); 501 return 'failed'; 502 } 503 504 return $this->create_qrcode( $post_id, $type ) ? 'created' : 'failed'; 505 } 506 507 /** 508 * 生成済みの QR コード画像が最新か(生成はしない) 509 * 510 * まとめてダウンロードは、この判定が true の投稿の画像だけを使う(新しく作らない)。 511 * 512 * @param int $post_id 投稿 ID またはユーザー ID。 513 * @param string $type post または user。 514 * @return bool 署名が今の内容と一致し、有効な形式のファイルが揃っていれば true。 515 */ 516 public function is_qrcode_fresh( $post_id, $type ) { 517 $signature = $this->qrcode_signature( $post_id, $type, $this->get_qrcode_data( $post_id, $type ) ); 518 519 return $this->get_qrcode_meta( $post_id, self::HASH_META_KEY, $type ) === $signature && $this->qrcode_files_exist( $post_id, $type ); 520 } 521 522 /** 523 * 生成済みの QR コード画像のパスを返す(生成はしない) 524 * 525 * @param int $post_id 投稿 ID またはユーザー ID。 526 * @param string $type post または user。 527 * @param string $format svg / png / eps / jpg。 528 * @return string ファイルのパス。リダイレクトコードが未発行なら空文字。 529 */ 530 public function qrcode_file_path( $post_id, $type, $format ) { 531 $code = (string) $this->get_qrcode_meta( $post_id, 'rwc_qrcm_redirect_code', $type ); 532 if ( '' === $code || ! in_array( $format, array( 'svg', 'png', 'eps', 'jpg' ), true ) ) { 533 return ''; 534 } 535 536 return $this->qrcode_dir( $type ) . (int) $post_id . '/' . $code . '.' . $format; 537 } 538 539 /** 540 * 有効な出力形式(設定画面の「出力形式」)を返す 541 * 542 * @return string[] svg / png / eps / jpg のうち有効なもの。 543 */ 544 public function enabled_formats() { 545 $formats = isset( $this->option['output']['format'] ) ? array_keys( (array) $this->option['output']['format'] ) : array(); 546 547 return array_values( array_intersect( array( 'png', 'svg', 'eps', 'jpg' ), $formats ) ); 548 } 549 550 /** 551 * 現在のユーザーが QR コードの機能を使える権限グループか(設定画面の「利用できる権限」) 552 * 553 * @return bool 使えるなら true。 554 */ 555 public function current_user_has_allowed_role() { 556 $allowed_roles = isset( $this->option['role']['roles'] ) ? array_keys( (array) $this->option['role']['roles'] ) : array(); 557 558 return (bool) array_intersect( wp_get_current_user()->roles, $allowed_roles ); 559 } 560 561 /** 562 * QR コードを発行する投稿タイプか(設定画面の「カスタム投稿タイプ」) 563 * 564 * @param string $post_type 投稿タイプ。 565 * @return bool 対象なら true。 566 */ 567 public function is_enabled_post_type( $post_type ) { 568 return isset( $this->option['role']['post_type'][ (string) $post_type ] ); 569 } 570 571 /** 572 * ユーザーのプロフィールで QR コードを使う設定か 573 * 574 * @return bool 使うなら true。 575 */ 576 public function is_profile_enabled() { 577 return isset( $this->option['role']['user']['profile'] ); 403 578 } 404 579 … … 597 772 * @var $rwcqrcm_qrdata_event_dtend 598 773 * @var $rwcqrcm_qrdata_free_freeinput 774 * @var $rwcqrcm_qrdata_wifi_ssid 775 * @var $rwcqrcm_qrdata_wifi_encryption 776 * @var $rwcqrcm_qrdata_wifi_password 777 * @var $rwcqrcm_qrdata_wifi_hidden 599 778 */ 600 779 $rwc_qrcm_redirect_code = $this->get_redirect_code( $post_id, $type ); … … 669 848 670 849 return $rwcqrcm_qrdata_free_freeinput; 850 } elseif ( 'wifi' === $rwcqrcm_qrdata_type_type ) { 851 // wifi(1.8.0〜) 852 return self::build_wifi( 853 $rwcqrcm_qrdata_wifi_ssid, 854 $rwcqrcm_qrdata_wifi_encryption, 855 $rwcqrcm_qrdata_wifi_password, 856 'on' === $rwcqrcm_qrdata_wifi_hidden 857 ); 671 858 } 672 859 … … 768 955 769 956 return "BEGIN:VCARD\r\nVERSION:3.0\r\n" . implode( "\r\n", $lines ) . "\r\nEND:VCARD"; 957 } 958 959 /** 960 * Wi-Fi の接続情報(WIFI: 形式)を組み立てる 961 * 962 * 形式は ZXing の「Wi-Fi Network config」: WIFI:T:<暗号方式>;S:<SSID>;P:<パスワード>;H:true;; 963 * SSID・パスワードの中の \ ; , : " は \ でエスケープする。暗号方式が nopass(パスワードなし)なら P: を出さない。 964 * SSID が空なら空文字を返す(URL が未入力のときと同じ扱い)。 965 * 966 * @param mixed $ssid SSID。 967 * @param mixed $encryption 暗号方式(WPA / WEP / nopass。不明な値は WPA)。 968 * @param mixed $password パスワード。 969 * @param bool $hidden SSID を隠しているネットワークなら true。 970 * @return string WIFI: 形式の文字列。 971 */ 972 public static function build_wifi( $ssid, $encryption, $password, $hidden = false ) { 973 $ssid = (string) $ssid; 974 if ( '' === $ssid ) { 975 return ''; 976 } 977 978 $encryption = in_array( $encryption, self::WIFI_ENCRYPTIONS, true ) ? $encryption : 'WPA'; 979 980 $escape = function ( $value ) { 981 return preg_replace( '/([\\\\;,:"])/', '\\\\$1', (string) $value ); 982 }; 983 984 $text = 'WIFI:T:' . $encryption . ';S:' . $escape( $ssid ) . ';'; 985 if ( 'nopass' !== $encryption && '' !== (string) $password ) { 986 $text .= 'P:' . $escape( $password ) . ';'; 987 } 988 if ( $hidden ) { 989 $text .= 'H:true;'; 990 } 991 992 return $text . ';'; 993 } 994 995 /** 996 * Wi-Fi の SSID・パスワードを保存できる形にする 997 * 998 * sanitize_text_field() はタグ・%xx・連続する空白を取り除き、パスワードが変わってしまうため使わない。 999 * 不正な UTF-8 と制御文字だけを取り除き、長さを上限で切る(前後の空白も値として残す)。 1000 * 1001 * @param mixed $value 入力値。 1002 * @return string 保存する値。 1003 */ 1004 public static function sanitize_wifi_text( $value ) { 1005 $value = wp_check_invalid_utf8( (string) $value ); 1006 $value = (string) preg_replace( '/[\x00-\x1F\x7F]/', '', $value ); 1007 1008 return function_exists( 'mb_substr' ) ? mb_substr( $value, 0, self::WIFI_MAX_LENGTH, 'UTF-8' ) : substr( $value, 0, self::WIFI_MAX_LENGTH ); 1009 } 1010 1011 /** 1012 * 送信された Wi-Fi のパスワードの扱いを決める 1013 * 1014 * 保存済みのパスワードは画面に出さない(入力欄は空で表示する)。そのため、空のまま保存されたら 1015 * 保存済みの値を残し、「パスワードを消す」にチェックがあるとき・「パスワードなし」にしたときだけ消す。 1016 * 1017 * @param array $qrdata 送信された qrdata(サニタイズ済み)。 1018 * @return array パスワードを残すときは wifi.password を取り除き、消すときは空にした qrdata。 1019 */ 1020 private static function apply_wifi_password_rules( $qrdata ) { 1021 if ( ! isset( $qrdata['wifi'] ) || ! is_array( $qrdata['wifi'] ) ) { 1022 return $qrdata; 1023 } 1024 1025 $clear = isset( $qrdata['wifi']['password_clear'] ) && 'on' === $qrdata['wifi']['password_clear']; 1026 unset( $qrdata['wifi']['password_clear'] ); 1027 // 「パスワードなし」では使わないパスワードを保存したままにしない 1028 if ( isset( $qrdata['wifi']['encryption'] ) && 'nopass' === $qrdata['wifi']['encryption'] ) { 1029 $clear = true; 1030 } 1031 1032 if ( $clear ) { 1033 $qrdata['wifi']['password'] = ''; 1034 } elseif ( ! isset( $qrdata['wifi']['password'] ) || '' === (string) $qrdata['wifi']['password'] ) { 1035 unset( $qrdata['wifi']['password'] ); 1036 } 1037 1038 return $qrdata; 770 1039 } 771 1040 … … 814 1083 $file_base = $this->qrcode_dir( $type ) . $post_id . '/' . $rwc_qrcm_redirect_code; 815 1084 816 $ qr_code = new QrCode( $data );1085 $text = (string) $data; 817 1086 818 1087 $data = $this->get_create_settings( $type, $post_id ); 819 1088 extract( $data ); 820 1089 821 // サイズ・余白・ロゴの寸法は get_create_settings() で整数の範囲に収めてある 822 if ( $rwcqrcm_qrsettings_size_width ) { 823 $qr_code->setSize( (int) $rwcqrcm_qrsettings_size_width ); 824 } 825 826 // 余白は 0 も指定できる(未入力のときだけ endroid の既定値 10 を使う) 827 if ( '' !== (string) $rwcqrcm_qrsettings_margin && is_numeric( $rwcqrcm_qrsettings_margin ) ) { 828 $qr_code->setMargin( max( 0, (int) $rwcqrcm_qrsettings_margin ) ); 829 } 830 831 if ( $rwcqrcm_qrsettings_correction_level && in_array( 832 $rwcqrcm_qrsettings_correction_level, 833 array( 834 'LOW', 835 'MEDIUM', 836 'QUARTILE', 837 'HIGH', 838 ), 839 true 840 ) ) { 841 $qr_code->setErrorCorrectionLevel( ErrorCorrectionLevel::{$rwcqrcm_qrsettings_correction_level}() ); 842 } 843 844 // サイズがモジュール(点)の数より小さいと 1 点が 0px になり、GD が ValueError(致命的エラー)を出す。 845 // 1 点 1px になるサイズまで広げる(データが大きすぎる場合は getData() が例外を投げ、create_qrcode() が捕捉する)。 846 $rwcqrcm_qr_matrix = $qr_code->getData(); 847 if ( $rwcqrcm_qr_matrix['block_size'] < 1 ) { 848 $qr_code->setSize( (int) $rwcqrcm_qr_matrix['block_count'] ); 849 } 850 1090 // サイズ・余白・ロゴの寸法は get_create_settings() で整数の範囲に収めてある。 1091 // 生成は Qr_Writer(endroid/qr-code 4.x)が 1.7.2 まで(3.9.7)と同じ画像になるように行う。 1092 $options = array( 1093 'size' => $rwcqrcm_qrsettings_size_width ? (int) $rwcqrcm_qrsettings_size_width : 0, 1094 // 余白は 0 も指定できる(未入力のときだけ既定値 10 を使う) 1095 'margin' => '' !== (string) $rwcqrcm_qrsettings_margin && is_numeric( $rwcqrcm_qrsettings_margin ) ? max( 0, (int) $rwcqrcm_qrsettings_margin ) : null, 1096 'font_path' => plugin_dir_path( RWCQRCM_PLUGIN_MAIN_FILE ) . 'vendor/endroid/qr-code/assets/open_sans.ttf', 1097 ); 1098 1099 if ( in_array( $rwcqrcm_qrsettings_correction_level, array( 'LOW', 'MEDIUM', 'QUARTILE', 'HIGH' ), true ) ) { 1100 $options['correction_level'] = $rwcqrcm_qrsettings_correction_level; 1101 } 1102 1103 // フォントは open_sans.ttf を明示する。endroid 既定の noto_sans.otf(約 16MB)は 1104 // 配布サイズ削減のため同梱していない(plugin-deps/prune-vendor.php で削除している)。 851 1105 if ( $rwcqrcm_qrsettings_label ) { 852 // フォントは open_sans.ttf を明示する。endroid の既定(noto_sans.otf、約 16MB)は 853 // 配布サイズ削減のため同梱していない(plugin-deps の post-install で削除している)。 854 $qr_code->setLabel( 855 $rwcqrcm_qrsettings_label, 856 16, 857 plugin_dir_path( RWCQRCM_PLUGIN_MAIN_FILE ) . 'vendor/endroid/qr-code/assets/fonts/open_sans.ttf', 858 LabelAlignment::CENTER() 859 ); 860 } 861 862 // 色コードとして解釈できない値(手入力の誤りなど)は無視し、endroid の既定色(黒 / 白)を使う。 863 // 以前は不正な値がそのまま 16 進変換され、意図しない色(多くは黒)になっていた。 864 $rwcqrcm_foreground_rgb = self::parse_hex_color( $rwcqrcm_qrsettings_color ); 865 if ( null !== $rwcqrcm_foreground_rgb ) { 866 $qr_code->setForegroundColor( $rwcqrcm_foreground_rgb + array( 'a' => 1 ) ); 867 } 868 869 $rwcqrcm_background_rgb = self::parse_hex_color( $rwcqrcm_qrsettings_background_color ); 870 if ( null !== $rwcqrcm_background_rgb ) { 871 $qr_code->setBackgroundColor( $rwcqrcm_background_rgb + array( 'a' => 1 ) ); 872 } 873 874 $rwcqrcm_qrsettings_logo_path = ''; 1106 $options['label'] = (string) $rwcqrcm_qrsettings_label; 1107 } 1108 1109 // 色コードとして解釈できない値(手入力の誤りなど)は無視し、既定色(黒 / 白)を使う。 1110 $options['foreground'] = self::parse_hex_color( $rwcqrcm_qrsettings_color ); 1111 $options['background'] = self::parse_hex_color( $rwcqrcm_qrsettings_background_color ); 1112 875 1113 if ( $rwcqrcm_qrsettings_logo ) { 876 1114 $rwcqrcm_qrsettings_logo_path = get_attached_file( $rwcqrcm_qrsettings_logo ); 877 } 878 879 if ( $rwcqrcm_qrsettings_logo_path && file_exists( $rwcqrcm_qrsettings_logo_path ) ) { 880 try { 881 $qr_code->setLogoPath( $rwcqrcm_qrsettings_logo_path ); 882 } catch ( \Exception $e ) { 883 // ロゴ画像が読み込めない場合はロゴなしで生成を続ける 884 unset( $e ); 885 } 886 } 887 888 if ( ! $rwcqrcm_qrsettings_logo_width ) { 889 $rwcqrcm_qrsettings_logo_width = '10%'; 890 } 891 892 if ( ! $rwcqrcm_qrsettings_logo_height ) { 893 $rwcqrcm_qrsettings_logo_height = '10%'; 894 } 895 896 if ( $rwcqrcm_qrsettings_logo_path ) { 897 $data = $qr_code->getData(); 898 899 if ( false !== strpos( $rwcqrcm_qrsettings_logo_width, '%' ) ) { // if size set as percent 900 $rwcqrcm_qrsettings_logo_width = $this->clear_digits( $rwcqrcm_qrsettings_logo_width ) * $data['inner_width'] / 100; 901 } 902 903 if ( false !== strpos( $rwcqrcm_qrsettings_logo_height, '%' ) ) { // if size set as percent 904 $rwcqrcm_qrsettings_logo_height = $this->clear_digits( $rwcqrcm_qrsettings_logo_height ) * $data['inner_height'] / 100; 905 } 906 907 $qr_code->setLogoSize( intval( $rwcqrcm_qrsettings_logo_width ), intval( $rwcqrcm_qrsettings_logo_height ) ); 1115 if ( $rwcqrcm_qrsettings_logo_path && file_exists( $rwcqrcm_qrsettings_logo_path ) ) { 1116 $options['logo_path'] = $rwcqrcm_qrsettings_logo_path; 1117 $options['logo_width'] = $rwcqrcm_qrsettings_logo_width; 1118 $options['logo_height'] = $rwcqrcm_qrsettings_logo_height; 1119 } 908 1120 } 909 1121 910 1122 // 一覧・メタボックスの表示用に svg は常に書き出す 911 $this->write_qrcode_file( $qr_code, $file_base, 'svg' ); 912 1123 $formats = array( 'svg' ); 913 1124 foreach ( array( 'png', 'eps' ) as $format ) { 914 1125 if ( isset( $this->option['output']['format'][ $format ] ) ) { 915 $this->write_qrcode_file( $qr_code, $file_base, $format ); 916 } 917 } 918 1126 $formats[] = $format; 1127 } 1128 } 919 1129 // jpeg のライターはないため、png を書き出してから GD で変換する 920 if ( isset( $this->option['output']['format']['jpg'] ) ) { 921 $this->write_qrcode_file( $qr_code, $file_base, 'png' ); 922 1130 $jpeg = isset( $this->option['output']['format']['jpg'] ); 1131 if ( $jpeg && ! in_array( 'png', $formats, true ) ) { 1132 $formats[] = 'png'; 1133 } 1134 1135 Qr_Writer::write( $text, $options, $file_base, $formats ); 1136 1137 if ( $jpeg ) { 923 1138 // エラー抑制(@)ではなく戻り値を確認する。読み込みに失敗した場合、 924 1139 // 以前は imagejpeg( false, ... ) で致命的エラーになっていた。 … … 926 1141 if ( false !== $image ) { 927 1142 imagejpeg( $image, $file_base . '.jpg' ); 928 // メモリの解放 929 imagedestroy( $image ); 930 } 931 } 932 } 933 934 /** 935 * QR コードを指定形式でファイルへ書き出す 936 * 937 * @param QrCode $qr_code 設定済みの QrCode インスタンス。 938 * @param string $file_base 拡張子を除いた出力パス。 939 * @param string $format svg / png / eps。 940 */ 941 private function write_qrcode_file( QrCode $qr_code, $file_base, $format ) { 942 $qr_code->setWriterByName( $format ); 943 $qr_code->writeFile( $file_base . '.' . $format ); 1143 // メモリの解放(PHP 8.0 以降は不要で、8.5 では imagedestroy() が非推奨) 1144 if ( PHP_VERSION_ID < 80000 ) { 1145 imagedestroy( $image ); 1146 } 1147 } 1148 } 944 1149 } 945 1150 … … 1529 1734 : array(); 1530 1735 1736 // Wi-Fi の SSID・パスワードは sanitize_text_field() を通すと値が変わる(タグ・%xx・連続する空白)ため、 1737 // 元の入力から sanitize_wifi_text() で作り直す。暗号方式は決まった値だけを受け付ける。 1738 if ( isset( $raw['qrdata']['wifi'] ) && is_array( $raw['qrdata']['wifi'] ) ) { 1739 foreach ( array( 'ssid', 'password' ) as $wifi_key ) { 1740 if ( isset( $raw['qrdata']['wifi'][ $wifi_key ] ) && is_scalar( $raw['qrdata']['wifi'][ $wifi_key ] ) ) { 1741 $qrdata['wifi'][ $wifi_key ] = self::sanitize_wifi_text( $raw['qrdata']['wifi'][ $wifi_key ] ); 1742 } 1743 } 1744 if ( isset( $qrdata['wifi']['encryption'] ) && ! in_array( $qrdata['wifi']['encryption'], self::WIFI_ENCRYPTIONS, true ) ) { 1745 $qrdata['wifi']['encryption'] = 'WPA'; 1746 } 1747 // 「SSID を隠している」はチェックを外すと空(フォームは hidden の off を先に送る) 1748 if ( isset( $qrdata['wifi']['hidden'] ) && 'on' !== $qrdata['wifi']['hidden'] ) { 1749 $qrdata['wifi']['hidden'] = ''; 1750 } 1751 $qrdata = self::apply_wifi_password_rules( $qrdata ); 1752 } 1753 1531 1754 // URL に許可されていないスキーム(javascript: / data: など)が入力されていたら保存しない。 1532 1755 // input type="url" はこれらも正しい URL として受け付けるため、サーバー側で弾く。 … … 1976 2199 wp_enqueue_script( 1977 2200 'qrcm-jsqr', 1978 plugins_url( '/assets/js/jsQR. js', Plugin::PLUGIN_BASEFILE ),2201 plugins_url( '/assets/js/jsQR.min.js', Plugin::PLUGIN_BASEFILE ), 1979 2202 array(), 1980 2203 RWCQRCM_VERSION, -
qr-code-management/trunk/includes/Report.php
r3802279 r3846961 283 283 * 対象ごとのスキャン数を集計する 284 284 * 285 * @param int $days 集計期間(日数)。0 なら全期間。 285 * @param int $days 集計期間(日数)。0 なら全期間。 286 * @param int $limit 件数(既定は画面・CSV と同じ 100 件)。 287 * @param int $offset 先頭から飛ばす件数(WP-CLI のページ分け)。 286 288 * @return array 行の配列(post_id / target_type / scans / visitors / last_scan)。 287 289 */ 288 public static function get_summary( $days ) {290 public static function get_summary( $days, $limit = self::LIMIT, $offset = 0 ) { 289 291 global $wpdb; 290 292 … … 293 295 return (array) $wpdb->get_results( 294 296 $wpdb->prepare( 295 "SELECT post_id, target_type, COUNT(*) AS scans, COUNT(DISTINCT user_id) AS visitors, MAX(create_date) AS last_scan FROM {$wpdb->prefix}rwc_qrcm_log WHERE create_date >= %s GROUP BY post_id, target_type ORDER BY scans DESC, last_scan DESC LIMIT %d",297 "SELECT post_id, target_type, COUNT(*) AS scans, COUNT(DISTINCT user_id) AS visitors, MAX(create_date) AS last_scan FROM {$wpdb->prefix}rwc_qrcm_log WHERE create_date >= %s GROUP BY post_id, target_type ORDER BY scans DESC, last_scan DESC, post_id ASC, target_type ASC LIMIT %d OFFSET %d", 296 298 $since, 297 self::LIMIT 299 max( 1, (int) $limit ), 300 max( 0, (int) $offset ) 298 301 ) 299 302 ); -
qr-code-management/trunk/includes/autoloader.php
r3743259 r3846961 10 10 11 11 $rwcqrcm_class_map = array( 12 'RWC\QRCM\Plugin' => $rwcqrcm_base_dir . '/Plugin.php', 13 'RWC\QRCM\DB_Tables' => $rwcqrcm_base_dir . '/DB_Tables.php', 14 'RWC\QRCM\Admin' => $rwcqrcm_base_dir . '/Admin.php', 15 'RWC\QRCM\RWC_Qrcode' => $rwcqrcm_base_dir . '/Qrcode.php', 16 'RWC\QRCM\Report' => $rwcqrcm_base_dir . '/Report.php', 17 'RWC\QRCM\Widget' => $rwcqrcm_base_dir . '/Widget.php', 12 'RWC\QRCM\Plugin' => $rwcqrcm_base_dir . '/Plugin.php', 13 'RWC\QRCM\DB_Tables' => $rwcqrcm_base_dir . '/DB_Tables.php', 14 'RWC\QRCM\Admin' => $rwcqrcm_base_dir . '/Admin.php', 15 'RWC\QRCM\RWC_Qrcode' => $rwcqrcm_base_dir . '/Qrcode.php', 16 'RWC\QRCM\Report' => $rwcqrcm_base_dir . '/Report.php', 17 'RWC\QRCM\Widget' => $rwcqrcm_base_dir . '/Widget.php', 18 'RWC\QRCM\Qr_Writer' => $rwcqrcm_base_dir . '/Qr_Writer.php', 19 'RWC\QRCM\CLI' => $rwcqrcm_base_dir . '/CLI.php', 20 'RWC\QRCM\Bulk_Download' => $rwcqrcm_base_dir . '/Bulk_Download.php', 21 'RWC\QRCM\Block' => $rwcqrcm_base_dir . '/Block.php', 18 22 ); 19 23 … … 30 34 ); 31 35 36 // QR コード生成ライブラリが使う拡張(mbstring / ctype)がない環境向けの代わりの関数 37 if ( ! function_exists( 'mb_list_encodings' ) ) { 38 require_once $rwcqrcm_base_dir . '/compat/mbstring.php'; 39 } 40 if ( ! function_exists( 'ctype_digit' ) ) { 41 require_once $rwcqrcm_base_dir . '/compat/ctype.php'; 42 } 43 32 44 require_once plugin_dir_path( RWCQRCM_PLUGIN_MAIN_FILE ) . '/vendor/autoload.php'; 33 45 -
qr-code-management/trunk/languages/qr-code-management-ja.po
r3845962 r3846961 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: QR Code Management 1. 7.2\n"6 "POT-Creation-Date: 2026-12-05 08:06+0000\n"5 "Project-Id-Version: QR Code Management 1.8.0\n" 6 "POT-Creation-Date: 2026-12-05 17:00+0000\n" 7 7 "MIME-Version: 1.0\n" 8 8 "Content-Type: text/plain; charset=UTF-8\n" 9 9 "Content-Transfer-Encoding: 8bit\n" 10 10 "X-Domain: qr-code-management\n" 11 "PO-Revision-Date: 2026-12-05 08:06+0000\n"11 "PO-Revision-Date: 2026-12-05 17:00+0000\n" 12 12 "Language: ja\n" 13 13 "Plural-Forms: nplurals=1; plural=0;\n" 14 14 15 #: includes/Report.php:32 215 #: includes/Report.php:325 16 16 msgid "(Deleted post #%d)" 17 17 msgstr "(削除された投稿 #%d)" 18 18 19 #: includes/Report.php:31 319 #: includes/Report.php:316 20 20 msgid "(Deleted user #%d)" 21 21 msgstr "(削除されたユーザー #%d)" 22 22 23 #: includes/Report.php:32 523 #: includes/Report.php:328 24 24 msgid "(no title)" 25 25 msgstr "(タイトルなし)" 26 26 27 #: templates/meta-box-qrcode-data.php:15 427 #: templates/meta-box-qrcode-data.php:159 28 28 msgid "8 digits for date of birth: year (4 digits), month (2 digits) and day (2 digits), in order." 29 29 msgstr "生年月日を 8 桁で指定します(年 4 桁・月 2 桁・日 2 桁の順)。" 30 30 31 #: templates/meta-box-qrcode-data.php:1 6931 #: templates/meta-box-qrcode-data.php:174 32 32 msgid "A URL pointing to a website that represents the person in some way." 33 33 msgstr "何らかの形で人物を表すWebサイトを指すURL" 34 34 35 #: templates/meta-box-qrcode-data.php:119 35 #: templates/meta-box-qrcode-data.php:300 36 msgid "A password is saved. It is not shown here. Leave this field empty to keep it." 37 msgstr "パスワードは保存済みです(ここには表示しません)。空のままにすると、保存済みのパスワードを使います。" 38 39 #: templates/meta-box-qrcode-data.php:124 36 40 msgid "A structured representation of the name of the person. When a field is divided by a comma (,), the first half is treated as the last name and the second half is treated as the first name." 37 41 msgstr "氏名を構造化して指定します。カンマ(,)で区切ると、前半が姓、後半が名として扱われます。" 38 42 39 #: templates/admin-qrcm-setting.php: 16843 #: templates/admin-qrcm-setting.php:202 40 44 msgid "Access log retention" 41 45 msgstr "アクセスログの保存期間" 42 46 43 #: templates/admin-qrcm-setting.php: 17847 #: templates/admin-qrcm-setting.php:212 44 48 msgid "Access logs (used by the access report) older than this number of days are deleted automatically once a day. Enter 0 to keep them forever (up to %d days)." 45 49 msgstr "アクセスレポートに使うアクセスログのうち、この日数より古いものを 1 日 1 回自動で削除します。0 を入力すると無期限に保存します(最大 %d 日)。" … … 57 61 msgstr "アクセスレポート" 58 62 63 #: templates/admin-qrcm-setting.php:184 64 msgid "Add UTM parameters to the redirect destination" 65 msgstr "リダイレクト先に UTM パラメーターを付ける" 66 59 67 #: templates/meta-box-qrcode-settings.php:69 60 68 msgid "Add an image" 61 69 msgstr "画像追加" 62 70 63 #: templates/meta-box-qrcode-data.php:1 4771 #: templates/meta-box-qrcode-data.php:152 64 72 msgid "Address" 65 73 msgstr "住所" … … 69 77 msgstr "全期間" 70 78 71 #: includes/Qrcode.php: 30479 #: includes/Qrcode.php:405 72 80 msgid "Author" 73 81 msgstr "作成者" 74 82 75 #: templates/admin-qrcm-setting.php:11 083 #: templates/admin-qrcm-setting.php:111 76 84 msgid "Available permissions" 77 85 msgstr "使用可能な権限" … … 85 93 msgstr "背景画像" 86 94 87 #: templates/meta-box-qrcode-data.php:15 295 #: templates/meta-box-qrcode-data.php:157 88 96 msgid "Birthday" 89 97 msgstr "誕生日" … … 101 109 msgstr "色" 102 110 103 #: templates/admin-qrcm-setting.php:21 templates/meta-box-qrcode-data.php:4 3111 #: templates/admin-qrcm-setting.php:21 templates/meta-box-qrcode-data.php:47 104 112 msgid "Contact" 105 113 msgstr "連絡先" … … 109 117 msgstr "補正レベル" 110 118 111 #: templates/admin-qrcm-setting.php:8 4119 #: templates/admin-qrcm-setting.php:85 112 120 msgid "Custom post type settings" 113 121 msgstr "カスタム投稿タイプ設定" 114 122 115 #: templates/admin-qrcm-setting.php:6 5123 #: templates/admin-qrcm-setting.php:66 116 124 msgid "Data format used" 117 125 msgstr "使用するデータ形式" … … 121 129 msgstr "削除" 122 130 123 #: templates/meta-box-qrcode-data.php:129 131 #: templates/meta-box-qrcode-data.php:308 132 msgid "Delete the saved password" 133 msgstr "保存済みのパスワードを消す" 134 135 #: templates/meta-box-qrcode-data.php:134 124 136 msgid "Designates a text string to be set as the kana name in the phonebook.When a field is divided by a comma (,), the first half is treated as the last name and the second half is treated as the first name." 125 137 msgstr "電話帳のふりがなとして設定する文字列を指定します。カンマ(,)で区切ると、前半が姓、後半が名として扱われます。" 126 138 127 #: templates/admin-qrcm-setting.php:3 6139 #: templates/admin-qrcm-setting.php:37 128 140 msgid "Display settings" 129 141 msgstr "表示設定" … … 133 145 msgstr "QR コード設定で有効にした投稿タイプのページ(ユーザープロフィールの QR コードが有効なら投稿者アーカイブも)にだけ表示されます。" 134 146 135 #: templates/admin-qrcm-setting.php:4 6147 #: templates/admin-qrcm-setting.php:47 136 148 msgid "Download" 137 149 msgstr "ダウンロード" … … 141 153 msgstr "CSV ダウンロード" 142 154 155 #: includes/Bulk_Download.php:104 156 msgid "Download QR codes (ZIP)" 157 msgstr "QRコードをダウンロード(ZIP)" 158 143 159 #: templates/meta-box-qrcode-settings.php:61 144 160 msgid "Edit" 145 161 msgstr "変更" 146 162 147 #: templates/meta-box-qrcode-data.php:14 2163 #: templates/meta-box-qrcode-data.php:147 148 164 msgid "Email" 149 165 msgstr "メールアドレス" 150 166 151 #: templates/meta-box-qrcode-data.php:21 2167 #: templates/meta-box-qrcode-data.php:217 152 168 msgid "End" 153 169 msgstr "終了" 154 170 155 #: templates/admin-qrcm-setting.php:22 templates/meta-box-qrcode-data.php:4 4171 #: templates/admin-qrcm-setting.php:22 templates/meta-box-qrcode-data.php:48 156 172 msgid "Events" 157 173 msgstr "イベント" 158 174 159 #: templates/meta-box-qrcode-data.php:12 4175 #: templates/meta-box-qrcode-data.php:129 160 176 msgid "Familiar name for the object represented by this MeCard/vCard." 161 177 msgstr "この MeCard / vCard によって表示されるニックネーム。" … … 173 189 msgstr "文字サイズ" 174 190 175 #: templates/admin-qrcm-setting.php:13 0191 #: templates/admin-qrcm-setting.php:131 176 192 msgid "Format" 177 193 msgstr "形式" 178 194 179 #: includes/Qrcode.php: 1997195 #: includes/Qrcode.php:2220 180 196 msgid "Forwarding" 181 197 msgstr "転送" 182 198 183 #: templates/admin-qrcm-setting.php:23 templates/meta-box-qrcode-data.php:4 5 templates/meta-box-qrcode-data.php:244199 #: templates/admin-qrcm-setting.php:23 templates/meta-box-qrcode-data.php:49 templates/meta-box-qrcode-data.php:249 184 200 msgid "Free" 185 201 msgstr "自由入力" … … 189 205 msgstr "高さ" 190 206 191 #: templates/admin-qrcm-setting.php:45 207 #: templates/meta-box-qrcode-data.php:313 208 msgid "Hidden network" 209 msgstr "ステルスネットワーク" 210 211 #: templates/admin-qrcm-setting.php:46 192 212 msgid "Image" 193 213 msgstr "画像" … … 201 221 msgstr "内側" 202 222 203 #: templates/admin-qrcm-setting.php:16 5223 #: templates/admin-qrcm-setting.php:166 204 224 msgid "Invalid" 205 225 msgstr "無効" … … 225 245 msgstr "最終スキャン" 226 246 247 #: includes/Block.php:71 248 msgid "Leave both empty to show the QR code of the post being displayed. If both are set, the post ID is used." 249 msgstr "両方とも空にすると、表示中の投稿の QR コードを表示します。両方を入れたときは投稿 ID を使います。" 250 227 251 #: templates/meta-box-qrcode-settings.php:122 228 252 msgid "Level H – up to 30% damage" … … 241 265 msgstr "Level Q – 最大25%の劣化" 242 266 243 #: templates/admin-qrcm-setting.php: 39267 #: templates/admin-qrcm-setting.php:40 244 268 msgid "List display" 245 269 msgstr "一覧の表示" … … 261 285 msgstr "最大 %s px。これより大きい値は最大値に切り詰めます。" 262 286 263 #: templates/meta-box-qrcode-data.php:10 4287 #: templates/meta-box-qrcode-data.php:109 264 288 msgid "MeCard" 265 289 msgstr "MeCard" 266 290 267 #: templates/meta-box-qrcode-data.php:1 17291 #: templates/meta-box-qrcode-data.php:122 268 292 msgid "Name" 269 293 msgstr "名前" 270 294 271 #: templates/meta-box-qrcode-data.php:122 295 #: templates/meta-box-qrcode-data.php:264 296 msgid "Network name (SSID)" 297 msgstr "ネットワーク名(SSID)" 298 299 #: templates/meta-box-qrcode-data.php:127 272 300 msgid "Nickname" 273 301 msgstr "ニックネーム" 302 303 #: includes/Block.php:72 304 msgid "No QR code to show. Save the post, check that this post type is enabled in the QR code settings, and that \"Image\" is enabled under \"List display\"." 305 msgstr "表示する QR コードがありません。投稿を保存し、QR コードの設定でこの投稿タイプが有効になっていること、「一覧の表示」の「画像」が有効になっていることを確かめてください。" 274 306 275 307 #: templates/meta-box-qrcode-settings.php:67 … … 277 309 msgstr "画像が選択されていません" 278 310 311 #: templates/meta-box-qrcode-data.php:302 312 msgid "No password is saved." 313 msgstr "パスワードは保存されていません。" 314 279 315 #: templates/admin-qrcm-report.php:79 280 316 msgid "No scans have been recorded in this period." 281 317 msgstr "この期間に記録されたスキャンはありません。" 282 318 283 #: templates/meta-box-qrcode-data.php:31 templates/meta-box-qrcode-settings.php:85 templates/meta-box-qrcode-settings.php:231 319 #: templates/meta-box-qrcode-data.php:279 320 msgid "None (no password)" 321 msgstr "なし(パスワードなし)" 322 323 #: includes/Bulk_Download.php:257 324 msgid "None of the selected posts have generated QR code images. Open the post list or the edit screen to generate them, then download again." 325 msgstr "選んだ投稿には、作成済みの QR コード画像がありません。投稿一覧か編集画面を開いて画像を作成してから、もう一度ダウンロードしてください。" 326 327 #: templates/meta-box-qrcode-data.php:35 templates/meta-box-qrcode-settings.php:85 templates/meta-box-qrcode-settings.php:231 284 328 msgid "Not set" 285 329 msgstr "設定しない" 286 330 287 #: templates/meta-box-qrcode-data.php:17 2331 #: templates/meta-box-qrcode-data.php:177 288 332 msgid "Note" 289 333 msgstr "ノート" … … 297 341 msgstr "QRコードの下のオプションのテキストラベルです。" 298 342 299 #: templates/meta-box-qrcode-data.php:16 2343 #: templates/meta-box-qrcode-data.php:167 300 344 msgid "Organization" 301 345 msgstr "組織" 302 346 303 #: templates/meta-box-qrcode-data.php:16 4347 #: templates/meta-box-qrcode-data.php:169 304 348 msgid "Organization name." 305 349 msgstr "組織名。" 306 350 307 #: templates/admin-qrcm-setting.php:12 7351 #: templates/admin-qrcm-setting.php:128 308 352 msgid "Output setting" 309 353 msgstr "出力設定" … … 313 357 msgstr "外側" 314 358 315 #: includes/Qrcode.php:2001 359 #: templates/meta-box-qrcode-data.php:291 360 msgid "Password" 361 msgstr "パスワード" 362 363 #: includes/Qrcode.php:2224 316 364 msgid "Permission failed" 317 365 msgstr "許可に失敗しました" 318 366 319 #: templates/meta-box-qrcode-data.php:13 2367 #: templates/meta-box-qrcode-data.php:137 320 368 msgid "Phone" 321 369 msgstr "電話" 322 370 323 #: templates/meta-box-qrcode-data.php:1 59371 #: templates/meta-box-qrcode-data.php:164 324 372 msgid "Position held in organization." 325 373 msgstr "組織での役職。" … … 329 377 msgstr "投稿" 330 378 331 #: templates/admin-qrcm-setting.php:156 379 #: includes/Block.php:69 380 msgid "Post ID" 381 msgstr "投稿 ID" 382 383 #: templates/admin-qrcm-setting.php:157 332 384 msgid "Presence" 333 385 msgstr "有効/無効" 334 386 335 #: includes/ Qrcode.php:302 includes/Qrcode.php:1272 includes/Qrcode.php:1731includes/Widget.php:104387 #: includes/Block.php:66 includes/Qrcode.php:403 includes/Qrcode.php:1477 includes/Qrcode.php:1954 includes/Widget.php:104 336 388 msgid "QR Code" 337 389 msgstr "QRコード" … … 341 393 msgstr "QR コード (QR Code Management)" 342 394 343 #: includes/Qrcode.php:1 432 includes/Qrcode.php:1671395 #: includes/Qrcode.php:1637 includes/Qrcode.php:1894 344 396 msgid "QR Code Data" 345 397 msgstr "QRコードデータ" 346 398 347 #: includes/Qrcode.php: 1996399 #: includes/Qrcode.php:2219 348 400 msgid "QR Code Management" 349 401 msgstr "QR Code Management" 350 402 351 #: includes/Qrcode.php:1 442 includes/Qrcode.php:1676 templates/admin-qrcm-setting.php:188403 #: includes/Qrcode.php:1647 includes/Qrcode.php:1899 templates/admin-qrcm-setting.php:222 352 404 msgid "QR Code Settings" 353 405 msgstr "QRコード設定" 354 406 355 #: includes/Qrcode.php:1 452 includes/Qrcode.php:1681407 #: includes/Qrcode.php:1657 includes/Qrcode.php:1904 356 408 msgid "QR Code Shortcode" 357 409 msgstr "QRコードショートコード" 358 410 359 #: templates/admin-qrcm-setting.php:6 2411 #: templates/admin-qrcm-setting.php:63 360 412 msgid "QR Code data settings" 361 413 msgstr "QRコードデータ設定" … … 373 425 msgstr "QRコード設定" 374 426 427 #: includes/Block.php:68 428 msgid "QR code target" 429 msgstr "QR コードの対象" 430 375 431 #: templates/meta-box-qrcode-settings.php:327 376 432 msgid "Qrcode size" … … 381 437 msgstr "記録されているスキャン: %1$s 件(%2$s 以降)。" 382 438 383 #: templates/admin-qrcm-setting.php:15 3439 #: templates/admin-qrcm-setting.php:154 384 440 msgid "Redirect settings" 385 441 msgstr "リダイレクト設定" 386 442 387 #: templates/admin-qrcm-setting.php:8 1443 #: templates/admin-qrcm-setting.php:82 388 444 msgid "Role settings" 389 445 msgstr "権限設定" … … 393 449 msgstr "サンプルQRコード" 394 450 395 #: templates/admin-qrcm-setting.php:2 13templates/meta-box-qrcode-settings.php:337451 #: templates/admin-qrcm-setting.php:247 templates/meta-box-qrcode-settings.php:337 396 452 msgid "Save" 397 453 msgstr "保存" 398 454 399 #: templates/admin-qrcm-setting.php: 195455 #: templates/admin-qrcm-setting.php:229 400 456 msgid "Scanner shortcode" 401 457 msgstr "スキャナーショートコード" … … 409 465 msgstr "スキャンはリダイレクト設定が有効なときだけ記録されます。アクセスを集計するには設定画面で有効にしてください。" 410 466 411 #: includes/Qrcode.php:1 223467 #: includes/Qrcode.php:1428 412 468 msgid "Scans: %s" 413 469 msgstr "スキャン数: %s" 414 470 415 #: includes/Admin.php:324 471 #: templates/meta-box-qrcode-data.php:272 472 msgid "Security" 473 msgstr "セキュリティ" 474 475 #: includes/Admin.php:399 416 476 msgid "Select" 417 477 msgstr "選択" 418 478 419 #: templates/meta-box-qrcode-data.php:1 09479 #: templates/meta-box-qrcode-data.php:114 420 480 msgid "Select contact information QR code format" 421 481 msgstr "連絡先情報のQRコードフォーマットを選択" 422 482 423 #: includes/Qrcode.php: 1999483 #: includes/Qrcode.php:2222 424 484 msgid "Select device" 425 485 msgstr "デバイスを選択" 426 486 427 #: includes/Admin.php:3 23487 #: includes/Admin.php:398 428 488 msgid "Select or Upload Media" 429 489 msgstr "メディアを選択またはアップロード" 430 490 431 #: templates/meta-box-qrcode-data.php:34 templates/meta-box-qrcode-settings.php:88 templates/meta-box-qrcode-settings.php:235 491 #: includes/Bulk_Download.php:256 492 msgid "Select up to %d posts to download QR codes at a time." 493 msgstr "QR コードを一度にダウンロードできるのは %d 件までです。" 494 495 #: templates/meta-box-qrcode-data.php:38 templates/meta-box-qrcode-settings.php:88 templates/meta-box-qrcode-settings.php:235 432 496 msgid "Set" 433 497 msgstr "設定する" 434 498 435 #: templates/meta-box-qrcode-data.php: 27templates/meta-box-qrcode-settings.php:81499 #: templates/meta-box-qrcode-data.php:31 templates/meta-box-qrcode-settings.php:81 436 500 msgid "Set individually" 437 501 msgstr "個別に設定する" … … 449 513 msgstr "設定" 450 514 451 #: templates/admin-qrcm-setting.php: 199templates/meta-box-qrcode-shortcode.php:14515 #: templates/admin-qrcm-setting.php:233 templates/meta-box-qrcode-shortcode.php:14 452 516 msgid "Shortcode" 453 517 msgstr "ショートコード" … … 457 521 msgstr "表示中のページの QR コードを表示します。" 458 522 523 #: includes/Block.php:67 524 msgid "Shows the QR code of this post, or of the post or user you specify. Same as the [qrcm] shortcode." 525 msgstr "この投稿、または指定した投稿・ユーザーの QR コードを表示します。[qrcm] ショートコードと同じです。" 526 459 527 #: templates/admin-qrcm-report.php:103 460 528 msgid "Shows up to %d QR codes, sorted by number of scans." … … 469 537 msgstr "このページにアクセスする権限がありません。" 470 538 471 #: includes/Qrcode.php:1 363539 #: includes/Qrcode.php:1568 472 540 msgid "Sorry, you are not allowed to download this QR code." 473 541 msgstr "この QR コードをダウンロードする権限がありません。" 474 542 475 #: templates/meta-box-qrcode-data.php:1 27543 #: templates/meta-box-qrcode-data.php:132 476 544 msgid "Sound" 477 545 msgstr "音" 478 546 479 #: templates/meta-box-qrcode-data.php:17 4547 #: templates/meta-box-qrcode-data.php:179 480 548 msgid "Specifies supplemental information to be set as memo in the phonebook." 481 549 msgstr "電話帳にメモとして設定する補足情報を指定します。" … … 485 553 msgstr "QRコードの周囲の境界線サイズをピクセルで指定してください" 486 554 487 #: templates/meta-box-qrcode-data.php:21 1555 #: templates/meta-box-qrcode-data.php:216 488 556 msgid "Start" 489 557 msgstr "開始" 490 558 491 #: templates/meta-box-qrcode-data.php:23 0559 #: templates/meta-box-qrcode-data.php:235 492 560 msgid "Summary" 493 561 msgstr "概要" … … 505 573 msgstr "テキストの位置" 506 574 507 #: includes/Qrcode.php:1256 575 #: templates/meta-box-qrcode-data.php:321 576 msgid "The QR code contains the password as it is. Anyone who can see or download the QR code image can connect to the network." 577 msgstr "QR コードにはパスワードがそのまま入ります。QR コードの画像を見られる人・ダウンロードできる人は、誰でもこのネットワークに接続できます。" 578 579 #: includes/Qrcode.php:1461 508 580 msgid "The QR code data is too long to generate an image. Shorten the QR code data." 509 581 msgstr "QR コードのデータが長すぎるため画像を生成できません。QR コードのデータを短くしてください。" 510 582 511 #: templates/meta-box-qrcode-data.php:144 583 #: includes/Bulk_Download.php:258 584 msgid "The ZIP file could not be created." 585 msgstr "ZIP ファイルを作成できませんでした。" 586 587 #: templates/meta-box-qrcode-data.php:149 512 588 msgid "The address for electronic mail communication." 513 589 msgstr "電子メール通信用のアドレス。" 514 590 515 #: templates/meta-box-qrcode-data.php:13 4591 #: templates/meta-box-qrcode-data.php:139 516 592 msgid "The canonical number string for a telephone number for telephony communication." 517 593 msgstr "電話番号を正規の形式で指定します。" 518 594 519 #: templates/meta-box-qrcode-data.php:1 39595 #: templates/meta-box-qrcode-data.php:144 520 596 msgid "The canonical string for a videophone number communication." 521 597 msgstr "テレビ電話番号通信の正規の文字列" 522 598 523 #: templates/meta-box-qrcode-data.php:149 599 #: templates/meta-box-qrcode-data.php:317 600 msgid "The network does not broadcast its SSID" 601 msgstr "SSID を公開していない(ステルス)ネットワーク" 602 603 #: templates/meta-box-qrcode-data.php:154 524 604 msgid "The physical delivery address. The fields divided by commas (,) denote PO box, room number, house number, city, prefecture, zip code and country, in order." 525 605 msgstr "住所を指定します。カンマ(,)で区切った各項目は、私書箱・部屋番号・番地・市区町村・都道府県・郵便番号・国の順に扱われます。" … … 529 609 msgstr "QR コードが使用環境でどの程度損傷しうるかに応じて、「バックアップ」データの量が変わります。" 530 610 531 #: templates/meta-box-qrcode-data.php: 85 templates/meta-box-qrcode-data.php:195611 #: templates/meta-box-qrcode-data.php:90 templates/meta-box-qrcode-data.php:200 532 612 msgid "This URL cannot be used in a QR code because its scheme (such as javascript: or data:) is not allowed. It will not be saved. Enter a URL that starts with https:// or http://." 533 613 msgstr "この URL は、スキーム(javascript: や data: など)が許可されていないため QR コードに使えません。保存されません。https:// または http:// で始まる URL を入力してください。" … … 537 617 msgstr "この色の組み合わせでは QR コードが読み取りにくい可能性があります。明るい背景に、十分なコントラストのある濃い色を使ってください。" 538 618 539 #: templates/meta-box-qrcode-data.php:1 57619 #: templates/meta-box-qrcode-data.php:162 540 620 msgid "Title" 541 621 msgstr "タイトル" … … 553 633 msgstr "上部テキストの種類" 554 634 555 #: includes/Report.php:202 templates/admin-qrcm-report.php:70 templates/meta-box-qrcode-data.php: 97635 #: includes/Report.php:202 templates/admin-qrcm-report.php:70 templates/meta-box-qrcode-data.php:102 556 636 msgid "Type" 557 637 msgstr "タイプ" 558 638 559 #: templates/admin-qrcm-setting.php:20 templates/meta-box-qrcode-data.php:4 2 templates/meta-box-qrcode-data.php:73 templates/meta-box-qrcode-data.php:167639 #: templates/admin-qrcm-setting.php:20 templates/meta-box-qrcode-data.php:46 templates/meta-box-qrcode-data.php:78 templates/meta-box-qrcode-data.php:172 560 640 msgid "URL" 561 641 msgstr "URL" 642 643 #: templates/admin-qrcm-setting.php:179 644 msgid "UTM parameters" 645 msgstr "UTM パラメーター" 562 646 563 647 #: includes/Report.php:205 templates/admin-qrcm-report.php:72 … … 565 649 msgstr "ユニーク訪問者" 566 650 567 #: templates/admin-qrcm-setting.php:10 7651 #: templates/admin-qrcm-setting.php:108 568 652 msgid "Use with user profile" 569 653 msgstr "ユーザープロフィールで使用する" … … 573 657 msgstr "ユーザー" 574 658 575 #: templates/admin-qrcm-setting.php:99 659 #: includes/Block.php:70 660 msgid "User ID" 661 msgstr "ユーザー ID" 662 663 #: templates/admin-qrcm-setting.php:100 576 664 msgid "User settings" 577 665 msgstr "ユーザー設定" 578 666 579 #: templates/admin-qrcm-setting.php:16 1667 #: templates/admin-qrcm-setting.php:162 580 668 msgid "Valid" 581 669 msgstr "有効" 582 670 583 #: templates/meta-box-qrcode-data.php:1 37671 #: templates/meta-box-qrcode-data.php:142 584 672 msgid "Videophone" 585 673 msgstr "テレビ電話" 586 674 587 #: includes/Qrcode.php:2000 675 #: templates/meta-box-qrcode-data.php:278 676 msgid "WEP" 677 msgstr "WEP" 678 679 #: templates/meta-box-qrcode-data.php:277 680 msgid "WPA / WPA2 / WPA3" 681 msgstr "WPA / WPA2 / WPA3" 682 683 #: includes/Qrcode.php:2223 588 684 msgid "Wait for your permission" 589 685 msgstr "許可を待っています" 686 687 #: templates/admin-qrcm-setting.php:199 688 msgid "When a QR code with the shortened URL is scanned, these parameters are added to the redirect destination so that access analysis (such as Google Analytics) can tell visits from QR codes. Parameters already in the destination URL are not overwritten. Empty fields are not added." 689 msgstr "短縮 URL の QR コードが読み取られたとき、リダイレクト先にこのパラメーターを付けます。アクセス解析(Google アナリティクスなど)で QR コードからの訪問を見分けられます。転送先の URL にすでにあるパラメーターは上書きしません。空の項目は付けません。" 690 691 #: templates/admin-qrcm-setting.php:24 templates/meta-box-qrcode-data.php:50 692 msgid "Wi-Fi" 693 msgstr "Wi-Fi" 590 694 591 695 #: templates/meta-box-qrcode-settings.php:205 … … 593 697 msgstr "幅" 594 698 595 #: includes/Qrcode.php: 1998699 #: includes/Qrcode.php:2221 596 700 msgid "Would you like to redirect to the url \"%URL\"" 597 701 msgstr "\"%URL\"にリダイレクトしますか" 598 702 599 #: includes/Qrcode.php:2 002703 #: includes/Qrcode.php:2225 600 704 msgid "Your browser has no permission for the camera. Please activate the permission." 601 705 msgstr "ブラウザーにカメラの使用許可がありません。許可を有効にしてください。" 602 706 603 #: templates/admin-qrcm-setting.php: 174707 #: templates/admin-qrcm-setting.php:208 604 708 msgid "days" 605 709 msgstr "日" … … 613 717 msgstr "背景画像のプレビューを編集" 614 718 615 #: includes/Qrcode.php:1 315 templates/admin-qrcm-setting.php:137719 #: includes/Qrcode.php:1520 templates/admin-qrcm-setting.php:138 616 720 msgid "eps" 617 721 msgstr "EPS" 618 722 619 #: includes/Qrcode.php:1 316 templates/admin-qrcm-setting.php:135723 #: includes/Qrcode.php:1521 templates/admin-qrcm-setting.php:136 620 724 msgid "jpeg" 621 725 msgstr "JPEG" 622 726 623 #: includes/Qrcode.php:1 313 templates/admin-qrcm-setting.php:136727 #: includes/Qrcode.php:1518 templates/admin-qrcm-setting.php:137 624 728 msgid "png" 625 729 msgstr "PNG" … … 629 733 msgstr "背景画像を保存" 630 734 631 #: includes/Qrcode.php:1 314 templates/admin-qrcm-setting.php:138735 #: includes/Qrcode.php:1519 templates/admin-qrcm-setting.php:139 632 736 msgid "svg" 633 737 msgstr "SVG" 634 738 635 #: templates/meta-box-qrcode-data.php:1 06739 #: templates/meta-box-qrcode-data.php:111 636 740 msgid "vCard" 637 741 msgstr "vCard" -
qr-code-management/trunk/languages/qr-code-management.pot
r3845962 r3846961 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: QR Code Management 1. 7.2\n"6 "POT-Creation-Date: 2026-12-05 08:06+0000\n"5 "Project-Id-Version: QR Code Management 1.8.0\n" 6 "POT-Creation-Date: 2026-12-05 17:00+0000\n" 7 7 "MIME-Version: 1.0\n" 8 8 "Content-Type: text/plain; charset=UTF-8\n" … … 11 11 "Language-Team: \n" 12 12 13 #: includes/Report.php:32 213 #: includes/Report.php:325 14 14 msgid "(Deleted post #%d)" 15 15 msgstr "" 16 16 17 #: includes/Report.php:31 317 #: includes/Report.php:316 18 18 msgid "(Deleted user #%d)" 19 19 msgstr "" 20 20 21 #: includes/Report.php:32 521 #: includes/Report.php:328 22 22 msgid "(no title)" 23 23 msgstr "" 24 24 25 #: templates/meta-box-qrcode-data.php:15 425 #: templates/meta-box-qrcode-data.php:159 26 26 msgid "8 digits for date of birth: year (4 digits), month (2 digits) and day (2 digits), in order." 27 27 msgstr "" 28 28 29 #: templates/meta-box-qrcode-data.php:1 6929 #: templates/meta-box-qrcode-data.php:174 30 30 msgid "A URL pointing to a website that represents the person in some way." 31 31 msgstr "" 32 32 33 #: templates/meta-box-qrcode-data.php:119 33 #: templates/meta-box-qrcode-data.php:300 34 msgid "A password is saved. It is not shown here. Leave this field empty to keep it." 35 msgstr "" 36 37 #: templates/meta-box-qrcode-data.php:124 34 38 msgid "A structured representation of the name of the person. When a field is divided by a comma (,), the first half is treated as the last name and the second half is treated as the first name." 35 39 msgstr "" 36 40 37 #: templates/admin-qrcm-setting.php: 16841 #: templates/admin-qrcm-setting.php:202 38 42 msgid "Access log retention" 39 43 msgstr "" 40 44 41 #: templates/admin-qrcm-setting.php: 17845 #: templates/admin-qrcm-setting.php:212 42 46 msgid "Access logs (used by the access report) older than this number of days are deleted automatically once a day. Enter 0 to keep them forever (up to %d days)." 43 47 msgstr "" … … 55 59 msgstr "" 56 60 61 #: templates/admin-qrcm-setting.php:184 62 msgid "Add UTM parameters to the redirect destination" 63 msgstr "" 64 57 65 #: templates/meta-box-qrcode-settings.php:69 58 66 msgid "Add an image" 59 67 msgstr "" 60 68 61 #: templates/meta-box-qrcode-data.php:1 4769 #: templates/meta-box-qrcode-data.php:152 62 70 msgid "Address" 63 71 msgstr "" … … 67 75 msgstr "" 68 76 69 #: includes/Qrcode.php: 30477 #: includes/Qrcode.php:405 70 78 msgid "Author" 71 79 msgstr "" 72 80 73 #: templates/admin-qrcm-setting.php:11 081 #: templates/admin-qrcm-setting.php:111 74 82 msgid "Available permissions" 75 83 msgstr "" … … 83 91 msgstr "" 84 92 85 #: templates/meta-box-qrcode-data.php:15 293 #: templates/meta-box-qrcode-data.php:157 86 94 msgid "Birthday" 87 95 msgstr "" … … 99 107 msgstr "" 100 108 101 #: templates/admin-qrcm-setting.php:21 templates/meta-box-qrcode-data.php:4 3109 #: templates/admin-qrcm-setting.php:21 templates/meta-box-qrcode-data.php:47 102 110 msgid "Contact" 103 111 msgstr "" … … 107 115 msgstr "" 108 116 109 #: templates/admin-qrcm-setting.php:8 4117 #: templates/admin-qrcm-setting.php:85 110 118 msgid "Custom post type settings" 111 119 msgstr "" 112 120 113 #: templates/admin-qrcm-setting.php:6 5121 #: templates/admin-qrcm-setting.php:66 114 122 msgid "Data format used" 115 123 msgstr "" … … 119 127 msgstr "" 120 128 121 #: templates/meta-box-qrcode-data.php:129 129 #: templates/meta-box-qrcode-data.php:308 130 msgid "Delete the saved password" 131 msgstr "" 132 133 #: templates/meta-box-qrcode-data.php:134 122 134 msgid "Designates a text string to be set as the kana name in the phonebook.When a field is divided by a comma (,), the first half is treated as the last name and the second half is treated as the first name." 123 135 msgstr "" 124 136 125 #: templates/admin-qrcm-setting.php:3 6137 #: templates/admin-qrcm-setting.php:37 126 138 msgid "Display settings" 127 139 msgstr "" … … 131 143 msgstr "" 132 144 133 #: templates/admin-qrcm-setting.php:4 6145 #: templates/admin-qrcm-setting.php:47 134 146 msgid "Download" 135 147 msgstr "" … … 139 151 msgstr "" 140 152 153 #: includes/Bulk_Download.php:104 154 msgid "Download QR codes (ZIP)" 155 msgstr "" 156 141 157 #: templates/meta-box-qrcode-settings.php:61 142 158 msgid "Edit" 143 159 msgstr "" 144 160 145 #: templates/meta-box-qrcode-data.php:14 2161 #: templates/meta-box-qrcode-data.php:147 146 162 msgid "Email" 147 163 msgstr "" 148 164 149 #: templates/meta-box-qrcode-data.php:21 2165 #: templates/meta-box-qrcode-data.php:217 150 166 msgid "End" 151 167 msgstr "" 152 168 153 #: templates/admin-qrcm-setting.php:22 templates/meta-box-qrcode-data.php:4 4169 #: templates/admin-qrcm-setting.php:22 templates/meta-box-qrcode-data.php:48 154 170 msgid "Events" 155 171 msgstr "" 156 172 157 #: templates/meta-box-qrcode-data.php:12 4173 #: templates/meta-box-qrcode-data.php:129 158 174 msgid "Familiar name for the object represented by this MeCard/vCard." 159 175 msgstr "" … … 171 187 msgstr "" 172 188 173 #: templates/admin-qrcm-setting.php:13 0189 #: templates/admin-qrcm-setting.php:131 174 190 msgid "Format" 175 191 msgstr "" 176 192 177 #: includes/Qrcode.php: 1997193 #: includes/Qrcode.php:2220 178 194 msgid "Forwarding" 179 195 msgstr "" 180 196 181 #: templates/admin-qrcm-setting.php:23 templates/meta-box-qrcode-data.php:4 5 templates/meta-box-qrcode-data.php:244197 #: templates/admin-qrcm-setting.php:23 templates/meta-box-qrcode-data.php:49 templates/meta-box-qrcode-data.php:249 182 198 msgid "Free" 183 199 msgstr "" … … 187 203 msgstr "" 188 204 189 #: templates/admin-qrcm-setting.php:45 205 #: templates/meta-box-qrcode-data.php:313 206 msgid "Hidden network" 207 msgstr "" 208 209 #: templates/admin-qrcm-setting.php:46 190 210 msgid "Image" 191 211 msgstr "" … … 199 219 msgstr "" 200 220 201 #: templates/admin-qrcm-setting.php:16 5221 #: templates/admin-qrcm-setting.php:166 202 222 msgid "Invalid" 203 223 msgstr "" … … 223 243 msgstr "" 224 244 245 #: includes/Block.php:71 246 msgid "Leave both empty to show the QR code of the post being displayed. If both are set, the post ID is used." 247 msgstr "" 248 225 249 #: templates/meta-box-qrcode-settings.php:122 226 250 msgid "Level H – up to 30% damage" … … 239 263 msgstr "" 240 264 241 #: templates/admin-qrcm-setting.php: 39265 #: templates/admin-qrcm-setting.php:40 242 266 msgid "List display" 243 267 msgstr "" … … 259 283 msgstr "" 260 284 261 #: templates/meta-box-qrcode-data.php:10 4285 #: templates/meta-box-qrcode-data.php:109 262 286 msgid "MeCard" 263 287 msgstr "" 264 288 265 #: templates/meta-box-qrcode-data.php:1 17289 #: templates/meta-box-qrcode-data.php:122 266 290 msgid "Name" 267 291 msgstr "" 268 292 269 #: templates/meta-box-qrcode-data.php:122 293 #: templates/meta-box-qrcode-data.php:264 294 msgid "Network name (SSID)" 295 msgstr "" 296 297 #: templates/meta-box-qrcode-data.php:127 270 298 msgid "Nickname" 299 msgstr "" 300 301 #: includes/Block.php:72 302 msgid "No QR code to show. Save the post, check that this post type is enabled in the QR code settings, and that \"Image\" is enabled under \"List display\"." 271 303 msgstr "" 272 304 … … 275 307 msgstr "" 276 308 309 #: templates/meta-box-qrcode-data.php:302 310 msgid "No password is saved." 311 msgstr "" 312 277 313 #: templates/admin-qrcm-report.php:79 278 314 msgid "No scans have been recorded in this period." 279 315 msgstr "" 280 316 281 #: templates/meta-box-qrcode-data.php:31 templates/meta-box-qrcode-settings.php:85 templates/meta-box-qrcode-settings.php:231 317 #: templates/meta-box-qrcode-data.php:279 318 msgid "None (no password)" 319 msgstr "" 320 321 #: includes/Bulk_Download.php:257 322 msgid "None of the selected posts have generated QR code images. Open the post list or the edit screen to generate them, then download again." 323 msgstr "" 324 325 #: templates/meta-box-qrcode-data.php:35 templates/meta-box-qrcode-settings.php:85 templates/meta-box-qrcode-settings.php:231 282 326 msgid "Not set" 283 327 msgstr "" 284 328 285 #: templates/meta-box-qrcode-data.php:17 2329 #: templates/meta-box-qrcode-data.php:177 286 330 msgid "Note" 287 331 msgstr "" … … 295 339 msgstr "" 296 340 297 #: templates/meta-box-qrcode-data.php:16 2341 #: templates/meta-box-qrcode-data.php:167 298 342 msgid "Organization" 299 343 msgstr "" 300 344 301 #: templates/meta-box-qrcode-data.php:16 4345 #: templates/meta-box-qrcode-data.php:169 302 346 msgid "Organization name." 303 347 msgstr "" 304 348 305 #: templates/admin-qrcm-setting.php:12 7349 #: templates/admin-qrcm-setting.php:128 306 350 msgid "Output setting" 307 351 msgstr "" … … 311 355 msgstr "" 312 356 313 #: includes/Qrcode.php:2001 357 #: templates/meta-box-qrcode-data.php:291 358 msgid "Password" 359 msgstr "" 360 361 #: includes/Qrcode.php:2224 314 362 msgid "Permission failed" 315 363 msgstr "" 316 364 317 #: templates/meta-box-qrcode-data.php:13 2365 #: templates/meta-box-qrcode-data.php:137 318 366 msgid "Phone" 319 367 msgstr "" 320 368 321 #: templates/meta-box-qrcode-data.php:1 59369 #: templates/meta-box-qrcode-data.php:164 322 370 msgid "Position held in organization." 323 371 msgstr "" … … 327 375 msgstr "" 328 376 329 #: templates/admin-qrcm-setting.php:156 377 #: includes/Block.php:69 378 msgid "Post ID" 379 msgstr "" 380 381 #: templates/admin-qrcm-setting.php:157 330 382 msgid "Presence" 331 383 msgstr "" 332 384 333 #: includes/ Qrcode.php:302 includes/Qrcode.php:1272 includes/Qrcode.php:1731includes/Widget.php:104385 #: includes/Block.php:66 includes/Qrcode.php:403 includes/Qrcode.php:1477 includes/Qrcode.php:1954 includes/Widget.php:104 334 386 msgid "QR Code" 335 387 msgstr "" … … 339 391 msgstr "" 340 392 341 #: includes/Qrcode.php:1 432 includes/Qrcode.php:1671393 #: includes/Qrcode.php:1637 includes/Qrcode.php:1894 342 394 msgid "QR Code Data" 343 395 msgstr "" 344 396 345 #: includes/Qrcode.php: 1996397 #: includes/Qrcode.php:2219 346 398 msgid "QR Code Management" 347 399 msgstr "" 348 400 349 #: includes/Qrcode.php:1 442 includes/Qrcode.php:1676 templates/admin-qrcm-setting.php:188401 #: includes/Qrcode.php:1647 includes/Qrcode.php:1899 templates/admin-qrcm-setting.php:222 350 402 msgid "QR Code Settings" 351 403 msgstr "" 352 404 353 #: includes/Qrcode.php:1 452 includes/Qrcode.php:1681405 #: includes/Qrcode.php:1657 includes/Qrcode.php:1904 354 406 msgid "QR Code Shortcode" 355 407 msgstr "" 356 408 357 #: templates/admin-qrcm-setting.php:6 2409 #: templates/admin-qrcm-setting.php:63 358 410 msgid "QR Code data settings" 359 411 msgstr "" … … 371 423 msgstr "" 372 424 425 #: includes/Block.php:68 426 msgid "QR code target" 427 msgstr "" 428 373 429 #: templates/meta-box-qrcode-settings.php:327 374 430 msgid "Qrcode size" … … 379 435 msgstr "" 380 436 381 #: templates/admin-qrcm-setting.php:15 3437 #: templates/admin-qrcm-setting.php:154 382 438 msgid "Redirect settings" 383 439 msgstr "" 384 440 385 #: templates/admin-qrcm-setting.php:8 1441 #: templates/admin-qrcm-setting.php:82 386 442 msgid "Role settings" 387 443 msgstr "" … … 391 447 msgstr "" 392 448 393 #: templates/admin-qrcm-setting.php:2 13templates/meta-box-qrcode-settings.php:337449 #: templates/admin-qrcm-setting.php:247 templates/meta-box-qrcode-settings.php:337 394 450 msgid "Save" 395 451 msgstr "" 396 452 397 #: templates/admin-qrcm-setting.php: 195453 #: templates/admin-qrcm-setting.php:229 398 454 msgid "Scanner shortcode" 399 455 msgstr "" … … 407 463 msgstr "" 408 464 409 #: includes/Qrcode.php:1 223465 #: includes/Qrcode.php:1428 410 466 msgid "Scans: %s" 411 467 msgstr "" 412 468 413 #: includes/Admin.php:324 469 #: templates/meta-box-qrcode-data.php:272 470 msgid "Security" 471 msgstr "" 472 473 #: includes/Admin.php:399 414 474 msgid "Select" 415 475 msgstr "" 416 476 417 #: templates/meta-box-qrcode-data.php:1 09477 #: templates/meta-box-qrcode-data.php:114 418 478 msgid "Select contact information QR code format" 419 479 msgstr "" 420 480 421 #: includes/Qrcode.php: 1999481 #: includes/Qrcode.php:2222 422 482 msgid "Select device" 423 483 msgstr "" 424 484 425 #: includes/Admin.php:3 23485 #: includes/Admin.php:398 426 486 msgid "Select or Upload Media" 427 487 msgstr "" 428 488 429 #: templates/meta-box-qrcode-data.php:34 templates/meta-box-qrcode-settings.php:88 templates/meta-box-qrcode-settings.php:235 489 #: includes/Bulk_Download.php:256 490 msgid "Select up to %d posts to download QR codes at a time." 491 msgstr "" 492 493 #: templates/meta-box-qrcode-data.php:38 templates/meta-box-qrcode-settings.php:88 templates/meta-box-qrcode-settings.php:235 430 494 msgid "Set" 431 495 msgstr "" 432 496 433 #: templates/meta-box-qrcode-data.php: 27templates/meta-box-qrcode-settings.php:81497 #: templates/meta-box-qrcode-data.php:31 templates/meta-box-qrcode-settings.php:81 434 498 msgid "Set individually" 435 499 msgstr "" … … 447 511 msgstr "" 448 512 449 #: templates/admin-qrcm-setting.php: 199templates/meta-box-qrcode-shortcode.php:14513 #: templates/admin-qrcm-setting.php:233 templates/meta-box-qrcode-shortcode.php:14 450 514 msgid "Shortcode" 451 515 msgstr "" … … 455 519 msgstr "" 456 520 521 #: includes/Block.php:67 522 msgid "Shows the QR code of this post, or of the post or user you specify. Same as the [qrcm] shortcode." 523 msgstr "" 524 457 525 #: templates/admin-qrcm-report.php:103 458 526 msgid "Shows up to %d QR codes, sorted by number of scans." … … 467 535 msgstr "" 468 536 469 #: includes/Qrcode.php:1 363537 #: includes/Qrcode.php:1568 470 538 msgid "Sorry, you are not allowed to download this QR code." 471 539 msgstr "" 472 540 473 #: templates/meta-box-qrcode-data.php:1 27541 #: templates/meta-box-qrcode-data.php:132 474 542 msgid "Sound" 475 543 msgstr "" 476 544 477 #: templates/meta-box-qrcode-data.php:17 4545 #: templates/meta-box-qrcode-data.php:179 478 546 msgid "Specifies supplemental information to be set as memo in the phonebook." 479 547 msgstr "" … … 483 551 msgstr "" 484 552 485 #: templates/meta-box-qrcode-data.php:21 1553 #: templates/meta-box-qrcode-data.php:216 486 554 msgid "Start" 487 555 msgstr "" 488 556 489 #: templates/meta-box-qrcode-data.php:23 0557 #: templates/meta-box-qrcode-data.php:235 490 558 msgid "Summary" 491 559 msgstr "" … … 503 571 msgstr "" 504 572 505 #: includes/Qrcode.php:1256 573 #: templates/meta-box-qrcode-data.php:321 574 msgid "The QR code contains the password as it is. Anyone who can see or download the QR code image can connect to the network." 575 msgstr "" 576 577 #: includes/Qrcode.php:1461 506 578 msgid "The QR code data is too long to generate an image. Shorten the QR code data." 507 579 msgstr "" 508 580 581 #: includes/Bulk_Download.php:258 582 msgid "The ZIP file could not be created." 583 msgstr "" 584 585 #: templates/meta-box-qrcode-data.php:149 586 msgid "The address for electronic mail communication." 587 msgstr "" 588 589 #: templates/meta-box-qrcode-data.php:139 590 msgid "The canonical number string for a telephone number for telephony communication." 591 msgstr "" 592 509 593 #: templates/meta-box-qrcode-data.php:144 510 msgid "The address for electronic mail communication."511 msgstr ""512 513 #: templates/meta-box-qrcode-data.php:134514 msgid "The canonical number string for a telephone number for telephony communication."515 msgstr ""516 517 #: templates/meta-box-qrcode-data.php:139518 594 msgid "The canonical string for a videophone number communication." 519 595 msgstr "" 520 596 521 #: templates/meta-box-qrcode-data.php:149 597 #: templates/meta-box-qrcode-data.php:317 598 msgid "The network does not broadcast its SSID" 599 msgstr "" 600 601 #: templates/meta-box-qrcode-data.php:154 522 602 msgid "The physical delivery address. The fields divided by commas (,) denote PO box, room number, house number, city, prefecture, zip code and country, in order." 523 603 msgstr "" … … 527 607 msgstr "" 528 608 529 #: templates/meta-box-qrcode-data.php: 85 templates/meta-box-qrcode-data.php:195609 #: templates/meta-box-qrcode-data.php:90 templates/meta-box-qrcode-data.php:200 530 610 msgid "This URL cannot be used in a QR code because its scheme (such as javascript: or data:) is not allowed. It will not be saved. Enter a URL that starts with https:// or http://." 531 611 msgstr "" … … 535 615 msgstr "" 536 616 537 #: templates/meta-box-qrcode-data.php:1 57617 #: templates/meta-box-qrcode-data.php:162 538 618 msgid "Title" 539 619 msgstr "" … … 551 631 msgstr "" 552 632 553 #: includes/Report.php:202 templates/admin-qrcm-report.php:70 templates/meta-box-qrcode-data.php: 97633 #: includes/Report.php:202 templates/admin-qrcm-report.php:70 templates/meta-box-qrcode-data.php:102 554 634 msgid "Type" 555 635 msgstr "" 556 636 557 #: templates/admin-qrcm-setting.php:20 templates/meta-box-qrcode-data.php:4 2 templates/meta-box-qrcode-data.php:73 templates/meta-box-qrcode-data.php:167637 #: templates/admin-qrcm-setting.php:20 templates/meta-box-qrcode-data.php:46 templates/meta-box-qrcode-data.php:78 templates/meta-box-qrcode-data.php:172 558 638 msgid "URL" 639 msgstr "" 640 641 #: templates/admin-qrcm-setting.php:179 642 msgid "UTM parameters" 559 643 msgstr "" 560 644 … … 563 647 msgstr "" 564 648 565 #: templates/admin-qrcm-setting.php:10 7649 #: templates/admin-qrcm-setting.php:108 566 650 msgid "Use with user profile" 567 651 msgstr "" … … 571 655 msgstr "" 572 656 573 #: templates/admin-qrcm-setting.php:99 657 #: includes/Block.php:70 658 msgid "User ID" 659 msgstr "" 660 661 #: templates/admin-qrcm-setting.php:100 574 662 msgid "User settings" 575 663 msgstr "" 576 664 577 #: templates/admin-qrcm-setting.php:16 1665 #: templates/admin-qrcm-setting.php:162 578 666 msgid "Valid" 579 667 msgstr "" 580 668 581 #: templates/meta-box-qrcode-data.php:1 37669 #: templates/meta-box-qrcode-data.php:142 582 670 msgid "Videophone" 583 671 msgstr "" 584 672 585 #: includes/Qrcode.php:2000 673 #: templates/meta-box-qrcode-data.php:278 674 msgid "WEP" 675 msgstr "" 676 677 #: templates/meta-box-qrcode-data.php:277 678 msgid "WPA / WPA2 / WPA3" 679 msgstr "" 680 681 #: includes/Qrcode.php:2223 586 682 msgid "Wait for your permission" 683 msgstr "" 684 685 #: templates/admin-qrcm-setting.php:199 686 msgid "When a QR code with the shortened URL is scanned, these parameters are added to the redirect destination so that access analysis (such as Google Analytics) can tell visits from QR codes. Parameters already in the destination URL are not overwritten. Empty fields are not added." 687 msgstr "" 688 689 #: templates/admin-qrcm-setting.php:24 templates/meta-box-qrcode-data.php:50 690 msgid "Wi-Fi" 587 691 msgstr "" 588 692 … … 591 695 msgstr "" 592 696 593 #: includes/Qrcode.php: 1998697 #: includes/Qrcode.php:2221 594 698 msgid "Would you like to redirect to the url \"%URL\"" 595 699 msgstr "" 596 700 597 #: includes/Qrcode.php:2 002701 #: includes/Qrcode.php:2225 598 702 msgid "Your browser has no permission for the camera. Please activate the permission." 599 703 msgstr "" 600 704 601 #: templates/admin-qrcm-setting.php: 174705 #: templates/admin-qrcm-setting.php:208 602 706 msgid "days" 603 707 msgstr "" … … 611 715 msgstr "" 612 716 613 #: includes/Qrcode.php:1 315 templates/admin-qrcm-setting.php:137717 #: includes/Qrcode.php:1520 templates/admin-qrcm-setting.php:138 614 718 msgid "eps" 615 719 msgstr "" 616 720 617 #: includes/Qrcode.php:1 316 templates/admin-qrcm-setting.php:135721 #: includes/Qrcode.php:1521 templates/admin-qrcm-setting.php:136 618 722 msgid "jpeg" 619 723 msgstr "" 620 724 621 #: includes/Qrcode.php:1 313 templates/admin-qrcm-setting.php:136725 #: includes/Qrcode.php:1518 templates/admin-qrcm-setting.php:137 622 726 msgid "png" 623 727 msgstr "" … … 627 731 msgstr "" 628 732 629 #: includes/Qrcode.php:1 314 templates/admin-qrcm-setting.php:138733 #: includes/Qrcode.php:1519 templates/admin-qrcm-setting.php:139 630 734 msgid "svg" 631 735 msgstr "" 632 736 633 #: templates/meta-box-qrcode-data.php:1 06737 #: templates/meta-box-qrcode-data.php:111 634 738 msgid "vCard" 635 739 msgstr "" -
qr-code-management/trunk/qr-code-management.php
r3845962 r3846961 3 3 * Plugin Name: QR Code Management 4 4 * Description: A plug-in that issues a QR code for public pages of posts, fixed pages, and custom post types. The QR code format is PNG, SVG, EPS, JPEG. 5 * Version: 1. 7.25 * Version: 1.8.0 6 6 * Author: Redwoodcity Inc. 7 7 * Author URI: https://www.redwoodcity.jp/ … … 17 17 } 18 18 19 define( 'RWCQRCM_VERSION', '1. 7.2' );19 define( 'RWCQRCM_VERSION', '1.8.0' ); 20 20 define( 'RWCQRCM_PLUGIN_MAIN_FILE', __FILE__ ); 21 21 -
qr-code-management/trunk/readme.txt
r3845962 r3846961 5 5 Requires at least: 4.7 6 6 Tested up to: 7.1 7 Stable tag: 1. 7.27 Stable tag: 1.8.0 8 8 Requires PHP: 7.4 9 9 License: GPLv2 or later … … 20 20 * **QR code display** — Shows a QR code with a download button on the edit screen and in the post / page list of the post types you choose. 21 21 * **Output formats** — Download QR codes as PNG, SVG, EPS, or JPEG. 22 * **Redirect (shortened URL)** — Embeds a shortened URL (`https://your-site/?qrc=CODE`) instead of the page URL. Each scan is recorded in an access log and redirected to the current permalink, so printed QR codes keep working even when the page URL changes. 22 * **Redirect (shortened URL)** — Embeds a shortened URL (`https://your-site/?qrc=CODE`) instead of the page URL. Each scan is recorded in an access log and redirected to the current permalink, so printed QR codes keep working even when the page URL changes. Optionally, UTM parameters (`utm_source` / `utm_medium` / `utm_campaign`) are added to the redirect destination for your analytics tool. 23 23 * **Access report** — See the number of scans, unique visitors, and the last scan date for each QR code over the last 7 / 30 / 90 days or all time, and download the report as CSV. The scan count is also shown in the post list. Optionally, access logs older than a set number of days are deleted automatically. 24 * **QR code data** — Embeds the permalink by default. Per post, it can be changed to a URL, contact information (MeCard / vCard), event information, or free text.24 * **QR code data** — Embeds the permalink by default. Per post, it can be changed to a URL, contact information (MeCard / vCard), event information, Wi-Fi network settings, or free text. 25 25 * **Appearance settings** — Margin, error correction level, label, size, colors, logo image, and background image can be set globally or per post. 26 26 * **Original QR codes** — Create QR codes that are not tied to a post, with any data. … … 29 29 * **Shortcodes** — `[qrcm]` embeds a QR code in content (attributes: `post_id` / `user_id`; without attributes it shows the QR code of the current post or author). `[qrcm_scanner]` places a camera-based QR code reader that redirects to the scanned URL. 30 30 * **Sidebar widget** — The "QR Code (QR Code Management)" widget shows the QR code of the page being viewed. 31 * **Block** — The "QR Code" block shows the same QR code as the `[qrcm]` shortcode in the block editor (WordPress 5.3 or later). 32 * **Bulk download** — Select posts in the list screen and choose "Download QR codes (ZIP)" to download their generated QR code images at once (up to 100 posts at a time). 33 * **WP-CLI** — `wp qrcm regenerate` regenerates QR code images and `wp qrcm report` outputs the access report (table / CSV / JSON). 31 34 32 35 = Usage = … … 86 89 87 90 == Changelog == 91 92 = 1.8.0 = 93 *Release Date - 6 December 2026* 94 * Reduced the plugin size by more than half (about 2.4 MB to 1.0 MB): updated the bundled QR code library (endroid/qr-code 3.9.7 to 4.6.1, which no longer needs the Symfony components), removed the unused QR code reader library, the library tests and documents, and minified the scanner script. QR code images are generated exactly as before 95 * Added the Wi-Fi data type (network name, security, password, hidden network). The saved password is not shown on the edit screen 96 * Added an option to add UTM parameters to the redirect destination ("Setting" -> "Redirect settings", off by default), and the `rwcqrcm_redirect_url` filter 97 * Added the "QR Code" block (WordPress 5.3 or later) 98 * Added the "Download QR codes (ZIP)" bulk action to the post list (only images that are already generated and up to date; up to 100 posts at a time) 99 * Added WP-CLI commands: `wp qrcm regenerate` and `wp qrcm report` 100 * The admin CSS and JavaScript are now loaded only on the screens that use them 88 101 89 102 = 1.7.2 = -
qr-code-management/trunk/templates/admin-qrcm-setting.php
r3802279 r3846961 22 22 'event' => __( 'Events', 'qr-code-management' ), 23 23 'free' => __( 'Free', 'qr-code-management' ), 24 'wifi' => __( 'Wi-Fi', 'qr-code-management' ), 24 25 ); 25 26 … … 164 165 <?php checked( isset( $rwc_qrcm['redirect']['presence'] ) && 'invalid' === $rwc_qrcm['redirect']['presence'] ); ?>> 165 166 <label for="rwc_qrcm_redirect_presence_invalid"><?php esc_html_e( 'Invalid', 'qr-code-management' ); ?></label> 167 </div> 168 169 <?php 170 // 転送先に付ける UTM(1.8.0〜)。未保存なら既定値を表示する(付与は無効) 171 $rwcqrcm_utm = isset( $rwc_qrcm['redirect']['utm'] ) && is_array( $rwc_qrcm['redirect']['utm'] ) ? $rwc_qrcm['redirect']['utm'] : array(); 172 $rwcqrcm_utm_fields = array( 173 'source' => array( 'utm_source', 'qr' ), 174 'medium' => array( 'utm_medium', 'qrcode' ), 175 'campaign' => array( 'utm_campaign', '' ), 176 ); 177 $rwcqrcm_utm_enabled = isset( $rwcqrcm_utm['enabled'] ) && 'on' === $rwcqrcm_utm['enabled']; 178 ?> 179 <h3 class="rwc_inner_box__header"><?php esc_html_e( 'UTM parameters', 'qr-code-management' ); ?></h3> 180 <div class="rwc_inner_box__body"> 181 <input type="checkbox" name="rwc_qrcm[redirect][utm][enabled]" 182 id="rwc_qrcm_redirect_utm_enabled" value="on" 183 <?php checked( $rwcqrcm_utm_enabled ); ?>> 184 <label for="rwc_qrcm_redirect_utm_enabled"><?php esc_html_e( 'Add UTM parameters to the redirect destination', 'qr-code-management' ); ?></label> 185 <table class="form-table" role="presentation"> 186 <?php foreach ( $rwcqrcm_utm_fields as $rwcqrcm_utm_key => $rwcqrcm_utm_def ) : ?> 187 <tr> 188 <th><label for="rwc_qrcm_redirect_utm_<?php echo esc_attr( $rwcqrcm_utm_key ); ?>"><?php echo esc_html( $rwcqrcm_utm_def[0] ); ?></label></th> 189 <td> 190 <input type="text" class="regular-text" 191 name="rwc_qrcm[redirect][utm][<?php echo esc_attr( $rwcqrcm_utm_key ); ?>]" 192 id="rwc_qrcm_redirect_utm_<?php echo esc_attr( $rwcqrcm_utm_key ); ?>" 193 maxlength="<?php echo esc_attr( (string) RWC_Qrcode::UTM_MAX_LENGTH ); ?>" 194 value="<?php echo esc_attr( isset( $rwcqrcm_utm[ $rwcqrcm_utm_key ] ) ? (string) $rwcqrcm_utm[ $rwcqrcm_utm_key ] : $rwcqrcm_utm_def[1] ); ?>"> 195 </td> 196 </tr> 197 <?php endforeach; ?> 198 </table> 199 <p class="description"><?php esc_html_e( 'When a QR code with the shortened URL is scanned, these parameters are added to the redirect destination so that access analysis (such as Google Analytics) can tell visits from QR codes. Parameters already in the destination URL are not overwritten. Empty fields are not added.', 'qr-code-management' ); ?></p> 166 200 </div> 167 201 -
qr-code-management/trunk/templates/meta-box-qrcode-data.php
r3845962 r3846961 15 15 * @var $rwcqrcm_qrdata_event_summary 16 16 * @var $rwcqrcm_qrdata_free_freeinput 17 * @var $rwcqrcm_qrdata_wifi_ssid 18 * @var $rwcqrcm_qrdata_wifi_encryption 19 * @var $rwcqrcm_qrdata_wifi_password 20 * @var $rwcqrcm_qrdata_wifi_hidden 17 21 */ 18 22 … … 44 48 'event' => __( 'Events', 'qr-code-management' ), 45 49 'free' => __( 'Free', 'qr-code-management' ), 50 'wifi' => __( 'Wi-Fi', 'qr-code-management' ), 46 51 ); 47 52 … … 254 259 </table> 255 260 </div> 261 <div class="tab_content" id="rwcqrcm_qrdata_wifi_content"> 262 <table class="form-table" role="presentation"> 263 <tr> 264 <th><label for="rwcqrcm_qrdata_wifi_ssid"><?php esc_html_e( 'Network name (SSID)', 'qr-code-management' ); ?></label></th> 265 <td> 266 <input type="text" name="rwcqrcm[qrdata][wifi][ssid]" id="rwcqrcm_qrdata_wifi_ssid" class="regular-text" 267 maxlength="<?php echo esc_attr( (string) RWC_Qrcode::WIFI_MAX_LENGTH ); ?>" autocomplete="off" 268 value="<?php echo esc_attr( (string) $rwcqrcm_qrdata_wifi_ssid ); ?>"> 269 </td> 270 </tr> 271 <tr> 272 <th><label for="rwcqrcm_qrdata_wifi_encryption"><?php esc_html_e( 'Security', 'qr-code-management' ); ?></label></th> 273 <td> 274 <?php 275 // 暗号方式(ラベルは定義時に翻訳しておく)。未保存なら WPA 276 $rwcqrcm_wifi_encryptions = array( 277 'WPA' => __( 'WPA / WPA2 / WPA3', 'qr-code-management' ), 278 'WEP' => __( 'WEP', 'qr-code-management' ), 279 'nopass' => __( 'None (no password)', 'qr-code-management' ), 280 ); 281 $rwcqrcm_wifi_encryption_current = in_array( $rwcqrcm_qrdata_wifi_encryption, RWC_Qrcode::WIFI_ENCRYPTIONS, true ) ? $rwcqrcm_qrdata_wifi_encryption : 'WPA'; 282 ?> 283 <select name="rwcqrcm[qrdata][wifi][encryption]" id="rwcqrcm_qrdata_wifi_encryption"> 284 <?php foreach ( $rwcqrcm_wifi_encryptions as $rwcqrcm_wifi_encryption => $rwcqrcm_wifi_encryption_label ) : ?> 285 <option value="<?php echo esc_attr( $rwcqrcm_wifi_encryption ); ?>" <?php selected( $rwcqrcm_wifi_encryption_current, $rwcqrcm_wifi_encryption ); ?>><?php echo esc_html( $rwcqrcm_wifi_encryption_label ); ?></option> 286 <?php endforeach; ?> 287 </select> 288 </td> 289 </tr> 290 <tr> 291 <th><label for="rwcqrcm_qrdata_wifi_password"><?php esc_html_e( 'Password', 'qr-code-management' ); ?></label></th> 292 <td> 293 <?php // 保存済みのパスワードは画面に出さない。空のまま保存すると、保存済みの値を残す。 ?> 294 <input type="password" name="rwcqrcm[qrdata][wifi][password]" id="rwcqrcm_qrdata_wifi_password" class="regular-text" 295 maxlength="<?php echo esc_attr( (string) RWC_Qrcode::WIFI_MAX_LENGTH ); ?>" autocomplete="new-password" value="" 296 aria-describedby="rwcqrcm_qrdata_wifi_password_description"> 297 <p class="description" id="rwcqrcm_qrdata_wifi_password_description"> 298 <?php 299 if ( '' !== (string) $rwcqrcm_qrdata_wifi_password ) { 300 esc_html_e( 'A password is saved. It is not shown here. Leave this field empty to keep it.', 'qr-code-management' ); 301 } else { 302 esc_html_e( 'No password is saved.', 'qr-code-management' ); 303 } 304 ?> 305 </p> 306 <?php if ( '' !== (string) $rwcqrcm_qrdata_wifi_password ) : ?> 307 <input type="checkbox" name="rwcqrcm[qrdata][wifi][password_clear]" id="rwcqrcm_qrdata_wifi_password_clear" value="on"> 308 <label for="rwcqrcm_qrdata_wifi_password_clear"><?php esc_html_e( 'Delete the saved password', 'qr-code-management' ); ?></label> 309 <?php endif; ?> 310 </td> 311 </tr> 312 <tr> 313 <th><?php esc_html_e( 'Hidden network', 'qr-code-management' ); ?></th> 314 <td> 315 <input type="hidden" name="rwcqrcm[qrdata][wifi][hidden]" value="off"> 316 <input type="checkbox" name="rwcqrcm[qrdata][wifi][hidden]" id="rwcqrcm_qrdata_wifi_hidden" value="on" <?php checked( 'on' === $rwcqrcm_qrdata_wifi_hidden ); ?>> 317 <label for="rwcqrcm_qrdata_wifi_hidden"><?php esc_html_e( 'The network does not broadcast its SSID', 'qr-code-management' ); ?></label> 318 </td> 319 </tr> 320 </table> 321 <p class="description"><?php esc_html_e( 'The QR code contains the password as it is. Anyone who can see or download the QR code image can connect to the network.', 'qr-code-management' ); ?></p> 322 </div> 256 323 </div> -
qr-code-management/trunk/vendor/composer/autoload_classmap.php
r3609180 r3846961 7 7 8 8 return array( 9 'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',10 9 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', 11 'JsonException' => $vendorDir . '/symfony/polyfill-php73/Resources/stubs/JsonException.php',12 'Normalizer' => $vendorDir . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php',13 'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php',14 'Stringable' => $vendorDir . '/myclabs/php-enum/stubs/Stringable.php',15 'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',16 'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',17 10 ); -
qr-code-management/trunk/vendor/composer/autoload_psr4.php
r3609180 r3846961 7 7 8 8 return array( 9 'Zxing\\' => array($vendorDir . '/khanamiryan/qrcode-detector-decoder/lib'),10 'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'),11 'Symfony\\Polyfill\\Php73\\' => array($vendorDir . '/symfony/polyfill-php73'),12 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),13 'Symfony\\Polyfill\\Intl\\Normalizer\\' => array($vendorDir . '/symfony/polyfill-intl-normalizer'),14 'Symfony\\Polyfill\\Intl\\Grapheme\\' => array($vendorDir . '/symfony/polyfill-intl-grapheme'),15 'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'),16 'Symfony\\Component\\String\\' => array($vendorDir . '/symfony/string'),17 'Symfony\\Component\\PropertyInfo\\' => array($vendorDir . '/symfony/property-info'),18 'Symfony\\Component\\PropertyAccess\\' => array($vendorDir . '/symfony/property-access'),19 'Symfony\\Component\\OptionsResolver\\' => array($vendorDir . '/symfony/options-resolver'),20 'MyCLabs\\Enum\\' => array($vendorDir . '/myclabs/php-enum/src'),21 9 'Endroid\\QrCode\\' => array($vendorDir . '/endroid/qr-code/src'), 22 10 'DASPRiD\\Enum\\' => array($vendorDir . '/dasprid/enum/src'), -
qr-code-management/trunk/vendor/composer/autoload_real.php
r3609180 r3846961 34 34 $loader->register(true); 35 35 36 $filesToLoad = \Composer\Autoload\ComposerStaticInitbbbd9ef4ee6dc9adeb1afd05246f95d0::$files;37 $requireFile = \Closure::bind(static function ($fileIdentifier, $file) {38 if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {39 $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;40 41 require $file;42 }43 }, null, null);44 foreach ($filesToLoad as $fileIdentifier => $file) {45 $requireFile($fileIdentifier, $file);46 }47 48 36 return $loader; 49 37 } -
qr-code-management/trunk/vendor/composer/autoload_static.php
r3609180 r3846961 7 7 class ComposerStaticInitbbbd9ef4ee6dc9adeb1afd05246f95d0 8 8 { 9 public static $files = array (10 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',11 '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php',12 '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',13 '8825ede83f2f289127722d4e842cf7e8' => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme/bootstrap.php',14 'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php',15 '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',16 'b6b991a57620e2fb6b2f66f03fe9ddc2' => __DIR__ . '/..' . '/symfony/string/Resources/functions.php',17 '0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php',18 'a9ed0d27b5a698798a89181429f162c5' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/Common/customFunctions.php',19 );20 21 9 public static $prefixLengthsPsr4 = array ( 22 'Z' =>23 array (24 'Zxing\\' => 6,25 ),26 'S' =>27 array (28 'Symfony\\Polyfill\\Php80\\' => 23,29 'Symfony\\Polyfill\\Php73\\' => 23,30 'Symfony\\Polyfill\\Mbstring\\' => 26,31 'Symfony\\Polyfill\\Intl\\Normalizer\\' => 33,32 'Symfony\\Polyfill\\Intl\\Grapheme\\' => 31,33 'Symfony\\Polyfill\\Ctype\\' => 23,34 'Symfony\\Component\\String\\' => 25,35 'Symfony\\Component\\PropertyInfo\\' => 31,36 'Symfony\\Component\\PropertyAccess\\' => 33,37 'Symfony\\Component\\OptionsResolver\\' => 34,38 ),39 'M' =>40 array (41 'MyCLabs\\Enum\\' => 13,42 ),43 10 'E' => 44 11 array ( … … 56 23 57 24 public static $prefixDirsPsr4 = array ( 58 'Zxing\\' =>59 array (60 0 => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib',61 ),62 'Symfony\\Polyfill\\Php80\\' =>63 array (64 0 => __DIR__ . '/..' . '/symfony/polyfill-php80',65 ),66 'Symfony\\Polyfill\\Php73\\' =>67 array (68 0 => __DIR__ . '/..' . '/symfony/polyfill-php73',69 ),70 'Symfony\\Polyfill\\Mbstring\\' =>71 array (72 0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring',73 ),74 'Symfony\\Polyfill\\Intl\\Normalizer\\' =>75 array (76 0 => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer',77 ),78 'Symfony\\Polyfill\\Intl\\Grapheme\\' =>79 array (80 0 => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme',81 ),82 'Symfony\\Polyfill\\Ctype\\' =>83 array (84 0 => __DIR__ . '/..' . '/symfony/polyfill-ctype',85 ),86 'Symfony\\Component\\String\\' =>87 array (88 0 => __DIR__ . '/..' . '/symfony/string',89 ),90 'Symfony\\Component\\PropertyInfo\\' =>91 array (92 0 => __DIR__ . '/..' . '/symfony/property-info',93 ),94 'Symfony\\Component\\PropertyAccess\\' =>95 array (96 0 => __DIR__ . '/..' . '/symfony/property-access',97 ),98 'Symfony\\Component\\OptionsResolver\\' =>99 array (100 0 => __DIR__ . '/..' . '/symfony/options-resolver',101 ),102 'MyCLabs\\Enum\\' =>103 array (104 0 => __DIR__ . '/..' . '/myclabs/php-enum/src',105 ),106 25 'Endroid\\QrCode\\' => 107 26 array ( … … 119 38 120 39 public static $classMap = array ( 121 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',122 40 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', 123 'JsonException' => __DIR__ . '/..' . '/symfony/polyfill-php73/Resources/stubs/JsonException.php',124 'Normalizer' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php',125 'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php',126 'Stringable' => __DIR__ . '/..' . '/myclabs/php-enum/stubs/Stringable.php',127 'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',128 'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',129 41 ); 130 42 -
qr-code-management/trunk/vendor/composer/installed.json
r3743259 r3846961 113 113 { 114 114 "name": "endroid/qr-code", 115 "version": " 3.9.7",116 "version_normalized": " 3.9.7.0",115 "version": "4.6.1", 116 "version_normalized": "4.6.1.0", 117 117 "source": { 118 118 "type": "git", 119 119 "url": "https://github.com/endroid/qr-code.git", 120 "reference": " 94563d7b3105288e6ac53a67ae720e3669fac1f6"120 "reference": "a75c913b0e4d6ad275e49a2c1de1cacffc6c2184" 121 121 }, 122 122 "dist": { 123 123 "type": "zip", 124 "url": "https://api.github.com/repos/endroid/qr-code/zipball/ 94563d7b3105288e6ac53a67ae720e3669fac1f6",125 "reference": " 94563d7b3105288e6ac53a67ae720e3669fac1f6",124 "url": "https://api.github.com/repos/endroid/qr-code/zipball/a75c913b0e4d6ad275e49a2c1de1cacffc6c2184", 125 "reference": "a75c913b0e4d6ad275e49a2c1de1cacffc6c2184", 126 126 "shasum": "" 127 127 }, 128 128 "require": { 129 "bacon/bacon-qr-code": "^2.0", 130 "khanamiryan/qrcode-detector-decoder": "^1.0.5", 131 "myclabs/php-enum": "^1.5", 132 "php": "^7.3||^8.0", 133 "symfony/options-resolver": "^3.4||^4.4||^5.0", 134 "symfony/property-access": "^3.4||^4.4||^5.0" 129 "bacon/bacon-qr-code": "^2.0.5", 130 "php": "^7.4||^8.0" 135 131 }, 136 132 "require-dev": { 137 "endroid/quality": "^1.5.2", 138 "setasign/fpdf": "^1.8" 133 "endroid/quality": "dev-master", 134 "ext-gd": "*", 135 "khanamiryan/qrcode-detector-decoder": "^1.0.4", 136 "setasign/fpdf": "^1.8.2" 139 137 }, 140 138 "suggest": { 141 "ext-gd": " Required for generatingPNG images",142 " roave/security-advisories": "Avoids installation of package versions with vulnerabilities",143 " setasign/fpdf": "Required to use the FPDF writer.",144 "s ymfony/security-checker": "Checks your composer.lock for vulnerabilities"139 "ext-gd": "Enables you to write PNG images", 140 "khanamiryan/qrcode-detector-decoder": "Enables you to use the image validator", 141 "roave/security-advisories": "Makes sure package versions with known security issues are not installed", 142 "setasign/fpdf": "Enables you to use the PDF writer" 145 143 }, 146 "time": "202 1-04-20T19:10:54+00:00",144 "time": "2022-10-26T08:48:17+00:00", 147 145 "type": "library", 148 146 "extra": { 149 147 "branch-alias": { 150 "dev-master": " 3.x-dev"148 "dev-master": "4.x-dev" 151 149 } 152 150 }, … … 170 168 "homepage": "https://github.com/endroid/qr-code", 171 169 "keywords": [ 172 "bundle",173 170 "code", 174 171 "endroid", … … 179 176 "support": { 180 177 "issues": "https://github.com/endroid/qr-code/issues", 181 "source": "https://github.com/endroid/qr-code/tree/ 3.9.7"178 "source": "https://github.com/endroid/qr-code/tree/4.6.1" 182 179 }, 183 180 "funding": [ … … 188 185 ], 189 186 "install-path": "../endroid/qr-code" 190 },191 {192 "name": "khanamiryan/qrcode-detector-decoder",193 "version": "1.0.6",194 "version_normalized": "1.0.6.0",195 "source": {196 "type": "git",197 "url": "https://github.com/khanamiryan/php-qrcode-detector-decoder.git",198 "reference": "45326fb83a2a375065dbb3a134b5b8a5872da569"199 },200 "dist": {201 "type": "zip",202 "url": "https://api.github.com/repos/khanamiryan/php-qrcode-detector-decoder/zipball/45326fb83a2a375065dbb3a134b5b8a5872da569",203 "reference": "45326fb83a2a375065dbb3a134b5b8a5872da569",204 "shasum": ""205 },206 "require": {207 "php": ">=5.6"208 },209 "require-dev": {210 "phpunit/phpunit": "^5.7 | ^7.5 | ^8.0 | ^9.0",211 "rector/rector": "^0.13.6",212 "symplify/easy-coding-standard": "^11.0"213 },214 "time": "2022-06-29T09:25:13+00:00",215 "type": "library",216 "installation-source": "dist",217 "autoload": {218 "files": [219 "lib/Common/customFunctions.php"220 ],221 "psr-4": {222 "Zxing\\": "lib/"223 }224 },225 "notification-url": "https://packagist.org/downloads/",226 "license": [227 "MIT",228 "Apache-2.0"229 ],230 "authors": [231 {232 "name": "Ashot Khanamiryan",233 "email": "a.khanamiryan@gmail.com",234 "homepage": "https://github.com/khanamiryan",235 "role": "Developer"236 }237 ],238 "description": "QR code decoder / reader",239 "homepage": "https://github.com/khanamiryan/php-qrcode-detector-decoder/",240 "keywords": [241 "barcode",242 "qr",243 "zxing"244 ],245 "support": {246 "issues": "https://github.com/khanamiryan/php-qrcode-detector-decoder/issues",247 "source": "https://github.com/khanamiryan/php-qrcode-detector-decoder/tree/1.0.6"248 },249 "install-path": "../khanamiryan/qrcode-detector-decoder"250 },251 {252 "name": "myclabs/php-enum",253 "version": "1.8.5",254 "version_normalized": "1.8.5.0",255 "source": {256 "type": "git",257 "url": "https://github.com/myclabs/php-enum.git",258 "reference": "e7be26966b7398204a234f8673fdad5ac6277802"259 },260 "dist": {261 "type": "zip",262 "url": "https://api.github.com/repos/myclabs/php-enum/zipball/e7be26966b7398204a234f8673fdad5ac6277802",263 "reference": "e7be26966b7398204a234f8673fdad5ac6277802",264 "shasum": ""265 },266 "require": {267 "ext-json": "*",268 "php": "^7.3 || ^8.0"269 },270 "require-dev": {271 "phpunit/phpunit": "^9.5",272 "squizlabs/php_codesniffer": "1.*",273 "vimeo/psalm": "^4.6.2 || ^5.2"274 },275 "time": "2025-01-14T11:49:03+00:00",276 "type": "library",277 "installation-source": "dist",278 "autoload": {279 "psr-4": {280 "MyCLabs\\Enum\\": "src/"281 },282 "classmap": [283 "stubs/Stringable.php"284 ]285 },286 "notification-url": "https://packagist.org/downloads/",287 "license": [288 "MIT"289 ],290 "authors": [291 {292 "name": "PHP Enum contributors",293 "homepage": "https://github.com/myclabs/php-enum/graphs/contributors"294 }295 ],296 "description": "PHP Enum implementation",297 "homepage": "https://github.com/myclabs/php-enum",298 "keywords": [299 "enum"300 ],301 "support": {302 "issues": "https://github.com/myclabs/php-enum/issues",303 "source": "https://github.com/myclabs/php-enum/tree/1.8.5"304 },305 "funding": [306 {307 "url": "https://github.com/mnapoli",308 "type": "github"309 },310 {311 "url": "https://tidelift.com/funding/github/packagist/myclabs/php-enum",312 "type": "tidelift"313 }314 ],315 "install-path": "../myclabs/php-enum"316 },317 {318 "name": "symfony/deprecation-contracts",319 "version": "v2.5.4",320 "version_normalized": "2.5.4.0",321 "source": {322 "type": "git",323 "url": "https://github.com/symfony/deprecation-contracts.git",324 "reference": "605389f2a7e5625f273b53960dc46aeaf9c62918"325 },326 "dist": {327 "type": "zip",328 "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/605389f2a7e5625f273b53960dc46aeaf9c62918",329 "reference": "605389f2a7e5625f273b53960dc46aeaf9c62918",330 "shasum": ""331 },332 "require": {333 "php": ">=7.1"334 },335 "time": "2024-09-25T14:11:13+00:00",336 "type": "library",337 "extra": {338 "thanks": {339 "url": "https://github.com/symfony/contracts",340 "name": "symfony/contracts"341 },342 "branch-alias": {343 "dev-main": "2.5-dev"344 }345 },346 "installation-source": "dist",347 "autoload": {348 "files": [349 "function.php"350 ]351 },352 "notification-url": "https://packagist.org/downloads/",353 "license": [354 "MIT"355 ],356 "authors": [357 {358 "name": "Nicolas Grekas",359 "email": "p@tchwork.com"360 },361 {362 "name": "Symfony Community",363 "homepage": "https://symfony.com/contributors"364 }365 ],366 "description": "A generic function and convention to trigger deprecation notices",367 "homepage": "https://symfony.com",368 "support": {369 "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.4"370 },371 "funding": [372 {373 "url": "https://symfony.com/sponsor",374 "type": "custom"375 },376 {377 "url": "https://github.com/fabpot",378 "type": "github"379 },380 {381 "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",382 "type": "tidelift"383 }384 ],385 "install-path": "../symfony/deprecation-contracts"386 },387 {388 "name": "symfony/options-resolver",389 "version": "v5.4.45",390 "version_normalized": "5.4.45.0",391 "source": {392 "type": "git",393 "url": "https://github.com/symfony/options-resolver.git",394 "reference": "74e5b6f0db3e8589e6cfd5efb317a1fc2bb52fb6"395 },396 "dist": {397 "type": "zip",398 "url": "https://api.github.com/repos/symfony/options-resolver/zipball/74e5b6f0db3e8589e6cfd5efb317a1fc2bb52fb6",399 "reference": "74e5b6f0db3e8589e6cfd5efb317a1fc2bb52fb6",400 "shasum": ""401 },402 "require": {403 "php": ">=7.2.5",404 "symfony/deprecation-contracts": "^2.1|^3",405 "symfony/polyfill-php73": "~1.0",406 "symfony/polyfill-php80": "^1.16"407 },408 "time": "2024-09-25T14:11:13+00:00",409 "type": "library",410 "installation-source": "dist",411 "autoload": {412 "psr-4": {413 "Symfony\\Component\\OptionsResolver\\": ""414 },415 "exclude-from-classmap": [416 "/Tests/"417 ]418 },419 "notification-url": "https://packagist.org/downloads/",420 "license": [421 "MIT"422 ],423 "authors": [424 {425 "name": "Fabien Potencier",426 "email": "fabien@symfony.com"427 },428 {429 "name": "Symfony Community",430 "homepage": "https://symfony.com/contributors"431 }432 ],433 "description": "Provides an improved replacement for the array_replace PHP function",434 "homepage": "https://symfony.com",435 "keywords": [436 "config",437 "configuration",438 "options"439 ],440 "support": {441 "source": "https://github.com/symfony/options-resolver/tree/v5.4.45"442 },443 "funding": [444 {445 "url": "https://symfony.com/sponsor",446 "type": "custom"447 },448 {449 "url": "https://github.com/fabpot",450 "type": "github"451 },452 {453 "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",454 "type": "tidelift"455 }456 ],457 "install-path": "../symfony/options-resolver"458 },459 {460 "name": "symfony/polyfill-ctype",461 "version": "v1.37.0",462 "version_normalized": "1.37.0.0",463 "source": {464 "type": "git",465 "url": "https://github.com/symfony/polyfill-ctype.git",466 "reference": "141046a8f9477948ff284fa65be2095baafb94f2"467 },468 "dist": {469 "type": "zip",470 "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/141046a8f9477948ff284fa65be2095baafb94f2",471 "reference": "141046a8f9477948ff284fa65be2095baafb94f2",472 "shasum": ""473 },474 "require": {475 "php": ">=7.2"476 },477 "provide": {478 "ext-ctype": "*"479 },480 "suggest": {481 "ext-ctype": "For best performance"482 },483 "time": "2026-04-10T16:19:22+00:00",484 "type": "library",485 "extra": {486 "thanks": {487 "url": "https://github.com/symfony/polyfill",488 "name": "symfony/polyfill"489 }490 },491 "installation-source": "dist",492 "autoload": {493 "files": [494 "bootstrap.php"495 ],496 "psr-4": {497 "Symfony\\Polyfill\\Ctype\\": ""498 }499 },500 "notification-url": "https://packagist.org/downloads/",501 "license": [502 "MIT"503 ],504 "authors": [505 {506 "name": "Gert de Pagter",507 "email": "BackEndTea@gmail.com"508 },509 {510 "name": "Symfony Community",511 "homepage": "https://symfony.com/contributors"512 }513 ],514 "description": "Symfony polyfill for ctype functions",515 "homepage": "https://symfony.com",516 "keywords": [517 "compatibility",518 "ctype",519 "polyfill",520 "portable"521 ],522 "support": {523 "source": "https://github.com/symfony/polyfill-ctype/tree/v1.37.0"524 },525 "funding": [526 {527 "url": "https://symfony.com/sponsor",528 "type": "custom"529 },530 {531 "url": "https://github.com/fabpot",532 "type": "github"533 },534 {535 "url": "https://github.com/nicolas-grekas",536 "type": "github"537 },538 {539 "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",540 "type": "tidelift"541 }542 ],543 "install-path": "../symfony/polyfill-ctype"544 },545 {546 "name": "symfony/polyfill-intl-grapheme",547 "version": "v1.38.1",548 "version_normalized": "1.38.1.0",549 "source": {550 "type": "git",551 "url": "https://github.com/symfony/polyfill-intl-grapheme.git",552 "reference": "e9247d281d694a5120554d9afaf54e070e88a603"553 },554 "dist": {555 "type": "zip",556 "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/e9247d281d694a5120554d9afaf54e070e88a603",557 "reference": "e9247d281d694a5120554d9afaf54e070e88a603",558 "shasum": ""559 },560 "require": {561 "php": ">=7.2"562 },563 "suggest": {564 "ext-intl": "For best performance"565 },566 "time": "2026-05-26T05:58:03+00:00",567 "type": "library",568 "extra": {569 "thanks": {570 "url": "https://github.com/symfony/polyfill",571 "name": "symfony/polyfill"572 }573 },574 "installation-source": "dist",575 "autoload": {576 "files": [577 "bootstrap.php"578 ],579 "psr-4": {580 "Symfony\\Polyfill\\Intl\\Grapheme\\": ""581 }582 },583 "notification-url": "https://packagist.org/downloads/",584 "license": [585 "MIT"586 ],587 "authors": [588 {589 "name": "Nicolas Grekas",590 "email": "p@tchwork.com"591 },592 {593 "name": "Symfony Community",594 "homepage": "https://symfony.com/contributors"595 }596 ],597 "description": "Symfony polyfill for intl's grapheme_* functions",598 "homepage": "https://symfony.com",599 "keywords": [600 "compatibility",601 "grapheme",602 "intl",603 "polyfill",604 "portable",605 "shim"606 ],607 "support": {608 "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.38.1"609 },610 "funding": [611 {612 "url": "https://symfony.com/sponsor",613 "type": "custom"614 },615 {616 "url": "https://github.com/fabpot",617 "type": "github"618 },619 {620 "url": "https://github.com/nicolas-grekas",621 "type": "github"622 },623 {624 "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",625 "type": "tidelift"626 }627 ],628 "install-path": "../symfony/polyfill-intl-grapheme"629 },630 {631 "name": "symfony/polyfill-intl-normalizer",632 "version": "v1.38.0",633 "version_normalized": "1.38.0.0",634 "source": {635 "type": "git",636 "url": "https://github.com/symfony/polyfill-intl-normalizer.git",637 "reference": "2d446c214bdbe5b71bde5011b060a05fece3ae6b"638 },639 "dist": {640 "type": "zip",641 "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/2d446c214bdbe5b71bde5011b060a05fece3ae6b",642 "reference": "2d446c214bdbe5b71bde5011b060a05fece3ae6b",643 "shasum": ""644 },645 "require": {646 "php": ">=7.2"647 },648 "suggest": {649 "ext-intl": "For best performance"650 },651 "time": "2026-05-25T13:48:31+00:00",652 "type": "library",653 "extra": {654 "thanks": {655 "url": "https://github.com/symfony/polyfill",656 "name": "symfony/polyfill"657 }658 },659 "installation-source": "dist",660 "autoload": {661 "files": [662 "bootstrap.php"663 ],664 "psr-4": {665 "Symfony\\Polyfill\\Intl\\Normalizer\\": ""666 },667 "classmap": [668 "Resources/stubs"669 ]670 },671 "notification-url": "https://packagist.org/downloads/",672 "license": [673 "MIT"674 ],675 "authors": [676 {677 "name": "Nicolas Grekas",678 "email": "p@tchwork.com"679 },680 {681 "name": "Symfony Community",682 "homepage": "https://symfony.com/contributors"683 }684 ],685 "description": "Symfony polyfill for intl's Normalizer class and related functions",686 "homepage": "https://symfony.com",687 "keywords": [688 "compatibility",689 "intl",690 "normalizer",691 "polyfill",692 "portable",693 "shim"694 ],695 "support": {696 "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.38.0"697 },698 "funding": [699 {700 "url": "https://symfony.com/sponsor",701 "type": "custom"702 },703 {704 "url": "https://github.com/fabpot",705 "type": "github"706 },707 {708 "url": "https://github.com/nicolas-grekas",709 "type": "github"710 },711 {712 "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",713 "type": "tidelift"714 }715 ],716 "install-path": "../symfony/polyfill-intl-normalizer"717 },718 {719 "name": "symfony/polyfill-mbstring",720 "version": "v1.38.2",721 "version_normalized": "1.38.2.0",722 "source": {723 "type": "git",724 "url": "https://github.com/symfony/polyfill-mbstring.git",725 "reference": "d3d318bad5e7a1bfbd026009c8bfb8d8f99ae6b6"726 },727 "dist": {728 "type": "zip",729 "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d3d318bad5e7a1bfbd026009c8bfb8d8f99ae6b6",730 "reference": "d3d318bad5e7a1bfbd026009c8bfb8d8f99ae6b6",731 "shasum": ""732 },733 "require": {734 "ext-iconv": "*",735 "php": ">=7.2"736 },737 "provide": {738 "ext-mbstring": "*"739 },740 "suggest": {741 "ext-mbstring": "For best performance"742 },743 "time": "2026-05-27T06:59:30+00:00",744 "type": "library",745 "extra": {746 "thanks": {747 "url": "https://github.com/symfony/polyfill",748 "name": "symfony/polyfill"749 }750 },751 "installation-source": "dist",752 "autoload": {753 "files": [754 "bootstrap.php"755 ],756 "psr-4": {757 "Symfony\\Polyfill\\Mbstring\\": ""758 }759 },760 "notification-url": "https://packagist.org/downloads/",761 "license": [762 "MIT"763 ],764 "authors": [765 {766 "name": "Nicolas Grekas",767 "email": "p@tchwork.com"768 },769 {770 "name": "Symfony Community",771 "homepage": "https://symfony.com/contributors"772 }773 ],774 "description": "Symfony polyfill for the Mbstring extension",775 "homepage": "https://symfony.com",776 "keywords": [777 "compatibility",778 "mbstring",779 "polyfill",780 "portable",781 "shim"782 ],783 "support": {784 "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.38.2"785 },786 "funding": [787 {788 "url": "https://symfony.com/sponsor",789 "type": "custom"790 },791 {792 "url": "https://github.com/fabpot",793 "type": "github"794 },795 {796 "url": "https://github.com/nicolas-grekas",797 "type": "github"798 },799 {800 "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",801 "type": "tidelift"802 }803 ],804 "install-path": "../symfony/polyfill-mbstring"805 },806 {807 "name": "symfony/polyfill-php73",808 "version": "v1.37.0",809 "version_normalized": "1.37.0.0",810 "source": {811 "type": "git",812 "url": "https://github.com/symfony/polyfill-php73.git",813 "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb"814 },815 "dist": {816 "type": "zip",817 "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/0f68c03565dcaaf25a890667542e8bd75fe7e5bb",818 "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb",819 "shasum": ""820 },821 "require": {822 "php": ">=7.2"823 },824 "time": "2024-09-09T11:45:10+00:00",825 "type": "library",826 "extra": {827 "thanks": {828 "url": "https://github.com/symfony/polyfill",829 "name": "symfony/polyfill"830 }831 },832 "installation-source": "dist",833 "autoload": {834 "files": [835 "bootstrap.php"836 ],837 "psr-4": {838 "Symfony\\Polyfill\\Php73\\": ""839 },840 "classmap": [841 "Resources/stubs"842 ]843 },844 "notification-url": "https://packagist.org/downloads/",845 "license": [846 "MIT"847 ],848 "authors": [849 {850 "name": "Nicolas Grekas",851 "email": "p@tchwork.com"852 },853 {854 "name": "Symfony Community",855 "homepage": "https://symfony.com/contributors"856 }857 ],858 "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions",859 "homepage": "https://symfony.com",860 "keywords": [861 "compatibility",862 "polyfill",863 "portable",864 "shim"865 ],866 "support": {867 "source": "https://github.com/symfony/polyfill-php73/tree/v1.37.0"868 },869 "funding": [870 {871 "url": "https://symfony.com/sponsor",872 "type": "custom"873 },874 {875 "url": "https://github.com/fabpot",876 "type": "github"877 },878 {879 "url": "https://github.com/nicolas-grekas",880 "type": "github"881 },882 {883 "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",884 "type": "tidelift"885 }886 ],887 "install-path": "../symfony/polyfill-php73"888 },889 {890 "name": "symfony/polyfill-php80",891 "version": "v1.37.0",892 "version_normalized": "1.37.0.0",893 "source": {894 "type": "git",895 "url": "https://github.com/symfony/polyfill-php80.git",896 "reference": "dfb55726c3a76ea3b6459fcfda1ec2d80a682411"897 },898 "dist": {899 "type": "zip",900 "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dfb55726c3a76ea3b6459fcfda1ec2d80a682411",901 "reference": "dfb55726c3a76ea3b6459fcfda1ec2d80a682411",902 "shasum": ""903 },904 "require": {905 "php": ">=7.2"906 },907 "time": "2026-04-10T16:19:22+00:00",908 "type": "library",909 "extra": {910 "thanks": {911 "url": "https://github.com/symfony/polyfill",912 "name": "symfony/polyfill"913 }914 },915 "installation-source": "dist",916 "autoload": {917 "files": [918 "bootstrap.php"919 ],920 "psr-4": {921 "Symfony\\Polyfill\\Php80\\": ""922 },923 "classmap": [924 "Resources/stubs"925 ]926 },927 "notification-url": "https://packagist.org/downloads/",928 "license": [929 "MIT"930 ],931 "authors": [932 {933 "name": "Ion Bazan",934 "email": "ion.bazan@gmail.com"935 },936 {937 "name": "Nicolas Grekas",938 "email": "p@tchwork.com"939 },940 {941 "name": "Symfony Community",942 "homepage": "https://symfony.com/contributors"943 }944 ],945 "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",946 "homepage": "https://symfony.com",947 "keywords": [948 "compatibility",949 "polyfill",950 "portable",951 "shim"952 ],953 "support": {954 "source": "https://github.com/symfony/polyfill-php80/tree/v1.37.0"955 },956 "funding": [957 {958 "url": "https://symfony.com/sponsor",959 "type": "custom"960 },961 {962 "url": "https://github.com/fabpot",963 "type": "github"964 },965 {966 "url": "https://github.com/nicolas-grekas",967 "type": "github"968 },969 {970 "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",971 "type": "tidelift"972 }973 ],974 "install-path": "../symfony/polyfill-php80"975 },976 {977 "name": "symfony/property-access",978 "version": "v5.4.45",979 "version_normalized": "5.4.45.0",980 "source": {981 "type": "git",982 "url": "https://github.com/symfony/property-access.git",983 "reference": "111e7ed617509f1a9139686055d234aad6e388e0"984 },985 "dist": {986 "type": "zip",987 "url": "https://api.github.com/repos/symfony/property-access/zipball/111e7ed617509f1a9139686055d234aad6e388e0",988 "reference": "111e7ed617509f1a9139686055d234aad6e388e0",989 "shasum": ""990 },991 "require": {992 "php": ">=7.2.5",993 "symfony/deprecation-contracts": "^2.1|^3",994 "symfony/polyfill-php80": "^1.16",995 "symfony/property-info": "^5.2|^6.0"996 },997 "require-dev": {998 "symfony/cache": "^4.4|^5.0|^6.0"999 },1000 "suggest": {1001 "psr/cache-implementation": "To cache access methods."1002 },1003 "time": "2024-09-25T14:11:13+00:00",1004 "type": "library",1005 "installation-source": "dist",1006 "autoload": {1007 "psr-4": {1008 "Symfony\\Component\\PropertyAccess\\": ""1009 },1010 "exclude-from-classmap": [1011 "/Tests/"1012 ]1013 },1014 "notification-url": "https://packagist.org/downloads/",1015 "license": [1016 "MIT"1017 ],1018 "authors": [1019 {1020 "name": "Fabien Potencier",1021 "email": "fabien@symfony.com"1022 },1023 {1024 "name": "Symfony Community",1025 "homepage": "https://symfony.com/contributors"1026 }1027 ],1028 "description": "Provides functions to read and write from/to an object or array using a simple string notation",1029 "homepage": "https://symfony.com",1030 "keywords": [1031 "access",1032 "array",1033 "extraction",1034 "index",1035 "injection",1036 "object",1037 "property",1038 "property-path",1039 "reflection"1040 ],1041 "support": {1042 "source": "https://github.com/symfony/property-access/tree/v5.4.45"1043 },1044 "funding": [1045 {1046 "url": "https://symfony.com/sponsor",1047 "type": "custom"1048 },1049 {1050 "url": "https://github.com/fabpot",1051 "type": "github"1052 },1053 {1054 "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",1055 "type": "tidelift"1056 }1057 ],1058 "install-path": "../symfony/property-access"1059 },1060 {1061 "name": "symfony/property-info",1062 "version": "v5.4.48",1063 "version_normalized": "5.4.48.0",1064 "source": {1065 "type": "git",1066 "url": "https://github.com/symfony/property-info.git",1067 "reference": "a0396295ad585f95fccd690bc6a281e5bd303902"1068 },1069 "dist": {1070 "type": "zip",1071 "url": "https://api.github.com/repos/symfony/property-info/zipball/a0396295ad585f95fccd690bc6a281e5bd303902",1072 "reference": "a0396295ad585f95fccd690bc6a281e5bd303902",1073 "shasum": ""1074 },1075 "require": {1076 "php": ">=7.2.5",1077 "symfony/deprecation-contracts": "^2.1|^3",1078 "symfony/polyfill-php80": "^1.16",1079 "symfony/string": "^5.1|^6.0"1080 },1081 "conflict": {1082 "phpdocumentor/reflection-docblock": "<3.2.2",1083 "phpdocumentor/type-resolver": "<1.4.0",1084 "symfony/dependency-injection": "<4.4"1085 },1086 "require-dev": {1087 "doctrine/annotations": "^1.10.4|^2",1088 "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0",1089 "phpstan/phpdoc-parser": "^1.0|^2.0",1090 "symfony/cache": "^4.4|^5.0|^6.0",1091 "symfony/dependency-injection": "^4.4|^5.0|^6.0",1092 "symfony/serializer": "^4.4|^5.0|^6.0"1093 },1094 "suggest": {1095 "phpdocumentor/reflection-docblock": "To use the PHPDoc",1096 "psr/cache-implementation": "To cache results",1097 "symfony/doctrine-bridge": "To use Doctrine metadata",1098 "symfony/serializer": "To use Serializer metadata"1099 },1100 "time": "2024-11-25T16:14:41+00:00",1101 "type": "library",1102 "installation-source": "dist",1103 "autoload": {1104 "psr-4": {1105 "Symfony\\Component\\PropertyInfo\\": ""1106 },1107 "exclude-from-classmap": [1108 "/Tests/"1109 ]1110 },1111 "notification-url": "https://packagist.org/downloads/",1112 "license": [1113 "MIT"1114 ],1115 "authors": [1116 {1117 "name": "Kévin Dunglas",1118 "email": "dunglas@gmail.com"1119 },1120 {1121 "name": "Symfony Community",1122 "homepage": "https://symfony.com/contributors"1123 }1124 ],1125 "description": "Extracts information about PHP class' properties using metadata of popular sources",1126 "homepage": "https://symfony.com",1127 "keywords": [1128 "doctrine",1129 "phpdoc",1130 "property",1131 "symfony",1132 "type",1133 "validator"1134 ],1135 "support": {1136 "source": "https://github.com/symfony/property-info/tree/v5.4.48"1137 },1138 "funding": [1139 {1140 "url": "https://symfony.com/sponsor",1141 "type": "custom"1142 },1143 {1144 "url": "https://github.com/fabpot",1145 "type": "github"1146 },1147 {1148 "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",1149 "type": "tidelift"1150 }1151 ],1152 "install-path": "../symfony/property-info"1153 },1154 {1155 "name": "symfony/string",1156 "version": "v5.4.47",1157 "version_normalized": "5.4.47.0",1158 "source": {1159 "type": "git",1160 "url": "https://github.com/symfony/string.git",1161 "reference": "136ca7d72f72b599f2631aca474a4f8e26719799"1162 },1163 "dist": {1164 "type": "zip",1165 "url": "https://api.github.com/repos/symfony/string/zipball/136ca7d72f72b599f2631aca474a4f8e26719799",1166 "reference": "136ca7d72f72b599f2631aca474a4f8e26719799",1167 "shasum": ""1168 },1169 "require": {1170 "php": ">=7.2.5",1171 "symfony/polyfill-ctype": "~1.8",1172 "symfony/polyfill-intl-grapheme": "~1.0",1173 "symfony/polyfill-intl-normalizer": "~1.0",1174 "symfony/polyfill-mbstring": "~1.0",1175 "symfony/polyfill-php80": "~1.15"1176 },1177 "conflict": {1178 "symfony/translation-contracts": ">=3.0"1179 },1180 "require-dev": {1181 "symfony/error-handler": "^4.4|^5.0|^6.0",1182 "symfony/http-client": "^4.4|^5.0|^6.0",1183 "symfony/translation-contracts": "^1.1|^2",1184 "symfony/var-exporter": "^4.4|^5.0|^6.0"1185 },1186 "time": "2024-11-10T20:33:58+00:00",1187 "type": "library",1188 "installation-source": "dist",1189 "autoload": {1190 "files": [1191 "Resources/functions.php"1192 ],1193 "psr-4": {1194 "Symfony\\Component\\String\\": ""1195 },1196 "exclude-from-classmap": [1197 "/Tests/"1198 ]1199 },1200 "notification-url": "https://packagist.org/downloads/",1201 "license": [1202 "MIT"1203 ],1204 "authors": [1205 {1206 "name": "Nicolas Grekas",1207 "email": "p@tchwork.com"1208 },1209 {1210 "name": "Symfony Community",1211 "homepage": "https://symfony.com/contributors"1212 }1213 ],1214 "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way",1215 "homepage": "https://symfony.com",1216 "keywords": [1217 "grapheme",1218 "i18n",1219 "string",1220 "unicode",1221 "utf-8",1222 "utf8"1223 ],1224 "support": {1225 "source": "https://github.com/symfony/string/tree/v5.4.47"1226 },1227 "funding": [1228 {1229 "url": "https://symfony.com/sponsor",1230 "type": "custom"1231 },1232 {1233 "url": "https://github.com/fabpot",1234 "type": "github"1235 },1236 {1237 "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",1238 "type": "tidelift"1239 }1240 ],1241 "install-path": "../symfony/string"1242 187 } 1243 188 ], 1244 "dev": false,189 "dev": true, 1245 190 "dev-package-names": [] 1246 191 } -
qr-code-management/trunk/vendor/composer/installed.php
r3743259 r3846961 4 4 'pretty_version' => 'dev-master', 5 5 'version' => 'dev-master', 6 'reference' => ' e32024923a2ebfad3c156b0951c8c4d78b4eb885',6 'reference' => '76580b88ec31e6b5f9ce8ba81d36ed985c7ce60f', 7 7 'type' => 'library', 8 8 'install_path' => __DIR__ . '/../../../../../../plugin-deps', 9 9 'aliases' => array(), 10 'dev' => false,10 'dev' => true, 11 11 ), 12 12 'versions' => array( … … 30 30 ), 31 31 'endroid/qr-code' => array( 32 'pretty_version' => ' 3.9.7',33 'version' => ' 3.9.7.0',34 'reference' => ' 94563d7b3105288e6ac53a67ae720e3669fac1f6',32 'pretty_version' => '4.6.1', 33 'version' => '4.6.1.0', 34 'reference' => 'a75c913b0e4d6ad275e49a2c1de1cacffc6c2184', 35 35 'type' => 'library', 36 36 'install_path' => __DIR__ . '/../endroid/qr-code', 37 'aliases' => array(),38 'dev_requirement' => false,39 ),40 'khanamiryan/qrcode-detector-decoder' => array(41 'pretty_version' => '1.0.6',42 'version' => '1.0.6.0',43 'reference' => '45326fb83a2a375065dbb3a134b5b8a5872da569',44 'type' => 'library',45 'install_path' => __DIR__ . '/../khanamiryan/qrcode-detector-decoder',46 'aliases' => array(),47 'dev_requirement' => false,48 ),49 'myclabs/php-enum' => array(50 'pretty_version' => '1.8.5',51 'version' => '1.8.5.0',52 'reference' => 'e7be26966b7398204a234f8673fdad5ac6277802',53 'type' => 'library',54 'install_path' => __DIR__ . '/../myclabs/php-enum',55 37 'aliases' => array(), 56 38 'dev_requirement' => false, … … 59 41 'pretty_version' => 'dev-master', 60 42 'version' => 'dev-master', 61 'reference' => ' e32024923a2ebfad3c156b0951c8c4d78b4eb885',43 'reference' => '76580b88ec31e6b5f9ce8ba81d36ed985c7ce60f', 62 44 'type' => 'library', 63 45 'install_path' => __DIR__ . '/../../../../../../plugin-deps', … … 65 47 'dev_requirement' => false, 66 48 ), 67 'symfony/deprecation-contracts' => array(68 'pretty_version' => 'v2.5.4',69 'version' => '2.5.4.0',70 'reference' => '605389f2a7e5625f273b53960dc46aeaf9c62918',71 'type' => 'library',72 'install_path' => __DIR__ . '/../symfony/deprecation-contracts',73 'aliases' => array(),74 'dev_requirement' => false,75 ),76 'symfony/options-resolver' => array(77 'pretty_version' => 'v5.4.45',78 'version' => '5.4.45.0',79 'reference' => '74e5b6f0db3e8589e6cfd5efb317a1fc2bb52fb6',80 'type' => 'library',81 'install_path' => __DIR__ . '/../symfony/options-resolver',82 'aliases' => array(),83 'dev_requirement' => false,84 ),85 'symfony/polyfill-ctype' => array(86 'pretty_version' => 'v1.37.0',87 'version' => '1.37.0.0',88 'reference' => '141046a8f9477948ff284fa65be2095baafb94f2',89 'type' => 'library',90 'install_path' => __DIR__ . '/../symfony/polyfill-ctype',91 'aliases' => array(),92 'dev_requirement' => false,93 ),94 'symfony/polyfill-intl-grapheme' => array(95 'pretty_version' => 'v1.38.1',96 'version' => '1.38.1.0',97 'reference' => 'e9247d281d694a5120554d9afaf54e070e88a603',98 'type' => 'library',99 'install_path' => __DIR__ . '/../symfony/polyfill-intl-grapheme',100 'aliases' => array(),101 'dev_requirement' => false,102 ),103 'symfony/polyfill-intl-normalizer' => array(104 'pretty_version' => 'v1.38.0',105 'version' => '1.38.0.0',106 'reference' => '2d446c214bdbe5b71bde5011b060a05fece3ae6b',107 'type' => 'library',108 'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer',109 'aliases' => array(),110 'dev_requirement' => false,111 ),112 'symfony/polyfill-mbstring' => array(113 'pretty_version' => 'v1.38.2',114 'version' => '1.38.2.0',115 'reference' => 'd3d318bad5e7a1bfbd026009c8bfb8d8f99ae6b6',116 'type' => 'library',117 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring',118 'aliases' => array(),119 'dev_requirement' => false,120 ),121 'symfony/polyfill-php73' => array(122 'pretty_version' => 'v1.37.0',123 'version' => '1.37.0.0',124 'reference' => '0f68c03565dcaaf25a890667542e8bd75fe7e5bb',125 'type' => 'library',126 'install_path' => __DIR__ . '/../symfony/polyfill-php73',127 'aliases' => array(),128 'dev_requirement' => false,129 ),130 'symfony/polyfill-php80' => array(131 'pretty_version' => 'v1.37.0',132 'version' => '1.37.0.0',133 'reference' => 'dfb55726c3a76ea3b6459fcfda1ec2d80a682411',134 'type' => 'library',135 'install_path' => __DIR__ . '/../symfony/polyfill-php80',136 'aliases' => array(),137 'dev_requirement' => false,138 ),139 'symfony/property-access' => array(140 'pretty_version' => 'v5.4.45',141 'version' => '5.4.45.0',142 'reference' => '111e7ed617509f1a9139686055d234aad6e388e0',143 'type' => 'library',144 'install_path' => __DIR__ . '/../symfony/property-access',145 'aliases' => array(),146 'dev_requirement' => false,147 ),148 'symfony/property-info' => array(149 'pretty_version' => 'v5.4.48',150 'version' => '5.4.48.0',151 'reference' => 'a0396295ad585f95fccd690bc6a281e5bd303902',152 'type' => 'library',153 'install_path' => __DIR__ . '/../symfony/property-info',154 'aliases' => array(),155 'dev_requirement' => false,156 ),157 'symfony/string' => array(158 'pretty_version' => 'v5.4.47',159 'version' => '5.4.47.0',160 'reference' => '136ca7d72f72b599f2631aca474a4f8e26719799',161 'type' => 'library',162 'install_path' => __DIR__ . '/../symfony/string',163 'aliases' => array(),164 'dev_requirement' => false,165 ),166 49 ), 167 50 ); -
qr-code-management/trunk/vendor/endroid/qr-code/LICENSE
r2269636 r3846961 1 Copyright 202 0(c) Jeroen van den Enden1 Copyright 2022 (c) Jeroen van den Enden 2 2 3 3 Permission is hereby granted, free of charge, to any person obtaining a copy -
qr-code-management/trunk/vendor/endroid/qr-code/composer.json
r3609180 r3846961 2 2 "name": "endroid/qr-code", 3 3 "description": "Endroid QR Code", 4 "keywords": ["endroid", "qrcode", "qr", "code", " bundle", "php"],4 "keywords": ["endroid", "qrcode", "qr", "code", "php"], 5 5 "homepage": "https://github.com/endroid/qr-code", 6 6 "type": "library", … … 13 13 ], 14 14 "require": { 15 "php": "^7.3||^8.0", 16 "bacon/bacon-qr-code": "^2.0", 17 "khanamiryan/qrcode-detector-decoder": "^1.0.5", 18 "myclabs/php-enum": "^1.5", 19 "symfony/options-resolver": "^3.4||^4.4||^5.0", 20 "symfony/property-access": "^3.4||^4.4||^5.0" 15 "php": "^7.4||^8.0", 16 "bacon/bacon-qr-code": "^2.0.5" 21 17 }, 22 18 "require-dev": { 23 "endroid/quality": "^1.5.2", 24 "setasign/fpdf": "^1.8" 19 "ext-gd": "*", 20 "endroid/quality": "dev-master", 21 "khanamiryan/qrcode-detector-decoder": "^1.0.4", 22 "setasign/fpdf": "^1.8.2" 25 23 }, 26 24 "suggest": { 27 "ext-gd": " Required for generatingPNG images",28 " roave/security-advisories": "Avoids installation of package versions with vulnerabilities",29 " setasign/fpdf": "Required to use the FPDF writer.",30 "s ymfony/security-checker": "Checks your composer.lock for vulnerabilities"25 "ext-gd": "Enables you to write PNG images", 26 "khanamiryan/qrcode-detector-decoder": "Enables you to use the image validator", 27 "roave/security-advisories": "Makes sure package versions with known security issues are not installed", 28 "setasign/fpdf": "Enables you to use the PDF writer" 31 29 }, 32 30 "autoload": { … … 41 39 }, 42 40 "config": { 43 "sort-packages": true 41 "sort-packages": true, 42 "preferred-install": { 43 "endroid/*": "source" 44 } 44 45 }, 45 46 "extra": { 46 47 "branch-alias": { 47 "dev-master": " 3.x-dev"48 "dev-master": "4.x-dev" 48 49 } 49 50 } -
qr-code-management/trunk/vendor/endroid/qr-code/src/Exception/ValidationException.php
r3609180 r3846961 3 3 declare(strict_types=1); 4 4 5 /*6 * (c) Jeroen van den Enden <info@endroid.nl>7 *8 * This source file is subject to the MIT license that is bundled9 * with this source code in the file LICENSE.10 */11 12 5 namespace Endroid\QrCode\Exception; 13 6 14 class ValidationException extends QrCodeException7 final class ValidationException extends \Exception 15 8 { 9 public static function createForUnsupportedWriter(string $writerClass): self 10 { 11 return new self(sprintf('Unable to validate the result: "%s" does not support validation', $writerClass)); 12 } 13 14 public static function createForMissingPackage(string $packageName): self 15 { 16 return new self(sprintf('Please install "%s" or disable image validation', $packageName)); 17 } 18 19 public static function createForIncompatiblePhpVersion(): self 20 { 21 return new self('The validator is not compatible with PHP 8 yet, see https://github.com/khanamiryan/php-qrcode-detector-decoder/pull/103'); 22 } 23 24 public static function createForInvalidData(string $expectedData, string $actualData): self 25 { 26 return new self('The validation reader read "'.$actualData.'" instead of "'.$expectedData.'". Adjust your parameters to increase readability or disable validation.'); 27 } 16 28 } -
qr-code-management/trunk/vendor/endroid/qr-code/src/QrCode.php
r3609180 r3846961 3 3 declare(strict_types=1); 4 4 5 /*6 * (c) Jeroen van den Enden <info@endroid.nl>7 *8 * This source file is subject to the MIT license that is bundled9 * with this source code in the file LICENSE.10 */11 12 5 namespace Endroid\QrCode; 13 6 14 use BaconQrCode\Encoder\Encoder; 15 use Endroid\QrCode\Exception\InvalidFontException; 16 use Endroid\QrCode\Exception\UnsupportedExtensionException; 17 use Endroid\QrCode\Exception\ValidationException; 18 use Endroid\QrCode\Writer\WriterInterface; 7 use Endroid\QrCode\Color\Color; 8 use Endroid\QrCode\Color\ColorInterface; 9 use Endroid\QrCode\Encoding\Encoding; 10 use Endroid\QrCode\Encoding\EncodingInterface; 11 use Endroid\QrCode\ErrorCorrectionLevel\ErrorCorrectionLevelInterface; 12 use Endroid\QrCode\ErrorCorrectionLevel\ErrorCorrectionLevelLow; 13 use Endroid\QrCode\RoundBlockSizeMode\RoundBlockSizeModeInterface; 14 use Endroid\QrCode\RoundBlockSizeMode\RoundBlockSizeModeMargin; 19 15 20 class QrCode implements QrCodeInterface16 final class QrCode implements QrCodeInterface 21 17 { 22 const LABEL_FONT_PATH_DEFAULT = __DIR__.'/../assets/fonts/noto_sans.otf'; 18 private string $data; 19 private EncodingInterface $encoding; 20 private ErrorCorrectionLevelInterface $errorCorrectionLevel; 21 private int $size; 22 private int $margin; 23 private RoundBlockSizeModeInterface $roundBlockSizeMode; 24 private ColorInterface $foregroundColor; 25 private ColorInterface $backgroundColor; 23 26 24 const ROUND_BLOCK_SIZE_MODE_MARGIN = 'margin'; 25 const ROUND_BLOCK_SIZE_MODE_SHRINK = 'shrink'; 26 const ROUND_BLOCK_SIZE_MODE_ENLARGE = 'enlarge'; 27 28 private $text; 29 30 /** @var int */ 31 private $size = 300; 32 33 /** @var int */ 34 private $margin = 10; 35 36 /** @var array<int> */ 37 private $foregroundColor = [ 38 'r' => 0, 39 'g' => 0, 40 'b' => 0, 41 'a' => 0, 42 ]; 43 44 /** @var array<int> */ 45 private $backgroundColor = [ 46 'r' => 255, 47 'g' => 255, 48 'b' => 255, 49 'a' => 0, 50 ]; 51 52 /** @var string */ 53 private $encoding = 'UTF-8'; 54 55 /** @var bool */ 56 private $roundBlockSize = true; 57 58 /** @var string */ 59 private $roundBlockSizeMode = self::ROUND_BLOCK_SIZE_MODE_MARGIN; 60 61 private $errorCorrectionLevel; 62 63 /** @var string */ 64 private $logoPath; 65 66 /** @var int|null */ 67 private $logoWidth; 68 69 /** @var int|null */ 70 private $logoHeight; 71 72 /** @var string */ 73 private $label; 74 75 /** @var int */ 76 private $labelFontSize = 16; 77 78 /** @var string */ 79 private $labelFontPath = self::LABEL_FONT_PATH_DEFAULT; 80 81 private $labelAlignment; 82 83 /** @var array<string, int> */ 84 private $labelMargin = [ 85 't' => 0, 86 'r' => 10, 87 'b' => 10, 88 'l' => 10, 89 ]; 90 91 /** @var WriterRegistryInterface */ 92 private $writerRegistry; 93 94 /** @var WriterInterface|null */ 95 private $writer; 96 97 /** @var array<mixed> */ 98 private $writerOptions = []; 99 100 /** @var bool */ 101 private $validateResult = false; 102 103 public function __construct(string $text = '') 104 { 105 $this->text = $text; 106 107 $this->errorCorrectionLevel = ErrorCorrectionLevel::LOW(); 108 $this->labelAlignment = LabelAlignment::CENTER(); 109 110 $this->createWriterRegistry(); 27 public function __construct( 28 string $data, 29 EncodingInterface $encoding = null, 30 ErrorCorrectionLevelInterface $errorCorrectionLevel = null, 31 int $size = 300, 32 int $margin = 10, 33 RoundBlockSizeModeInterface $roundBlockSizeMode = null, 34 ColorInterface $foregroundColor = null, 35 ColorInterface $backgroundColor = null 36 ) { 37 $this->data = $data; 38 $this->encoding = $encoding ?? new Encoding('UTF-8'); 39 $this->errorCorrectionLevel = $errorCorrectionLevel ?? new ErrorCorrectionLevelLow(); 40 $this->size = $size; 41 $this->margin = $margin; 42 $this->roundBlockSizeMode = $roundBlockSizeMode ?? new RoundBlockSizeModeMargin(); 43 $this->foregroundColor = $foregroundColor ?? new Color(0, 0, 0); 44 $this->backgroundColor = $backgroundColor ?? new Color(255, 255, 255); 111 45 } 112 46 113 public function setText(string $text): void47 public static function create(string $data): self 114 48 { 115 $this->text = $text;49 return new self($data); 116 50 } 117 51 118 public function get Text(): string52 public function getData(): string 119 53 { 120 return $this-> text;54 return $this->data; 121 55 } 122 56 123 public function set Size(int $size): void57 public function setData(string $data): self 124 58 { 125 $this->size = $size; 59 $this->data = $data; 60 61 return $this; 62 } 63 64 public function getEncoding(): EncodingInterface 65 { 66 return $this->encoding; 67 } 68 69 public function setEncoding(Encoding $encoding): self 70 { 71 $this->encoding = $encoding; 72 73 return $this; 74 } 75 76 public function getErrorCorrectionLevel(): ErrorCorrectionLevelInterface 77 { 78 return $this->errorCorrectionLevel; 79 } 80 81 public function setErrorCorrectionLevel(ErrorCorrectionLevelInterface $errorCorrectionLevel): self 82 { 83 $this->errorCorrectionLevel = $errorCorrectionLevel; 84 85 return $this; 126 86 } 127 87 … … 131 91 } 132 92 133 public function set Margin(int $margin): void93 public function setSize(int $size): self 134 94 { 135 $this->margin = $margin; 95 $this->size = $size; 96 97 return $this; 136 98 } 137 99 … … 141 103 } 142 104 143 /** @param array<int> $foregroundColor */ 144 public function setForegroundColor(array $foregroundColor): void 105 public function setMargin(int $margin): self 145 106 { 146 if (!isset($foregroundColor['a'])) { 147 $foregroundColor['a'] = 0; 148 } 107 $this->margin = $margin; 149 108 150 foreach ($foregroundColor as &$color) { 151 $color = intval($color); 152 } 153 154 $this->foregroundColor = $foregroundColor; 109 return $this; 155 110 } 156 111 157 public function getForegroundColor(): array 112 public function getRoundBlockSizeMode(): RoundBlockSizeModeInterface 113 { 114 return $this->roundBlockSizeMode; 115 } 116 117 public function setRoundBlockSizeMode(RoundBlockSizeModeInterface $roundBlockSizeMode): self 118 { 119 $this->roundBlockSizeMode = $roundBlockSizeMode; 120 121 return $this; 122 } 123 124 public function getForegroundColor(): ColorInterface 158 125 { 159 126 return $this->foregroundColor; 160 127 } 161 128 162 /** @param array<int> $backgroundColor */ 163 public function setBackgroundColor(array $backgroundColor): void 129 public function setForegroundColor(ColorInterface $foregroundColor): self 164 130 { 165 if (!isset($backgroundColor['a'])) { 166 $backgroundColor['a'] = 0; 167 } 131 $this->foregroundColor = $foregroundColor; 168 132 169 foreach ($backgroundColor as &$color) { 170 $color = intval($color); 171 } 172 173 $this->backgroundColor = $backgroundColor; 133 return $this; 174 134 } 175 135 176 public function getBackgroundColor(): array136 public function getBackgroundColor(): ColorInterface 177 137 { 178 138 return $this->backgroundColor; 179 139 } 180 140 181 public function set Encoding(string $encoding): void141 public function setBackgroundColor(ColorInterface $backgroundColor): self 182 142 { 183 $this->encoding = $encoding; 184 } 143 $this->backgroundColor = $backgroundColor; 185 144 186 public function getEncoding(): string 187 { 188 return $this->encoding; 189 } 190 191 public function setRoundBlockSize(bool $roundBlockSize, string $roundBlockSizeMode = self::ROUND_BLOCK_SIZE_MODE_MARGIN): void 192 { 193 $this->roundBlockSize = $roundBlockSize; 194 $this->setRoundBlockSizeMode($roundBlockSizeMode); 195 } 196 197 public function getRoundBlockSize(): bool 198 { 199 return $this->roundBlockSize; 200 } 201 202 public function setRoundBlockSizeMode(string $roundBlockSizeMode): void 203 { 204 if (!in_array($roundBlockSizeMode, [ 205 self::ROUND_BLOCK_SIZE_MODE_ENLARGE, 206 self::ROUND_BLOCK_SIZE_MODE_MARGIN, 207 self::ROUND_BLOCK_SIZE_MODE_SHRINK, 208 ])) { 209 throw new ValidationException('Invalid round block size mode: '.$roundBlockSizeMode); 210 } 211 212 $this->roundBlockSizeMode = $roundBlockSizeMode; 213 } 214 215 public function setErrorCorrectionLevel(ErrorCorrectionLevel $errorCorrectionLevel): void 216 { 217 $this->errorCorrectionLevel = $errorCorrectionLevel; 218 } 219 220 public function getErrorCorrectionLevel(): ErrorCorrectionLevel 221 { 222 return $this->errorCorrectionLevel; 223 } 224 225 public function setLogoPath(string $logoPath): void 226 { 227 $this->logoPath = $logoPath; 228 } 229 230 public function getLogoPath(): ?string 231 { 232 return $this->logoPath; 233 } 234 235 public function setLogoSize(int $logoWidth, int $logoHeight = null): void 236 { 237 $this->logoWidth = $logoWidth; 238 $this->logoHeight = $logoHeight; 239 } 240 241 public function setLogoWidth(int $logoWidth): void 242 { 243 $this->logoWidth = $logoWidth; 244 } 245 246 public function getLogoWidth(): ?int 247 { 248 return $this->logoWidth; 249 } 250 251 public function setLogoHeight(int $logoHeight): void 252 { 253 $this->logoHeight = $logoHeight; 254 } 255 256 public function getLogoHeight(): ?int 257 { 258 return $this->logoHeight; 259 } 260 261 /** @param array<string, int> $labelMargin */ 262 public function setLabel(string $label, int $labelFontSize = null, string $labelFontPath = null, string $labelAlignment = null, array $labelMargin = null): void 263 { 264 $this->label = $label; 265 266 if (null !== $labelFontSize) { 267 $this->setLabelFontSize($labelFontSize); 268 } 269 270 if (null !== $labelFontPath) { 271 $this->setLabelFontPath($labelFontPath); 272 } 273 274 if (null !== $labelAlignment) { 275 $this->setLabelAlignment($labelAlignment); 276 } 277 278 if (null !== $labelMargin) { 279 $this->setLabelMargin($labelMargin); 280 } 281 } 282 283 public function getLabel(): ?string 284 { 285 return $this->label; 286 } 287 288 public function setLabelFontSize(int $labelFontSize): void 289 { 290 $this->labelFontSize = $labelFontSize; 291 } 292 293 public function getLabelFontSize(): int 294 { 295 return $this->labelFontSize; 296 } 297 298 public function setLabelFontPath(string $labelFontPath): void 299 { 300 $resolvedLabelFontPath = (string) realpath($labelFontPath); 301 302 if (!is_file($resolvedLabelFontPath)) { 303 throw new InvalidFontException('Invalid label font path: '.$labelFontPath); 304 } 305 306 $this->labelFontPath = $resolvedLabelFontPath; 307 } 308 309 public function getLabelFontPath(): string 310 { 311 return $this->labelFontPath; 312 } 313 314 public function setLabelAlignment(string $labelAlignment): void 315 { 316 $this->labelAlignment = new LabelAlignment($labelAlignment); 317 } 318 319 public function getLabelAlignment(): string 320 { 321 return $this->labelAlignment->getValue(); 322 } 323 324 /** @param array<string, int> $labelMargin */ 325 public function setLabelMargin(array $labelMargin): void 326 { 327 $this->labelMargin = array_merge($this->labelMargin, $labelMargin); 328 } 329 330 public function getLabelMargin(): array 331 { 332 return $this->labelMargin; 333 } 334 335 public function setWriterRegistry(WriterRegistryInterface $writerRegistry): void 336 { 337 $this->writerRegistry = $writerRegistry; 338 } 339 340 public function setWriter(WriterInterface $writer): void 341 { 342 $this->writer = $writer; 343 } 344 345 public function getWriter(string $name = null): WriterInterface 346 { 347 if (!is_null($name)) { 348 return $this->writerRegistry->getWriter($name); 349 } 350 351 if ($this->writer instanceof WriterInterface) { 352 return $this->writer; 353 } 354 355 return $this->writerRegistry->getDefaultWriter(); 356 } 357 358 /** @param array<string, mixed> $writerOptions */ 359 public function setWriterOptions(array $writerOptions): void 360 { 361 $this->writerOptions = $writerOptions; 362 } 363 364 public function getWriterOptions(): array 365 { 366 return $this->writerOptions; 367 } 368 369 private function createWriterRegistry(): void 370 { 371 $this->writerRegistry = new WriterRegistry(); 372 $this->writerRegistry->loadDefaultWriters(); 373 } 374 375 public function setWriterByName(string $name): void 376 { 377 $this->writer = $this->getWriter($name); 378 } 379 380 public function setWriterByPath(string $path): void 381 { 382 $extension = pathinfo($path, PATHINFO_EXTENSION); 383 384 $this->setWriterByExtension($extension); 385 } 386 387 public function setWriterByExtension(string $extension): void 388 { 389 foreach ($this->writerRegistry->getWriters() as $writer) { 390 if ($writer->supportsExtension($extension)) { 391 $this->writer = $writer; 392 393 return; 394 } 395 } 396 397 throw new UnsupportedExtensionException('Missing writer for extension "'.$extension.'"'); 398 } 399 400 public function writeString(): string 401 { 402 return $this->getWriter()->writeString($this); 403 } 404 405 public function writeDataUri(): string 406 { 407 return $this->getWriter()->writeDataUri($this); 408 } 409 410 public function writeFile(string $path): void 411 { 412 $this->getWriter()->writeFile($this, $path); 413 } 414 415 public function getContentType(): string 416 { 417 return $this->getWriter()->getContentType(); 418 } 419 420 public function setValidateResult(bool $validateResult): void 421 { 422 $this->validateResult = $validateResult; 423 } 424 425 public function getValidateResult(): bool 426 { 427 return $this->validateResult; 428 } 429 430 public function getData(): array 431 { 432 $baconErrorCorrectionLevel = $this->errorCorrectionLevel->toBaconErrorCorrectionLevel(); 433 434 $baconQrCode = Encoder::encode($this->text, $baconErrorCorrectionLevel, $this->encoding); 435 436 $baconMatrix = $baconQrCode->getMatrix(); 437 438 $matrix = []; 439 $columnCount = $baconMatrix->getWidth(); 440 $rowCount = $baconMatrix->getHeight(); 441 for ($rowIndex = 0; $rowIndex < $rowCount; ++$rowIndex) { 442 $matrix[$rowIndex] = []; 443 for ($columnIndex = 0; $columnIndex < $columnCount; ++$columnIndex) { 444 $matrix[$rowIndex][$columnIndex] = $baconMatrix->get($columnIndex, $rowIndex); 445 } 446 } 447 448 $data = ['matrix' => $matrix]; 449 $data['block_count'] = count($matrix[0]); 450 $data['block_size'] = $this->size / $data['block_count']; 451 if ($this->roundBlockSize) { 452 switch ($this->roundBlockSizeMode) { 453 case self::ROUND_BLOCK_SIZE_MODE_ENLARGE: 454 $data['block_size'] = intval(ceil($data['block_size'])); 455 $this->size = $data['block_size'] * $data['block_count']; 456 break; 457 case self::ROUND_BLOCK_SIZE_MODE_SHRINK: 458 $data['block_size'] = intval(floor($data['block_size'])); 459 $this->size = $data['block_size'] * $data['block_count']; 460 break; 461 case self::ROUND_BLOCK_SIZE_MODE_MARGIN: 462 default: 463 $data['block_size'] = intval(floor($data['block_size'])); 464 } 465 } 466 $data['inner_width'] = $data['block_size'] * $data['block_count']; 467 $data['inner_height'] = $data['block_size'] * $data['block_count']; 468 $data['outer_width'] = $this->size + 2 * $this->margin; 469 $data['outer_height'] = $this->size + 2 * $this->margin; 470 $data['margin_left'] = ($data['outer_width'] - $data['inner_width']) / 2; 471 if ($this->roundBlockSize) { 472 $data['margin_left'] = intval(floor($data['margin_left'])); 473 } 474 $data['margin_right'] = $data['outer_width'] - $data['inner_width'] - $data['margin_left']; 475 476 return $data; 145 return $this; 477 146 } 478 147 } -
qr-code-management/trunk/vendor/endroid/qr-code/src/QrCodeInterface.php
r3609180 r3846961 3 3 declare(strict_types=1); 4 4 5 /* 6 * (c) Jeroen van den Enden <info@endroid.nl> 7 * 8 * This source file is subject to the MIT license that is bundled 9 * with this source code in the file LICENSE. 10 */ 5 namespace Endroid\QrCode; 11 6 12 namespace Endroid\QrCode; 7 use Endroid\QrCode\Color\ColorInterface; 8 use Endroid\QrCode\Encoding\EncodingInterface; 9 use Endroid\QrCode\ErrorCorrectionLevel\ErrorCorrectionLevelInterface; 10 use Endroid\QrCode\RoundBlockSizeMode\RoundBlockSizeModeInterface; 13 11 14 12 interface QrCodeInterface 15 13 { 16 public function getText(): string; 14 public function getData(): string; 15 16 public function getEncoding(): EncodingInterface; 17 18 public function getErrorCorrectionLevel(): ErrorCorrectionLevelInterface; 17 19 18 20 public function getSize(): int; … … 20 22 public function getMargin(): int; 21 23 22 /** @return array<int> */ 23 public function getForegroundColor(): array; 24 public function getRoundBlockSizeMode(): RoundBlockSizeModeInterface; 24 25 25 /** @return array<int> */ 26 public function getBackgroundColor(): array; 26 public function getForegroundColor(): ColorInterface; 27 27 28 public function getEncoding(): string; 29 30 public function getRoundBlockSize(): bool; 31 32 public function getErrorCorrectionLevel(): ErrorCorrectionLevel; 33 34 public function getLogoPath(): ?string; 35 36 public function getLogoWidth(): ?int; 37 38 public function getLogoHeight(): ?int; 39 40 public function getLabel(): ?string; 41 42 public function getLabelFontPath(): string; 43 44 public function getLabelFontSize(): int; 45 46 public function getLabelAlignment(): string; 47 48 /** @return array<int> */ 49 public function getLabelMargin(): array; 50 51 public function getValidateResult(): bool; 52 53 /** @return array<mixed> */ 54 public function getWriterOptions(): array; 55 56 public function getContentType(): string; 57 58 public function setWriterRegistry(WriterRegistryInterface $writerRegistry): void; 59 60 public function writeString(): string; 61 62 public function writeDataUri(): string; 63 64 public function writeFile(string $path): void; 65 66 /** @return array<mixed> */ 67 public function getData(): array; 28 public function getBackgroundColor(): ColorInterface; 68 29 } -
qr-code-management/trunk/vendor/endroid/qr-code/src/Writer/BinaryWriter.php
r3609180 r3846961 3 3 declare(strict_types=1); 4 4 5 /*6 * (c) Jeroen van den Enden <info@endroid.nl>7 *8 * This source file is subject to the MIT license that is bundled9 * with this source code in the file LICENSE.10 */11 12 5 namespace Endroid\QrCode\Writer; 13 6 7 use Endroid\QrCode\Bacon\MatrixFactory; 8 use Endroid\QrCode\Label\LabelInterface; 9 use Endroid\QrCode\Logo\LogoInterface; 14 10 use Endroid\QrCode\QrCodeInterface; 11 use Endroid\QrCode\Writer\Result\BinaryResult; 12 use Endroid\QrCode\Writer\Result\ResultInterface; 15 13 16 class BinaryWriter extends AbstractWriter 14 final class BinaryWriter implements WriterInterface 17 15 { 18 public function write String(QrCodeInterface $qrCode): string16 public function write(QrCodeInterface $qrCode, LogoInterface $logo = null, LabelInterface $label = null, array $options = []): ResultInterface 19 17 { 20 $rows = []; 21 $data = $qrCode->getData(); 22 foreach ($data['matrix'] as $row) { 23 $values = ''; 24 foreach ($row as $value) { 25 $values .= $value; 26 } 27 $rows[] = $values; 28 } 18 $matrixFactory = new MatrixFactory(); 19 $matrix = $matrixFactory->create($qrCode); 29 20 30 return implode("\n", $rows); 31 } 32 33 public static function getContentType(): string 34 { 35 return 'text/plain'; 36 } 37 38 public static function getSupportedExtensions(): array 39 { 40 return ['bin', 'txt']; 41 } 42 43 public function getName(): string 44 { 45 return 'binary'; 21 return new BinaryResult($matrix); 46 22 } 47 23 } -
qr-code-management/trunk/vendor/endroid/qr-code/src/Writer/DebugWriter.php
r3609180 r3846961 3 3 declare(strict_types=1); 4 4 5 /*6 * (c) Jeroen van den Enden <info@endroid.nl>7 *8 * This source file is subject to the MIT license that is bundled9 * with this source code in the file LICENSE.10 */11 12 5 namespace Endroid\QrCode\Writer; 13 6 7 use Endroid\QrCode\Bacon\MatrixFactory; 8 use Endroid\QrCode\Label\LabelInterface; 9 use Endroid\QrCode\Logo\LogoInterface; 14 10 use Endroid\QrCode\QrCodeInterface; 15 use E xception;16 use ReflectionClass;11 use Endroid\QrCode\Writer\Result\DebugResult; 12 use Endroid\QrCode\Writer\Result\ResultInterface; 17 13 18 class DebugWriter extends AbstractWriter 14 final class DebugWriter implements WriterInterface, ValidatingWriterInterface 19 15 { 20 public function write String(QrCodeInterface $qrCode): string16 public function write(QrCodeInterface $qrCode, LogoInterface $logo = null, LabelInterface $label = null, array $options = []): ResultInterface 21 17 { 22 $ data = [];23 $ skip = ['getData'];18 $matrixFactory = new MatrixFactory(); 19 $matrix = $matrixFactory->create($qrCode); 24 20 25 $reflectionClass = new ReflectionClass($qrCode); 26 foreach ($reflectionClass->getMethods() as $method) { 27 $methodName = $method->getShortName(); 28 if (0 === strpos($methodName, 'get') && 0 == $method->getNumberOfParameters() && !in_array($methodName, $skip)) { 29 $value = $qrCode->{$methodName}(); 30 if (is_array($value) && !is_object(current($value))) { 31 $value = '['.implode(', ', $value).']'; 32 } elseif (is_bool($value)) { 33 $value = $value ? 'true' : 'false'; 34 } elseif (is_string($value)) { 35 $value = '"'.$value.'"'; 36 } elseif (is_null($value)) { 37 $value = 'null'; 38 } 39 try { 40 $data[] = $methodName.': '.$value; 41 } catch (Exception $exception) { 42 } 43 } 21 return new DebugResult($matrix, $qrCode, $logo, $label, $options); 22 } 23 24 public function validateResult(ResultInterface $result, string $expectedData): void 25 { 26 if (!$result instanceof DebugResult) { 27 throw new \Exception('Unable to write logo: instance of DebugResult expected'); 44 28 } 45 29 46 $string = implode(" \n", $data); 47 48 return $string; 49 } 50 51 public static function getContentType(): string 52 { 53 return 'text/plain'; 54 } 55 56 public function getName(): string 57 { 58 return 'debug'; 30 $result->setValidateResult(true); 59 31 } 60 32 } -
qr-code-management/trunk/vendor/endroid/qr-code/src/Writer/EpsWriter.php
r3609180 r3846961 3 3 declare(strict_types=1); 4 4 5 /*6 * (c) Jeroen van den Enden <info@endroid.nl>7 *8 * This source file is subject to the MIT license that is bundled9 * with this source code in the file LICENSE.10 */11 12 5 namespace Endroid\QrCode\Writer; 13 6 7 use Endroid\QrCode\Bacon\MatrixFactory; 8 use Endroid\QrCode\Label\LabelInterface; 9 use Endroid\QrCode\Logo\LogoInterface; 14 10 use Endroid\QrCode\QrCodeInterface; 11 use Endroid\QrCode\Writer\Result\EpsResult; 12 use Endroid\QrCode\Writer\Result\ResultInterface; 15 13 16 class EpsWriter extends AbstractWriter 14 final class EpsWriter implements WriterInterface 17 15 { 18 public function writeString(QrCodeInterface $qrCode): string 16 public const DECIMAL_PRECISION = 10; 17 18 public function write(QrCodeInterface $qrCode, LogoInterface $logo = null, LabelInterface $label = null, array $options = []): ResultInterface 19 19 { 20 $data = $qrCode->getData(); 20 $matrixFactory = new MatrixFactory(); 21 $matrix = $matrixFactory->create($qrCode); 21 22 22 $epsData = []; 23 $epsData[] = '%!PS-Adobe-3.0 EPSF-3.0'; 24 $epsData[] = '%%BoundingBox: 0 0 '.$data['outer_width'].' '.$data['outer_height']; 25 $epsData[] = '/F { rectfill } def'; 26 $epsData[] = number_format($qrCode->getBackgroundColor()['r'] / 100, 2, '.', ',').' '.number_format($qrCode->getBackgroundColor()['g'] / 100, 2, '.', ',').' '.number_format($qrCode->getBackgroundColor()['b'] / 100, 2, '.', ',').' setrgbcolor'; 27 $epsData[] = '0 0 '.$data['outer_width'].' '.$data['outer_height'].' F'; 28 $epsData[] = number_format($qrCode->getForegroundColor()['r'] / 100, 2, '.', ',').' '.number_format($qrCode->getForegroundColor()['g'] / 100, 2, '.', ',').' '.number_format($qrCode->getForegroundColor()['b'] / 100, 2, '.', ',').' setrgbcolor'; 23 $lines = [ 24 '%!PS-Adobe-3.0 EPSF-3.0', 25 '%%BoundingBox: 0 0 '.$matrix->getOuterSize().' '.$matrix->getOuterSize(), 26 '/F { rectfill } def', 27 number_format($qrCode->getBackgroundColor()->getRed() / 100, 2, '.', ',').' '.number_format($qrCode->getBackgroundColor()->getGreen() / 100, 2, '.', ',').' '.number_format($qrCode->getBackgroundColor()->getBlue() / 100, 2, '.', ',').' setrgbcolor', 28 '0 0 '.$matrix->getOuterSize().' '.$matrix->getOuterSize().' F', 29 number_format($qrCode->getForegroundColor()->getRed() / 100, 2, '.', ',').' '.number_format($qrCode->getForegroundColor()->getGreen() / 100, 2, '.', ',').' '.number_format($qrCode->getForegroundColor()->getBlue() / 100, 2, '.', ',').' setrgbcolor', 30 ]; 29 31 30 // Please note an EPS has a reversed Y axis compared to PNG and SVG 31 $data['matrix'] = array_reverse($data['matrix']); 32 foreach ($data['matrix'] as $row => $values) { 33 foreach ($values as $column => $value) { 34 if (1 === $value) { 35 $x = $data['margin_left'] + $data['block_size'] * $column; 36 $y = $data['margin_left'] + $data['block_size'] * $row; 37 $epsData[] = $x.' '.$y.' '.$data['block_size'].' '.$data['block_size'].' F'; 32 for ($rowIndex = 0; $rowIndex < $matrix->getBlockCount(); ++$rowIndex) { 33 for ($columnIndex = 0; $columnIndex < $matrix->getBlockCount(); ++$columnIndex) { 34 if (1 === $matrix->getBlockValue($matrix->getBlockCount() - 1 - $rowIndex, $columnIndex)) { 35 $x = $matrix->getMarginLeft() + $matrix->getBlockSize() * $columnIndex; 36 $y = $matrix->getMarginLeft() + $matrix->getBlockSize() * $rowIndex; 37 $lines[] = number_format($x, self::DECIMAL_PRECISION, '.', '').' '.number_format($y, self::DECIMAL_PRECISION, '.', '').' '.number_format($matrix->getBlockSize(), self::DECIMAL_PRECISION, '.', '').' '.number_format($matrix->getBlockSize(), self::DECIMAL_PRECISION, '.', '').' F'; 38 38 } 39 39 } 40 40 } 41 41 42 return implode("\n", $epsData); 43 } 44 45 public static function getContentType(): string 46 { 47 return 'image/eps'; 48 } 49 50 public static function getSupportedExtensions(): array 51 { 52 return ['eps']; 53 } 54 55 public function getName(): string 56 { 57 return 'eps'; 42 return new EpsResult($matrix, $lines); 58 43 } 59 44 } -
qr-code-management/trunk/vendor/endroid/qr-code/src/Writer/PngWriter.php
r3609180 r3846961 3 3 declare(strict_types=1); 4 4 5 /*6 * (c) Jeroen van den Enden <info@endroid.nl>7 *8 * This source file is subject to the MIT license that is bundled9 * with this source code in the file LICENSE.10 */11 12 5 namespace Endroid\QrCode\Writer; 13 6 14 use Endroid\QrCode\Exception\GenerateImageException; 15 use Endroid\QrCode\Exception\MissingFunctionException; 16 use Endroid\QrCode\Exception\MissingLogoHeightException; 7 use Endroid\QrCode\Bacon\MatrixFactory; 17 8 use Endroid\QrCode\Exception\ValidationException; 18 use Endroid\QrCode\LabelAlignment; 9 use Endroid\QrCode\ImageData\LabelImageData; 10 use Endroid\QrCode\ImageData\LogoImageData; 11 use Endroid\QrCode\Label\Alignment\LabelAlignmentLeft; 12 use Endroid\QrCode\Label\Alignment\LabelAlignmentRight; 13 use Endroid\QrCode\Label\LabelInterface; 14 use Endroid\QrCode\Logo\LogoInterface; 19 15 use Endroid\QrCode\QrCodeInterface; 16 use Endroid\QrCode\RoundBlockSizeMode\RoundBlockSizeModeNone; 17 use Endroid\QrCode\Writer\Result\PngResult; 18 use Endroid\QrCode\Writer\Result\ResultInterface; 20 19 use Zxing\QrReader; 21 20 22 class PngWriter extends AbstractWriter 21 final class PngWriter implements WriterInterface, ValidatingWriterInterface 23 22 { 24 public function write String(QrCodeInterface $qrCode): string23 public function write(QrCodeInterface $qrCode, LogoInterface $logo = null, LabelInterface $label = null, array $options = []): ResultInterface 25 24 { 26 25 if (!extension_loaded('gd')) { 27 throw new GenerateImageException('Unable to generate image: check your GD installation'); 28 } 29 30 $image = $this->createImage($qrCode->getData(), $qrCode); 31 32 $logoPath = $qrCode->getLogoPath(); 33 if (null !== $logoPath) { 34 $image = $this->addLogo($image, $logoPath, $qrCode->getLogoWidth(), $qrCode->getLogoHeight()); 35 } 36 37 $label = $qrCode->getLabel(); 38 if (null !== $label) { 39 $image = $this->addLabel($image, $label, $qrCode->getLabelFontPath(), $qrCode->getLabelFontSize(), $qrCode->getLabelAlignment(), $qrCode->getLabelMargin(), $qrCode->getForegroundColor(), $qrCode->getBackgroundColor()); 40 } 41 42 $string = $this->imageToString($image); 43 44 if (PHP_VERSION_ID < 80000) { 45 imagedestroy($image); 46 } 47 48 if ($qrCode->getValidateResult()) { 49 $reader = new QrReader($string, QrReader::SOURCE_TYPE_BLOB); 50 if ($reader->text() !== $qrCode->getText()) { 51 throw new ValidationException('Built-in validation reader read "'.$reader->text().'" instead of "'.$qrCode->getText().'". 52 Adjust your parameters to increase readability or disable built-in validation.'); 26 throw new \Exception('Unable to generate image: please check if the GD extension is enabled and configured correctly'); 27 } 28 29 $matrixFactory = new MatrixFactory(); 30 $matrix = $matrixFactory->create($qrCode); 31 32 $baseBlockSize = $qrCode->getRoundBlockSizeMode() instanceof RoundBlockSizeModeNone ? 10 : intval($matrix->getBlockSize()); 33 $baseImage = imagecreatetruecolor($matrix->getBlockCount() * $baseBlockSize, $matrix->getBlockCount() * $baseBlockSize); 34 35 if (!$baseImage) { 36 throw new \Exception('Unable to generate image: please check if the GD extension is enabled and configured correctly'); 37 } 38 39 /** @var int $foregroundColor */ 40 $foregroundColor = imagecolorallocatealpha( 41 $baseImage, 42 $qrCode->getForegroundColor()->getRed(), 43 $qrCode->getForegroundColor()->getGreen(), 44 $qrCode->getForegroundColor()->getBlue(), 45 $qrCode->getForegroundColor()->getAlpha() 46 ); 47 48 /** @var int $transparentColor */ 49 $transparentColor = imagecolorallocatealpha($baseImage, 255, 255, 255, 127); 50 51 imagefill($baseImage, 0, 0, $transparentColor); 52 53 for ($rowIndex = 0; $rowIndex < $matrix->getBlockCount(); ++$rowIndex) { 54 for ($columnIndex = 0; $columnIndex < $matrix->getBlockCount(); ++$columnIndex) { 55 if (1 === $matrix->getBlockValue($rowIndex, $columnIndex)) { 56 imagefilledrectangle( 57 $baseImage, 58 $columnIndex * $baseBlockSize, 59 $rowIndex * $baseBlockSize, 60 ($columnIndex + 1) * $baseBlockSize - 1, 61 ($rowIndex + 1) * $baseBlockSize - 1, 62 $foregroundColor 63 ); 64 } 53 65 } 54 66 } 55 67 56 return $string; 57 } 58 59 /** 60 * @param array<mixed> $data 61 * 62 * @return mixed 63 */ 64 private function createImage(array $data, QrCodeInterface $qrCode) 65 { 66 $baseSize = $qrCode->getRoundBlockSize() ? $data['block_size'] : 25; 67 68 $baseImage = $this->createBaseImage($baseSize, $data, $qrCode); 69 $interpolatedImage = $this->createInterpolatedImage($baseImage, $data, $qrCode); 68 $targetWidth = $matrix->getOuterSize(); 69 $targetHeight = $matrix->getOuterSize(); 70 71 if ($label instanceof LabelInterface) { 72 $labelImageData = LabelImageData::createForLabel($label); 73 $targetHeight += $labelImageData->getHeight() + $label->getMargin()->getTop() + $label->getMargin()->getBottom(); 74 } 75 76 $targetImage = imagecreatetruecolor($targetWidth, $targetHeight); 77 78 if (!$targetImage) { 79 throw new \Exception('Unable to generate image: please check if the GD extension is enabled and configured correctly'); 80 } 81 82 /** @var int $backgroundColor */ 83 $backgroundColor = imagecolorallocatealpha( 84 $targetImage, 85 $qrCode->getBackgroundColor()->getRed(), 86 $qrCode->getBackgroundColor()->getGreen(), 87 $qrCode->getBackgroundColor()->getBlue(), 88 $qrCode->getBackgroundColor()->getAlpha() 89 ); 90 91 imagefill($targetImage, 0, 0, $backgroundColor); 92 93 imagecopyresampled( 94 $targetImage, 95 $baseImage, 96 $matrix->getMarginLeft(), 97 $matrix->getMarginLeft(), 98 0, 99 0, 100 $matrix->getInnerSize(), 101 $matrix->getInnerSize(), 102 imagesx($baseImage), 103 imagesy($baseImage) 104 ); 70 105 71 106 if (PHP_VERSION_ID < 80000) { … … 73 108 } 74 109 75 return $interpolatedImage; 76 } 77 78 /** 79 * @param array<mixed> $data 80 * 81 * @return mixed 82 */ 83 private function createBaseImage(int $baseSize, array $data, QrCodeInterface $qrCode) 84 { 85 $image = imagecreatetruecolor($data['block_count'] * $baseSize, $data['block_count'] * $baseSize); 86 87 if (!$image) { 88 throw new GenerateImageException('Unable to generate image: check your GD installation'); 89 } 90 91 $foregroundColor = imagecolorallocatealpha($image, $qrCode->getForegroundColor()['r'], $qrCode->getForegroundColor()['g'], $qrCode->getForegroundColor()['b'], $qrCode->getForegroundColor()['a']); 92 if (!is_int($foregroundColor)) { 93 throw new GenerateImageException('Foreground color could not be allocated'); 94 } 95 96 $backgroundColor = imagecolorallocatealpha($image, $qrCode->getBackgroundColor()['r'], $qrCode->getBackgroundColor()['g'], $qrCode->getBackgroundColor()['b'], $qrCode->getBackgroundColor()['a']); 97 if (!is_int($backgroundColor)) { 98 throw new GenerateImageException('Background color could not be allocated'); 99 } 100 101 imagefill($image, 0, 0, $backgroundColor); 102 103 foreach ($data['matrix'] as $row => $values) { 104 foreach ($values as $column => $value) { 105 if (1 === $value) { 106 imagefilledrectangle($image, $column * $baseSize, $row * $baseSize, intval(($column + 1) * $baseSize), intval(($row + 1) * $baseSize), $foregroundColor); 110 if ($qrCode->getBackgroundColor()->getAlpha() > 0) { 111 imagesavealpha($targetImage, true); 112 } 113 114 $result = new PngResult($matrix, $targetImage); 115 116 if ($logo instanceof LogoInterface) { 117 $result = $this->addLogo($logo, $result); 118 } 119 120 if ($label instanceof LabelInterface) { 121 $result = $this->addLabel($label, $result); 122 } 123 124 return $result; 125 } 126 127 private function addLogo(LogoInterface $logo, PngResult $result): PngResult 128 { 129 $logoImageData = LogoImageData::createForLogo($logo); 130 131 if ('image/svg+xml' === $logoImageData->getMimeType()) { 132 throw new \Exception('PNG Writer does not support SVG logo'); 133 } 134 135 $targetImage = $result->getImage(); 136 $matrix = $result->getMatrix(); 137 138 if ($logoImageData->getPunchoutBackground()) { 139 /** @var int $transparent */ 140 $transparent = imagecolorallocatealpha($targetImage, 255, 255, 255, 127); 141 imagealphablending($targetImage, false); 142 $xOffsetStart = intval($matrix->getOuterSize() / 2 - $logoImageData->getWidth() / 2); 143 $yOffsetStart = intval($matrix->getOuterSize() / 2 - $logoImageData->getHeight() / 2); 144 for ($xOffset = $xOffsetStart; $xOffset < $xOffsetStart + $logoImageData->getWidth(); ++$xOffset) { 145 for ($yOffset = $yOffsetStart; $yOffset < $yOffsetStart + $logoImageData->getHeight(); ++$yOffset) { 146 imagesetpixel($targetImage, $xOffset, $yOffset, $transparent); 107 147 } 108 148 } 109 149 } 110 150 111 return $image; 112 } 113 114 /** 115 * @param mixed $baseImage 116 * @param array<mixed> $data 117 * 118 * @return mixed 119 */ 120 private function createInterpolatedImage($baseImage, array $data, QrCodeInterface $qrCode) 121 { 122 $image = imagecreatetruecolor($data['outer_width'], $data['outer_height']); 123 124 if (!$image) { 125 throw new GenerateImageException('Unable to generate image: check your GD installation'); 126 } 127 128 $backgroundColor = imagecolorallocatealpha($image, $qrCode->getBackgroundColor()['r'], $qrCode->getBackgroundColor()['g'], $qrCode->getBackgroundColor()['b'], $qrCode->getBackgroundColor()['a']); 129 if (!is_int($backgroundColor)) { 130 throw new GenerateImageException('Background color could not be allocated'); 131 } 132 133 imagefill($image, 0, 0, $backgroundColor); 134 imagecopyresampled($image, $baseImage, (int) $data['margin_left'], (int) $data['margin_left'], 0, 0, (int) $data['inner_width'], (int) $data['inner_height'], imagesx($baseImage), imagesy($baseImage)); 135 136 if ($qrCode->getBackgroundColor()['a'] > 0) { 137 imagesavealpha($image, true); 138 } 139 140 return $image; 141 } 142 143 /** 144 * @param mixed $sourceImage 145 * 146 * @return mixed 147 */ 148 private function addLogo($sourceImage, string $logoPath, int $logoWidth = null, int $logoHeight = null) 149 { 150 $mimeType = $this->getMimeType($logoPath); 151 $logoImage = imagecreatefromstring(strval(file_get_contents($logoPath))); 152 153 if ('image/svg+xml' === $mimeType && (null === $logoHeight || null === $logoWidth)) { 154 throw new MissingLogoHeightException('SVG Logos require an explicit height set via setLogoSize($width, $height)'); 155 } 156 157 if (!$logoImage) { 158 throw new GenerateImageException('Unable to generate image: check your GD installation or logo path'); 159 } 160 161 $logoSourceWidth = imagesx($logoImage); 162 $logoSourceHeight = imagesy($logoImage); 163 164 if (null === $logoWidth) { 165 $logoWidth = $logoSourceWidth; 166 } 167 168 if (null === $logoHeight) { 169 $aspectRatio = $logoWidth / $logoSourceWidth; 170 $logoHeight = intval($logoSourceHeight * $aspectRatio); 171 } 172 173 $logoX = imagesx($sourceImage) / 2 - $logoWidth / 2; 174 $logoY = imagesy($sourceImage) / 2 - $logoHeight / 2; 175 176 imagecopyresampled($sourceImage, $logoImage, intval($logoX), intval($logoY), 0, 0, $logoWidth, $logoHeight, $logoSourceWidth, $logoSourceHeight); 151 imagecopyresampled( 152 $targetImage, 153 $logoImageData->getImage(), 154 intval($matrix->getOuterSize() / 2 - $logoImageData->getWidth() / 2), 155 intval($matrix->getOuterSize() / 2 - $logoImageData->getHeight() / 2), 156 0, 157 0, 158 $logoImageData->getWidth(), 159 $logoImageData->getHeight(), 160 imagesx($logoImageData->getImage()), 161 imagesy($logoImageData->getImage()) 162 ); 177 163 178 164 if (PHP_VERSION_ID < 80000) { 179 imagedestroy($logoImage); 180 } 181 182 return $sourceImage; 183 } 184 185 /** 186 * @param mixed $sourceImage 187 * @param array<int> $labelMargin 188 * @param array<int> $foregroundColor 189 * @param array<int> $backgroundColor 190 * 191 * @return mixed 192 */ 193 private function addLabel($sourceImage, string $label, string $labelFontPath, int $labelFontSize, string $labelAlignment, array $labelMargin, array $foregroundColor, array $backgroundColor) 194 { 195 if (!function_exists('imagettfbbox')) { 196 throw new MissingFunctionException('Missing function "imagettfbbox", please make sure you installed the FreeType library'); 197 } 198 199 $labelBox = imagettfbbox($labelFontSize, 0, $labelFontPath, $label); 200 if (!$labelBox) { 201 throw new GenerateImageException('Unable to add label: check your GD installation'); 202 } 203 204 $labelBoxWidth = intval($labelBox[2] - $labelBox[0]); 205 $labelBoxHeight = intval($labelBox[0] - $labelBox[7]); 206 207 $sourceWidth = imagesx($sourceImage); 208 $sourceHeight = imagesy($sourceImage); 209 $targetWidth = $sourceWidth; 210 $targetHeight = $sourceHeight + $labelBoxHeight + $labelMargin['t'] + $labelMargin['b']; 211 212 // Create empty target image 213 $targetImage = imagecreatetruecolor($targetWidth, $targetHeight); 214 215 if (!$targetImage) { 216 throw new GenerateImageException('Unable to generate image: check your GD installation'); 217 } 218 219 $foregroundColor = imagecolorallocate($targetImage, $foregroundColor['r'], $foregroundColor['g'], $foregroundColor['b']); 220 if (!is_int($foregroundColor)) { 221 throw new GenerateImageException('Foreground color could not be allocated'); 222 } 223 224 $backgroundColor = imagecolorallocate($targetImage, $backgroundColor['r'], $backgroundColor['g'], $backgroundColor['b']); 225 if (!is_int($backgroundColor)) { 226 throw new GenerateImageException('Background color could not be allocated'); 227 } 228 229 imagefill($targetImage, 0, 0, $backgroundColor); 230 231 // Copy source image to target image 232 imagecopyresampled($targetImage, $sourceImage, 0, 0, 0, 0, $sourceWidth, $sourceHeight, $sourceWidth, $sourceHeight); 233 234 if (PHP_VERSION_ID < 80000) { 235 imagedestroy($sourceImage); 236 } 237 238 switch ($labelAlignment) { 239 case LabelAlignment::LEFT: 240 $labelX = $labelMargin['l']; 241 break; 242 case LabelAlignment::RIGHT: 243 $labelX = $targetWidth - $labelBoxWidth - $labelMargin['r']; 244 break; 245 default: 246 $labelX = intval($targetWidth / 2 - $labelBoxWidth / 2); 247 break; 248 } 249 250 $labelY = $targetHeight - $labelMargin['b']; 251 imagettftext($targetImage, $labelFontSize, 0, $labelX, $labelY, $foregroundColor, $labelFontPath, $label); 252 253 return $targetImage; 254 } 255 256 /** 257 * @param mixed $image 258 */ 259 private function imageToString($image): string 260 { 261 ob_start(); 262 imagepng($image); 263 264 return (string) ob_get_clean(); 265 } 266 267 public static function getContentType(): string 268 { 269 return 'image/png'; 270 } 271 272 public static function getSupportedExtensions(): array 273 { 274 return ['png']; 275 } 276 277 public function getName(): string 278 { 279 return 'png'; 165 imagedestroy($logoImageData->getImage()); 166 } 167 168 return new PngResult($matrix, $targetImage); 169 } 170 171 private function addLabel(LabelInterface $label, PngResult $result): PngResult 172 { 173 $targetImage = $result->getImage(); 174 175 $labelImageData = LabelImageData::createForLabel($label); 176 177 /** @var int $textColor */ 178 $textColor = imagecolorallocatealpha( 179 $targetImage, 180 $label->getTextColor()->getRed(), 181 $label->getTextColor()->getGreen(), 182 $label->getTextColor()->getBlue(), 183 $label->getTextColor()->getAlpha() 184 ); 185 186 $x = intval(imagesx($targetImage) / 2 - $labelImageData->getWidth() / 2); 187 $y = imagesy($targetImage) - $label->getMargin()->getBottom(); 188 189 if ($label->getAlignment() instanceof LabelAlignmentLeft) { 190 $x = $label->getMargin()->getLeft(); 191 } elseif ($label->getAlignment() instanceof LabelAlignmentRight) { 192 $x = imagesx($targetImage) - $labelImageData->getWidth() - $label->getMargin()->getRight(); 193 } 194 195 imagettftext($targetImage, $label->getFont()->getSize(), 0, $x, $y, $textColor, $label->getFont()->getPath(), $label->getText()); 196 197 return new PngResult($result->getMatrix(), $targetImage); 198 } 199 200 public function validateResult(ResultInterface $result, string $expectedData): void 201 { 202 $string = $result->getString(); 203 204 if (!class_exists(QrReader::class)) { 205 throw ValidationException::createForMissingPackage('khanamiryan/qrcode-detector-decoder'); 206 } 207 208 if (PHP_VERSION_ID >= 80000) { 209 throw ValidationException::createForIncompatiblePhpVersion(); 210 } 211 212 $reader = new QrReader($string, QrReader::SOURCE_TYPE_BLOB); 213 if ($reader->text() !== $expectedData) { 214 throw ValidationException::createForInvalidData($expectedData, strval($reader->text())); 215 } 280 216 } 281 217 } -
qr-code-management/trunk/vendor/endroid/qr-code/src/Writer/SvgWriter.php
r3609180 r3846961 3 3 declare(strict_types=1); 4 4 5 /*6 * (c) Jeroen van den Enden <info@endroid.nl>7 *8 * This source file is subject to the MIT license that is bundled9 * with this source code in the file LICENSE.10 */11 12 5 namespace Endroid\QrCode\Writer; 13 6 14 use Endroid\QrCode\Exception\GenerateImageException; 15 use Endroid\QrCode\Exception\MissingLogoHeightException; 16 use Endroid\QrCode\Exception\ValidationException; 7 use Endroid\QrCode\Bacon\MatrixFactory; 8 use Endroid\QrCode\ImageData\LogoImageData; 9 use Endroid\QrCode\Label\LabelInterface; 10 use Endroid\QrCode\Logo\LogoInterface; 17 11 use Endroid\QrCode\QrCodeInterface; 18 use SimpleXMLElement; 12 use Endroid\QrCode\Writer\Result\ResultInterface; 13 use Endroid\QrCode\Writer\Result\SvgResult; 19 14 20 class SvgWriter extends AbstractWriter 15 final class SvgWriter implements WriterInterface 21 16 { 22 public function writeString(QrCodeInterface $qrCode): string 17 public const DECIMAL_PRECISION = 10; 18 public const WRITER_OPTION_BLOCK_ID = 'block_id'; 19 public const WRITER_OPTION_EXCLUDE_XML_DECLARATION = 'exclude_xml_declaration'; 20 public const WRITER_OPTION_EXCLUDE_SVG_WIDTH_AND_HEIGHT = 'exclude_svg_width_and_height'; 21 public const WRITER_OPTION_FORCE_XLINK_HREF = 'force_xlink_href'; 22 23 public function write(QrCodeInterface $qrCode, LogoInterface $logo = null, LabelInterface $label = null, array $options = []): ResultInterface 23 24 { 24 $options = $qrCode->getWriterOptions(); 25 26 if ($qrCode->getValidateResult()) { 27 throw new ValidationException('Built-in validation reader can not check SVG images: please disable via setValidateResult(false)'); 25 if (!isset($options[self::WRITER_OPTION_BLOCK_ID])) { 26 $options[self::WRITER_OPTION_BLOCK_ID] = 'block'; 28 27 } 29 28 30 $data = $qrCode->getData(); 29 if (!isset($options[self::WRITER_OPTION_EXCLUDE_XML_DECLARATION])) { 30 $options[self::WRITER_OPTION_EXCLUDE_XML_DECLARATION] = false; 31 } 31 32 32 $svg = new SimpleXMLElement('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"/>'); 33 $svg->addAttribute('version', '1.1'); 34 $svg->addAttribute('width', $data['outer_width'].'px'); 35 $svg->addAttribute('height', $data['outer_height'].'px'); 36 $svg->addAttribute('viewBox', '0 0 '.$data['outer_width'].' '.$data['outer_height']); 37 $svg->addChild('defs'); 33 if (!isset($options[self::WRITER_OPTION_EXCLUDE_SVG_WIDTH_AND_HEIGHT])) { 34 $options[self::WRITER_OPTION_EXCLUDE_SVG_WIDTH_AND_HEIGHT] = false; 35 } 38 36 39 // Block definition 40 $block_id = isset($options['rect_id']) && $options['rect_id'] ? $options['rect_id'] : 'block'; 41 $blockDefinition = $svg->defs->addChild('rect'); 42 $blockDefinition->addAttribute('id', $block_id); 43 $blockDefinition->addAttribute('width', strval($data['block_size'])); 44 $blockDefinition->addAttribute('height', strval($data['block_size'])); 45 $blockDefinition->addAttribute('fill', '#'.sprintf('%02x%02x%02x', $qrCode->getForegroundColor()['r'], $qrCode->getForegroundColor()['g'], $qrCode->getForegroundColor()['b'])); 46 $blockDefinition->addAttribute('fill-opacity', strval($this->getOpacity($qrCode->getForegroundColor()['a']))); 37 $matrixFactory = new MatrixFactory(); 38 $matrix = $matrixFactory->create($qrCode); 47 39 48 // Background 49 $background = $svg->addChild('rect'); 40 $xml = new \SimpleXMLElement('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"/>'); 41 $xml->addAttribute('version', '1.1'); 42 if (!$options[self::WRITER_OPTION_EXCLUDE_SVG_WIDTH_AND_HEIGHT]) { 43 $xml->addAttribute('width', $matrix->getOuterSize().'px'); 44 $xml->addAttribute('height', $matrix->getOuterSize().'px'); 45 } 46 $xml->addAttribute('viewBox', '0 0 '.$matrix->getOuterSize().' '.$matrix->getOuterSize()); 47 $xml->addChild('defs'); 48 49 $blockDefinition = $xml->defs->addChild('rect'); 50 $blockDefinition->addAttribute('id', strval($options[self::WRITER_OPTION_BLOCK_ID])); 51 $blockDefinition->addAttribute('width', number_format($matrix->getBlockSize(), self::DECIMAL_PRECISION, '.', '')); 52 $blockDefinition->addAttribute('height', number_format($matrix->getBlockSize(), self::DECIMAL_PRECISION, '.', '')); 53 $blockDefinition->addAttribute('fill', '#'.sprintf('%02x%02x%02x', $qrCode->getForegroundColor()->getRed(), $qrCode->getForegroundColor()->getGreen(), $qrCode->getForegroundColor()->getBlue())); 54 $blockDefinition->addAttribute('fill-opacity', strval($qrCode->getForegroundColor()->getOpacity())); 55 56 $background = $xml->addChild('rect'); 50 57 $background->addAttribute('x', '0'); 51 58 $background->addAttribute('y', '0'); 52 $background->addAttribute('width', strval($ data['outer_width']));53 $background->addAttribute('height', strval($ data['outer_height']));54 $background->addAttribute('fill', '#'.sprintf('%02x%02x%02x', $qrCode->getBackgroundColor() ['r'], $qrCode->getBackgroundColor()['g'], $qrCode->getBackgroundColor()['b']));55 $background->addAttribute('fill-opacity', strval($ this->getOpacity($qrCode->getBackgroundColor()['a'])));59 $background->addAttribute('width', strval($matrix->getOuterSize())); 60 $background->addAttribute('height', strval($matrix->getOuterSize())); 61 $background->addAttribute('fill', '#'.sprintf('%02x%02x%02x', $qrCode->getBackgroundColor()->getRed(), $qrCode->getBackgroundColor()->getGreen(), $qrCode->getBackgroundColor()->getBlue())); 62 $background->addAttribute('fill-opacity', strval($qrCode->getBackgroundColor()->getOpacity())); 56 63 57 for each ($data['matrix'] as $row => $values) {58 for each ($values as $column => $value) {59 if (1 === $ value) {60 $block = $ svg->addChild('use');61 $block->addAttribute('x', strval($data['margin_left'] + $data['block_size'] * $column));62 $block->addAttribute('y', strval($data['margin_left'] + $data['block_size'] * $row));63 $block->addAttribute('xlink:href', '#'.$ block_id, 'http://www.w3.org/1999/xlink');64 for ($rowIndex = 0; $rowIndex < $matrix->getBlockCount(); ++$rowIndex) { 65 for ($columnIndex = 0; $columnIndex < $matrix->getBlockCount(); ++$columnIndex) { 66 if (1 === $matrix->getBlockValue($rowIndex, $columnIndex)) { 67 $block = $xml->addChild('use'); 68 $block->addAttribute('x', number_format($matrix->getMarginLeft() + $matrix->getBlockSize() * $columnIndex, self::DECIMAL_PRECISION, '.', '')); 69 $block->addAttribute('y', number_format($matrix->getMarginLeft() + $matrix->getBlockSize() * $rowIndex, self::DECIMAL_PRECISION, '.', '')); 70 $block->addAttribute('xlink:href', '#'.$options[self::WRITER_OPTION_BLOCK_ID], 'http://www.w3.org/1999/xlink'); 64 71 } 65 72 } 66 73 } 67 74 68 $logoPath = $qrCode->getLogoPath(); 69 if (is_string($logoPath)) { 70 $forceXlinkHref = false; 71 if (isset($options['force_xlink_href']) && $options['force_xlink_href']) { 72 $forceXlinkHref = true; 73 } 75 $result = new SvgResult($matrix, $xml, boolval($options[self::WRITER_OPTION_EXCLUDE_XML_DECLARATION])); 74 76 75 $this->addLogo($svg, $data['outer_width'], $data['outer_height'], $logoPath, $qrCode->getLogoWidth(), $qrCode->getLogoHeight(), $forceXlinkHref); 77 if ($logo instanceof LogoInterface) { 78 $this->addLogo($logo, $result, $options); 76 79 } 77 80 78 $xml = $svg->asXML(); 81 return $result; 82 } 79 83 80 if (!is_string($xml)) { 81 throw new GenerateImageException('Unable to save SVG XML'); 84 /** @param array<mixed> $options */ 85 private function addLogo(LogoInterface $logo, SvgResult $result, array $options): void 86 { 87 $logoImageData = LogoImageData::createForLogo($logo); 88 89 if (!isset($options[self::WRITER_OPTION_FORCE_XLINK_HREF])) { 90 $options[self::WRITER_OPTION_FORCE_XLINK_HREF] = false; 82 91 } 83 92 84 if (isset($options['exclude_xml_declaration']) && $options['exclude_xml_declaration']) { 85 $xml = str_replace("<?xml version=\"1.0\"?>\n", '', $xml); 86 } 93 $xml = $result->getXml(); 87 94 88 return $xml;89 }95 /** @var \SimpleXMLElement $xmlAttributes */ 96 $xmlAttributes = $xml->attributes(); 90 97 91 private function addLogo(SimpleXMLElement $svg, int $imageWidth, int $imageHeight, string $logoPath, int $logoWidth = null, int $logoHeight = null, bool $forceXlinkHref = false): void 92 { 93 $mimeType = $this->getMimeType($logoPath); 94 $imageData = file_get_contents($logoPath); 98 $x = intval($xmlAttributes->width) / 2 - $logoImageData->getWidth() / 2; 99 $y = intval($xmlAttributes->height) / 2 - $logoImageData->getHeight() / 2; 95 100 96 if (!is_string($imageData)) { 97 throw new GenerateImageException('Unable to read image data: check your logo path'); 98 } 99 100 if ('image/svg+xml' === $mimeType && (null === $logoHeight || null === $logoWidth)) { 101 throw new MissingLogoHeightException('SVG Logos require an explicit height set via setLogoSize($width, $height)'); 102 } 103 104 if (null === $logoHeight || null === $logoWidth) { 105 $logoImage = imagecreatefromstring(strval($imageData)); 106 107 if (!$logoImage) { 108 throw new GenerateImageException('Unable to generate image: check your GD installation or logo path'); 109 } 110 111 /** @var mixed $logoImage */ 112 $logoSourceWidth = imagesx($logoImage); 113 $logoSourceHeight = imagesy($logoImage); 114 115 if (PHP_VERSION_ID < 80000) { 116 imagedestroy($logoImage); 117 } 118 119 if (null === $logoWidth) { 120 $logoWidth = $logoSourceWidth; 121 } 122 123 if (null === $logoHeight) { 124 $aspectRatio = $logoWidth / $logoSourceWidth; 125 $logoHeight = intval($logoSourceHeight * $aspectRatio); 126 } 127 } 128 129 $logoX = $imageWidth / 2 - $logoWidth / 2; 130 $logoY = $imageHeight / 2 - $logoHeight / 2; 131 132 $imageDefinition = $svg->addChild('image'); 133 $imageDefinition->addAttribute('x', strval($logoX)); 134 $imageDefinition->addAttribute('y', strval($logoY)); 135 $imageDefinition->addAttribute('width', strval($logoWidth)); 136 $imageDefinition->addAttribute('height', strval($logoHeight)); 101 $imageDefinition = $xml->addChild('image'); 102 $imageDefinition->addAttribute('x', strval($x)); 103 $imageDefinition->addAttribute('y', strval($y)); 104 $imageDefinition->addAttribute('width', strval($logoImageData->getWidth())); 105 $imageDefinition->addAttribute('height', strval($logoImageData->getHeight())); 137 106 $imageDefinition->addAttribute('preserveAspectRatio', 'none'); 138 107 139 // xlink:href is actually deprecated, but still required when placing the qr code in a pdf. 140 // SimpleXML strips out the xlink part by using addAttribute(), so it must be set directly. 141 if ($forceXlinkHref) { 142 $imageDefinition['xlink:href'] = 'data:'.$mimeType.';base64,'.base64_encode($imageData); 108 if ($options[self::WRITER_OPTION_FORCE_XLINK_HREF]) { 109 $imageDefinition->addAttribute('xlink:href', $logoImageData->createDataUri(), 'http://www.w3.org/1999/xlink'); 143 110 } else { 144 $imageDefinition->addAttribute('href', 'data:'.$mimeType.';base64,'.base64_encode($imageData));111 $imageDefinition->addAttribute('href', $logoImageData->createDataUri()); 145 112 } 146 113 } 147 148 private function getOpacity(int $alpha): float149 {150 $opacity = 1 - $alpha / 127;151 152 return $opacity;153 }154 155 public static function getContentType(): string156 {157 return 'image/svg+xml';158 }159 160 public static function getSupportedExtensions(): array161 {162 return ['svg'];163 }164 165 public function getName(): string166 {167 return 'svg';168 }169 114 } -
qr-code-management/trunk/vendor/endroid/qr-code/src/Writer/WriterInterface.php
r3609180 r3846961 3 3 declare(strict_types=1); 4 4 5 /*6 * (c) Jeroen van den Enden <info@endroid.nl>7 *8 * This source file is subject to the MIT license that is bundled9 * with this source code in the file LICENSE.10 */11 12 5 namespace Endroid\QrCode\Writer; 13 6 7 use Endroid\QrCode\Label\LabelInterface; 8 use Endroid\QrCode\Logo\LogoInterface; 14 9 use Endroid\QrCode\QrCodeInterface; 10 use Endroid\QrCode\Writer\Result\ResultInterface; 15 11 16 12 interface WriterInterface 17 13 { 18 public function writeString(QrCodeInterface $qrCode): string; 19 20 public function writeDataUri(QrCodeInterface $qrCode): string; 21 22 public function writeFile(QrCodeInterface $qrCode, string $path): void; 23 24 public static function getContentType(): string; 25 26 public static function supportsExtension(string $extension): bool; 27 28 /** @return array<string> */ 29 public static function getSupportedExtensions(): array; 30 31 public function getName(): string; 14 /** @param array<mixed> $options */ 15 public function write(QrCodeInterface $qrCode, LogoInterface $logo = null, LabelInterface $label = null, array $options = []): ResultInterface; 32 16 }
Note:
See TracChangeset
for help on using the changeset viewer.