├── .gitattributes ├── Facade.php ├── LICENSE ├── README.md ├── ServiceProvider.php ├── composer.json └── composer.lock /.gitattributes: -------------------------------------------------------------------------------- 1 | * text eol=lf -------------------------------------------------------------------------------- /Facade.php: -------------------------------------------------------------------------------- 1 | composer require ammadeuss/laravel-html-dom-parser 7 | 8 | You need to add the service provider in app.php 9 | > Ammadeuss\LaravelHtmlDomParser\ServiceProvider::class, 10 | 11 | If you want to use the facade, add this to your facades in app.php 12 | > 'HTMLDomParser' => Ammadeuss\LaravelHtmlDomParser\Facade::class 13 | 14 | ## Usage 15 | ```php 16 | $name = HTMLDomParser::str_get_html($html)->find('div.profile > span.name > span')[0]->plaintext; 17 | ``` -------------------------------------------------------------------------------- /ServiceProvider.php: -------------------------------------------------------------------------------- 1 | app->bind('HTMLDomParser', function ($app) { 27 | return new HtmlDomParser; 28 | }); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ammadeuss/laravel-html-dom-parser", 3 | "description": "Laravel wrapper for the PHP Simple HTML DOM Parser package", 4 | "keywords": [ 5 | "dom parser", 6 | "html dom parser", 7 | "laravel" 8 | ], 9 | "require": { 10 | "php": ">=5.6", 11 | "illuminate/support": "^5.2", 12 | "kub-at/php-simple-html-dom-parser": "^1.8" 13 | }, 14 | "homepage": "https://github.com/ammadeuss/html-dom-parser", 15 | "license": "MIT", 16 | "authors": [ 17 | { 18 | "name": "Ammadeuss Raducan", 19 | "email": "raducan@ammadeuss.ro" 20 | } 21 | ], 22 | "autoload": { 23 | "psr-4": { "Ammadeuss\\LaravelHtmlDomParser\\": "" } 24 | }, 25 | "extra": { 26 | "laravel": { 27 | "providers": [ 28 | "Ammadeuss\\LaravelHtmlDomParser\\ServiceProvider" 29 | ], 30 | "aliases": { 31 | "HTMLDomParser": "Ammadeuss\\LaravelHtmlDomParser\\Facade" 32 | } 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "e6926f9cacee314dc1293d639edb2bf1", 8 | "packages": [ 9 | { 10 | "name": "doctrine/inflector", 11 | "version": "v1.3.0", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/doctrine/inflector.git", 15 | "reference": "5527a48b7313d15261292c149e55e26eae771b0a" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/doctrine/inflector/zipball/5527a48b7313d15261292c149e55e26eae771b0a", 20 | "reference": "5527a48b7313d15261292c149e55e26eae771b0a", 21 | "shasum": "" 22 | }, 23 | "require": { 24 | "php": "^7.1" 25 | }, 26 | "require-dev": { 27 | "phpunit/phpunit": "^6.2" 28 | }, 29 | "type": "library", 30 | "extra": { 31 | "branch-alias": { 32 | "dev-master": "1.3.x-dev" 33 | } 34 | }, 35 | "autoload": { 36 | "psr-4": { 37 | "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector" 38 | } 39 | }, 40 | "notification-url": "https://packagist.org/downloads/", 41 | "license": [ 42 | "MIT" 43 | ], 44 | "authors": [ 45 | { 46 | "name": "Roman Borschel", 47 | "email": "roman@code-factory.org" 48 | }, 49 | { 50 | "name": "Benjamin Eberlei", 51 | "email": "kontakt@beberlei.de" 52 | }, 53 | { 54 | "name": "Guilherme Blanco", 55 | "email": "guilhermeblanco@gmail.com" 56 | }, 57 | { 58 | "name": "Jonathan Wage", 59 | "email": "jonwage@gmail.com" 60 | }, 61 | { 62 | "name": "Johannes Schmitt", 63 | "email": "schmittjoh@gmail.com" 64 | } 65 | ], 66 | "description": "Common String Manipulations with regard to casing and singular/plural rules.", 67 | "homepage": "http://www.doctrine-project.org", 68 | "keywords": [ 69 | "inflection", 70 | "pluralize", 71 | "singularize", 72 | "string" 73 | ], 74 | "time": "2018-01-09T20:05:19+00:00" 75 | }, 76 | { 77 | "name": "illuminate/contracts", 78 | "version": "v5.8.17", 79 | "source": { 80 | "type": "git", 81 | "url": "https://github.com/illuminate/contracts.git", 82 | "reference": "acd524087bcebcc0979748e84ccc0876395ae497" 83 | }, 84 | "dist": { 85 | "type": "zip", 86 | "url": "https://api.github.com/repos/illuminate/contracts/zipball/acd524087bcebcc0979748e84ccc0876395ae497", 87 | "reference": "acd524087bcebcc0979748e84ccc0876395ae497", 88 | "shasum": "" 89 | }, 90 | "require": { 91 | "php": "^7.1.3", 92 | "psr/container": "^1.0", 93 | "psr/simple-cache": "^1.0" 94 | }, 95 | "type": "library", 96 | "extra": { 97 | "branch-alias": { 98 | "dev-master": "5.8-dev" 99 | } 100 | }, 101 | "autoload": { 102 | "psr-4": { 103 | "Illuminate\\Contracts\\": "" 104 | } 105 | }, 106 | "notification-url": "https://packagist.org/downloads/", 107 | "license": [ 108 | "MIT" 109 | ], 110 | "authors": [ 111 | { 112 | "name": "Taylor Otwell", 113 | "email": "taylor@laravel.com" 114 | } 115 | ], 116 | "description": "The Illuminate Contracts package.", 117 | "homepage": "https://laravel.com", 118 | "time": "2019-05-14T10:54:47+00:00" 119 | }, 120 | { 121 | "name": "illuminate/support", 122 | "version": "v5.8.17", 123 | "source": { 124 | "type": "git", 125 | "url": "https://github.com/illuminate/support.git", 126 | "reference": "128c6aaa1599811a04fd10c2d68e1213e433da3f" 127 | }, 128 | "dist": { 129 | "type": "zip", 130 | "url": "https://api.github.com/repos/illuminate/support/zipball/128c6aaa1599811a04fd10c2d68e1213e433da3f", 131 | "reference": "128c6aaa1599811a04fd10c2d68e1213e433da3f", 132 | "shasum": "" 133 | }, 134 | "require": { 135 | "doctrine/inflector": "^1.1", 136 | "ext-json": "*", 137 | "ext-mbstring": "*", 138 | "illuminate/contracts": "5.8.*", 139 | "nesbot/carbon": "^1.26.3 || ^2.0", 140 | "php": "^7.1.3" 141 | }, 142 | "conflict": { 143 | "tightenco/collect": "<5.5.33" 144 | }, 145 | "suggest": { 146 | "illuminate/filesystem": "Required to use the composer class (5.8.*).", 147 | "moontoast/math": "Required to use ordered UUIDs (^1.1).", 148 | "ramsey/uuid": "Required to use Str::uuid() (^3.7).", 149 | "symfony/process": "Required to use the composer class (^4.2).", 150 | "symfony/var-dumper": "Required to use the dd function (^4.2).", 151 | "vlucas/phpdotenv": "Required to use the env helper (^3.3)." 152 | }, 153 | "type": "library", 154 | "extra": { 155 | "branch-alias": { 156 | "dev-master": "5.8-dev" 157 | } 158 | }, 159 | "autoload": { 160 | "psr-4": { 161 | "Illuminate\\Support\\": "" 162 | }, 163 | "files": [ 164 | "helpers.php" 165 | ] 166 | }, 167 | "notification-url": "https://packagist.org/downloads/", 168 | "license": [ 169 | "MIT" 170 | ], 171 | "authors": [ 172 | { 173 | "name": "Taylor Otwell", 174 | "email": "taylor@laravel.com" 175 | } 176 | ], 177 | "description": "The Illuminate Support package.", 178 | "homepage": "https://laravel.com", 179 | "time": "2019-05-14T13:37:34+00:00" 180 | }, 181 | { 182 | "name": "kub-at/php-simple-html-dom-parser", 183 | "version": "1.8.1", 184 | "source": { 185 | "type": "git", 186 | "url": "https://github.com/Kub-AT/php-simple-html-dom-parser.git", 187 | "reference": "6db1e01db320040024cd1f74b0e1483aa2670720" 188 | }, 189 | "dist": { 190 | "type": "zip", 191 | "url": "https://api.github.com/repos/Kub-AT/php-simple-html-dom-parser/zipball/6db1e01db320040024cd1f74b0e1483aa2670720", 192 | "reference": "6db1e01db320040024cd1f74b0e1483aa2670720", 193 | "shasum": "" 194 | }, 195 | "require": { 196 | "php": ">=5.3.2" 197 | }, 198 | "type": "library", 199 | "autoload": { 200 | "psr-0": { 201 | "KubAT\\PhpSimple\\HtmlDomParser": "src/" 202 | } 203 | }, 204 | "notification-url": "https://packagist.org/downloads/", 205 | "license": [ 206 | "MIT" 207 | ], 208 | "authors": [ 209 | { 210 | "name": "S.C. Chen", 211 | "email": "me578022@gmail.com" 212 | }, 213 | { 214 | "name": "Jakub Stawowy", 215 | "email": "Kub-AT@users.noreply.github.com" 216 | } 217 | ], 218 | "description": "PHP Simple HTML DOM Parser with namespace and PHP 7.3 compatible", 219 | "homepage": "http://simplehtmldom.sourceforge.net/", 220 | "keywords": [ 221 | "Simple", 222 | "dom", 223 | "html" 224 | ], 225 | "time": "2019-03-05T14:12:22+00:00" 226 | }, 227 | { 228 | "name": "nesbot/carbon", 229 | "version": "2.17.1", 230 | "source": { 231 | "type": "git", 232 | "url": "https://github.com/briannesbitt/Carbon.git", 233 | "reference": "96acbc0c03782e8115156dd4dd8b736267155066" 234 | }, 235 | "dist": { 236 | "type": "zip", 237 | "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/96acbc0c03782e8115156dd4dd8b736267155066", 238 | "reference": "96acbc0c03782e8115156dd4dd8b736267155066", 239 | "shasum": "" 240 | }, 241 | "require": { 242 | "ext-json": "*", 243 | "php": "^7.1.8 || ^8.0", 244 | "symfony/translation": "^3.4 || ^4.0" 245 | }, 246 | "require-dev": { 247 | "friendsofphp/php-cs-fixer": "^2.14 || ^3.0", 248 | "kylekatarnls/multi-tester": "^1.1", 249 | "phpmd/phpmd": "^2.6", 250 | "phpstan/phpstan": "^0.11", 251 | "phpunit/phpunit": "^7.5 || ^8.0", 252 | "squizlabs/php_codesniffer": "^3.4" 253 | }, 254 | "type": "library", 255 | "extra": { 256 | "laravel": { 257 | "providers": [ 258 | "Carbon\\Laravel\\ServiceProvider" 259 | ] 260 | } 261 | }, 262 | "autoload": { 263 | "psr-4": { 264 | "Carbon\\": "src/Carbon/" 265 | } 266 | }, 267 | "notification-url": "https://packagist.org/downloads/", 268 | "license": [ 269 | "MIT" 270 | ], 271 | "authors": [ 272 | { 273 | "name": "Brian Nesbitt", 274 | "email": "brian@nesbot.com", 275 | "homepage": "http://nesbot.com" 276 | } 277 | ], 278 | "description": "A simple API extension for DateTime.", 279 | "homepage": "http://carbon.nesbot.com", 280 | "keywords": [ 281 | "date", 282 | "datetime", 283 | "time" 284 | ], 285 | "time": "2019-04-27T18:04:27+00:00" 286 | }, 287 | { 288 | "name": "psr/container", 289 | "version": "1.0.0", 290 | "source": { 291 | "type": "git", 292 | "url": "https://github.com/php-fig/container.git", 293 | "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" 294 | }, 295 | "dist": { 296 | "type": "zip", 297 | "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", 298 | "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", 299 | "shasum": "" 300 | }, 301 | "require": { 302 | "php": ">=5.3.0" 303 | }, 304 | "type": "library", 305 | "extra": { 306 | "branch-alias": { 307 | "dev-master": "1.0.x-dev" 308 | } 309 | }, 310 | "autoload": { 311 | "psr-4": { 312 | "Psr\\Container\\": "src/" 313 | } 314 | }, 315 | "notification-url": "https://packagist.org/downloads/", 316 | "license": [ 317 | "MIT" 318 | ], 319 | "authors": [ 320 | { 321 | "name": "PHP-FIG", 322 | "homepage": "http://www.php-fig.org/" 323 | } 324 | ], 325 | "description": "Common Container Interface (PHP FIG PSR-11)", 326 | "homepage": "https://github.com/php-fig/container", 327 | "keywords": [ 328 | "PSR-11", 329 | "container", 330 | "container-interface", 331 | "container-interop", 332 | "psr" 333 | ], 334 | "time": "2017-02-14T16:28:37+00:00" 335 | }, 336 | { 337 | "name": "psr/simple-cache", 338 | "version": "1.0.1", 339 | "source": { 340 | "type": "git", 341 | "url": "https://github.com/php-fig/simple-cache.git", 342 | "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" 343 | }, 344 | "dist": { 345 | "type": "zip", 346 | "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", 347 | "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", 348 | "shasum": "" 349 | }, 350 | "require": { 351 | "php": ">=5.3.0" 352 | }, 353 | "type": "library", 354 | "extra": { 355 | "branch-alias": { 356 | "dev-master": "1.0.x-dev" 357 | } 358 | }, 359 | "autoload": { 360 | "psr-4": { 361 | "Psr\\SimpleCache\\": "src/" 362 | } 363 | }, 364 | "notification-url": "https://packagist.org/downloads/", 365 | "license": [ 366 | "MIT" 367 | ], 368 | "authors": [ 369 | { 370 | "name": "PHP-FIG", 371 | "homepage": "http://www.php-fig.org/" 372 | } 373 | ], 374 | "description": "Common interfaces for simple caching", 375 | "keywords": [ 376 | "cache", 377 | "caching", 378 | "psr", 379 | "psr-16", 380 | "simple-cache" 381 | ], 382 | "time": "2017-10-23T01:57:42+00:00" 383 | }, 384 | { 385 | "name": "sunra/php-simple-html-dom-parser", 386 | "version": "v1.5.2", 387 | "source": { 388 | "type": "git", 389 | "url": "https://github.com/sunra/php-simple-html-dom-parser.git", 390 | "reference": "75b9b1cb64502d8f8c04dc11b5906b969af247c6" 391 | }, 392 | "dist": { 393 | "type": "zip", 394 | "url": "https://api.github.com/repos/sunra/php-simple-html-dom-parser/zipball/75b9b1cb64502d8f8c04dc11b5906b969af247c6", 395 | "reference": "75b9b1cb64502d8f8c04dc11b5906b969af247c6", 396 | "shasum": "" 397 | }, 398 | "require": { 399 | "ext-mbstring": "*", 400 | "php": ">=5.3.2" 401 | }, 402 | "type": "library", 403 | "autoload": { 404 | "psr-0": { 405 | "Sunra\\PhpSimple\\HtmlDomParser": "Src/" 406 | } 407 | }, 408 | "notification-url": "https://packagist.org/downloads/", 409 | "license": [ 410 | "MIT" 411 | ], 412 | "authors": [ 413 | { 414 | "name": "Sunra", 415 | "email": "sunra@yandex.ru", 416 | "homepage": "https://github.com/sunra" 417 | }, 418 | { 419 | "name": "S.C. Chen", 420 | "homepage": "http://sourceforge.net/projects/simplehtmldom/" 421 | } 422 | ], 423 | "description": "Composer adaptation of: A HTML DOM parser written in PHP5+ let you manipulate HTML in a very easy way! Require PHP 5+. Supports invalid HTML. Find tags on an HTML page with selectors just like jQuery. Extract contents from HTML in a single line.", 424 | "homepage": "https://github.com/sunra/php-simple-html-dom-parser", 425 | "keywords": [ 426 | "dom", 427 | "html", 428 | "parser" 429 | ], 430 | "time": "2016-11-22T22:57:47+00:00" 431 | }, 432 | { 433 | "name": "symfony/contracts", 434 | "version": "v1.1.0", 435 | "source": { 436 | "type": "git", 437 | "url": "https://github.com/symfony/contracts.git", 438 | "reference": "d3636025e8253c6144358ec0a62773cae588395b" 439 | }, 440 | "dist": { 441 | "type": "zip", 442 | "url": "https://api.github.com/repos/symfony/contracts/zipball/d3636025e8253c6144358ec0a62773cae588395b", 443 | "reference": "d3636025e8253c6144358ec0a62773cae588395b", 444 | "shasum": "" 445 | }, 446 | "require": { 447 | "php": "^7.1.3" 448 | }, 449 | "require-dev": { 450 | "psr/cache": "^1.0", 451 | "psr/container": "^1.0", 452 | "symfony/polyfill-intl-idn": "^1.10" 453 | }, 454 | "suggest": { 455 | "psr/cache": "When using the Cache contracts", 456 | "psr/container": "When using the Service contracts", 457 | "symfony/cache-contracts-implementation": "", 458 | "symfony/event-dispatcher-implementation": "", 459 | "symfony/http-client-contracts-implementation": "", 460 | "symfony/service-contracts-implementation": "", 461 | "symfony/translation-contracts-implementation": "" 462 | }, 463 | "type": "library", 464 | "extra": { 465 | "branch-alias": { 466 | "dev-master": "1.1-dev" 467 | } 468 | }, 469 | "autoload": { 470 | "psr-4": { 471 | "Symfony\\Contracts\\": "" 472 | }, 473 | "exclude-from-classmap": [ 474 | "**/Tests/" 475 | ] 476 | }, 477 | "notification-url": "https://packagist.org/downloads/", 478 | "license": [ 479 | "MIT" 480 | ], 481 | "authors": [ 482 | { 483 | "name": "Nicolas Grekas", 484 | "email": "p@tchwork.com" 485 | }, 486 | { 487 | "name": "Symfony Community", 488 | "homepage": "https://symfony.com/contributors" 489 | } 490 | ], 491 | "description": "A set of abstractions extracted out of the Symfony components", 492 | "homepage": "https://symfony.com", 493 | "keywords": [ 494 | "abstractions", 495 | "contracts", 496 | "decoupling", 497 | "interfaces", 498 | "interoperability", 499 | "standards" 500 | ], 501 | "time": "2019-04-27T14:29:50+00:00" 502 | }, 503 | { 504 | "name": "symfony/polyfill-mbstring", 505 | "version": "v1.11.0", 506 | "source": { 507 | "type": "git", 508 | "url": "https://github.com/symfony/polyfill-mbstring.git", 509 | "reference": "fe5e94c604826c35a32fa832f35bd036b6799609" 510 | }, 511 | "dist": { 512 | "type": "zip", 513 | "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fe5e94c604826c35a32fa832f35bd036b6799609", 514 | "reference": "fe5e94c604826c35a32fa832f35bd036b6799609", 515 | "shasum": "" 516 | }, 517 | "require": { 518 | "php": ">=5.3.3" 519 | }, 520 | "suggest": { 521 | "ext-mbstring": "For best performance" 522 | }, 523 | "type": "library", 524 | "extra": { 525 | "branch-alias": { 526 | "dev-master": "1.11-dev" 527 | } 528 | }, 529 | "autoload": { 530 | "psr-4": { 531 | "Symfony\\Polyfill\\Mbstring\\": "" 532 | }, 533 | "files": [ 534 | "bootstrap.php" 535 | ] 536 | }, 537 | "notification-url": "https://packagist.org/downloads/", 538 | "license": [ 539 | "MIT" 540 | ], 541 | "authors": [ 542 | { 543 | "name": "Nicolas Grekas", 544 | "email": "p@tchwork.com" 545 | }, 546 | { 547 | "name": "Symfony Community", 548 | "homepage": "https://symfony.com/contributors" 549 | } 550 | ], 551 | "description": "Symfony polyfill for the Mbstring extension", 552 | "homepage": "https://symfony.com", 553 | "keywords": [ 554 | "compatibility", 555 | "mbstring", 556 | "polyfill", 557 | "portable", 558 | "shim" 559 | ], 560 | "time": "2019-02-06T07:57:58+00:00" 561 | }, 562 | { 563 | "name": "symfony/translation", 564 | "version": "v4.2.8", 565 | "source": { 566 | "type": "git", 567 | "url": "https://github.com/symfony/translation.git", 568 | "reference": "181a426dd129cb496f12d7e7555f6d0b37a7615b" 569 | }, 570 | "dist": { 571 | "type": "zip", 572 | "url": "https://api.github.com/repos/symfony/translation/zipball/181a426dd129cb496f12d7e7555f6d0b37a7615b", 573 | "reference": "181a426dd129cb496f12d7e7555f6d0b37a7615b", 574 | "shasum": "" 575 | }, 576 | "require": { 577 | "php": "^7.1.3", 578 | "symfony/contracts": "^1.0.2", 579 | "symfony/polyfill-mbstring": "~1.0" 580 | }, 581 | "conflict": { 582 | "symfony/config": "<3.4", 583 | "symfony/dependency-injection": "<3.4", 584 | "symfony/yaml": "<3.4" 585 | }, 586 | "provide": { 587 | "symfony/translation-contracts-implementation": "1.0" 588 | }, 589 | "require-dev": { 590 | "psr/log": "~1.0", 591 | "symfony/config": "~3.4|~4.0", 592 | "symfony/console": "~3.4|~4.0", 593 | "symfony/dependency-injection": "~3.4|~4.0", 594 | "symfony/finder": "~2.8|~3.0|~4.0", 595 | "symfony/http-kernel": "~3.4|~4.0", 596 | "symfony/intl": "~3.4|~4.0", 597 | "symfony/var-dumper": "~3.4|~4.0", 598 | "symfony/yaml": "~3.4|~4.0" 599 | }, 600 | "suggest": { 601 | "psr/log-implementation": "To use logging capability in translator", 602 | "symfony/config": "", 603 | "symfony/yaml": "" 604 | }, 605 | "type": "library", 606 | "extra": { 607 | "branch-alias": { 608 | "dev-master": "4.2-dev" 609 | } 610 | }, 611 | "autoload": { 612 | "psr-4": { 613 | "Symfony\\Component\\Translation\\": "" 614 | }, 615 | "exclude-from-classmap": [ 616 | "/Tests/" 617 | ] 618 | }, 619 | "notification-url": "https://packagist.org/downloads/", 620 | "license": [ 621 | "MIT" 622 | ], 623 | "authors": [ 624 | { 625 | "name": "Fabien Potencier", 626 | "email": "fabien@symfony.com" 627 | }, 628 | { 629 | "name": "Symfony Community", 630 | "homepage": "https://symfony.com/contributors" 631 | } 632 | ], 633 | "description": "Symfony Translation Component", 634 | "homepage": "https://symfony.com", 635 | "time": "2019-05-01T12:55:36+00:00" 636 | } 637 | ], 638 | "packages-dev": [], 639 | "aliases": [], 640 | "minimum-stability": "stable", 641 | "stability-flags": [], 642 | "prefer-stable": false, 643 | "prefer-lowest": false, 644 | "platform": { 645 | "php": ">=5.6" 646 | }, 647 | "platform-dev": [] 648 | } 649 | --------------------------------------------------------------------------------