Compare commits
4148 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 956fd4a2c4 | |||
| 6a44d02898 | |||
| 3970be3d7f | |||
| 31d48d4ba4 | |||
| de6b683b50 | |||
| 2dca0926b0 | |||
| f1250a3867 | |||
| e7d1af48fb | |||
| 7ee722e0da | |||
| e073cd756c | |||
| f6c07094c2 | |||
| 1853a83874 | |||
| fe64e625ff | |||
| f0f9269161 | |||
| 6682c60866 | |||
| 9c1cc15c8d | |||
| c932f93a40 | |||
| 276aefba81 | |||
| 71b4cddd52 | |||
| c67de113c6 | |||
| 63c02fd595 | |||
| 7aff5eae6c | |||
| 2b80102909 | |||
| 9b2b5e0f6d | |||
| be6848a549 | |||
| 689c8f5f09 | |||
| 061938cbb5 | |||
| 642e7ce110 | |||
| f955f6a685 | |||
| ff4b175622 | |||
| 009fbd89b4 | |||
| 815eb2591a | |||
| 8f616ecf76 | |||
| 0f454215e7 | |||
| 83caaa6d3f | |||
| 59d16c5f9a | |||
| 6e1ca36207 | |||
| cf1c3635ff | |||
| 23533a763a | |||
| 5eb5d23ac1 | |||
| eb192ff4f3 | |||
| cf1430df45 | |||
| 0722ff6e32 | |||
| 0dc371f579 | |||
| a7a861b2c6 | |||
| 8c7fa15aaf | |||
| 4a15cf28a9 | |||
| 0f68276921 | |||
| 4beabe23e7 | |||
| d28e0f4d5b | |||
| f3f3c791ba | |||
| 691f00eb39 | |||
| 9266f4da99 | |||
| de6d550cce | |||
| 3d48bf18d3 | |||
| bb07c20bf4 | |||
| 48ccfa42d3 | |||
| 517bd28940 | |||
| 826a439c15 | |||
| f1b10fcc93 | |||
| 063c9accb6 | |||
| 3a5076d646 | |||
| 4bc7387d7c | |||
| 769d94ab26 | |||
| 5c9325bbe0 | |||
| d3bb01b598 | |||
| 44260a552c | |||
| e817504569 | |||
| ae2bcf968d | |||
| 454f81fb15 | |||
| 773f3cf973 | |||
| daa4d2cd84 | |||
| b117a1e3ec | |||
| 4bc88ef59d | |||
| d5566d0267 | |||
| ca64a4080f | |||
| 7fbe306990 | |||
| c8f670dfab | |||
| 8983c6dd6b | |||
| d657263403 | |||
| 74ac2ac63a | |||
| 8554525ebe | |||
| b48228ae3d | |||
| 64fe06710a | |||
| 300f6894e0 | |||
| 0145c65bf3 | |||
| 4db5481ad5 | |||
| 52b3305892 | |||
| 3ef944521e | |||
| 60b8e172d5 | |||
| 2c97f4788b | |||
| aa9824d35b | |||
| 34464b1f8b | |||
| aa88ec81c7 | |||
| 86279bc192 | |||
| 0468f53f73 | |||
| 1b34bda76b | |||
| e44f9ab46e | |||
| 8ed13e627e | |||
| 0d2d613f59 | |||
| 670022cc8a | |||
| 3a6341c880 | |||
| c3ccdbaa79 | |||
| d56966f14f | |||
| 739c5488a5 | |||
| 5d425a9f79 | |||
| 0059535140 | |||
| 7ec3e37199 | |||
| f4577bf00c | |||
| 449b9b92f0 | |||
| 93849916bb | |||
| 4dc7ed139b | |||
| c1f7d320e8 | |||
| 1d983c28aa | |||
| 6515c5c1e7 | |||
| 1c1ed52867 | |||
| d1f0261b5d | |||
| 2f8412defc | |||
| cf113409ad | |||
| 53da328aa1 | |||
| 8bd6d862b8 | |||
| 5b7ef90d3a | |||
| 3db5fb891c | |||
| 54c421f384 | |||
| 1645f77aad | |||
| 2774ff1ad8 | |||
| d8ca4f78cf | |||
| f97f1b4266 | |||
| 20e9903396 | |||
| 647888eea2 | |||
| 54a3717005 | |||
| 3775c0d8b2 | |||
| 3b4c47c52e | |||
| d7c09d8bb5 | |||
| 8a0dc774bc | |||
| 5a48ade933 | |||
| d4072c82dd | |||
| 07fa8da278 | |||
| 7e49a33d64 | |||
| 08f7d4c552 | |||
| 35bd601215 | |||
| f750da1802 | |||
| 89f5701d1a | |||
| a2cc772aa5 | |||
| b096fd9ed8 | |||
| df64b9b0e9 | |||
| 90cbc32c77 | |||
| e03b5ff665 | |||
| fdbe0c9734 | |||
| 0df376d472 | |||
| 16224e5e8b | |||
| c1bb8139a0 | |||
| bae954a797 | |||
| 7922338050 | |||
| e606213fa0 | |||
| 0c7efc234b | |||
| ea7456a06a | |||
| fcb4d2aaee | |||
| 122d1efecf | |||
| fc536c3491 | |||
| 9e73524168 | |||
| 2d3c709163 | |||
| db77dc91bc | |||
| 2e9115efe0 | |||
| a6ff909911 | |||
| 1a874b4c56 | |||
| 9b5e8a2c63 | |||
| ea33b4aaa1 | |||
| 253f101b39 | |||
| 73a72054a3 | |||
| b7aee58ef9 | |||
| 48505c5626 | |||
| 5b42325b01 | |||
| 74d49920f2 | |||
| 0aac70aaf1 | |||
| fbe0d0d4fd | |||
| b35c6b57a9 | |||
| 6146b6a131 | |||
| 57d41bb1f8 | |||
| cbfbbe672c | |||
| 2cc0515161 | |||
| f998ed331a | |||
| 3e454d3459 | |||
| 7a7c301d7d | |||
| 57cf0ae3d1 | |||
| 38c56388c1 | |||
| b9cd0ecc8a | |||
| cf181e88bb | |||
| 2f1e601809 | |||
| bfdb374a2c | |||
| 4ccfd27fa2 | |||
| c1ba4deb72 | |||
| 58adeaa80a | |||
| aac9629e88 | |||
| 5fe7200a7f | |||
| 2c99924f7d | |||
| ac8bfc218e | |||
| d216678481 | |||
| 9e83c3f823 | |||
| b39f01fce6 | |||
| 5d72681d10 | |||
| ab18a0bfe8 | |||
| eceed497b1 | |||
| fbc2892083 | |||
| c04074692e | |||
| 0f66870470 | |||
| b619821f4a | |||
| 6673375eeb | |||
| 7b92c27777 | |||
| 01b366df80 | |||
| 35effbcd3f | |||
| 568b6a7f56 | |||
| a3b06e9658 | |||
| cda9dcc7aa | |||
| 5cf42b88af | |||
| 583dce5276 | |||
| 97e8ff6801 | |||
| d4271ed9df | |||
| 954d4e5200 | |||
| 8b1bc322ff | |||
| 6779f28af4 | |||
| e03c5f39a8 | |||
| e74f4b406f | |||
| 9b3d8660eb | |||
| de850dfa52 | |||
| 4c6d11e223 | |||
| 18c8896b3c | |||
| 84827ff992 | |||
| 3f86fd5193 | |||
| 9c8eb104b6 | |||
| 55eb318265 | |||
| bda2dbec1f | |||
| 0c8740c1d5 | |||
| 82cfb3e0f5 | |||
| 2e34673989 | |||
| 1f2b37c08b | |||
| 3514ec5947 | |||
| 1fc74ea174 | |||
| 40f91d9f7c | |||
| 6d37f9b951 | |||
| e7c106d91e | |||
| 0fb90fa875 | |||
| 4e1e978b89 | |||
| 9295f49553 | |||
| 1629c77eb5 | |||
| 90518e8d2a | |||
| b80b8656eb | |||
| 8a42d159f7 | |||
| ddb8d1460b | |||
| 2e2eccc879 | |||
| 21dfe9dc5e | |||
| 198b73ddd1 | |||
| 3ce6eca40a | |||
| 3327aabe4d | |||
| 82d3fe2e1c | |||
| 30d31fecd9 | |||
| 78ecfc89a7 | |||
| a332c39472 | |||
| 6b6477a90a | |||
| 8d475debe0 | |||
| 68fd5a5d58 | |||
| 1a2ab2ef68 | |||
| 77e2387d94 | |||
| ddf0903ace | |||
| ee0294bbb1 | |||
| 3926e2d4f3 | |||
| 5ac10a9c0e | |||
| f45411f79d | |||
| 85cc34fd05 | |||
| f6dc158d51 | |||
| 9e6221b229 | |||
| 56bd3f1220 | |||
| 996020d82b | |||
| af77ce9a9b | |||
| 546ae30421 | |||
| 51cb1c9ffa | |||
| 19b55d3fce | |||
| a36a8faad4 | |||
| ab9927d5fc | |||
| b4e7c05959 | |||
| faebee5f25 | |||
| 9eb91a111d | |||
| d07512c82d | |||
| 20499e336b | |||
| 5b7c69f978 | |||
| 919681f3e6 | |||
| 847832ae77 | |||
| d12021e3c4 | |||
| cf3940425f | |||
| 0622fa79ba | |||
| b40f9670ae | |||
| 736739bbbd | |||
| d2bd78c41a | |||
| 3c2af95108 | |||
| 8e5240d579 | |||
| 646a4bd635 | |||
| 08e0b6cf5e | |||
| d98d72aa99 | |||
| c99d7dd94f | |||
| 9c2f105164 | |||
| 347ce2aafa | |||
| f0362dbf58 | |||
| 4462b26160 | |||
| 2dff357a4e | |||
| 9469c9947f | |||
| 232788396d | |||
| 7efa7171e3 | |||
| 3fd2e0d2ce | |||
| 4c02a82f6c | |||
| b133f22d7f | |||
| a95c1b8082 | |||
| 00e1d174a9 | |||
| e98305fa65 | |||
| 03fad97764 | |||
| 8f2217ca2e | |||
| 61d535984d | |||
| 2e309aae97 | |||
| 02cee2c562 | |||
| 0c7f0aa3fa | |||
| 59a2616105 | |||
| 20d9a8b6a1 | |||
| a3f250bfe6 | |||
| 0c86f8a61e | |||
| daff3aa667 | |||
| 60103d9b94 | |||
| e5840e1fe2 | |||
| aa51639271 | |||
| 78c11700f9 | |||
| 709b0a1ddc | |||
| 4094f6f8e0 | |||
| d1e5a56bc6 | |||
| ffe5ef2268 | |||
| 7bc6e86969 | |||
| bf93b9e98a | |||
| 20f8137ca0 | |||
| a69c53caef | |||
| de95bf62a2 | |||
| 3c6c8ecab0 | |||
| 2c6740b0c7 | |||
| ddd991a59e | |||
| d9fbdae758 | |||
| e3f452cf53 | |||
| 2ae37b32d4 | |||
| 8fc565821f | |||
| 46b1f35107 | |||
| b055ebc1fc | |||
| 7a5028317d | |||
| 6f981738bb | |||
| a9d7c67bf2 | |||
| 94803dc222 | |||
| 2062ebacef | |||
| 798e6aa40b | |||
| 93c0e8b3bf | |||
| de6aa0f88c | |||
| 98cd98e2e5 | |||
| d4636f4b86 | |||
| 2e826fa82a | |||
| 3e57e76c48 | |||
| 03f66c6351 | |||
| 14b240a3f4 | |||
| a589a700e1 | |||
| bc60b8d87a | |||
| 99db3c01ee | |||
| 890c57bad5 | |||
| 4de182c7af | |||
| 9d443e021d | |||
| 2cf5bb6849 | |||
| 7d090a45d2 | |||
| 63cc1ccacd | |||
| bba434ca37 | |||
| 588b51d88a | |||
| 000d7ba975 | |||
| eb7e2d7d35 | |||
| fae1ce4ea7 | |||
| c1490239e5 | |||
| 051442bc76 | |||
| 7dcf38c40f | |||
| 9c47346373 | |||
| 41d0308806 | |||
| 4f88fadbc1 | |||
| da1da8197e | |||
| fa4a52260f | |||
| 52717d2a1b | |||
| f6df71b74d | |||
| 9dee2a6b2c | |||
| c067cfc3b5 | |||
| d01db3a807 | |||
| 5dee914ed2 | |||
| 251a6d1a9f | |||
| cdf5d4e231 | |||
| 0ce1cbdd14 | |||
| 010b97febd | |||
| 9921ca11b5 | |||
| 5962a0d4ac | |||
| 43978abd80 | |||
| 10d291d6b3 | |||
| 40b823bc8b | |||
| 4dbc2093c6 | |||
| 9b5e0bebef | |||
| 5b7cefb1e5 | |||
| 5a1ea62437 | |||
| bf8b3b0696 | |||
| 52d113b9e1 | |||
| da4688d804 | |||
| e9c7ecf22d | |||
| 0ff5ab65be | |||
| df6b15445d | |||
| e0a5f976e7 | |||
| 71423ec566 | |||
| b9033d3b78 | |||
| f28d71bb9c | |||
| ef073a148f | |||
| 936c8ba1cc | |||
| 5904d5cf50 | |||
| d032345191 | |||
| 1138df0f4b | |||
| 6bdbcc1f49 | |||
| b125caaaf6 | |||
| e33b12a375 | |||
| ef10603c26 | |||
| 9bdd00c0f2 | |||
| 46fe2e3e2a | |||
| 7d2a68fc31 | |||
| 5a264040d4 | |||
| 8534373f2f | |||
| 3a184e2e1d | |||
| c4e47953ac | |||
| 5155f589fd | |||
| cde60dba0f | |||
| 65b9850e53 | |||
| 471cad7d90 | |||
| aa0c3ddcfe | |||
| 41179a1456 | |||
| e0db22cc07 | |||
| 333345d201 | |||
| fe8b10a922 | |||
| d2b0de614e | |||
| 1945cd6946 | |||
| 5d55c709dd | |||
| 2edf59c026 | |||
| 2488cdb8a1 | |||
| 5bf69cace1 | |||
| 9dbc6b5158 | |||
| 35177e00c0 | |||
| bede32be24 | |||
| c1019a6e98 | |||
| 400ade063c | |||
| f2ec68d40c | |||
| f69f764e8b | |||
| c996600786 | |||
| 6c2fc0cbe8 | |||
| 6330fdad08 | |||
| aa4f01fbcc | |||
| 4b4c3c3f3a | |||
| 24a8451b2e | |||
| 101406eba7 | |||
| 2facf509cc | |||
| 2092caf6d3 | |||
| d46bea8867 | |||
| c0e67fa24a | |||
| 70cb053e6b | |||
| d875191777 | |||
| 4a7591d0ab | |||
| 74a0df335a | |||
| 2580d8540d | |||
| eda42cece9 | |||
| f9aadfff7a | |||
| 9bcc5c11a8 | |||
| 4a89eb77c1 | |||
| 2c264f836c | |||
| d0b7b01737 | |||
| a004759230 | |||
| 19d2b94837 | |||
| 76b8d06284 | |||
| d9592ddcb0 | |||
| 1fef13b0c0 | |||
| eae21f3269 | |||
| 0006b432f5 | |||
| 439467746a | |||
| 1e47156226 | |||
| 01da64caf7 | |||
| 248eae2d0f | |||
| 907fa9d85b | |||
| 716c5a3c8e | |||
| 231eec7325 | |||
| 6c670cb82d | |||
| 333e8986f6 | |||
| def59755ad | |||
| adb32ad347 | |||
| 594221a467 | |||
| 3499783ea5 | |||
| 7aad40ca4d | |||
| 6f982d2e20 | |||
| 7a06e144ec | |||
| 2296521a2e | |||
| eab4a05d78 | |||
| 27da29525a | |||
| 8d1754041e | |||
| e61e40c23d | |||
| bde5b4a7ff | |||
| a4a3d62a55 | |||
| 07ff1e723a | |||
| 89c8316f8f | |||
| 077ea94f71 | |||
| 3d6909f372 | |||
| a22a79cddd | |||
| 76a60a2fc3 | |||
| 9e03ea4a28 | |||
| b62a8ba0f8 | |||
| b6ea57c8b6 | |||
| 8076b1e12d | |||
| a89231ac1d | |||
| 5be9084c73 | |||
| cbee0d3128 | |||
| 55194e0343 | |||
| 97a8af7f25 | |||
| 5611e6c9d3 | |||
| f85d076a4e | |||
| 43caa3b3b9 | |||
| 8feb7dd9d9 | |||
| 375ba98645 | |||
| 15be032740 | |||
| 6cc9f600d2 | |||
| 351740601a | |||
| 80dff77b65 | |||
| e5ef3e1340 | |||
| 0b51c53443 | |||
| 4ba527625f | |||
| 47081a2471 | |||
| f7e410147f | |||
| ec98ecff05 | |||
| 31d623f426 | |||
| 6d37b8567b | |||
| 4fe90f62f4 | |||
| eec7c3833c | |||
| 10bbbc8cd2 | |||
| 71f9b1968e | |||
| 33c343ed11 | |||
| da03d05700 | |||
| c536e930f4 | |||
| 82a61e2e1a | |||
| ff66600bc0 | |||
| 8e99475886 | |||
| 8c7f854671 | |||
| f1830866a3 | |||
| 72256abf34 | |||
| 6750998984 | |||
| d71600213a | |||
| c9eaffd336 | |||
| 8ed8d9cd91 | |||
| 2fe646dcec | |||
| c94f39b488 | |||
| 93b63cf375 | |||
| 98e0db15a2 | |||
| e48f511606 | |||
| 31e32e3c10 | |||
| e2fb094693 | |||
| ab58471904 | |||
| 1a2bbd2ee4 | |||
| 20f3875f1b | |||
| 254b8b9506 | |||
| 70cea18cce | |||
| dc7cdda5cc | |||
| 5bf69237b2 | |||
| 7b548837df | |||
| d0554bef06 | |||
| 7ded9cf520 | |||
| d3ce2cacd6 | |||
| 3f9ac6405a | |||
| 8a69116e94 | |||
| 51b6aab436 | |||
| 54854b2e3d | |||
| 11314c81d9 | |||
| e8ec999090 | |||
| 0195d5b439 | |||
| e409e7cd4c | |||
| 5193ddd7d7 | |||
| 8a3d41c043 | |||
| 6c908a4cd0 | |||
| f425b80deb | |||
| b20b30b6fe | |||
| 04c6582af1 | |||
| e1268cd5f4 | |||
| 051cb7d96b | |||
| f0701f75a9 | |||
| 07f2e316e4 | |||
| 9c520c70a8 | |||
| a8b6fdd396 | |||
| 0bccd9c18c | |||
| f6fefe9a36 | |||
| 023479b1e2 | |||
| 163344243b | |||
| c7e7767f58 | |||
| b862c49ae6 | |||
| 0d0129221b | |||
| b5db852438 | |||
| 4d3ef9a824 | |||
| 84bd83b1dc | |||
| e3adbcb7d5 | |||
| 09a5c59cca | |||
| f0f1adb994 | |||
| c6f034a5d2 | |||
| afeb9d9cbf | |||
| bef701c448 | |||
| 2e77df91e9 | |||
| 7eb7492360 | |||
| 72c0d6968e | |||
| 3aedbc5f95 | |||
| 06e9ac8591 | |||
| 6e7f5ec4ce | |||
| c627657fc6 | |||
| 657d02371c | |||
| a1b309a42a | |||
| 0aaf6d16a5 | |||
| 80c850d018 | |||
| 768041b6cb | |||
| 18c11ec81b | |||
| 1384fdfe01 | |||
| 993d655aad | |||
| 1b935a22ce | |||
| ee0cb68f5e | |||
| 74b5e22a68 | |||
| f7fb4a54c9 | |||
| 5483c1be42 | |||
| 5fda0e4b3b | |||
| 6930af4c0f | |||
| 78b2da583d | |||
| 6039dd0fe8 | |||
| d96e962fc1 | |||
| 18a024e251 | |||
| 6bdefef31e | |||
| 2b10371bde | |||
| 40f95ffdf3 | |||
| c693ee2adb | |||
| 0249a72cab | |||
| 1277962183 | |||
| 754844f5c9 | |||
| 6312067ab5 | |||
| ebd82ee772 | |||
| 2c92a79b5d | |||
| ebcaa46482 | |||
| b19fae392b | |||
| 3f64eb25ab | |||
| 02c1127de3 | |||
| 4bb1a2c2d6 | |||
| 5dbf362623 | |||
| c20abfef38 | |||
| 249e0c1ee2 | |||
| 32de47d1d9 | |||
| de135e3b9b | |||
| 9d91e53027 | |||
| b75f680b8e | |||
| 1a913ac282 | |||
| 6895c54a3f | |||
| cbba469990 | |||
| 0933b5e7ab | |||
| a82d709f87 | |||
| e1cd690a7c | |||
| c00762b49b | |||
| 7d9587bab3 | |||
| b369adbd94 | |||
| a3dff248a1 | |||
| 02a65f30ec | |||
| 8ae1430090 | |||
| 81f549baee | |||
| 4795295fb1 | |||
| d76552a009 | |||
| e459309511 | |||
| 20f1c1e6ca | |||
| 6c554d0ffa | |||
| 93ae945414 | |||
| 2953f4d11a | |||
| b462795be2 | |||
| 565e02d061 | |||
| d854e4a144 | |||
| f991948a71 | |||
| ef9511c713 | |||
| d764585d8b | |||
| 03f81fdd88 | |||
| 323b19a4a0 | |||
| 476043ecb9 | |||
| 60c0827ba3 | |||
| 9ee2bb9719 | |||
| 5b70e2fb25 | |||
| 5c3ea14819 | |||
| cc2bfd313d | |||
| 9015c46e31 | |||
| 60b924c954 | |||
| fa502e160d | |||
| f17eea506a | |||
| d6346b5b0b | |||
| a85d49833b | |||
| fb84d0aff8 | |||
| 9b29bc96de | |||
| 684007bbae | |||
| 0b06eff3a0 | |||
| 29b9e27078 | |||
| 9b134b0636 | |||
| a3d0a74d03 | |||
| 69a2173fdb | |||
| b824425186 | |||
| 988f98fc6f | |||
| 22f4acadc0 | |||
| b8da5c5262 | |||
| 6848b069c9 | |||
| dfc94cbe84 | |||
| 0cd9570277 | |||
| 4ea927a798 | |||
| b704ff1bc7 | |||
| fd47fbe176 | |||
| 9092692b8e | |||
| 95c220a246 | |||
| 10eea3f464 | |||
| 19109afa79 | |||
| d1110c62ef | |||
| 42a570788b | |||
| 728e6a6bf9 | |||
| 6d92ebca45 | |||
| 9226cb7a6a | |||
| aaedb23f05 | |||
| 3b9d283245 | |||
| c0df15367f | |||
| 08fe6bdb27 | |||
| f5c9fe9ece | |||
| 1b29fc3fb2 | |||
| 3ba9a9e6a8 | |||
| 912c87eeda | |||
| 1b084cc120 | |||
| 6ee7dc5f59 | |||
| fffbf26159 | |||
| 82ba2151d1 | |||
| 8f2e9caf96 | |||
| d17eba19c1 | |||
| c5b31b001a | |||
| 44fa4433bc | |||
| c77fa42143 | |||
| 43ee5cf224 | |||
| e8f062dc93 | |||
| 8a6cb23170 | |||
| e888f4d9bc | |||
| 4c2cf35050 | |||
| 1bba445642 | |||
| f08cfcecec | |||
| 24aff287cf | |||
| f85aaf1f58 | |||
| 80ddf37bb7 | |||
| 651de1e588 | |||
| 9e3242d05e | |||
| 56e064bd09 | |||
| 16fc4dfd1a | |||
| a34631f84e | |||
| 69f3b5e2d2 | |||
| c6144535a8 | |||
| e2f64394f3 | |||
| a0a80e74c2 | |||
| 260c48c29a | |||
| 0918fc7d91 | |||
| 80950f2e1c | |||
| ff3b199cc8 | |||
| 1a49497899 | |||
| fd54791952 | |||
| a86d89f5ca | |||
| 74e5402711 | |||
| e29ae46609 | |||
| 6bfe2289be | |||
| ef80ad1d48 | |||
| d1fe3c2314 | |||
| acea156a3d | |||
| 3d68732657 | |||
| 711aa229b8 | |||
| 12ef2f5054 | |||
| c3d78cf77a | |||
| 99a473bd62 | |||
| 0f5864d864 | |||
| c3cb000cb2 | |||
| 2fbc92bd4b | |||
| 1384be4bff | |||
| 70ba428222 | |||
| c75bbb59a9 | |||
| 2e85313701 | |||
| 909282c81e | |||
| 3aeea0c196 | |||
| 3706bbec1b | |||
| 85019887df | |||
| 9abb70245a | |||
| 5cefd34660 | |||
| 9a707e10bf | |||
| aceda02887 | |||
| bdb3962b8d | |||
| d1ad4dc8d6 | |||
| b39c3d4c4e | |||
| 26e9a0dd13 | |||
| 3fb91a7411 | |||
| b44bc9f4b2 | |||
| 921fc59d8f | |||
| 45de7ad221 | |||
| dfc92675e0 | |||
| eb29c577c2 | |||
| cf492a9649 | |||
| de71842888 | |||
| 8959e0af3d | |||
| 7402543d3e | |||
| 3e0e6e35f4 | |||
| 69ee0efc0b | |||
| 57b8ff890c | |||
| d24abc3b9d | |||
| 4dabd0fb9c | |||
| 6ba30cb713 | |||
| d8761d7edd | |||
| 66018b89b2 | |||
| 86192c2f8d | |||
| 9cd5221d47 | |||
| ed54de1bbf | |||
| 8afeb0fedb | |||
| 320fde9eec | |||
| 899c7631d5 | |||
| e1948c651b | |||
| 02f4e78f3e | |||
| c3187e9388 | |||
| 6af808edc9 | |||
| cfd0140e2f | |||
| 3c182bdb35 | |||
| 961c239ee4 | |||
| e59c87ee36 | |||
| 5720bd296d | |||
| 70d0103a67 | |||
| 464c751f30 | |||
| fa97c59f95 | |||
| b61f6438ba | |||
| 965a8ba2c6 | |||
| 77cefdedb8 | |||
| dc18e65b46 | |||
| 1281809300 | |||
| e5cda3abcd | |||
| 2dfab65a33 | |||
| 8ecddb5bc3 | |||
| 74ba09f95c | |||
| 68b1ae1a36 | |||
| ea99e1184d | |||
| b0e68d039c | |||
| 712e25bb02 | |||
| a0d917fe98 | |||
| 0b426b5e64 | |||
| 9b1d6246a9 | |||
| 8e27b725ba | |||
| 9ac65c51f5 | |||
| c0bdad5893 | |||
| dae34edf4f | |||
| fef3434bdf | |||
| 738601f4fe | |||
| 679ddc0e32 | |||
| a384fcb99f | |||
| f36d31f74d | |||
| 80f4c4f923 | |||
| 75a4e46872 | |||
| 9ee3eb1412 | |||
| cdf9f8c42a | |||
| 947d2e5705 | |||
| 19d81068f6 | |||
| b3bd4bc384 | |||
| b3ae2208b1 | |||
| cf3bb08dfb | |||
| 9ee931e790 | |||
| 71cdfdcec8 | |||
| 819af69972 | |||
| 0a46c7a393 | |||
| 2a03db6065 | |||
| 8a6fa65ed6 | |||
| b480071946 | |||
| 0912f40ebe | |||
| 54a9fd2e6a | |||
| 1f91224f9e | |||
| 8ddea7e95c | |||
| 897261daf4 | |||
| 38cb716a57 | |||
| 7ddd043427 | |||
| d32799e4bf | |||
| 5868199e85 | |||
| b669c846b0 | |||
| e292b1fcdb | |||
| a6a8e2c553 | |||
| c5b8a3eb94 | |||
| fd16784bcc | |||
| f241615693 | |||
| ba5e60e2e4 | |||
| 4410f15dd8 | |||
| fbb314ef4b | |||
| f16cfbab5e | |||
| 85cb171cb8 | |||
| 3b71e46cf7 | |||
| 402c6da968 | |||
| 4976daca7a | |||
| 30498fd6f8 | |||
| 29bb5d27e4 | |||
| 8113a43252 | |||
| 19243b3e91 | |||
| e160acefe3 | |||
| 61a43419a5 | |||
| dec139716e | |||
| 5608867edc | |||
| a0a5668d1e | |||
| b1bcc60d83 | |||
| 721311c909 | |||
| 926b2b78fe | |||
| bfdbdd9b20 | |||
| 029e1aced7 | |||
| 44c34115a4 | |||
| c069aa62a4 | |||
| 7d1880078c | |||
| 9b1c881ca8 | |||
| 386663ddb6 | |||
| d8864d4f4b | |||
| d3bf013761 | |||
| 5c55b9c5ac | |||
| 524bd2e75f | |||
| 7504ceb6f2 | |||
| 137dce87fc | |||
| 3babb8c22c | |||
| 8ed4606685 | |||
| d8e54acbf3 | |||
| e256ac8791 | |||
| c65adc12d5 | |||
| 5d4c546693 | |||
| ea3499a712 | |||
| 1e0364baa8 | |||
| 9ef34cd831 | |||
| 74f0bebfc8 | |||
| b9bdad5165 | |||
| 77a9e343aa | |||
| afcb0aee40 | |||
| 02dc343209 | |||
| 854eaff34f | |||
| 0aaaefbb4b | |||
| 1165b358b4 | |||
| b9f9228a22 | |||
| 4c52007996 | |||
| 471e735b0c | |||
| 7cf7d5c3dd | |||
| 28e0d64ede | |||
| f9b7ed3a1f | |||
| b8466d362e | |||
| 6aee6dae6b | |||
| b654121b50 | |||
| 6066ea3170 | |||
| 8686667b10 | |||
| eea0d2e096 | |||
| add9673ad6 | |||
| 31df4c00ec | |||
| b95f561bf2 | |||
| 1bd27891e2 | |||
| df2e788a1c | |||
| a7908ba76b | |||
| 1d8fdf52d5 | |||
| e9c1f8b4e6 | |||
| 43ba23430d | |||
| 78189e2247 | |||
| 9165b5c28e | |||
| 69d584331d | |||
| b2011bd0a0 | |||
| 5fa90cd214 | |||
| 86edc0da31 | |||
| fa853102e4 | |||
| bc81179163 | |||
| 815649dbd7 | |||
| 56bc2c4591 | |||
| 48f99fe661 | |||
| 1ade37305f | |||
| b86f2069ff | |||
| 2f3c0a6d80 | |||
| bd262eaac0 | |||
| 7e7de25710 | |||
| d9aa31fd92 | |||
| 156bdae2fe | |||
| 7b5395675d | |||
| 0466437fa7 | |||
| 8cea656ad7 | |||
| 0f16935763 | |||
| 637db92e60 | |||
| 613e15035e | |||
| ac2d14101c | |||
| 64d3301523 | |||
| 9f547a1b39 | |||
| 2dfa02a346 | |||
| 3f6e971571 | |||
| fd72556fd1 | |||
| 17af1ba893 | |||
| eaa649cfb2 | |||
| 07719045db | |||
| 47f94548ce | |||
| 0c56f82db5 | |||
| 6cf3f10d35 | |||
| b0894b3148 | |||
| 4fda6af725 | |||
| 9c247ce874 | |||
| 53091551d8 | |||
| 8e188cd96f | |||
| ecc596534a | |||
| e5ebbacc9e | |||
| 9294a95438 | |||
| 960553f9c4 | |||
| 5a4237a31d | |||
| 97d216c94d | |||
| 4d884c3849 | |||
| e940152bce | |||
| eef9a1e7ed | |||
| e18c0d54f6 | |||
| 5e314e8eff | |||
| c0869887cf | |||
| 9edf45a324 | |||
| d2886f2020 | |||
| 00449cdf37 | |||
| 23d39f7ef0 | |||
| d1ae6512cc | |||
| b71cf1a4f9 | |||
| 660951dc64 | |||
| 42e110b49c | |||
| a098c7c685 | |||
| 22466010fc | |||
| 2fe0716cb4 | |||
| 96c99125da | |||
| fe3d3be399 | |||
| 5b4a303672 | |||
| 8a2c5dda6d | |||
| 85f9869f69 | |||
| 60e3b563e2 | |||
| acdce2b1e0 | |||
| 95c2ac5d58 | |||
| cd05dfb943 | |||
| dd4e577f6d | |||
| fc555b48ec | |||
| b3f107ddda | |||
| 896bff5748 | |||
| bd9fa658de | |||
| ff5dbc52b8 | |||
| 9f9b448161 | |||
| adc9d906e4 | |||
| f21d6d4f9f | |||
| dc499c5b4e | |||
| d0cb99e347 | |||
| 2cb741adff | |||
| 33c1fa6e28 | |||
| 72a43b3929 | |||
| 3e150ff548 | |||
| ff4b0c4d7f | |||
| cce59df2ae | |||
| 39e8981bc2 | |||
| b758725bf7 | |||
| 1b8a644c31 | |||
| 6545e48787 | |||
| 6bb48b2731 | |||
| d896c19011 | |||
| eba6a65908 | |||
| ffbd72bbcf | |||
| a248cc73e6 | |||
| daf742c086 | |||
| ce89ff15aa | |||
| d01b78a4b4 | |||
| 3e84d85482 | |||
| aba3182a7d | |||
| f7d8a8c571 | |||
| d20eea9761 | |||
| 4e327295c6 | |||
| 0fd8b1a044 | |||
| ca2c7001c4 | |||
| 70237f7ecc | |||
| 10fc51dc92 | |||
| cf26f8a6a7 | |||
| 4b3f074309 | |||
| 2f68b08491 | |||
| ebc7a6a0a6 | |||
| 9d2f8aa717 | |||
| b72d7f1ab3 | |||
| ad495a9218 | |||
| 1f8cf2d8f2 | |||
| a88305b4cb | |||
| f9f91a08b4 | |||
| 71b70bb05f | |||
| 20fc23c82b | |||
| 3300d6ea53 | |||
| a7438189f3 | |||
| 3a4521a012 | |||
| 6b704a780d | |||
| 5161758921 | |||
| 6abb2cb92e | |||
| 65eee1f69d | |||
| ef1e359c7c | |||
| e3203f87ff | |||
| 284955573c | |||
| dde5660915 | |||
| 011132feb3 | |||
| 7552390031 | |||
| 523fdda399 | |||
| a07c6b1a2e | |||
| 7bc9fa765c | |||
| 90286353e2 | |||
| d15959d573 | |||
| f74d11c0c3 | |||
| 45a3d84748 | |||
| af75ecf9da | |||
| e2fd0bbf02 | |||
| 4b3282b325 | |||
| 11f7eeb63a | |||
| b559952806 | |||
| 73eca66a89 | |||
| 5fef9dfc22 | |||
| 60ba5508a4 | |||
| d6a9af3138 | |||
| 72882beb0d | |||
| 1b6fe4f65e | |||
| c26e003462 | |||
| e57de98bbe | |||
| d8e9db207f | |||
| f42897344f | |||
| 08b4f996d3 | |||
| e5c009599d | |||
| 0d16f177cb | |||
| 34a0128ddf | |||
| bcda46eda3 | |||
| bd4fd76bfb | |||
| ef33219e4f | |||
| 31d268fe92 | |||
| 553f4533c0 | |||
| b201e51528 | |||
| c8acd4a594 | |||
| 4e89a0faf6 | |||
| 536a3ecb42 | |||
| ede0a675bc | |||
| cb2dd97509 | |||
| fa165498cc | |||
| ff038f8766 | |||
| 0a07e5fdaa | |||
| ff75d65d7e | |||
| c384e3ba4f | |||
| c92fc9bf65 | |||
| 24bc639222 | |||
| bcef775d6b | |||
| 266699ddf9 | |||
| 128d446f39 | |||
| eb3ec05f88 | |||
| 73c6db5c8e | |||
| 3f881f1ca5 | |||
| 0ba9332358 | |||
| 0c19e44a61 | |||
| 60a939dfcf | |||
| 0da988a1bb | |||
| ee31bc7995 | |||
| a867bcab46 | |||
| 31e20d2283 | |||
| 6ff89dcf72 | |||
| f479105f5e | |||
| 10ef01b04b | |||
| 8b9d439841 | |||
| 179bf15daf | |||
| 71b32f7ad4 | |||
| 96dd008f5e | |||
| b7a5ae38c5 | |||
| 102cf150b3 | |||
| ec40f69c9e | |||
| ac0c5ba6da | |||
| 19c101a660 | |||
| 34c08b3165 | |||
| d139e3c3cd | |||
| c23090b43c | |||
| a3125f164e | |||
| 26fcb35a89 | |||
| 826cb2c650 | |||
| be60b451eb | |||
| afcf965498 | |||
| cbdcb68c2b | |||
| e0cbefc727 | |||
| 109d806617 | |||
| 0e11cc9f6f | |||
| ac8362e34a | |||
| b63b377c4d | |||
| 45b320d674 | |||
| 7cad6ccce0 | |||
| a191b75c31 | |||
| 7ed8f39744 | |||
| 37963fee28 | |||
| 8e8c4a8edc | |||
| 82b54938e3 | |||
| 0a93d4eccf | |||
| 5b03de9a66 | |||
| 892343c7c1 | |||
| d91bc9b317 | |||
| 7c815054c7 | |||
| 61166c1002 | |||
| 8f8d486f35 | |||
| 07d7138df0 | |||
| 0fa5e196ef | |||
| 514c9ad8e7 | |||
| 19bbb61b20 | |||
| 89c39b47bc | |||
| 632b3cbbbb | |||
| 3d8a09b147 | |||
| 145d6f3566 | |||
| fa104fee17 | |||
| b13ab2b17e | |||
| 194211500b | |||
| 9848bc33e5 | |||
| 03120959e9 | |||
| 33b06c4484 | |||
| ddb7197c9c | |||
| de09883d86 | |||
| b1a33110fc | |||
| 77f6872ea4 | |||
| bc085c3ff4 | |||
| 247b25e7a9 | |||
| 5234e66bab | |||
| 27bf34f7be | |||
| eaa1074ccb | |||
| 38072e1900 | |||
| 7ba8dbb920 | |||
| 122f7e4c2f | |||
| 8e22823501 | |||
| de49652536 | |||
| 222bb2303f | |||
| 5332c319a2 | |||
| c442a06a02 | |||
| 9377b75350 | |||
| 3267d91bda | |||
| a77edf88c6 | |||
| cfc41942e4 | |||
| 27218f85cb | |||
| b949619d04 | |||
| 45c9f1978e | |||
| 50233d075c | |||
| 0fadbee699 | |||
| 193e93e4a9 | |||
| c9be325af2 | |||
| a310a81053 | |||
| 5a50144a16 | |||
| fa8b66ca4f | |||
| a919a136c4 | |||
| cd2f75fdad | |||
| 0f3eebbbd9 | |||
| 7e3b35a57c | |||
| 111af7fed5 | |||
| 4d5646a59f | |||
| 4a91c6dbed | |||
| 9e83f0247f | |||
| 6b01d7be9a | |||
| dd0daa6e33 | |||
| d108bdc7c7 | |||
| 551b4443e1 | |||
| 60fe9dda5d | |||
| 1cdb4396a4 | |||
| 3efa5f17f2 | |||
| c55d2af6b3 | |||
| 2b8125f4ba | |||
| d36d317bb2 | |||
| 03eb5197b6 | |||
| 9c032ecc33 | |||
| a2d7e9c6e8 | |||
| fa5a5649c6 | |||
| a85a10b378 | |||
| 618f92b3fb | |||
| d5959872e1 | |||
| 4b8ff4d910 | |||
| f6075cc1fe | |||
| 92221e98de | |||
| d712d7f52c | |||
| 3ca76d24a9 | |||
| dc3dd272f7 | |||
| 1aaf008020 | |||
| 3f507898d0 | |||
| c3dfcc5b21 | |||
| b4ffaa9498 | |||
| ca9b4e467f | |||
| 84d6c53970 | |||
| 2582fe1c89 | |||
| 98bf8cfeb6 | |||
| 2cbd281637 | |||
| 8228a554a4 | |||
| bc5d9f5868 | |||
| 8495e1a63e | |||
| f8b62d49ee | |||
| d1b2c10422 | |||
| 700a120c22 | |||
| a33a62bf60 | |||
| ae7aab2d6e | |||
| 91d85e9b16 | |||
| 340320625e | |||
| 9908adb320 | |||
| d8cfe77ba5 | |||
| 9599548203 | |||
| ab760578f8 | |||
| 97ab706a6a | |||
| 46aa011ef9 | |||
| 9ccf46d350 | |||
| 018f0c4b72 | |||
| 57c4d39b1e | |||
| cf5d63f0ab | |||
| d8d2939668 | |||
| 75323b86d1 | |||
| 1d88ab57ec | |||
| 41817db2e2 | |||
| a4543175ce | |||
| 9f01533710 | |||
| fb88bdba69 | |||
| 0a78849391 | |||
| c40668e3a9 | |||
| c411826fe5 | |||
| f06858689f | |||
| af214d9dcd | |||
| a5df3f8ea7 | |||
| 72947e46d1 | |||
| bb97cbbb0c | |||
| 0f54084305 | |||
| 2e365658c8 | |||
| 691103acd5 | |||
| 34f05ba180 | |||
| f2dcab50b5 | |||
| 4c45483ad3 | |||
| 188a304625 | |||
| 6906988b4e | |||
| 23b64cd9ce | |||
| 042878a5a9 | |||
| c609b30841 | |||
| 1794ad353d | |||
| 86fed4c226 | |||
| 8188a9f51b | |||
| 9c79de4aa0 | |||
| 45ef2ecf52 | |||
| 3e84f170e7 | |||
| 1865659ce1 | |||
| 90e2962c91 | |||
| 503e5cada3 | |||
| 48fe85d9bd | |||
| e8afe4f158 | |||
| 4daedda35a | |||
| b621431c11 | |||
| 3b9ce95fc3 | |||
| d1dcd7893c | |||
| 8c7b13db70 | |||
| 3d3190309f | |||
| 1471d8f710 | |||
| e10402c61b | |||
| 5d8d7ef2a1 | |||
| 5dcd9e20d0 | |||
| ec2f49833d | |||
| f914cd0144 | |||
| fe3bcb5fe2 | |||
| 642ccd27ab | |||
| 33c5b3a2ef | |||
| 6ecbaf0041 | |||
| 0b4607321f | |||
| d29a02a65a | |||
| fa6ad6ba68 | |||
| b192f86d84 | |||
| eb8ffd9315 | |||
| f193e474c1 | |||
| e76e4e7540 | |||
| b23b5aae7f | |||
| baffa03fa5 | |||
| f040ce044c | |||
| 3c72a7c934 | |||
| 02f15e9a03 | |||
| 2754cac21f | |||
| ea15c17149 | |||
| 0a9b0ee382 | |||
| a829ce69c5 | |||
| 5e9d268c21 | |||
| de642697bb | |||
| d1c3aa3112 | |||
| de37bafa5c | |||
| 3e0bb3e7c4 | |||
| a76ff563d6 | |||
| 7ec1c0703d | |||
| 273d7fb4fd | |||
| 77b51f03e3 | |||
| 76d7ce4b52 | |||
| 630cee0ef2 | |||
| d190ebee48 | |||
| 5943af17e7 | |||
| 63a088c2b1 | |||
| d8d4420f22 | |||
| cef230c141 | |||
| 4eb9a69bd8 | |||
| e2721fc93c | |||
| 5eca0e4f29 | |||
| 2a351f4456 | |||
| aae0d990ca | |||
| 089c24e650 | |||
| 8c09330959 | |||
| 04c9cc6034 | |||
| a501d4b61e | |||
| ab96fa67c8 | |||
| 8148480cfe | |||
| 01fcc080bb | |||
| 857535403c | |||
| ff0a542e48 | |||
| d4d09b06f8 | |||
| 3d0d47957e | |||
| 62cd89da14 | |||
| 89865cb8a0 | |||
| 92c7b2717d | |||
| 6c501f90bb | |||
| 0af31a5328 | |||
| c8c3b8a63e | |||
| 0b19af5e10 | |||
| fe0832746b | |||
| ff9111847f | |||
| a5e892505e | |||
| 797e921b9a | |||
| a7d7597d55 | |||
| 42735429da | |||
| 28650191c3 | |||
| 820f2f27f6 | |||
| a1d03de666 | |||
| 8fe5251029 | |||
| 4f627c428e | |||
| bfb67286c8 | |||
| dda79a90cf | |||
| ea8f71a19c | |||
| 8b93a9a237 | |||
| 862f824d64 | |||
| 097ce76fc4 | |||
| 0d2f1688e4 | |||
| 3cf81cadd5 | |||
| cc15852386 | |||
| 7988541476 | |||
| 66f4f06dd9 | |||
| 11cb45bd43 | |||
| 9dcf29ff51 | |||
| 0d3181b6d1 | |||
| 4230e217af | |||
| 9f5bce81b0 | |||
| e039015ca1 | |||
| 1d1dfcbc1a | |||
| e082d473bb | |||
| ca874a3ad7 | |||
| 9df193f051 | |||
| 7c738a1384 | |||
| eae32e05c9 | |||
| b1fb325d48 | |||
| f285790fa1 | |||
| 319e93f7fb | |||
| cfa284bfa8 | |||
| 8cd1027214 | |||
| b7de1850a0 | |||
| e188b96596 | |||
| 8f9c852325 | |||
| ce4fe9e7cb | |||
| a02d5d1a3d | |||
| 3e756407a0 | |||
| 95fe159914 | |||
| a62e109e8c | |||
| 196d619689 | |||
| 358fd1c024 | |||
| 77493e8d70 | |||
| 996e6cf419 | |||
| 3988ec2813 | |||
| 5387820a3b | |||
| 70f9936651 | |||
| 814bc2fd2b | |||
| 2e05bd69f5 | |||
| c768751c23 | |||
| 8bfc73c188 | |||
| f3ebd29661 | |||
| 18bac944b4 | |||
| 92db4f8be0 | |||
| 7f754c02f3 | |||
| 3f87c2cedb | |||
| 9850820b42 | |||
| 6c6b570ff1 | |||
| fd72f2bd29 | |||
| e2d6bf4c63 | |||
| d9914664f6 | |||
| b3f3b8c23f | |||
| ed0c99ef14 | |||
| 1a9ded981b | |||
| faf6055baa | |||
| 499ec15c26 | |||
| 4af22bfb7a | |||
| 9460c9e907 | |||
| 9794e7e427 | |||
| cff0ac2bf9 | |||
| 0ae088a50a | |||
| 48f42176cd | |||
| d20b8399c3 | |||
| c5c843bfef | |||
| e0c92662f8 | |||
| a79f5d40de | |||
| c20319d377 | |||
| d9c7e4c333 | |||
| 325858e9e2 | |||
| c121a1a1e7 | |||
| 6a8364c3ff | |||
| 95459d068e | |||
| 1cffeefa06 | |||
| 6658f51098 | |||
| b3a974d8bb | |||
| 501678f981 | |||
| f1cbb9effc | |||
| e53e7990c4 | |||
| fd4b30ac6f | |||
| e9af218562 | |||
| e2b4954176 | |||
| 82394f9527 | |||
| 3d67cd51c2 | |||
| abc749feeb | |||
| b6ed61eab2 | |||
| d3e6ea6ac0 | |||
| 3d8d6d718b | |||
| 86d2927c02 | |||
| 987845c312 | |||
| 236d2aa5b8 | |||
| e227a65f66 | |||
| 70a369e16d | |||
| 21f8d0992f | |||
| 36b7d819e5 | |||
| be948a9baa | |||
| 7c7031df44 | |||
| c691c9d24c | |||
| 7a49c8e59c | |||
| 6540bda238 | |||
| 77ab89a7cb | |||
| d5f7a39936 | |||
| ffdfe8257b | |||
| 456ada01fa | |||
| 12bcbcdc62 | |||
| 8ed4262393 | |||
| 430ccef09c | |||
| 0ae2e250f5 | |||
| a069d83f44 | |||
| ec7ed3c882 | |||
| 619c62e681 | |||
| 548a2e6263 | |||
| 3efa69bc84 | |||
| 1cf7fc261f | |||
| 8dff0fb58d | |||
| ceb0016bdc | |||
| 30d524b426 | |||
| 7ff4e40b20 | |||
| 490c9db15d | |||
| c62673d360 | |||
| 9d2379742b | |||
| 8a1b671fdd | |||
| adec09b075 | |||
| 87627c7a50 | |||
| 71a2241aee | |||
| 2ee2f87efe | |||
| 868cf6bb83 | |||
| 96612c506e | |||
| 71aa36c3f1 | |||
| 0203f55fbf | |||
| a3e58157ee | |||
| d8734cee02 | |||
| 6f1ed85f0b | |||
| 1fa05894d5 | |||
| 45cff7b737 | |||
| bd7227bb93 | |||
| 6bbd67c3c6 | |||
| 539fd7240c | |||
| a33b757b19 | |||
| dab5531474 | |||
| e8b69d45a3 | |||
| f47444e1f7 | |||
| 5f3c549227 | |||
| f54c767d72 | |||
| bcbebe390b | |||
| 011bc1e764 | |||
| 6e35d50cbb | |||
| 62da0bae43 | |||
| a3b8d54576 | |||
| 98b2d2db3d | |||
| 496c1581d7 | |||
| 86893ea78c | |||
| 0e2531ba57 | |||
| fa7fabf024 | |||
| 20553c1afe | |||
| 19827b8b35 | |||
| dccdeca258 | |||
| c2fb5fed02 | |||
| e6b835bea8 | |||
| aec6a3c32f | |||
| 127c0c7033 | |||
| d53ed4b40b | |||
| 31dab0372d | |||
| ae426ad115 | |||
| 064f87680b | |||
| 60a03580ff | |||
| f7161bb48b | |||
| dc20900e10 | |||
| 53503148f3 | |||
| 4446854f75 | |||
| 07c422d81d | |||
| 3adaacc0ce | |||
| 024405e4f1 | |||
| 3c52ac7af3 | |||
| bfa18fde19 | |||
| 7323b52560 | |||
| a37bd93222 | |||
| 777804fac2 | |||
| 525306c1e2 | |||
| 29fc82c364 | |||
| 594dcf13f2 | |||
| 0fd5252cfc | |||
| 169ddc5b0b | |||
| e137020f67 | |||
| 363fdc40b8 | |||
| 7208abf618 | |||
| e084386770 | |||
| e402896001 | |||
| 01827e9340 | |||
| d10f4f071d | |||
| d6aa5ac7e8 | |||
| 31ea39360c | |||
| 3030f13d5f | |||
| 40d343e2af | |||
| a25bda8e41 | |||
| 5c816c0cc9 | |||
| 125cf79a37 | |||
| 45bb6f5fd4 | |||
| ee7931f457 | |||
| 3579446930 | |||
| 0917bdecdd | |||
| a0bb6079c5 | |||
| f5385e4a63 | |||
| 623afb69b6 | |||
| 39f342d595 | |||
| 6eb1427ac0 | |||
| b77132edbe | |||
| 6bd0aad117 | |||
| facd4cbe17 | |||
| 3eff161bbf | |||
| 90d189a8b3 | |||
| 8f3da6ee9b | |||
| 1a74f0a18c | |||
| c4ee924869 | |||
| 192b8906a3 | |||
| c9db88aa3b | |||
| 73038156cc | |||
| 95e7be4aec | |||
| 5408a26234 | |||
| 6929652e14 | |||
| 26a5c13906 | |||
| 340b6bf3ad | |||
| b5418173e5 | |||
| 1bd3b65069 | |||
| db23ec5c1c | |||
| 66ac6c232c | |||
| 20b9678789 | |||
| 1a0c273a20 | |||
| d9db6e73d8 | |||
| a8b7ae515c | |||
| 1d6b4f8f3c | |||
| b4924ed1e5 | |||
| fd9ce6da35 | |||
| c95e8a1fc5 | |||
| 2f80df1f9e | |||
| 85853f9ec2 | |||
| 9379c3e128 | |||
| 8684e847b0 | |||
| b4d84bd9bb | |||
| c4864b4a54 | |||
| 25f1263c11 | |||
| ff53b0c209 | |||
| 25381ac5b1 | |||
| 398fbe7b82 | |||
| 88b2391d2b | |||
| 7cd1a302d3 | |||
| 158360c09b | |||
| 43d2266f5c | |||
| eb5de4d4f7 | |||
| 7c03b612d2 | |||
| 24748ee10f | |||
| c4a6b99814 | |||
| bcebfbfbe2 | |||
| 9fd07ee10d | |||
| 36d696c30d | |||
| 5f7727629a | |||
| 25faa40bd0 | |||
| f4a586a52c | |||
| c191ef6459 | |||
| 0c5eb542bd | |||
| 6112cdc7e8 | |||
| 9f1370a6d1 | |||
| c0c6b5310e | |||
| 3e9a69b9b7 | |||
| 424c64c0eb | |||
| 249e46c5b7 | |||
| 4db661ba9d | |||
| 23396721e4 | |||
| 1e4444f25b | |||
| 90a830baba | |||
| cdf1cf82ba | |||
| e50dfbc228 | |||
| 2cebfb50a4 | |||
| 5962e66b6d | |||
| bc79951f33 | |||
| 3af427fa54 | |||
| 89616d81f0 | |||
| 960dd750c9 | |||
| 9f3388ecbc | |||
| 30673e4786 | |||
| 89073970d3 | |||
| 8337eaa1ec | |||
| 25e777ef5e | |||
| 90c4666b12 | |||
| 0bb48d814b | |||
| 7c00aedc37 | |||
| 36bc1a2102 | |||
| 493ba20734 | |||
| 55be59e738 | |||
| 5e08d1bb40 | |||
| b810380d56 | |||
| cfc710e768 | |||
| f6a27dfa28 | |||
| f1672d7d10 | |||
| 5a106d1036 | |||
| 24c79c5bce | |||
| 1133eaa679 | |||
| ee88ded463 | |||
| 0bbc9ade7d | |||
| 8df0650658 | |||
| ee01d1a81d | |||
| 5507db9b15 | |||
| ab31a890b6 | |||
| 05d76dcd67 | |||
| bfa69c3e59 | |||
| 6225b5ec86 | |||
| 66b96e4440 | |||
| f81ac81550 | |||
| 7b9fb84fe9 | |||
| 92b8f32386 | |||
| 91b705cc4f | |||
| f870f9efcf | |||
| 9e5172f75c | |||
| f198296576 | |||
| f999fbf81a | |||
| bbd10a3c94 | |||
| e4faea8f90 | |||
| d514b1d92d | |||
| 6583d30e26 | |||
| e229a6adec | |||
| 0124809a42 | |||
| a69d3c3346 | |||
| 4145e3b265 | |||
| 39d312861a | |||
| 2b8ec1cad0 | |||
| 153467dbe0 | |||
| 7b82d153c7 | |||
| 3a5d3dfd97 | |||
| 32bff22dc7 | |||
| 64a617b2a1 | |||
| 1f718d31e1 | |||
| 6c340416d9 | |||
| 3f1486534f | |||
| db1f77e4f5 | |||
| 149bbeb260 | |||
| f91702d7b5 | |||
| c72c4dd412 | |||
| 4c1fb4c282 | |||
| 12681e92b0 | |||
| fdf3df3de5 | |||
| 371b4642bb | |||
| f1c5dce75c | |||
| c46f701771 | |||
| df67c35017 | |||
| 7ff86cfebe | |||
| 803f86e0fc | |||
| 538618df62 | |||
| fc70c7094a | |||
| 217151eb9c | |||
| ffecc3e434 | |||
| 8543e79713 | |||
| 1191b57b34 | |||
| 6a1121ab2e | |||
| e0f655fb70 | |||
| 0ba315912b | |||
| 4522d19b4c | |||
| 45038af948 | |||
| 5574b87e9b | |||
| 039bbfde2d | |||
| 30f1de71a6 | |||
| 927bf56940 | |||
| 928e9b121b | |||
| 57f2bf5969 | |||
| 21bf8e99ee | |||
| 05f1fffddc | |||
| ad4e305c96 | |||
| 500407dbe9 | |||
| 2f4a289782 | |||
| 830cf87697 | |||
| 266fbb442e | |||
| 935b828427 | |||
| 63ae4b3dfc | |||
| 5172e0a7a3 | |||
| e6298325f6 | |||
| 5458e52935 | |||
| a77f3a07a1 | |||
| 6fccf12299 | |||
| cdfb252ced | |||
| 456394d3ec | |||
| e1a499f65d | |||
| c2183427c3 | |||
| 76ce8c6c6a | |||
| b8e01939e9 | |||
| 66f8a0e1a3 | |||
| 78c5c2e7d5 | |||
| 5238a7812c | |||
| 01ebb74a33 | |||
| 437d50c6f6 | |||
| 97901391f4 | |||
| 415e968612 | |||
| b5ae924031 | |||
| 9dcdf517f5 | |||
| 7ea2923fa8 | |||
| 735fcf8bd2 | |||
| 6866165a37 | |||
| 1c311c36bf | |||
| 42ef44e1b4 | |||
| 6ccb1187df | |||
| d12afe0541 | |||
| 3552626358 | |||
| 11c848b221 | |||
| ccad24a925 | |||
| 838766add0 | |||
| ca03a26f15 | |||
| 137c630377 | |||
| 5bd117dd6d | |||
| dc942d6f3e | |||
| ce13b3b7cd | |||
| b44a7dc36a | |||
| 10aa296895 | |||
| 69ca0ae177 | |||
| 1f95231801 | |||
| 6e86b34586 | |||
| 91016e37d4 | |||
| 42b1c75a66 | |||
| 7859c1105c | |||
| de16537231 | |||
| 1f35c94242 | |||
| 2179437726 | |||
| 941f199caf | |||
| 965ea96439 | |||
| a1dfe16d0a | |||
| d7ed456f96 | |||
| 96e2f15d8a | |||
| b0dbca0cc7 | |||
| 757e6cd0aa | |||
| 011732a083 | |||
| ebe10870cf | |||
| 907dd4d24d | |||
| da33229dab | |||
| b366b0eb52 | |||
| ac188ec74b | |||
| 3210fe2564 | |||
| 15ea83834d | |||
| a883fcca3c | |||
| a44bbd8005 | |||
| 6b50980469 | |||
| c81beab96d | |||
| 3364502f00 | |||
| 07cf709eeb | |||
| 63d9c1a817 | |||
| 37c0b97b3c | |||
| 7cd809b286 | |||
| 3ec5ffe24e | |||
| 5ecc10b756 | |||
| 9c04858631 | |||
| ec3955b158 | |||
| cf1023567b | |||
| 360778e520 | |||
| 872d301af3 | |||
| 0e428ec595 | |||
| 43f7b2fd2d | |||
| fed7eef4f3 | |||
| 87b46decfa | |||
| 5cd6e0f4d9 | |||
| d347fe0c53 | |||
| b1433119cc | |||
| 56af6ee752 | |||
| 0ac9e56da9 | |||
| 0c76884f98 | |||
| ef69abd4dc | |||
| 2d25bb3b01 | |||
| 5eb6071b04 | |||
| b106686382 | |||
| 0615d096ce | |||
| 36a2649e37 | |||
| 352d73f1e0 | |||
| 4cc68eac6d | |||
| f4ce399162 | |||
| 469a80ac09 | |||
| 5c179e6255 | |||
| bfdbcbee12 | |||
| e979aa0c32 | |||
| 58a781d9e4 | |||
| 34a4784077 | |||
| e0dc8b8ab2 | |||
| 4d1c414ffb | |||
| 868cf46290 | |||
| 06388e1339 | |||
| a9878dca6d | |||
| 7d53b6f106 | |||
| 6e0ea7aaae | |||
| 1b1c4889fc | |||
| ffd47ef4d7 | |||
| f9c4975a45 | |||
| 37dbf48434 | |||
| 0ba472c18a | |||
| 1697347045 | |||
| e60860148c | |||
| 22356533a0 | |||
| 0d120efda5 | |||
| 28e15fd487 | |||
| cd8f54ade2 | |||
| 0fb73ec49d | |||
| 9bcd367873 | |||
| a1429085ee | |||
| a0ff21a232 | |||
| 0b45d19ea0 | |||
| c6eeb4a808 | |||
| b71ea287aa | |||
| 8de4163ba2 | |||
| 25213a790d | |||
| 1b5d206ca7 | |||
| f4338f631b | |||
| 118cbf8400 | |||
| afa07beda0 | |||
| 24dc1aec8e | |||
| dddcd66ead | |||
| 237ba65a20 | |||
| eae3e134ff | |||
| d93a5a0774 | |||
| 1a6ad816a3 | |||
| 5500041cca | |||
| d92b083c1d | |||
| 3c910b812b | |||
| f67e5d18e7 | |||
| d23c9362d8 | |||
| 125731cab0 | |||
| df10d7f385 | |||
| fd4b63810d | |||
| e316cddf65 | |||
| 2a0ed930ef | |||
| 66020c5d44 | |||
| 6d37c7d351 | |||
| 60653c0544 | |||
| aadb81a32a | |||
| 9d9f254c78 | |||
| 3f67918522 | |||
| 27d9cbd8c0 | |||
| ac63afbd95 | |||
| 5817bd10ba | |||
| 5f04b41ea6 | |||
| 978a08ab1c | |||
| 604ca61d78 | |||
| 47548fb8c6 | |||
| 85ab3b3924 | |||
| d91a4fcaf3 | |||
| 6c78cd2765 | |||
| 3be0564040 | |||
| 19186bf37b | |||
| 18b8dc1c21 | |||
| f7f19af816 | |||
| 5e40653713 | |||
| fbb126cdd9 | |||
| de3032fd00 | |||
| ccc43f0ea0 | |||
| 37f5a8cdb4 | |||
| e5d3666280 | |||
| ed5fb902bd | |||
| 13784bee18 | |||
| 041e3575d1 | |||
| 9e105d9bd7 | |||
| 4c91ca2f86 | |||
| a9aabd1c8d | |||
| 9c6248443a | |||
| 49337e0ad1 | |||
| ae711168c3 | |||
| 4d1ed7e05f | |||
| a4e14b49b1 | |||
| 76b193c698 | |||
| c2392bbace | |||
| 6a295997bc | |||
| 21c4515465 | |||
| 034cf19159 | |||
| 010bfa11e3 | |||
| fea68e08b4 | |||
| 001d06f2ff | |||
| c6aa0f9854 | |||
| 09a53170a3 | |||
| ecf6f2ca2f | |||
| 9a4e37483b | |||
| 91a9688d07 | |||
| 6c09d9e0f8 | |||
| 799a7db638 | |||
| d1edc360d9 | |||
| 8f8985c3e5 | |||
| 23f52aa6fd | |||
| 2de3b4bd17 | |||
| 5b57cd310e | |||
| 6b95d7427a | |||
| e51957b4de | |||
| 9ed3c31fc9 | |||
| c3cda81577 | |||
| 67a8ae084a | |||
| 33847dd101 | |||
| 064d6b8a2c | |||
| 0d81014fa6 | |||
| d485a70e7d | |||
| 47a275f389 | |||
| f9db4249a3 | |||
| f18e866a1e | |||
| db490fbc8f | |||
| cb445deb5f | |||
| 486694c2ec | |||
| be9ca44d07 | |||
| a01a3d412c | |||
| edc9a150aa | |||
| 2f86a6203a | |||
| d3a0c7354c | |||
| a88cc91ad9 | |||
| d80b477ab5 | |||
| 48a8f2a793 | |||
| b6d66c4727 | |||
| 6dcabdc61c | |||
| e0a058c732 | |||
| 868a3b5364 | |||
| 9e9bc1430b | |||
| fe59015126 | |||
| 4c8f17ad47 | |||
| b8cffbc0ee | |||
| 2a184631d1 | |||
| ebe3ae58cf | |||
| 0730077840 | |||
| 39a7bd9c00 | |||
| cc55f00481 | |||
| a1af757ef6 | |||
| 6a7fbf9d13 | |||
| c62c55fb81 | |||
| 534b6f3a09 | |||
| 29048bf4bd | |||
| 30857b24ea | |||
| 5ccd26959f | |||
| e6739d230e | |||
| 4374d55e5e | |||
| fb4c3bd9ce | |||
| 470bab9c68 | |||
| a8789ebe29 | |||
| a9bab168f5 | |||
| 65c37abef9 | |||
| 1415cb8d19 | |||
| 536bc3d3c5 | |||
| db6738478b | |||
| 51dfb0a3e0 | |||
| 312e7993bb | |||
| a22b5feda6 | |||
| 7250dc4e98 | |||
| 67854a94bf | |||
| 782d201191 | |||
| 19328fd8b2 | |||
| 5d9b7bf1dd | |||
| ad9a81bf41 | |||
| 4eb7487e61 | |||
| 853d1730c7 | |||
| 929ce2b566 | |||
| 64a24191a3 | |||
| c500c1e930 | |||
| 6207c0444b | |||
| 5d8314cfb8 | |||
| cbb2db8622 | |||
| e7de254342 | |||
| 06d2a87ee4 | |||
| 2c4ab355ac | |||
| e04951f8fd | |||
| 8efec8e900 | |||
| 215cb1e6e0 | |||
| 1b146b85d2 | |||
| 5a5b216ba0 | |||
| 5ebf8a87f2 | |||
| 39e67707d7 | |||
| 97471b5c2a | |||
| 830a34a10a | |||
| eb4cd86910 | |||
| 4793d25c57 | |||
| 31663cfff5 | |||
| 96dc279e8e | |||
| 2ea20862fc | |||
| 3bb11db943 | |||
| ed2ba4e8e4 | |||
| 86b65c269a | |||
| 349923c5b8 | |||
| 9b59bf40df | |||
| 8afb2e98fa | |||
| a70fbcea28 | |||
| 5a99310cdf | |||
| 16e4e6dcc3 | |||
| 3e2e5196d2 | |||
| 5fd595c0bf | |||
| 1cddfe8820 | |||
| 95b9f4ed23 | |||
| 5bff1c8ad1 | |||
| f009ede753 | |||
| 1efb4a0c61 | |||
| f7674d06d3 | |||
| 524aaf0e5e | |||
| ffa835c56f | |||
| 16c8f62658 | |||
| d582f7576c | |||
| 9eef57faed | |||
| 8ee53708ae | |||
| 1fe55b6656 | |||
| 9bb004963b | |||
| 5e6fa608eb | |||
| 469e983a02 | |||
| 1383cb51e7 | |||
| 6a1a7fcd26 | |||
| 25fa9bf8ec | |||
| 3c42867109 | |||
| e1b9b65e41 | |||
| d5e9c7d572 | |||
| fbad1da9e2 | |||
| dff9585f64 | |||
| ff346ad135 | |||
| 4eb36b0ecf | |||
| 3d1accab70 | |||
| 9e50cecf27 | |||
| 092c41f375 | |||
| a7b048dc05 | |||
| f6ed7a19be | |||
| f3e8776dc6 | |||
| feeb0c742a | |||
| dc641943d9 | |||
| 65214bed0c | |||
| 6cef214b66 | |||
| a862fec9a3 | |||
| 3844fb0e4c | |||
| 835d6a9b6e | |||
| a9e94a34c9 | |||
| 59ad0a6c9c | |||
| ec12dec106 | |||
| 1ab0adec46 | |||
| c67c933d3f | |||
| 9fdd1bafdc | |||
| 5e711f37ca | |||
| 9c6d3a83fd | |||
| ccd9b56609 | |||
| efecb694ef | |||
| bd65c18f21 | |||
| b41ca8bacb | |||
| a8148fa94a | |||
| 7f1bb5fd78 | |||
| d55e689261 | |||
| 3f44a28e28 | |||
| 39430c837f | |||
| c7b7758816 | |||
| 56f12cbfb1 | |||
| 33caa64cce | |||
| b7c754cb32 | |||
| 1746cba249 | |||
| a3cb04013e | |||
| 2e951c0ce5 | |||
| 76c37792cb | |||
| 5cb10548b3 | |||
| 7aa8eb3427 | |||
| b3661adf02 | |||
| ac8177d83e | |||
| bd68cee8cf | |||
| add48b2657 | |||
| 487c23e27f | |||
| eeaf539a44 | |||
| 2103c331a0 | |||
| d4546cdf37 | |||
| 9ba59aee36 | |||
| 0342b5fc43 | |||
| a389d94e2b | |||
| 546b7279a3 | |||
| 1220edd4df | |||
| 36abf22a48 | |||
| 7e990a8e5c | |||
| 247146f703 | |||
| c67ac46b6c | |||
| b9e6f5e42d | |||
| afa93c1f28 | |||
| a0548a416a | |||
| 830efdccac | |||
| 2b48b733a3 | |||
| 95ae0f23f1 | |||
| 361d4ac13b | |||
| 5e4f28ea21 | |||
| 9c5306d9b1 | |||
| 31846141b0 | |||
| 25a6679c1e | |||
| 58d1a3516a | |||
| 21d613cbc6 | |||
| 0bbeb13e26 | |||
| e5fdc6013a | |||
| 2d391298fb | |||
| bf719d6670 | |||
| ced944258a | |||
| dd7a411f9a | |||
| 153029a170 | |||
| a8e4d2946a | |||
| 1d312cf070 | |||
| 53ff85e2ad | |||
| 6ce6cbf489 | |||
| 9701145f83 | |||
| 43911d9a6f | |||
| 4a57728ddd | |||
| cea6561632 | |||
| fab70cb590 | |||
| 76bfc3b547 | |||
| c945989a70 | |||
| 8d092434ed | |||
| 18d8dc4757 | |||
| 93502b3ef8 | |||
| 6c01175acd | |||
| 2dd757156c | |||
| bae6c1167c | |||
| ee549dfb38 | |||
| 5e037bfd54 | |||
| a2ecdfcac1 | |||
| ad390d5e42 | |||
| a38778f911 | |||
| 6c4692380f | |||
| 7df9d934ca | |||
| 949bd2c47a | |||
| 4bebf419d1 | |||
| 48ae18a733 | |||
| bf84aa23f4 | |||
| cff6a41e2b | |||
| 0155effdb7 | |||
| 1c7ba0dd9e | |||
| 7454af0c79 | |||
| 82f30c709c | |||
| a70c2b3cb9 | |||
| 28cd41a2a4 | |||
| 96b91e5b0b | |||
| 0d274b0268 | |||
| 98dc0882cb | |||
| 916c72b40b | |||
| 9686c5b6aa | |||
| 3d498002d0 | |||
| b2f1429b75 | |||
| aa7c5a971c | |||
| 486a31bfa3 | |||
| 89b3a395df | |||
| a303992d78 | |||
| bf40691ace | |||
| eea20e51d8 | |||
| 7fd52de2d3 | |||
| e5a3ab8aad | |||
| 03d9fab3c0 | |||
| 024f4375b6 | |||
| 88de9e4050 | |||
| 26272c4252 | |||
| b2f2a87745 | |||
| 5a8235eca0 | |||
| 7543ffa3b1 | |||
| 524e3686a0 | |||
| ef124c3e21 | |||
| b095859a92 | |||
| c65e417666 | |||
| 5a6aba1e11 | |||
| 938c5ef21c | |||
| 4b424e12df | |||
| b3a73c78e8 | |||
| 841be90939 | |||
| 2bd28acdc6 | |||
| 5cc6635eb8 | |||
| ca6c500799 | |||
| ec015a2e68 | |||
| 878fc1d197 | |||
| c33884779d | |||
| 059ab889bd | |||
| 7a8c762e48 | |||
| 452a463764 | |||
| 97291fda58 | |||
| 3940ca3df1 | |||
| cc35cb74e1 | |||
| 7de591f5cc | |||
| 2fa9e3279c | |||
| 8de7c36b4c | |||
| 75ff9abaca | |||
| 70014c4fd0 | |||
| 095d0aa743 | |||
| b3bb83cf58 | |||
| e55c5c590e | |||
| 9a049de85f | |||
| bf18568e17 | |||
| 2c68aab198 | |||
| ce2b39b398 | |||
| 8eda6f8feb | |||
| e2907eb99d | |||
| 7b3ae2edd4 | |||
| 13d2c5e926 | |||
| c7d1737d47 | |||
| e533e82bc9 | |||
| eaad3ab45f | |||
| a21908cf18 | |||
| 5ffec92701 | |||
| a809fe9a04 | |||
| 8dd2f463f8 | |||
| 1e8e2ae353 | |||
| 7b01858c57 | |||
| 6d4d15b221 | |||
| c0e9c805ec | |||
| 865be6064a | |||
| 0d022de0f4 | |||
| d7a7c40a0f | |||
| 6eee638482 | |||
| 715e376cd2 | |||
| d0e9c81399 | |||
| 55d957489d | |||
| 50649ad0d1 | |||
| 950018b5c3 | |||
| 9832a0817d | |||
| abf33d32b9 | |||
| 0c890a501c | |||
| 410c6bba47 | |||
| f073041b0b | |||
| 8d203531fb | |||
| 6592fbb948 | |||
| 4140a75a5e | |||
| c28504deca | |||
| 93c18e9ae3 | |||
| d46288b0ab | |||
| 122fa190c6 | |||
| 38bb503ff6 | |||
| 74740fb71a | |||
| da4a1e6118 | |||
| 4d60f9d3bd | |||
| 835c56c4b0 | |||
| 3acea2f574 | |||
| d89666261f | |||
| b224991ea2 | |||
| dc9c5f10f5 | |||
| 045c42aa99 | |||
| 9761a1de3e | |||
| 0011c42669 | |||
| 268e667bef | |||
| 7761765a4b | |||
| af1f0305eb | |||
| 42306f1e35 | |||
| 9d46c378b9 | |||
| 0d4240e196 | |||
| aa087f8661 | |||
| 50bf7a98c2 | |||
| 4c256433c0 | |||
| 8c7fc03296 | |||
| cf5686def0 | |||
| 433b57c315 | |||
| d50b014aba | |||
| ba3d139de8 | |||
| 92fa6f0a48 | |||
| eb68201bc5 | |||
| a1eda425ed | |||
| 61660c068a | |||
| c420001f2b | |||
| 92ba000f09 | |||
| 43c28b941b | |||
| f0565de900 | |||
| c40383b610 | |||
| e48377d85b | |||
| d09b3ad2e7 | |||
| b40122832f | |||
| 085001fa24 | |||
| 96002c8c8f | |||
| beb5d62779 | |||
| 2269f74c27 | |||
| 3d8a1ccb3f | |||
| a8bca282df | |||
| bb5ccc5731 | |||
| 0eb6c759d7 | |||
| 4fe48a50f0 | |||
| 2e6ec6ce0b | |||
| 4075d18050 | |||
| a12cdb55b1 | |||
| 2906ea3d78 | |||
| 3a937f79f7 | |||
| e9b6a1018d | |||
| 8f77179d29 | |||
| 273972b75a | |||
| 466b41c36b | |||
| 7e34452746 | |||
| da8d32ae38 | |||
| 9ea34250a0 | |||
| b15d8878b7 | |||
| c32cce4b35 | |||
| 55e8b02a09 | |||
| 29368d1c58 | |||
| b975f11514 | |||
| 28ab39073a | |||
| 59eac3bc29 | |||
| 2ac00b378a | |||
| ebd36d56ca | |||
| 7358d9ebb4 | |||
| 3c5a6a356a | |||
| 492931562f | |||
| 4d1776faf9 | |||
| 595b13f1e0 | |||
| 77378fa189 | |||
| 330c513015 | |||
| 1f6be85719 | |||
| b0127e3918 | |||
| d9372ac766 | |||
| 820cd0fb75 | |||
| d11a8f4103 | |||
| 90c54ade67 | |||
| c105268a1d | |||
| 543537ef29 | |||
| 9ce15667d5 | |||
| 512d226d43 | |||
| 5d09a5e37e | |||
| 323a98adb7 | |||
| c383543ec9 | |||
| 9cfae56df5 | |||
| 9bde002c95 | |||
| 8d4039b678 | |||
| 3fee961a0a | |||
| f29dc0c0fb | |||
| 125da4722e | |||
| 8450785379 | |||
| 9a5af50f32 | |||
| 169dd7da77 | |||
| c0b011e714 | |||
| ea8461e83d | |||
| a01d10e57d | |||
| db2fb38746 | |||
| f1fd374a6f | |||
| d7fa2a0f77 | |||
| ffb9a0475e | |||
| 8da00e2d9a | |||
| 2cc5f5e19e | |||
| c86d1824fe | |||
| ef8826ac2d | |||
| 9d3c7badb5 | |||
| 4cbae823eb | |||
| 9ba384b9a4 | |||
| 8b3c4e9a52 | |||
| 6163351ea2 | |||
| c48fbd3609 | |||
| f49ecee24c | |||
| e710bcb6d3 | |||
| e2468c4343 | |||
| 6e62911a4e | |||
| f4fb6356cd | |||
| 42f289d994 | |||
| 203f7a3a87 | |||
| 88aa40e6ac | |||
| 949494ccfd | |||
| 19d4e6e1d5 | |||
| 4a4e6eb071 | |||
| deaeab3d92 | |||
| adebefad84 | |||
| bbd96fdd39 | |||
| 6b64aa3faf | |||
| f3f5d775b5 | |||
| 39e7db7db4 | |||
| 590ff0ced9 | |||
| 71caa4a20c | |||
| 0bb3270503 | |||
| a13d42fdaf | |||
| 46b8703b71 | |||
| f95e8c62c9 | |||
| 8ea9c39241 | |||
| bc54f13636 | |||
| 7e0da0cb25 | |||
| 538abb99f1 | |||
| 1f562a2e83 | |||
| 66db81309b | |||
| 65a491eabd | |||
| 6449a45695 | |||
| 4fc8e28fba | |||
| ab5e26dd32 | |||
| fa72f1c3cc | |||
| 0aaa1fb64e | |||
| 980a0893f0 | |||
| 20554be9f4 | |||
| d0107a0c0a | |||
| e345fbd386 | |||
| bb26fe9300 | |||
| ae56bb63c6 | |||
| 543e8456b7 | |||
| 878178145d | |||
| 3cc7212c82 | |||
| b0847a61f5 | |||
| c30aa4ddeb | |||
| 16ee08385e | |||
| 4786ed321e | |||
| c28f1e0276 | |||
| bf017fb4bd | |||
| 55ab68a332 | |||
| c853fc75a1 | |||
| 08c38c8158 | |||
| d9464de690 | |||
| f92fa6989e | |||
| 30343f15e2 | |||
| af6eb52b5e | |||
| d5931b8c48 | |||
| edd958836e | |||
| 86825ee3b5 | |||
| 28dcbe3cb0 | |||
| 8e532b5ceb | |||
| 5570222b40 | |||
| 3388381deb | |||
| 0cde2a3146 | |||
| 15e5bd16ab | |||
| c6a73bee5e | |||
| 1fba8619d4 | |||
| a8621265e2 | |||
| 813e8b274a | |||
| 7579fc7bc9 | |||
| 93ed844015 | |||
| 2c95c799e6 | |||
| fada3517b0 | |||
| 39d42fc62b | |||
| 0179b61f69 | |||
| 451b5940ea | |||
| fa203d186e | |||
| 2d9c3d75f3 | |||
| 09c1179094 | |||
| 4bcb6f5346 | |||
| 340f6bbaba | |||
| d1518f2901 | |||
| 33f24a42b8 | |||
| 314e84716b | |||
| de21378291 | |||
| 5c9b069fe5 | |||
| b60f755f4f | |||
| 9d918b5ac8 | |||
| 58d284419c | |||
| 70091ec649 | |||
| 33b660857a | |||
| 79da90bb08 | |||
| 45fda6f43e | |||
| 6c9ff0e47e | |||
| 32ce0d3c6e | |||
| 02d7b1a1fc | |||
| 77e12a15b1 | |||
| c40a1fcede | |||
| e8c6252a4c | |||
| dec8106665 | |||
| 6159b79715 | |||
| ffc5c4dabe | |||
| baf2fa3a9f | |||
| acbd31255e | |||
| 6d8985ceb2 | |||
| 481a37fcf3 | |||
| 25544d31f9 | |||
| a2bcbec791 | |||
| d249e30714 | |||
| 36196b6c2d | |||
| 7bcc0efd6a | |||
| 39c4d9b2ca | |||
| 0eddc5cae2 | |||
| c3d7ffc877 | |||
| ee62eb7bb0 | |||
| 6643f68663 | |||
| bdcf31cc73 | |||
| 590b006d5c | |||
| 213275a1f8 | |||
| daee88fd26 | |||
| ba49bcd5a9 | |||
| 41dfce150d | |||
| 88f4f5413a | |||
| fef31bc6c7 | |||
| 54e5a10846 | |||
| 07b3b103ce | |||
| 0825073e8c | |||
| 0ebe9ad70c | |||
| f9824f6108 | |||
| 339d417420 | |||
| 1ea183a0f7 | |||
| 8219516ec0 | |||
| 50007f2d40 | |||
| a7431d99e5 | |||
| 43a3e46369 | |||
| 83e7f9d54a | |||
| 5a40804773 | |||
| c943f48547 | |||
| bf6414d3ad | |||
| 0514a1925b | |||
| 21a88613a1 | |||
| ddd28aae67 | |||
| 9a5d517ec2 | |||
| f4782a7690 | |||
| ddd3599899 | |||
| e2251a4b38 | |||
| 0541728404 | |||
| 2740491f18 | |||
| 5775421f78 | |||
| 301d7bd3a9 | |||
| ccfa2dd24c | |||
| c3b57944ac | |||
| 7fb89c5386 | |||
| 51e68729de | |||
| 35d490f8e9 | |||
| d59c48217d | |||
| 98fad5de92 | |||
| 84e209f1e0 | |||
| 516517dc3c | |||
| 182333a781 | |||
| 6636720d2d | |||
| 387b94b740 | |||
| 2086bc4be7 | |||
| fcc6d61fe1 | |||
| 0d40617c07 | |||
| 8d3c3785bc | |||
| f29f601ec4 | |||
| 3c361cec92 | |||
| c9c7d5e1aa | |||
| 5875b50de0 | |||
| 7c20aea96c | |||
| 3f7d964acd | |||
| 45c983e899 | |||
| 19d4121763 | |||
| 3ebf1a5a3b | |||
| dded8ab27d | |||
| 93a0e668a6 | |||
| 98ded8d168 | |||
| bc7289bb28 | |||
| 1639a1ca49 | |||
| c39c6d36df | |||
| 4fe993a55d | |||
| 2ca74dc334 | |||
| 3129855cc4 | |||
| 3886a749fb | |||
| 61c4f9b3c8 | |||
| 59d4ddd905 | |||
| 8d14c489eb | |||
| 3ab8739809 | |||
| 1f74e76d83 | |||
| 98c59605aa | |||
| 18216fe71f | |||
| f14a62c875 | |||
| f2a7f230f1 | |||
| 475dd72ea4 | |||
| 0fcd765bd5 | |||
| e30220e287 | |||
| b178310a82 | |||
| 40b47defcb | |||
| fbada56054 | |||
| 8e42b02a22 | |||
| 8c405a59d8 | |||
| c6f78fbe43 | |||
| 61aa00899d | |||
| 10c5178e31 | |||
| bf3248bee9 | |||
| 83ccbbe49f | |||
| 861ef363a5 | |||
| f4ecf47e61 | |||
| 3fcc7b5949 | |||
| 2d3c1a3f00 | |||
| 5fbf378d10 | |||
| 676838ac31 | |||
| f149303895 | |||
| 950d4e1da4 | |||
| aae6881494 | |||
| e4dc33b368 | |||
| bcf92badd1 | |||
| 63e6863222 | |||
| bc43851d74 | |||
| 17e631bc5e | |||
| dbddec9160 | |||
| 1985bfd9eb | |||
| fb01a72693 | |||
| 64b68f2474 | |||
| 6c2b22406c | |||
| 57bffdb46a | |||
| c16a9a83ba | |||
| 09092dd2d2 | |||
| ae4c83af91 | |||
| 368412a730 | |||
| 700ac75565 | |||
| a54ea3246c | |||
| ce2c7bad44 | |||
| 7f83176306 | |||
| 408c391f83 | |||
| c09b125131 | |||
| da63140b04 | |||
| 4aeb2990c0 | |||
| 260893816b | |||
| 63907a7508 | |||
| 3bccebacbc | |||
| 793e29e124 | |||
| 842ce24d2b | |||
| 152fc7d94d | |||
| ef07b599cb | |||
| b23d030925 | |||
| e0d013b25e | |||
| 36c31b0e83 | |||
| c7d4e72341 | |||
| 037d0e9640 | |||
| 983445cd39 | |||
| d7c165eb35 | |||
| 934b18405a | |||
| ff10303755 | |||
| d928cd3636 | |||
| 71706282f7 | |||
| b0e23a1634 | |||
| 761ba4a379 | |||
| 652b744201 | |||
| 2ff5df192b | |||
| 8648e3c43c | |||
| 9c550e8e9f | |||
| 2267b6e97d | |||
| 6f3c118038 | |||
| f65d0e4f80 | |||
| 782069e1fa | |||
| 5741811d36 | |||
| 6e46bd7373 | |||
| aa4aa40b57 | |||
| d3fedc14e2 | |||
| b73f72f62c | |||
| e9950defb2 | |||
| 5559a0dede | |||
| 73d0caf8a4 | |||
| 917ea58a8c | |||
| 0dd5fd5cd3 | |||
| aad62919da | |||
| e990ef3542 | |||
| 8966ed5a00 | |||
| 82c7598861 | |||
| d5656716f6 | |||
| 0660133d2e | |||
| 7c5e389067 | |||
| 6e980d419c | |||
| 94696ea7de | |||
| 39fa5d1c7f | |||
| b86367866e | |||
| 0714e83a8e | |||
| 68e7666293 | |||
| 8826aa8056 | |||
| 78863696b7 | |||
| 8c7aa06088 | |||
| 5e3ecbbf96 | |||
| 0e2b957dac | |||
| d0d3fecc95 | |||
| f0da2a2258 | |||
| 22db68816e | |||
| 079df42103 | |||
| fe62c803e2 | |||
| 54a3b28dce | |||
| 2a84f7f07c | |||
| 45d42a9654 | |||
| 73d3dc91fd | |||
| 0fde26c86c | |||
| 2353f02d9a | |||
| 15559d3e88 | |||
| b413dcfa7c | |||
| 388b14604a | |||
| d3ee19e675 | |||
| 4d7ed0f2f5 | |||
| ae622dbbfe | |||
| c3ff534b19 | |||
| b6c69e580a | |||
| cb9a67906d | |||
| 68758f9b2c | |||
| 7c9f1007d5 | |||
| 0ff9bc4806 | |||
| 67addb4882 | |||
| 9a5530a48f | |||
| d3f6f618e6 | |||
| fb96256c63 | |||
| d0746d7e32 | |||
| 6e569c5ed1 | |||
| f928d4af56 | |||
| 5685965fdb | |||
| f93be510a3 | |||
| d07f3d548c | |||
| 5fda79531d | |||
| b1e3961825 | |||
| 014f4af79c | |||
| cb7cc99302 | |||
| 6e6be3aa8f | |||
| 994c7f3dad | |||
| de729d8d8b | |||
| cd44dff5af | |||
| 3234597703 | |||
| e9df292b62 | |||
| 72aa1bf75c | |||
| 647fab07c7 | |||
| 97fc236760 | |||
| 1afeb5cd12 | |||
| cbb36829e6 | |||
| 760b47a62f | |||
| 80f5942868 | |||
| f031e308cd | |||
| e5e4277ff3 | |||
| 5fed5bab4a | |||
| 74f6dd5d5a | |||
| f3e98878da | |||
| dabf10f99c | |||
| fbde66a56c | |||
| 0df98b9a78 | |||
| 9b14c276e3 | |||
| abb6a15aa4 | |||
| b7ba0839c6 | |||
| c5aa139296 | |||
| 0b5f0ac249 | |||
| f7f527e3e9 | |||
| d6e9bbfcfa | |||
| 75383a8308 | |||
| 14bbd6f976 | |||
| a47f22a275 | |||
| 2fed316efa | |||
| 252bca5057 | |||
| f4b9895cbf | |||
| ec87e2eac4 | |||
| cfb932b073 | |||
| 3130234640 | |||
| 2e2bdb449f | |||
| 471b543c8f | |||
| 5536579e1a | |||
| 1bf215cd08 | |||
| afb07d3e39 | |||
| 208852abf2 | |||
| d33a5ea5d4 | |||
| 6155c758be | |||
| 6eff001ebb | |||
| 1940bc3dc0 | |||
| e89d622c3a | |||
| e798c32375 | |||
| 71205b8b07 | |||
| 8cdd9ab81b | |||
| 62cca8264f | |||
| 804af7f189 | |||
| b7e9e7e777 | |||
| e765e7e9e8 | |||
| 1bb754299a | |||
| 3d2b4b03af | |||
| 472307366c | |||
| 578d1de55d | |||
| b579c812b2 | |||
| 31a094becb | |||
| 0c07312ad8 | |||
| 6fa9be73f8 | |||
| 8cbe66b5c1 | |||
| 58129f9a11 | |||
| 3972774a2e | |||
| 40d9439d4e | |||
| a7496b1c9d | |||
| b0ce1ded97 | |||
| 9177a088b4 | |||
| 361861295f | |||
| 5678d78d54 | |||
| 9a60313c3b | |||
| 7fa1f8161c | |||
| e4f70d5bbb | |||
| 9411d8bb08 | |||
| 57ecf25da7 | |||
| f758d223a2 | |||
| e89a4b3a0d | |||
| 2815db2b07 | |||
| c8a544eaea | |||
| a469d15bc8 | |||
| 5700d8d6b1 | |||
| c769f961ab | |||
| f18af2c60d | |||
| c306164426 | |||
| 6e746e6ab2 | |||
| f795ed77c6 | |||
| 7e3fa85a00 | |||
| 427747abba | |||
| 1c955606a1 | |||
| efa3085073 | |||
| 6ad64c6f8a | |||
| 60a5581071 | |||
| 281b2187ab | |||
| b92603b3fd | |||
| be4cb55368 | |||
| affc879cde | |||
| a695aa3071 | |||
| 947216942a | |||
| 5f0ab971f1 | |||
| ca08ccb61c | |||
| 5c9178f851 | |||
| d5c73c6d4a | |||
| 0c0435615d | |||
| 04eebccc39 | |||
| bcfdc12852 | |||
| fef7e9d5f4 | |||
| 1b6a77ce5e | |||
| 2b572f676d | |||
| 0054197d02 | |||
| fba066341d | |||
| 74c7890fbb | |||
| 98ca6c4a16 | |||
| eee7d8da50 | |||
| 6ec4d58508 | |||
| 0b17a542cb | |||
| 464c75e4b2 | |||
| ee8c252404 | |||
| 897bc55d46 | |||
| b9565cb174 | |||
| 9d48ca75ff | |||
| 52ca447efc | |||
| 0e8d3251f5 | |||
| e8fa2d3442 | |||
| 88e7939364 | |||
| f8fc8eb430 | |||
| 11c2aff8c9 | |||
| 8543191406 | |||
| 9b674d26c0 | |||
| 5301248ea2 | |||
| fbf9d62742 | |||
| f5c2c13566 | |||
| ee0954b236 | |||
| 9d4f183f5a | |||
| 56399d1d79 | |||
| ce1d13c9b6 | |||
| ad053d504c | |||
| e6bdd25667 | |||
| 0972606072 | |||
| e0a69bbeac | |||
| 55a8ee34bd | |||
| df560b3d9d | |||
| 3fbc8973ee | |||
| 9353d1de74 | |||
| 46af991574 | |||
| 8c8490b28e | |||
| e0ff57e8c2 | |||
| 7cd592e055 | |||
| 365c4fdae2 | |||
| 4c4b1e4c2d | |||
| 4028dc984a | |||
| 0f3ef8aeb0 | |||
| f4c498edba | |||
| 112eccfe33 | |||
| c87cee6b1f | |||
| 778404fb29 | |||
| 84761b1518 | |||
| cdf0d010eb | |||
| bf68cd8ba4 | |||
| b09ba58ca6 | |||
| 847347b58a | |||
| 672515c23f | |||
| 89839b4c63 | |||
| 7e1759e775 | |||
| 3c3a859b89 | |||
| 72a4703d82 | |||
| d40b905f27 | |||
| 53f0381f0f | |||
| f5cef2fcbf | |||
| 3b10cddceb | |||
| 900382057d | |||
| 391e064e67 | |||
| b2fddc408c | |||
| f2229e0427 | |||
| e78d1dd676 | |||
| 96ad8a15b4 | |||
| c72187474a | |||
| dd9f4a3e3c | |||
| 1b64b7395c | |||
| d851bdac90 | |||
| fbb63f11e4 | |||
| d5ba4ec825 | |||
| 13b7cb59eb | |||
| af3080402b | |||
| c9a11d0aab | |||
| 043e62ffd9 | |||
| 3f8e4e2a30 | |||
| 09c8cd17cc | |||
| 0eda75a193 | |||
| f10f916f8c | |||
| ceae4fa7b4 | |||
| b05be2f26d | |||
| 6afc17be1a | |||
| 631152fc3e | |||
| d15673f13f | |||
| 3cb07254e5 | |||
| fc4d31547b | |||
| 8e32cfbf15 | |||
| 109302a928 | |||
| eac4d4ff06 | |||
| add0a90e1e | |||
| 422d8215cf | |||
| 389b2775c2 | |||
| d9aae20003 | |||
| c2f0fe51c4 | |||
| 778b8543c1 | |||
| b3f6eb2224 | |||
| 86f6d2fc25 | |||
| 0db5c734bc | |||
| d1daca5029 | |||
| ca86093270 | |||
| 60019278e7 | |||
| 5d310ebf92 | |||
| bb127a367d | |||
| df6517c72d | |||
| 262a652710 | |||
| a57d4726bc | |||
| d1aebcddf2 | |||
| 498356fcb8 | |||
| 115a6c8785 | |||
| 4c49a81c8e | |||
| 594532da9a | |||
| 31bcb2bd92 | |||
| 2ee9e80afe | |||
| e8951b7a2d | |||
| 6720a45d65 | |||
| 8fb75f379a | |||
| b4cf61ee32 | |||
| 4078e0a242 | |||
| 1303e40b6e | |||
| 5b8658ca10 | |||
| 1c13b2681a | |||
| 9ee4fcdf2f | |||
| 5925697374 | |||
| 683e125042 | |||
| 0bd92fecec | |||
| 30dab8473d | |||
| 83911837be | |||
| b7b3a49203 | |||
| 0edce1796b | |||
| 582dca4d91 | |||
| 4496624685 | |||
| 382b67a4b5 | |||
| 42ed3c6b7e | |||
| cb9fc6d901 | |||
| 462fe1e56b | |||
| 9f28c20660 | |||
| ea65d90a41 | |||
| 48df7a2a7d | |||
| 0573695d05 | |||
| 9c3a836044 | |||
| 717ab56419 | |||
| 726933831d | |||
| fd74e43afa | |||
| c078966511 | |||
| b885bad2ee | |||
| e4c9871299 | |||
| 5fbed936bf | |||
| 1ec75330ec | |||
| 98997a51fa | |||
| 70405cc80e | |||
| e954d2d013 | |||
| 82bd2ad310 | |||
| 801e4f8611 | |||
| 5b09aef166 | |||
| af55526164 | |||
| 13cbd7f578 | |||
| 5608aaee8a | |||
| 523b0966d2 | |||
| 6173c0fbc2 | |||
| 2f1a06b2ee | |||
| 66576de1b7 | |||
| 4f3fdf6c45 | |||
| 4a52886728 | |||
| c08e85bf70 | |||
| 6096568da9 | |||
| 39ecef39cd | |||
| 2cb231d0a4 | |||
| 5cb687d168 | |||
| e1473cfe83 | |||
| 0e25dd65c0 | |||
| 7bb261f810 | |||
| df532e3f82 | |||
| 970888b92d | |||
| 6e30ade0b3 | |||
| f2a21398d7 | |||
| 4f43b0a729 | |||
| bd12bdfe56 | |||
| 6eabee3dfd | |||
| 6f37f2917d | |||
| ee8e6d5442 | |||
| 44b59e3823 | |||
| 1f98f5cfda | |||
| 595329a8a0 | |||
| 6b2862fcfe | |||
| 7474c907dc | |||
| 9ac084d0b8 | |||
| 2ba3793671 | |||
| c144976676 | |||
| ccf410c7b0 | |||
| 3b5f16b23c | |||
| 0c903c63d8 | |||
| d5b4056514 | |||
| 9648be97fb | |||
| 9be059aced | |||
| 7ece8ed314 | |||
| b2768637d2 | |||
| 4a5ee765cf | |||
| 122018889a | |||
| 67156f87e3 | |||
| ffe9da91af | |||
| 3c517499bb | |||
| 98a5e063ac | |||
| 21690a3702 | |||
| b0b5a46543 | |||
| 382834ec2b | |||
| 686be824b5 | |||
| 42c5a24dc3 | |||
| 497789cdd8 | |||
| c2a5b49834 | |||
| a8e6be6016 | |||
| 14fd20d0ef | |||
| 23c3c561ac | |||
| a61dde9b52 | |||
| 4ae5c4bc33 | |||
| d47cdc3c18 | |||
| 5a26640f63 | |||
| 0b4ed25776 | |||
| 02824cabfe | |||
| f62b315159 | |||
| 9ba303a95f | |||
| 6c4d075bd6 | |||
| 3747ba928f | |||
| db4fccce51 | |||
| d78b75a0d1 | |||
| 4830555cce | |||
| 577f2952bd | |||
| 972f7d7e60 | |||
| ae7d9143f4 | |||
| 52df7accfd | |||
| 9e35d5a886 | |||
| 57bdb6115c | |||
| 11b3c10cc6 | |||
| 9683d44633 | |||
| ce9b36fd3e | |||
| 0bcb4a6a8f | |||
| dfb923f34e | |||
| c65046773d | |||
| 8aac43c12b | |||
| 99790d6805 | |||
| 6d25943f2f | |||
| ef5e253bf5 | |||
| 0ad0ed77c5 | |||
| 0f91438b80 | |||
| aa582ec43a | |||
| 4a334f0d12 | |||
| 2af0269eb9 | |||
| 103d23b3a3 | |||
| 26ac7f0f1d | |||
| 6b9cf8d2d5 | |||
| 952d88a28c | |||
| d75faac09e | |||
| 5b9f6b4001 | |||
| 50c1553c38 | |||
| c824572b91 | |||
| bc5bf18eed | |||
| 568fd0df83 | |||
| 511c193631 | |||
| b4e89871dd | |||
| 592eacf37d | |||
| c9c1633882 | |||
| 2e58752e12 | |||
| 414e5e174d | |||
| 4915610b5f | |||
| 8639630a18 | |||
| bbfb93c655 | |||
| bfd72501a1 | |||
| 110f96df78 | |||
| b6b00393a2 | |||
| a8cb411a92 | |||
| fa61279e45 | |||
| 1128b15833 | |||
| 225d000491 | |||
| bdba88d7f6 | |||
| 90136b6e0a | |||
| 6af4c2dd0f | |||
| 05f3910718 | |||
| fa102cd229 | |||
| f03874ac49 | |||
| b54d790a87 | |||
| 5324d6f7df | |||
| 1dac5bb390 | |||
| ec31a29b3c | |||
| e1bde1a78e | |||
| 80660bdc07 | |||
| fbf86c6683 | |||
| 613ab41eb3 | |||
| 8ff736b571 | |||
| 338e350e0f | |||
| 3e3488139e | |||
| f754d6dc51 | |||
| 6822a7a215 | |||
| f633492dfc | |||
| c4931cff34 | |||
| 1f1498ceca | |||
| cdf91b6b3e | |||
| 9059b55979 | |||
| 32be4746f8 | |||
| 476ed14965 | |||
| ae862ddf69 | |||
| 58ab3883b9 | |||
| 2b59912b3d | |||
| c958a44e46 | |||
| 7b653dbca6 | |||
| 88e338ec23 | |||
| 74be4644ed | |||
| ec2dd5be3a | |||
| 9817b51c21 | |||
| 2ea86fbaba | |||
| 9e4fb257e3 | |||
| 34529b1c35 | |||
| 891ac04c19 | |||
| ce76cece09 | |||
| 987ce6b4bd | |||
| c6f499c685 | |||
| 7c840e9bbb | |||
| c654442901 | |||
| ec6aed8475 | |||
| 9a8eb7298c | |||
| cdf2dbcd52 | |||
| 1419d7f2b0 | |||
| 88e2b3a857 | |||
| 6d1c266e1e | |||
| 075db9f7ea | |||
| 5047b6e385 | |||
| 76fc062f27 | |||
| 4e5b6f72c1 | |||
| 97462b018d | |||
| 44f3dfe771 | |||
| 8e3914bceb | |||
| 30d47732bd | |||
| 8d03f03081 | |||
| 7b38e5d7c7 | |||
| 82d2c45e14 | |||
| 5ed1030dbf | |||
| 16bb34cd94 | |||
| 60133cc58d | |||
| 962907ee6f | |||
| 4b967a9414 | |||
| d1d47eb5eb | |||
| 6aaa49d386 | |||
| 5ecdd26902 | |||
| 23c8d7b3fb | |||
| e6f6d3dabc | |||
| 7820e8959c | |||
| 8bd82b96f3 | |||
| 3b34cba4ae | |||
| e153fb79bb | |||
| ded97de891 | |||
| c350301342 | |||
| 4de7009014 | |||
| 90726b10c4 | |||
| 8c34ea496a | |||
| 2f95b82934 | |||
| 3c01c36202 | |||
| 4b26740e9f | |||
| 968f1282ce | |||
| 544c61f983 | |||
| b9ce564053 | |||
| ecd2738e83 | |||
| 8c1e100fe0 | |||
| c572de6276 | |||
| 5382ec66a2 | |||
| b1a369b49f | |||
| 70a4cfd112 | |||
| c5505d267f | |||
| 51f74d021f | |||
| 41a4fa97b8 | |||
| 1aa89b7cbb | |||
| 5d521d7c7c | |||
| 3e8ae8636c | |||
| acf7916e71 | |||
| a0b7b85c56 | |||
| 58c2d29f8c | |||
| b2702c4406 | |||
| f5a030f4ae | |||
| 51caa624bb | |||
| 7c254dd94d | |||
| 8876ae0e98 | |||
| 60cb7c1c4d | |||
| 1dc3cb67fa | |||
| 5e2f7bfda9 | |||
| a689fa18df | |||
| 6d5402247c | |||
| b513a60540 | |||
| 63de1841a6 | |||
| 77fccc9d00 | |||
| 42a6549729 | |||
| be9c044b24 | |||
| 2f10598af6 | |||
| d9ccbe96dd | |||
| 501b767e6e | |||
| 5f7c040ec0 | |||
| f039320a0b | |||
| c998bc1215 | |||
| fbdd65bf7b | |||
| 843f8aca7c | |||
| faf6c0e8e1 | |||
| 6d5cb13018 | |||
| 193b9c9386 | |||
| 01cecc8388 | |||
| 60a7a9d6f0 | |||
| 222b728723 | |||
| 12cc7c77ba | |||
| 4d17fbd3aa | |||
| 122c3a3cf8 | |||
| 93b342ee39 | |||
| e209511f86 | |||
| 8f01abf054 | |||
| 4851a55c1d | |||
| de0e16a6f3 | |||
| 8e5184a8b9 | |||
| a84b00cefc | |||
| d8c86a2ad6 | |||
| 9b4d19a13f | |||
| c79af7cc4f | |||
| fdb944e7a3 | |||
| 6527048164 | |||
| a2062036d3 | |||
| ad51328408 | |||
| dd5cc8dcaf | |||
| 3829b1e7b9 | |||
| 6bda6de9a1 | |||
| e50abdd355 | |||
| 96ab35a331 | |||
| 1b920fb536 | |||
| 3faa22c6e5 | |||
| d0b2a3b1ac | |||
| d71cca0e81 | |||
| 7d49e8285c | |||
| db90b2e44a | |||
| c50a83cd8d | |||
| 0d79560e94 | |||
| 957b9e8b84 | |||
| 900adb35d8 | |||
| 02ebc4879a | |||
| c0e7cf2e40 | |||
| c814f10d7f | |||
| b5c213ce6d | |||
| 5c941e57d2 | |||
| 657a61e537 | |||
| 04b745d67a | |||
| 9f981de854 | |||
| ad45c78b44 | |||
| a8ffe16f4f | |||
| e79c827b22 | |||
| ddfc9fc001 | |||
| 29239d6638 | |||
| 30ce4e5b6b | |||
| 57ca70e27c | |||
| f13ff8f601 | |||
| ef22498c6f | |||
| 9b764cb7f4 | |||
| 28a64bc2f8 | |||
| 1933426e3e | |||
| e1596cc65a | |||
| 76a2f5b547 | |||
| cbf8f822de | |||
| f88b477459 | |||
| bd6b38e638 | |||
| 2d19965750 | |||
| a14a83b9c6 | |||
| c185743ae9 | |||
| 6e2ce76223 | |||
| 14f7daf53c | |||
| aff8bc62d2 | |||
| f88c4b1f48 | |||
| 17058c9467 | |||
| b93b066a42 | |||
| 5ef407d1c9 | |||
| eb3526c9a6 | |||
| 2c8b4da840 | |||
| 0bc16683e5 | |||
| 291d8c73f8 | |||
| 0d3ebbfefd | |||
| 11d1627513 | |||
| 3a08f747fb | |||
| 1564a40538 | |||
| 0b44db954f | |||
| 77b558885a | |||
| e6821e9d7c | |||
| 0503c3499e | |||
| f8c560a35a | |||
| 0dab7f2e53 | |||
| c78e41b2d3 | |||
| 6c25348b77 | |||
| 18949aaa0b | |||
| d13ba0ee2d | |||
| d6faa89ed7 | |||
| aa08196c32 | |||
| d2d77b2a48 | |||
| aafd36e2f3 | |||
| b2f1d26d93 | |||
| 103d45539d | |||
| 9714bab653 | |||
| 77abade785 | |||
| 78d41a03e0 | |||
| 09e05d14a0 | |||
| 95ec75b919 | |||
| 48fb1e2dae | |||
| f9ddbc4925 | |||
| 8426babab9 | |||
| bb5e6c9823 | |||
| 924cd17f2e | |||
| 51e00d074c | |||
| eee2a2266d | |||
| 773d23bbd5 | |||
| 93dd1c57cc | |||
| aa7c6f057b | |||
| 94e25ecb0c | |||
| f0c1f38f98 | |||
| bafd684eb6 | |||
| 220132ca23 | |||
| 2ff8d7a8bc | |||
| 2bfad189e7 | |||
| 5fd77084c4 | |||
| d12d08e2f3 | |||
| 8b872e326a | |||
| fe47d51598 | |||
| 997e1f9743 | |||
| 9f867abe75 | |||
| 45222f34a6 | |||
| b12b8d6166 | |||
| 1fc41a7bfc | |||
| b6ad416757 | |||
| 98e78c0599 | |||
| 2781fdeed8 | |||
| dee7fb3b72 | |||
| fcc9f50641 | |||
| 46400a8124 | |||
| 72402ff143 | |||
| 7e0bbd20c0 | |||
| d23d4e66c5 | |||
| 18d8f34f96 | |||
| 2d43f6e307 | |||
| 468319fe04 | |||
| 23f051ccd6 | |||
| 3758b0d707 | |||
| 952b83cbdc | |||
| 67fe835f03 | |||
| a7748c14c6 | |||
| 224dbed79c | |||
| 0e76d06358 | |||
| 7e3b796de8 | |||
| 3a9af23cda | |||
| e7a2627189 | |||
| ebec36f190 | |||
| 03713ede03 | |||
| 5bc0619234 | |||
| 6d0c8ea7e4 | |||
| dbcebba882 | |||
| 19d81add3d | |||
| b88e5ce9a1 | |||
| c15db76aa0 | |||
| 82261e9907 | |||
| f1616b0e62 | |||
| c73dd86713 | |||
| 433ad8c3ce | |||
| 4028178982 | |||
| ab81128e5c | |||
| f1c2b5b304 | |||
| 20f5a9f085 | |||
| 68915f1852 | |||
| 9642a43129 | |||
| 30307e736b | |||
| 9565ea251d | |||
| ba246d3b27 | |||
| 9e7baba977 | |||
| 0ab6e03863 | |||
| 31a067b5a3 | |||
| 5728f80116 | |||
| bc51425bb7 | |||
| 7d15a45e09 | |||
| aa33812104 | |||
| 0d408fe6f5 | |||
| 43f99a8983 | |||
| ece6bd663c | |||
| 74249c65da | |||
| 09eff063de | |||
| c5bc345604 | |||
| d36850f0f2 | |||
| 7cd7e64498 | |||
| 64b5332f33 | |||
| 9a88f066c5 | |||
| 78f47c07e0 | |||
| 25c48e6aed | |||
| 90ecd2c293 | |||
| 7d5bc7974d | |||
| 7505720350 | |||
| e69079f935 | |||
| 924100dd8c | |||
| 2f807a3c7f | |||
| f5c0dbd947 | |||
| 556bf2ef4d | |||
| 0dad1f8ccb | |||
| 606dec8da0 | |||
| 6585e83037 | |||
| 7e11bf280d | |||
| 59e55b711b | |||
| ff3140052a | |||
| 1ec0b6ecc1 | |||
| 344b7f548b | |||
| d6d38ac3fa | |||
| 00da23faf6 | |||
| 633d7826c9 | |||
| be45ad904e | |||
| ede0cc1cfa | |||
| 7b02adf715 | |||
| 48fe201dd5 | |||
| b0f166fc83 | |||
| 543bdb8ccd | |||
| 0e05a86484 | |||
| 243199859b | |||
| 6a9a62b7d2 | |||
| 98cd83fabd | |||
| ac0c33209d | |||
| e03340b04d | |||
| edec37b402 | |||
| a471d40cc8 | |||
| 9a989a284a | |||
| 415ae8e40a | |||
| 5148eb9121 | |||
| 4282a42b3f | |||
| 17b5bcb24f | |||
| 4993fb4665 | |||
| de7c110225 | |||
| e6e673d7c0 | |||
| 3097e4f48a | |||
| ccc94819e2 | |||
| 5416c0e6f8 | |||
| 18a36be28c | |||
| 0fa41e9171 | |||
| 3b92ec12c2 | |||
| 41a2da234a | |||
| ceb711dff4 | |||
| 5851da47f1 | |||
| d6bf5cd251 | |||
| 7c9f356abe | |||
| 0387cc5f1f | |||
| e6e14719c9 | |||
| 9d1c5c855b | |||
| 9be2dc8290 | |||
| 9950f06c59 | |||
| 828a26c69e | |||
| d9a79c0f7e | |||
| 101c6d151e | |||
| 38f1cffab3 | |||
| f441059b01 | |||
| 4ff2dc3035 | |||
| aa335f57d6 | |||
| bc40532109 | |||
| 0accf2d647 | |||
| be6b5c8e77 | |||
| 302527c2d6 | |||
| 8eefd42a7d | |||
| 4abefde290 | |||
| 6af4c465b8 | |||
| fcda3a338c | |||
| 3e6037659e | |||
| 22f8415045 | |||
| 1cfa911ce3 | |||
| abf6ba621a | |||
| 15c1a8109b | |||
| c9082d5b0d | |||
| 029b21bf54 | |||
| 86cd8063b4 | |||
| 3fab6016f9 | |||
| f40a1c8cb8 | |||
| bf1ca75710 | |||
| 6b034ad2f9 | |||
| 5539f67135 | |||
| c5776fdae4 | |||
| 6230001a3c | |||
| 9bc3991c23 | |||
| 332cab0c55 | |||
| 6cd5270967 | |||
| 0251290794 | |||
| ff54602be0 | |||
| b69ae10b74 | |||
| 61837428ba | |||
| 24e81ce4d5 | |||
| 4c0c5b64c2 | |||
| f4121339af | |||
| 6935f036a5 | |||
| 1a6718c979 | |||
| f3f8a96c6d | |||
| 5aaacf3241 | |||
| dbcb35655e | |||
| 8ad4a44171 | |||
| 8ed0223bd6 | |||
| 7920e706ea | |||
| 2fb1481613 | |||
| f09f2d3290 | |||
| 24e24f1b65 | |||
| ecaf66ee97 | |||
| 5896e48755 | |||
| a79f2535f8 | |||
| a861666500 | |||
| d393ccfe2c | |||
| 2c4fef91da | |||
| f8eced1960 | |||
| b2b7d99302 | |||
| 6b303ee64b | |||
| 190908bc1e | |||
| 9e420e4639 | |||
| e202c29926 | |||
| 89a6f16e8d | |||
| 1b8e59a0ef | |||
| 163c490c92 | |||
| 5c671c995c | |||
| 010920ad08 | |||
| 73bab46758 | |||
| f1cac00396 | |||
| d91d2178b8 | |||
| 541c40f3cc | |||
| e3e0a28b62 | |||
| 76aceb9970 | |||
| 35d6051e9d | |||
| b7c45ba240 | |||
| 58e8312b1c | |||
| a51628187a | |||
| 47993fe29a | |||
| 01a9d916e7 | |||
| d31349b781 | |||
| 1cc9fc3ab4 | |||
| af3aceaf08 | |||
| f22e39a574 | |||
| 5e560e9bd9 | |||
| 2212b5b5d7 | |||
| 45bda0997f | |||
| 0a6c76fb91 | |||
| e3fd72dc16 | |||
| aa3b76e3fb | |||
| 76eaab4b6b | |||
| b297892775 | |||
| 2908145b94 | |||
| 732ad7f6c1 | |||
| 39c56a6ed0 | |||
| 4e5eb4c23e | |||
| 5165e5dfcf | |||
| bea758271a | |||
| 827eb1ae24 | |||
| 1eb19b63ad | |||
| cf33995892 | |||
| e6bc6a29b9 | |||
| 7362f103ed | |||
| 9deab8302f | |||
| 607f1a2738 | |||
| 05389827fd | |||
| 53ae56097d | |||
| 7f0dc638ae | |||
| f989871501 | |||
| f893f14615 | |||
| e24e2d0e16 | |||
| 1daeb13dd9 | |||
| f2845bbea8 | |||
| b03083b881 | |||
| 053edde780 | |||
| a402c8ffe1 | |||
| fe178310f3 | |||
| 12c168b6dd | |||
| f40a1cad8b | |||
| 78293ea244 | |||
| c8781b1caf | |||
| e91f42d249 | |||
| 4ac25942de | |||
| 155f62bcf6 | |||
| 2098cbd822 | |||
| 7d2784c4c3 | |||
| 4d11e920be | |||
| 1aa8399915 | |||
| 2772c66259 | |||
| 53cb4c16ed | |||
| 735738fe6f | |||
| 5f29f8a831 | |||
| d4618d633a | |||
| 612f8cb954 | |||
| c8e57d5460 | |||
| 467778d66f | |||
| 2073d3b08e | |||
| 0bf67298d1 | |||
| 5aa8f16bbf | |||
| 8b76590f5d | |||
| 6452f5b5cb | |||
| 1ce24d892b | |||
| bd4aec2c4c | |||
| 3b2fcd356f | |||
| 96657f8b62 | |||
| 01471d3e2a | |||
| 51b2557470 | |||
| 481b7b25e2 | |||
| 8cbee28416 | |||
| 50dbc533e1 | |||
| 87097db4eb | |||
| e3ea84d048 | |||
| 3f5fde50c1 | |||
| 098fc5ef95 | |||
| ac0d41418e | |||
| 18e776fa2f | |||
| 83958ebd4b | |||
| c0af177223 | |||
| 4f6ea7e648 | |||
| 77f5fa0f07 | |||
| 36dbb8edab | |||
| 299d7bc306 | |||
| 6a726e2488 | |||
| e047feb2ad | |||
| ee0f1490e1 | |||
| c36b8621b4 | |||
| c25474e2c5 | |||
| 34de2cacd1 | |||
| 2d5b4dfa10 | |||
| bcfd1ff304 | |||
| fb7f00edbc | |||
| f72db005b5 | |||
| 3e74cca739 | |||
| ef3386c5f8 | |||
| daa194cede | |||
| 0c3880cffc | |||
| 61993419ec | |||
| 0603391405 | |||
| 557b5b4b47 | |||
| eb1ce7819a | |||
| d38e958ada | |||
| 0f0d37b85c | |||
| 91c37bbb76 | |||
| 272fc252fb | |||
| 0563741652 | |||
| 7ac7a6801c | |||
| 317b18bef8 | |||
| 9f7e50ae8e | |||
| ca849a4f0f | |||
| 4c1d3155a3 | |||
| 76b12c4ae0 | |||
| a7b7f5a76c | |||
| 99ae7cd477 | |||
| ad893f2bea | |||
| b31a8ac985 | |||
| 38545d5ee4 | |||
| 51c0a8e3ce | |||
| ee247a21a4 | |||
| 37f9e03772 | |||
| 11dc3bb0e1 | |||
| 07f2fcf7ec | |||
| 80257558af | |||
| c26719a10d | |||
| e8e483d079 | |||
| abac11d8c4 | |||
| 86406c6cfe | |||
| a688e5a5b1 | |||
| 6b2ec22104 | |||
| d5b550395a | |||
| baa00a589f | |||
| 6a19a7d226 | |||
| 14dddc0c9e | |||
| 1cab3ca92c | |||
| 97ab331b2a | |||
| be3ee03189 | |||
| 4e7d1c376f | |||
| 69b5e01be1 | |||
| 51420a7522 | |||
| c4e7761ee8 | |||
| 561c3a15f0 | |||
| 07b72ca534 | |||
| 300b8c06cf | |||
| e6621b9c78 | |||
| fe4a213e1b | |||
| bf66563cda | |||
| 3062723c34 | |||
| fd2c1839a1 | |||
| 1b6307471e | |||
| 7d3ae7ae9b | |||
| 141ffbb1f5 | |||
| f6eb7c1205 | |||
| 00858efbe2 | |||
| f863002e95 | |||
| 1e0fe05bef | |||
| 80194daec7 | |||
| 1ea43dd7f9 | |||
| 600219c8c0 | |||
| 964b51879e | |||
| e179ef5547 | |||
| bb5a2a917b | |||
| 2a5ee9512e | |||
| 5425c3d1e9 | |||
| 8603b0973f | |||
| 5a284afae6 | |||
| 86dd023448 | |||
| d65f8bba73 | |||
| bc0790381e | |||
| 277e644558 | |||
| 153d8fec30 | |||
| b0476bf174 | |||
| 40a96aab28 | |||
| dab656007d | |||
| e5816451c8 | |||
| cde38eb00a | |||
| 4b9665a952 | |||
| 1eb0faa264 | |||
| 3892fe5511 | |||
| d8ba312679 | |||
| 815f239014 | |||
| 00711341e9 | |||
| 016a892a78 | |||
| 5d3cf06c73 | |||
| 7f987b84a5 | |||
| da2c9aa807 | |||
| 2b45a28bd4 | |||
| 8c5a06028a | |||
| 6c6871336d | |||
| 09458aa639 | |||
| c1d02fd166 | |||
| 72815bc553 | |||
| 469cbb7c75 | |||
| 6b34ba8a8e | |||
| f48344df30 | |||
| 85cae2cc32 | |||
| 2617e4b607 | |||
| f4e4617be7 | |||
| d23ecd0538 | |||
| 5ccce7e45f | |||
| c948137f96 | |||
| 398d4de0f5 | |||
| 1ec304227e | |||
| 13ddf8100f | |||
| a8fb310d79 | |||
| 103047eeea | |||
| 2299a48045 | |||
| e314a83a7b | |||
| b0ecd70582 | |||
| e6b90a60af | |||
| 915073f8ea | |||
| 841016153d | |||
| 52054d1977 | |||
| d10840ab18 | |||
| d70dfbdebb | |||
| 6b83e5ccfe | |||
| e8e0608991 | |||
| 5d358bb63f | |||
| 96cb5a3d2e | |||
| 3e99aefb7e | |||
| 9174351412 | |||
| 1850bddb67 | |||
| e7c91b55b7 | |||
| 8a6edd4654 | |||
| cb8c890594 | |||
| b7aba15f17 | |||
| 8d52fdb7fa | |||
| 08cfe4b6ff | |||
| 4c0d6dc9e7 | |||
| 3e47ce3cef | |||
| bd034da8f8 | |||
| cf76cad931 | |||
| 741519fa79 | |||
| 4e2ef271bc | |||
| 85dd7129a8 | |||
| 0385cc52dc | |||
| 85764257ea | |||
| 59e9c1ee0e | |||
| d1b4f74bc2 | |||
| 88033c268b | |||
| 3d5c13a3e1 | |||
| ef25b32856 | |||
| 07c6c7f4fa | |||
| 4a9fdd2918 | |||
| 3113176ea0 | |||
| 565c46eedf | |||
| c7d5e671ac | |||
| ecd68e0c6e | |||
| 074fda4ba8 | |||
| 8080a1a5a7 | |||
| 4cb9cdb337 | |||
| 660e2c8102 | |||
| 4ae158bbe0 | |||
| 5a11e739b4 | |||
| ca00d37a71 | |||
| 235b647fe1 | |||
| 0f49d57d27 | |||
| 70bf44401d | |||
| 2673b6c054 | |||
| 14777ba444 | |||
| 6f07cf2651 | |||
| b57823baa5 | |||
| a977ba31ce | |||
| 1c300bb49b | |||
| 46f1ea14c0 | |||
| 7684585f49 | |||
| 5896fbd910 | |||
| f1e78be4f4 | |||
| 2fdf654f40 | |||
| 4d1ff67cac | |||
| 3be15b1dfd | |||
| da30671ec4 | |||
| 6111ad4306 | |||
| fe90bf4bdc | |||
| 67ba9b320e | |||
| 761a517888 | |||
| b8e1788ed0 | |||
| 329d804032 | |||
| a1ff99126a | |||
| dd0eb9dd8d | |||
| f22c05deab | |||
| b37fb9142f | |||
| b4a74f895e | |||
| 900ece18e7 | |||
| 5249f09f70 | |||
| 4e5fe303a1 | |||
| 1f514a1afa | |||
| bba07fdb26 | |||
| 1fe5f5a2df | |||
| 7438960109 | |||
| 8a7f2361d5 | |||
| d377a1518d | |||
| 944a05b588 | |||
| 03747a0ffb | |||
| a70330e9be | |||
| 573d36a168 | |||
| 866d01f50d | |||
| bc7d6a9dde | |||
| 43646dbf8d | |||
| f82946c6a9 | |||
| 8c5831d958 | |||
| 21def39dac | |||
| ee3d32b023 | |||
| 91b5d8575a | |||
| 47223ae2d9 | |||
| 1ffb09b38a | |||
| b0f7a1fe6f | |||
| f02884e294 | |||
| 80c00c9ddd | |||
| 7b02151639 | |||
| 871a4b3d4a | |||
| ec7e338704 | |||
| d59b0df401 | |||
| 79d8aa871a | |||
| 56a3a96e65 | |||
| 799a1b9539 | |||
| 8dcfd0ee8a | |||
| 9b26cb0bfb | |||
| 60b6825612 | |||
| 023c1b2f19 | |||
| 225ad85e90 | |||
| f7c708b22a | |||
| c192af186d | |||
| 270e1101f4 | |||
| 5759802091 | |||
| ee4d087e72 | |||
| 4b0a3163c8 | |||
| 6891e363ea | |||
| 4865f423f5 | |||
| 86356e888e | |||
| c070b624a6 | |||
| e37151a3f1 | |||
| 542a0a2518 | |||
| e984a3b47a | |||
| 453660644e | |||
| 0ddf4f196e | |||
| 7fbcafdda4 | |||
| a8f823fc7f | |||
| 6affa3281a | |||
| 793c507af2 | |||
| afa2c4a2c3 | |||
| d076c22e28 | |||
| 58cb46c4e8 | |||
| 243d6566dd | |||
| 883e3dabb3 | |||
| a538e3369a | |||
| 81792437b2 | |||
| dd8f7f14d2 | |||
| a14f8243e8 | |||
| ab155de14f | |||
| fda445ab05 | |||
| c5e270b453 | |||
| 5a03ce696c | |||
| fde08b2389 | |||
| 5f69a7c5e5 | |||
| c0ee7a47e4 | |||
| 28199a4052 | |||
| 8a5d1ffebe | |||
| 85a6097c03 | |||
| 0820cb8f17 | |||
| d314c33715 | |||
| cb2d8db9ce | |||
| c4287162c4 | |||
| 2940f818b4 | |||
| ca04b33abe | |||
| 7de3ecfe5f | |||
| 23717b74c7 | |||
| 2df6e15fca | |||
| 3263b80ea9 | |||
| 87ebd6700d | |||
| a20ace7d35 | |||
| 9c103ffa45 | |||
| 3e28883a9f | |||
| 25d687f35a | |||
| b129079bed | |||
| da5d388266 | |||
| 9947428d79 | |||
| bfc3b337b7 | |||
| f8e05b67ff | |||
| d376b4c90a | |||
| af40d872ce | |||
| fc63882fe2 | |||
| 7035c0417c | |||
| a7da3cd6a0 | |||
| 6d64a90c24 | |||
| d1faeca8d4 | |||
| 97efd27a9a | |||
| 5198491735 | |||
| 5409b34b06 | |||
| c1db5c0848 | |||
| 26974d0465 | |||
| 3764b61be7 | |||
| 519a84e048 | |||
| a08445227f | |||
| a16c6fb804 | |||
| fb74de326d | |||
| 1372d8339d | |||
| bf45dcb959 | |||
| d002ed0b94 | |||
| e043f9c6fe | |||
| cf50c497b9 | |||
| 18ff5f0a7d | |||
| 67ef39866d | |||
| d9ed9fc8e3 | |||
| 101877351b | |||
| e71bc75a9d | |||
| 7b00f99a57 | |||
| 219c4a2c78 | |||
| 85df699746 | |||
| bb3ad56bf5 | |||
| c5f9c5b8a3 | |||
| 5ccdea8e5b | |||
| 150631849f | |||
| 1419b80d4e | |||
| f0e59b9043 | |||
| 964a55033a | |||
| f2e37e0018 | |||
| 5d23b60c8a | |||
| af1e48df80 | |||
| 2698572162 | |||
| e440e733fd | |||
| 6c51974174 | |||
| 318d024cc1 | |||
| 1495ec0f31 | |||
| b5f913a3fc | |||
| 4c74029489 | |||
| 5112295723 | |||
| d6d848184b | |||
| fa140555e8 | |||
| 1c3703477b | |||
| 9a575d1ded | |||
| 50035f5a92 | |||
| 627dc95d19 | |||
| 9dd0d90f69 | |||
| 8465f76e7e | |||
| 77fe7240f0 | |||
| f4d0310d73 | |||
| 177fd27382 | |||
| fc33094429 | |||
| ed77ab18c9 | |||
| e8f6848095 | |||
| 683677b4f9 | |||
| 69289bf943 | |||
| 26841884af | |||
| e42dbbf7f3 | |||
| 232654cb60 | |||
| 16e4a1dd17 | |||
| abe09d25ce | |||
| f36f453dd2 | |||
| f1015c88fa | |||
| 3d89b2caa4 | |||
| 3c01e30748 | |||
| 149793f2e7 | |||
| d4fa3f91ee | |||
| 7c8ae42c6f | |||
| f66d3ab208 | |||
| 908e377246 | |||
| d3502315bd | |||
| e83d801c71 | |||
| 0f494970d1 | |||
| 1df0397163 | |||
| f2627dd757 | |||
| 49a78333fb | |||
| ef5bd659fa | |||
| 6c4b06390e | |||
| e5de3dd94b | |||
| 39292ba053 | |||
| a3070405d9 | |||
| 59847bb901 | |||
| 1aa7fd98c2 | |||
| 883c7a582d | |||
| 25e59e3ce6 | |||
| 88df5fcd04 | |||
| 7faf852561 | |||
| bf815b3390 | |||
| 1935d85ef1 | |||
| ab22dfde8a | |||
| f042e85d41 | |||
| f7f957abb9 | |||
| ae5dc3efdf | |||
| 94b405b64f | |||
| 39279350eb | |||
| ddc2a70de9 | |||
| 61ffa182ee | |||
| e5ea0a3daa | |||
| dfa6b749ba | |||
| ede34c17dd | |||
| 66ac355f78 | |||
| 015ab0eb64 | |||
| 9aad8b3a86 | |||
| 132695ceb1 | |||
| b98cd2d870 | |||
| 09cbe1301e | |||
| 809db50459 | |||
| 1fd39a52fa | |||
| 6f81c4e7b9 | |||
| 21ee8dc0b6 | |||
| 797a4c3c60 | |||
| 7b3d57abd4 | |||
| d294c2f6bd | |||
| a5533ffc6a | |||
| 42cdc9f04f | |||
| 78d875c60f | |||
| 0a505fd383 | |||
| fbc3210184 | |||
| 7351528431 | |||
| 9d8047382e | |||
| 1c207a8889 | |||
| 066ca70890 | |||
| 15d15104d4 | |||
| 9cd4c99918 | |||
| 93bc69011b | |||
| c09373a516 | |||
| 0337b46975 | |||
| 8625a524a5 | |||
| 9805336c0a | |||
| 66a7c35d80 | |||
| f2d78424f2 | |||
| 9e75e34184 | |||
| e0f6ad1c9c | |||
| 56ec730337 | |||
| 49c2efee27 | |||
| b705b95a1e | |||
| 5a05da2af2 | |||
| ca791d32d8 | |||
| 5c856e5741 | |||
| 0f5923a150 | |||
| 61ce6e21ec | |||
| 290b2d7355 | |||
| ba246b450f | |||
| 654387ff05 | |||
| 336f21f0aa | |||
| 7e83db10d5 | |||
| db5cac3b3f | |||
| 087a72f0ef | |||
| fd0e0d675e | |||
| a576150b64 | |||
| 7710dc7325 | |||
| e84acb289e | |||
| 8681d62bbf | |||
| e61c59165c | |||
| 962e548495 | |||
| 4b0c953e66 | |||
| e18898dfe1 | |||
| 92d08d513b | |||
| fc5b8679da |
+30
@@ -1,6 +1,9 @@
|
||||
# the default generated dir + db file
|
||||
data
|
||||
owncloud
|
||||
config/config.php
|
||||
config/mount.php
|
||||
apps/inc.php
|
||||
|
||||
# just sane ignores
|
||||
.*.sw[po]
|
||||
@@ -16,3 +19,30 @@ _darcs/*
|
||||
CVS/*
|
||||
.svn/*
|
||||
RCS/*
|
||||
|
||||
# kdevelop
|
||||
.kdev
|
||||
*.kdev4
|
||||
|
||||
# Lokalize
|
||||
*lokalize*
|
||||
|
||||
# eclipse
|
||||
.project
|
||||
.settings
|
||||
|
||||
# netbeans
|
||||
nbproject
|
||||
|
||||
# geany
|
||||
*.geany
|
||||
|
||||
# Cloud9IDE
|
||||
.settings.xml
|
||||
|
||||
# Mac OS
|
||||
.DS_Store
|
||||
|
||||
# WebFinger
|
||||
.well-known
|
||||
/.buildpath
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
ErrorDocument 403 /core/templates/403.php
|
||||
ErrorDocument 404 /core/templates/404.php
|
||||
<IfModule mod_php5.c>
|
||||
php_value upload_max_filesize 513M
|
||||
php_value post_max_size 513M
|
||||
php_value memory_limit 512M
|
||||
<IfModule env_module>
|
||||
SetEnv htaccessWorking true
|
||||
</IfModule>
|
||||
</IfModule>
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine on
|
||||
RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
|
||||
RewriteRule ^.well-known/host-meta /public.php?service=host-meta [QSA,L]
|
||||
RewriteRule ^.well-known/carddav /remote.php/carddav/ [R]
|
||||
RewriteRule ^.well-known/caldav /remote.php/caldav/ [R]
|
||||
RewriteRule ^apps/calendar/caldav.php remote.php/caldav/ [QSA,L]
|
||||
RewriteRule ^apps/contacts/carddav.php remote.php/carddav/ [QSA,L]
|
||||
RewriteRule ^apps/([^/]*)/(.*\.(css|php))$ index.php?app=$1&getfile=$2 [QSA,L]
|
||||
RewriteRule ^remote/(.*) remote.php [QSA,L]
|
||||
</IfModule>
|
||||
Options -Indexes
|
||||
+182
@@ -0,0 +1,182 @@
|
||||
[main]
|
||||
host = https://www.transifex.net
|
||||
|
||||
[owncloud.core]
|
||||
file_filter = l10n/<lang>/core.po
|
||||
host = http://www.transifex.net
|
||||
source_file = l10n/templates/core.pot
|
||||
source_lang = en
|
||||
trans.bg_BG = l10n/bg_BG/core.po
|
||||
trans.ca = l10n/ca/core.po
|
||||
trans.cs_CZ = l10n/cs_CZ/core.po
|
||||
trans.da = l10n/da/core.po
|
||||
trans.de = l10n/de/core.po
|
||||
trans.el = l10n/el/core.po
|
||||
trans.es = l10n/es/core.po
|
||||
trans.et_EE = l10n/et_EE/core.po
|
||||
trans.fr = l10n/fr/core.po
|
||||
trans.id = l10n/id/core.po
|
||||
trans.it = l10n/it/core.po
|
||||
trans.lb = l10n/lb/core.po
|
||||
trans.ms_MY = l10n/ms_MY/core.po
|
||||
trans.nb_NO = l10n/nb_NO/core.po
|
||||
trans.nl = l10n/nl/core.po
|
||||
trans.pl = l10n/pl/core.po
|
||||
trans.pt_BR = l10n/pt_BR/core.po
|
||||
trans.pt_PT = l10n/pt_PT/core.po
|
||||
trans.ro = l10n/ro/core.po
|
||||
trans.ru = l10n/ru/core.po
|
||||
trans.sr = l10n/sr/core.po
|
||||
trans.sr@latin = l10n/sr@latin/core.po
|
||||
trans.sv = l10n/sv/core.po
|
||||
trans.zh_CN = l10n/zh_CN/core.po
|
||||
|
||||
[owncloud.settings]
|
||||
file_filter = l10n/<lang>/settings.po
|
||||
host = http://www.transifex.net
|
||||
source_file = l10n/templates/settings.pot
|
||||
source_lang = en
|
||||
trans.bg_BG = l10n/bg_BG/settings.po
|
||||
trans.ca = l10n/ca/settings.po
|
||||
trans.cs_CZ = l10n/cs_CZ/settings.po
|
||||
trans.da = l10n/da/settings.po
|
||||
trans.de = l10n/de/settings.po
|
||||
trans.el = l10n/el/settings.po
|
||||
trans.es = l10n/es/settings.po
|
||||
trans.et_EE = l10n/et_EE/settings.po
|
||||
trans.fr = l10n/fr/settings.po
|
||||
trans.id = l10n/id/settings.po
|
||||
trans.it = l10n/it/settings.po
|
||||
trans.lb = l10n/lb/settings.po
|
||||
trans.ms_MY = l10n/ms_MY/settings.po
|
||||
trans.nb_NO = l10n/nb_NO/settings.po
|
||||
trans.nl = l10n/nl/settings.po
|
||||
trans.pl = l10n/pl/settings.po
|
||||
trans.pt_BR = l10n/pt_BR/settings.po
|
||||
trans.pt_PT = l10n/pt_PT/settings.po
|
||||
trans.ro = l10n/ro/settings.po
|
||||
trans.ru = l10n/ru/settings.po
|
||||
trans.sr = l10n/sr/settings.po
|
||||
trans.sr@latin = l10n/sr@latin/settings.po
|
||||
trans.sv = l10n/sv/settings.po
|
||||
trans.zh_CN = l10n/zh_CN/settings.po
|
||||
|
||||
[owncloud.files]
|
||||
file_filter = translations/owncloud.files/<lang>.po
|
||||
host = http://www.transifex.net
|
||||
source_file = l10n/templates/files.pot
|
||||
source_lang = en
|
||||
trans.bg_BG = l10n/bg_BG/files.po
|
||||
trans.ca = l10n/ca/files.po
|
||||
trans.cs_CZ = l10n/cs_CZ/files.po
|
||||
trans.da = l10n/da/files.po
|
||||
trans.de = l10n/de/files.po
|
||||
trans.el = l10n/el/files.po
|
||||
trans.es = l10n/es/files.po
|
||||
trans.et_EE = l10n/et_EE/files.po
|
||||
trans.fr = l10n/fr/files.po
|
||||
trans.id = l10n/id/files.po
|
||||
trans.it = l10n/it/files.po
|
||||
trans.lb = l10n/lb/files.po
|
||||
trans.ms_MY = l10n/ms_MY/files.po
|
||||
trans.nb_NO = l10n/nb_NO/files.po
|
||||
trans.nl = l10n/nl/files.po
|
||||
trans.pl = l10n/pl/files.po
|
||||
trans.pt_BR = l10n/pt_BR/files.po
|
||||
trans.pt_PT = l10n/pt_PT/files.po
|
||||
trans.ro = l10n/ro/files.po
|
||||
trans.ru = l10n/ru/files.po
|
||||
trans.sr = l10n/sr/files.po
|
||||
trans.sr@latin = l10n/sr@latin/files.po
|
||||
trans.sv = l10n/sv/files.po
|
||||
trans.zh_CN = l10n/zh_CN/files.po
|
||||
|
||||
[owncloud.media]
|
||||
file_filter = translations/owncloud.media/<lang>.po
|
||||
host = http://www.transifex.net
|
||||
source_file = l10n/templates/media.pot
|
||||
source_lang = en
|
||||
trans.bg_BG = l10n/bg_BG/media.po
|
||||
trans.ca = l10n/ca/media.po
|
||||
trans.cs_CZ = l10n/cs_CZ/media.po
|
||||
trans.da = l10n/da/media.po
|
||||
trans.de = l10n/de/media.po
|
||||
trans.el = l10n/el/media.po
|
||||
trans.es = l10n/es/media.po
|
||||
trans.et_EE = l10n/et_EE/media.po
|
||||
trans.fr = l10n/fr/media.po
|
||||
trans.id = l10n/id/media.po
|
||||
trans.it = l10n/it/media.po
|
||||
trans.lb = l10n/lb/media.po
|
||||
trans.ms_MY = l10n/ms_MY/media.po
|
||||
trans.nb_NO = l10n/nb_NO/media.po
|
||||
trans.nl = l10n/nl/media.po
|
||||
trans.pl = l10n/pl/media.po
|
||||
trans.pt_BR = l10n/pt_BR/media.po
|
||||
trans.pt_PT = l10n/pt_PT/media.po
|
||||
trans.ro = l10n/ro/media.po
|
||||
trans.ru = l10n/ru/media.po
|
||||
trans.sr = l10n/sr/media.po
|
||||
trans.sr@latin = l10n/sr@latin/media.po
|
||||
trans.sv = l10n/sv/media.po
|
||||
trans.zh_CN = l10n/zh_CN/media.po
|
||||
|
||||
[owncloud.calendar]
|
||||
file_filter = l10n/<lang>/calendar.po
|
||||
host = http://www.transifex.net
|
||||
source_file = l10n/templates/calendar.pot
|
||||
source_lang = en
|
||||
trans.bg_BG = l10n/bg_BG/calendar.po
|
||||
trans.ca = l10n/ca/calendar.po
|
||||
trans.cs_CZ = l10n/cs_CZ/calendar.po
|
||||
trans.da = l10n/da/calendar.po
|
||||
trans.de = l10n/de/calendar.po
|
||||
trans.el = l10n/el/calendar.po
|
||||
trans.es = l10n/es/calendar.po
|
||||
trans.et_EE = l10n/et_EE/calendar.po
|
||||
trans.fr = l10n/fr/calendar.po
|
||||
trans.id = l10n/id/calendar.po
|
||||
trans.it = l10n/it/calendar.po
|
||||
trans.lb = l10n/lb/calendar.po
|
||||
trans.ms_MY = l10n/ms_MY/calendar.po
|
||||
trans.nb_NO = l10n/nb_NO/calendar.po
|
||||
trans.nl = l10n/nl/calendar.po
|
||||
trans.pl = l10n/pl/calendar.po
|
||||
trans.pt_BR = l10n/pt_BR/calendar.po
|
||||
trans.pt_PT = l10n/pt_PT/calendar.po
|
||||
trans.ro = l10n/ro/calendar.po
|
||||
trans.ru = l10n/ru/calendar.po
|
||||
trans.sr = l10n/sr/calendar.po
|
||||
trans.sr@latin = l10n/sr@latin/calendar.po
|
||||
trans.sv = l10n/sv/calendar.po
|
||||
trans.zh_CN = l10n/zh_CN/calendar.po
|
||||
|
||||
[owncloud.contacts]
|
||||
file_filter = translations/owncloud.contacts/<lang>.po
|
||||
host = http://www.transifex.net
|
||||
source_file = l10n/templates/contacts.pot
|
||||
source_lang = en
|
||||
trans.bg_BG = l10n/bg_BG/contacts.po
|
||||
trans.ca = l10n/ca/contacts.po
|
||||
trans.cs_CZ = l10n/cs_CZ/contacts.po
|
||||
trans.da = l10n/da/contacts.po
|
||||
trans.de = l10n/de/contacts.po
|
||||
trans.el = l10n/el/contacts.po
|
||||
trans.es = l10n/es/contacts.po
|
||||
trans.et_EE = l10n/et_EE/contacts.po
|
||||
trans.fr = l10n/fr/contacts.po
|
||||
trans.id = l10n/id/contacts.po
|
||||
trans.it = l10n/it/contacts.po
|
||||
trans.lb = l10n/lb/contacts.po
|
||||
trans.ms_MY = l10n/ms_MY/contacts.po
|
||||
trans.nb_NO = l10n/nb_NO/contacts.po
|
||||
trans.nl = l10n/nl/contacts.po
|
||||
trans.pl = l10n/pl/contacts.po
|
||||
trans.pt_BR = l10n/pt_BR/contacts.po
|
||||
trans.pt_PT = l10n/pt_PT/contacts.po
|
||||
trans.ro = l10n/ro/contacts.po
|
||||
trans.ru = l10n/ru/contacts.po
|
||||
trans.sr = l10n/sr/contacts.po
|
||||
trans.sr@latin = l10n/sr@latin/contacts.po
|
||||
trans.sv = l10n/sv/contacts.po
|
||||
trans.zh_CN = l10n/zh_CN/contacts.po
|
||||
+429
-237
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -18,7 +18,7 @@
|
||||
//
|
||||
// $Id: Getopt.php,v 1.21.4.7 2003/12/05 21:57:01 andrei Exp $
|
||||
|
||||
oc_require_once( 'PEAR.php');
|
||||
require_once( 'PEAR.php');
|
||||
|
||||
/**
|
||||
* Command-line options parsing class.
|
||||
Vendored
+317
@@ -0,0 +1,317 @@
|
||||
<?php
|
||||
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
|
||||
|
||||
/**
|
||||
* Crypt_Blowfish allows for encryption and decryption on the fly using
|
||||
* the Blowfish algorithm. Crypt_Blowfish does not require the mcrypt
|
||||
* PHP extension, it uses only PHP.
|
||||
* Crypt_Blowfish support encryption/decryption with or without a secret key.
|
||||
*
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* LICENSE: This source file is subject to version 3.0 of the PHP license
|
||||
* that is available through the world-wide-web at the following URI:
|
||||
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
|
||||
* the PHP License and are unable to obtain it through the web, please
|
||||
* send a note to license@php.net so we can mail you a copy immediately.
|
||||
*
|
||||
* @category Encryption
|
||||
* @package Crypt_Blowfish
|
||||
* @author Matthew Fonda <mfonda@php.net>
|
||||
* @copyright 2005 Matthew Fonda
|
||||
* @license http://www.php.net/license/3_0.txt PHP License 3.0
|
||||
* @version CVS: $Id: Blowfish.php,v 1.81 2005/05/30 18:40:36 mfonda Exp $
|
||||
* @link http://pear.php.net/package/Crypt_Blowfish
|
||||
*/
|
||||
|
||||
|
||||
require_once 'PEAR.php';
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Example usage:
|
||||
* $bf = new Crypt_Blowfish('some secret key!');
|
||||
* $encrypted = $bf->encrypt('this is some example plain text');
|
||||
* $plaintext = $bf->decrypt($encrypted);
|
||||
* echo "plain text: $plaintext";
|
||||
*
|
||||
*
|
||||
* @category Encryption
|
||||
* @package Crypt_Blowfish
|
||||
* @author Matthew Fonda <mfonda@php.net>
|
||||
* @copyright 2005 Matthew Fonda
|
||||
* @license http://www.php.net/license/3_0.txt PHP License 3.0
|
||||
* @link http://pear.php.net/package/Crypt_Blowfish
|
||||
* @version @package_version@
|
||||
* @access public
|
||||
*/
|
||||
class Crypt_Blowfish
|
||||
{
|
||||
/**
|
||||
* P-Array contains 18 32-bit subkeys
|
||||
*
|
||||
* @var array
|
||||
* @access private
|
||||
*/
|
||||
var $_P = array();
|
||||
|
||||
|
||||
/**
|
||||
* Array of four S-Blocks each containing 256 32-bit entries
|
||||
*
|
||||
* @var array
|
||||
* @access private
|
||||
*/
|
||||
var $_S = array();
|
||||
|
||||
/**
|
||||
* Mcrypt td resource
|
||||
*
|
||||
* @var resource
|
||||
* @access private
|
||||
*/
|
||||
var $_td = null;
|
||||
|
||||
/**
|
||||
* Initialization vector
|
||||
*
|
||||
* @var string
|
||||
* @access private
|
||||
*/
|
||||
var $_iv = null;
|
||||
|
||||
|
||||
/**
|
||||
* Crypt_Blowfish Constructor
|
||||
* Initializes the Crypt_Blowfish object, and gives a sets
|
||||
* the secret key
|
||||
*
|
||||
* @param string $key
|
||||
* @access public
|
||||
*/
|
||||
function Crypt_Blowfish($key)
|
||||
{
|
||||
if (extension_loaded('mcrypt')) {
|
||||
$this->_td = mcrypt_module_open(MCRYPT_BLOWFISH, '', 'ecb', '');
|
||||
$this->_iv = mcrypt_create_iv(8, MCRYPT_RAND);
|
||||
}
|
||||
$this->setKey($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deprecated isReady method
|
||||
*
|
||||
* @return bool
|
||||
* @access public
|
||||
* @deprecated
|
||||
*/
|
||||
function isReady()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deprecated init method - init is now a private
|
||||
* method and has been replaced with _init
|
||||
*
|
||||
* @return bool
|
||||
* @access public
|
||||
* @deprecated
|
||||
* @see Crypt_Blowfish::_init()
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
$this->_init();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the Crypt_Blowfish object
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
function _init()
|
||||
{
|
||||
$defaults = new Crypt_Blowfish_DefaultKey();
|
||||
$this->_P = $defaults->P;
|
||||
$this->_S = $defaults->S;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enciphers a single 64 bit block
|
||||
*
|
||||
* @param int &$Xl
|
||||
* @param int &$Xr
|
||||
* @access private
|
||||
*/
|
||||
function _encipher(&$Xl, &$Xr)
|
||||
{
|
||||
for ($i = 0; $i < 16; $i++) {
|
||||
$temp = $Xl ^ $this->_P[$i];
|
||||
$Xl = ((($this->_S[0][($temp>>24) & 255] +
|
||||
$this->_S[1][($temp>>16) & 255]) ^
|
||||
$this->_S[2][($temp>>8) & 255]) +
|
||||
$this->_S[3][$temp & 255]) ^ $Xr;
|
||||
$Xr = $temp;
|
||||
}
|
||||
$Xr = $Xl ^ $this->_P[16];
|
||||
$Xl = $temp ^ $this->_P[17];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Deciphers a single 64 bit block
|
||||
*
|
||||
* @param int &$Xl
|
||||
* @param int &$Xr
|
||||
* @access private
|
||||
*/
|
||||
function _decipher(&$Xl, &$Xr)
|
||||
{
|
||||
for ($i = 17; $i > 1; $i--) {
|
||||
$temp = $Xl ^ $this->_P[$i];
|
||||
$Xl = ((($this->_S[0][($temp>>24) & 255] +
|
||||
$this->_S[1][($temp>>16) & 255]) ^
|
||||
$this->_S[2][($temp>>8) & 255]) +
|
||||
$this->_S[3][$temp & 255]) ^ $Xr;
|
||||
$Xr = $temp;
|
||||
}
|
||||
$Xr = $Xl ^ $this->_P[1];
|
||||
$Xl = $temp ^ $this->_P[0];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Encrypts a string
|
||||
*
|
||||
* @param string $plainText
|
||||
* @return string Returns cipher text on success, PEAR_Error on failure
|
||||
* @access public
|
||||
*/
|
||||
function encrypt($plainText)
|
||||
{
|
||||
if (!is_string($plainText)) {
|
||||
PEAR::raiseError('Plain text must be a string', 0, PEAR_ERROR_DIE);
|
||||
}
|
||||
|
||||
if (extension_loaded('mcrypt')) {
|
||||
return mcrypt_generic($this->_td, $plainText);
|
||||
}
|
||||
|
||||
$cipherText = '';
|
||||
$len = strlen($plainText);
|
||||
$plainText .= str_repeat(chr(0),(8 - ($len%8))%8);
|
||||
for ($i = 0; $i < $len; $i += 8) {
|
||||
list(,$Xl,$Xr) = unpack("N2",substr($plainText,$i,8));
|
||||
$this->_encipher($Xl, $Xr);
|
||||
$cipherText .= pack("N2", $Xl, $Xr);
|
||||
}
|
||||
return $cipherText;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Decrypts an encrypted string
|
||||
*
|
||||
* @param string $cipherText
|
||||
* @return string Returns plain text on success, PEAR_Error on failure
|
||||
* @access public
|
||||
*/
|
||||
function decrypt($cipherText)
|
||||
{
|
||||
if (!is_string($cipherText)) {
|
||||
PEAR::raiseError('Chiper text must be a string', 1, PEAR_ERROR_DIE);
|
||||
}
|
||||
|
||||
if (extension_loaded('mcrypt')) {
|
||||
return mdecrypt_generic($this->_td, $cipherText);
|
||||
}
|
||||
|
||||
$plainText = '';
|
||||
$len = strlen($cipherText);
|
||||
$cipherText .= str_repeat(chr(0),(8 - ($len%8))%8);
|
||||
for ($i = 0; $i < $len; $i += 8) {
|
||||
list(,$Xl,$Xr) = unpack("N2",substr($cipherText,$i,8));
|
||||
$this->_decipher($Xl, $Xr);
|
||||
$plainText .= pack("N2", $Xl, $Xr);
|
||||
}
|
||||
return $plainText;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the secret key
|
||||
* The key must be non-zero, and less than or equal to
|
||||
* 56 characters in length.
|
||||
*
|
||||
* @param string $key
|
||||
* @return bool Returns true on success, PEAR_Error on failure
|
||||
* @access public
|
||||
*/
|
||||
function setKey($key)
|
||||
{
|
||||
if (!is_string($key)) {
|
||||
PEAR::raiseError('Key must be a string', 2, PEAR_ERROR_DIE);
|
||||
}
|
||||
|
||||
$len = strlen($key);
|
||||
|
||||
if ($len > 56 || $len == 0) {
|
||||
PEAR::raiseError('Key must be less than 56 characters and non-zero. Supplied key length: ' . $len, 3, PEAR_ERROR_DIE);
|
||||
}
|
||||
|
||||
if (extension_loaded('mcrypt')) {
|
||||
mcrypt_generic_init($this->_td, $key, $this->_iv);
|
||||
return true;
|
||||
}
|
||||
|
||||
require_once 'Blowfish/DefaultKey.php';
|
||||
$this->_init();
|
||||
|
||||
$k = 0;
|
||||
$data = 0;
|
||||
$datal = 0;
|
||||
$datar = 0;
|
||||
|
||||
for ($i = 0; $i < 18; $i++) {
|
||||
$data = 0;
|
||||
for ($j = 4; $j > 0; $j--) {
|
||||
$data = $data << 8 | ord($key{$k});
|
||||
$k = ($k+1) % $len;
|
||||
}
|
||||
$this->_P[$i] ^= $data;
|
||||
}
|
||||
|
||||
for ($i = 0; $i <= 16; $i += 2) {
|
||||
$this->_encipher($datal, $datar);
|
||||
$this->_P[$i] = $datal;
|
||||
$this->_P[$i+1] = $datar;
|
||||
}
|
||||
for ($i = 0; $i < 256; $i += 2) {
|
||||
$this->_encipher($datal, $datar);
|
||||
$this->_S[0][$i] = $datal;
|
||||
$this->_S[0][$i+1] = $datar;
|
||||
}
|
||||
for ($i = 0; $i < 256; $i += 2) {
|
||||
$this->_encipher($datal, $datar);
|
||||
$this->_S[1][$i] = $datal;
|
||||
$this->_S[1][$i+1] = $datar;
|
||||
}
|
||||
for ($i = 0; $i < 256; $i += 2) {
|
||||
$this->_encipher($datal, $datar);
|
||||
$this->_S[2][$i] = $datal;
|
||||
$this->_S[2][$i+1] = $datar;
|
||||
}
|
||||
for ($i = 0; $i < 256; $i += 2) {
|
||||
$this->_encipher($datal, $datar);
|
||||
$this->_S[3][$i] = $datal;
|
||||
$this->_S[3][$i+1] = $datar;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
+327
@@ -0,0 +1,327 @@
|
||||
<?php
|
||||
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
|
||||
|
||||
/**
|
||||
* Crypt_Blowfish allows for encryption and decryption on the fly using
|
||||
* the Blowfish algorithm. Crypt_Blowfish does not require the mcrypt
|
||||
* PHP extension, it uses only PHP.
|
||||
* Crypt_Blowfish support encryption/decryption with or without a secret key.
|
||||
*
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* LICENSE: This source file is subject to version 3.0 of the PHP license
|
||||
* that is available through the world-wide-web at the following URI:
|
||||
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
|
||||
* the PHP License and are unable to obtain it through the web, please
|
||||
* send a note to license@php.net so we can mail you a copy immediately.
|
||||
*
|
||||
* @category Encryption
|
||||
* @package Crypt_Blowfish
|
||||
* @author Matthew Fonda <mfonda@php.net>
|
||||
* @copyright 2005 Matthew Fonda
|
||||
* @license http://www.php.net/license/3_0.txt PHP License 3.0
|
||||
* @version CVS: $Id: DefaultKey.php,v 1.81 2005/05/30 18:40:37 mfonda Exp $
|
||||
* @link http://pear.php.net/package/Crypt_Blowfish
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Class containing default key
|
||||
*
|
||||
* @category Encryption
|
||||
* @package Crypt_Blowfish
|
||||
* @author Matthew Fonda <mfonda@php.net>
|
||||
* @copyright 2005 Matthew Fonda
|
||||
* @license http://www.php.net/license/3_0.txt PHP License 3.0
|
||||
* @link http://pear.php.net/package/Crypt_Blowfish
|
||||
* @version @package_version@
|
||||
* @access public
|
||||
*/
|
||||
class Crypt_Blowfish_DefaultKey
|
||||
{
|
||||
var $P = array();
|
||||
|
||||
var $S = array();
|
||||
|
||||
function Crypt_Blowfish_DefaultKey()
|
||||
{
|
||||
$this->P = array(
|
||||
0x243F6A88, 0x85A308D3, 0x13198A2E, 0x03707344,
|
||||
0xA4093822, 0x299F31D0, 0x082EFA98, 0xEC4E6C89,
|
||||
0x452821E6, 0x38D01377, 0xBE5466CF, 0x34E90C6C,
|
||||
0xC0AC29B7, 0xC97C50DD, 0x3F84D5B5, 0xB5470917,
|
||||
0x9216D5D9, 0x8979FB1B
|
||||
);
|
||||
|
||||
$this->S = array(
|
||||
array(
|
||||
0xD1310BA6, 0x98DFB5AC, 0x2FFD72DB, 0xD01ADFB7,
|
||||
0xB8E1AFED, 0x6A267E96, 0xBA7C9045, 0xF12C7F99,
|
||||
0x24A19947, 0xB3916CF7, 0x0801F2E2, 0x858EFC16,
|
||||
0x636920D8, 0x71574E69, 0xA458FEA3, 0xF4933D7E,
|
||||
0x0D95748F, 0x728EB658, 0x718BCD58, 0x82154AEE,
|
||||
0x7B54A41D, 0xC25A59B5, 0x9C30D539, 0x2AF26013,
|
||||
0xC5D1B023, 0x286085F0, 0xCA417918, 0xB8DB38EF,
|
||||
0x8E79DCB0, 0x603A180E, 0x6C9E0E8B, 0xB01E8A3E,
|
||||
0xD71577C1, 0xBD314B27, 0x78AF2FDA, 0x55605C60,
|
||||
0xE65525F3, 0xAA55AB94, 0x57489862, 0x63E81440,
|
||||
0x55CA396A, 0x2AAB10B6, 0xB4CC5C34, 0x1141E8CE,
|
||||
0xA15486AF, 0x7C72E993, 0xB3EE1411, 0x636FBC2A,
|
||||
0x2BA9C55D, 0x741831F6, 0xCE5C3E16, 0x9B87931E,
|
||||
0xAFD6BA33, 0x6C24CF5C, 0x7A325381, 0x28958677,
|
||||
0x3B8F4898, 0x6B4BB9AF, 0xC4BFE81B, 0x66282193,
|
||||
0x61D809CC, 0xFB21A991, 0x487CAC60, 0x5DEC8032,
|
||||
0xEF845D5D, 0xE98575B1, 0xDC262302, 0xEB651B88,
|
||||
0x23893E81, 0xD396ACC5, 0x0F6D6FF3, 0x83F44239,
|
||||
0x2E0B4482, 0xA4842004, 0x69C8F04A, 0x9E1F9B5E,
|
||||
0x21C66842, 0xF6E96C9A, 0x670C9C61, 0xABD388F0,
|
||||
0x6A51A0D2, 0xD8542F68, 0x960FA728, 0xAB5133A3,
|
||||
0x6EEF0B6C, 0x137A3BE4, 0xBA3BF050, 0x7EFB2A98,
|
||||
0xA1F1651D, 0x39AF0176, 0x66CA593E, 0x82430E88,
|
||||
0x8CEE8619, 0x456F9FB4, 0x7D84A5C3, 0x3B8B5EBE,
|
||||
0xE06F75D8, 0x85C12073, 0x401A449F, 0x56C16AA6,
|
||||
0x4ED3AA62, 0x363F7706, 0x1BFEDF72, 0x429B023D,
|
||||
0x37D0D724, 0xD00A1248, 0xDB0FEAD3, 0x49F1C09B,
|
||||
0x075372C9, 0x80991B7B, 0x25D479D8, 0xF6E8DEF7,
|
||||
0xE3FE501A, 0xB6794C3B, 0x976CE0BD, 0x04C006BA,
|
||||
0xC1A94FB6, 0x409F60C4, 0x5E5C9EC2, 0x196A2463,
|
||||
0x68FB6FAF, 0x3E6C53B5, 0x1339B2EB, 0x3B52EC6F,
|
||||
0x6DFC511F, 0x9B30952C, 0xCC814544, 0xAF5EBD09,
|
||||
0xBEE3D004, 0xDE334AFD, 0x660F2807, 0x192E4BB3,
|
||||
0xC0CBA857, 0x45C8740F, 0xD20B5F39, 0xB9D3FBDB,
|
||||
0x5579C0BD, 0x1A60320A, 0xD6A100C6, 0x402C7279,
|
||||
0x679F25FE, 0xFB1FA3CC, 0x8EA5E9F8, 0xDB3222F8,
|
||||
0x3C7516DF, 0xFD616B15, 0x2F501EC8, 0xAD0552AB,
|
||||
0x323DB5FA, 0xFD238760, 0x53317B48, 0x3E00DF82,
|
||||
0x9E5C57BB, 0xCA6F8CA0, 0x1A87562E, 0xDF1769DB,
|
||||
0xD542A8F6, 0x287EFFC3, 0xAC6732C6, 0x8C4F5573,
|
||||
0x695B27B0, 0xBBCA58C8, 0xE1FFA35D, 0xB8F011A0,
|
||||
0x10FA3D98, 0xFD2183B8, 0x4AFCB56C, 0x2DD1D35B,
|
||||
0x9A53E479, 0xB6F84565, 0xD28E49BC, 0x4BFB9790,
|
||||
0xE1DDF2DA, 0xA4CB7E33, 0x62FB1341, 0xCEE4C6E8,
|
||||
0xEF20CADA, 0x36774C01, 0xD07E9EFE, 0x2BF11FB4,
|
||||
0x95DBDA4D, 0xAE909198, 0xEAAD8E71, 0x6B93D5A0,
|
||||
0xD08ED1D0, 0xAFC725E0, 0x8E3C5B2F, 0x8E7594B7,
|
||||
0x8FF6E2FB, 0xF2122B64, 0x8888B812, 0x900DF01C,
|
||||
0x4FAD5EA0, 0x688FC31C, 0xD1CFF191, 0xB3A8C1AD,
|
||||
0x2F2F2218, 0xBE0E1777, 0xEA752DFE, 0x8B021FA1,
|
||||
0xE5A0CC0F, 0xB56F74E8, 0x18ACF3D6, 0xCE89E299,
|
||||
0xB4A84FE0, 0xFD13E0B7, 0x7CC43B81, 0xD2ADA8D9,
|
||||
0x165FA266, 0x80957705, 0x93CC7314, 0x211A1477,
|
||||
0xE6AD2065, 0x77B5FA86, 0xC75442F5, 0xFB9D35CF,
|
||||
0xEBCDAF0C, 0x7B3E89A0, 0xD6411BD3, 0xAE1E7E49,
|
||||
0x00250E2D, 0x2071B35E, 0x226800BB, 0x57B8E0AF,
|
||||
0x2464369B, 0xF009B91E, 0x5563911D, 0x59DFA6AA,
|
||||
0x78C14389, 0xD95A537F, 0x207D5BA2, 0x02E5B9C5,
|
||||
0x83260376, 0x6295CFA9, 0x11C81968, 0x4E734A41,
|
||||
0xB3472DCA, 0x7B14A94A, 0x1B510052, 0x9A532915,
|
||||
0xD60F573F, 0xBC9BC6E4, 0x2B60A476, 0x81E67400,
|
||||
0x08BA6FB5, 0x571BE91F, 0xF296EC6B, 0x2A0DD915,
|
||||
0xB6636521, 0xE7B9F9B6, 0xFF34052E, 0xC5855664,
|
||||
0x53B02D5D, 0xA99F8FA1, 0x08BA4799, 0x6E85076A
|
||||
),
|
||||
array(
|
||||
0x4B7A70E9, 0xB5B32944, 0xDB75092E, 0xC4192623,
|
||||
0xAD6EA6B0, 0x49A7DF7D, 0x9CEE60B8, 0x8FEDB266,
|
||||
0xECAA8C71, 0x699A17FF, 0x5664526C, 0xC2B19EE1,
|
||||
0x193602A5, 0x75094C29, 0xA0591340, 0xE4183A3E,
|
||||
0x3F54989A, 0x5B429D65, 0x6B8FE4D6, 0x99F73FD6,
|
||||
0xA1D29C07, 0xEFE830F5, 0x4D2D38E6, 0xF0255DC1,
|
||||
0x4CDD2086, 0x8470EB26, 0x6382E9C6, 0x021ECC5E,
|
||||
0x09686B3F, 0x3EBAEFC9, 0x3C971814, 0x6B6A70A1,
|
||||
0x687F3584, 0x52A0E286, 0xB79C5305, 0xAA500737,
|
||||
0x3E07841C, 0x7FDEAE5C, 0x8E7D44EC, 0x5716F2B8,
|
||||
0xB03ADA37, 0xF0500C0D, 0xF01C1F04, 0x0200B3FF,
|
||||
0xAE0CF51A, 0x3CB574B2, 0x25837A58, 0xDC0921BD,
|
||||
0xD19113F9, 0x7CA92FF6, 0x94324773, 0x22F54701,
|
||||
0x3AE5E581, 0x37C2DADC, 0xC8B57634, 0x9AF3DDA7,
|
||||
0xA9446146, 0x0FD0030E, 0xECC8C73E, 0xA4751E41,
|
||||
0xE238CD99, 0x3BEA0E2F, 0x3280BBA1, 0x183EB331,
|
||||
0x4E548B38, 0x4F6DB908, 0x6F420D03, 0xF60A04BF,
|
||||
0x2CB81290, 0x24977C79, 0x5679B072, 0xBCAF89AF,
|
||||
0xDE9A771F, 0xD9930810, 0xB38BAE12, 0xDCCF3F2E,
|
||||
0x5512721F, 0x2E6B7124, 0x501ADDE6, 0x9F84CD87,
|
||||
0x7A584718, 0x7408DA17, 0xBC9F9ABC, 0xE94B7D8C,
|
||||
0xEC7AEC3A, 0xDB851DFA, 0x63094366, 0xC464C3D2,
|
||||
0xEF1C1847, 0x3215D908, 0xDD433B37, 0x24C2BA16,
|
||||
0x12A14D43, 0x2A65C451, 0x50940002, 0x133AE4DD,
|
||||
0x71DFF89E, 0x10314E55, 0x81AC77D6, 0x5F11199B,
|
||||
0x043556F1, 0xD7A3C76B, 0x3C11183B, 0x5924A509,
|
||||
0xF28FE6ED, 0x97F1FBFA, 0x9EBABF2C, 0x1E153C6E,
|
||||
0x86E34570, 0xEAE96FB1, 0x860E5E0A, 0x5A3E2AB3,
|
||||
0x771FE71C, 0x4E3D06FA, 0x2965DCB9, 0x99E71D0F,
|
||||
0x803E89D6, 0x5266C825, 0x2E4CC978, 0x9C10B36A,
|
||||
0xC6150EBA, 0x94E2EA78, 0xA5FC3C53, 0x1E0A2DF4,
|
||||
0xF2F74EA7, 0x361D2B3D, 0x1939260F, 0x19C27960,
|
||||
0x5223A708, 0xF71312B6, 0xEBADFE6E, 0xEAC31F66,
|
||||
0xE3BC4595, 0xA67BC883, 0xB17F37D1, 0x018CFF28,
|
||||
0xC332DDEF, 0xBE6C5AA5, 0x65582185, 0x68AB9802,
|
||||
0xEECEA50F, 0xDB2F953B, 0x2AEF7DAD, 0x5B6E2F84,
|
||||
0x1521B628, 0x29076170, 0xECDD4775, 0x619F1510,
|
||||
0x13CCA830, 0xEB61BD96, 0x0334FE1E, 0xAA0363CF,
|
||||
0xB5735C90, 0x4C70A239, 0xD59E9E0B, 0xCBAADE14,
|
||||
0xEECC86BC, 0x60622CA7, 0x9CAB5CAB, 0xB2F3846E,
|
||||
0x648B1EAF, 0x19BDF0CA, 0xA02369B9, 0x655ABB50,
|
||||
0x40685A32, 0x3C2AB4B3, 0x319EE9D5, 0xC021B8F7,
|
||||
0x9B540B19, 0x875FA099, 0x95F7997E, 0x623D7DA8,
|
||||
0xF837889A, 0x97E32D77, 0x11ED935F, 0x16681281,
|
||||
0x0E358829, 0xC7E61FD6, 0x96DEDFA1, 0x7858BA99,
|
||||
0x57F584A5, 0x1B227263, 0x9B83C3FF, 0x1AC24696,
|
||||
0xCDB30AEB, 0x532E3054, 0x8FD948E4, 0x6DBC3128,
|
||||
0x58EBF2EF, 0x34C6FFEA, 0xFE28ED61, 0xEE7C3C73,
|
||||
0x5D4A14D9, 0xE864B7E3, 0x42105D14, 0x203E13E0,
|
||||
0x45EEE2B6, 0xA3AAABEA, 0xDB6C4F15, 0xFACB4FD0,
|
||||
0xC742F442, 0xEF6ABBB5, 0x654F3B1D, 0x41CD2105,
|
||||
0xD81E799E, 0x86854DC7, 0xE44B476A, 0x3D816250,
|
||||
0xCF62A1F2, 0x5B8D2646, 0xFC8883A0, 0xC1C7B6A3,
|
||||
0x7F1524C3, 0x69CB7492, 0x47848A0B, 0x5692B285,
|
||||
0x095BBF00, 0xAD19489D, 0x1462B174, 0x23820E00,
|
||||
0x58428D2A, 0x0C55F5EA, 0x1DADF43E, 0x233F7061,
|
||||
0x3372F092, 0x8D937E41, 0xD65FECF1, 0x6C223BDB,
|
||||
0x7CDE3759, 0xCBEE7460, 0x4085F2A7, 0xCE77326E,
|
||||
0xA6078084, 0x19F8509E, 0xE8EFD855, 0x61D99735,
|
||||
0xA969A7AA, 0xC50C06C2, 0x5A04ABFC, 0x800BCADC,
|
||||
0x9E447A2E, 0xC3453484, 0xFDD56705, 0x0E1E9EC9,
|
||||
0xDB73DBD3, 0x105588CD, 0x675FDA79, 0xE3674340,
|
||||
0xC5C43465, 0x713E38D8, 0x3D28F89E, 0xF16DFF20,
|
||||
0x153E21E7, 0x8FB03D4A, 0xE6E39F2B, 0xDB83ADF7
|
||||
),
|
||||
array(
|
||||
0xE93D5A68, 0x948140F7, 0xF64C261C, 0x94692934,
|
||||
0x411520F7, 0x7602D4F7, 0xBCF46B2E, 0xD4A20068,
|
||||
0xD4082471, 0x3320F46A, 0x43B7D4B7, 0x500061AF,
|
||||
0x1E39F62E, 0x97244546, 0x14214F74, 0xBF8B8840,
|
||||
0x4D95FC1D, 0x96B591AF, 0x70F4DDD3, 0x66A02F45,
|
||||
0xBFBC09EC, 0x03BD9785, 0x7FAC6DD0, 0x31CB8504,
|
||||
0x96EB27B3, 0x55FD3941, 0xDA2547E6, 0xABCA0A9A,
|
||||
0x28507825, 0x530429F4, 0x0A2C86DA, 0xE9B66DFB,
|
||||
0x68DC1462, 0xD7486900, 0x680EC0A4, 0x27A18DEE,
|
||||
0x4F3FFEA2, 0xE887AD8C, 0xB58CE006, 0x7AF4D6B6,
|
||||
0xAACE1E7C, 0xD3375FEC, 0xCE78A399, 0x406B2A42,
|
||||
0x20FE9E35, 0xD9F385B9, 0xEE39D7AB, 0x3B124E8B,
|
||||
0x1DC9FAF7, 0x4B6D1856, 0x26A36631, 0xEAE397B2,
|
||||
0x3A6EFA74, 0xDD5B4332, 0x6841E7F7, 0xCA7820FB,
|
||||
0xFB0AF54E, 0xD8FEB397, 0x454056AC, 0xBA489527,
|
||||
0x55533A3A, 0x20838D87, 0xFE6BA9B7, 0xD096954B,
|
||||
0x55A867BC, 0xA1159A58, 0xCCA92963, 0x99E1DB33,
|
||||
0xA62A4A56, 0x3F3125F9, 0x5EF47E1C, 0x9029317C,
|
||||
0xFDF8E802, 0x04272F70, 0x80BB155C, 0x05282CE3,
|
||||
0x95C11548, 0xE4C66D22, 0x48C1133F, 0xC70F86DC,
|
||||
0x07F9C9EE, 0x41041F0F, 0x404779A4, 0x5D886E17,
|
||||
0x325F51EB, 0xD59BC0D1, 0xF2BCC18F, 0x41113564,
|
||||
0x257B7834, 0x602A9C60, 0xDFF8E8A3, 0x1F636C1B,
|
||||
0x0E12B4C2, 0x02E1329E, 0xAF664FD1, 0xCAD18115,
|
||||
0x6B2395E0, 0x333E92E1, 0x3B240B62, 0xEEBEB922,
|
||||
0x85B2A20E, 0xE6BA0D99, 0xDE720C8C, 0x2DA2F728,
|
||||
0xD0127845, 0x95B794FD, 0x647D0862, 0xE7CCF5F0,
|
||||
0x5449A36F, 0x877D48FA, 0xC39DFD27, 0xF33E8D1E,
|
||||
0x0A476341, 0x992EFF74, 0x3A6F6EAB, 0xF4F8FD37,
|
||||
0xA812DC60, 0xA1EBDDF8, 0x991BE14C, 0xDB6E6B0D,
|
||||
0xC67B5510, 0x6D672C37, 0x2765D43B, 0xDCD0E804,
|
||||
0xF1290DC7, 0xCC00FFA3, 0xB5390F92, 0x690FED0B,
|
||||
0x667B9FFB, 0xCEDB7D9C, 0xA091CF0B, 0xD9155EA3,
|
||||
0xBB132F88, 0x515BAD24, 0x7B9479BF, 0x763BD6EB,
|
||||
0x37392EB3, 0xCC115979, 0x8026E297, 0xF42E312D,
|
||||
0x6842ADA7, 0xC66A2B3B, 0x12754CCC, 0x782EF11C,
|
||||
0x6A124237, 0xB79251E7, 0x06A1BBE6, 0x4BFB6350,
|
||||
0x1A6B1018, 0x11CAEDFA, 0x3D25BDD8, 0xE2E1C3C9,
|
||||
0x44421659, 0x0A121386, 0xD90CEC6E, 0xD5ABEA2A,
|
||||
0x64AF674E, 0xDA86A85F, 0xBEBFE988, 0x64E4C3FE,
|
||||
0x9DBC8057, 0xF0F7C086, 0x60787BF8, 0x6003604D,
|
||||
0xD1FD8346, 0xF6381FB0, 0x7745AE04, 0xD736FCCC,
|
||||
0x83426B33, 0xF01EAB71, 0xB0804187, 0x3C005E5F,
|
||||
0x77A057BE, 0xBDE8AE24, 0x55464299, 0xBF582E61,
|
||||
0x4E58F48F, 0xF2DDFDA2, 0xF474EF38, 0x8789BDC2,
|
||||
0x5366F9C3, 0xC8B38E74, 0xB475F255, 0x46FCD9B9,
|
||||
0x7AEB2661, 0x8B1DDF84, 0x846A0E79, 0x915F95E2,
|
||||
0x466E598E, 0x20B45770, 0x8CD55591, 0xC902DE4C,
|
||||
0xB90BACE1, 0xBB8205D0, 0x11A86248, 0x7574A99E,
|
||||
0xB77F19B6, 0xE0A9DC09, 0x662D09A1, 0xC4324633,
|
||||
0xE85A1F02, 0x09F0BE8C, 0x4A99A025, 0x1D6EFE10,
|
||||
0x1AB93D1D, 0x0BA5A4DF, 0xA186F20F, 0x2868F169,
|
||||
0xDCB7DA83, 0x573906FE, 0xA1E2CE9B, 0x4FCD7F52,
|
||||
0x50115E01, 0xA70683FA, 0xA002B5C4, 0x0DE6D027,
|
||||
0x9AF88C27, 0x773F8641, 0xC3604C06, 0x61A806B5,
|
||||
0xF0177A28, 0xC0F586E0, 0x006058AA, 0x30DC7D62,
|
||||
0x11E69ED7, 0x2338EA63, 0x53C2DD94, 0xC2C21634,
|
||||
0xBBCBEE56, 0x90BCB6DE, 0xEBFC7DA1, 0xCE591D76,
|
||||
0x6F05E409, 0x4B7C0188, 0x39720A3D, 0x7C927C24,
|
||||
0x86E3725F, 0x724D9DB9, 0x1AC15BB4, 0xD39EB8FC,
|
||||
0xED545578, 0x08FCA5B5, 0xD83D7CD3, 0x4DAD0FC4,
|
||||
0x1E50EF5E, 0xB161E6F8, 0xA28514D9, 0x6C51133C,
|
||||
0x6FD5C7E7, 0x56E14EC4, 0x362ABFCE, 0xDDC6C837,
|
||||
0xD79A3234, 0x92638212, 0x670EFA8E, 0x406000E0
|
||||
),
|
||||
array(
|
||||
0x3A39CE37, 0xD3FAF5CF, 0xABC27737, 0x5AC52D1B,
|
||||
0x5CB0679E, 0x4FA33742, 0xD3822740, 0x99BC9BBE,
|
||||
0xD5118E9D, 0xBF0F7315, 0xD62D1C7E, 0xC700C47B,
|
||||
0xB78C1B6B, 0x21A19045, 0xB26EB1BE, 0x6A366EB4,
|
||||
0x5748AB2F, 0xBC946E79, 0xC6A376D2, 0x6549C2C8,
|
||||
0x530FF8EE, 0x468DDE7D, 0xD5730A1D, 0x4CD04DC6,
|
||||
0x2939BBDB, 0xA9BA4650, 0xAC9526E8, 0xBE5EE304,
|
||||
0xA1FAD5F0, 0x6A2D519A, 0x63EF8CE2, 0x9A86EE22,
|
||||
0xC089C2B8, 0x43242EF6, 0xA51E03AA, 0x9CF2D0A4,
|
||||
0x83C061BA, 0x9BE96A4D, 0x8FE51550, 0xBA645BD6,
|
||||
0x2826A2F9, 0xA73A3AE1, 0x4BA99586, 0xEF5562E9,
|
||||
0xC72FEFD3, 0xF752F7DA, 0x3F046F69, 0x77FA0A59,
|
||||
0x80E4A915, 0x87B08601, 0x9B09E6AD, 0x3B3EE593,
|
||||
0xE990FD5A, 0x9E34D797, 0x2CF0B7D9, 0x022B8B51,
|
||||
0x96D5AC3A, 0x017DA67D, 0xD1CF3ED6, 0x7C7D2D28,
|
||||
0x1F9F25CF, 0xADF2B89B, 0x5AD6B472, 0x5A88F54C,
|
||||
0xE029AC71, 0xE019A5E6, 0x47B0ACFD, 0xED93FA9B,
|
||||
0xE8D3C48D, 0x283B57CC, 0xF8D56629, 0x79132E28,
|
||||
0x785F0191, 0xED756055, 0xF7960E44, 0xE3D35E8C,
|
||||
0x15056DD4, 0x88F46DBA, 0x03A16125, 0x0564F0BD,
|
||||
0xC3EB9E15, 0x3C9057A2, 0x97271AEC, 0xA93A072A,
|
||||
0x1B3F6D9B, 0x1E6321F5, 0xF59C66FB, 0x26DCF319,
|
||||
0x7533D928, 0xB155FDF5, 0x03563482, 0x8ABA3CBB,
|
||||
0x28517711, 0xC20AD9F8, 0xABCC5167, 0xCCAD925F,
|
||||
0x4DE81751, 0x3830DC8E, 0x379D5862, 0x9320F991,
|
||||
0xEA7A90C2, 0xFB3E7BCE, 0x5121CE64, 0x774FBE32,
|
||||
0xA8B6E37E, 0xC3293D46, 0x48DE5369, 0x6413E680,
|
||||
0xA2AE0810, 0xDD6DB224, 0x69852DFD, 0x09072166,
|
||||
0xB39A460A, 0x6445C0DD, 0x586CDECF, 0x1C20C8AE,
|
||||
0x5BBEF7DD, 0x1B588D40, 0xCCD2017F, 0x6BB4E3BB,
|
||||
0xDDA26A7E, 0x3A59FF45, 0x3E350A44, 0xBCB4CDD5,
|
||||
0x72EACEA8, 0xFA6484BB, 0x8D6612AE, 0xBF3C6F47,
|
||||
0xD29BE463, 0x542F5D9E, 0xAEC2771B, 0xF64E6370,
|
||||
0x740E0D8D, 0xE75B1357, 0xF8721671, 0xAF537D5D,
|
||||
0x4040CB08, 0x4EB4E2CC, 0x34D2466A, 0x0115AF84,
|
||||
0xE1B00428, 0x95983A1D, 0x06B89FB4, 0xCE6EA048,
|
||||
0x6F3F3B82, 0x3520AB82, 0x011A1D4B, 0x277227F8,
|
||||
0x611560B1, 0xE7933FDC, 0xBB3A792B, 0x344525BD,
|
||||
0xA08839E1, 0x51CE794B, 0x2F32C9B7, 0xA01FBAC9,
|
||||
0xE01CC87E, 0xBCC7D1F6, 0xCF0111C3, 0xA1E8AAC7,
|
||||
0x1A908749, 0xD44FBD9A, 0xD0DADECB, 0xD50ADA38,
|
||||
0x0339C32A, 0xC6913667, 0x8DF9317C, 0xE0B12B4F,
|
||||
0xF79E59B7, 0x43F5BB3A, 0xF2D519FF, 0x27D9459C,
|
||||
0xBF97222C, 0x15E6FC2A, 0x0F91FC71, 0x9B941525,
|
||||
0xFAE59361, 0xCEB69CEB, 0xC2A86459, 0x12BAA8D1,
|
||||
0xB6C1075E, 0xE3056A0C, 0x10D25065, 0xCB03A442,
|
||||
0xE0EC6E0E, 0x1698DB3B, 0x4C98A0BE, 0x3278E964,
|
||||
0x9F1F9532, 0xE0D392DF, 0xD3A0342B, 0x8971F21E,
|
||||
0x1B0A7441, 0x4BA3348C, 0xC5BE7120, 0xC37632D8,
|
||||
0xDF359F8D, 0x9B992F2E, 0xE60B6F47, 0x0FE3F11D,
|
||||
0xE54CDA54, 0x1EDAD891, 0xCE6279CF, 0xCD3E7E6F,
|
||||
0x1618B166, 0xFD2C1D05, 0x848FD2C5, 0xF6FB2299,
|
||||
0xF523F357, 0xA6327623, 0x93A83531, 0x56CCCD02,
|
||||
0xACF08162, 0x5A75EBB5, 0x6E163697, 0x88D273CC,
|
||||
0xDE966292, 0x81B949D0, 0x4C50901B, 0x71C65614,
|
||||
0xE6C6C7BD, 0x327A140A, 0x45E1D006, 0xC3F27B9A,
|
||||
0xC9AA53FD, 0x62A80F00, 0xBB25BFE2, 0x35BDD2F6,
|
||||
0x71126905, 0xB2040222, 0xB6CBCF7C, 0xCD769C2B,
|
||||
0x53113EC0, 0x1640E3D3, 0x38ABBD60, 0x2547ADF0,
|
||||
0xBA38209C, 0xF746CE76, 0x77AFA1C5, 0x20756060,
|
||||
0x85CBFE4E, 0x8AE88DD8, 0x7AAAF9B0, 0x4CF9AA7E,
|
||||
0x1948C25C, 0x02FB8A8C, 0x01C36AE4, 0xD6EBE1F9,
|
||||
0x90D4F869, 0xA65CDEA0, 0x3F09252D, 0xC208E69F,
|
||||
0xB74E6132, 0xCE77E25B, 0x578FDFE3, 0x3AC372E6
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
Vendored
+591
-365
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -42,7 +42,7 @@
|
||||
// | Author: Lukas Smith <smith@pooteeweet.org> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: Date.php,v 1.10 2006/03/01 12:15:32 lsmith Exp $
|
||||
// $Id$
|
||||
//
|
||||
|
||||
/**
|
||||
+65
-47
@@ -42,9 +42,9 @@
|
||||
// | Author: Lukas Smith <smith@pooteeweet.org> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: Common.php,v 1.139 2008/12/04 11:50:42 afz Exp $
|
||||
// $Id$
|
||||
|
||||
oc_require_once('MDB2/LOB.php');
|
||||
require_once 'MDB2/LOB.php';
|
||||
|
||||
/**
|
||||
* @package MDB2
|
||||
@@ -100,7 +100,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
|
||||
function getValidTypes()
|
||||
{
|
||||
$types = $this->valid_default_values;
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -145,7 +145,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
|
||||
$types = is_array($types) ? $types : array($types);
|
||||
foreach ($types as $key => $type) {
|
||||
if (!isset($this->valid_default_values[$type])) {
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -209,7 +209,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
|
||||
return fopen('MDB2LOB://'.$lob_index.'@'.$this->db_index, 'r+');
|
||||
}
|
||||
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -232,10 +232,10 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function convertResult($value, $type, $rtrim = true)
|
||||
{
|
||||
if (is_null($value)) {
|
||||
if (null === $value) {
|
||||
return null;
|
||||
}
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -263,7 +263,11 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function convertResultRow($types, $row, $rtrim = true)
|
||||
{
|
||||
$types = $this->_sortResultFieldTypes(array_keys($row), $types);
|
||||
//$types = $this->_sortResultFieldTypes(array_keys($row), $types);
|
||||
$keys = array_keys($row);
|
||||
if (is_int($keys[0])) {
|
||||
$types = $this->_sortResultFieldTypes($keys, $types);
|
||||
}
|
||||
foreach ($row as $key => $value) {
|
||||
if (empty($types[$key])) {
|
||||
continue;
|
||||
@@ -313,7 +317,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
|
||||
if (count($types)) {
|
||||
reset($types);
|
||||
foreach (array_keys($sorted_types) as $k) {
|
||||
if (is_null($sorted_types[$k])) {
|
||||
if (null === $sorted_types[$k]) {
|
||||
$sorted_types[$k] = current($types);
|
||||
next($types);
|
||||
}
|
||||
@@ -338,7 +342,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function getDeclaration($type, $name, $field)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -387,7 +391,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function getTypeDeclaration($field)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -453,7 +457,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function _getDeclaration($name, $field)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -501,17 +505,17 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
|
||||
$default = '';
|
||||
if (array_key_exists('default', $field)) {
|
||||
if ($field['default'] === '') {
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
$valid_default_values = $this->getValidTypes();
|
||||
$field['default'] = $valid_default_values[$field['type']];
|
||||
if ($field['default'] === ''&& ($db->options['portability'] & MDB2_PORTABILITY_EMPTY_TO_NULL)) {
|
||||
if ($field['default'] === '' && ($db->options['portability'] & MDB2_PORTABILITY_EMPTY_TO_NULL)) {
|
||||
$field['default'] = ' ';
|
||||
}
|
||||
}
|
||||
if (!is_null($field['default'])) {
|
||||
if (null !== $field['default']) {
|
||||
$default = ' DEFAULT ' . $this->quote($field['default'], $field['type']);
|
||||
}
|
||||
}
|
||||
@@ -524,7 +528,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
|
||||
|
||||
// }}}
|
||||
// {{{ _getCharsetFieldDeclaration()
|
||||
|
||||
|
||||
/**
|
||||
* Obtain DBMS specific SQL code portion needed to set the CHARACTER SET
|
||||
* of a field declaration to be used in statements like CREATE TABLE.
|
||||
@@ -583,7 +587,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
|
||||
function _getIntegerDeclaration($name, $field)
|
||||
{
|
||||
if (!empty($field['unsigned'])) {
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -651,7 +655,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function _getCLOBDeclaration($name, $field)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -687,7 +691,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function _getBLOBDeclaration($name, $field)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -875,7 +879,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
|
||||
$type = !empty($current['type']) ? $current['type'] : null;
|
||||
|
||||
if (!method_exists($this, "_compare{$type}Definition")) {
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -1114,12 +1118,12 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function quote($value, $type = null, $quote = true, $escape_wildcards = false)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
|
||||
if (is_null($value)
|
||||
if ((null === $value)
|
||||
|| ($value === '' && $db->options['portability'] & MDB2_PORTABILITY_EMPTY_TO_NULL)
|
||||
) {
|
||||
if (!$quote) {
|
||||
@@ -1128,7 +1132,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
|
||||
return 'NULL';
|
||||
}
|
||||
|
||||
if (is_null($type)) {
|
||||
if (null === $type) {
|
||||
switch (gettype($value)) {
|
||||
case 'integer':
|
||||
$type = 'integer';
|
||||
@@ -1218,7 +1222,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
|
||||
return $value;
|
||||
}
|
||||
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -1247,14 +1251,14 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
|
||||
$close = false;
|
||||
if (preg_match('/^(\w+:\/\/)(.*)$/', $value, $match)) {
|
||||
$close = true;
|
||||
if ($match[1] == 'file://') {
|
||||
if (strtolower($match[1]) == 'file://') {
|
||||
$value = $match[2];
|
||||
}
|
||||
$value = @fopen($value, 'r');
|
||||
}
|
||||
|
||||
if (is_resource($value)) {
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -1288,9 +1292,15 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function _quoteLOB($value, $quote, $escape_wildcards)
|
||||
{
|
||||
$value = $this->_readFile($value);
|
||||
if (PEAR::isError($value)) {
|
||||
return $value;
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
if ($db->options['lob_allow_url_include']) {
|
||||
$value = $this->_readFile($value);
|
||||
if (PEAR::isError($value)) {
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
return $this->_quoteText($value, $quote, $escape_wildcards);
|
||||
}
|
||||
@@ -1369,11 +1379,11 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
|
||||
function _quoteDate($value, $quote, $escape_wildcards)
|
||||
{
|
||||
if ($value === 'CURRENT_DATE') {
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
if (isset($db->function) && is_a($db->function, 'MDB2_Driver_Function_Common')) {
|
||||
if (isset($db->function) && is_object($this->function) && is_a($db->function, 'MDB2_Driver_Function_Common')) {
|
||||
return $db->function->now('date');
|
||||
}
|
||||
return 'CURRENT_DATE';
|
||||
@@ -1398,11 +1408,11 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
|
||||
function _quoteTimestamp($value, $quote, $escape_wildcards)
|
||||
{
|
||||
if ($value === 'CURRENT_TIMESTAMP') {
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
if (isset($db->function) && is_a($db->function, 'MDB2_Driver_Function_Common')) {
|
||||
if (isset($db->function) && is_object($this->function) && is_a($db->function, 'MDB2_Driver_Function_Common')) {
|
||||
return $db->function->now('timestamp');
|
||||
}
|
||||
return 'CURRENT_TIMESTAMP';
|
||||
@@ -1427,11 +1437,11 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
|
||||
function _quoteTime($value, $quote, $escape_wildcards)
|
||||
{
|
||||
if ($value === 'CURRENT_TIME') {
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
if (isset($db->function) && is_a($db->function, 'MDB2_Driver_Function_Common')) {
|
||||
if (isset($db->function) && is_object($this->function) && is_a($db->function, 'MDB2_Driver_Function_Common')) {
|
||||
return $db->function->now('time');
|
||||
}
|
||||
return 'CURRENT_TIME';
|
||||
@@ -1517,7 +1527,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function writeLOBToFile($lob, $file)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -1554,7 +1564,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function _retrieveLOB(&$lob)
|
||||
{
|
||||
if (is_null($lob['value'])) {
|
||||
if (null === $lob['value']) {
|
||||
$lob['value'] = $lob['resource'];
|
||||
}
|
||||
$lob['loaded'] = true;
|
||||
@@ -1681,27 +1691,38 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function matchPattern($pattern, $operator = null, $field = null)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
|
||||
$match = '';
|
||||
if (!is_null($operator)) {
|
||||
if (null !== $operator) {
|
||||
$operator = strtoupper($operator);
|
||||
switch ($operator) {
|
||||
// case insensitive
|
||||
case 'ILIKE':
|
||||
if (is_null($field)) {
|
||||
if (null === $field) {
|
||||
return $db->raiseError(MDB2_ERROR_UNSUPPORTED, null, null,
|
||||
'case insensitive LIKE matching requires passing the field name', __FUNCTION__);
|
||||
}
|
||||
$db->loadModule('Function', null, true);
|
||||
$match = $db->function->lower($field).' LIKE ';
|
||||
break;
|
||||
case 'NOT ILIKE':
|
||||
if (null === $field) {
|
||||
return $db->raiseError(MDB2_ERROR_UNSUPPORTED, null, null,
|
||||
'case insensitive NOT ILIKE matching requires passing the field name', __FUNCTION__);
|
||||
}
|
||||
$db->loadModule('Function', null, true);
|
||||
$match = $db->function->lower($field).' NOT LIKE ';
|
||||
break;
|
||||
// case sensitive
|
||||
case 'LIKE':
|
||||
$match = is_null($field) ? 'LIKE ' : $field.' LIKE ';
|
||||
$match = (null === $field) ? 'LIKE ' : ($field.' LIKE ');
|
||||
break;
|
||||
case 'NOT LIKE':
|
||||
$match = (null === $field) ? 'NOT LIKE ' : ($field.' NOT LIKE ');
|
||||
break;
|
||||
default:
|
||||
return $db->raiseError(MDB2_ERROR_UNSUPPORTED, null, null,
|
||||
@@ -1713,9 +1734,6 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
|
||||
if ($key % 2) {
|
||||
$match.= $value;
|
||||
} else {
|
||||
if ($operator === 'ILIKE') {
|
||||
$value = strtolower($value);
|
||||
}
|
||||
$escaped = $db->escape($value);
|
||||
if (PEAR::isError($escaped)) {
|
||||
return $escaped;
|
||||
@@ -1755,7 +1773,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function mapNativeDatatype($field)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -1784,7 +1802,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function _mapNativeDatatype($field)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -1805,7 +1823,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function mapPrepareDatatype($type)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
+59
-10
@@ -43,10 +43,10 @@
|
||||
// | Author: Lukas Smith <smith@pooteeweet.org> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: mysql.php,v 1.65 2008/02/22 19:23:49 quipo Exp $
|
||||
// $Id$
|
||||
//
|
||||
|
||||
oc_require_once('MDB2/Driver/Datatype/Common.php');
|
||||
require_once 'MDB2/Driver/Datatype/Common.php';
|
||||
|
||||
/**
|
||||
* MDB2 MySQL driver
|
||||
@@ -88,6 +88,35 @@ class MDB2_Driver_Datatype_mysql extends MDB2_Driver_Datatype_Common
|
||||
return 'COLLATE '.$collation;
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ getDeclaration()
|
||||
|
||||
/**
|
||||
* Obtain DBMS specific SQL code portion needed to declare
|
||||
* of the given type
|
||||
*
|
||||
* @param string $type type to which the value should be converted to
|
||||
* @param string $name name the field to be declared.
|
||||
* @param string $field definition of the field
|
||||
*
|
||||
* @return string DBMS-specific SQL code portion that should be used to
|
||||
* declare the specified field.
|
||||
* @access public
|
||||
*/
|
||||
function getDeclaration($type, $name, $field)
|
||||
{
|
||||
// MySQL DDL syntax forbids combining NOT NULL with DEFAULT NULL.
|
||||
// To get a default of NULL for NOT NULL columns, omit it.
|
||||
if ( isset($field['notnull'])
|
||||
&& !empty($field['notnull'])
|
||||
&& array_key_exists('default', $field) // do not use isset() here!
|
||||
&& null === $field['default']
|
||||
) {
|
||||
unset($field['default']);
|
||||
}
|
||||
return parent::getDeclaration($type, $name, $field);
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ getTypeDeclaration()
|
||||
|
||||
@@ -116,7 +145,7 @@ class MDB2_Driver_Datatype_mysql extends MDB2_Driver_Datatype_Common
|
||||
*/
|
||||
function getTypeDeclaration($field)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -179,7 +208,15 @@ class MDB2_Driver_Datatype_mysql extends MDB2_Driver_Datatype_Common
|
||||
case 'timestamp':
|
||||
return 'DATETIME';
|
||||
case 'float':
|
||||
return 'DOUBLE';
|
||||
$l = '';
|
||||
if (!empty($field['length'])) {
|
||||
$l = '(' . $field['length'];
|
||||
if (!empty($field['scale'])) {
|
||||
$l .= ',' . $field['scale'];
|
||||
}
|
||||
$l .= ')';
|
||||
}
|
||||
return 'DOUBLE' . $l;
|
||||
case 'decimal':
|
||||
$length = !empty($field['length']) ? $field['length'] : 18;
|
||||
$scale = !empty($field['scale']) ? $field['scale'] : $db->options['decimal_places'];
|
||||
@@ -219,7 +256,7 @@ class MDB2_Driver_Datatype_mysql extends MDB2_Driver_Datatype_Common
|
||||
*/
|
||||
function _getIntegerDeclaration($name, $field)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -236,6 +273,9 @@ class MDB2_Driver_Datatype_mysql extends MDB2_Driver_Datatype_Common
|
||||
|
||||
$notnull = empty($field['notnull']) ? '' : ' NOT NULL';
|
||||
$unsigned = empty($field['unsigned']) ? '' : ' UNSIGNED';
|
||||
if (empty($default) && empty($notnull)) {
|
||||
$default = ' DEFAULT NULL';
|
||||
}
|
||||
$name = $db->quoteIdentifier($name, true);
|
||||
return $name.' '.$this->getTypeDeclaration($field).$unsigned.$default.$notnull.$autoinc;
|
||||
}
|
||||
@@ -308,7 +348,7 @@ class MDB2_Driver_Datatype_mysql extends MDB2_Driver_Datatype_Common
|
||||
*/
|
||||
function _getDecimalDeclaration($name, $field)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -346,24 +386,30 @@ class MDB2_Driver_Datatype_mysql extends MDB2_Driver_Datatype_Common
|
||||
*/
|
||||
function matchPattern($pattern, $operator = null, $field = null)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
|
||||
$match = '';
|
||||
if (!is_null($operator)) {
|
||||
$field = is_null($field) ? '' : $field.' ';
|
||||
if (null !== $operator) {
|
||||
$field = (null === $field) ? '' : $field.' ';
|
||||
$operator = strtoupper($operator);
|
||||
switch ($operator) {
|
||||
// case insensitive
|
||||
case 'ILIKE':
|
||||
$match = $field.'LIKE ';
|
||||
break;
|
||||
case 'NOT ILIKE':
|
||||
$match = $field.'NOT LIKE ';
|
||||
break;
|
||||
// case sensitive
|
||||
case 'LIKE':
|
||||
$match = $field.'LIKE BINARY ';
|
||||
break;
|
||||
case 'NOT LIKE':
|
||||
$match = $field.'NOT LIKE BINARY ';
|
||||
break;
|
||||
default:
|
||||
return $db->raiseError(MDB2_ERROR_UNSUPPORTED, null, null,
|
||||
'not a supported operator type:'. $operator, __FUNCTION__);
|
||||
@@ -504,6 +550,9 @@ class MDB2_Driver_Datatype_mysql extends MDB2_Driver_Datatype_Common
|
||||
case 'real':
|
||||
$type[] = 'float';
|
||||
$unsigned = preg_match('/ unsigned/i', $field['type']);
|
||||
if ($decimal !== false) {
|
||||
$length = $length.','.$decimal;
|
||||
}
|
||||
break;
|
||||
case 'unknown':
|
||||
case 'decimal':
|
||||
@@ -531,7 +580,7 @@ class MDB2_Driver_Datatype_mysql extends MDB2_Driver_Datatype_Common
|
||||
$length = null;
|
||||
break;
|
||||
default:
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
+40
-15
@@ -42,9 +42,9 @@
|
||||
// | Author: Paul Cooper <pgc@ucecom.com> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: pgsql.php,v 1.93 2008/08/28 20:32:57 afz Exp $
|
||||
// $Id$
|
||||
|
||||
oc_require_once('MDB2/Driver/Datatype/Common.php');
|
||||
require_once 'MDB2/Driver/Datatype/Common.php';
|
||||
|
||||
/**
|
||||
* MDB2 PostGreSQL driver
|
||||
@@ -68,7 +68,7 @@ class MDB2_Driver_Datatype_pgsql extends MDB2_Driver_Datatype_Common
|
||||
*/
|
||||
function _baseConvertResult($value, $type, $rtrim = true)
|
||||
{
|
||||
if (is_null($value)) {
|
||||
if (null === $value) {
|
||||
return null;
|
||||
}
|
||||
switch ($type) {
|
||||
@@ -117,7 +117,7 @@ class MDB2_Driver_Datatype_pgsql extends MDB2_Driver_Datatype_Common
|
||||
*/
|
||||
function getTypeDeclaration($field)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -198,7 +198,7 @@ class MDB2_Driver_Datatype_pgsql extends MDB2_Driver_Datatype_Common
|
||||
*/
|
||||
function _getIntegerDeclaration($name, $field)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -219,6 +219,9 @@ class MDB2_Driver_Datatype_pgsql extends MDB2_Driver_Datatype_Common
|
||||
}
|
||||
|
||||
$notnull = empty($field['notnull']) ? '' : ' NOT NULL';
|
||||
if (empty($default) && empty($notnull)) {
|
||||
$default = ' DEFAULT NULL';
|
||||
}
|
||||
$name = $db->quoteIdentifier($name, true);
|
||||
return $name.' '.$this->getTypeDeclaration($field).$default.$notnull;
|
||||
}
|
||||
@@ -239,6 +242,16 @@ class MDB2_Driver_Datatype_pgsql extends MDB2_Driver_Datatype_Common
|
||||
*/
|
||||
function _quoteCLOB($value, $quote, $escape_wildcards)
|
||||
{
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
if ($db->options['lob_allow_url_include']) {
|
||||
$value = $this->_readFile($value);
|
||||
if (PEAR::isError($value)) {
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
return $this->_quoteText($value, $quote, $escape_wildcards);
|
||||
}
|
||||
|
||||
@@ -261,11 +274,17 @@ class MDB2_Driver_Datatype_pgsql extends MDB2_Driver_Datatype_Common
|
||||
if (!$quote) {
|
||||
return $value;
|
||||
}
|
||||
if (version_compare(PHP_VERSION, '5.2.0RC6', '>=')) {
|
||||
$db =& $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
if ($db->options['lob_allow_url_include']) {
|
||||
$value = $this->_readFile($value);
|
||||
if (PEAR::isError($value)) {
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
if (version_compare(PHP_VERSION, '5.2.0RC6', '>=')) {
|
||||
$connection = $db->getConnection();
|
||||
if (PEAR::isError($connection)) {
|
||||
return $connection;
|
||||
@@ -317,24 +336,30 @@ class MDB2_Driver_Datatype_pgsql extends MDB2_Driver_Datatype_Common
|
||||
*/
|
||||
function matchPattern($pattern, $operator = null, $field = null)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
|
||||
$match = '';
|
||||
if (!is_null($operator)) {
|
||||
$field = is_null($field) ? '' : $field.' ';
|
||||
if (null !== $operator) {
|
||||
$field = (null === $field) ? '' : $field.' ';
|
||||
$operator = strtoupper($operator);
|
||||
switch ($operator) {
|
||||
// case insensitive
|
||||
case 'ILIKE':
|
||||
$match = $field.'ILIKE ';
|
||||
break;
|
||||
case 'NOT ILIKE':
|
||||
$match = $field.'NOT ILIKE ';
|
||||
break;
|
||||
// case sensitive
|
||||
case 'LIKE':
|
||||
$match = $field.'LIKE ';
|
||||
break;
|
||||
case 'NOT LIKE':
|
||||
$match = $field.'NOT LIKE ';
|
||||
break;
|
||||
default:
|
||||
return $db->raiseError(MDB2_ERROR_UNSUPPORTED, null, null,
|
||||
'not a supported operator type:'. $operator, __FUNCTION__);
|
||||
@@ -366,7 +391,7 @@ class MDB2_Driver_Datatype_pgsql extends MDB2_Driver_Datatype_Common
|
||||
*/
|
||||
function patternEscapeString()
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -492,7 +517,7 @@ class MDB2_Driver_Datatype_pgsql extends MDB2_Driver_Datatype_Common
|
||||
$length = null;
|
||||
break;
|
||||
default:
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -519,7 +544,7 @@ class MDB2_Driver_Datatype_pgsql extends MDB2_Driver_Datatype_Common
|
||||
*/
|
||||
function mapPrepareDatatype($type)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
+17
-8
@@ -43,10 +43,10 @@
|
||||
// | Author: Lukas Smith <smith@pooteeweet.org> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: sqlite.php,v 1.67 2008/02/22 19:58:06 quipo Exp $
|
||||
// $Id$
|
||||
//
|
||||
|
||||
oc_require_once('MDB2/Driver/Datatype/Common.php');
|
||||
require_once 'MDB2/Driver/Datatype/Common.php';
|
||||
|
||||
/**
|
||||
* MDB2 SQLite driver
|
||||
@@ -101,7 +101,7 @@ class MDB2_Driver_Datatype_sqlite extends MDB2_Driver_Datatype_Common
|
||||
*/
|
||||
function getTypeDeclaration($field)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -199,7 +199,7 @@ class MDB2_Driver_Datatype_sqlite extends MDB2_Driver_Datatype_Common
|
||||
*/
|
||||
function _getIntegerDeclaration($name, $field)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -216,6 +216,9 @@ class MDB2_Driver_Datatype_sqlite extends MDB2_Driver_Datatype_Common
|
||||
|
||||
$notnull = empty($field['notnull']) ? '' : ' NOT NULL';
|
||||
$unsigned = empty($field['unsigned']) ? '' : ' UNSIGNED';
|
||||
if (empty($default) && empty($notnull)) {
|
||||
$default = ' DEFAULT NULL';
|
||||
}
|
||||
$name = $db->quoteIdentifier($name, true);
|
||||
return $name.' '.$this->getTypeDeclaration($field).$unsigned.$default.$notnull.$autoinc;
|
||||
}
|
||||
@@ -237,24 +240,30 @@ class MDB2_Driver_Datatype_sqlite extends MDB2_Driver_Datatype_Common
|
||||
*/
|
||||
function matchPattern($pattern, $operator = null, $field = null)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
|
||||
$match = '';
|
||||
if (!is_null($operator)) {
|
||||
$field = is_null($field) ? '' : $field.' ';
|
||||
if (null !== $operator) {
|
||||
$field = (null === $field) ? '' : $field.' ';
|
||||
$operator = strtoupper($operator);
|
||||
switch ($operator) {
|
||||
// case insensitive
|
||||
case 'ILIKE':
|
||||
$match = $field.'LIKE ';
|
||||
break;
|
||||
case 'NOT ILIKE':
|
||||
$match = $field.'NOT LIKE ';
|
||||
break;
|
||||
// case sensitive
|
||||
case 'LIKE':
|
||||
$match = $field.'LIKE ';
|
||||
break;
|
||||
case 'NOT LIKE':
|
||||
$match = $field.'NOT LIKE ';
|
||||
break;
|
||||
default:
|
||||
return $db->raiseError(MDB2_ERROR_UNSUPPORTED, null, null,
|
||||
'not a supported operator type:'. $operator, __FUNCTION__);
|
||||
@@ -388,7 +397,7 @@ class MDB2_Driver_Datatype_sqlite extends MDB2_Driver_Datatype_Common
|
||||
$length = null;
|
||||
break;
|
||||
default:
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
+9
-9
@@ -42,7 +42,7 @@
|
||||
// | Author: Lukas Smith <smith@pooteeweet.org> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: Common.php,v 1.21 2008/02/17 18:51:39 quipo Exp $
|
||||
// $Id$
|
||||
//
|
||||
|
||||
/**
|
||||
@@ -78,14 +78,14 @@ class MDB2_Driver_Function_Common extends MDB2_Module_Common
|
||||
* @return mixed a result handle or MDB2_OK on success, a MDB2 error on failure
|
||||
* @access public
|
||||
*/
|
||||
function &executeStoredProc($name, $params = null, $types = null, $result_class = true, $result_wrap_class = false)
|
||||
function executeStoredProc($name, $params = null, $types = null, $result_class = true, $result_wrap_class = false)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
|
||||
$error =& $db->raiseError(MDB2_ERROR_UNSUPPORTED, null, null,
|
||||
$error = $db->raiseError(MDB2_ERROR_UNSUPPORTED, null, null,
|
||||
'method not implemented', __FUNCTION__);
|
||||
return $error;
|
||||
}
|
||||
@@ -145,12 +145,12 @@ class MDB2_Driver_Function_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function unixtimestamp($expression)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
|
||||
$error =& $db->raiseError(MDB2_ERROR_UNSUPPORTED, null, null,
|
||||
$error = $db->raiseError(MDB2_ERROR_UNSUPPORTED, null, null,
|
||||
'method not implemented', __FUNCTION__);
|
||||
return $error;
|
||||
}
|
||||
@@ -166,7 +166,7 @@ class MDB2_Driver_Function_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function substring($value, $position = 1, $length = null)
|
||||
{
|
||||
if (!is_null($length)) {
|
||||
if (null !== $length) {
|
||||
return "SUBSTRING($value FROM $position FOR $length)";
|
||||
}
|
||||
return "SUBSTRING($value FROM $position)";
|
||||
@@ -278,12 +278,12 @@ class MDB2_Driver_Function_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function guid()
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
|
||||
$error =& $db->raiseError(MDB2_ERROR_UNSUPPORTED, null, null,
|
||||
$error = $db->raiseError(MDB2_ERROR_UNSUPPORTED, null, null,
|
||||
'method not implemented', __FUNCTION__);
|
||||
return $error;
|
||||
}
|
||||
+4
-4
@@ -42,10 +42,10 @@
|
||||
// | Author: Lukas Smith <smith@pooteeweet.org> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: mysql.php,v 1.12 2008/02/17 18:54:08 quipo Exp $
|
||||
// $Id$
|
||||
//
|
||||
|
||||
oc_require_once('MDB2/Driver/Function/Common.php');
|
||||
require_once 'MDB2/Driver/Function/Common.php';
|
||||
|
||||
/**
|
||||
* MDB2 MySQL driver for the function modules
|
||||
@@ -71,9 +71,9 @@ class MDB2_Driver_Function_mysql extends MDB2_Driver_Function_Common
|
||||
* @return mixed a result handle or MDB2_OK on success, a MDB2 error on failure
|
||||
* @access public
|
||||
*/
|
||||
function &executeStoredProc($name, $params = null, $types = null, $result_class = true, $result_wrap_class = false)
|
||||
function executeStoredProc($name, $params = null, $types = null, $result_class = true, $result_wrap_class = false)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
+21
-4
@@ -42,9 +42,9 @@
|
||||
// | Author: Paul Cooper <pgc@ucecom.com> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: pgsql.php,v 1.11 2008/11/09 19:46:50 quipo Exp $
|
||||
// $Id$
|
||||
|
||||
oc_require_once('MDB2/Driver/Function/Common.php');
|
||||
require_once 'MDB2/Driver/Function/Common.php';
|
||||
|
||||
/**
|
||||
* MDB2 MySQL driver for the function modules
|
||||
@@ -69,9 +69,9 @@ class MDB2_Driver_Function_pgsql extends MDB2_Driver_Function_Common
|
||||
* @return mixed a result handle or MDB2_OK on success, a MDB2 error on failure
|
||||
* @access public
|
||||
*/
|
||||
function &executeStoredProc($name, $params = null, $types = null, $result_class = true, $result_wrap_class = false)
|
||||
function executeStoredProc($name, $params = null, $types = null, $result_class = true, $result_wrap_class = false)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -96,6 +96,23 @@ class MDB2_Driver_Function_pgsql extends MDB2_Driver_Function_Common
|
||||
return 'EXTRACT(EPOCH FROM DATE_TRUNC(\'seconds\', CAST ((' . $expression . ') AS TIMESTAMP)))';
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ substring()
|
||||
|
||||
/**
|
||||
* return string to call a function to get a substring inside an SQL statement
|
||||
*
|
||||
* @return string to call a function to get a substring
|
||||
* @access public
|
||||
*/
|
||||
function substring($value, $position = 1, $length = null)
|
||||
{
|
||||
if (null !== $length) {
|
||||
return "SUBSTRING(CAST($value AS VARCHAR) FROM $position FOR $length)";
|
||||
}
|
||||
return "SUBSTRING(CAST($value AS VARCHAR) FROM $position)";
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ random()
|
||||
|
||||
+7
-7
@@ -42,10 +42,10 @@
|
||||
// | Author: Lukas Smith <smith@pooteeweet.org> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: sqlite.php,v 1.10 2008/02/17 18:54:08 quipo Exp $
|
||||
// $Id$
|
||||
//
|
||||
|
||||
oc_require_once('MDB2/Driver/Function/Common.php');
|
||||
require_once 'MDB2/Driver/Function/Common.php';
|
||||
|
||||
/**
|
||||
* MDB2 SQLite driver for the function modules
|
||||
@@ -116,10 +116,10 @@ class MDB2_Driver_Function_sqlite extends MDB2_Driver_Function_Common
|
||||
*/
|
||||
function substring($value, $position = 1, $length = null)
|
||||
{
|
||||
if (!is_null($length)) {
|
||||
return "substr($value,$position,$length)";
|
||||
if (null !== $length) {
|
||||
return "substr($value, $position, $length)";
|
||||
}
|
||||
return "substr($value,$position,length($value))";
|
||||
return "substr($value, $position, length($value))";
|
||||
}
|
||||
|
||||
// }}}
|
||||
@@ -147,12 +147,12 @@ class MDB2_Driver_Function_sqlite extends MDB2_Driver_Function_Common
|
||||
*/
|
||||
function replace($str, $from_str, $to_str)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
|
||||
$error =& $db->raiseError(MDB2_ERROR_UNSUPPORTED, null, null,
|
||||
$error = $db->raiseError(MDB2_ERROR_UNSUPPORTED, null, null,
|
||||
'method not implemented', __FUNCTION__);
|
||||
return $error;
|
||||
}
|
||||
+61
-37
@@ -43,7 +43,7 @@
|
||||
// | Lorenzo Alberton <l.alberton@quipo.it> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: Common.php,v 1.72 2009/01/14 15:00:40 quipo Exp $
|
||||
// $Id$
|
||||
//
|
||||
|
||||
/**
|
||||
@@ -108,7 +108,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function getFieldDeclarationList($fields)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -140,7 +140,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function _fixSequenceName($sqn, $check = false)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -168,7 +168,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function _fixIndexName($idx)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -195,7 +195,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function createDatabase($database, $options = array())
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -218,7 +218,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function alterDatabase($database, $options = array())
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -239,7 +239,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function dropDatabase($database)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -263,7 +263,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function _getCreateTableQuery($name, $fields, $options = array())
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -356,7 +356,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
|
||||
if (PEAR::isError($query)) {
|
||||
return $query;
|
||||
}
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -379,13 +379,17 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function dropTable($name)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
|
||||
$name = $db->quoteIdentifier($name, true);
|
||||
return $db->exec("DROP TABLE $name");
|
||||
$result = $db->exec("DROP TABLE $name");
|
||||
if (MDB2::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
return MDB2_OK;
|
||||
}
|
||||
|
||||
// }}}
|
||||
@@ -401,13 +405,17 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function truncateTable($name)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
|
||||
$name = $db->quoteIdentifier($name, true);
|
||||
return $db->exec("DELETE FROM $name");
|
||||
$result = $db->exec("DELETE FROM $name");
|
||||
if (MDB2::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
return MDB2_OK;
|
||||
}
|
||||
|
||||
// }}}
|
||||
@@ -429,7 +437,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function vacuum($table = null, $options = array())
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -533,7 +541,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function alterTable($name, $changes, $check)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -553,7 +561,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function listDatabases()
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -573,7 +581,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function listUsers()
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -596,7 +604,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function listViews($database = null)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -617,7 +625,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function listTableViews($table)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -638,7 +646,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function listTableTriggers($table = null)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -658,7 +666,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function listFunctions()
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -681,7 +689,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function listTables($database = null)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -702,7 +710,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function listTableFields($table)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -748,7 +756,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function createIndex($table, $name, $definition)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -761,7 +769,11 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
|
||||
$fields[] = $db->quoteIdentifier($field, true);
|
||||
}
|
||||
$query .= ' ('. implode(', ', $fields) . ')';
|
||||
return $db->exec($query);
|
||||
$result = $db->exec($query);
|
||||
if (MDB2::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
return MDB2_OK;
|
||||
}
|
||||
|
||||
// }}}
|
||||
@@ -777,13 +789,17 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function dropIndex($table, $name)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
|
||||
$name = $db->quoteIdentifier($db->getIndexName($name), true);
|
||||
return $db->exec("DROP INDEX $name");
|
||||
$result = $db->exec("DROP INDEX $name");
|
||||
if (MDB2::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
return MDB2_OK;
|
||||
}
|
||||
|
||||
// }}}
|
||||
@@ -798,7 +814,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function listTableIndexes($table)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -867,7 +883,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function createConstraint($table, $name, $definition)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -895,7 +911,11 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
|
||||
$query .= ' ('. implode(', ', $referenced_fields) . ')';
|
||||
$query .= $this->_getAdvancedFKOptions($definition);
|
||||
}
|
||||
return $db->exec($query);
|
||||
$result = $db->exec($query);
|
||||
if (MDB2::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
return MDB2_OK;
|
||||
}
|
||||
|
||||
// }}}
|
||||
@@ -912,14 +932,18 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function dropConstraint($table, $name, $primary = false)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
|
||||
$table = $db->quoteIdentifier($table, true);
|
||||
$name = $db->quoteIdentifier($db->getIndexName($name), true);
|
||||
return $db->exec("ALTER TABLE $table DROP CONSTRAINT $name");
|
||||
$result = $db->exec("ALTER TABLE $table DROP CONSTRAINT $name");
|
||||
if (MDB2::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
return MDB2_OK;
|
||||
}
|
||||
|
||||
// }}}
|
||||
@@ -934,7 +958,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function listTableConstraints($table)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -956,7 +980,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function createSequence($seq_name, $start = 1)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -977,7 +1001,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function dropSequence($name)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -1000,7 +1024,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function listSequences($database = null)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -1011,4 +1035,4 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
|
||||
|
||||
// }}}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
+91
-52
@@ -42,10 +42,10 @@
|
||||
// | Author: Lukas Smith <smith@pooteeweet.org> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: mysql.php,v 1.113 2008/11/23 20:30:29 quipo Exp $
|
||||
// $Id$
|
||||
//
|
||||
|
||||
oc_require_once('MDB2/Driver/Manager/Common.php');
|
||||
require_once 'MDB2/Driver/Manager/Common.php';
|
||||
|
||||
/**
|
||||
* MDB2 MySQL driver for the management modules
|
||||
@@ -71,7 +71,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function createDatabase($name, $options = array())
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -101,7 +101,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function alterDatabase($name, $options = array())
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -128,7 +128,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function dropDatabase($name)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -204,7 +204,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function createTable($name, $fields, $options = array())
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -222,7 +222,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
|
||||
$autoincrement = $fieldname;
|
||||
}
|
||||
}
|
||||
if (!is_null($autoincrement) && count($pk_fields) > 1) {
|
||||
if ((null !== $autoincrement) && count($pk_fields) > 1) {
|
||||
$options['primary'] = $pk_fields;
|
||||
} else {
|
||||
// the PK constraint is on max one field => OK
|
||||
@@ -235,7 +235,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
|
||||
return $query;
|
||||
}
|
||||
|
||||
if (!is_null($autoincrement)) {
|
||||
if (null !== $autoincrement) {
|
||||
// we have to remove the PK clause added by _getIntegerDeclaration()
|
||||
$query = str_replace('AUTO_INCREMENT PRIMARY KEY', 'AUTO_INCREMENT', $query);
|
||||
}
|
||||
@@ -285,7 +285,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function dropTable($name)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -321,13 +321,17 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function truncateTable($name)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
|
||||
$name = $db->quoteIdentifier($name, true);
|
||||
return $db->exec("TRUNCATE TABLE $name");
|
||||
$result = $db->exec("TRUNCATE TABLE $name");
|
||||
if (MDB2::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
return MDB2_OK;
|
||||
}
|
||||
|
||||
// }}}
|
||||
@@ -349,7 +353,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function vacuum($table = null, $options = array())
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -374,7 +378,10 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
|
||||
return $result;
|
||||
}
|
||||
if (!empty($options['analyze'])) {
|
||||
return $db->exec('ANALYZE TABLE '.$table);
|
||||
$result = $db->exec('ANALYZE TABLE '.$table);
|
||||
if (MDB2::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
return MDB2_OK;
|
||||
}
|
||||
@@ -474,7 +481,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function alterTable($name, $changes, $check)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -561,7 +568,11 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
|
||||
}
|
||||
|
||||
$name = $db->quoteIdentifier($name, true);
|
||||
return $db->exec("ALTER TABLE $name $query");
|
||||
$result = $db->exec("ALTER TABLE $name $query");
|
||||
if (MDB2::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
return MDB2_OK;
|
||||
}
|
||||
|
||||
// }}}
|
||||
@@ -575,7 +586,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function listDatabases()
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -601,7 +612,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function listUsers()
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -620,7 +631,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function listFunctions()
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -653,13 +664,13 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function listTableTriggers($table = null)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
|
||||
$query = 'SHOW TRIGGERS';
|
||||
if (!is_null($table)) {
|
||||
if (null !== $table) {
|
||||
$table = $db->quote($table, 'text');
|
||||
$query .= " LIKE $table";
|
||||
}
|
||||
@@ -685,13 +696,13 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function listTables($database = null)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
|
||||
$query = "SHOW /*!50002 FULL*/ TABLES";
|
||||
if (!is_null($database)) {
|
||||
if (null !== $database) {
|
||||
$query .= " FROM $database";
|
||||
}
|
||||
$query.= "/*!50002 WHERE Table_type = 'BASE TABLE'*/";
|
||||
@@ -725,13 +736,13 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function listViews($database = null)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
|
||||
$query = 'SHOW FULL TABLES';
|
||||
if (!is_null($database)) {
|
||||
if (null !== $database) {
|
||||
$query.= " FROM $database";
|
||||
}
|
||||
$query.= " WHERE Table_type = 'VIEW'";
|
||||
@@ -759,7 +770,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function listTableFields($table)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -815,7 +826,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function createIndex($table, $name, $definition)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -832,7 +843,11 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
|
||||
}
|
||||
}
|
||||
$query .= ' ('. implode(', ', $fields) . ')';
|
||||
return $db->exec($query);
|
||||
$result = $db->exec($query);
|
||||
if (MDB2::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
return MDB2_OK;
|
||||
}
|
||||
|
||||
// }}}
|
||||
@@ -848,14 +863,18 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function dropIndex($table, $name)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
|
||||
$table = $db->quoteIdentifier($table, true);
|
||||
$name = $db->quoteIdentifier($db->getIndexName($name), true);
|
||||
return $db->exec("DROP INDEX $name ON $table");
|
||||
$result = $db->exec("DROP INDEX $name ON $table");
|
||||
if (MDB2::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
return MDB2_OK;
|
||||
}
|
||||
|
||||
// }}}
|
||||
@@ -870,7 +889,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function listTableIndexes($table)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -934,7 +953,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function createConstraint($table, $name, $definition)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -1008,14 +1027,18 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function dropConstraint($table, $name, $primary = false)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
|
||||
if ($primary || strtolower($name) == 'primary') {
|
||||
$query = 'ALTER TABLE '. $db->quoteIdentifier($table, true) .' DROP PRIMARY KEY';
|
||||
return $db->exec($query);
|
||||
$result = $db->exec($query);
|
||||
if (MDB2::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
return MDB2_OK;
|
||||
}
|
||||
|
||||
//is it a FK constraint? If so, also delete the associated triggers
|
||||
@@ -1031,13 +1054,21 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
|
||||
$table = $db->quoteIdentifier($table, true);
|
||||
$name = $db->quoteIdentifier($db->getIndexName($name), true);
|
||||
$query = "ALTER TABLE $table DROP FOREIGN KEY $name";
|
||||
return $db->exec($query);
|
||||
$result = $db->exec($query);
|
||||
if (MDB2::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
return MDB2_OK;
|
||||
}
|
||||
|
||||
$table = $db->quoteIdentifier($table, true);
|
||||
$name = $db->quoteIdentifier($db->getIndexName($name), true);
|
||||
$query = "ALTER TABLE $table DROP INDEX $name";
|
||||
return $db->exec($query);
|
||||
$result = $db->exec($query);
|
||||
if (MDB2::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
return MDB2_OK;
|
||||
}
|
||||
|
||||
// }}}
|
||||
@@ -1058,7 +1089,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function _createFKTriggers($table, $foreign_keys)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -1103,10 +1134,14 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
|
||||
for ($i=0; $i<count($referenced_fields); $i++) {
|
||||
$conditions2[] = 'NEW.'.$referenced_fields[$i] .' <> OLD.'.$referenced_fields[$i];
|
||||
}
|
||||
$restrict_action .= implode(' AND ', $conditions).') IS NOT NULL'
|
||||
.' AND (' .implode(' OR ', $conditions2) .')'
|
||||
.' THEN CALL %s_ON_TABLE_'.$table.'_VIOLATES_FOREIGN_KEY_CONSTRAINT();'
|
||||
.' END IF;';
|
||||
|
||||
$restrict_action .= implode(' AND ', $conditions).') IS NOT NULL';
|
||||
$restrict_action2 = empty($conditions2) ? '' : ' AND (' .implode(' OR ', $conditions2) .')';
|
||||
$restrict_action3 = ' THEN CALL %s_ON_TABLE_'.$table.'_VIOLATES_FOREIGN_KEY_CONSTRAINT();'
|
||||
.' END IF;';
|
||||
|
||||
$restrict_action_update = $restrict_action . $restrict_action2 . $restrict_action3;
|
||||
$restrict_action_delete = $restrict_action . $restrict_action3; // There is no NEW row in on DELETE trigger
|
||||
|
||||
$cascade_action_update = 'UPDATE '.$table_quoted.' SET '.implode(', ', $new_values) .' WHERE '.implode(' AND ', $conditions). ';';
|
||||
$cascade_action_delete = 'DELETE FROM '.$table_quoted.' WHERE '.implode(' AND ', $conditions). ';';
|
||||
@@ -1137,9 +1172,9 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
|
||||
} elseif ('SET DEFAULT' == $fkdef['onupdate']) {
|
||||
$sql_update = sprintf($query, $trigger_names['pk_update'], 'BEFORE UPDATE', 'update') . $setdefault_action;
|
||||
} elseif ('NO ACTION' == $fkdef['onupdate']) {
|
||||
$sql_update = sprintf($query.$restrict_action, $trigger_names['pk_update'], 'AFTER UPDATE', 'update');
|
||||
$sql_update = sprintf($query.$restrict_action_update, $trigger_names['pk_update'], 'AFTER UPDATE', 'update');
|
||||
} elseif ('RESTRICT' == $fkdef['onupdate']) {
|
||||
$sql_update = sprintf($query.$restrict_action, $trigger_names['pk_update'], 'BEFORE UPDATE', 'update');
|
||||
$sql_update = sprintf($query.$restrict_action_update, $trigger_names['pk_update'], 'BEFORE UPDATE', 'update');
|
||||
}
|
||||
if ('CASCADE' == $fkdef['ondelete']) {
|
||||
$sql_delete = sprintf($query, $trigger_names['pk_delete'], 'BEFORE DELETE', 'delete') . $cascade_action_delete;
|
||||
@@ -1148,9 +1183,9 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
|
||||
} elseif ('SET DEFAULT' == $fkdef['ondelete']) {
|
||||
$sql_delete = sprintf($query, $trigger_names['pk_delete'], 'BEFORE DELETE', 'delete') . $setdefault_action;
|
||||
} elseif ('NO ACTION' == $fkdef['ondelete']) {
|
||||
$sql_delete = sprintf($query.$restrict_action, $trigger_names['pk_delete'], 'AFTER DELETE', 'delete');
|
||||
$sql_delete = sprintf($query.$restrict_action_delete, $trigger_names['pk_delete'], 'AFTER DELETE', 'delete');
|
||||
} elseif ('RESTRICT' == $fkdef['ondelete']) {
|
||||
$sql_delete = sprintf($query.$restrict_action, $trigger_names['pk_delete'], 'BEFORE DELETE', 'delete');
|
||||
$sql_delete = sprintf($query.$restrict_action_delete, $trigger_names['pk_delete'], 'BEFORE DELETE', 'delete');
|
||||
}
|
||||
$sql_update .= ' SET FOREIGN_KEY_CHECKS = 1; END;';
|
||||
$sql_delete .= ' SET FOREIGN_KEY_CHECKS = 1; END;';
|
||||
@@ -1198,7 +1233,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function _dropFKTriggers($table, $fkname, $referenced_table)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -1232,7 +1267,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function listTableConstraints($table)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -1307,7 +1342,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function createSequence($seq_name, $start = 1, $options = array())
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -1380,13 +1415,17 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function dropSequence($seq_name)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
|
||||
$sequence_name = $db->quoteIdentifier($db->getSequenceName($seq_name), true);
|
||||
return $db->exec("DROP TABLE $sequence_name");
|
||||
$result = $db->exec("DROP TABLE $sequence_name");
|
||||
if (MDB2::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
return MDB2_OK;
|
||||
}
|
||||
|
||||
// }}}
|
||||
@@ -1401,13 +1440,13 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function listSequences($database = null)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
|
||||
$query = "SHOW TABLES";
|
||||
if (!is_null($database)) {
|
||||
if (null !== $database) {
|
||||
$query .= " FROM $database";
|
||||
}
|
||||
$table_names = $db->queryCol($query);
|
||||
@@ -1429,4 +1468,4 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
|
||||
|
||||
// }}}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
+69
-36
@@ -42,9 +42,9 @@
|
||||
// | Author: Paul Cooper <pgc@ucecom.com> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: pgsql.php,v 1.87 2008/11/29 14:09:59 afz Exp $
|
||||
// $Id$
|
||||
|
||||
oc_require_once('MDB2/Driver/Manager/Common.php');
|
||||
require_once 'MDB2/Driver/Manager/Common.php';
|
||||
|
||||
/**
|
||||
* MDB2 MySQL driver for the management modules
|
||||
@@ -68,7 +68,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function createDatabase($name, $options = array())
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -95,18 +95,24 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function alterDatabase($name, $options = array())
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
|
||||
$query = 'ALTER DATABASE '. $db->quoteIdentifier($name, true);
|
||||
$query = '';
|
||||
if (!empty($options['name'])) {
|
||||
$query .= ' RENAME TO ' . $options['name'];
|
||||
}
|
||||
if (!empty($options['owner'])) {
|
||||
$query .= ' OWNER TO ' . $options['owner'];
|
||||
}
|
||||
|
||||
if (empty($query)) {
|
||||
return MDB2_OK;
|
||||
}
|
||||
|
||||
$query = 'ALTER DATABASE '. $db->quoteIdentifier($name, true) . $query;
|
||||
return $db->standaloneQuery($query, null, true);
|
||||
}
|
||||
|
||||
@@ -122,7 +128,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function dropDatabase($name)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -181,13 +187,17 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function truncateTable($name)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
|
||||
$name = $db->quoteIdentifier($name, true);
|
||||
return $db->exec("TRUNCATE TABLE $name");
|
||||
$result = $db->exec("TRUNCATE TABLE $name");
|
||||
if (MDB2::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
return MDB2_OK;
|
||||
}
|
||||
|
||||
// }}}
|
||||
@@ -209,7 +219,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function vacuum($table = null, $options = array())
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -228,7 +238,11 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
|
||||
if (!empty($table)) {
|
||||
$query .= ' '.$db->quoteIdentifier($table, true);
|
||||
}
|
||||
return $db->exec($query);
|
||||
$result = $db->exec($query);
|
||||
if (MDB2::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
return MDB2_OK;
|
||||
}
|
||||
|
||||
// }}}
|
||||
@@ -326,7 +340,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function alterTable($name, $changes, $check)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -396,6 +410,9 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
|
||||
}
|
||||
$db->loadModule('Datatype', null, true);
|
||||
$type = $db->datatype->getTypeDeclaration($field['definition']);
|
||||
if($type=='SERIAL PRIMARY KEY'){//not correct when altering a table, since serials arent a real type
|
||||
$type='INTEGER';//use integer instead
|
||||
}
|
||||
$query = "ALTER $field_name TYPE $type USING CAST($field_name AS $type)";
|
||||
$result = $db->exec("ALTER TABLE $name $query");
|
||||
if (PEAR::isError($result)) {
|
||||
@@ -409,7 +426,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
if (!empty($field['definition']['notnull'])) {
|
||||
if (array_key_exists('notnull', $field['definition'])) {
|
||||
$query = "ALTER $field_name ".($field['definition']['notnull'] ? 'SET' : 'DROP').' NOT NULL';
|
||||
$result = $db->exec("ALTER TABLE $name $query");
|
||||
if (PEAR::isError($result)) {
|
||||
@@ -441,7 +458,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function listDatabases()
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -474,7 +491,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function listUsers()
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -499,9 +516,9 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
|
||||
* @return mixed array of view names on success, a MDB2 error on failure
|
||||
* @access public
|
||||
*/
|
||||
function listViews()
|
||||
function listViews($database = null)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -532,7 +549,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function listTableViews($table)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -560,7 +577,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function listFunctions()
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -599,7 +616,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function listTableTriggers($table = null)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -608,9 +625,9 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
|
||||
FROM pg_trigger trg,
|
||||
pg_class tbl
|
||||
WHERE trg.tgrelid = tbl.oid';
|
||||
if (!is_null($table)) {
|
||||
if (null !== $table) {
|
||||
$table = $db->quote(strtoupper($table), 'text');
|
||||
$query .= " AND tbl.relname = $table";
|
||||
$query .= " AND UPPER(tbl.relname) = $table";
|
||||
}
|
||||
$result = $db->queryCol($query);
|
||||
if (PEAR::isError($result)) {
|
||||
@@ -631,9 +648,9 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
|
||||
* @return mixed array of table names on success, a MDB2 error on failure
|
||||
* @access public
|
||||
*/
|
||||
function listTables()
|
||||
function listTables($database = null)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -680,7 +697,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function listTableFields($table)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -716,7 +733,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function listTableIndexes($table)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -769,7 +786,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function dropConstraint($table, $name, $primary = false)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -795,11 +812,19 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
|
||||
}
|
||||
|
||||
if (in_array($name, $unique)) {
|
||||
return $db->exec('DROP INDEX '.$db->quoteIdentifier($name, true));
|
||||
$result = $db->exec('DROP INDEX '.$db->quoteIdentifier($name, true));
|
||||
if (MDB2::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
return MDB2_OK;
|
||||
}
|
||||
$idxname = $db->getIndexName($name);
|
||||
if (in_array($idxname, $unique)) {
|
||||
return $db->exec('DROP INDEX '.$db->quoteIdentifier($idxname, true));
|
||||
$result = $db->exec('DROP INDEX '.$db->quoteIdentifier($idxname, true));
|
||||
if (MDB2::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
return MDB2_OK;
|
||||
}
|
||||
return $db->raiseError(MDB2_ERROR_NOT_FOUND, null, null,
|
||||
$name . ' is not an existing constraint for table ' . $table, __FUNCTION__);
|
||||
@@ -817,7 +842,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function listTableConstraints($table)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -882,14 +907,18 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function createSequence($seq_name, $start = 1)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
|
||||
$sequence_name = $db->quoteIdentifier($db->getSequenceName($seq_name), true);
|
||||
return $db->exec("CREATE SEQUENCE $sequence_name INCREMENT 1".
|
||||
$result = $db->exec("CREATE SEQUENCE $sequence_name INCREMENT 1".
|
||||
($start < 1 ? " MINVALUE $start" : '')." START $start");
|
||||
if (MDB2::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
return MDB2_OK;
|
||||
}
|
||||
|
||||
// }}}
|
||||
@@ -904,13 +933,17 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function dropSequence($seq_name)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
|
||||
$sequence_name = $db->quoteIdentifier($db->getSequenceName($seq_name), true);
|
||||
return $db->exec("DROP SEQUENCE $sequence_name");
|
||||
$result = $db->exec("DROP SEQUENCE $sequence_name");
|
||||
if (MDB2::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
return MDB2_OK;
|
||||
}
|
||||
|
||||
// }}}
|
||||
@@ -922,9 +955,9 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
|
||||
* @return mixed array of sequence names on success, a MDB2 error on failure
|
||||
* @access public
|
||||
*/
|
||||
function listSequences()
|
||||
function listSequences($database = null)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -945,4 +978,4 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
+66
-38
@@ -43,10 +43,10 @@
|
||||
// | Lorenzo Alberton <l.alberton@quipo.it> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: sqlite.php,v 1.76 2008/05/31 11:48:48 quipo Exp $
|
||||
// $Id$
|
||||
//
|
||||
|
||||
oc_require_once('MDB2/Driver/Manager/Common.php');
|
||||
require_once 'MDB2/Driver/Manager/Common.php';
|
||||
|
||||
/**
|
||||
* MDB2 SQLite driver for the management modules
|
||||
@@ -71,7 +71,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function createDatabase($name, $options = array())
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -107,7 +107,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function dropDatabase($name)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -174,7 +174,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function _getCreateTableQuery($name, $fields, $options = array())
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -236,7 +236,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common
|
||||
}
|
||||
// create triggers to enforce FOREIGN KEY constraints
|
||||
if (!empty($options['foreign_keys'])) {
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -384,7 +384,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function dropTable($name)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -405,7 +405,11 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common
|
||||
}
|
||||
|
||||
$name = $db->quoteIdentifier($name, true);
|
||||
return $db->exec("DROP TABLE $name");
|
||||
$result = $db->exec("DROP TABLE $name");
|
||||
if (MDB2::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
return MDB2_OK;
|
||||
}
|
||||
|
||||
// }}}
|
||||
@@ -427,7 +431,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function vacuum($table = null, $options = array())
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -436,7 +440,11 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common
|
||||
if (!empty($table)) {
|
||||
$query .= ' '.$db->quoteIdentifier($table, true);
|
||||
}
|
||||
return $db->exec($query);
|
||||
$result = $db->exec($query);
|
||||
if (MDB2::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
return MDB2_OK;
|
||||
}
|
||||
|
||||
// }}}
|
||||
@@ -534,7 +542,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function alterTable($name, $changes, $check, $options = array())
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -687,7 +695,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common
|
||||
$query = 'INSERT INTO '.$db->quoteIdentifier($name_new, true);
|
||||
$query.= '('.implode(', ', array_slice(array_keys($fields), 0, count($select_fields))).')';
|
||||
$query.=' VALUES (?'.str_repeat(', ?', (count($select_fields) - 1)).')';
|
||||
$stmt =& $db->prepare($query, null, MDB2_PREPARE_MANIP);
|
||||
$stmt = $db->prepare($query, null, MDB2_PREPARE_MANIP);
|
||||
if (PEAR::isError($stmt)) {
|
||||
return $stmt;
|
||||
}
|
||||
@@ -712,7 +720,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function listDatabases()
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -732,7 +740,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function listUsers()
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -752,7 +760,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function listViews()
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -780,7 +788,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function listTableViews($table)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -816,7 +824,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function listTables()
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -850,7 +858,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function listTableFields($table)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -898,13 +906,13 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function listTableTriggers($table = null)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
|
||||
$query = "SELECT name FROM sqlite_master WHERE type='trigger' AND sql NOT NULL";
|
||||
if (!is_null($table)) {
|
||||
if (null !== $table) {
|
||||
if ($db->options['portability'] & MDB2_PORTABILITY_FIX_CASE) {
|
||||
$query.= ' AND LOWER(tbl_name)='.$db->quote(strtolower($table), 'text');
|
||||
} else {
|
||||
@@ -958,17 +966,17 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function createIndex($table, $name, $definition)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
|
||||
$table = $db->quoteIdentifier($table, true);
|
||||
$name = $db->getIndexName($name);
|
||||
$name = $db->quoteIdentifier($db->getIndexName($name), true);
|
||||
$query = "CREATE INDEX $name ON $table";
|
||||
$fields = array();
|
||||
foreach ($definition['fields'] as $field_name => $field) {
|
||||
$field_string = $field_name;
|
||||
$field_string = $db->quoteIdentifier($field_name, true);
|
||||
if (!empty($field['sorting'])) {
|
||||
switch ($field['sorting']) {
|
||||
case 'ascending':
|
||||
@@ -982,7 +990,11 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common
|
||||
$fields[] = $field_string;
|
||||
}
|
||||
$query .= ' ('.implode(', ', $fields) . ')';
|
||||
return $db->exec($query);
|
||||
$result = $db->exec($query);
|
||||
if (MDB2::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
return MDB2_OK;
|
||||
}
|
||||
|
||||
// }}}
|
||||
@@ -998,13 +1010,17 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function dropIndex($table, $name)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
|
||||
$name = $db->getIndexName($name);
|
||||
return $db->exec("DROP INDEX $name");
|
||||
$result = $db->exec("DROP INDEX $name");
|
||||
if (MDB2::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
return MDB2_OK;
|
||||
}
|
||||
|
||||
// }}}
|
||||
@@ -1019,7 +1035,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function listTableIndexes($table)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -1080,7 +1096,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function createConstraint($table, $name, $definition)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -1112,7 +1128,11 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common
|
||||
$fields[] = $field_string;
|
||||
}
|
||||
$query .= ' ('.implode(', ', $fields) . ')';
|
||||
return $db->exec($query);
|
||||
$result = $db->exec($query);
|
||||
if (MDB2::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
return MDB2_OK;
|
||||
}
|
||||
|
||||
// }}}
|
||||
@@ -1133,7 +1153,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common
|
||||
return $this->alterTable($table, array(), false, array('primary' => null));
|
||||
}
|
||||
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -1152,7 +1172,11 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common
|
||||
}
|
||||
|
||||
$name = $db->getIndexName($name);
|
||||
return $db->exec("DROP INDEX $name");
|
||||
$result = $db->exec("DROP INDEX $name");
|
||||
if (MDB2::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
return MDB2_OK;
|
||||
}
|
||||
|
||||
// }}}
|
||||
@@ -1170,7 +1194,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function _dropFKTriggers($table, $fkname, $referenced_table)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -1204,7 +1228,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function listTableConstraints($table)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -1274,7 +1298,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function createSequence($seq_name, $start = 1)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -1315,13 +1339,17 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function dropSequence($seq_name)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
|
||||
$sequence_name = $db->quoteIdentifier($db->getSequenceName($seq_name), true);
|
||||
return $db->exec("DROP TABLE $sequence_name");
|
||||
$result = $db->exec("DROP TABLE $sequence_name");
|
||||
if (MDB2::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
return MDB2_OK;
|
||||
}
|
||||
|
||||
// }}}
|
||||
@@ -1335,7 +1363,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common
|
||||
*/
|
||||
function listSequences()
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -1359,4 +1387,4 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common
|
||||
|
||||
// }}}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
@@ -42,7 +42,7 @@
|
||||
// | Author: Lukas Smith <smith@pooteeweet.org> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: Common.php,v 1.2 2007/09/09 13:47:36 quipo Exp $
|
||||
// $Id$
|
||||
//
|
||||
|
||||
/**
|
||||
@@ -42,7 +42,7 @@
|
||||
// | Author: Lukas Smith <smith@pooteeweet.org> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: mysql.php,v 1.9 2006/06/18 21:59:05 lsmith Exp $
|
||||
// $Id$
|
||||
//
|
||||
|
||||
require_once 'MDB2/Driver/Native/Common.php';
|
||||
@@ -42,7 +42,7 @@
|
||||
// | Author: Paul Cooper <pgc@ucecom.com> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: pgsql.php,v 1.12 2006/07/15 13:07:15 lsmith Exp $
|
||||
// $Id$
|
||||
|
||||
require_once 'MDB2/Driver/Native/Common.php';
|
||||
|
||||
@@ -67,7 +67,7 @@ class MDB2_Driver_Native_pgsql extends MDB2_Driver_Native_Common
|
||||
*/
|
||||
function deleteOID($OID)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -42,7 +42,7 @@
|
||||
// | Author: Lukas Smith <smith@pooteeweet.org> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: sqlite.php,v 1.9 2006/06/18 21:59:05 lsmith Exp $
|
||||
// $Id$
|
||||
//
|
||||
|
||||
require_once 'MDB2/Driver/Native/Common.php';
|
||||
+7
-7
@@ -42,7 +42,7 @@
|
||||
// | Author: Lukas Smith <smith@pooteeweet.org> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: Common.php,v 1.43 2009/01/14 15:01:21 quipo Exp $
|
||||
// $Id$
|
||||
//
|
||||
|
||||
/**
|
||||
@@ -107,7 +107,7 @@ class MDB2_Driver_Reverse_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function getTableFieldDefinition($table, $field)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -141,7 +141,7 @@ class MDB2_Driver_Reverse_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function getTableIndexDefinition($table, $index)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -193,7 +193,7 @@ class MDB2_Driver_Reverse_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function getTableConstraintDefinition($table, $index)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -220,7 +220,7 @@ class MDB2_Driver_Reverse_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function getSequenceDefinition($sequence)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -273,7 +273,7 @@ class MDB2_Driver_Reverse_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function getTriggerDefinition($trigger)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -407,7 +407,7 @@ class MDB2_Driver_Reverse_Common extends MDB2_Module_Common
|
||||
*/
|
||||
function tableInfo($result, $mode = null)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
+40
-30
@@ -42,10 +42,10 @@
|
||||
// | Author: Lukas Smith <smith@pooteeweet.org> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: mysql.php,v 1.80 2008/03/26 21:15:37 quipo Exp $
|
||||
// $Id$
|
||||
//
|
||||
|
||||
oc_require_once('MDB2/Driver/Reverse/Common.php');
|
||||
require_once 'MDB2/Driver/Reverse/Common.php';
|
||||
|
||||
/**
|
||||
* MDB2 MySQL driver for the schema reverse engineering module
|
||||
@@ -69,7 +69,7 @@ class MDB2_Driver_Reverse_mysql extends MDB2_Driver_Reverse_Common
|
||||
*/
|
||||
function getTableFieldDefinition($table_name, $field_name)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -113,13 +113,21 @@ class MDB2_Driver_Reverse_mysql extends MDB2_Driver_Reverse_Common
|
||||
$default = false;
|
||||
if (array_key_exists('default', $column)) {
|
||||
$default = $column['default'];
|
||||
if (is_null($default) && $notnull) {
|
||||
if ((null === $default) && $notnull) {
|
||||
$default = '';
|
||||
}
|
||||
}
|
||||
$definition[0] = array(
|
||||
'notnull' => $notnull,
|
||||
'nativetype' => preg_replace('/^([a-z]+)[^a-z].*/i', '\\1', $column['type'])
|
||||
);
|
||||
$autoincrement = false;
|
||||
if (!empty($column['extra']) && $column['extra'] == 'auto_increment') {
|
||||
$autoincrement = true;
|
||||
if (!empty($column['extra'])) {
|
||||
if ($column['extra'] == 'auto_increment') {
|
||||
$autoincrement = true;
|
||||
} else {
|
||||
$definition[0]['extra'] = $column['extra'];
|
||||
}
|
||||
}
|
||||
$collate = null;
|
||||
if (!empty($column['collation'])) {
|
||||
@@ -127,17 +135,13 @@ class MDB2_Driver_Reverse_mysql extends MDB2_Driver_Reverse_Common
|
||||
$charset = preg_replace('/(.+?)(_.+)?/', '$1', $collate);
|
||||
}
|
||||
|
||||
$definition[0] = array(
|
||||
'notnull' => $notnull,
|
||||
'nativetype' => preg_replace('/^([a-z]+)[^a-z].*/i', '\\1', $column['type'])
|
||||
);
|
||||
if (!is_null($length)) {
|
||||
if (null !== $length) {
|
||||
$definition[0]['length'] = $length;
|
||||
}
|
||||
if (!is_null($unsigned)) {
|
||||
if (null !== $unsigned) {
|
||||
$definition[0]['unsigned'] = $unsigned;
|
||||
}
|
||||
if (!is_null($fixed)) {
|
||||
if (null !== $fixed) {
|
||||
$definition[0]['fixed'] = $fixed;
|
||||
}
|
||||
if ($default !== false) {
|
||||
@@ -146,7 +150,7 @@ class MDB2_Driver_Reverse_mysql extends MDB2_Driver_Reverse_Common
|
||||
if ($autoincrement !== false) {
|
||||
$definition[0]['autoincrement'] = $autoincrement;
|
||||
}
|
||||
if (!is_null($collate)) {
|
||||
if (null !== $collate) {
|
||||
$definition[0]['collate'] = $collate;
|
||||
$definition[0]['charset'] = $charset;
|
||||
}
|
||||
@@ -181,7 +185,7 @@ class MDB2_Driver_Reverse_mysql extends MDB2_Driver_Reverse_Common
|
||||
*/
|
||||
function getTableIndexDefinition($table_name, $index_name)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -192,7 +196,7 @@ class MDB2_Driver_Reverse_mysql extends MDB2_Driver_Reverse_Common
|
||||
$query = "SHOW INDEX FROM $table /*!50002 WHERE Key_name = %s */";
|
||||
$index_name_mdb2 = $db->getIndexName($index_name);
|
||||
$result = $db->queryRow(sprintf($query, $db->quote($index_name_mdb2)));
|
||||
if (!PEAR::isError($result) && !is_null($result)) {
|
||||
if (!PEAR::isError($result) && (null !== $result)) {
|
||||
// apply 'idxname_format' only if the query succeeded, otherwise
|
||||
// fallback to the given $index_name, without transformation
|
||||
$index_name = $index_name_mdb2;
|
||||
@@ -256,7 +260,7 @@ class MDB2_Driver_Reverse_mysql extends MDB2_Driver_Reverse_Common
|
||||
*/
|
||||
function getTableConstraintDefinition($table_name, $constraint_name)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -269,7 +273,7 @@ class MDB2_Driver_Reverse_mysql extends MDB2_Driver_Reverse_Common
|
||||
if (strtolower($constraint_name) != 'primary') {
|
||||
$constraint_name_mdb2 = $db->getIndexName($constraint_name);
|
||||
$result = $db->queryRow(sprintf($query, $db->quote($constraint_name_mdb2)));
|
||||
if (!PEAR::isError($result) && !is_null($result)) {
|
||||
if (!PEAR::isError($result) && (null !== $result)) {
|
||||
// apply 'idxname_format' only if the query succeeded, otherwise
|
||||
// fallback to the given $index_name, without transformation
|
||||
$constraint_name = $constraint_name_mdb2;
|
||||
@@ -356,10 +360,16 @@ class MDB2_Driver_Reverse_mysql extends MDB2_Driver_Reverse_Common
|
||||
*/
|
||||
function _getTableFKConstraintDefinition($table, $constraint_name, $definition)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
//Use INFORMATION_SCHEMA instead?
|
||||
//SELECT *
|
||||
// FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS
|
||||
// WHERE CONSTRAINT_SCHEMA = '$dbname'
|
||||
// AND TABLE_NAME = '$table'
|
||||
// AND CONSTRAINT_NAME = '$constraint_name';
|
||||
$query = 'SHOW CREATE TABLE '. $db->escape($table);
|
||||
$constraint = $db->queryOne($query, 'text', 1);
|
||||
if (!PEAR::isError($constraint) && !empty($constraint)) {
|
||||
@@ -372,10 +382,10 @@ class MDB2_Driver_Reverse_mysql extends MDB2_Driver_Reverse_Common
|
||||
}
|
||||
$constraint_name_original = $constraint_name;
|
||||
$constraint_name = $db->getIndexName($constraint_name);
|
||||
$pattern = '/\bCONSTRAINT\s+'.$constraint_name.'\s+FOREIGN KEY\s+\(([^\)]+)\) \bREFERENCES\b ([^ ]+) \(([^\)]+)\)/i';
|
||||
$pattern = '/\bCONSTRAINT\s+'.$constraint_name.'\s+FOREIGN KEY\s+\(([^\)]+)\) \bREFERENCES\b ([^\s]+) \(([^\)]+)\)(?: ON DELETE ([^\s]+))?(?: ON UPDATE ([^\s]+))?/i';
|
||||
if (!preg_match($pattern, str_replace('`', '', $constraint), $matches)) {
|
||||
//fallback to original constraint name
|
||||
$pattern = '/\bCONSTRAINT\s+'.$constraint_name_original.'\s+FOREIGN KEY\s+\(([^\)]+)\) \bREFERENCES\b ([^ ]+) \(([^\)]+)\)/i';
|
||||
$pattern = '/\bCONSTRAINT\s+'.$constraint_name_original.'\s+FOREIGN KEY\s+\(([^\)]+)\) \bREFERENCES\b ([^\s]+) \(([^\)]+)\)(?: ON DELETE ([^\s]+))?(?: ON UPDATE ([^\s]+))?/i';
|
||||
}
|
||||
if (preg_match($pattern, str_replace('`', '', $constraint), $matches)) {
|
||||
$definition['foreign'] = true;
|
||||
@@ -397,8 +407,8 @@ class MDB2_Driver_Reverse_mysql extends MDB2_Driver_Reverse_Common
|
||||
'position' => $colpos++
|
||||
);
|
||||
}
|
||||
$definition['onupdate'] = 'NO ACTION';
|
||||
$definition['ondelete'] = 'NO ACTION';
|
||||
$definition['ondelete'] = empty($matches[4]) ? 'RESTRICT' : strtoupper($matches[4]);
|
||||
$definition['onupdate'] = empty($matches[5]) ? 'RESTRICT' : strtoupper($matches[5]);
|
||||
$definition['match'] = 'SIMPLE';
|
||||
return $definition;
|
||||
}
|
||||
@@ -424,7 +434,7 @@ class MDB2_Driver_Reverse_mysql extends MDB2_Driver_Reverse_Common
|
||||
*/
|
||||
function getTriggerDefinition($trigger)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -476,7 +486,7 @@ class MDB2_Driver_Reverse_mysql extends MDB2_Driver_Reverse_Common
|
||||
return parent::tableInfo($result, $mode);
|
||||
}
|
||||
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -506,11 +516,11 @@ class MDB2_Driver_Reverse_mysql extends MDB2_Driver_Reverse_Common
|
||||
$db->loadModule('Datatype', null, true);
|
||||
for ($i = 0; $i < $count; $i++) {
|
||||
$res[$i] = array(
|
||||
'table' => $case_func(@mysql_field_table($resource, $i)),
|
||||
'name' => $case_func(@mysql_field_name($resource, $i)),
|
||||
'type' => @mysql_field_type($resource, $i),
|
||||
'length' => @mysql_field_len($resource, $i),
|
||||
'flags' => @mysql_field_flags($resource, $i),
|
||||
'table' => $case_func(@mysql_field_table($resource, $i)),
|
||||
'name' => $case_func(@mysql_field_name($resource, $i)),
|
||||
'type' => @mysql_field_type($resource, $i),
|
||||
'length' => @mysql_field_len($resource, $i),
|
||||
'flags' => @mysql_field_flags($resource, $i),
|
||||
);
|
||||
if ($res[$i]['type'] == 'string') {
|
||||
$res[$i]['type'] = 'char';
|
||||
+12
-11
@@ -43,9 +43,9 @@
|
||||
// | Lorenzo Alberton <l.alberton@quipo.it> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: pgsql.php,v 1.75 2008/08/22 16:36:20 quipo Exp $
|
||||
// $Id$
|
||||
|
||||
oc_require_once('MDB2/Driver/Reverse/Common.php');
|
||||
require_once 'MDB2/Driver/Reverse/Common.php';
|
||||
|
||||
/**
|
||||
* MDB2 PostGreSQL driver for the schema reverse engineering module
|
||||
@@ -69,7 +69,7 @@ class MDB2_Driver_Reverse_pgsql extends MDB2_Driver_Reverse_Common
|
||||
*/
|
||||
function getTableFieldDefinition($table_name, $field_name)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -143,11 +143,12 @@ class MDB2_Driver_Reverse_pgsql extends MDB2_Driver_Reverse_Common
|
||||
}
|
||||
$default = null;
|
||||
if ($column['atthasdef'] === 't'
|
||||
&& strpos($column['default'], 'NULL') !== 0
|
||||
&& !preg_match("/nextval\('([^']+)'/", $column['default'])
|
||||
) {
|
||||
$pattern = '/^\'(.*)\'::[\w ]+$/i';
|
||||
$default = $column['default'];#substr($column['adsrc'], 1, -1);
|
||||
if (is_null($default) && $notnull) {
|
||||
if ((null === $default) && $notnull) {
|
||||
$default = '';
|
||||
} elseif (!empty($default) && preg_match($pattern, $default)) {
|
||||
//remove data type cast
|
||||
@@ -159,13 +160,13 @@ class MDB2_Driver_Reverse_pgsql extends MDB2_Driver_Reverse_Common
|
||||
$autoincrement = true;
|
||||
}
|
||||
$definition[0] = array('notnull' => $notnull, 'nativetype' => $column['type']);
|
||||
if (!is_null($length)) {
|
||||
if (null !== $length) {
|
||||
$definition[0]['length'] = $length;
|
||||
}
|
||||
if (!is_null($unsigned)) {
|
||||
if (null !== $unsigned) {
|
||||
$definition[0]['unsigned'] = $unsigned;
|
||||
}
|
||||
if (!is_null($fixed)) {
|
||||
if (null !== $fixed) {
|
||||
$definition[0]['fixed'] = $fixed;
|
||||
}
|
||||
if ($default !== false) {
|
||||
@@ -198,7 +199,7 @@ class MDB2_Driver_Reverse_pgsql extends MDB2_Driver_Reverse_Common
|
||||
*/
|
||||
function getTableIndexDefinition($table_name, $index_name)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -256,7 +257,7 @@ class MDB2_Driver_Reverse_pgsql extends MDB2_Driver_Reverse_Common
|
||||
*/
|
||||
function getTableConstraintDefinition($table_name, $constraint_name)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -443,7 +444,7 @@ class MDB2_Driver_Reverse_pgsql extends MDB2_Driver_Reverse_Common
|
||||
*/
|
||||
function getTriggerDefinition($trigger)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -517,7 +518,7 @@ class MDB2_Driver_Reverse_pgsql extends MDB2_Driver_Reverse_Common
|
||||
return parent::tableInfo($result, $mode);
|
||||
}
|
||||
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
+26
-24
@@ -43,10 +43,10 @@
|
||||
// | Lorenzo Alberton <l.alberton@quipo.it> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: sqlite.php,v 1.80 2008/05/03 10:30:14 quipo Exp $
|
||||
// $Id$
|
||||
//
|
||||
|
||||
oc_require_once('MDB2/Driver/Reverse/Common.php');
|
||||
require_once 'MDB2/Driver/Reverse/Common.php';
|
||||
|
||||
/**
|
||||
* MDB2 SQlite driver for the schema reverse engineering module
|
||||
@@ -63,7 +63,7 @@ class MDB2_Driver_Reverse_sqlite extends MDB2_Driver_Reverse_Common
|
||||
* @access private
|
||||
*/
|
||||
function _removeComments($sql) {
|
||||
$lines = split("\n", $sql);
|
||||
$lines = explode("\n", $sql);
|
||||
foreach ($lines as $k => $line) {
|
||||
$pieces = explode('--', $line);
|
||||
if (count($pieces) > 1 && (substr_count($pieces[0], '\'') % 2) == 0) {
|
||||
@@ -78,7 +78,7 @@ class MDB2_Driver_Reverse_sqlite extends MDB2_Driver_Reverse_Common
|
||||
*/
|
||||
function _getTableColumns($sql)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -88,14 +88,14 @@ class MDB2_Driver_Reverse_sqlite extends MDB2_Driver_Reverse_Common
|
||||
// replace the decimal length-places-separator with a colon
|
||||
$column_def = preg_replace('/(\d),(\d)/', '\1:\2', $column_def);
|
||||
$column_def = $this->_removeComments($column_def);
|
||||
$column_sql = split(',', $column_def);
|
||||
$column_sql = explode(',', $column_def);
|
||||
$columns = array();
|
||||
$count = count($column_sql);
|
||||
if ($count == 0) {
|
||||
return $db->raiseError(MDB2_ERROR_UNSUPPORTED, null, null,
|
||||
'unexpected empty table column definition list', __FUNCTION__);
|
||||
}
|
||||
$regexp = '/^\s*([^\s]+) +(CHAR|VARCHAR|VARCHAR2|TEXT|BOOLEAN|SMALLINT|INT|INTEGER|DECIMAL|BIGINT|DOUBLE|FLOAT|DATETIME|DATE|TIME|LONGTEXT|LONGBLOB)( ?\(([1-9][0-9]*)(:([1-9][0-9]*))?\))?( NULL| NOT NULL)?( UNSIGNED)?( NULL| NOT NULL)?( PRIMARY KEY)?( DEFAULT (\'[^\']*\'|[^ ]+))?( NULL| NOT NULL)?( PRIMARY KEY)?(\s*\-\-.*)?$/i';
|
||||
$regexp = '/^\s*([^\s]+) +(CHAR|VARCHAR|VARCHAR2|TEXT|BOOLEAN|SMALLINT|INT|INTEGER|DECIMAL|TINYINT|BIGINT|DOUBLE|FLOAT|DATETIME|DATE|TIME|LONGTEXT|LONGBLOB)( ?\(([1-9][0-9]*)(:([1-9][0-9]*))?\))?( NULL| NOT NULL)?( UNSIGNED)?( NULL| NOT NULL)?( PRIMARY KEY)?( DEFAULT (\'[^\']*\'|[^ ]+))?( NULL| NOT NULL)?( PRIMARY KEY)?(\s*\-\-.*)?$/i';
|
||||
$regexp2 = '/^\s*([^ ]+) +(PRIMARY|UNIQUE|CHECK)$/i';
|
||||
for ($i=0, $j=0; $i<$count; ++$i) {
|
||||
if (!preg_match($regexp, trim($column_sql[$i]), $matches)) {
|
||||
@@ -128,6 +128,8 @@ class MDB2_Driver_Reverse_sqlite extends MDB2_Driver_Reverse_Common
|
||||
$default = null;
|
||||
}
|
||||
$columns[$j]['default'] = $default;
|
||||
} else {
|
||||
$columns[$j]['default'] = null;
|
||||
}
|
||||
if (isset($matches[7]) && strlen($matches[7])) {
|
||||
$columns[$j]['notnull'] = ($matches[7] === ' NOT NULL');
|
||||
@@ -156,11 +158,11 @@ class MDB2_Driver_Reverse_sqlite extends MDB2_Driver_Reverse_Common
|
||||
*/
|
||||
function getTableFieldDefinition($table_name, $field_name)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
|
||||
|
||||
list($schema, $table) = $this->splitTableSchema($table_name);
|
||||
|
||||
$result = $db->loadModule('Datatype', null, true);
|
||||
@@ -201,7 +203,7 @@ class MDB2_Driver_Reverse_sqlite extends MDB2_Driver_Reverse_Common
|
||||
$default = false;
|
||||
if (array_key_exists('default', $column)) {
|
||||
$default = $column['default'];
|
||||
if (is_null($default) && $notnull) {
|
||||
if ((null === $default) && $notnull) {
|
||||
$default = '';
|
||||
}
|
||||
}
|
||||
@@ -214,13 +216,13 @@ class MDB2_Driver_Reverse_sqlite extends MDB2_Driver_Reverse_Common
|
||||
'notnull' => $notnull,
|
||||
'nativetype' => preg_replace('/^([a-z]+)[^a-z].*/i', '\\1', $column['type'])
|
||||
);
|
||||
if (!is_null($length)) {
|
||||
if (null !== $length) {
|
||||
$definition[0]['length'] = $length;
|
||||
}
|
||||
if (!is_null($unsigned)) {
|
||||
if (null !== $unsigned) {
|
||||
$definition[0]['unsigned'] = $unsigned;
|
||||
}
|
||||
if (!is_null($fixed)) {
|
||||
if (null !== $fixed) {
|
||||
$definition[0]['fixed'] = $fixed;
|
||||
}
|
||||
if ($default !== false) {
|
||||
@@ -258,11 +260,11 @@ class MDB2_Driver_Reverse_sqlite extends MDB2_Driver_Reverse_Common
|
||||
*/
|
||||
function getTableIndexDefinition($table_name, $index_name)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
|
||||
|
||||
list($schema, $table) = $this->splitTableSchema($table_name);
|
||||
|
||||
$query = "SELECT sql FROM sqlite_master WHERE type='index' AND ";
|
||||
@@ -300,7 +302,7 @@ class MDB2_Driver_Reverse_sqlite extends MDB2_Driver_Reverse_Common
|
||||
$start_pos = strpos($sql, '(');
|
||||
$end_pos = strrpos($sql, ')');
|
||||
$column_names = substr($sql, $start_pos+1, $end_pos-$start_pos-1);
|
||||
$column_names = split(',', $column_names);
|
||||
$column_names = explode(',', $column_names);
|
||||
|
||||
if (preg_match("/^create unique/", $sql)) {
|
||||
return $db->raiseError(MDB2_ERROR_NOT_FOUND, null, null,
|
||||
@@ -341,11 +343,11 @@ class MDB2_Driver_Reverse_sqlite extends MDB2_Driver_Reverse_Common
|
||||
*/
|
||||
function getTableConstraintDefinition($table_name, $constraint_name)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
|
||||
|
||||
list($schema, $table) = $this->splitTableSchema($table_name);
|
||||
|
||||
$query = "SELECT sql FROM sqlite_master WHERE type='index' AND ";
|
||||
@@ -408,7 +410,7 @@ class MDB2_Driver_Reverse_sqlite extends MDB2_Driver_Reverse_Common
|
||||
if (preg_match("/\bPRIMARY\s+KEY\b\s*\(([^)]+)/i", $sql, $tmp)) {
|
||||
$definition['primary'] = true;
|
||||
$definition['fields'] = array();
|
||||
$column_names = split(',', $tmp[1]);
|
||||
$column_names = explode(',', $tmp[1]);
|
||||
$colpos = 1;
|
||||
foreach ($column_names as $column_name) {
|
||||
$definition['fields'][trim($column_name)] = array(
|
||||
@@ -420,7 +422,7 @@ class MDB2_Driver_Reverse_sqlite extends MDB2_Driver_Reverse_Common
|
||||
if (preg_match("/\"([^\"]+)\"[^\,\"]+\bPRIMARY\s+KEY\b[^\,\)]*/i", $sql, $tmp)) {
|
||||
$definition['primary'] = true;
|
||||
$definition['fields'] = array();
|
||||
$column_names = split(',', $tmp[1]);
|
||||
$column_names = explode(',', $tmp[1]);
|
||||
$colpos = 1;
|
||||
foreach ($column_names as $column_name) {
|
||||
$definition['fields'][trim($column_name)] = array(
|
||||
@@ -450,14 +452,14 @@ class MDB2_Driver_Reverse_sqlite extends MDB2_Driver_Reverse_Common
|
||||
$definition['onupdate'] = 'NO ACTION';
|
||||
$definition['ondelete'] = 'NO ACTION';
|
||||
$definition['references']['table'] = $tmp[2];
|
||||
$column_names = split(',', $tmp[1]);
|
||||
$column_names = explode(',', $tmp[1]);
|
||||
$colpos = 1;
|
||||
foreach ($column_names as $column_name) {
|
||||
$definition['fields'][trim($column_name)] = array(
|
||||
'position' => $colpos++
|
||||
);
|
||||
}
|
||||
$referenced_cols = split(',', $tmp[3]);
|
||||
$referenced_cols = explode(',', $tmp[3]);
|
||||
$colpos = 1;
|
||||
foreach ($referenced_cols as $column_name) {
|
||||
$definition['references']['fields'][trim($column_name)] = array(
|
||||
@@ -487,7 +489,7 @@ class MDB2_Driver_Reverse_sqlite extends MDB2_Driver_Reverse_Common
|
||||
$start_pos = strpos($sql, '(');
|
||||
$end_pos = strrpos($sql, ')');
|
||||
$column_names = substr($sql, $start_pos+1, $end_pos-$start_pos-1);
|
||||
$column_names = split(',', $column_names);
|
||||
$column_names = explode(',', $column_names);
|
||||
|
||||
if (!preg_match("/^create unique/", $sql)) {
|
||||
return $db->raiseError(MDB2_ERROR_NOT_FOUND, null, null,
|
||||
@@ -532,7 +534,7 @@ class MDB2_Driver_Reverse_sqlite extends MDB2_Driver_Reverse_Common
|
||||
*/
|
||||
function getTriggerDefinition($trigger)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -596,7 +598,7 @@ class MDB2_Driver_Reverse_sqlite extends MDB2_Driver_Reverse_Common
|
||||
return parent::tableInfo($result, $mode);
|
||||
}
|
||||
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
+87
-58
@@ -43,7 +43,7 @@
|
||||
// | Author: Lukas Smith <smith@pooteeweet.org> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: mysql.php,v 1.214 2008/11/16 21:45:08 quipo Exp $
|
||||
// $Id$
|
||||
//
|
||||
|
||||
/**
|
||||
@@ -57,21 +57,30 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
|
||||
{
|
||||
// {{{ properties
|
||||
|
||||
var $string_quoting = array('start' => "'", 'end' => "'", 'escape' => '\\', 'escape_pattern' => '\\');
|
||||
public $string_quoting = array(
|
||||
'start' => "'",
|
||||
'end' => "'",
|
||||
'escape' => '\\',
|
||||
'escape_pattern' => '\\',
|
||||
);
|
||||
|
||||
var $identifier_quoting = array('start' => '`', 'end' => '`', 'escape' => '`');
|
||||
public $identifier_quoting = array(
|
||||
'start' => '`',
|
||||
'end' => '`',
|
||||
'escape' => '`',
|
||||
);
|
||||
|
||||
var $sql_comments = array(
|
||||
public $sql_comments = array(
|
||||
array('start' => '-- ', 'end' => "\n", 'escape' => false),
|
||||
array('start' => '#', 'end' => "\n", 'escape' => false),
|
||||
array('start' => '/*', 'end' => '*/', 'escape' => false),
|
||||
);
|
||||
|
||||
var $server_capabilities_checked = false;
|
||||
protected $server_capabilities_checked = false;
|
||||
|
||||
var $start_transaction = false;
|
||||
protected $start_transaction = false;
|
||||
|
||||
var $varchar_max_length = 255;
|
||||
protected $varchar_max_length = 255;
|
||||
|
||||
// }}}
|
||||
// {{{ constructor
|
||||
@@ -117,7 +126,7 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
|
||||
|
||||
// }}}
|
||||
// {{{ _reCheckSupportedOptions()
|
||||
|
||||
|
||||
/**
|
||||
* If the user changes certain options, other capabilities may depend
|
||||
* on the new settings, so we need to check them (again).
|
||||
@@ -338,7 +347,7 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
|
||||
register_shutdown_function('MDB2_closeOpenTransactions');
|
||||
}
|
||||
$query = $this->start_transaction ? 'START TRANSACTION' : 'SET AUTOCOMMIT = 0';
|
||||
$result =& $this->_doQuery($query, true);
|
||||
$result = $this->_doQuery($query, true);
|
||||
if (PEAR::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
@@ -385,13 +394,13 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
|
||||
'transactions are not supported', __FUNCTION__);
|
||||
}
|
||||
|
||||
$result =& $this->_doQuery('COMMIT', true);
|
||||
$result = $this->_doQuery('COMMIT', true);
|
||||
if (PEAR::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
if (!$this->start_transaction) {
|
||||
$query = 'SET AUTOCOMMIT = 1';
|
||||
$result =& $this->_doQuery($query, true);
|
||||
$result = $this->_doQuery($query, true);
|
||||
if (PEAR::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
@@ -431,13 +440,13 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
|
||||
}
|
||||
|
||||
$query = 'ROLLBACK';
|
||||
$result =& $this->_doQuery($query, true);
|
||||
$result = $this->_doQuery($query, true);
|
||||
if (PEAR::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
if (!$this->start_transaction) {
|
||||
$query = 'SET AUTOCOMMIT = 1';
|
||||
$result =& $this->_doQuery($query, true);
|
||||
$result = $this->_doQuery($query, true);
|
||||
if (PEAR::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
@@ -457,12 +466,16 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
|
||||
* READ COMMITTED (prevents dirty reads)
|
||||
* REPEATABLE READ (prevents nonrepeatable reads)
|
||||
* SERIALIZABLE (prevents phantom reads)
|
||||
* @param array some transaction options:
|
||||
* 'wait' => 'WAIT' | 'NO WAIT'
|
||||
* 'rw' => 'READ WRITE' | 'READ ONLY'
|
||||
*
|
||||
* @return mixed MDB2_OK on success, a MDB2 error on failure
|
||||
*
|
||||
* @access public
|
||||
* @since 2.1.1
|
||||
*/
|
||||
function setTransactionIsolation($isolation)
|
||||
function setTransactionIsolation($isolation, $options = array())
|
||||
{
|
||||
$this->debug('Setting transaction isolation level', __FUNCTION__, array('is_manip' => true));
|
||||
if (!$this->supports('transactions')) {
|
||||
@@ -501,14 +514,14 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
|
||||
}
|
||||
|
||||
$params = array();
|
||||
if ($this->dsn['protocol'] && $this->dsn['protocol'] == 'unix') {
|
||||
$params[0] = ':' . $this->dsn['socket'];
|
||||
$unix = ($this->dsn['protocol'] && $this->dsn['protocol'] == 'unix');
|
||||
if (empty($this->dsn['hostspec'])) {
|
||||
$this->dsn['hostspec'] = $unix ? '' : 'localhost';
|
||||
}
|
||||
if ($this->dsn['hostspec']) {
|
||||
$params[0] = $this->dsn['hostspec'] . ($this->dsn['port'] ? ':' . $this->dsn['port'] : '');
|
||||
} else {
|
||||
$params[0] = $this->dsn['hostspec'] ? $this->dsn['hostspec']
|
||||
: 'localhost';
|
||||
if ($this->dsn['port']) {
|
||||
$params[0].= ':' . $this->dsn['port'];
|
||||
}
|
||||
$params[0] = ':' . $this->dsn['socket'];
|
||||
}
|
||||
$params[] = $username ? $username : null;
|
||||
$params[] = $password ? $password : null;
|
||||
@@ -626,7 +639,7 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
|
||||
$client_info = mysql_get_client_info();
|
||||
if (function_exists('mysql_set_charset') && version_compare($client_info, '5.0.6')) {
|
||||
if (!$result = mysql_set_charset($charset, $connection)) {
|
||||
$err =& $this->raiseError(null, null, null,
|
||||
$err = $this->raiseError(null, null, null,
|
||||
'Could not set client character set', __FUNCTION__);
|
||||
return $err;
|
||||
}
|
||||
@@ -634,7 +647,7 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
|
||||
}
|
||||
$query = "SET NAMES '".mysql_real_escape_string($charset, $connection)."'";
|
||||
if (!is_null($collation)) {
|
||||
$query .= " COLLATE '".mysqli_real_escape_string($connection, $collation)."'";
|
||||
$query .= " COLLATE '".mysql_real_escape_string($collation, $connection)."'";
|
||||
}
|
||||
return $this->_doQuery($query, true, $connection);
|
||||
}
|
||||
@@ -709,7 +722,7 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
|
||||
// }}}
|
||||
// {{{ standaloneQuery()
|
||||
|
||||
/**
|
||||
/**
|
||||
* execute a query as DBA
|
||||
*
|
||||
* @param string $query the SQL query
|
||||
@@ -719,7 +732,7 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
|
||||
* @return mixed MDB2_OK on success, a MDB2 error on failure
|
||||
* @access public
|
||||
*/
|
||||
function &standaloneQuery($query, $types = null, $is_manip = false)
|
||||
function standaloneQuery($query, $types = null, $is_manip = false)
|
||||
{
|
||||
$user = $this->options['DBA_username']? $this->options['DBA_username'] : $this->dsn['username'];
|
||||
$pass = $this->options['DBA_password']? $this->options['DBA_password'] : $this->dsn['password'];
|
||||
@@ -732,8 +745,8 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
|
||||
$limit = $this->limit;
|
||||
$this->offset = $this->limit = 0;
|
||||
$query = $this->_modifyQuery($query, $is_manip, $limit, $offset);
|
||||
|
||||
$result =& $this->_doQuery($query, $is_manip, $connection, $this->database_name);
|
||||
|
||||
$result = $this->_doQuery($query, $is_manip, $connection, $this->database_name);
|
||||
if (!PEAR::isError($result)) {
|
||||
$result = $this->_affectedRows($connection, $result);
|
||||
}
|
||||
@@ -754,7 +767,7 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
|
||||
* @return result or error object
|
||||
* @access protected
|
||||
*/
|
||||
function &_doQuery($query, $is_manip = false, $connection = null, $database_name = null)
|
||||
function _doQuery($query, $is_manip = false, $connection = null, $database_name = null)
|
||||
{
|
||||
$this->last_query = $query;
|
||||
$result = $this->debug($query, 'query', array('is_manip' => $is_manip, 'when' => 'pre'));
|
||||
@@ -793,8 +806,8 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
|
||||
$function = $this->options['result_buffering']
|
||||
? 'mysql_query' : 'mysql_unbuffered_query';
|
||||
$result = @$function($query, $connection);
|
||||
if (!$result) {
|
||||
$err =& $this->raiseError(null, null, null,
|
||||
if (!$result && 0 !== mysql_errno($connection)) {
|
||||
$err = $this->raiseError(null, null, null,
|
||||
'Could not execute statement', __FUNCTION__);
|
||||
return $err;
|
||||
}
|
||||
@@ -945,7 +958,7 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
|
||||
$this->supported['triggers'] = false;
|
||||
$this->start_transaction = false;
|
||||
$this->varchar_max_length = 255;
|
||||
|
||||
|
||||
$server_info = $this->getServerVersion();
|
||||
if (is_array($server_info)) {
|
||||
$server_version = $server_info['major'].'.'.$server_info['minor'].'.'.$server_info['patch'];
|
||||
@@ -983,7 +996,7 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
|
||||
// {{{ function _skipUserDefinedVariable($query, $position)
|
||||
|
||||
/**
|
||||
* Utility method, used by prepare() to avoid misinterpreting MySQL user
|
||||
* Utility method, used by prepare() to avoid misinterpreting MySQL user
|
||||
* defined variables (SELECT @x:=5) for placeholders.
|
||||
* Check if the placeholder is a false positive, i.e. if it is an user defined
|
||||
* variable instead. If so, skip it and advance the position, otherwise
|
||||
@@ -1032,13 +1045,18 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
|
||||
* @access public
|
||||
* @see bindParam, execute
|
||||
*/
|
||||
function &prepare($query, $types = null, $result_types = null, $lobs = array())
|
||||
function prepare($query, $types = null, $result_types = null, $lobs = array())
|
||||
{
|
||||
// connect to get server capabilities (http://pear.php.net/bugs/16147)
|
||||
$connection = $this->getConnection();
|
||||
if (PEAR::isError($connection)) {
|
||||
return $connection;
|
||||
}
|
||||
|
||||
if ($this->options['emulate_prepared']
|
||||
|| $this->supported['prepared_statements'] !== true
|
||||
) {
|
||||
$obj =& parent::prepare($query, $types, $result_types, $lobs);
|
||||
return $obj;
|
||||
return parent::prepare($query, $types, $result_types, $lobs);
|
||||
}
|
||||
$is_manip = ($result_types === MDB2_PREPARE_MANIP);
|
||||
$offset = $this->offset;
|
||||
@@ -1072,7 +1090,7 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
|
||||
if (is_null($placeholder_type)) {
|
||||
$placeholder_type_guess = $query[$p_position];
|
||||
}
|
||||
|
||||
|
||||
$new_pos = $this->_skipDelimitedStrings($query, $position, $p_position);
|
||||
if (PEAR::isError($new_pos)) {
|
||||
return $new_pos;
|
||||
@@ -1081,7 +1099,7 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
|
||||
$position = $new_pos;
|
||||
continue; //evaluate again starting from the new position
|
||||
}
|
||||
|
||||
|
||||
//make sure this is not part of an user defined variable
|
||||
$new_pos = $this->_skipUserDefinedVariable($query, $position);
|
||||
if ($new_pos != $position) {
|
||||
@@ -1098,7 +1116,7 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
|
||||
$regexp = '/^.{'.($position+1).'}('.$this->options['bindname_format'].').*$/s';
|
||||
$parameter = preg_replace($regexp, '\\1', $query);
|
||||
if ($parameter === '') {
|
||||
$err =& $this->raiseError(MDB2_ERROR_SYNTAX, null, null,
|
||||
$err = $this->raiseError(MDB2_ERROR_SYNTAX, null, null,
|
||||
'named parameter name must match "bindname_format" option', __FUNCTION__);
|
||||
return $err;
|
||||
}
|
||||
@@ -1112,15 +1130,12 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
|
||||
$position = $p_position;
|
||||
}
|
||||
}
|
||||
$connection = $this->getConnection();
|
||||
if (PEAR::isError($connection)) {
|
||||
return $connection;
|
||||
}
|
||||
|
||||
static $prep_statement_counter = 1;
|
||||
$statement_name = sprintf($this->options['statement_format'], $this->phptype, $prep_statement_counter++ . sha1(microtime() + mt_rand()));
|
||||
$statement_name = substr(strtolower($statement_name), 0, $this->options['max_identifiers_length']);
|
||||
$query = "PREPARE $statement_name FROM ".$this->quote($query, 'text');
|
||||
$statement =& $this->_doQuery($query, true, $connection);
|
||||
$statement = $this->_doQuery($query, true, $connection);
|
||||
if (PEAR::isError($statement)) {
|
||||
return $statement;
|
||||
}
|
||||
@@ -1240,7 +1255,7 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
|
||||
|
||||
$table = $this->quoteIdentifier($table, true);
|
||||
$query = "REPLACE INTO $table ($query) VALUES ($values)";
|
||||
$result =& $this->_doQuery($query, true, $connection);
|
||||
$result = $this->_doQuery($query, true, $connection);
|
||||
if (PEAR::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
@@ -1268,7 +1283,7 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
|
||||
$query = "INSERT INTO $sequence_name ($seqcol_name) VALUES (NULL)";
|
||||
$this->pushErrorHandling(PEAR_ERROR_RETURN);
|
||||
$this->expectError(MDB2_ERROR_NOSUCHTABLE);
|
||||
$result =& $this->_doQuery($query, true);
|
||||
$result = $this->_doQuery($query, true);
|
||||
$this->popExpect();
|
||||
$this->popErrorHandling();
|
||||
if (PEAR::isError($result)) {
|
||||
@@ -1287,7 +1302,7 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
|
||||
$value = $this->lastInsertID();
|
||||
if (is_numeric($value)) {
|
||||
$query = "DELETE FROM $sequence_name WHERE $seqcol_name < $value";
|
||||
$result =& $this->_doQuery($query, true);
|
||||
$result = $this->_doQuery($query, true);
|
||||
if (PEAR::isError($result)) {
|
||||
$this->warnings[] = 'nextID: could not delete previous sequence table values from '.$seq_name;
|
||||
}
|
||||
@@ -1310,7 +1325,8 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
|
||||
function lastInsertID($table = null, $field = null)
|
||||
{
|
||||
// not using mysql_insert_id() due to http://pear.php.net/bugs/bug.php?id=8051
|
||||
return $this->queryOne('SELECT LAST_INSERT_ID()', 'integer');
|
||||
// not casting to integer to handle BIGINT http://pear.php.net/bugs/bug.php?id=17650
|
||||
return $this->queryOne('SELECT LAST_INSERT_ID()');
|
||||
}
|
||||
|
||||
// }}}
|
||||
@@ -1352,7 +1368,7 @@ class MDB2_Result_mysql extends MDB2_Result_Common
|
||||
* @return int data array on success, a MDB2 error on failure
|
||||
* @access public
|
||||
*/
|
||||
function &fetchRow($fetchmode = MDB2_FETCHMODE_DEFAULT, $rownum = null)
|
||||
function fetchRow($fetchmode = MDB2_FETCHMODE_DEFAULT, $rownum = null)
|
||||
{
|
||||
if (!is_null($rownum)) {
|
||||
$seek = $this->seek($rownum);
|
||||
@@ -1363,7 +1379,9 @@ class MDB2_Result_mysql extends MDB2_Result_Common
|
||||
if ($fetchmode == MDB2_FETCHMODE_DEFAULT) {
|
||||
$fetchmode = $this->db->fetchmode;
|
||||
}
|
||||
if ($fetchmode & MDB2_FETCHMODE_ASSOC) {
|
||||
if ( $fetchmode == MDB2_FETCHMODE_ASSOC
|
||||
|| $fetchmode == MDB2_FETCHMODE_OBJECT
|
||||
) {
|
||||
$row = @mysql_fetch_assoc($this->result);
|
||||
if (is_array($row)
|
||||
&& $this->db->options['portability'] & MDB2_PORTABILITY_FIX_CASE
|
||||
@@ -1376,12 +1394,11 @@ class MDB2_Result_mysql extends MDB2_Result_Common
|
||||
|
||||
if (!$row) {
|
||||
if ($this->result === false) {
|
||||
$err =& $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null,
|
||||
$err = $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null,
|
||||
'resultset has already been freed', __FUNCTION__);
|
||||
return $err;
|
||||
}
|
||||
$null = null;
|
||||
return $null;
|
||||
return null;
|
||||
}
|
||||
$mode = $this->db->options['portability'] & MDB2_PORTABILITY_EMPTY_TO_NULL;
|
||||
$rtrim = false;
|
||||
@@ -1395,8 +1412,16 @@ class MDB2_Result_mysql extends MDB2_Result_Common
|
||||
if ($mode) {
|
||||
$this->db->_fixResultArrayValues($row, $mode);
|
||||
}
|
||||
if (!empty($this->types)) {
|
||||
if ( ( $fetchmode != MDB2_FETCHMODE_ASSOC
|
||||
&& $fetchmode != MDB2_FETCHMODE_OBJECT)
|
||||
&& !empty($this->types)
|
||||
) {
|
||||
$row = $this->db->datatype->convertResultRow($this->types, $row, $rtrim);
|
||||
} elseif (($fetchmode == MDB2_FETCHMODE_ASSOC
|
||||
|| $fetchmode == MDB2_FETCHMODE_OBJECT)
|
||||
&& !empty($this->types_assoc)
|
||||
) {
|
||||
$row = $this->db->datatype->convertResultRow($this->types_assoc, $row, $rtrim);
|
||||
}
|
||||
if (!empty($this->values)) {
|
||||
$this->_assignBindColumns($row);
|
||||
@@ -1406,7 +1431,8 @@ class MDB2_Result_mysql extends MDB2_Result_Common
|
||||
if ($object_class == 'stdClass') {
|
||||
$row = (object) $row;
|
||||
} else {
|
||||
$row = new $object_class($row);
|
||||
$rowObj = new $object_class($row);
|
||||
$row = $rowObj;
|
||||
}
|
||||
}
|
||||
++$this->rownum;
|
||||
@@ -1568,6 +1594,8 @@ class MDB2_BufferedResult_mysql extends MDB2_Result_mysql
|
||||
}
|
||||
return $rows;
|
||||
}
|
||||
|
||||
// }}}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1591,10 +1619,10 @@ class MDB2_Statement_mysql extends MDB2_Statement_Common
|
||||
* a MDB2 error on failure
|
||||
* @access private
|
||||
*/
|
||||
function &_execute($result_class = true, $result_wrap_class = false)
|
||||
function _execute($result_class = true, $result_wrap_class = true)
|
||||
{
|
||||
if (is_null($this->statement)) {
|
||||
$result =& parent::_execute($result_class, $result_wrap_class);
|
||||
$result = parent::_execute($result_class, $result_wrap_class);
|
||||
return $result;
|
||||
}
|
||||
$this->db->last_query = $this->query;
|
||||
@@ -1617,6 +1645,7 @@ class MDB2_Statement_mysql extends MDB2_Statement_Common
|
||||
return $this->db->raiseError(MDB2_ERROR_NOT_FOUND, null, null,
|
||||
'Unable to bind to missing placeholder: '.$parameter, __FUNCTION__);
|
||||
}
|
||||
$close = false;
|
||||
$value = $this->values[$parameter];
|
||||
$type = array_key_exists($parameter, $this->types) ? $this->types[$parameter] : null;
|
||||
if (is_resource($value) || $type == 'clob' || $type == 'blob' && $this->db->options['lob_allow_url_include']) {
|
||||
@@ -1661,7 +1690,7 @@ class MDB2_Statement_mysql extends MDB2_Statement_Common
|
||||
return $affected_rows;
|
||||
}
|
||||
|
||||
$result =& $this->db->_wrapResult($result, $this->result_types,
|
||||
$result = $this->db->_wrapResult($result, $this->result_types,
|
||||
$result_class, $result_wrap_class, $this->limit, $this->offset);
|
||||
$this->db->debug($this->query, 'execute', array('is_manip' => $this->is_manip, 'when' => 'post', 'result' => $result));
|
||||
return $result;
|
||||
@@ -1697,4 +1726,4 @@ class MDB2_Statement_mysql extends MDB2_Statement_Common
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
+132
-68
@@ -43,7 +43,7 @@
|
||||
// | Author: Paul Cooper <pgc@ucecom.com> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: pgsql.php,v 1.203 2008/11/29 14:04:46 afz Exp $
|
||||
// $Id$
|
||||
|
||||
/**
|
||||
* MDB2 PostGreSQL driver
|
||||
@@ -236,21 +236,22 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
|
||||
function beginTransaction($savepoint = null)
|
||||
{
|
||||
$this->debug('Starting transaction/savepoint', __FUNCTION__, array('is_manip' => true, 'savepoint' => $savepoint));
|
||||
if (!is_null($savepoint)) {
|
||||
if (null !== $savepoint) {
|
||||
if (!$this->in_transaction) {
|
||||
return $this->raiseError(MDB2_ERROR_INVALID, null, null,
|
||||
'savepoint cannot be released when changes are auto committed', __FUNCTION__);
|
||||
}
|
||||
$query = 'SAVEPOINT '.$savepoint;
|
||||
return $this->_doQuery($query, true);
|
||||
} elseif ($this->in_transaction) {
|
||||
}
|
||||
if ($this->in_transaction) {
|
||||
return MDB2_OK; //nothing to do
|
||||
}
|
||||
if (!$this->destructor_registered && $this->opened_persistent) {
|
||||
$this->destructor_registered = true;
|
||||
register_shutdown_function('MDB2_closeOpenTransactions');
|
||||
}
|
||||
$result =& $this->_doQuery('BEGIN', true);
|
||||
$result = $this->_doQuery('BEGIN', true);
|
||||
if (PEAR::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
@@ -279,12 +280,12 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
|
||||
return $this->raiseError(MDB2_ERROR_INVALID, null, null,
|
||||
'commit/release savepoint cannot be done changes are auto committed', __FUNCTION__);
|
||||
}
|
||||
if (!is_null($savepoint)) {
|
||||
if (null !== $savepoint) {
|
||||
$query = 'RELEASE SAVEPOINT '.$savepoint;
|
||||
return $this->_doQuery($query, true);
|
||||
}
|
||||
|
||||
$result =& $this->_doQuery('COMMIT', true);
|
||||
$result = $this->_doQuery('COMMIT', true);
|
||||
if (PEAR::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
@@ -313,13 +314,13 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
|
||||
return $this->raiseError(MDB2_ERROR_INVALID, null, null,
|
||||
'rollback cannot be done changes are auto committed', __FUNCTION__);
|
||||
}
|
||||
if (!is_null($savepoint)) {
|
||||
if (null !== $savepoint) {
|
||||
$query = 'ROLLBACK TO SAVEPOINT '.$savepoint;
|
||||
return $this->_doQuery($query, true);
|
||||
}
|
||||
|
||||
$query = 'ROLLBACK';
|
||||
$result =& $this->_doQuery($query, true);
|
||||
$result = $this->_doQuery($query, true);
|
||||
if (PEAR::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
@@ -338,12 +339,16 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
|
||||
* READ COMMITTED (prevents dirty reads)
|
||||
* REPEATABLE READ (prevents nonrepeatable reads)
|
||||
* SERIALIZABLE (prevents phantom reads)
|
||||
* @param array some transaction options:
|
||||
* 'wait' => 'WAIT' | 'NO WAIT'
|
||||
* 'rw' => 'READ WRITE' | 'READ ONLY'
|
||||
*
|
||||
* @return mixed MDB2_OK on success, a MDB2 error on failure
|
||||
*
|
||||
* @access public
|
||||
* @since 2.1.1
|
||||
*/
|
||||
function setTransactionIsolation($isolation)
|
||||
function setTransactionIsolation($isolation, $options = array())
|
||||
{
|
||||
$this->debug('Setting transaction isolation level', __FUNCTION__, array('is_manip' => true));
|
||||
switch ($isolation) {
|
||||
@@ -376,7 +381,7 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
|
||||
return $this->raiseError(MDB2_ERROR_NOT_FOUND, null, null,
|
||||
'extension '.$this->phptype.' is not compiled into PHP', __FUNCTION__);
|
||||
}
|
||||
|
||||
|
||||
if ($database_name == '') {
|
||||
$database_name = 'template1';
|
||||
}
|
||||
@@ -452,6 +457,29 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
|
||||
}
|
||||
}
|
||||
|
||||
// Enable extra compatibility settings on 8.2 and later
|
||||
if (function_exists('pg_parameter_status')) {
|
||||
$version = pg_parameter_status($connection, 'server_version');
|
||||
if ($version == false) {
|
||||
return $this->raiseError(null, null, null,
|
||||
'Unable to retrieve server version', __FUNCTION__);
|
||||
}
|
||||
$version = explode ('.', $version);
|
||||
if ( $version['0'] > 8
|
||||
|| ($version['0'] == 8 && $version['1'] >= 2)
|
||||
) {
|
||||
if (!@pg_query($connection, "SET SESSION STANDARD_CONFORMING_STRINGS = OFF")) {
|
||||
return $this->raiseError(null, null, null,
|
||||
'Unable to set standard_conforming_strings to off', __FUNCTION__);
|
||||
}
|
||||
|
||||
if (!@pg_query($connection, "SET SESSION ESCAPE_STRING_WARNING = OFF")) {
|
||||
return $this->raiseError(null, null, null,
|
||||
'Unable to set escape_string_warning to off', __FUNCTION__);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $connection;
|
||||
}
|
||||
|
||||
@@ -509,7 +537,7 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
|
||||
*/
|
||||
function setCharset($charset, $connection = null)
|
||||
{
|
||||
if (is_null($connection)) {
|
||||
if (null === $connection) {
|
||||
$connection = $this->getConnection();
|
||||
if (PEAR::isError($connection)) {
|
||||
return $connection;
|
||||
@@ -595,7 +623,7 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
|
||||
// }}}
|
||||
// {{{ standaloneQuery()
|
||||
|
||||
/**
|
||||
/**
|
||||
* execute a query as DBA
|
||||
*
|
||||
* @param string $query the SQL query
|
||||
@@ -605,7 +633,7 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
|
||||
* @return mixed MDB2_OK on success, a MDB2 error on failure
|
||||
* @access public
|
||||
*/
|
||||
function &standaloneQuery($query, $types = null, $is_manip = false)
|
||||
function standaloneQuery($query, $types = null, $is_manip = false)
|
||||
{
|
||||
$user = $this->options['DBA_username']? $this->options['DBA_username'] : $this->dsn['username'];
|
||||
$pass = $this->options['DBA_password']? $this->options['DBA_password'] : $this->dsn['password'];
|
||||
@@ -619,12 +647,12 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
|
||||
$this->offset = $this->limit = 0;
|
||||
$query = $this->_modifyQuery($query, $is_manip, $limit, $offset);
|
||||
|
||||
$result =& $this->_doQuery($query, $is_manip, $connection, $this->database_name);
|
||||
$result = $this->_doQuery($query, $is_manip, $connection, $this->database_name);
|
||||
if (!PEAR::isError($result)) {
|
||||
if ($is_manip) {
|
||||
$result = $this->_affectedRows($connection, $result);
|
||||
} else {
|
||||
$result =& $this->_wrapResult($result, $types, true, false, $limit, $offset);
|
||||
$result = $this->_wrapResult($result, $types, true, true, $limit, $offset);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -644,7 +672,7 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
|
||||
* @return result or error object
|
||||
* @access protected
|
||||
*/
|
||||
function &_doQuery($query, $is_manip = false, $connection = null, $database_name = null)
|
||||
function _doQuery($query, $is_manip = false, $connection = null, $database_name = null)
|
||||
{
|
||||
$this->last_query = $query;
|
||||
$result = $this->debug($query, 'query', array('is_manip' => $is_manip, 'when' => 'pre'));
|
||||
@@ -659,7 +687,7 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
|
||||
return $result;
|
||||
}
|
||||
|
||||
if (is_null($connection)) {
|
||||
if (null === $connection) {
|
||||
$connection = $this->getConnection();
|
||||
if (PEAR::isError($connection)) {
|
||||
return $connection;
|
||||
@@ -669,12 +697,12 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
|
||||
$function = $this->options['multi_query'] ? 'pg_send_query' : 'pg_query';
|
||||
$result = @$function($connection, $query);
|
||||
if (!$result) {
|
||||
$err =& $this->raiseError(null, null, null,
|
||||
$err = $this->raiseError(null, null, null,
|
||||
'Could not execute statement', __FUNCTION__);
|
||||
return $err;
|
||||
} elseif ($this->options['multi_query']) {
|
||||
if (!($result = @pg_get_result($connection))) {
|
||||
$err =& $this->raiseError(null, null, null,
|
||||
$err = $this->raiseError(null, null, null,
|
||||
'Could not get the first result from a multi query', __FUNCTION__);
|
||||
return $err;
|
||||
}
|
||||
@@ -697,7 +725,7 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
|
||||
*/
|
||||
function _affectedRows($connection, $result = null)
|
||||
{
|
||||
if (is_null($connection)) {
|
||||
if (null === $connection) {
|
||||
$connection = $this->getConnection();
|
||||
if (PEAR::isError($connection)) {
|
||||
return $connection;
|
||||
@@ -736,10 +764,10 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
|
||||
}
|
||||
return $query;
|
||||
}
|
||||
|
||||
|
||||
// }}}
|
||||
// {{{ _modifyManipQuery()
|
||||
|
||||
|
||||
/**
|
||||
* Changes a manip query string for various DBMS specific reasons
|
||||
*
|
||||
@@ -841,11 +869,10 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
|
||||
* @access public
|
||||
* @see bindParam, execute
|
||||
*/
|
||||
function &prepare($query, $types = null, $result_types = null, $lobs = array())
|
||||
function prepare($query, $types = null, $result_types = null, $lobs = array())
|
||||
{
|
||||
if ($this->options['emulate_prepared']) {
|
||||
$obj =& parent::prepare($query, $types, $result_types, $lobs);
|
||||
return $obj;
|
||||
return parent::prepare($query, $types, $result_types, $lobs);
|
||||
}
|
||||
$is_manip = ($result_types === MDB2_PREPARE_MANIP);
|
||||
$offset = $this->offset;
|
||||
@@ -885,10 +912,10 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
if (is_null($placeholder_type)) {
|
||||
if (null === $placeholder_type) {
|
||||
$placeholder_type_guess = $query[$p_position];
|
||||
}
|
||||
|
||||
|
||||
$new_pos = $this->_skipDelimitedStrings($query, $position, $p_position);
|
||||
if (PEAR::isError($new_pos)) {
|
||||
return $new_pos;
|
||||
@@ -899,7 +926,7 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
|
||||
}
|
||||
|
||||
if ($query[$position] == $placeholder_type_guess) {
|
||||
if (is_null($placeholder_type)) {
|
||||
if (null === $placeholder_type) {
|
||||
$placeholder_type = $query[$p_position];
|
||||
$question = $colon = $placeholder_type;
|
||||
if (!empty($types) && is_array($types)) {
|
||||
@@ -916,7 +943,7 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
|
||||
$regexp = '/^.{'.($position+1).'}('.$this->options['bindname_format'].').*$/s';
|
||||
$param = preg_replace($regexp, '\\1', $query);
|
||||
if ($param === '') {
|
||||
$err =& $this->raiseError(MDB2_ERROR_SYNTAX, null, null,
|
||||
$err = $this->raiseError(MDB2_ERROR_SYNTAX, null, null,
|
||||
'named parameter name must match "bindname_format" option', __FUNCTION__);
|
||||
return $err;
|
||||
}
|
||||
@@ -932,17 +959,18 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
|
||||
$pgtypes[] = 'text';
|
||||
}
|
||||
}
|
||||
if (($key_parameter = array_search($name, $positions))) {
|
||||
$next_parameter = 1;
|
||||
foreach ($positions as $key => $value) {
|
||||
if ($key_parameter == $key) {
|
||||
break;
|
||||
}
|
||||
++$next_parameter;
|
||||
}
|
||||
if (($key_parameter = array_search($name, $positions)) !== false) {
|
||||
//$next_parameter = 1;
|
||||
$parameter = $key_parameter + 1;
|
||||
//foreach ($positions as $key => $value) {
|
||||
// if ($key_parameter == $key) {
|
||||
// break;
|
||||
// }
|
||||
// ++$next_parameter;
|
||||
//}
|
||||
} else {
|
||||
++$parameter;
|
||||
$next_parameter = $parameter;
|
||||
//$next_parameter = $parameter;
|
||||
$positions[] = $name;
|
||||
}
|
||||
$query = substr_replace($query, '$'.$parameter, $position, $length);
|
||||
@@ -958,10 +986,10 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
|
||||
static $prep_statement_counter = 1;
|
||||
$statement_name = sprintf($this->options['statement_format'], $this->phptype, $prep_statement_counter++ . sha1(microtime() + mt_rand()));
|
||||
$statement_name = substr(strtolower($statement_name), 0, $this->options['max_identifiers_length']);
|
||||
if ($pgtypes === false) {
|
||||
if (false === $pgtypes) {
|
||||
$result = @pg_prepare($connection, $statement_name, $query);
|
||||
if (!$result) {
|
||||
$err =& $this->raiseError(null, null, null,
|
||||
$err = $this->raiseError(null, null, null,
|
||||
'Unable to create prepared statement handle', __FUNCTION__);
|
||||
return $err;
|
||||
}
|
||||
@@ -971,7 +999,7 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
|
||||
$types_string = ' ('.implode(', ', $pgtypes).') ';
|
||||
}
|
||||
$query = 'PREPARE '.$statement_name.$types_string.' AS '.$query;
|
||||
$statement =& $this->_doQuery($query, true, $connection);
|
||||
$statement = $this->_doQuery($query, true, $connection);
|
||||
if (PEAR::isError($statement)) {
|
||||
return $statement;
|
||||
}
|
||||
@@ -1140,9 +1168,9 @@ class MDB2_Result_pgsql extends MDB2_Result_Common
|
||||
* @return int data array on success, a MDB2 error on failure
|
||||
* @access public
|
||||
*/
|
||||
function &fetchRow($fetchmode = MDB2_FETCHMODE_DEFAULT, $rownum = null)
|
||||
function fetchRow($fetchmode = MDB2_FETCHMODE_DEFAULT, $rownum = null)
|
||||
{
|
||||
if (!is_null($rownum)) {
|
||||
if (null !== $rownum) {
|
||||
$seek = $this->seek($rownum);
|
||||
if (PEAR::isError($seek)) {
|
||||
return $seek;
|
||||
@@ -1151,7 +1179,9 @@ class MDB2_Result_pgsql extends MDB2_Result_Common
|
||||
if ($fetchmode == MDB2_FETCHMODE_DEFAULT) {
|
||||
$fetchmode = $this->db->fetchmode;
|
||||
}
|
||||
if ($fetchmode & MDB2_FETCHMODE_ASSOC) {
|
||||
if ( $fetchmode == MDB2_FETCHMODE_ASSOC
|
||||
|| $fetchmode == MDB2_FETCHMODE_OBJECT
|
||||
) {
|
||||
$row = @pg_fetch_array($this->result, null, PGSQL_ASSOC);
|
||||
if (is_array($row)
|
||||
&& $this->db->options['portability'] & MDB2_PORTABILITY_FIX_CASE
|
||||
@@ -1162,13 +1192,12 @@ class MDB2_Result_pgsql extends MDB2_Result_Common
|
||||
$row = @pg_fetch_row($this->result);
|
||||
}
|
||||
if (!$row) {
|
||||
if ($this->result === false) {
|
||||
$err =& $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null,
|
||||
if (false === $this->result) {
|
||||
$err = $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null,
|
||||
'resultset has already been freed', __FUNCTION__);
|
||||
return $err;
|
||||
}
|
||||
$null = null;
|
||||
return $null;
|
||||
return null;
|
||||
}
|
||||
$mode = $this->db->options['portability'] & MDB2_PORTABILITY_EMPTY_TO_NULL;
|
||||
$rtrim = false;
|
||||
@@ -1182,8 +1211,16 @@ class MDB2_Result_pgsql extends MDB2_Result_Common
|
||||
if ($mode) {
|
||||
$this->db->_fixResultArrayValues($row, $mode);
|
||||
}
|
||||
if (!empty($this->types)) {
|
||||
if ( ( $fetchmode != MDB2_FETCHMODE_ASSOC
|
||||
&& $fetchmode != MDB2_FETCHMODE_OBJECT)
|
||||
&& !empty($this->types)
|
||||
) {
|
||||
$row = $this->db->datatype->convertResultRow($this->types, $row, $rtrim);
|
||||
} elseif (($fetchmode == MDB2_FETCHMODE_ASSOC
|
||||
|| $fetchmode == MDB2_FETCHMODE_OBJECT)
|
||||
&& !empty($this->types_assoc)
|
||||
) {
|
||||
$row = $this->db->datatype->convertResultRow($this->types_assoc, $row, $rtrim);
|
||||
}
|
||||
if (!empty($this->values)) {
|
||||
$this->_assignBindColumns($row);
|
||||
@@ -1193,7 +1230,8 @@ class MDB2_Result_pgsql extends MDB2_Result_Common
|
||||
if ($object_class == 'stdClass') {
|
||||
$row = (object) $row;
|
||||
} else {
|
||||
$row = &new $object_class($row);
|
||||
$rowObj = new $object_class($row);
|
||||
$row = $rowObj;
|
||||
}
|
||||
}
|
||||
++$this->rownum;
|
||||
@@ -1242,11 +1280,12 @@ class MDB2_Result_pgsql extends MDB2_Result_Common
|
||||
function numCols()
|
||||
{
|
||||
$cols = @pg_num_fields($this->result);
|
||||
if (is_null($cols)) {
|
||||
if ($this->result === false) {
|
||||
if (null === $cols) {
|
||||
if (false === $this->result) {
|
||||
return $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null,
|
||||
'resultset has already been freed', __FUNCTION__);
|
||||
} elseif (is_null($this->result)) {
|
||||
}
|
||||
if (null === $this->result) {
|
||||
return count($this->types);
|
||||
}
|
||||
return $this->db->raiseError(null, null, null,
|
||||
@@ -1290,7 +1329,7 @@ class MDB2_Result_pgsql extends MDB2_Result_Common
|
||||
{
|
||||
if (is_resource($this->result) && $this->db->connection) {
|
||||
$free = @pg_free_result($this->result);
|
||||
if ($free === false) {
|
||||
if (false === $free) {
|
||||
return $this->db->raiseError(null, null, null,
|
||||
'Could not free result', __FUNCTION__);
|
||||
}
|
||||
@@ -1321,10 +1360,11 @@ class MDB2_BufferedResult_pgsql extends MDB2_Result_pgsql
|
||||
function seek($rownum = 0)
|
||||
{
|
||||
if ($this->rownum != ($rownum - 1) && !@pg_result_seek($this->result, $rownum)) {
|
||||
if ($this->result === false) {
|
||||
if (false === $this->result) {
|
||||
return $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null,
|
||||
'resultset has already been freed', __FUNCTION__);
|
||||
} elseif (is_null($this->result)) {
|
||||
}
|
||||
if (null === $this->result) {
|
||||
return MDB2_OK;
|
||||
}
|
||||
return $this->db->raiseError(MDB2_ERROR_INVALID, null, null,
|
||||
@@ -1364,11 +1404,12 @@ class MDB2_BufferedResult_pgsql extends MDB2_Result_pgsql
|
||||
function numRows()
|
||||
{
|
||||
$rows = @pg_num_rows($this->result);
|
||||
if (is_null($rows)) {
|
||||
if ($this->result === false) {
|
||||
if (null === $rows) {
|
||||
if (false === $this->result) {
|
||||
return $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null,
|
||||
'resultset has already been freed', __FUNCTION__);
|
||||
} elseif (is_null($this->result)) {
|
||||
}
|
||||
if (null === $this->result) {
|
||||
return 0;
|
||||
}
|
||||
return $this->db->raiseError(null, null, null,
|
||||
@@ -1399,11 +1440,10 @@ class MDB2_Statement_pgsql extends MDB2_Statement_Common
|
||||
* a MDB2 error on failure
|
||||
* @access private
|
||||
*/
|
||||
function &_execute($result_class = true, $result_wrap_class = false)
|
||||
function _execute($result_class = true, $result_wrap_class = true)
|
||||
{
|
||||
if (is_null($this->statement)) {
|
||||
$result =& parent::_execute($result_class, $result_wrap_class);
|
||||
return $result;
|
||||
if (null === $this->statement) {
|
||||
return parent::_execute($result_class, $result_wrap_class);
|
||||
}
|
||||
$this->db->last_query = $this->query;
|
||||
$this->db->debug($this->query, 'execute', array('is_manip' => $this->is_manip, 'when' => 'pre', 'parameters' => $this->values));
|
||||
@@ -1464,7 +1504,7 @@ class MDB2_Statement_pgsql extends MDB2_Statement_Common
|
||||
if (!$query) {
|
||||
$result = @pg_execute($connection, $this->statement, $parameters);
|
||||
if (!$result) {
|
||||
$err =& $this->db->raiseError(null, null, null,
|
||||
$err = $this->db->raiseError(null, null, null,
|
||||
'Unable to execute statement', __FUNCTION__);
|
||||
return $err;
|
||||
}
|
||||
@@ -1480,7 +1520,7 @@ class MDB2_Statement_pgsql extends MDB2_Statement_Common
|
||||
return $affected_rows;
|
||||
}
|
||||
|
||||
$result =& $this->db->_wrapResult($result, $this->result_types,
|
||||
$result = $this->db->_wrapResult($result, $this->result_types,
|
||||
$result_class, $result_wrap_class, $this->limit, $this->offset);
|
||||
$this->db->debug($this->query, 'execute', array('is_manip' => $this->is_manip, 'when' => 'post', 'result' => $result));
|
||||
return $result;
|
||||
@@ -1497,13 +1537,13 @@ class MDB2_Statement_pgsql extends MDB2_Statement_Common
|
||||
*/
|
||||
function free()
|
||||
{
|
||||
if (is_null($this->positions)) {
|
||||
if (null === $this->positions) {
|
||||
return $this->db->raiseError(MDB2_ERROR, null, null,
|
||||
'Prepared statement has already been freed', __FUNCTION__);
|
||||
}
|
||||
$result = MDB2_OK;
|
||||
|
||||
if (!is_null($this->statement)) {
|
||||
if (null !== $this->statement) {
|
||||
$connection = $this->db->getConnection();
|
||||
if (PEAR::isError($connection)) {
|
||||
return $connection;
|
||||
@@ -1515,5 +1555,29 @@ class MDB2_Statement_pgsql extends MDB2_Statement_Common
|
||||
parent::free();
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* drop an existing table
|
||||
*
|
||||
* @param string $name name of the table that should be dropped
|
||||
* @return mixed MDB2_OK on success, a MDB2 error on failure
|
||||
* @access public
|
||||
*/
|
||||
function dropTable($name)
|
||||
{
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
|
||||
$name = $db->quoteIdentifier($name, true);
|
||||
$result = $db->exec("DROP TABLE $name");
|
||||
|
||||
if (PEAR::isError($result)) {
|
||||
$result = $db->exec("DROP TABLE $name CASCADE");
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
+59
-37
@@ -43,7 +43,7 @@
|
||||
// | Author: Lukas Smith <smith@pooteeweet.org> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: sqlite.php,v 1.165 2008/11/30 14:28:01 afz Exp $
|
||||
// $Id$
|
||||
//
|
||||
|
||||
/**
|
||||
@@ -126,12 +126,12 @@ class MDB2_Driver_sqlite extends MDB2_Driver_Common
|
||||
}
|
||||
$native_msg = $this->_lasterror
|
||||
? html_entity_decode($this->_lasterror) : @sqlite_error_string($native_code);
|
||||
|
||||
|
||||
// PHP 5.2+ prepends the function name to $php_errormsg, so we need
|
||||
// this hack to work around it, per bug #9599.
|
||||
$native_msg = preg_replace('/^sqlite[a-z_]+\(\)[^:]*: /', '', $native_msg);
|
||||
|
||||
if (is_null($error)) {
|
||||
if (null === $error) {
|
||||
static $error_regexps;
|
||||
if (empty($error_regexps)) {
|
||||
$error_regexps = array(
|
||||
@@ -142,6 +142,7 @@ class MDB2_Driver_sqlite extends MDB2_Driver_Common
|
||||
'/is not unique/' => MDB2_ERROR_CONSTRAINT,
|
||||
'/columns .* are not unique/i' => MDB2_ERROR_CONSTRAINT,
|
||||
'/uniqueness constraint failed/' => MDB2_ERROR_CONSTRAINT,
|
||||
'/violates .*constraint/' => MDB2_ERROR_CONSTRAINT,
|
||||
'/may not be NULL/' => MDB2_ERROR_CONSTRAINT_NOT_NULL,
|
||||
'/^no such column:/' => MDB2_ERROR_NOSUCHFIELD,
|
||||
'/no column named/' => MDB2_ERROR_NOSUCHFIELD,
|
||||
@@ -194,10 +195,11 @@ class MDB2_Driver_sqlite extends MDB2_Driver_Common
|
||||
function beginTransaction($savepoint = null)
|
||||
{
|
||||
$this->debug('Starting transaction/savepoint', __FUNCTION__, array('is_manip' => true, 'savepoint' => $savepoint));
|
||||
if (!is_null($savepoint)) {
|
||||
if (null !== $savepoint) {
|
||||
return $this->raiseError(MDB2_ERROR_UNSUPPORTED, null, null,
|
||||
'savepoints are not supported', __FUNCTION__);
|
||||
} elseif ($this->in_transaction) {
|
||||
}
|
||||
if ($this->in_transaction) {
|
||||
return MDB2_OK; //nothing to do
|
||||
}
|
||||
if (!$this->destructor_registered && $this->opened_persistent) {
|
||||
@@ -205,7 +207,7 @@ class MDB2_Driver_sqlite extends MDB2_Driver_Common
|
||||
register_shutdown_function('MDB2_closeOpenTransactions');
|
||||
}
|
||||
$query = 'BEGIN TRANSACTION '.$this->options['base_transaction_name'];
|
||||
$result =& $this->_doQuery($query, true);
|
||||
$result = $this->_doQuery($query, true);
|
||||
if (PEAR::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
@@ -234,13 +236,13 @@ class MDB2_Driver_sqlite extends MDB2_Driver_Common
|
||||
return $this->raiseError(MDB2_ERROR_INVALID, null, null,
|
||||
'commit/release savepoint cannot be done changes are auto committed', __FUNCTION__);
|
||||
}
|
||||
if (!is_null($savepoint)) {
|
||||
if (null !== $savepoint) {
|
||||
return $this->raiseError(MDB2_ERROR_UNSUPPORTED, null, null,
|
||||
'savepoints are not supported', __FUNCTION__);
|
||||
}
|
||||
|
||||
$query = 'COMMIT TRANSACTION '.$this->options['base_transaction_name'];
|
||||
$result =& $this->_doQuery($query, true);
|
||||
$result = $this->_doQuery($query, true);
|
||||
if (PEAR::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
@@ -269,13 +271,13 @@ class MDB2_Driver_sqlite extends MDB2_Driver_Common
|
||||
return $this->raiseError(MDB2_ERROR_INVALID, null, null,
|
||||
'rollback cannot be done changes are auto committed', __FUNCTION__);
|
||||
}
|
||||
if (!is_null($savepoint)) {
|
||||
if (null !== $savepoint) {
|
||||
return $this->raiseError(MDB2_ERROR_UNSUPPORTED, null, null,
|
||||
'savepoints are not supported', __FUNCTION__);
|
||||
}
|
||||
|
||||
$query = 'ROLLBACK TRANSACTION '.$this->options['base_transaction_name'];
|
||||
$result =& $this->_doQuery($query, true);
|
||||
$result = $this->_doQuery($query, true);
|
||||
if (PEAR::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
@@ -294,12 +296,16 @@ class MDB2_Driver_sqlite extends MDB2_Driver_Common
|
||||
* READ COMMITTED (prevents dirty reads)
|
||||
* REPEATABLE READ (prevents nonrepeatable reads)
|
||||
* SERIALIZABLE (prevents phantom reads)
|
||||
* @param array some transaction options:
|
||||
* 'wait' => 'WAIT' | 'NO WAIT'
|
||||
* 'rw' => 'READ WRITE' | 'READ ONLY'
|
||||
*
|
||||
* @return mixed MDB2_OK on success, a MDB2 error on failure
|
||||
*
|
||||
* @access public
|
||||
* @since 2.1.1
|
||||
*/
|
||||
function setTransactionIsolation($isolation)
|
||||
function setTransactionIsolation($isolation, $options = array())
|
||||
{
|
||||
$this->debug('Setting transaction isolation level', __FUNCTION__, array('is_manip' => true));
|
||||
switch ($isolation) {
|
||||
@@ -499,7 +505,7 @@ class MDB2_Driver_sqlite extends MDB2_Driver_Common
|
||||
* @return result or error object
|
||||
* @access protected
|
||||
*/
|
||||
function &_doQuery($query, $is_manip = false, $connection = null, $database_name = null)
|
||||
function _doQuery($query, $is_manip = false, $connection = null, $database_name = null)
|
||||
{
|
||||
$this->last_query = $query;
|
||||
$result = $this->debug($query, 'query', array('is_manip' => $is_manip, 'when' => 'pre'));
|
||||
@@ -514,7 +520,7 @@ class MDB2_Driver_sqlite extends MDB2_Driver_Common
|
||||
return $result;
|
||||
}
|
||||
|
||||
if (is_null($connection)) {
|
||||
if (null === $connection) {
|
||||
$connection = $this->getConnection();
|
||||
if (PEAR::isError($connection)) {
|
||||
return $connection;
|
||||
@@ -538,7 +544,11 @@ class MDB2_Driver_sqlite extends MDB2_Driver_Common
|
||||
$this->_lasterror = $php_errormsg;
|
||||
|
||||
if (!$result) {
|
||||
$err =& $this->raiseError(null, null, null,
|
||||
$code = null;
|
||||
if (0 === strpos($this->_lasterror, 'no such table')) {
|
||||
$code = MDB2_ERROR_NOSUCHTABLE;
|
||||
}
|
||||
$err = $this->raiseError($code, null, null,
|
||||
'Could not execute statement', __FUNCTION__);
|
||||
return $err;
|
||||
}
|
||||
@@ -560,7 +570,7 @@ class MDB2_Driver_sqlite extends MDB2_Driver_Common
|
||||
*/
|
||||
function _affectedRows($connection, $result = null)
|
||||
{
|
||||
if (is_null($connection)) {
|
||||
if (null === $connection) {
|
||||
$connection = $this->getConnection();
|
||||
if (PEAR::isError($connection)) {
|
||||
return $connection;
|
||||
@@ -753,7 +763,7 @@ class MDB2_Driver_sqlite extends MDB2_Driver_Common
|
||||
|
||||
$table = $this->quoteIdentifier($table, true);
|
||||
$query = "REPLACE INTO $table ($query) VALUES ($values)";
|
||||
$result =& $this->_doQuery($query, true, $connection);
|
||||
$result = $this->_doQuery($query, true, $connection);
|
||||
if (PEAR::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
@@ -781,7 +791,7 @@ class MDB2_Driver_sqlite extends MDB2_Driver_Common
|
||||
$query = "INSERT INTO $sequence_name ($seqcol_name) VALUES (NULL)";
|
||||
$this->pushErrorHandling(PEAR_ERROR_RETURN);
|
||||
$this->expectError(MDB2_ERROR_NOSUCHTABLE);
|
||||
$result =& $this->_doQuery($query, true);
|
||||
$result = $this->_doQuery($query, true);
|
||||
$this->popExpect();
|
||||
$this->popErrorHandling();
|
||||
if (PEAR::isError($result)) {
|
||||
@@ -800,7 +810,7 @@ class MDB2_Driver_sqlite extends MDB2_Driver_Common
|
||||
$value = $this->lastInsertID();
|
||||
if (is_numeric($value)) {
|
||||
$query = "DELETE FROM $sequence_name WHERE $seqcol_name < $value";
|
||||
$result =& $this->_doQuery($query, true);
|
||||
$result = $this->_doQuery($query, true);
|
||||
if (PEAR::isError($result)) {
|
||||
$this->warnings[] = 'nextID: could not delete previous sequence table values from '.$seq_name;
|
||||
}
|
||||
@@ -873,9 +883,9 @@ class MDB2_Result_sqlite extends MDB2_Result_Common
|
||||
* @return int data array on success, a MDB2 error on failure
|
||||
* @access public
|
||||
*/
|
||||
function &fetchRow($fetchmode = MDB2_FETCHMODE_DEFAULT, $rownum = null)
|
||||
function fetchRow($fetchmode = MDB2_FETCHMODE_DEFAULT, $rownum = null)
|
||||
{
|
||||
if (!is_null($rownum)) {
|
||||
if (null !== $rownum) {
|
||||
$seek = $this->seek($rownum);
|
||||
if (PEAR::isError($seek)) {
|
||||
return $seek;
|
||||
@@ -884,7 +894,9 @@ class MDB2_Result_sqlite extends MDB2_Result_Common
|
||||
if ($fetchmode == MDB2_FETCHMODE_DEFAULT) {
|
||||
$fetchmode = $this->db->fetchmode;
|
||||
}
|
||||
if ($fetchmode & MDB2_FETCHMODE_ASSOC) {
|
||||
if ( $fetchmode == MDB2_FETCHMODE_ASSOC
|
||||
|| $fetchmode == MDB2_FETCHMODE_OBJECT
|
||||
) {
|
||||
$row = @sqlite_fetch_array($this->result, SQLITE_ASSOC);
|
||||
if (is_array($row)
|
||||
&& $this->db->options['portability'] & MDB2_PORTABILITY_FIX_CASE
|
||||
@@ -895,13 +907,12 @@ class MDB2_Result_sqlite extends MDB2_Result_Common
|
||||
$row = @sqlite_fetch_array($this->result, SQLITE_NUM);
|
||||
}
|
||||
if (!$row) {
|
||||
if ($this->result === false) {
|
||||
$err =& $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null,
|
||||
if (false === $this->result) {
|
||||
$err = $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null,
|
||||
'resultset has already been freed', __FUNCTION__);
|
||||
return $err;
|
||||
}
|
||||
$null = null;
|
||||
return $null;
|
||||
return null;
|
||||
}
|
||||
$mode = $this->db->options['portability'] & MDB2_PORTABILITY_EMPTY_TO_NULL;
|
||||
$rtrim = false;
|
||||
@@ -915,8 +926,16 @@ class MDB2_Result_sqlite extends MDB2_Result_Common
|
||||
if ($mode) {
|
||||
$this->db->_fixResultArrayValues($row, $mode);
|
||||
}
|
||||
if (!empty($this->types)) {
|
||||
if ( ( $fetchmode != MDB2_FETCHMODE_ASSOC
|
||||
&& $fetchmode != MDB2_FETCHMODE_OBJECT)
|
||||
&& !empty($this->types)
|
||||
) {
|
||||
$row = $this->db->datatype->convertResultRow($this->types, $row, $rtrim);
|
||||
} elseif (($fetchmode == MDB2_FETCHMODE_ASSOC
|
||||
|| $fetchmode == MDB2_FETCHMODE_OBJECT)
|
||||
&& !empty($this->types_assoc)
|
||||
) {
|
||||
$row = $this->db->datatype->convertResultRow($this->types_assoc, $row, $rtrim);
|
||||
}
|
||||
if (!empty($this->values)) {
|
||||
$this->_assignBindColumns($row);
|
||||
@@ -926,7 +945,8 @@ class MDB2_Result_sqlite extends MDB2_Result_Common
|
||||
if ($object_class == 'stdClass') {
|
||||
$row = (object) $row;
|
||||
} else {
|
||||
$row = &new $object_class($row);
|
||||
$rowObj = new $object_class($row);
|
||||
$row = $rowObj;
|
||||
}
|
||||
}
|
||||
++$this->rownum;
|
||||
@@ -975,11 +995,12 @@ class MDB2_Result_sqlite extends MDB2_Result_Common
|
||||
function numCols()
|
||||
{
|
||||
$cols = @sqlite_num_fields($this->result);
|
||||
if (is_null($cols)) {
|
||||
if ($this->result === false) {
|
||||
if (null === $cols) {
|
||||
if (false === $this->result) {
|
||||
return $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null,
|
||||
'resultset has already been freed', __FUNCTION__);
|
||||
} elseif (is_null($this->result)) {
|
||||
}
|
||||
if (null === $this->result) {
|
||||
return count($this->types);
|
||||
}
|
||||
return $this->db->raiseError(null, null, null,
|
||||
@@ -1010,10 +1031,11 @@ class MDB2_BufferedResult_sqlite extends MDB2_Result_sqlite
|
||||
function seek($rownum = 0)
|
||||
{
|
||||
if (!@sqlite_seek($this->result, $rownum)) {
|
||||
if ($this->result === false) {
|
||||
if (false === $this->result) {
|
||||
return $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null,
|
||||
'resultset has already been freed', __FUNCTION__);
|
||||
} elseif (is_null($this->result)) {
|
||||
}
|
||||
if (null === $this->result) {
|
||||
return MDB2_OK;
|
||||
}
|
||||
return $this->db->raiseError(MDB2_ERROR_INVALID, null, null,
|
||||
@@ -1053,11 +1075,12 @@ class MDB2_BufferedResult_sqlite extends MDB2_Result_sqlite
|
||||
function numRows()
|
||||
{
|
||||
$rows = @sqlite_num_rows($this->result);
|
||||
if (is_null($rows)) {
|
||||
if ($this->result === false) {
|
||||
if (null === $rows) {
|
||||
if (false === $this->result) {
|
||||
return $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null,
|
||||
'resultset has already been freed', __FUNCTION__);
|
||||
} elseif (is_null($this->result)) {
|
||||
}
|
||||
if (null === $this->result) {
|
||||
return 0;
|
||||
}
|
||||
return $this->db->raiseError(null, null, null,
|
||||
@@ -1078,5 +1101,4 @@ class MDB2_Statement_sqlite extends MDB2_Statement_Common
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
+23
-21
@@ -42,7 +42,7 @@
|
||||
// | Author: Lukas Smith <smith@pooteeweet.org> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: Extended.php,v 1.60 2007/11/28 19:49:34 quipo Exp $
|
||||
// $Id$
|
||||
|
||||
/**
|
||||
* @package MDB2
|
||||
@@ -96,7 +96,7 @@ class MDB2_Extended extends MDB2_Module_Common
|
||||
if (PEAR::isError($query)) {
|
||||
return $query;
|
||||
}
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -134,7 +134,7 @@ class MDB2_Extended extends MDB2_Module_Common
|
||||
* @see autoPrepare
|
||||
* @access public
|
||||
*/
|
||||
function &autoExecute($table, $fields_values, $mode = MDB2_AUTOQUERY_INSERT,
|
||||
function autoExecute($table, $fields_values, $mode = MDB2_AUTOQUERY_INSERT,
|
||||
$where = false, $types = null, $result_class = true, $result_types = MDB2_PREPARE_MANIP)
|
||||
{
|
||||
$fields_values = (array)$fields_values;
|
||||
@@ -153,12 +153,12 @@ class MDB2_Extended extends MDB2_Module_Common
|
||||
if (empty($params)) {
|
||||
$query = $this->buildManipSQL($table, $keys, $mode, $where);
|
||||
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
if ($mode == MDB2_AUTOQUERY_SELECT) {
|
||||
$result =& $db->query($query, $result_types, $result_class);
|
||||
$result = $db->query($query, $result_types, $result_class);
|
||||
} else {
|
||||
$result = $db->exec($query);
|
||||
}
|
||||
@@ -167,7 +167,7 @@ class MDB2_Extended extends MDB2_Module_Common
|
||||
if (PEAR::isError($stmt)) {
|
||||
return $stmt;
|
||||
}
|
||||
$result =& $stmt->execute($params, $result_class);
|
||||
$result = $stmt->execute($params, $result_class);
|
||||
$stmt->free();
|
||||
}
|
||||
return $result;
|
||||
@@ -199,7 +199,7 @@ class MDB2_Extended extends MDB2_Module_Common
|
||||
*/
|
||||
function buildManipSQL($table, $table_fields, $mode, $where = false)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -214,7 +214,7 @@ class MDB2_Extended extends MDB2_Module_Common
|
||||
}
|
||||
}
|
||||
|
||||
if ($where !== false && !is_null($where)) {
|
||||
if ((false !== $where) && (null !== $where)) {
|
||||
if (is_array($where)) {
|
||||
$where = implode(' AND ', $where);
|
||||
}
|
||||
@@ -270,10 +270,10 @@ class MDB2_Extended extends MDB2_Module_Common
|
||||
* @return MDB2_Result|MDB2_Error result set on success, a MDB2 error on failure
|
||||
* @access public
|
||||
*/
|
||||
function &limitQuery($query, $types, $limit, $offset = 0, $result_class = true,
|
||||
function limitQuery($query, $types, $limit, $offset = 0, $result_class = true,
|
||||
$result_wrap_class = false)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -282,8 +282,7 @@ class MDB2_Extended extends MDB2_Module_Common
|
||||
if (PEAR::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
$result =& $db->query($query, $types, $result_class, $result_wrap_class);
|
||||
return $result;
|
||||
return $db->query($query, $types, $result_class, $result_wrap_class);
|
||||
}
|
||||
|
||||
// }}}
|
||||
@@ -302,7 +301,7 @@ class MDB2_Extended extends MDB2_Module_Common
|
||||
*/
|
||||
function execParam($query, $params = array(), $param_types = null)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -346,7 +345,7 @@ class MDB2_Extended extends MDB2_Module_Common
|
||||
function getOne($query, $type = null, $params = array(),
|
||||
$param_types = null, $colnum = 0)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -393,7 +392,7 @@ class MDB2_Extended extends MDB2_Module_Common
|
||||
function getRow($query, $types = null, $params = array(),
|
||||
$param_types = null, $fetchmode = MDB2_FETCHMODE_DEFAULT)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -439,7 +438,7 @@ class MDB2_Extended extends MDB2_Module_Common
|
||||
function getCol($query, $type = null, $params = array(),
|
||||
$param_types = null, $colnum = 0)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -495,7 +494,7 @@ class MDB2_Extended extends MDB2_Module_Common
|
||||
$param_types = null, $fetchmode = MDB2_FETCHMODE_DEFAULT,
|
||||
$rekey = false, $force_array = false, $group = false)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -600,7 +599,7 @@ class MDB2_Extended extends MDB2_Module_Common
|
||||
function getAssoc($query, $types = null, $params = array(), $param_types = null,
|
||||
$fetchmode = MDB2_FETCHMODE_DEFAULT, $force_array = false, $group = false)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -644,8 +643,11 @@ class MDB2_Extended extends MDB2_Module_Common
|
||||
* @access public
|
||||
* @see prepare(), execute()
|
||||
*/
|
||||
function executeMultiple(&$stmt, $params = null)
|
||||
function executeMultiple($stmt, $params = null)
|
||||
{
|
||||
if (MDB2::isError($stmt)) {
|
||||
return $stmt;
|
||||
}
|
||||
for ($i = 0, $j = count($params); $i < $j; $i++) {
|
||||
$result = $stmt->execute($params[$i]);
|
||||
if (PEAR::isError($result)) {
|
||||
@@ -672,7 +674,7 @@ class MDB2_Extended extends MDB2_Module_Common
|
||||
*/
|
||||
function getBeforeID($table, $field = null, $ondemand = true, $quote = true)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
@@ -705,7 +707,7 @@ class MDB2_Extended extends MDB2_Module_Common
|
||||
*/
|
||||
function getAfterID($id, $table, $field = null)
|
||||
{
|
||||
$db =& $this->getDBInstance();
|
||||
$db = $this->getDBInstance();
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
+6
-3
@@ -42,7 +42,7 @@
|
||||
// | Author: Lukas Smith <smith@pooteeweet.org> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: Iterator.php,v 1.22 2006/05/06 14:03:41 lsmith Exp $
|
||||
// $Id$
|
||||
|
||||
/**
|
||||
* PHP5 Iterator
|
||||
@@ -54,6 +54,9 @@
|
||||
class MDB2_Iterator implements Iterator
|
||||
{
|
||||
protected $fetchmode;
|
||||
/**
|
||||
* @var MDB2_Result_Common
|
||||
*/
|
||||
protected $result;
|
||||
protected $row;
|
||||
|
||||
@@ -62,7 +65,7 @@ class MDB2_Iterator implements Iterator
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct($result, $fetchmode = MDB2_FETCHMODE_DEFAULT)
|
||||
public function __construct(MDB2_Result_Common $result, $fetchmode = MDB2_FETCHMODE_DEFAULT)
|
||||
{
|
||||
$this->result = $result;
|
||||
$this->fetchmode = $fetchmode;
|
||||
@@ -112,7 +115,7 @@ class MDB2_Iterator implements Iterator
|
||||
*/
|
||||
public function current()
|
||||
{
|
||||
if (is_null($this->row)) {
|
||||
if (null === $this->row) {
|
||||
$row = $this->result->fetchRow($this->fetchmode);
|
||||
if (PEAR::isError($row)) {
|
||||
$row = false;
|
||||
+2
-2
@@ -42,7 +42,7 @@
|
||||
// | Author: Lukas Smith <smith@pooteeweet.org> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: LOB.php,v 1.34 2006/10/25 11:52:21 lsmith Exp $
|
||||
// $Id$
|
||||
|
||||
/**
|
||||
* @package MDB2
|
||||
@@ -50,7 +50,7 @@
|
||||
* @author Lukas Smith <smith@pooteeweet.org>
|
||||
*/
|
||||
|
||||
oc_require_once('MDB2.php');
|
||||
require_once 'MDB2.php';
|
||||
|
||||
/**
|
||||
* MDB2_LOB: user land stream wrapper implementation for LOB support
|
||||
+74
-40
@@ -1,8 +1,6 @@
|
||||
<?php
|
||||
<?php /* vim: se et ts=4 sw=4 sts=4 fdm=marker tw=80: */
|
||||
/**
|
||||
* PHP version 4, 5
|
||||
*
|
||||
* Copyright (c) 1998-2008 Manuel Lemos, Tomas V.V.Cox,
|
||||
* Copyright (c) 1998-2010 Manuel Lemos, Tomas V.V.Cox,
|
||||
* Stig. S. Bakken, Lukas Smith, Igor Feghali
|
||||
* All rights reserved.
|
||||
*
|
||||
@@ -39,19 +37,18 @@
|
||||
* WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Author: Lukas Smith <smith@pooteeweet.org>
|
||||
* Author: Igor Feghali <ifeghali@php.net>
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Database
|
||||
* @package MDB2_Schema
|
||||
* @author Lukas Smith <smith@pooteeweet.org>
|
||||
* @author Igor Feghali <ifeghali@php.net>
|
||||
* @license BSD http://www.opensource.org/licenses/bsd-license.php
|
||||
* @version CVS: $Id: Schema.php,v 1.132 2009/02/22 21:43:22 ifeghali Exp $
|
||||
* @version SVN: $Id$
|
||||
* @link http://pear.php.net/packages/MDB2_Schema
|
||||
*/
|
||||
|
||||
// require_once('MDB2.php');
|
||||
require_once 'MDB2.php';
|
||||
|
||||
define('MDB2_SCHEMA_DUMP_ALL', 0);
|
||||
define('MDB2_SCHEMA_DUMP_STRUCTURE', 1);
|
||||
@@ -96,7 +93,7 @@ class MDB2_Schema extends PEAR
|
||||
'parser' => 'MDB2_Schema_Parser',
|
||||
'writer' => 'MDB2_Schema_Writer',
|
||||
'validate' => 'MDB2_Schema_Validate',
|
||||
'drop_missing_tables' => false
|
||||
'drop_obsolete_objects' => false
|
||||
);
|
||||
|
||||
// }}}
|
||||
@@ -237,9 +234,10 @@ class MDB2_Schema extends PEAR
|
||||
* @access public
|
||||
* @see MDB2::parseDSN
|
||||
*/
|
||||
function &factory(&$db, $options = array())
|
||||
static function &factory(&$db, $options = array())
|
||||
{
|
||||
$obj =new MDB2_Schema();
|
||||
$obj = new MDB2_Schema();
|
||||
|
||||
$result = $obj->connect($db, $options);
|
||||
if (PEAR::isError($result)) {
|
||||
return $result;
|
||||
@@ -280,15 +278,17 @@ class MDB2_Schema extends PEAR
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->disconnect();
|
||||
if (!MDB2::isConnection($db)) {
|
||||
$db =& MDB2::factory($db, $db_options);
|
||||
$db = MDB2::factory($db, $db_options);
|
||||
}
|
||||
|
||||
if (PEAR::isError($db)) {
|
||||
return $db;
|
||||
}
|
||||
$this->db =& $db;
|
||||
|
||||
$this->db = $db;
|
||||
$this->db->loadModule('Datatype');
|
||||
$this->db->loadModule('Manager');
|
||||
$this->db->loadModule('Reverse');
|
||||
@@ -377,7 +377,7 @@ class MDB2_Schema extends PEAR
|
||||
$dtd_file = $this->options['dtd_file'];
|
||||
if ($dtd_file) {
|
||||
include_once 'XML/DTD/XmlValidator.php';
|
||||
$dtd =new XML_DTD_XmlValidator;
|
||||
$dtd = new XML_DTD_XmlValidator;
|
||||
if (!$dtd->isValid($dtd_file, $input_file)) {
|
||||
return $this->raiseError(MDB2_SCHEMA_ERROR_PARSE, null, null, $dtd->getMessage());
|
||||
}
|
||||
@@ -390,7 +390,16 @@ class MDB2_Schema extends PEAR
|
||||
return $result;
|
||||
}
|
||||
|
||||
$parser =new $class_name($variables, $fail_on_invalid_names, $structure, $this->options['valid_types'], $this->options['force_defaults']);
|
||||
$max_identifiers_length = null;
|
||||
if (isset($this->db->options['max_identifiers_length'])) {
|
||||
$max_identifiers_length = $this->db->options['max_identifiers_length'];
|
||||
}
|
||||
|
||||
$parser = new $class_name($variables, $fail_on_invalid_names, $structure,
|
||||
$this->options['valid_types'], $this->options['force_defaults'],
|
||||
$max_identifiers_length
|
||||
);
|
||||
|
||||
$result = $parser->setInputFile($input_file);
|
||||
if (PEAR::isError($result)) {
|
||||
return $result;
|
||||
@@ -425,6 +434,7 @@ class MDB2_Schema extends PEAR
|
||||
return $this->raiseError(MDB2_SCHEMA_ERROR_INVALID, null, null,
|
||||
'it was not specified a valid database name');
|
||||
}
|
||||
|
||||
$class_name = $this->options['validate'];
|
||||
|
||||
$result = MDB2::loadClass($class_name, $this->db->getOption('debug'));
|
||||
@@ -432,7 +442,17 @@ class MDB2_Schema extends PEAR
|
||||
return $result;
|
||||
}
|
||||
|
||||
$val =new $class_name($this->options['fail_on_invalid_names'], $this->options['valid_types'], $this->options['force_defaults']);
|
||||
$max_identifiers_length = null;
|
||||
if (isset($this->db->options['max_identifiers_length'])) {
|
||||
$max_identifiers_length = $this->db->options['max_identifiers_length'];
|
||||
}
|
||||
|
||||
$val = new $class_name(
|
||||
$this->options['fail_on_invalid_names'],
|
||||
$this->options['valid_types'],
|
||||
$this->options['force_defaults'],
|
||||
$max_identifiers_length
|
||||
);
|
||||
|
||||
$database_definition = array(
|
||||
'name' => $database,
|
||||
@@ -466,7 +486,7 @@ class MDB2_Schema extends PEAR
|
||||
'initialization' => array()
|
||||
);
|
||||
|
||||
$table_definition =& $database_definition['tables'][$table_name];
|
||||
$table_definition = $database_definition['tables'][$table_name];
|
||||
foreach ($fields as $field_name) {
|
||||
$definition = $this->db->reverse->getTableFieldDefinition($table_name, $field_name);
|
||||
if (PEAR::isError($definition)) {
|
||||
@@ -624,6 +644,7 @@ class MDB2_Schema extends PEAR
|
||||
if (PEAR::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
$database_definition['tables'][$table_name]=$table_definition;
|
||||
|
||||
}
|
||||
|
||||
@@ -1451,16 +1472,17 @@ class MDB2_Schema extends PEAR
|
||||
$changes['tables'] = MDB2_Schema::arrayMergeClobber($changes['tables'], $change);
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($previous_definition['tables'])
|
||||
&& is_array($previous_definition['tables'])) {
|
||||
foreach ($previous_definition['tables'] as $table_name => $table) {
|
||||
if (empty($defined_tables[$table_name])) {
|
||||
$changes['tables']['remove'][$table_name] = true;
|
||||
}
|
||||
}
|
||||
if (!empty($previous_definition['tables'])
|
||||
&& is_array($previous_definition['tables'])
|
||||
) {
|
||||
foreach ($previous_definition['tables'] as $table_name => $table) {
|
||||
if (empty($defined_tables[$table_name])) {
|
||||
$changes['tables']['remove'][$table_name] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($current_definition['sequences']) && is_array($current_definition['sequences'])) {
|
||||
$changes['sequences'] = $defined_sequences = array();
|
||||
foreach ($current_definition['sequences'] as $sequence_name => $sequence) {
|
||||
@@ -1480,14 +1502,17 @@ class MDB2_Schema extends PEAR
|
||||
$changes['sequences'] = MDB2_Schema::arrayMergeClobber($changes['sequences'], $change);
|
||||
}
|
||||
}
|
||||
if (!empty($previous_definition['sequences']) && is_array($previous_definition['sequences'])) {
|
||||
foreach ($previous_definition['sequences'] as $sequence_name => $sequence) {
|
||||
if (empty($defined_sequences[$sequence_name])) {
|
||||
$changes['sequences']['remove'][$sequence_name] = true;
|
||||
}
|
||||
}
|
||||
if (!empty($previous_definition['sequences'])
|
||||
&& is_array($previous_definition['sequences'])
|
||||
) {
|
||||
foreach ($previous_definition['sequences'] as $sequence_name => $sequence) {
|
||||
if (empty($defined_sequences[$sequence_name])) {
|
||||
$changes['sequences']['remove'][$sequence_name] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $changes;
|
||||
}
|
||||
|
||||
@@ -2018,9 +2043,10 @@ class MDB2_Schema extends PEAR
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->options['drop_missing_tables']
|
||||
if ($this->options['drop_obsolete_objects']
|
||||
&& !empty($changes['remove'])
|
||||
&& is_array($changes['remove'])) {
|
||||
&& is_array($changes['remove'])
|
||||
) {
|
||||
foreach ($changes['remove'] as $table_name => $table) {
|
||||
$result = $this->db->manager->dropTable($table_name);
|
||||
if (PEAR::isError($result)) {
|
||||
@@ -2101,7 +2127,10 @@ class MDB2_Schema extends PEAR
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($changes['remove']) && is_array($changes['remove'])) {
|
||||
if ($this->options['drop_obsolete_objects']
|
||||
&& !empty($changes['remove'])
|
||||
&& is_array($changes['remove'])
|
||||
) {
|
||||
foreach ($changes['remove'] as $sequence_name => $sequence) {
|
||||
$result = $this->db->manager->dropSequence($sequence_name);
|
||||
if (PEAR::isError($result)) {
|
||||
@@ -2228,7 +2257,7 @@ class MDB2_Schema extends PEAR
|
||||
}
|
||||
|
||||
if (!empty($changes['tables']['remove']) && is_array($changes['tables']['remove'])) {
|
||||
if ($this->options['drop_missing_tables']) {
|
||||
if ($this->options['drop_obsolete_objects']) {
|
||||
foreach ($changes['tables']['remove'] as $table_name => $table) {
|
||||
$this->db->debug("$table_name:", __FUNCTION__);
|
||||
$this->db->debug("\tRemoved table '$table_name'", __FUNCTION__);
|
||||
@@ -2334,9 +2363,15 @@ class MDB2_Schema extends PEAR
|
||||
}
|
||||
}
|
||||
if (!empty($changes['sequences']['remove']) && is_array($changes['sequences']['remove'])) {
|
||||
foreach ($changes['sequences']['remove'] as $sequence_name => $sequence) {
|
||||
$this->db->debug("$sequence_name:", __FUNCTION__);
|
||||
$this->db->debug("\tAdded sequence '$sequence_name'", __FUNCTION__);
|
||||
if ($this->options['drop_obsolete_objects']) {
|
||||
foreach ($changes['sequences']['remove'] as $sequence_name => $sequence) {
|
||||
$this->db->debug("$sequence_name:", __FUNCTION__);
|
||||
$this->db->debug("\tRemoved sequence '$sequence_name'", __FUNCTION__);
|
||||
}
|
||||
} else {
|
||||
foreach ($changes['sequences']['remove'] as $sequence_name => $sequence) {
|
||||
$this->db->debug("\tObsolete sequence '$sequence_name' left as is", __FUNCTION__);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!empty($changes['sequences']['change']) && is_array($changes['sequences']['change'])) {
|
||||
@@ -2692,9 +2727,9 @@ class MDB2_Schema extends PEAR
|
||||
* @access public
|
||||
* @see PEAR_Error
|
||||
*/
|
||||
function &raiseError($code = null, $mode = null, $options = null, $userinfo = null)
|
||||
static function &raiseError($code = null, $mode = null, $options = null, $userinfo = null, $dummy1 = null, $dummy2 = null, $dummy3 = false)
|
||||
{
|
||||
$err =& PEAR::raiseError(null, $code, $mode, $options,
|
||||
$err = PEAR::raiseError(null, $code, $mode, $options,
|
||||
$userinfo, 'MDB2_Schema_Error', true);
|
||||
return $err;
|
||||
}
|
||||
@@ -2713,7 +2748,7 @@ class MDB2_Schema extends PEAR
|
||||
* @return bool true if parameter is an error
|
||||
* @access public
|
||||
*/
|
||||
function isError($data, $code = null)
|
||||
static function isError($data, $code = null)
|
||||
{
|
||||
if (is_a($data, 'MDB2_Schema_Error')) {
|
||||
if (is_null($code)) {
|
||||
@@ -2760,4 +2795,3 @@ class MDB2_Schema_Error extends PEAR_Error
|
||||
$mode, $level, $debuginfo);
|
||||
}
|
||||
}
|
||||
?>
|
||||
+110
-26
@@ -1,8 +1,6 @@
|
||||
<?php
|
||||
<?php /* vim: se et ts=4 sw=4 sts=4 fdm=marker tw=80: */
|
||||
/**
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* Copyright (c) 1998-2008 Manuel Lemos, Tomas V.V.Cox,
|
||||
* Copyright (c) 1998-2010 Manuel Lemos, Tomas V.V.Cox,
|
||||
* Stig. S. Bakken, Lukas Smith, Igor Feghali
|
||||
* All rights reserved.
|
||||
*
|
||||
@@ -39,23 +37,19 @@
|
||||
* WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Author: Christian Dickmann <dickmann@php.net>
|
||||
* Author: Igor Feghali <ifeghali@php.net>
|
||||
*
|
||||
* $Id: Parser.php,v 1.68 2008/11/30 03:34:00 clockwerx Exp $
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Database
|
||||
* @package MDB2_Schema
|
||||
* @author Christian Dickmann <dickmann@php.net>
|
||||
* @author Igor Feghali <ifeghali@php.net>
|
||||
* @license BSD http://www.opensource.org/licenses/bsd-license.php
|
||||
* @version CVS: $Id: Parser.php,v 1.68 2008/11/30 03:34:00 clockwerx Exp $
|
||||
* @version SVN: $Id$
|
||||
* @link http://pear.php.net/packages/MDB2_Schema
|
||||
*/
|
||||
|
||||
|
||||
oc_require_once('XML/Parser.php');
|
||||
oc_require_once('MDB2/Schema/Validate.php');
|
||||
require_once 'XML/Parser.php';
|
||||
require_once 'MDB2/Schema/Validate.php';
|
||||
|
||||
/**
|
||||
* Parses an XML schema file
|
||||
@@ -114,27 +108,83 @@ class MDB2_Schema_Parser extends XML_Parser
|
||||
|
||||
var $val;
|
||||
|
||||
/**
|
||||
* PHP 5 constructor
|
||||
*
|
||||
* @param array $variables mixed array with user defined schema
|
||||
* variables
|
||||
* @param bool $fail_on_invalid_names array with reserved words per RDBMS
|
||||
* @param array $structure multi dimensional array with
|
||||
* database schema and data
|
||||
* @param array $valid_types information of all valid fields
|
||||
* types
|
||||
* @param bool $force_defaults if true sets a default value to
|
||||
* field when not explicit
|
||||
* @param int $max_identifiers_length maximum allowed size for entities
|
||||
* name
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @access public
|
||||
* @static
|
||||
*/
|
||||
function __construct($variables, $fail_on_invalid_names = true,
|
||||
$structure = false, $valid_types = array(),
|
||||
$force_defaults = true)
|
||||
{
|
||||
$structure = false, $valid_types = array(), $force_defaults = true,
|
||||
$max_identifiers_length = null
|
||||
) {
|
||||
// force ISO-8859-1 due to different defaults for PHP4 and PHP5
|
||||
// todo: this probably needs to be investigated some more andcleaned up
|
||||
parent::XML_Parser('ISO-8859-1');
|
||||
parent::__construct('ISO-8859-1');
|
||||
|
||||
$this->variables = $variables;
|
||||
$this->structure = $structure;
|
||||
$this->val =new MDB2_Schema_Validate($fail_on_invalid_names, $valid_types, $force_defaults);
|
||||
$this->val = new MDB2_Schema_Validate(
|
||||
$fail_on_invalid_names,
|
||||
$valid_types,
|
||||
$force_defaults,
|
||||
$max_identifiers_length
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* PHP 4 compatible constructor
|
||||
*
|
||||
* @param array $variables mixed array with user defined schema
|
||||
* variables
|
||||
* @param bool $fail_on_invalid_names array with reserved words per RDBMS
|
||||
* @param array $structure multi dimensional array with
|
||||
* database schema and data
|
||||
* @param array $valid_types information of all valid fields
|
||||
* types
|
||||
* @param bool $force_defaults if true sets a default value to
|
||||
* field when not explicit
|
||||
* @param int $max_identifiers_length maximum allowed size for entities
|
||||
* name
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @access public
|
||||
* @static
|
||||
*/
|
||||
function MDB2_Schema_Parser($variables, $fail_on_invalid_names = true,
|
||||
$structure = false, $valid_types = array(),
|
||||
$force_defaults = true)
|
||||
{
|
||||
$structure = false, $valid_types = array(), $force_defaults = true,
|
||||
$max_identifiers_length = null
|
||||
) {
|
||||
$this->__construct($variables, $fail_on_invalid_names, $structure, $valid_types, $force_defaults);
|
||||
}
|
||||
|
||||
function startHandler($xp, $element, $attribs)
|
||||
/**
|
||||
* Triggered when reading a XML open tag <element>
|
||||
*
|
||||
* @param resource $xp xml parser resource
|
||||
* @param string $element element name
|
||||
* @param array $attribs attributes
|
||||
*
|
||||
* @return void
|
||||
* @access private
|
||||
* @static
|
||||
*/
|
||||
function startHandler($xp, $element, &$attribs)
|
||||
{
|
||||
if (strtolower($element) == 'variable') {
|
||||
$this->var_mode = true;
|
||||
@@ -335,12 +385,21 @@ class MDB2_Schema_Parser extends XML_Parser
|
||||
'start' => '',
|
||||
'description' => '',
|
||||
'comments' => '',
|
||||
'on' => array('table' => '', 'field' => '')
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggered when reading a XML close tag </element>
|
||||
*
|
||||
* @param resource $xp xml parser resource
|
||||
* @param string $element element name
|
||||
*
|
||||
* @return void
|
||||
* @access private
|
||||
* @static
|
||||
*/
|
||||
function endHandler($xp, $element)
|
||||
{
|
||||
if (strtolower($element) == 'variable') {
|
||||
@@ -503,7 +562,21 @@ class MDB2_Schema_Parser extends XML_Parser
|
||||
$this->element = implode('-', $this->elements);
|
||||
}
|
||||
|
||||
function &raiseError($msg = null, $xmlecode = 0, $xp = null, $ecode = MDB2_SCHEMA_ERROR_PARSE)
|
||||
/**
|
||||
* Pushes a MDB2_Schema_Error into stack and returns it
|
||||
*
|
||||
* @param string $msg textual message
|
||||
* @param int $xmlecode PHP's XML parser error code
|
||||
* @param resource $xp xml parser resource
|
||||
* @param int $ecode MDB2_Schema's error code
|
||||
*
|
||||
* @return object
|
||||
* @access private
|
||||
* @static
|
||||
*/
|
||||
static function &raiseError($msg = null, $xmlecode = 0, $xp = null, $ecode = MDB2_SCHEMA_ERROR_PARSE, $userinfo = null,
|
||||
$error_class = null,
|
||||
$skipmsg = false)
|
||||
{
|
||||
if (is_null($this->error)) {
|
||||
$error = '';
|
||||
@@ -530,11 +603,21 @@ class MDB2_Schema_Parser extends XML_Parser
|
||||
|
||||
$error .= "\n";
|
||||
|
||||
$this->error =& MDB2_Schema::raiseError($ecode, null, null, $error);
|
||||
$this->error = MDB2_Schema::raiseError($ecode, null, null, $error);
|
||||
}
|
||||
return $this->error;
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggered when reading data in a XML element (text between tags)
|
||||
*
|
||||
* @param resource $xp xml parser resource
|
||||
* @param string $data text
|
||||
*
|
||||
* @return void
|
||||
* @access private
|
||||
* @static
|
||||
*/
|
||||
function cdataHandler($xp, $data)
|
||||
{
|
||||
if ($this->var_mode == true) {
|
||||
@@ -806,6 +889,9 @@ class MDB2_Schema_Parser extends XML_Parser
|
||||
case 'database-sequence-comments':
|
||||
$this->sequence['comments'] .= $data;
|
||||
break;
|
||||
case 'database-sequence-on':
|
||||
$this->sequence['on'] = array('table' => '', 'field' => '');
|
||||
break;
|
||||
case 'database-sequence-on-table':
|
||||
$this->sequence['on']['table'] .= $data;
|
||||
break;
|
||||
@@ -815,5 +901,3 @@ class MDB2_Schema_Parser extends XML_Parser
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
+226
-21
@@ -1,8 +1,6 @@
|
||||
<?php
|
||||
<?php /* vim: se et ts=4 sw=4 sts=4 fdm=marker tw=80: */
|
||||
/**
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* Copyright (c) 1998-2008 Manuel Lemos, Tomas V.V.Cox,
|
||||
* Copyright (c) 1998-2010 Manuel Lemos, Tomas V.V.Cox,
|
||||
* Stig. S. Bakken, Lukas Smith, Igor Feghali
|
||||
* All rights reserved.
|
||||
*
|
||||
@@ -39,13 +37,13 @@
|
||||
* WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Author: Igor Feghali <ifeghali@php.net>
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Database
|
||||
* @package MDB2_Schema
|
||||
* @author Igor Feghali <ifeghali@php.net>
|
||||
* @license BSD http://www.opensource.org/licenses/bsd-license.php
|
||||
* @version CVS: $Id: Parser2.php,v 1.12 2008/11/30 03:34:00 clockwerx Exp $
|
||||
* @version SVN: $Id$
|
||||
* @link http://pear.php.net/packages/MDB2_Schema
|
||||
*/
|
||||
|
||||
@@ -100,8 +98,30 @@ class MDB2_Schema_Parser2 extends XML_Unserializer
|
||||
|
||||
var $init = array();
|
||||
|
||||
function __construct($variables, $fail_on_invalid_names = true, $structure = false, $valid_types = array(), $force_defaults = true)
|
||||
{
|
||||
/**
|
||||
* PHP 5 constructor
|
||||
*
|
||||
* @param array $variables mixed array with user defined schema
|
||||
* variables
|
||||
* @param bool $fail_on_invalid_names array with reserved words per RDBMS
|
||||
* @param array $structure multi dimensional array with
|
||||
* database schema and data
|
||||
* @param array $valid_types information of all valid fields
|
||||
* types
|
||||
* @param bool $force_defaults if true sets a default value to
|
||||
* field when not explicit
|
||||
* @param int $max_identifiers_length maximum allowed size for entities
|
||||
* name
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @access public
|
||||
* @static
|
||||
*/
|
||||
function __construct($variables, $fail_on_invalid_names = true,
|
||||
$structure = false, $valid_types = array(), $force_defaults = true,
|
||||
$max_identifiers_length = null
|
||||
) {
|
||||
// force ISO-8859-1 due to different defaults for PHP4 and PHP5
|
||||
// todo: this probably needs to be investigated some more and cleaned up
|
||||
$this->options['encoding'] = 'ISO-8859-1';
|
||||
@@ -119,15 +139,44 @@ class MDB2_Schema_Parser2 extends XML_Unserializer
|
||||
$this->variables = $variables;
|
||||
$this->structure = $structure;
|
||||
|
||||
$this->val =& new MDB2_Schema_Validate($fail_on_invalid_names, $valid_types, $force_defaults);
|
||||
$this->val = new MDB2_Schema_Validate($fail_on_invalid_names, $valid_types, $force_defaults);
|
||||
parent::XML_Unserializer($this->options);
|
||||
}
|
||||
|
||||
function MDB2_Schema_Parser2($variables, $fail_on_invalid_names = true, $structure = false, $valid_types = array(), $force_defaults = true)
|
||||
{
|
||||
/**
|
||||
* PHP 4 compatible constructor
|
||||
*
|
||||
* @param array $variables mixed array with user defined schema
|
||||
* variables
|
||||
* @param bool $fail_on_invalid_names array with reserved words per RDBMS
|
||||
* @param array $structure multi dimensional array with
|
||||
* database schema and data
|
||||
* @param array $valid_types information of all valid fields
|
||||
* types
|
||||
* @param bool $force_defaults if true sets a default value to
|
||||
* field when not explicit
|
||||
* @param int $max_identifiers_length maximum allowed size for entities
|
||||
* name
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @access public
|
||||
* @static
|
||||
*/
|
||||
function MDB2_Schema_Parser2($variables, $fail_on_invalid_names = true,
|
||||
$structure = false, $valid_types = array(), $force_defaults = true,
|
||||
$max_identifiers_length = null
|
||||
) {
|
||||
$this->__construct($variables, $fail_on_invalid_names, $structure, $valid_types, $force_defaults);
|
||||
}
|
||||
|
||||
/**
|
||||
* Main method. Parses XML Schema File.
|
||||
*
|
||||
* @return bool|error object
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function parse()
|
||||
{
|
||||
$result = $this->unserialize($this->filename, true);
|
||||
@@ -140,18 +189,33 @@ class MDB2_Schema_Parser2 extends XML_Unserializer
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Do the necessary stuff to set the input XML schema file
|
||||
*
|
||||
* @param string $filename full path to schema file
|
||||
*
|
||||
* @return boolean MDB2_OK on success
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function setInputFile($filename)
|
||||
{
|
||||
$this->filename = $filename;
|
||||
return MDB2_OK;
|
||||
}
|
||||
|
||||
function renameKey(&$arr, $oKey, $nKey)
|
||||
{
|
||||
$arr[$nKey] = &$arr[$oKey];
|
||||
unset($arr[$oKey]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Enforce the default values for mandatory keys and ensure everything goes
|
||||
* always in the same order (simulates the behaviour of the original
|
||||
* parser). Works at database level.
|
||||
*
|
||||
* @param array $database multi dimensional array with database definition
|
||||
* and data.
|
||||
*
|
||||
* @return bool|error MDB2_OK on success or error object
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
function fixDatabaseKeys($database)
|
||||
{
|
||||
$this->database_definition = array(
|
||||
@@ -204,6 +268,18 @@ class MDB2_Schema_Parser2 extends XML_Unserializer
|
||||
return MDB2_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enforce the default values for mandatory keys and ensure everything goes
|
||||
* always in the same order (simulates the behaviour of the original
|
||||
* parser). Works at table level.
|
||||
*
|
||||
* @param array $table multi dimensional array with table definition
|
||||
* and data.
|
||||
*
|
||||
* @return bool|error MDB2_OK on success or error object
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
function fixTableKeys($table)
|
||||
{
|
||||
$this->table = array(
|
||||
@@ -279,6 +355,17 @@ class MDB2_Schema_Parser2 extends XML_Unserializer
|
||||
return MDB2_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enforce the default values for mandatory keys and ensure everything goes
|
||||
* always in the same order (simulates the behaviour of the original
|
||||
* parser). Works at table field level.
|
||||
*
|
||||
* @param array $field array with table field definition
|
||||
*
|
||||
* @return bool|error MDB2_OK on success or error object
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
function fixTableFieldKeys($field)
|
||||
{
|
||||
$this->field = array();
|
||||
@@ -328,6 +415,17 @@ class MDB2_Schema_Parser2 extends XML_Unserializer
|
||||
return MDB2_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enforce the default values for mandatory keys and ensure everything goes
|
||||
* always in the same order (simulates the behaviour of the original
|
||||
* parser). Works at table index level.
|
||||
*
|
||||
* @param array $index array with table index definition
|
||||
*
|
||||
* @return bool|error MDB2_OK on success or error object
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
function fixTableIndexKeys($index)
|
||||
{
|
||||
$this->index = array(
|
||||
@@ -389,6 +487,17 @@ class MDB2_Schema_Parser2 extends XML_Unserializer
|
||||
return MDB2_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enforce the default values for mandatory keys and ensure everything goes
|
||||
* always in the same order (simulates the behaviour of the original
|
||||
* parser). Works at table constraint level.
|
||||
*
|
||||
* @param array $constraint array with table index definition
|
||||
*
|
||||
* @return bool|error MDB2_OK on success or error object
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
function fixTableConstraintKeys($constraint)
|
||||
{
|
||||
$this->constraint = array(
|
||||
@@ -468,6 +577,18 @@ class MDB2_Schema_Parser2 extends XML_Unserializer
|
||||
return MDB2_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enforce the default values for mandatory keys and ensure everything goes
|
||||
* always in the same order (simulates the behaviour of the original
|
||||
* parser). Works at table data level.
|
||||
*
|
||||
* @param array $element multi dimensional array with query definition
|
||||
* @param string $type whether its a insert|update|delete query
|
||||
*
|
||||
* @return bool|error MDB2_OK on success or error object
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
function fixTableInitializationKeys($element, $type = '')
|
||||
{
|
||||
if (!empty($element['select']) && is_array($element['select'])) {
|
||||
@@ -480,6 +601,43 @@ class MDB2_Schema_Parser2 extends XML_Unserializer
|
||||
$this->table['initialization'][] = array( 'type' => $type, 'data' => $this->init );
|
||||
}
|
||||
|
||||
/**
|
||||
* Enforce the default values for mandatory keys and ensure everything goes
|
||||
* always in the same order (simulates the behaviour of the original
|
||||
* parser). Works deeper at the table initialization level (data). At this
|
||||
* point we are look at one of the below:
|
||||
*
|
||||
* <insert>
|
||||
* {field}+
|
||||
* </insert>
|
||||
*
|
||||
* <select> (this is a select extracted off a insert-select query)
|
||||
* <table/>
|
||||
* {field}+
|
||||
* <where>
|
||||
* {expression}
|
||||
* </where>?
|
||||
* </select>
|
||||
*
|
||||
* <update>
|
||||
* {field}+
|
||||
* <where>
|
||||
* {expression}
|
||||
* </where>?
|
||||
* </update>
|
||||
*
|
||||
* <delete>
|
||||
* <where>
|
||||
* {expression}
|
||||
* </where>
|
||||
* </delete>
|
||||
*
|
||||
* @param array $element multi dimensional array with query definition
|
||||
*
|
||||
* @return bool|error MDB2_OK on success or error object
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
function fixTableInitializationDataKeys($element)
|
||||
{
|
||||
$this->init = array();
|
||||
@@ -505,6 +663,22 @@ class MDB2_Schema_Parser2 extends XML_Unserializer
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursively diggs into an "expression" element. According to our
|
||||
* documentation an "expression" element is of the kind:
|
||||
*
|
||||
* <expression>
|
||||
* <null/> or <value/> or <column/> or {function} or {expression}
|
||||
* <operator/>
|
||||
* <null/> or <value/> or <column/> or {function} or {expression}
|
||||
* </expression>
|
||||
*
|
||||
* @param array &$arr reference to current element definition
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
function setExpression(&$arr)
|
||||
{
|
||||
$element = each($arr);
|
||||
@@ -555,6 +729,30 @@ class MDB2_Schema_Parser2 extends XML_Unserializer
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Enforce the default values for mandatory keys and ensure everything goes
|
||||
* always in the same order (simulates the behaviour of the original
|
||||
* parser). Works at database sequences level. A "sequence" element looks
|
||||
* like:
|
||||
*
|
||||
* <sequence>
|
||||
* <name/>
|
||||
* <was/>?
|
||||
* <start/>?
|
||||
* <description/>?
|
||||
* <comments/>?
|
||||
* <on>
|
||||
* <table/>
|
||||
* <field/>
|
||||
* </on>?
|
||||
* </sequence>
|
||||
*
|
||||
* @param array $sequence multi dimensional array with sequence definition
|
||||
*
|
||||
* @return bool|error MDB2_OK on success or error object
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
function fixSequenceKeys($sequence)
|
||||
{
|
||||
$this->sequence = array(
|
||||
@@ -562,7 +760,6 @@ class MDB2_Schema_Parser2 extends XML_Unserializer
|
||||
'start' => '',
|
||||
'description' => '',
|
||||
'comments' => '',
|
||||
'on' => array('table' => '', 'field' => '')
|
||||
);
|
||||
|
||||
if (!empty($sequence['name'])) {
|
||||
@@ -610,15 +807,23 @@ class MDB2_Schema_Parser2 extends XML_Unserializer
|
||||
return MDB2_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pushes a MDB2_Schema_Error into stack and returns it
|
||||
*
|
||||
* @param string $msg textual message
|
||||
* @param int $ecode MDB2_Schema's error code
|
||||
*
|
||||
* @return object
|
||||
* @access private
|
||||
* @static
|
||||
*/
|
||||
function &raiseError($msg = null, $ecode = MDB2_SCHEMA_ERROR_PARSE)
|
||||
{
|
||||
if (is_null($this->error)) {
|
||||
$error = 'Parser error: '.$msg."\n";
|
||||
|
||||
$this->error =& MDB2_Schema::raiseError($ecode, null, null, $error);
|
||||
$this->error = MDB2_Schema::raiseError($ecode, null, null, $error);
|
||||
}
|
||||
return $this->error;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
+48
-47
@@ -1,49 +1,51 @@
|
||||
<?php
|
||||
// {{{ Disclaimer, Licence, copyrights
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP versions 4 and 5 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1998-2006 Manuel Lemos, Tomas V.V.Cox, |
|
||||
// | Stig. S. Bakken, Lukas Smith |
|
||||
// | All rights reserved. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | MDB2 is a merge of PEAR DB and Metabases that provides a unified DB |
|
||||
// | API as well as database abstraction for PHP applications. |
|
||||
// | This LICENSE is in the BSD license style. |
|
||||
// | |
|
||||
// | Redistribution and use in source and binary forms, with or without |
|
||||
// | modification, are permitted provided that the following conditions |
|
||||
// | are met: |
|
||||
// | |
|
||||
// | Redistributions of source code must retain the above copyright |
|
||||
// | notice, this list of conditions and the following disclaimer. |
|
||||
// | |
|
||||
// | Redistributions in binary form must reproduce the above copyright |
|
||||
// | notice, this list of conditions and the following disclaimer in the |
|
||||
// | documentation and/or other materials provided with the distribution. |
|
||||
// | |
|
||||
// | Neither the name of Manuel Lemos, Tomas V.V.Cox, Stig. S. Bakken, |
|
||||
// | Lukas Smith nor the names of his contributors may be used to endorse |
|
||||
// | or promote products derived from this software without specific prior|
|
||||
// | written permission. |
|
||||
// | |
|
||||
// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
|
||||
// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
|
||||
// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
|
||||
// | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
|
||||
// | REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
|
||||
// | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
|
||||
// | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS|
|
||||
// | OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
|
||||
// | AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
|
||||
// | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY|
|
||||
// | WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|
||||
// | POSSIBILITY OF SUCH DAMAGE. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Author: Lorenzo Alberton <l.alberton@quipo.it> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// }}}
|
||||
<?php /* vim: se et ts=4 sw=4 sts=4 fdm=marker tw=80: */
|
||||
/**
|
||||
* Copyright (c) 1998-2010 Manuel Lemos, Tomas V.V.Cox,
|
||||
* Stig. S. Bakken, Lukas Smith, Igor Feghali
|
||||
* All rights reserved.
|
||||
*
|
||||
* MDB2_Schema enables users to maintain RDBMS independant schema files
|
||||
* in XML that can be used to manipulate both data and database schemas
|
||||
* This LICENSE is in the BSD license style.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Manuel Lemos, Tomas V.V.Cox, Stig. S. Bakken,
|
||||
* Lukas Smith, Igor Feghali nor the names of his contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
|
||||
* WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Database
|
||||
* @package MDB2_Schema
|
||||
* @author Lorenzo Alberton <l.alberton@quipo.it>
|
||||
* @license BSD http://www.opensource.org/licenses/bsd-license.php
|
||||
* @version SVN: $Id$
|
||||
* @link http://pear.php.net/packages/MDB2_Schema
|
||||
*/
|
||||
// {{{ $GLOBALS['_MDB2_Schema_Reserved']['ibase']
|
||||
/**
|
||||
* Has a list of reserved words of Interbase/Firebird
|
||||
@@ -433,4 +435,3 @@ $GLOBALS['_MDB2_Schema_Reserved']['ibase'] = array(
|
||||
'ZONE',
|
||||
);
|
||||
// }}}
|
||||
?>
|
||||
+260
@@ -0,0 +1,260 @@
|
||||
<?php /* vim: se et ts=4 sw=4 sts=4 fdm=marker tw=80: */
|
||||
/**
|
||||
* Copyright (c) 1998-2010 Manuel Lemos, Tomas V.V.Cox,
|
||||
* Stig. S. Bakken, Lukas Smith, Igor Feghali
|
||||
* All rights reserved.
|
||||
*
|
||||
* MDB2_Schema enables users to maintain RDBMS independant schema files
|
||||
* in XML that can be used to manipulate both data and database schemas
|
||||
* This LICENSE is in the BSD license style.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Manuel Lemos, Tomas V.V.Cox, Stig. S. Bakken,
|
||||
* Lukas Smith, Igor Feghali nor the names of his contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
|
||||
* WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Database
|
||||
* @package MDB2_Schema
|
||||
* @author David Coallier <davidc@php.net>
|
||||
* @license BSD http://www.opensource.org/licenses/bsd-license.php
|
||||
* @version SVN: $Id$
|
||||
* @link http://pear.php.net/packages/MDB2_Schema
|
||||
*/
|
||||
|
||||
// {{{ $GLOBALS['_MDB2_Schema_Reserved']['mssql']
|
||||
/**
|
||||
* Has a list of all the reserved words for mssql.
|
||||
*
|
||||
* @package MDB2_Schema
|
||||
* @category Database
|
||||
* @access protected
|
||||
* @author David Coallier <davidc@php.net>
|
||||
*/
|
||||
$GLOBALS['_MDB2_Schema_Reserved']['mssql'] = array(
|
||||
'ADD',
|
||||
'CURRENT_TIMESTAMP',
|
||||
'GROUP',
|
||||
'OPENQUERY',
|
||||
'SERIALIZABLE',
|
||||
'ALL',
|
||||
'CURRENT_USER',
|
||||
'HAVING',
|
||||
'OPENROWSET',
|
||||
'SESSION_USER',
|
||||
'ALTER',
|
||||
'CURSOR',
|
||||
'HOLDLOCK',
|
||||
'OPTION',
|
||||
'SET',
|
||||
'AND',
|
||||
'DATABASE',
|
||||
'IDENTITY',
|
||||
'OR',
|
||||
'SETUSER',
|
||||
'ANY',
|
||||
'DBCC',
|
||||
'IDENTITYCOL',
|
||||
'ORDER',
|
||||
'SHUTDOWN',
|
||||
'AS',
|
||||
'DEALLOCATE',
|
||||
'IDENTITY_INSERT',
|
||||
'OUTER',
|
||||
'SOME',
|
||||
'ASC',
|
||||
'DECLARE',
|
||||
'IF',
|
||||
'OVER',
|
||||
'STATISTICS',
|
||||
'AUTHORIZATION',
|
||||
'DEFAULT',
|
||||
'IN',
|
||||
'PERCENT',
|
||||
'SUM',
|
||||
'AVG',
|
||||
'DELETE',
|
||||
'INDEX',
|
||||
'PERM',
|
||||
'SYSTEM_USER',
|
||||
'BACKUP',
|
||||
'DENY',
|
||||
'INNER',
|
||||
'PERMANENT',
|
||||
'TABLE',
|
||||
'BEGIN',
|
||||
'DESC',
|
||||
'INSERT',
|
||||
'PIPE',
|
||||
'TAPE',
|
||||
'BETWEEN',
|
||||
'DISK',
|
||||
'INTERSECT',
|
||||
'PLAN',
|
||||
'TEMP',
|
||||
'BREAK',
|
||||
'DISTINCT',
|
||||
'INTO',
|
||||
'PRECISION',
|
||||
'TEMPORARY',
|
||||
'BROWSE',
|
||||
'DISTRIBUTED',
|
||||
'IS',
|
||||
'PREPARE',
|
||||
'TEXTSIZE',
|
||||
'BULK',
|
||||
'DOUBLE',
|
||||
'ISOLATION',
|
||||
'PRIMARY',
|
||||
'THEN',
|
||||
'BY',
|
||||
'DROP',
|
||||
'JOIN',
|
||||
'PRINT',
|
||||
'TO',
|
||||
'CASCADE',
|
||||
'DUMMY',
|
||||
'KEY',
|
||||
'PRIVILEGES',
|
||||
'TOP',
|
||||
'CASE',
|
||||
'DUMP',
|
||||
'KILL',
|
||||
'PROC',
|
||||
'TRAN',
|
||||
'CHECK',
|
||||
'ELSE',
|
||||
'LEFT',
|
||||
'PROCEDURE',
|
||||
'TRANSACTION',
|
||||
'CHECKPOINT',
|
||||
'END',
|
||||
'LEVEL',
|
||||
'PROCESSEXIT',
|
||||
'TRIGGER',
|
||||
'CLOSE',
|
||||
'ERRLVL',
|
||||
'LIKE',
|
||||
'PUBLIC',
|
||||
'TRUNCATE',
|
||||
'CLUSTERED',
|
||||
'ERROREXIT',
|
||||
'LINENO',
|
||||
'RAISERROR',
|
||||
'TSEQUAL',
|
||||
'COALESCE',
|
||||
'ESCAPE',
|
||||
'LOAD',
|
||||
'READ',
|
||||
'UNCOMMITTED',
|
||||
'COLUMN',
|
||||
'EXCEPT',
|
||||
'MAX',
|
||||
'READTEXT',
|
||||
'UNION',
|
||||
'COMMIT',
|
||||
'EXEC',
|
||||
'MIN',
|
||||
'RECONFIGURE',
|
||||
'UNIQUE',
|
||||
'COMMITTED',
|
||||
'EXECUTE',
|
||||
'MIRROREXIT',
|
||||
'REFERENCES',
|
||||
'UPDATE',
|
||||
'COMPUTE',
|
||||
'EXISTS',
|
||||
'NATIONAL',
|
||||
'REPEATABLE',
|
||||
'UPDATETEXT',
|
||||
'CONFIRM',
|
||||
'EXIT',
|
||||
'NOCHECK',
|
||||
'REPLICATION',
|
||||
'USE',
|
||||
'CONSTRAINT',
|
||||
'FETCH',
|
||||
'NONCLUSTERED',
|
||||
'RESTORE',
|
||||
'USER',
|
||||
'CONTAINS',
|
||||
'FILE',
|
||||
'NOT',
|
||||
'RESTRICT',
|
||||
'VALUES',
|
||||
'CONTAINSTABLE',
|
||||
'FILLFACTOR',
|
||||
'NULL',
|
||||
'RETURN',
|
||||
'VARYING',
|
||||
'CONTINUE',
|
||||
'FLOPPY',
|
||||
'NULLIF',
|
||||
'REVOKE',
|
||||
'VIEW',
|
||||
'CONTROLROW',
|
||||
'FOR',
|
||||
'OF',
|
||||
'RIGHT',
|
||||
'WAITFOR',
|
||||
'CONVERT',
|
||||
'FOREIGN',
|
||||
'OFF',
|
||||
'ROLLBACK',
|
||||
'WHEN',
|
||||
'COUNT',
|
||||
'FREETEXT',
|
||||
'OFFSETS',
|
||||
'ROWCOUNT',
|
||||
'WHERE',
|
||||
'CREATE',
|
||||
'FREETEXTTABLE',
|
||||
'ON',
|
||||
'ROWGUIDCOL',
|
||||
'WHILE',
|
||||
'CROSS',
|
||||
'FROM',
|
||||
'ONCE',
|
||||
'RULE',
|
||||
'WITH',
|
||||
'CURRENT',
|
||||
'FULL',
|
||||
'ONLY',
|
||||
'SAVE',
|
||||
'WORK',
|
||||
'CURRENT_DATE',
|
||||
'GOTO',
|
||||
'OPEN',
|
||||
'SCHEMA',
|
||||
'WRITETEXT',
|
||||
'CURRENT_TIME',
|
||||
'GRANT',
|
||||
'OPENDATASOURCE',
|
||||
'SELECT',
|
||||
);
|
||||
//}}}
|
||||
+49
-48
@@ -1,50 +1,52 @@
|
||||
<?php
|
||||
// {{{ Disclaimer, Licence, copyrights
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP versions 4 and 5 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1998-2006 Manuel Lemos, Tomas V.V.Cox, |
|
||||
// | Stig. S. Bakken, Lukas Smith |
|
||||
// | All rights reserved. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | MDB2 is a merge of PEAR DB and Metabases that provides a unified DB |
|
||||
// | API as well as database abstraction for PHP applications. |
|
||||
// | This LICENSE is in the BSD license style. |
|
||||
// | |
|
||||
// | Redistribution and use in source and binary forms, with or without |
|
||||
// | modification, are permitted provided that the following conditions |
|
||||
// | are met: |
|
||||
// | |
|
||||
// | Redistributions of source code must retain the above copyright |
|
||||
// | notice, this list of conditions and the following disclaimer. |
|
||||
// | |
|
||||
// | Redistributions in binary form must reproduce the above copyright |
|
||||
// | notice, this list of conditions and the following disclaimer in the |
|
||||
// | documentation and/or other materials provided with the distribution. |
|
||||
// | |
|
||||
// | Neither the name of Manuel Lemos, Tomas V.V.Cox, Stig. S. Bakken, |
|
||||
// | Lukas Smith nor the names of his contributors may be used to endorse |
|
||||
// | or promote products derived from this software without specific prior|
|
||||
// | written permission. |
|
||||
// | |
|
||||
// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
|
||||
// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
|
||||
// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
|
||||
// | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
|
||||
// | REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
|
||||
// | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
|
||||
// | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS|
|
||||
// | OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
|
||||
// | AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
|
||||
// | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY|
|
||||
// | WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|
||||
// | POSSIBILITY OF SUCH DAMAGE. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Author: David Coallier <davidc@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: mysql.php,v 1.3 2006/03/01 12:16:40 lsmith Exp $
|
||||
// }}}
|
||||
<?php /* vim: se et ts=4 sw=4 sts=4 fdm=marker tw=80: */
|
||||
/**
|
||||
* Copyright (c) 1998-2010 Manuel Lemos, Tomas V.V.Cox,
|
||||
* Stig. S. Bakken, Lukas Smith, Igor Feghali
|
||||
* All rights reserved.
|
||||
*
|
||||
* MDB2_Schema enables users to maintain RDBMS independant schema files
|
||||
* in XML that can be used to manipulate both data and database schemas
|
||||
* This LICENSE is in the BSD license style.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Manuel Lemos, Tomas V.V.Cox, Stig. S. Bakken,
|
||||
* Lukas Smith, Igor Feghali nor the names of his contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
|
||||
* WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Database
|
||||
* @package MDB2_Schema
|
||||
* @author David Coallier <davidc@php.net>
|
||||
* @license BSD http://www.opensource.org/licenses/bsd-license.php
|
||||
* @version SVN: $Id$
|
||||
* @link http://pear.php.net/packages/MDB2_Schema
|
||||
*/
|
||||
|
||||
// {{{ $GLOBALS['_MDB2_Schema_Reserved']['mysql']
|
||||
/**
|
||||
* Has a list of reserved words of mysql
|
||||
@@ -281,4 +283,3 @@ $GLOBALS['_MDB2_Schema_Reserved']['mysql'] = array(
|
||||
'ZEROFILL',
|
||||
);
|
||||
// }}}
|
||||
?>
|
||||
+173
@@ -0,0 +1,173 @@
|
||||
<?php /* vim: se et ts=4 sw=4 sts=4 fdm=marker tw=80: */
|
||||
/**
|
||||
* Copyright (c) 1998-2010 Manuel Lemos, Tomas V.V.Cox,
|
||||
* Stig. S. Bakken, Lukas Smith, Igor Feghali
|
||||
* All rights reserved.
|
||||
*
|
||||
* MDB2_Schema enables users to maintain RDBMS independant schema files
|
||||
* in XML that can be used to manipulate both data and database schemas
|
||||
* This LICENSE is in the BSD license style.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Manuel Lemos, Tomas V.V.Cox, Stig. S. Bakken,
|
||||
* Lukas Smith, Igor Feghali nor the names of his contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
|
||||
* WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Database
|
||||
* @package MDB2_Schema
|
||||
* @author David Coallier <davidc@php.net>
|
||||
* @license BSD http://www.opensource.org/licenses/bsd-license.php
|
||||
* @version SVN: $Id$
|
||||
* @link http://pear.php.net/packages/MDB2_Schema
|
||||
*/
|
||||
|
||||
// {{{ $GLOBALS['_MDB2_Schema_Reserved']['oci8']
|
||||
/**
|
||||
* Has a list of all the reserved words for oracle.
|
||||
*
|
||||
* @package MDB2_Schema
|
||||
* @category Database
|
||||
* @access protected
|
||||
* @author David Coallier <davidc@php.net>
|
||||
*/
|
||||
$GLOBALS['_MDB2_Schema_Reserved']['oci8'] = array(
|
||||
'ACCESS',
|
||||
'ELSE',
|
||||
'MODIFY',
|
||||
'START',
|
||||
'ADD',
|
||||
'EXCLUSIVE',
|
||||
'NOAUDIT',
|
||||
'SELECT',
|
||||
'ALL',
|
||||
'EXISTS',
|
||||
'NOCOMPRESS',
|
||||
'SESSION',
|
||||
'ALTER',
|
||||
'FILE',
|
||||
'NOT',
|
||||
'SET',
|
||||
'AND',
|
||||
'FLOAT',
|
||||
'NOTFOUND ',
|
||||
'SHARE',
|
||||
'ANY',
|
||||
'FOR',
|
||||
'NOWAIT',
|
||||
'SIZE',
|
||||
'ARRAYLEN',
|
||||
'FROM',
|
||||
'NULL',
|
||||
'SMALLINT',
|
||||
'AS',
|
||||
'GRANT',
|
||||
'NUMBER',
|
||||
'SQLBUF',
|
||||
'ASC',
|
||||
'GROUP',
|
||||
'OF',
|
||||
'SUCCESSFUL',
|
||||
'AUDIT',
|
||||
'HAVING',
|
||||
'OFFLINE ',
|
||||
'SYNONYM',
|
||||
'BETWEEN',
|
||||
'IDENTIFIED',
|
||||
'ON',
|
||||
'SYSDATE',
|
||||
'BY',
|
||||
'IMMEDIATE',
|
||||
'ONLINE',
|
||||
'TABLE',
|
||||
'CHAR',
|
||||
'IN',
|
||||
'OPTION',
|
||||
'THEN',
|
||||
'CHECK',
|
||||
'INCREMENT',
|
||||
'OR',
|
||||
'TO',
|
||||
'CLUSTER',
|
||||
'INDEX',
|
||||
'ORDER',
|
||||
'TRIGGER',
|
||||
'COLUMN',
|
||||
'INITIAL',
|
||||
'PCTFREE',
|
||||
'UID',
|
||||
'COMMENT',
|
||||
'INSERT',
|
||||
'PRIOR',
|
||||
'UNION',
|
||||
'COMPRESS',
|
||||
'INTEGER',
|
||||
'PRIVILEGES',
|
||||
'UNIQUE',
|
||||
'CONNECT',
|
||||
'INTERSECT',
|
||||
'PUBLIC',
|
||||
'UPDATE',
|
||||
'CREATE',
|
||||
'INTO',
|
||||
'RAW',
|
||||
'USER',
|
||||
'CURRENT',
|
||||
'IS',
|
||||
'RENAME',
|
||||
'VALIDATE',
|
||||
'DATE',
|
||||
'LEVEL',
|
||||
'RESOURCE',
|
||||
'VALUES',
|
||||
'DECIMAL',
|
||||
'LIKE',
|
||||
'REVOKE',
|
||||
'VARCHAR',
|
||||
'DEFAULT',
|
||||
'LOCK',
|
||||
'ROW',
|
||||
'VARCHAR2',
|
||||
'DELETE',
|
||||
'LONG',
|
||||
'ROWID',
|
||||
'VIEW',
|
||||
'DESC',
|
||||
'MAXEXTENTS',
|
||||
'ROWLABEL',
|
||||
'WHENEVER',
|
||||
'DISTINCT',
|
||||
'MINUS',
|
||||
'ROWNUM',
|
||||
'WHERE',
|
||||
'DROP',
|
||||
'MODE',
|
||||
'ROWS',
|
||||
'WITH',
|
||||
);
|
||||
// }}}
|
||||
+148
@@ -0,0 +1,148 @@
|
||||
<?php /* vim: se et ts=4 sw=4 sts=4 fdm=marker tw=80: */
|
||||
/**
|
||||
* Copyright (c) 1998-2010 Manuel Lemos, Tomas V.V.Cox,
|
||||
* Stig. S. Bakken, Lukas Smith, Igor Feghali
|
||||
* All rights reserved.
|
||||
*
|
||||
* MDB2_Schema enables users to maintain RDBMS independant schema files
|
||||
* in XML that can be used to manipulate both data and database schemas
|
||||
* This LICENSE is in the BSD license style.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Manuel Lemos, Tomas V.V.Cox, Stig. S. Bakken,
|
||||
* Lukas Smith, Igor Feghali nor the names of his contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
|
||||
* WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Database
|
||||
* @package MDB2_Schema
|
||||
* @author Marcelo Santos Araujo <msaraujo@php.net>
|
||||
* @license BSD http://www.opensource.org/licenses/bsd-license.php
|
||||
* @version SVN: $Id$
|
||||
* @link http://pear.php.net/packages/MDB2_Schema
|
||||
*/
|
||||
|
||||
// {{{ $GLOBALS['_MDB2_Schema_Reserved']['pgsql']
|
||||
/**
|
||||
* Has a list of reserved words of pgsql
|
||||
*
|
||||
* @package MDB2_Schema
|
||||
* @category Database
|
||||
* @access protected
|
||||
* @author Marcelo Santos Araujo <msaraujo@php.net>
|
||||
*/
|
||||
$GLOBALS['_MDB2_Schema_Reserved']['pgsql'] = array(
|
||||
'ALL',
|
||||
'ANALYSE',
|
||||
'ANALYZE',
|
||||
'AND',
|
||||
'ANY',
|
||||
'AS',
|
||||
'ASC',
|
||||
'AUTHORIZATION',
|
||||
'BETWEEN',
|
||||
'BINARY',
|
||||
'BOTH',
|
||||
'CASE',
|
||||
'CAST',
|
||||
'CHECK',
|
||||
'COLLATE',
|
||||
'COLUMN',
|
||||
'CONSTRAINT',
|
||||
'CREATE',
|
||||
'CURRENT_DATE',
|
||||
'CURRENT_TIME',
|
||||
'CURRENT_TIMESTAMP',
|
||||
'CURRENT_USER',
|
||||
'DEFAULT',
|
||||
'DEFERRABLE',
|
||||
'DESC',
|
||||
'DISTINCT',
|
||||
'DO',
|
||||
'ELSE',
|
||||
'END',
|
||||
'EXCEPT',
|
||||
'FALSE',
|
||||
'FOR',
|
||||
'FOREIGN',
|
||||
'FREEZE',
|
||||
'FROM',
|
||||
'FULL',
|
||||
'GRANT',
|
||||
'GROUP',
|
||||
'HAVING',
|
||||
'ILIKE',
|
||||
'IN',
|
||||
'INITIALLY',
|
||||
'INNER',
|
||||
'INTERSECT',
|
||||
'INTO',
|
||||
'IS',
|
||||
'ISNULL',
|
||||
'JOIN',
|
||||
'LEADING',
|
||||
'LEFT',
|
||||
'LIKE',
|
||||
'LIMIT',
|
||||
'LOCALTIME',
|
||||
'LOCALTIMESTAMP',
|
||||
'NATURAL',
|
||||
'NEW',
|
||||
'NOT',
|
||||
'NOTNULL',
|
||||
'NULL',
|
||||
'OFF',
|
||||
'OFFSET',
|
||||
'OLD',
|
||||
'ON',
|
||||
'ONLY',
|
||||
'OR',
|
||||
'ORDER',
|
||||
'OUTER',
|
||||
'OVERLAPS',
|
||||
'PLACING',
|
||||
'PRIMARY',
|
||||
'REFERENCES',
|
||||
'SELECT',
|
||||
'SESSION_USER',
|
||||
'SIMILAR',
|
||||
'SOME',
|
||||
'TABLE',
|
||||
'THEN',
|
||||
'TO',
|
||||
'TRAILING',
|
||||
'TRUE',
|
||||
'UNION',
|
||||
'UNIQUE',
|
||||
'USER',
|
||||
'USING',
|
||||
'VERBOSE',
|
||||
'WHEN',
|
||||
'WHERE'
|
||||
);
|
||||
// }}}
|
||||
+47
-24
@@ -1,8 +1,6 @@
|
||||
<?php
|
||||
<?php /* vim: se et ts=4 sw=4 sts=4 fdm=marker tw=80: */
|
||||
/**
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* Copyright (c) 1998-2008 Manuel Lemos, Tomas V.V.Cox,
|
||||
* Copyright (c) 1998-2010 Manuel Lemos, Tomas V.V.Cox,
|
||||
* Stig. S. Bakken, Lukas Smith, Igor Feghali
|
||||
* All rights reserved.
|
||||
*
|
||||
@@ -39,14 +37,13 @@
|
||||
* WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Author: Christian Weiske <cweiske@php.net>
|
||||
* $Id: Tool.php,v 1.6 2008/12/13 00:26:07 clockwerx Exp $
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Database
|
||||
* @package MDB2_Schema
|
||||
* @author Christian Weiske <cweiske@php.net>
|
||||
* @license BSD http://www.opensource.org/licenses/bsd-license.php
|
||||
* @version CVS: $Id: Tool.php,v 1.6 2008/12/13 00:26:07 clockwerx Exp $
|
||||
* @version SVN: $Id$
|
||||
* @link http://pear.php.net/packages/MDB2_Schema
|
||||
*/
|
||||
|
||||
@@ -152,7 +149,9 @@ class MDB2_Schema_Tool
|
||||
case '--init':
|
||||
return 'init';
|
||||
default:
|
||||
throw new MDB2_Schema_Tool_ParameterException("Unknown mode \"$arg\"");
|
||||
throw new MDB2_Schema_Tool_ParameterException(
|
||||
"Unknown mode \"$arg\""
|
||||
);
|
||||
}
|
||||
}//protected function getAction(&$args)
|
||||
|
||||
@@ -179,7 +178,8 @@ class MDB2_Schema_Tool
|
||||
*/
|
||||
protected function doHelp()
|
||||
{
|
||||
self::toStdErr(<<<EOH
|
||||
self::toStdErr(
|
||||
<<<EOH
|
||||
Usage: mdb2_schematool mode parameters
|
||||
|
||||
Works with database schemas
|
||||
@@ -205,7 +205,8 @@ EOH
|
||||
*/
|
||||
protected function doHelpDump()
|
||||
{
|
||||
self::toStdErr( <<<EOH
|
||||
self::toStdErr(
|
||||
<<<EOH
|
||||
Usage: mdb2_schematool dump [all|data|schema] [-p] DSN
|
||||
|
||||
Dumps a database schema to stdout
|
||||
@@ -216,7 +217,8 @@ DSN: Data source name in the form of
|
||||
driver://user:password@host/database
|
||||
|
||||
User and password may be omitted.
|
||||
Using -p reads password from stdin which is more secure than passing it in the parameter.
|
||||
Using -p reads password from stdin which is more secure than passing it in the
|
||||
parameter.
|
||||
|
||||
EOH
|
||||
);
|
||||
@@ -231,7 +233,8 @@ EOH
|
||||
*/
|
||||
protected function doHelpInit()
|
||||
{
|
||||
self::toStdErr( <<<EOH
|
||||
self::toStdErr(
|
||||
<<<EOH
|
||||
Usage: mdb2_schematool init source [-p] destination
|
||||
|
||||
Initializes a database with data
|
||||
@@ -244,7 +247,8 @@ DSN: Data source name in the form of
|
||||
driver://user:password@host/database
|
||||
|
||||
User and password may be omitted.
|
||||
Using -p reads password from stdin which is more secure than passing it in the parameter.
|
||||
Using -p reads password from stdin which is more secure than passing it in the
|
||||
parameter.
|
||||
|
||||
EOH
|
||||
);
|
||||
@@ -259,7 +263,8 @@ EOH
|
||||
*/
|
||||
protected function doHelpLoad()
|
||||
{
|
||||
self::toStdErr( <<<EOH
|
||||
self::toStdErr(
|
||||
<<<EOH
|
||||
Usage: mdb2_schematool load [-p] source [-p] destination
|
||||
|
||||
Loads a database schema from source to destination
|
||||
@@ -272,7 +277,8 @@ DSN: Data source name in the form of
|
||||
driver://user:password@host/database
|
||||
|
||||
User and password may be omitted.
|
||||
Using -p reads password from stdin which is more secure than passing it in the parameter.
|
||||
Using -p reads password from stdin which is more secure than passing it in the
|
||||
parameter.
|
||||
|
||||
EOH
|
||||
);
|
||||
@@ -334,7 +340,9 @@ EOH
|
||||
protected function getFileOrDsn(&$args)
|
||||
{
|
||||
if (count($args) == 0) {
|
||||
throw new MDB2_Schema_Tool_ParameterException('File or DSN expected');
|
||||
throw new MDB2_Schema_Tool_ParameterException(
|
||||
'File or DSN expected'
|
||||
);
|
||||
}
|
||||
|
||||
$arg = array_shift($args);
|
||||
@@ -450,7 +458,8 @@ EOH
|
||||
list($type, $dsn) = $this->getFileOrDsn($args);
|
||||
if ($type == 'file') {
|
||||
throw new MDB2_Schema_Tool_ParameterException(
|
||||
'Dumping a schema file as a schema file does not make much sense'
|
||||
'Dumping a schema file as a schema file does not make much ' .
|
||||
'sense'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -503,8 +512,14 @@ EOH
|
||||
$definition = $schemaDest->parseDatabaseDefinitionFile($dsnSource);
|
||||
$where = 'loading schema file';
|
||||
} else {
|
||||
$schemaSource = MDB2_Schema::factory($dsnSource, $this->getSchemaOptions());
|
||||
$this->throwExceptionOnError($schemaSource, 'connecting to source database');
|
||||
$schemaSource = MDB2_Schema::factory(
|
||||
$dsnSource,
|
||||
$this->getSchemaOptions()
|
||||
);
|
||||
$this->throwExceptionOnError(
|
||||
$schemaSource,
|
||||
'connecting to source database'
|
||||
);
|
||||
|
||||
$definition = $schemaSource->getDefinitionFromDatabase();
|
||||
$where = 'loading definition from database';
|
||||
@@ -514,7 +529,11 @@ EOH
|
||||
|
||||
//create destination database from definition
|
||||
$simulate = false;
|
||||
$op = $schemaDest->createDatabase($definition, array(), $simulate);
|
||||
$op = $schemaDest->createDatabase(
|
||||
$definition,
|
||||
array(),
|
||||
$simulate
|
||||
);
|
||||
$this->throwExceptionOnError($op, 'creating the database');
|
||||
}//protected function doLoad($args)
|
||||
|
||||
@@ -545,10 +564,16 @@ EOH
|
||||
}
|
||||
|
||||
$schemaDest = MDB2_Schema::factory($dsnDest, $this->getSchemaOptions());
|
||||
$this->throwExceptionOnError($schemaDest, 'connecting to destination database');
|
||||
$this->throwExceptionOnError(
|
||||
$schemaDest,
|
||||
'connecting to destination database'
|
||||
);
|
||||
|
||||
$definition = $schemaDest->getDefinitionFromDatabase();
|
||||
$this->throwExceptionOnError($definition, 'loading definition from database');
|
||||
$this->throwExceptionOnError(
|
||||
$definition,
|
||||
'loading definition from database'
|
||||
);
|
||||
|
||||
$op = $schemaDest->writeInitialization($dsnSource, $definition);
|
||||
$this->throwExceptionOnError($op, 'initializing database');
|
||||
@@ -556,5 +581,3 @@ EOH
|
||||
|
||||
|
||||
}//class MDB2_Schema_Tool
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php /* vim: se et ts=4 sw=4 sts=4 fdm=marker tw=80: */
|
||||
/**
|
||||
* Copyright (c) 1998-2010 Manuel Lemos, Tomas V.V.Cox,
|
||||
* Stig. S. Bakken, Lukas Smith, Igor Feghali
|
||||
* All rights reserved.
|
||||
*
|
||||
* MDB2_Schema enables users to maintain RDBMS independant schema files
|
||||
* in XML that can be used to manipulate both data and database schemas
|
||||
* This LICENSE is in the BSD license style.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Manuel Lemos, Tomas V.V.Cox, Stig. S. Bakken,
|
||||
* Lukas Smith, Igor Feghali nor the names of his contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
|
||||
* WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Database
|
||||
* @package MDB2_Schema
|
||||
* @author Christian Weiske <cweiske@php.net>
|
||||
* @license BSD http://www.opensource.org/licenses/bsd-license.php
|
||||
* @version SVN: $Id$
|
||||
* @link http://pear.php.net/packages/MDB2_Schema
|
||||
*/
|
||||
|
||||
/**
|
||||
* To be implemented yet
|
||||
*
|
||||
* @category Database
|
||||
* @package MDB2_Schema
|
||||
* @author Christian Weiske <cweiske@php.net>
|
||||
* @license BSD http://www.opensource.org/licenses/bsd-license.php
|
||||
* @link http://pear.php.net/packages/MDB2_Schema
|
||||
*/
|
||||
class MDB2_Schema_Tool_ParameterException extends Exception
|
||||
{
|
||||
}
|
||||
+184
-80
@@ -1,8 +1,6 @@
|
||||
<?php
|
||||
<?php /* vim: se et ts=4 sw=4 sts=4 fdm=marker tw=80: */
|
||||
/**
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* Copyright (c) 1998-2008 Manuel Lemos, Tomas V.V.Cox,
|
||||
* Copyright (c) 1998-2010 Manuel Lemos, Tomas V.V.Cox,
|
||||
* Stig. S. Bakken, Lukas Smith, Igor Feghali
|
||||
* All rights reserved.
|
||||
*
|
||||
@@ -39,15 +37,14 @@
|
||||
* WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Author: Christian Dickmann <dickmann@php.net>
|
||||
* Author: Igor Feghali <ifeghali@php.net>
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Database
|
||||
* @package MDB2_Schema
|
||||
* @author Christian Dickmann <dickmann@php.net>
|
||||
* @author Igor Feghali <ifeghali@php.net>
|
||||
* @license BSD http://www.opensource.org/licenses/bsd-license.php
|
||||
* @version CVS: $Id: Validate.php,v 1.42 2008/11/30 03:34:00 clockwerx Exp $
|
||||
* @version SVN: $Id$
|
||||
* @link http://pear.php.net/packages/MDB2_Schema
|
||||
*/
|
||||
|
||||
@@ -70,11 +67,30 @@ class MDB2_Schema_Validate
|
||||
|
||||
var $force_defaults = true;
|
||||
|
||||
var $max_identifiers_length = null;
|
||||
|
||||
// }}}
|
||||
// {{{ constructor
|
||||
|
||||
function __construct($fail_on_invalid_names = true, $valid_types = array(), $force_defaults = true)
|
||||
{
|
||||
/**
|
||||
* PHP 5 constructor
|
||||
*
|
||||
* @param bool $fail_on_invalid_names array with reserved words per RDBMS
|
||||
* @param array $valid_types information of all valid fields
|
||||
* types
|
||||
* @param bool $force_defaults if true sets a default value to
|
||||
* field when not explicit
|
||||
* @param int $max_identifiers_length maximum allowed size for entities
|
||||
* name
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @access public
|
||||
* @static
|
||||
*/
|
||||
function __construct($fail_on_invalid_names = true, $valid_types = array(),
|
||||
$force_defaults = true, $max_identifiers_length = null
|
||||
) {
|
||||
if (empty($GLOBALS['_MDB2_Schema_Reserved'])) {
|
||||
$GLOBALS['_MDB2_Schema_Reserved'] = array();
|
||||
}
|
||||
@@ -87,21 +103,49 @@ class MDB2_Schema_Validate
|
||||
} else {
|
||||
$this->fail_on_invalid_names = array();
|
||||
}
|
||||
$this->valid_types = $valid_types;
|
||||
$this->force_defaults = $force_defaults;
|
||||
$this->valid_types = $valid_types;
|
||||
$this->force_defaults = $force_defaults;
|
||||
$this->max_identifiers_length = $max_identifiers_length;
|
||||
}
|
||||
|
||||
function MDB2_Schema_Validate($fail_on_invalid_names = true, $valid_types = array(), $force_defaults = true)
|
||||
{
|
||||
/**
|
||||
* PHP 4 compatible constructor
|
||||
*
|
||||
* @param bool $fail_on_invalid_names array with reserved words per RDBMS
|
||||
* @param array $valid_types information of all valid fields
|
||||
* types
|
||||
* @param bool $force_defaults if true sets a default value to
|
||||
* field when not explicit
|
||||
* @param int $max_identifiers_length maximum allowed size for entities
|
||||
* name
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @access public
|
||||
* @static
|
||||
*/
|
||||
function MDB2_Schema_Validate($fail_on_invalid_names = true, $valid_types = array(),
|
||||
$force_defaults = true, $max_identifiers_length = null
|
||||
) {
|
||||
$this->__construct($fail_on_invalid_names, $valid_types, $force_defaults);
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ raiseError()
|
||||
|
||||
/**
|
||||
* Pushes a MDB2_Schema_Error into stack and returns it
|
||||
*
|
||||
* @param int $ecode MDB2_Schema's error code
|
||||
* @param string $msg textual message
|
||||
*
|
||||
* @return object
|
||||
* @access private
|
||||
* @static
|
||||
*/
|
||||
function &raiseError($ecode, $msg = null)
|
||||
{
|
||||
$error =& MDB2_Schema::raiseError($ecode, null, null, $msg);
|
||||
$error = MDB2_Schema::raiseError($ecode, null, null, $msg);
|
||||
return $error;
|
||||
}
|
||||
|
||||
@@ -176,27 +220,18 @@ class MDB2_Schema_Validate
|
||||
*/
|
||||
function validateTable($tables, &$table, $table_name)
|
||||
{
|
||||
/* Have we got a name? */
|
||||
if (!$table_name) {
|
||||
return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
|
||||
'a table has to have a name');
|
||||
}
|
||||
|
||||
/* Table name duplicated? */
|
||||
if (is_array($tables) && isset($tables[$table_name])) {
|
||||
return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
|
||||
'table "'.$table_name.'" already exists');
|
||||
}
|
||||
|
||||
/* Table name reserved? */
|
||||
if (is_array($this->fail_on_invalid_names)) {
|
||||
$name = strtoupper($table_name);
|
||||
foreach ($this->fail_on_invalid_names as $rdbms) {
|
||||
if (in_array($name, $GLOBALS['_MDB2_Schema_Reserved'][$rdbms])) {
|
||||
return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
|
||||
'table name "'.$table_name.'" is a reserved word in: '.$rdbms);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Valid name ?
|
||||
*/
|
||||
$result = $this->validateIdentifier($table_name, 'table');
|
||||
if (PEAR::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
/* Was */
|
||||
@@ -289,10 +324,12 @@ class MDB2_Schema_Validate
|
||||
*/
|
||||
function validateField($fields, &$field, $field_name)
|
||||
{
|
||||
/* Have we got a name? */
|
||||
if (!$field_name) {
|
||||
return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
|
||||
'field name missing');
|
||||
/**
|
||||
* Valid name ?
|
||||
*/
|
||||
$result = $this->validateIdentifier($field_name, 'field');
|
||||
if (PEAR::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
/* Field name duplicated? */
|
||||
@@ -301,17 +338,6 @@ class MDB2_Schema_Validate
|
||||
'field "'.$field_name.'" already exists');
|
||||
}
|
||||
|
||||
/* Field name reserverd? */
|
||||
if (is_array($this->fail_on_invalid_names)) {
|
||||
$name = strtoupper($field_name);
|
||||
foreach ($this->fail_on_invalid_names as $rdbms) {
|
||||
if (in_array($name, $GLOBALS['_MDB2_Schema_Reserved'][$rdbms])) {
|
||||
return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
|
||||
'field name "'.$field_name.'" is a reserved word in: '.$rdbms);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Type check */
|
||||
if (empty($field['type'])) {
|
||||
return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
|
||||
@@ -422,10 +448,14 @@ class MDB2_Schema_Validate
|
||||
*/
|
||||
function validateIndex($table_indexes, &$index, $index_name)
|
||||
{
|
||||
if (!$index_name) {
|
||||
return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
|
||||
'an index has to have a name');
|
||||
/**
|
||||
* Valid name ?
|
||||
*/
|
||||
$result = $this->validateIdentifier($index_name, 'index');
|
||||
if (PEAR::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
if (is_array($table_indexes) && isset($table_indexes[$index_name])) {
|
||||
return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
|
||||
'index "'.$index_name.'" already exists');
|
||||
@@ -470,14 +500,18 @@ class MDB2_Schema_Validate
|
||||
*/
|
||||
function validateIndexField($index_fields, &$field, $field_name)
|
||||
{
|
||||
/**
|
||||
* Valid name ?
|
||||
*/
|
||||
$result = $this->validateIdentifier($field_name, 'index field');
|
||||
if (PEAR::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
if (is_array($index_fields) && isset($index_fields[$field_name])) {
|
||||
return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
|
||||
'index field "'.$field_name.'" already exists');
|
||||
}
|
||||
if (!$field_name) {
|
||||
return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
|
||||
'the index-field-name is required');
|
||||
}
|
||||
if (empty($field['sorting'])) {
|
||||
$field['sorting'] = 'ascending';
|
||||
} elseif ($field['sorting'] !== 'ascending' && $field['sorting'] !== 'descending') {
|
||||
@@ -506,10 +540,14 @@ class MDB2_Schema_Validate
|
||||
*/
|
||||
function validateConstraint($table_constraints, &$constraint, $constraint_name)
|
||||
{
|
||||
if (!$constraint_name) {
|
||||
return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
|
||||
'a foreign key has to have a name');
|
||||
/**
|
||||
* Valid name ?
|
||||
*/
|
||||
$result = $this->validateIdentifier($constraint_name, 'foreign key');
|
||||
if (PEAR::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
if (is_array($table_constraints) && isset($table_constraints[$constraint_name])) {
|
||||
return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
|
||||
'foreign key "'.$constraint_name.'" already exists');
|
||||
@@ -555,10 +593,14 @@ class MDB2_Schema_Validate
|
||||
*/
|
||||
function validateConstraintField($constraint_fields, $field_name)
|
||||
{
|
||||
if (!$field_name) {
|
||||
return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
|
||||
'empty value for foreign-field');
|
||||
/**
|
||||
* Valid name ?
|
||||
*/
|
||||
$result = $this->validateIdentifier($field_name, 'foreign key field');
|
||||
if (PEAR::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
if (is_array($constraint_fields) && isset($constraint_fields[$field_name])) {
|
||||
return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
|
||||
'foreign field "'.$field_name.'" already exists');
|
||||
@@ -582,10 +624,14 @@ class MDB2_Schema_Validate
|
||||
*/
|
||||
function validateConstraintReferencedField($referenced_fields, $field_name)
|
||||
{
|
||||
if (!$field_name) {
|
||||
return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
|
||||
'empty value for referenced foreign-field');
|
||||
/**
|
||||
* Valid name ?
|
||||
*/
|
||||
$result = $this->validateIdentifier($field_name, 'referenced foreign field');
|
||||
if (PEAR::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
if (is_array($referenced_fields) && isset($referenced_fields[$field_name])) {
|
||||
return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
|
||||
'foreign field "'.$field_name.'" already referenced');
|
||||
@@ -612,9 +658,12 @@ class MDB2_Schema_Validate
|
||||
*/
|
||||
function validateSequence($sequences, &$sequence, $sequence_name)
|
||||
{
|
||||
if (!$sequence_name) {
|
||||
return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
|
||||
'a sequence has to have a name');
|
||||
/**
|
||||
* Valid name ?
|
||||
*/
|
||||
$result = $this->validateIdentifier($sequence_name, 'sequence');
|
||||
if (PEAR::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
if (is_array($sequences) && isset($sequences[$sequence_name])) {
|
||||
@@ -661,21 +710,17 @@ class MDB2_Schema_Validate
|
||||
*/
|
||||
function validateDatabase(&$database)
|
||||
{
|
||||
/* Have we got a name? */
|
||||
if (!is_array($database) || !isset($database['name']) || !$database['name']) {
|
||||
if (!is_array($database)) {
|
||||
return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
|
||||
'a database has to have a name');
|
||||
'something wrong went with database definition');
|
||||
}
|
||||
|
||||
/* Database name reserved? */
|
||||
if (is_array($this->fail_on_invalid_names)) {
|
||||
$name = strtoupper($database['name']);
|
||||
foreach ($this->fail_on_invalid_names as $rdbms) {
|
||||
if (in_array($name, $GLOBALS['_MDB2_Schema_Reserved'][$rdbms])) {
|
||||
return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
|
||||
'database name "'.$database['name'].'" is a reserved word in: '.$rdbms);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Valid name ?
|
||||
*/
|
||||
$result = $this->validateIdentifier($database['name'], 'database');
|
||||
if (PEAR::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
/* Create */
|
||||
@@ -798,9 +843,12 @@ class MDB2_Schema_Validate
|
||||
*/
|
||||
function validateDataField($table_fields, $instruction_fields, &$field)
|
||||
{
|
||||
if (!$field['name']) {
|
||||
return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
|
||||
'field-name has to be specified');
|
||||
/**
|
||||
* Valid name ?
|
||||
*/
|
||||
$result = $this->validateIdentifier($field['name'], 'field');
|
||||
if (PEAR::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
if (is_array($instruction_fields) && isset($instruction_fields[$field['name']])) {
|
||||
@@ -917,6 +965,62 @@ class MDB2_Schema_Validate
|
||||
}
|
||||
return MDB2_OK;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
// }}}
|
||||
// {{{ validateIdentifier()
|
||||
|
||||
/**
|
||||
* Checks whether a given identifier is valid for current driver.
|
||||
*
|
||||
* @param string $id identifier to check
|
||||
* @param string $type whether identifier represents a table name, index, etc.
|
||||
*
|
||||
* @return bool|error object
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function validateIdentifier($id, $type)
|
||||
{
|
||||
$max_length = $this->max_identifiers_length;
|
||||
$cur_length = strlen($id);
|
||||
|
||||
/**
|
||||
* Have we got a name?
|
||||
*/
|
||||
if (!$id) {
|
||||
return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
|
||||
"a $type has to have a name");
|
||||
}
|
||||
|
||||
/**
|
||||
* Supported length ?
|
||||
*/
|
||||
if ($max_length !== null
|
||||
&& $cur_length > $max_length
|
||||
) {
|
||||
return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
|
||||
"$type name '$id' is too long for current driver");
|
||||
} elseif ($cur_length > 30) {
|
||||
// FIXME: find a way to issue a warning in MDB2_Schema object
|
||||
/* $this->warnings[] = "$type name '$id' might not be
|
||||
portable to other drivers"; */
|
||||
}
|
||||
|
||||
/**
|
||||
* Reserved ?
|
||||
*/
|
||||
if (is_array($this->fail_on_invalid_names)) {
|
||||
$name = strtoupper($id);
|
||||
foreach ($this->fail_on_invalid_names as $rdbms) {
|
||||
if (in_array($name, $GLOBALS['_MDB2_Schema_Reserved'][$rdbms])) {
|
||||
return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
|
||||
"$type name '$id' is a reserved word in: $rdbms");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return MDB2_OK;
|
||||
}
|
||||
|
||||
// }}}
|
||||
}
|
||||
+39
-18
@@ -1,8 +1,6 @@
|
||||
<?php
|
||||
<?php /* vim: se et ts=4 sw=4 sts=4 fdm=marker tw=80: */
|
||||
/**
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* Copyright (c) 1998-2008 Manuel Lemos, Tomas V.V.Cox,
|
||||
* Copyright (c) 1998-2010 Manuel Lemos, Tomas V.V.Cox,
|
||||
* Stig. S. Bakken, Lukas Smith, Igor Feghali
|
||||
* All rights reserved.
|
||||
*
|
||||
@@ -39,15 +37,14 @@
|
||||
* WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Author: Lukas Smith <smith@pooteeweet.org>
|
||||
* Author: Igor Feghali <ifeghali@php.net>
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Database
|
||||
* @package MDB2_Schema
|
||||
* @author Lukas Smith <smith@pooteeweet.org>
|
||||
* @author Igor Feghali <ifeghali@php.net>
|
||||
* @license BSD http://www.opensource.org/licenses/bsd-license.php
|
||||
* @version CVS: $Id: Writer.php,v 1.40 2008/11/30 03:34:00 clockwerx Exp $
|
||||
* @version SVN: $Id$
|
||||
* @link http://pear.php.net/packages/MDB2_Schema
|
||||
*/
|
||||
|
||||
@@ -69,11 +66,33 @@ class MDB2_Schema_Writer
|
||||
// }}}
|
||||
// {{{ constructor
|
||||
|
||||
/**
|
||||
* PHP 5 constructor
|
||||
*
|
||||
* @param array $valid_types information of all valid fields
|
||||
* types
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @access public
|
||||
* @static
|
||||
*/
|
||||
function __construct($valid_types = array())
|
||||
{
|
||||
$this->valid_types = $valid_types;
|
||||
}
|
||||
|
||||
/**
|
||||
* PHP 4 compatible constructor
|
||||
*
|
||||
* @param array $valid_types information of all valid fields
|
||||
* types
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @access public
|
||||
* @static
|
||||
*/
|
||||
function MDB2_Schema_Writer($valid_types = array())
|
||||
{
|
||||
$this->__construct($valid_types);
|
||||
@@ -87,15 +106,18 @@ class MDB2_Schema_Writer
|
||||
* callbacks etc. Basically a wrapper for PEAR::raiseError
|
||||
* without the message string.
|
||||
*
|
||||
* @param int|PEAR_Error $code integer error code or and PEAR_Error instance
|
||||
* @param int $mode error mode, see PEAR_Error docs
|
||||
* error level (E_USER_NOTICE etc). If error mode is
|
||||
* PEAR_ERROR_CALLBACK, this is the callback function,
|
||||
* either as a function name, or as an array of an
|
||||
* object and method name. For other error modes this
|
||||
* parameter is ignored.
|
||||
* @param string $options Extra debug information. Defaults to the last
|
||||
* query and native error code.
|
||||
* @param int|PEAR_Error $code integer error code or and PEAR_Error
|
||||
* instance
|
||||
* @param int $mode error mode, see PEAR_Error docs error
|
||||
* level (E_USER_NOTICE etc). If error mode
|
||||
* is PEAR_ERROR_CALLBACK, this is the
|
||||
* callback function, either as a function
|
||||
* name, or as an array of an object and
|
||||
* method name. For other error modes this
|
||||
* parameter is ignored.
|
||||
* @param string $options Extra debug information. Defaults to the
|
||||
* last query and native error code.
|
||||
* @param string $userinfo User-friendly error message
|
||||
*
|
||||
* @return object a PEAR error object
|
||||
* @access public
|
||||
@@ -103,7 +125,7 @@ class MDB2_Schema_Writer
|
||||
*/
|
||||
function &raiseError($code = null, $mode = null, $options = null, $userinfo = null)
|
||||
{
|
||||
$error =& MDB2_Schema::raiseError($code, $mode, $options, $userinfo);
|
||||
$error = MDB2_Schema::raiseError($code, $mode, $options, $userinfo);
|
||||
return $error;
|
||||
}
|
||||
|
||||
@@ -578,4 +600,3 @@ class MDB2_Schema_Writer
|
||||
|
||||
// }}}
|
||||
}
|
||||
?>
|
||||
+113
-62
@@ -1,23 +1,19 @@
|
||||
<?php
|
||||
//
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 5 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available through the world-wide-web at the following url: |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Stig Bakken <ssb@php.net> |
|
||||
// | |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: Guess.php,v 1.13.4.1 2004/10/19 04:15:56 cellog Exp $
|
||||
/**
|
||||
* The OS_Guess class
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Stig Bakken <ssb@php.net>
|
||||
* @author Gregory Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version CVS: $Id: Guess.php 313023 2011-07-06 19:17:11Z dufuz $
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since File available since PEAR 0.1
|
||||
*/
|
||||
|
||||
// {{{ uname examples
|
||||
|
||||
@@ -72,7 +68,7 @@
|
||||
// Darwin home-eden.local 7.5.0 Darwin Kernel Version 7.5.0: Thu Aug 5 19:26:16 PDT 2004; root:xnu/xnu-517.7.21.obj~3/RELEASE_PPC Power Macintosh
|
||||
//
|
||||
// Mac OS X early versions
|
||||
//
|
||||
//
|
||||
|
||||
// }}}
|
||||
|
||||
@@ -80,6 +76,21 @@
|
||||
* - define endianness, to allow matchSignature("bigend") etc.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Retrieves information about the current operating system
|
||||
*
|
||||
* This class uses php_uname() to grok information about the current OS
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Stig Bakken <ssb@php.net>
|
||||
* @author Gregory Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version Release: 1.9.4
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since Class available since Release 0.1
|
||||
*/
|
||||
class OS_Guess
|
||||
{
|
||||
var $sysname;
|
||||
@@ -111,23 +122,23 @@ class OS_Guess
|
||||
if ($uname === null) {
|
||||
$uname = php_uname();
|
||||
}
|
||||
$parts = split('[[:space:]]+', trim($uname));
|
||||
$parts = preg_split('/\s+/', trim($uname));
|
||||
$n = count($parts);
|
||||
|
||||
$release = $machine = $cpu = '';
|
||||
$sysname = $parts[0];
|
||||
$release = $machine = $cpu = '';
|
||||
$sysname = $parts[0];
|
||||
$nodename = $parts[1];
|
||||
$cpu = $parts[$n-1];
|
||||
$cpu = $parts[$n-1];
|
||||
$extra = '';
|
||||
if ($cpu == 'unknown') {
|
||||
$cpu = $parts[$n-2];
|
||||
$cpu = $parts[$n - 2];
|
||||
}
|
||||
|
||||
switch ($sysname) {
|
||||
case 'AIX':
|
||||
case 'AIX' :
|
||||
$release = "$parts[3].$parts[2]";
|
||||
break;
|
||||
case 'Windows':
|
||||
case 'Windows' :
|
||||
switch ($parts[1]) {
|
||||
case '95/98':
|
||||
$release = '9x';
|
||||
@@ -138,10 +149,10 @@ class OS_Guess
|
||||
}
|
||||
$cpu = 'i386';
|
||||
break;
|
||||
case 'Linux':
|
||||
case 'Linux' :
|
||||
$extra = $this->_detectGlibcVersion();
|
||||
// use only the first two digits from the kernel version
|
||||
$release = ereg_replace('^([[:digit:]]+\.[[:digit:]]+).*', '\1', $parts[2]);
|
||||
$release = preg_replace('/^([0-9]+\.[0-9]+).*/', '\1', $parts[2]);
|
||||
break;
|
||||
case 'Mac' :
|
||||
$sysname = 'darwin';
|
||||
@@ -159,14 +170,13 @@ class OS_Guess
|
||||
$cpu = 'powerpc';
|
||||
}
|
||||
}
|
||||
$release = ereg_replace('^([[:digit:]]+\.[[:digit:]]+).*', '\1', $parts[2]);
|
||||
$release = preg_replace('/^([0-9]+\.[0-9]+).*/', '\1', $parts[2]);
|
||||
break;
|
||||
default:
|
||||
$release = ereg_replace('-.*', '', $parts[2]);
|
||||
$release = preg_replace('/-.*/', '', $parts[2]);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (isset($sysmap[$sysname])) {
|
||||
$sysname = $sysmap[$sysname];
|
||||
} else {
|
||||
@@ -180,35 +190,81 @@ class OS_Guess
|
||||
|
||||
function _detectGlibcVersion()
|
||||
{
|
||||
static $glibc = false;
|
||||
if ($glibc !== false) {
|
||||
return $glibc; // no need to run this multiple times
|
||||
}
|
||||
$major = $minor = 0;
|
||||
include_once "System.php";
|
||||
// Use glibc's <features.h> header file to
|
||||
// get major and minor version number:
|
||||
include_once "System.php";
|
||||
$tmpfile = System::mktemp("glibctest");
|
||||
$fp = fopen($tmpfile, "w");
|
||||
fwrite($fp, "#include <features.h>\n__GLIBC__ __GLIBC_MINOR__\n");
|
||||
fclose($fp);
|
||||
$cpp = popen("/usr/bin/cpp $tmpfile", "r");
|
||||
$major = $minor = 0;
|
||||
while ($line = fgets($cpp, 1024)) {
|
||||
if ($line{0} == '#' || trim($line) == '') {
|
||||
continue;
|
||||
if (@file_exists('/usr/include/features.h') &&
|
||||
@is_readable('/usr/include/features.h')) {
|
||||
if (!@file_exists('/usr/bin/cpp') || !@is_executable('/usr/bin/cpp')) {
|
||||
$features_file = fopen('/usr/include/features.h', 'rb');
|
||||
while (!feof($features_file)) {
|
||||
$line = fgets($features_file, 8192);
|
||||
if (!$line || (strpos($line, '#define') === false)) {
|
||||
continue;
|
||||
}
|
||||
if (strpos($line, '__GLIBC__')) {
|
||||
// major version number #define __GLIBC__ version
|
||||
$line = preg_split('/\s+/', $line);
|
||||
$glibc_major = trim($line[2]);
|
||||
if (isset($glibc_minor)) {
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (strpos($line, '__GLIBC_MINOR__')) {
|
||||
// got the minor version number
|
||||
// #define __GLIBC_MINOR__ version
|
||||
$line = preg_split('/\s+/', $line);
|
||||
$glibc_minor = trim($line[2]);
|
||||
if (isset($glibc_major)) {
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
fclose($features_file);
|
||||
if (!isset($glibc_major) || !isset($glibc_minor)) {
|
||||
return $glibc = '';
|
||||
}
|
||||
return $glibc = 'glibc' . trim($glibc_major) . "." . trim($glibc_minor) ;
|
||||
} // no cpp
|
||||
|
||||
$tmpfile = System::mktemp("glibctest");
|
||||
$fp = fopen($tmpfile, "w");
|
||||
fwrite($fp, "#include <features.h>\n__GLIBC__ __GLIBC_MINOR__\n");
|
||||
fclose($fp);
|
||||
$cpp = popen("/usr/bin/cpp $tmpfile", "r");
|
||||
while ($line = fgets($cpp, 1024)) {
|
||||
if ($line{0} == '#' || trim($line) == '') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (list($major, $minor) = explode(' ', trim($line))) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (list($major, $minor) = explode(' ', trim($line))) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
pclose($cpp);
|
||||
unlink($tmpfile);
|
||||
if (!($major && $minor) && is_link('/lib/libc.so.6')) {
|
||||
pclose($cpp);
|
||||
unlink($tmpfile);
|
||||
} // features.h
|
||||
|
||||
if (!($major && $minor) && @is_link('/lib/libc.so.6')) {
|
||||
// Let's try reading the libc.so.6 symlink
|
||||
if (ereg('^libc-([.*])\.so$', basename(readlink('/lib/libc.so.6')), $matches)) {
|
||||
list($major, $minor) = explode('.', $matches);
|
||||
if (preg_match('/^libc-(.*)\.so$/', basename(readlink('/lib/libc.so.6')), $matches)) {
|
||||
list($major, $minor) = explode('.', $matches[1]);
|
||||
}
|
||||
}
|
||||
|
||||
if (!($major && $minor)) {
|
||||
return '';
|
||||
return $glibc = '';
|
||||
}
|
||||
return "glibc{$major}.{$minor}";
|
||||
|
||||
return $glibc = "glibc{$major}.{$minor}";
|
||||
}
|
||||
|
||||
function getSignature()
|
||||
@@ -246,11 +302,7 @@ class OS_Guess
|
||||
|
||||
function matchSignature($match)
|
||||
{
|
||||
if (is_array($match)) {
|
||||
$fragments = $match;
|
||||
} else {
|
||||
$fragments = explode('-', $match);
|
||||
}
|
||||
$fragments = is_array($match) ? $match : explode('-', $match);
|
||||
$n = count($fragments);
|
||||
$matches = 0;
|
||||
if ($n > 0) {
|
||||
@@ -271,8 +323,8 @@ class OS_Guess
|
||||
function _matchFragment($fragment, $value)
|
||||
{
|
||||
if (strcspn($fragment, '*?') < strlen($fragment)) {
|
||||
$reg = '^' . str_replace(array('*', '?', '/'), array('.*', '.', '\\/'), $fragment) . '$';
|
||||
return eregi($reg, $value);
|
||||
$reg = '/^' . str_replace(array('*', '?', '/'), array('.*', '.', '\\/'), $fragment) . '\\z/';
|
||||
return preg_match($reg, $value);
|
||||
}
|
||||
return ($fragment == '*' || !strcasecmp($fragment, $value));
|
||||
}
|
||||
@@ -283,5 +335,4 @@ class OS_Guess
|
||||
* indent-tabs-mode: nil
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
*/
|
||||
?>
|
||||
*/
|
||||
Vendored
+27
@@ -0,0 +1,27 @@
|
||||
Copyright (c) 1997-2009,
|
||||
Stig Bakken <ssb@php.net>,
|
||||
Gregory Beaver <cellog@php.net>,
|
||||
Helgi Þormar Þorbjörnsson <helgi@php.net>,
|
||||
Tomas V.V.Cox <cox@idecnet.com>,
|
||||
Martin Jansen <mj@php.net>.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
Vendored
+212
-204
@@ -1,26 +1,27 @@
|
||||
<?php
|
||||
//
|
||||
// +--------------------------------------------------------------------+
|
||||
// | PEAR, the PHP Extension and Application Repository |
|
||||
// +--------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +--------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available through the world-wide-web at the following url: |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +--------------------------------------------------------------------+
|
||||
// | Authors: Sterling Hughes <sterling@php.net> |
|
||||
// | Stig Bakken <ssb@php.net> |
|
||||
// | Tomas V.V.Cox <cox@idecnet.com> |
|
||||
// +--------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: PEAR.php,v 1.82.2.6 2005/01/01 05:24:51 cellog Exp $
|
||||
//
|
||||
/**
|
||||
* PEAR, the PHP Extension and Application Repository
|
||||
*
|
||||
* PEAR class and PEAR_Error class
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Sterling Hughes <sterling@php.net>
|
||||
* @author Stig Bakken <ssb@php.net>
|
||||
* @author Tomas V.V.Cox <cox@idecnet.com>
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2010 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version CVS: $Id: PEAR.php 313023 2011-07-06 19:17:11Z dufuz $
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since File available since Release 0.1
|
||||
*/
|
||||
|
||||
/**#@+
|
||||
* ERROR constants
|
||||
*/
|
||||
define('PEAR_ERROR_RETURN', 1);
|
||||
define('PEAR_ERROR_PRINT', 2);
|
||||
define('PEAR_ERROR_TRIGGER', 4);
|
||||
@@ -31,6 +32,7 @@ define('PEAR_ERROR_CALLBACK', 16);
|
||||
* @deprecated
|
||||
*/
|
||||
define('PEAR_ERROR_EXCEPTION', 32);
|
||||
/**#@-*/
|
||||
define('PEAR_ZE2', (function_exists('version_compare') &&
|
||||
version_compare(zend_version(), "2-dev", "ge")));
|
||||
|
||||
@@ -44,15 +46,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
define('PEAR_OS', 'Unix'); // blatant assumption
|
||||
}
|
||||
|
||||
// instant backwards compatibility
|
||||
if (!defined('PATH_SEPARATOR')) {
|
||||
if (OS_WINDOWS) {
|
||||
define('PATH_SEPARATOR', ';');
|
||||
} else {
|
||||
define('PATH_SEPARATOR', ':');
|
||||
}
|
||||
}
|
||||
|
||||
$GLOBALS['_PEAR_default_error_mode'] = PEAR_ERROR_RETURN;
|
||||
$GLOBALS['_PEAR_default_error_options'] = E_USER_NOTICE;
|
||||
$GLOBALS['_PEAR_destructor_object_list'] = array();
|
||||
@@ -78,14 +71,21 @@ $GLOBALS['_PEAR_error_handler_stack'] = array();
|
||||
* IMPORTANT! To use the emulated destructors you need to create the
|
||||
* objects by reference: $obj =& new PEAR_child;
|
||||
*
|
||||
* @since PHP 4.0.2
|
||||
* @author Stig Bakken <ssb@php.net>
|
||||
* @see http://pear.php.net/manual/
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Stig Bakken <ssb@php.net>
|
||||
* @author Tomas V.V. Cox <cox@idecnet.com>
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2006 The PHP Group
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version Release: 1.9.4
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @see PEAR_Error
|
||||
* @since Class available since PHP 4.0.2
|
||||
* @link http://pear.php.net/manual/en/core.pear.php#core.pear.pear
|
||||
*/
|
||||
class PEAR
|
||||
{
|
||||
// {{{ properties
|
||||
|
||||
/**
|
||||
* Whether to enable internal debug messages.
|
||||
*
|
||||
@@ -136,10 +136,6 @@ class PEAR
|
||||
*/
|
||||
var $_expected_errors = array();
|
||||
|
||||
// }}}
|
||||
|
||||
// {{{ constructor
|
||||
|
||||
/**
|
||||
* Constructor. Registers this object in
|
||||
* $_PEAR_destructor_object_list for destructor emulation if a
|
||||
@@ -156,9 +152,11 @@ class PEAR
|
||||
if ($this->_debug) {
|
||||
print "PEAR constructor called, class=$classname\n";
|
||||
}
|
||||
|
||||
if ($error_class !== null) {
|
||||
$this->_error_class = $error_class;
|
||||
}
|
||||
|
||||
while ($classname && strcasecmp($classname, "pear")) {
|
||||
$destructor = "_$classname";
|
||||
if (method_exists($this, $destructor)) {
|
||||
@@ -175,9 +173,6 @@ class PEAR
|
||||
}
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ destructor
|
||||
|
||||
/**
|
||||
* Destructor (the emulated type of...). Does nothing right now,
|
||||
* but is included for forward compatibility, so subclass
|
||||
@@ -195,9 +190,6 @@ class PEAR
|
||||
}
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ getStaticProperty()
|
||||
|
||||
/**
|
||||
* If you have a class that's mostly/entirely static, and you need static
|
||||
* properties, you can use this method to simulate them. Eg. in your method(s)
|
||||
@@ -213,12 +205,17 @@ class PEAR
|
||||
function &getStaticProperty($class, $var)
|
||||
{
|
||||
static $properties;
|
||||
if (!isset($properties[$class])) {
|
||||
$properties[$class] = array();
|
||||
}
|
||||
|
||||
if (!array_key_exists($var, $properties[$class])) {
|
||||
$properties[$class][$var] = null;
|
||||
}
|
||||
|
||||
return $properties[$class][$var];
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ registerShutdownFunc()
|
||||
|
||||
/**
|
||||
* Use this function to register a shutdown method for static
|
||||
* classes.
|
||||
@@ -230,12 +227,15 @@ class PEAR
|
||||
*/
|
||||
function registerShutdownFunc($func, $args = array())
|
||||
{
|
||||
// if we are called statically, there is a potential
|
||||
// that no shutdown func is registered. Bug #6445
|
||||
if (!isset($GLOBALS['_PEAR_SHUTDOWN_REGISTERED'])) {
|
||||
register_shutdown_function("_PEAR_call_destructors");
|
||||
$GLOBALS['_PEAR_SHUTDOWN_REGISTERED'] = true;
|
||||
}
|
||||
$GLOBALS['_PEAR_shutdown_funcs'][] = array($func, $args);
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ isError()
|
||||
|
||||
/**
|
||||
* Tell whether a value is a PEAR error.
|
||||
*
|
||||
@@ -247,22 +247,20 @@ class PEAR
|
||||
* @access public
|
||||
* @return bool true if parameter is an error
|
||||
*/
|
||||
function isError($data, $code = null)
|
||||
static function isError($data, $code = null)
|
||||
{
|
||||
if (is_a($data, 'PEAR_Error')) {
|
||||
if (is_null($code)) {
|
||||
return true;
|
||||
} elseif (is_string($code)) {
|
||||
return $data->getMessage() == $code;
|
||||
} else {
|
||||
return $data->getCode() == $code;
|
||||
}
|
||||
if (!is_a($data, 'PEAR_Error')) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ setErrorHandling()
|
||||
if (is_null($code)) {
|
||||
return true;
|
||||
} elseif (is_string($code)) {
|
||||
return $data->getMessage() == $code;
|
||||
}
|
||||
|
||||
return $data->getCode() == $code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets how errors generated by this object should be handled.
|
||||
@@ -302,7 +300,6 @@ class PEAR
|
||||
*
|
||||
* @since PHP 4.0.5
|
||||
*/
|
||||
|
||||
function setErrorHandling($mode = null, $options = null)
|
||||
{
|
||||
if (isset($this) && is_a($this, 'PEAR')) {
|
||||
@@ -340,9 +337,6 @@ class PEAR
|
||||
}
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ expectError()
|
||||
|
||||
/**
|
||||
* This method is used to tell which errors you expect to get.
|
||||
* Expected errors are always returned with error mode
|
||||
@@ -365,12 +359,9 @@ class PEAR
|
||||
} else {
|
||||
array_push($this->_expected_errors, array($code));
|
||||
}
|
||||
return sizeof($this->_expected_errors);
|
||||
return count($this->_expected_errors);
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ popExpect()
|
||||
|
||||
/**
|
||||
* This method pops one element off the expected error codes
|
||||
* stack.
|
||||
@@ -382,9 +373,6 @@ class PEAR
|
||||
return array_pop($this->_expected_errors);
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ _checkDelExpect()
|
||||
|
||||
/**
|
||||
* This method checks unsets an error code if available
|
||||
*
|
||||
@@ -396,8 +384,7 @@ class PEAR
|
||||
function _checkDelExpect($error_code)
|
||||
{
|
||||
$deleted = false;
|
||||
|
||||
foreach ($this->_expected_errors AS $key => $error_array) {
|
||||
foreach ($this->_expected_errors as $key => $error_array) {
|
||||
if (in_array($error_code, $error_array)) {
|
||||
unset($this->_expected_errors[$key][array_search($error_code, $error_array)]);
|
||||
$deleted = true;
|
||||
@@ -408,12 +395,10 @@ class PEAR
|
||||
unset($this->_expected_errors[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
return $deleted;
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ delExpect()
|
||||
|
||||
/**
|
||||
* This method deletes all occurences of the specified element from
|
||||
* the expected error codes stack.
|
||||
@@ -426,34 +411,26 @@ class PEAR
|
||||
function delExpect($error_code)
|
||||
{
|
||||
$deleted = false;
|
||||
|
||||
if ((is_array($error_code) && (0 != count($error_code)))) {
|
||||
// $error_code is a non-empty array here;
|
||||
// we walk through it trying to unset all
|
||||
// values
|
||||
foreach($error_code as $key => $error) {
|
||||
if ($this->_checkDelExpect($error)) {
|
||||
$deleted = true;
|
||||
} else {
|
||||
$deleted = false;
|
||||
}
|
||||
// $error_code is a non-empty array here; we walk through it trying
|
||||
// to unset all values
|
||||
foreach ($error_code as $key => $error) {
|
||||
$deleted = $this->_checkDelExpect($error) ? true : false;
|
||||
}
|
||||
|
||||
return $deleted ? true : PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME
|
||||
} elseif (!empty($error_code)) {
|
||||
// $error_code comes alone, trying to unset it
|
||||
if ($this->_checkDelExpect($error_code)) {
|
||||
return true;
|
||||
} else {
|
||||
return PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME
|
||||
}
|
||||
} else {
|
||||
// $error_code is empty
|
||||
return PEAR::raiseError("The expected error you submitted is empty"); // IMPROVE ME
|
||||
}
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ raiseError()
|
||||
return PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME
|
||||
}
|
||||
|
||||
// $error_code is empty
|
||||
return PEAR::raiseError("The expected error you submitted is empty"); // IMPROVE ME
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is a wrapper that returns an instance of the
|
||||
@@ -492,7 +469,7 @@ class PEAR
|
||||
* @see PEAR::setErrorHandling
|
||||
* @since PHP 4.0.5
|
||||
*/
|
||||
function raiseError($message = null,
|
||||
static function &raiseError($message = null,
|
||||
$code = null,
|
||||
$mode = null,
|
||||
$options = null,
|
||||
@@ -509,13 +486,20 @@ class PEAR
|
||||
$message = $message->getMessage();
|
||||
}
|
||||
|
||||
if (isset($this) && isset($this->_expected_errors) && sizeof($this->_expected_errors) > 0 && sizeof($exp = end($this->_expected_errors))) {
|
||||
if (
|
||||
isset($this) &&
|
||||
isset($this->_expected_errors) &&
|
||||
count($this->_expected_errors) > 0 &&
|
||||
count($exp = end($this->_expected_errors))
|
||||
) {
|
||||
if ($exp[0] == "*" ||
|
||||
(is_int(reset($exp)) && in_array($code, $exp)) ||
|
||||
(is_string(reset($exp)) && in_array($message, $exp))) {
|
||||
(is_string(reset($exp)) && in_array($message, $exp))
|
||||
) {
|
||||
$mode = PEAR_ERROR_RETURN;
|
||||
}
|
||||
}
|
||||
|
||||
// No mode given, try global ones
|
||||
if ($mode === null) {
|
||||
// Class error handler
|
||||
@@ -536,38 +520,52 @@ class PEAR
|
||||
} else {
|
||||
$ec = 'PEAR_Error';
|
||||
}
|
||||
if ($skipmsg) {
|
||||
return new $ec($code, $mode, $options, $userinfo);
|
||||
} else {
|
||||
return new $ec($message, $code, $mode, $options, $userinfo);
|
||||
}
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ throwError()
|
||||
if (intval(PHP_VERSION) < 5) {
|
||||
// little non-eval hack to fix bug #12147
|
||||
include 'PEAR/FixPHP5PEARWarnings.php';
|
||||
return $a;
|
||||
}
|
||||
|
||||
if ($skipmsg) {
|
||||
$a = new $ec($code, $mode, $options, $userinfo);
|
||||
} else {
|
||||
$a = new $ec($message, $code, $mode, $options, $userinfo);
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
/**
|
||||
* Simpler form of raiseError with fewer options. In most cases
|
||||
* message, code and userinfo are enough.
|
||||
*
|
||||
* @param string $message
|
||||
* @param mixed $message a text error message or a PEAR error object
|
||||
*
|
||||
* @param int $code a numeric error code (it is up to your class
|
||||
* to define these if you want to use codes)
|
||||
*
|
||||
* @param string $userinfo If you need to pass along for example debug
|
||||
* information, this parameter is meant for that.
|
||||
*
|
||||
* @access public
|
||||
* @return object a PEAR error object
|
||||
* @see PEAR::raiseError
|
||||
*/
|
||||
function throwError($message = null,
|
||||
$code = null,
|
||||
$userinfo = null)
|
||||
function &throwError($message = null, $code = null, $userinfo = null)
|
||||
{
|
||||
if (isset($this) && is_a($this, 'PEAR')) {
|
||||
return $this->raiseError($message, $code, null, null, $userinfo);
|
||||
} else {
|
||||
return PEAR::raiseError($message, $code, null, null, $userinfo);
|
||||
$a = $this->raiseError($message, $code, null, null, $userinfo);
|
||||
return $a;
|
||||
}
|
||||
|
||||
$a = PEAR::raiseError($message, $code, null, null, $userinfo);
|
||||
return $a;
|
||||
}
|
||||
|
||||
// }}}
|
||||
function staticPushErrorHandling($mode, $options = null)
|
||||
{
|
||||
$stack = &$GLOBALS['_PEAR_error_handler_stack'];
|
||||
$stack = &$GLOBALS['_PEAR_error_handler_stack'];
|
||||
$def_mode = &$GLOBALS['_PEAR_default_error_mode'];
|
||||
$def_options = &$GLOBALS['_PEAR_default_error_options'];
|
||||
$stack[] = array($def_mode, $def_options);
|
||||
@@ -636,8 +634,6 @@ class PEAR
|
||||
return true;
|
||||
}
|
||||
|
||||
// {{{ pushErrorHandling()
|
||||
|
||||
/**
|
||||
* Push a new error handler on top of the error handler options stack. With this
|
||||
* you can easily override the actual error handler for some code and restore
|
||||
@@ -671,9 +667,6 @@ class PEAR
|
||||
return true;
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ popErrorHandling()
|
||||
|
||||
/**
|
||||
* Pop the last error handler used
|
||||
*
|
||||
@@ -695,9 +688,6 @@ class PEAR
|
||||
return true;
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ loadExtension()
|
||||
|
||||
/**
|
||||
* OS independant PHP extension load. Remember to take care
|
||||
* on the correct extension name for case sensitive OSes.
|
||||
@@ -705,33 +695,40 @@ class PEAR
|
||||
* @param string $ext The extension name
|
||||
* @return bool Success or not on the dl() call
|
||||
*/
|
||||
function loadExtension($ext)
|
||||
static function loadExtension($ext)
|
||||
{
|
||||
if (!extension_loaded($ext)) {
|
||||
// if either returns true dl() will produce a FATAL error, stop that
|
||||
if ((ini_get('enable_dl') != 1) || (ini_get('safe_mode') == 1)) {
|
||||
return false;
|
||||
}
|
||||
if (OS_WINDOWS) {
|
||||
$suffix = '.dll';
|
||||
} elseif (PHP_OS == 'HP-UX') {
|
||||
$suffix = '.sl';
|
||||
} elseif (PHP_OS == 'AIX') {
|
||||
$suffix = '.a';
|
||||
} elseif (PHP_OS == 'OSX') {
|
||||
$suffix = '.bundle';
|
||||
} else {
|
||||
$suffix = '.so';
|
||||
}
|
||||
return @dl('php_'.$ext.$suffix) || @dl($ext.$suffix);
|
||||
if (extension_loaded($ext)) {
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// }}}
|
||||
// if either returns true dl() will produce a FATAL error, stop that
|
||||
if (
|
||||
function_exists('dl') === false ||
|
||||
ini_get('enable_dl') != 1 ||
|
||||
ini_get('safe_mode') == 1
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (OS_WINDOWS) {
|
||||
$suffix = '.dll';
|
||||
} elseif (PHP_OS == 'HP-UX') {
|
||||
$suffix = '.sl';
|
||||
} elseif (PHP_OS == 'AIX') {
|
||||
$suffix = '.a';
|
||||
} elseif (PHP_OS == 'OSX') {
|
||||
$suffix = '.bundle';
|
||||
} else {
|
||||
$suffix = '.so';
|
||||
}
|
||||
|
||||
return @dl('php_'.$ext.$suffix) || @dl($ext.$suffix);
|
||||
}
|
||||
}
|
||||
|
||||
// {{{ _PEAR_call_destructors()
|
||||
if (PEAR_ZE2) {
|
||||
include_once 'PEAR5.php';
|
||||
}
|
||||
|
||||
function _PEAR_call_destructors()
|
||||
{
|
||||
@@ -740,9 +737,16 @@ function _PEAR_call_destructors()
|
||||
sizeof($_PEAR_destructor_object_list))
|
||||
{
|
||||
reset($_PEAR_destructor_object_list);
|
||||
if (@PEAR::getStaticProperty('PEAR', 'destructlifo')) {
|
||||
if (PEAR_ZE2) {
|
||||
$destructLifoExists = PEAR5::getStaticProperty('PEAR', 'destructlifo');
|
||||
} else {
|
||||
$destructLifoExists = PEAR::getStaticProperty('PEAR', 'destructlifo');
|
||||
}
|
||||
|
||||
if ($destructLifoExists) {
|
||||
$_PEAR_destructor_object_list = array_reverse($_PEAR_destructor_object_list);
|
||||
}
|
||||
|
||||
while (list($k, $objref) = each($_PEAR_destructor_object_list)) {
|
||||
$classname = get_class($objref);
|
||||
while ($classname) {
|
||||
@@ -761,19 +765,36 @@ function _PEAR_call_destructors()
|
||||
}
|
||||
|
||||
// Now call the shutdown functions
|
||||
if (is_array($GLOBALS['_PEAR_shutdown_funcs']) AND !empty($GLOBALS['_PEAR_shutdown_funcs'])) {
|
||||
if (
|
||||
isset($GLOBALS['_PEAR_shutdown_funcs']) &&
|
||||
is_array($GLOBALS['_PEAR_shutdown_funcs']) &&
|
||||
!empty($GLOBALS['_PEAR_shutdown_funcs'])
|
||||
) {
|
||||
foreach ($GLOBALS['_PEAR_shutdown_funcs'] as $value) {
|
||||
call_user_func_array($value[0], $value[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// }}}
|
||||
|
||||
/**
|
||||
* Standard PEAR error class for PHP 4
|
||||
*
|
||||
* This class is supserseded by {@link PEAR_Exception} in PHP 5
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Stig Bakken <ssb@php.net>
|
||||
* @author Tomas V.V. Cox <cox@idecnet.com>
|
||||
* @author Gregory Beaver <cellog@php.net>
|
||||
* @copyright 1997-2006 The PHP Group
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version Release: 1.9.4
|
||||
* @link http://pear.php.net/manual/en/core.pear.pear-error.php
|
||||
* @see PEAR::raiseError(), PEAR::throwError()
|
||||
* @since Class available since PHP 4.0.2
|
||||
*/
|
||||
class PEAR_Error
|
||||
{
|
||||
// {{{ properties
|
||||
|
||||
var $error_message_prefix = '';
|
||||
var $mode = PEAR_ERROR_RETURN;
|
||||
var $level = E_USER_NOTICE;
|
||||
@@ -782,9 +803,6 @@ class PEAR_Error
|
||||
var $userinfo = '';
|
||||
var $backtrace = null;
|
||||
|
||||
// }}}
|
||||
// {{{ constructor
|
||||
|
||||
/**
|
||||
* PEAR_Error constructor
|
||||
*
|
||||
@@ -815,11 +833,20 @@ class PEAR_Error
|
||||
$this->code = $code;
|
||||
$this->mode = $mode;
|
||||
$this->userinfo = $userinfo;
|
||||
if (function_exists("debug_backtrace")) {
|
||||
if (@!PEAR::getStaticProperty('PEAR_Error', 'skiptrace')) {
|
||||
$this->backtrace = debug_backtrace();
|
||||
|
||||
if (PEAR_ZE2) {
|
||||
$skiptrace = PEAR5::getStaticProperty('PEAR_Error', 'skiptrace');
|
||||
} else {
|
||||
$skiptrace = PEAR::getStaticProperty('PEAR_Error', 'skiptrace');
|
||||
}
|
||||
|
||||
if (!$skiptrace) {
|
||||
$this->backtrace = debug_backtrace();
|
||||
if (isset($this->backtrace[0]) && isset($this->backtrace[0]['object'])) {
|
||||
unset($this->backtrace[0]['object']);
|
||||
}
|
||||
}
|
||||
|
||||
if ($mode & PEAR_ERROR_CALLBACK) {
|
||||
$this->level = E_USER_NOTICE;
|
||||
$this->callback = $options;
|
||||
@@ -827,20 +854,25 @@ class PEAR_Error
|
||||
if ($options === null) {
|
||||
$options = E_USER_NOTICE;
|
||||
}
|
||||
|
||||
$this->level = $options;
|
||||
$this->callback = null;
|
||||
}
|
||||
|
||||
if ($this->mode & PEAR_ERROR_PRINT) {
|
||||
if (is_null($options) || is_int($options)) {
|
||||
$format = "%s";
|
||||
} else {
|
||||
$format = $options;
|
||||
}
|
||||
|
||||
printf($format, $this->getMessage());
|
||||
}
|
||||
|
||||
if ($this->mode & PEAR_ERROR_TRIGGER) {
|
||||
trigger_error($this->getMessage(), $this->level);
|
||||
}
|
||||
|
||||
if ($this->mode & PEAR_ERROR_DIE) {
|
||||
$msg = $this->getMessage();
|
||||
if (is_null($options) || is_int($options)) {
|
||||
@@ -853,47 +885,39 @@ class PEAR_Error
|
||||
}
|
||||
die(sprintf($format, $msg));
|
||||
}
|
||||
if ($this->mode & PEAR_ERROR_CALLBACK) {
|
||||
if (is_callable($this->callback)) {
|
||||
call_user_func($this->callback, $this);
|
||||
}
|
||||
|
||||
if ($this->mode & PEAR_ERROR_CALLBACK && is_callable($this->callback)) {
|
||||
call_user_func($this->callback, $this);
|
||||
}
|
||||
|
||||
if ($this->mode & PEAR_ERROR_EXCEPTION) {
|
||||
trigger_error("PEAR_ERROR_EXCEPTION is obsolete, use class PEAR_ErrorStack for exceptions", E_USER_WARNING);
|
||||
eval('$e = new Exception($this->message, $this->code);$e->PEAR_Error = $this;throw($e);');
|
||||
trigger_error("PEAR_ERROR_EXCEPTION is obsolete, use class PEAR_Exception for exceptions", E_USER_WARNING);
|
||||
eval('$e = new Exception($this->message, $this->code);throw($e);');
|
||||
}
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ getMode()
|
||||
|
||||
/**
|
||||
* Get the error mode from an error object.
|
||||
*
|
||||
* @return int error mode
|
||||
* @access public
|
||||
*/
|
||||
function getMode() {
|
||||
function getMode()
|
||||
{
|
||||
return $this->mode;
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ getCallback()
|
||||
|
||||
/**
|
||||
* Get the callback function/method from an error object.
|
||||
*
|
||||
* @return mixed callback function or object/method array
|
||||
* @access public
|
||||
*/
|
||||
function getCallback() {
|
||||
function getCallback()
|
||||
{
|
||||
return $this->callback;
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ getMessage()
|
||||
|
||||
|
||||
/**
|
||||
* Get the error message from an error object.
|
||||
*
|
||||
@@ -905,10 +929,6 @@ class PEAR_Error
|
||||
return ($this->error_message_prefix . $this->message);
|
||||
}
|
||||
|
||||
|
||||
// }}}
|
||||
// {{{ getCode()
|
||||
|
||||
/**
|
||||
* Get error code from an error object
|
||||
*
|
||||
@@ -920,9 +940,6 @@ class PEAR_Error
|
||||
return $this->code;
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ getType()
|
||||
|
||||
/**
|
||||
* Get the name of this error/exception.
|
||||
*
|
||||
@@ -934,9 +951,6 @@ class PEAR_Error
|
||||
return get_class($this);
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ getUserInfo()
|
||||
|
||||
/**
|
||||
* Get additional user-supplied information.
|
||||
*
|
||||
@@ -948,9 +962,6 @@ class PEAR_Error
|
||||
return $this->userinfo;
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ getDebugInfo()
|
||||
|
||||
/**
|
||||
* Get additional debug information supplied by the application.
|
||||
*
|
||||
@@ -962,9 +973,6 @@ class PEAR_Error
|
||||
return $this->getUserInfo();
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ getBacktrace()
|
||||
|
||||
/**
|
||||
* Get the call backtrace from where the error was generated.
|
||||
* Supported with PHP 4.3.0 or newer.
|
||||
@@ -975,15 +983,15 @@ class PEAR_Error
|
||||
*/
|
||||
function getBacktrace($frame = null)
|
||||
{
|
||||
if (defined('PEAR_IGNORE_BACKTRACE')) {
|
||||
return null;
|
||||
}
|
||||
if ($frame === null) {
|
||||
return $this->backtrace;
|
||||
}
|
||||
return $this->backtrace[$frame];
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ addUserInfo()
|
||||
|
||||
function addUserInfo($info)
|
||||
{
|
||||
if (empty($this->userinfo)) {
|
||||
@@ -993,8 +1001,10 @@ class PEAR_Error
|
||||
}
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ toString()
|
||||
function __toString()
|
||||
{
|
||||
return $this->getMessage();
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a string representation of this object.
|
||||
@@ -1002,7 +1012,8 @@ class PEAR_Error
|
||||
* @return string a string with an object summary
|
||||
* @access public
|
||||
*/
|
||||
function toString() {
|
||||
function toString()
|
||||
{
|
||||
$modes = array();
|
||||
$levels = array(E_USER_NOTICE => 'notice',
|
||||
E_USER_WARNING => 'warning',
|
||||
@@ -1041,8 +1052,6 @@ class PEAR_Error
|
||||
$this->error_message_prefix,
|
||||
$this->userinfo);
|
||||
}
|
||||
|
||||
// }}}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1052,4 +1061,3 @@ class PEAR_Error
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
*/
|
||||
?>
|
||||
+30
-20
@@ -1,29 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* Class auto-loader
|
||||
*
|
||||
* PHP versions 4
|
||||
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Stig Bakken <ssb@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version CVS: $Id: Autoloader.php 313023 2011-07-06 19:17:11Z dufuz $
|
||||
* @link http://pear.php.net/manual/en/core.ppm.php#core.ppm.pear-autoloader
|
||||
* @since File available since Release 0.1
|
||||
* @deprecated File deprecated in Release 1.4.0a1
|
||||
*/
|
||||
|
||||
// /* vim: set expandtab tabstop=4 shiftwidth=4: */
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 5 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available through the world-wide-web at the following url: |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Author: Stig Bakken <ssb@php.net> |
|
||||
// | |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: Autoloader.php,v 1.11 2004/02/27 02:21:29 cellog Exp $
|
||||
|
||||
if (!extension_loaded("overload")) {
|
||||
// die hard without ext/overload
|
||||
die("Rebuild PHP with the `overload' extension to use PEAR_Autoloader");
|
||||
}
|
||||
|
||||
/**
|
||||
* Include for PEAR_Error and PEAR classes
|
||||
*/
|
||||
require_once "PEAR.php";
|
||||
|
||||
/**
|
||||
@@ -38,7 +40,15 @@ require_once "PEAR.php";
|
||||
* methods, an instance of each class providing separated methods is
|
||||
* stored and called every time the aggregated method is called.
|
||||
*
|
||||
* @author Stig Sæther Bakken <ssb@php.net>
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Stig Bakken <ssb@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version Release: 1.9.4
|
||||
* @link http://pear.php.net/manual/en/core.ppm.php#core.ppm.pear-autoloader
|
||||
* @since File available since Release 0.1
|
||||
* @deprecated File deprecated in Release 1.4.0a1
|
||||
*/
|
||||
class PEAR_Autoloader extends PEAR
|
||||
{
|
||||
@@ -134,7 +144,7 @@ class PEAR_Autoloader extends PEAR
|
||||
$include_file = preg_replace('/[^a-z0-9]/i', '_', $classname);
|
||||
include_once $include_file;
|
||||
}
|
||||
$obj =& new $classname;
|
||||
$obj = new $classname;
|
||||
$methods = get_class_methods($classname);
|
||||
foreach ($methods as $method) {
|
||||
// don't import priviate methods and constructors
|
||||
+153
-90
@@ -1,47 +1,60 @@
|
||||
<?php
|
||||
//
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 5 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available through the world-wide-web at the following url: |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Stig Sæther Bakken <ssb@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: Builder.php,v 1.16.2.3 2005/02/17 17:55:01 cellog Exp $
|
||||
/**
|
||||
* PEAR_Builder for building PHP extensions (PECL packages)
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Stig Bakken <ssb@php.net>
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version CVS: $Id: Builder.php 313024 2011-07-06 19:51:24Z dufuz $
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since File available since Release 0.1
|
||||
*
|
||||
* TODO: log output parameters in PECL command line
|
||||
* TODO: msdev path in configuration
|
||||
*/
|
||||
|
||||
/**
|
||||
* Needed for extending PEAR_Builder
|
||||
*/
|
||||
require_once 'PEAR/Common.php';
|
||||
require_once 'PEAR/PackageFile.php';
|
||||
|
||||
/**
|
||||
* Class to handle building (compiling) extensions.
|
||||
*
|
||||
* @author Stig Sæther Bakken <ssb@php.net>
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Stig Bakken <ssb@php.net>
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version Release: 1.9.4
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since Class available since PHP 4.0.2
|
||||
* @see http://pear.php.net/manual/en/core.ppm.pear-builder.php
|
||||
*/
|
||||
class PEAR_Builder extends PEAR_Common
|
||||
{
|
||||
// {{{ properties
|
||||
|
||||
var $php_api_version = 0;
|
||||
var $zend_module_api_no = 0;
|
||||
var $zend_extension_api_no = 0;
|
||||
|
||||
var $extensions_built = array();
|
||||
|
||||
/**
|
||||
* @var string Used for reporting when it is not possible to pass function
|
||||
* via extra parameter, e.g. log, msdevCallback
|
||||
*/
|
||||
var $current_callback = null;
|
||||
|
||||
// used for msdev builds
|
||||
var $_lastline = null;
|
||||
var $_firstline = null;
|
||||
// }}}
|
||||
// {{{ constructor
|
||||
|
||||
/**
|
||||
* PEAR_Builder constructor.
|
||||
@@ -56,35 +69,48 @@ class PEAR_Builder extends PEAR_Common
|
||||
$this->setFrontendObject($ui);
|
||||
}
|
||||
|
||||
// }}}
|
||||
|
||||
// {{{ _build_win32()
|
||||
|
||||
/**
|
||||
* Build an extension from source on windows.
|
||||
* requires msdev
|
||||
*/
|
||||
function _build_win32($descfile, $callback = null)
|
||||
{
|
||||
if (PEAR::isError($info = $this->infoFromDescriptionFile($descfile))) {
|
||||
return $info;
|
||||
if (is_object($descfile)) {
|
||||
$pkg = $descfile;
|
||||
$descfile = $pkg->getPackageFile();
|
||||
} else {
|
||||
$pf = &new PEAR_PackageFile($this->config, $this->debug);
|
||||
$pkg = &$pf->fromPackageFile($descfile, PEAR_VALIDATE_NORMAL);
|
||||
if (PEAR::isError($pkg)) {
|
||||
return $pkg;
|
||||
}
|
||||
}
|
||||
$dir = dirname($descfile);
|
||||
$old_cwd = getcwd();
|
||||
|
||||
if (!@chdir($dir)) {
|
||||
if (!file_exists($dir) || !is_dir($dir) || !chdir($dir)) {
|
||||
return $this->raiseError("could not chdir to $dir");
|
||||
}
|
||||
|
||||
// packages that were in a .tar have the packagefile in this directory
|
||||
$vdir = $pkg->getPackage() . '-' . $pkg->getVersion();
|
||||
if (file_exists($dir) && is_dir($vdir)) {
|
||||
if (!chdir($vdir)) {
|
||||
return $this->raiseError("could not chdir to " . realpath($vdir));
|
||||
}
|
||||
|
||||
$dir = getcwd();
|
||||
}
|
||||
|
||||
$this->log(2, "building in $dir");
|
||||
|
||||
$dsp = $info['package'].'.dsp';
|
||||
if (!@is_file("$dir/$dsp")) {
|
||||
$dsp = $pkg->getPackage().'.dsp';
|
||||
if (!file_exists("$dir/$dsp")) {
|
||||
return $this->raiseError("The DSP $dsp does not exist.");
|
||||
}
|
||||
// XXX TODO: make release build type configurable
|
||||
$command = 'msdev '.$dsp.' /MAKE "'.$info['package']. ' - Release"';
|
||||
$command = 'msdev '.$dsp.' /MAKE "'.$pkg->getPackage(). ' - Release"';
|
||||
|
||||
$this->current_callback = $callback;
|
||||
$err = $this->_runCommand($command, array(&$this, 'msdevCallback'));
|
||||
if (PEAR::isError($err)) {
|
||||
return $err;
|
||||
@@ -93,12 +119,12 @@ class PEAR_Builder extends PEAR_Common
|
||||
// figure out the build platform and type
|
||||
$platform = 'Win32';
|
||||
$buildtype = 'Release';
|
||||
if (preg_match('/.*?'.$info['package'].'\s-\s(\w+)\s(.*?)-+/i',$this->_firstline,$matches)) {
|
||||
if (preg_match('/.*?'.$pkg->getPackage().'\s-\s(\w+)\s(.*?)-+/i',$this->_firstline,$matches)) {
|
||||
$platform = $matches[1];
|
||||
$buildtype = $matches[2];
|
||||
}
|
||||
|
||||
if (preg_match('/(.*)?\s-\s(\d+).*?(\d+)/',$this->_lastline,$matches)) {
|
||||
if (preg_match('/(.*)?\s-\s(\d+).*?(\d+)/', $this->_lastline, $matches)) {
|
||||
if ($matches[2]) {
|
||||
// there were errors in the build
|
||||
return $this->raiseError("There were errors during compilation.");
|
||||
@@ -115,18 +141,19 @@ class PEAR_Builder extends PEAR_Common
|
||||
// this regex depends on the build platform and type having been
|
||||
// correctly identified above.
|
||||
$regex ='/.*?!IF\s+"\$\(CFG\)"\s+==\s+("'.
|
||||
$info['package'].'\s-\s'.
|
||||
$pkg->getPackage().'\s-\s'.
|
||||
$platform.'\s'.
|
||||
$buildtype.'").*?'.
|
||||
'\/out:"(.*?)"/is';
|
||||
|
||||
if ($dsptext && preg_match($regex,$dsptext,$matches)) {
|
||||
if ($dsptext && preg_match($regex, $dsptext, $matches)) {
|
||||
// what we get back is a relative path to the output file itself.
|
||||
$outfile = realpath($matches[2]);
|
||||
} else {
|
||||
return $this->raiseError("Could not retrieve output information from $dsp.");
|
||||
}
|
||||
if (@copy($outfile, "$dir/$out")) {
|
||||
// realpath returns false if the file doesn't exist
|
||||
if ($outfile && copy($outfile, "$dir/$out")) {
|
||||
$outfile = "$dir/$out";
|
||||
}
|
||||
|
||||
@@ -147,10 +174,9 @@ class PEAR_Builder extends PEAR_Common
|
||||
if (!$this->_firstline)
|
||||
$this->_firstline = $data;
|
||||
$this->_lastline = $data;
|
||||
call_user_func($this->current_callback, $what, $data);
|
||||
}
|
||||
// }}}
|
||||
|
||||
// {{{ _harventInstDir
|
||||
/**
|
||||
* @param string
|
||||
* @param string
|
||||
@@ -191,16 +217,13 @@ class PEAR_Builder extends PEAR_Common
|
||||
return $ret;
|
||||
}
|
||||
|
||||
// }}}
|
||||
|
||||
// {{{ build()
|
||||
|
||||
/**
|
||||
* Build an extension from source. Runs "phpize" in the source
|
||||
* directory, but compiles in a temporary directory
|
||||
* (/var/tmp/pear-build-USER/PACKAGE-VERSION).
|
||||
* (TMPDIR/pear-build-USER/PACKAGE-VERSION).
|
||||
*
|
||||
* @param string $descfile path to XML package description file
|
||||
* @param string|PEAR_PackageFile_v* $descfile path to XML package description file, or
|
||||
* a PEAR_PackageFile object
|
||||
*
|
||||
* @param mixed $callback callback function used to report output,
|
||||
* see PEAR_Builder::_runCommand for details
|
||||
@@ -216,48 +239,97 @@ class PEAR_Builder extends PEAR_Common
|
||||
* @access public
|
||||
*
|
||||
* @see PEAR_Builder::_runCommand
|
||||
* @see PEAR_Common::infoFromDescriptionFile
|
||||
*/
|
||||
function build($descfile, $callback = null)
|
||||
{
|
||||
if (PEAR_OS == "Windows") {
|
||||
return $this->_build_win32($descfile,$callback);
|
||||
if (preg_match('/(\\/|\\\\|^)([^\\/\\\\]+)?php(.+)?$/',
|
||||
$this->config->get('php_bin'), $matches)) {
|
||||
if (isset($matches[2]) && strlen($matches[2]) &&
|
||||
trim($matches[2]) != trim($this->config->get('php_prefix'))) {
|
||||
$this->log(0, 'WARNING: php_bin ' . $this->config->get('php_bin') .
|
||||
' appears to have a prefix ' . $matches[2] . ', but' .
|
||||
' config variable php_prefix does not match');
|
||||
}
|
||||
|
||||
if (isset($matches[3]) && strlen($matches[3]) &&
|
||||
trim($matches[3]) != trim($this->config->get('php_suffix'))) {
|
||||
$this->log(0, 'WARNING: php_bin ' . $this->config->get('php_bin') .
|
||||
' appears to have a suffix ' . $matches[3] . ', but' .
|
||||
' config variable php_suffix does not match');
|
||||
}
|
||||
}
|
||||
|
||||
$this->current_callback = $callback;
|
||||
if (PEAR_OS == "Windows") {
|
||||
return $this->_build_win32($descfile, $callback);
|
||||
}
|
||||
|
||||
if (PEAR_OS != 'Unix') {
|
||||
return $this->raiseError("building extensions not supported on this platform");
|
||||
}
|
||||
if (PEAR::isError($info = $this->infoFromDescriptionFile($descfile))) {
|
||||
return $info;
|
||||
|
||||
if (is_object($descfile)) {
|
||||
$pkg = $descfile;
|
||||
$descfile = $pkg->getPackageFile();
|
||||
if (is_a($pkg, 'PEAR_PackageFile_v1')) {
|
||||
$dir = dirname($descfile);
|
||||
} else {
|
||||
$dir = $pkg->_config->get('temp_dir') . '/' . $pkg->getName();
|
||||
// automatically delete at session end
|
||||
$this->addTempFile($dir);
|
||||
}
|
||||
} else {
|
||||
$pf = &new PEAR_PackageFile($this->config);
|
||||
$pkg = &$pf->fromPackageFile($descfile, PEAR_VALIDATE_NORMAL);
|
||||
if (PEAR::isError($pkg)) {
|
||||
return $pkg;
|
||||
}
|
||||
$dir = dirname($descfile);
|
||||
}
|
||||
$dir = dirname($descfile);
|
||||
|
||||
// Find config. outside of normal path - e.g. config.m4
|
||||
foreach (array_keys($pkg->getInstallationFileList()) as $item) {
|
||||
if (stristr(basename($item), 'config.m4') && dirname($item) != '.') {
|
||||
$dir .= DIRECTORY_SEPARATOR . dirname($item);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$old_cwd = getcwd();
|
||||
if (!@chdir($dir)) {
|
||||
if (!file_exists($dir) || !is_dir($dir) || !chdir($dir)) {
|
||||
return $this->raiseError("could not chdir to $dir");
|
||||
}
|
||||
$vdir = "$info[package]-$info[version]";
|
||||
|
||||
$vdir = $pkg->getPackage() . '-' . $pkg->getVersion();
|
||||
if (is_dir($vdir)) {
|
||||
chdir($vdir);
|
||||
}
|
||||
|
||||
$dir = getcwd();
|
||||
$this->log(2, "building in $dir");
|
||||
$this->current_callback = $callback;
|
||||
putenv('PATH=' . $this->config->get('bin_dir') . ':' . getenv('PATH'));
|
||||
$err = $this->_runCommand("phpize", array(&$this, 'phpizeCallback'));
|
||||
$err = $this->_runCommand($this->config->get('php_prefix')
|
||||
. "phpize" .
|
||||
$this->config->get('php_suffix'),
|
||||
array(&$this, 'phpizeCallback'));
|
||||
if (PEAR::isError($err)) {
|
||||
return $err;
|
||||
}
|
||||
|
||||
if (!$err) {
|
||||
return $this->raiseError("`phpize' failed");
|
||||
}
|
||||
|
||||
// {{{ start of interactive part
|
||||
$configure_command = "$dir/configure";
|
||||
if (isset($info['configure_options'])) {
|
||||
foreach ($info['configure_options'] as $o) {
|
||||
$configure_options = $pkg->getConfigureOptions();
|
||||
if ($configure_options) {
|
||||
foreach ($configure_options as $o) {
|
||||
$default = array_key_exists('default', $o) ? $o['default'] : null;
|
||||
list($r) = $this->ui->userDialog('build',
|
||||
array($o['prompt']),
|
||||
array('text'),
|
||||
array(@$o['default']));
|
||||
array($default));
|
||||
if (substr($o['name'], 0, 5) == 'with-' &&
|
||||
($r == 'yes' || $r == 'autodetect')) {
|
||||
$configure_command .= " --$o[name]";
|
||||
@@ -269,40 +341,41 @@ class PEAR_Builder extends PEAR_Common
|
||||
// }}} end of interactive part
|
||||
|
||||
// FIXME make configurable
|
||||
if(!$user=getenv('USER')){
|
||||
if (!$user=getenv('USER')) {
|
||||
$user='defaultuser';
|
||||
}
|
||||
$build_basedir = "/var/tmp/pear-build-$user";
|
||||
$build_dir = "$build_basedir/$info[package]-$info[version]";
|
||||
$inst_dir = "$build_basedir/install-$info[package]-$info[version]";
|
||||
|
||||
$tmpdir = $this->config->get('temp_dir');
|
||||
$build_basedir = System::mktemp(' -t "' . $tmpdir . '" -d "pear-build-' . $user . '"');
|
||||
$build_dir = "$build_basedir/$vdir";
|
||||
$inst_dir = "$build_basedir/install-$vdir";
|
||||
$this->log(1, "building in $build_dir");
|
||||
if (is_dir($build_dir)) {
|
||||
System::rm('-rf', $build_dir);
|
||||
System::rm(array('-rf', $build_dir));
|
||||
}
|
||||
|
||||
if (!System::mkDir(array('-p', $build_dir))) {
|
||||
return $this->raiseError("could not create build dir: $build_dir");
|
||||
}
|
||||
|
||||
$this->addTempFile($build_dir);
|
||||
if (!System::mkDir(array('-p', $inst_dir))) {
|
||||
return $this->raiseError("could not create temporary install dir: $inst_dir");
|
||||
}
|
||||
$this->addTempFile($inst_dir);
|
||||
|
||||
if (getenv('MAKE')) {
|
||||
$make_command = getenv('MAKE');
|
||||
} else {
|
||||
$make_command = 'make';
|
||||
}
|
||||
$make_command = getenv('MAKE') ? getenv('MAKE') : 'make';
|
||||
|
||||
$to_run = array(
|
||||
$configure_command,
|
||||
$make_command,
|
||||
"$make_command INSTALL_ROOT=\"$inst_dir\" install",
|
||||
"find \"$inst_dir\" -ls"
|
||||
"find \"$inst_dir\" | xargs ls -dils"
|
||||
);
|
||||
if (!@chdir($build_dir)) {
|
||||
if (!file_exists($build_dir) || !is_dir($build_dir) || !chdir($build_dir)) {
|
||||
return $this->raiseError("could not chdir to $build_dir");
|
||||
}
|
||||
putenv('PHP_PEAR_VERSION=@PEAR-VER@');
|
||||
putenv('PHP_PEAR_VERSION=1.9.4');
|
||||
foreach ($to_run as $cmd) {
|
||||
$err = $this->_runCommand($cmd, $callback);
|
||||
if (PEAR::isError($err)) {
|
||||
@@ -319,15 +392,14 @@ class PEAR_Builder extends PEAR_Common
|
||||
return $this->raiseError("no `modules' directory found");
|
||||
}
|
||||
$built_files = array();
|
||||
$prefix = exec("php-config --prefix");
|
||||
$prefix = exec($this->config->get('php_prefix')
|
||||
. "php-config" .
|
||||
$this->config->get('php_suffix') . " --prefix");
|
||||
$this->_harvestInstDir($prefix, $inst_dir . DIRECTORY_SEPARATOR . $prefix, $built_files);
|
||||
chdir($old_cwd);
|
||||
return $built_files;
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ phpizeCallback()
|
||||
|
||||
/**
|
||||
* Message callback function used when running the "phpize"
|
||||
* program. Extracts the API numbers used. Ignores other message
|
||||
@@ -361,9 +433,6 @@ class PEAR_Builder extends PEAR_Common
|
||||
}
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ _runCommand()
|
||||
|
||||
/**
|
||||
* Run an external command, using a message callback to report
|
||||
* output. The command will be run through popen and output is
|
||||
@@ -383,7 +452,7 @@ class PEAR_Builder extends PEAR_Common
|
||||
function _runCommand($command, $callback = null)
|
||||
{
|
||||
$this->log(1, "running: $command");
|
||||
$pp = @popen("$command 2>&1", "r");
|
||||
$pp = popen("$command 2>&1", "r");
|
||||
if (!$pp) {
|
||||
return $this->raiseError("failed to run `$command'");
|
||||
}
|
||||
@@ -402,13 +471,11 @@ class PEAR_Builder extends PEAR_Common
|
||||
if ($callback && isset($olddbg)) {
|
||||
$callback[0]->debug = $olddbg;
|
||||
}
|
||||
$exitcode = @pclose($pp);
|
||||
|
||||
$exitcode = is_resource($pp) ? pclose($pp) : -1;
|
||||
return ($exitcode == 0);
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ log()
|
||||
|
||||
function log($level, $msg)
|
||||
{
|
||||
if ($this->current_callback) {
|
||||
@@ -419,8 +486,4 @@ class PEAR_Builder extends PEAR_Common
|
||||
}
|
||||
return PEAR_Common::log($level, $msg);
|
||||
}
|
||||
|
||||
// }}}
|
||||
}
|
||||
|
||||
?>
|
||||
}
|
||||
Vendored
+1559
File diff suppressed because it is too large
Load Diff
Vendored
+68
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
/**
|
||||
* PEAR_ChannelFile_Parser for parsing channel.xml
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version CVS: $Id: Parser.php 313023 2011-07-06 19:17:11Z dufuz $
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since File available since Release 1.4.0a1
|
||||
*/
|
||||
|
||||
/**
|
||||
* base xml parser class
|
||||
*/
|
||||
require_once 'PEAR/XMLParser.php';
|
||||
require_once 'PEAR/ChannelFile.php';
|
||||
/**
|
||||
* Parser for channel.xml
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version Release: 1.9.4
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since Class available since Release 1.4.0a1
|
||||
*/
|
||||
class PEAR_ChannelFile_Parser extends PEAR_XMLParser
|
||||
{
|
||||
var $_config;
|
||||
var $_logger;
|
||||
var $_registry;
|
||||
|
||||
function setConfig(&$c)
|
||||
{
|
||||
$this->_config = &$c;
|
||||
$this->_registry = &$c->getRegistry();
|
||||
}
|
||||
|
||||
function setLogger(&$l)
|
||||
{
|
||||
$this->_logger = &$l;
|
||||
}
|
||||
|
||||
function parse($data, $file)
|
||||
{
|
||||
if (PEAR::isError($err = parent::parse($data, $file))) {
|
||||
return $err;
|
||||
}
|
||||
|
||||
$ret = new PEAR_ChannelFile;
|
||||
$ret->setConfig($this->_config);
|
||||
if (isset($this->_logger)) {
|
||||
$ret->setLogger($this->_logger);
|
||||
}
|
||||
|
||||
$ret->fromArray($this->_unserializedData);
|
||||
// make sure the filelist is in the easy to read format needed
|
||||
$ret->flattenFilelist();
|
||||
$ret->setPackagefile($file, $archive);
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
+123
-107
@@ -1,25 +1,26 @@
|
||||
<?php
|
||||
//
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 5 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available through the world-wide-web at the following url: |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Author: Stig Bakken <ssb@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: Command.php,v 1.24 2004/05/16 15:43:30 pajoye Exp $
|
||||
/**
|
||||
* PEAR_Command, command pattern class
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Stig Bakken <ssb@php.net>
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version CVS: $Id: Command.php 313023 2011-07-06 19:17:11Z dufuz $
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since File available since Release 0.1
|
||||
*/
|
||||
|
||||
|
||||
require_once "PEAR.php";
|
||||
/**
|
||||
* Needed for error handling
|
||||
*/
|
||||
require_once 'PEAR.php';
|
||||
require_once 'PEAR/Frontend.php';
|
||||
require_once 'PEAR/XMLParser.php';
|
||||
|
||||
/**
|
||||
* List of commands and what classes they are implemented in.
|
||||
@@ -27,6 +28,12 @@ require_once "PEAR.php";
|
||||
*/
|
||||
$GLOBALS['_PEAR_Command_commandlist'] = array();
|
||||
|
||||
/**
|
||||
* List of commands and their descriptions
|
||||
* @var array command => description
|
||||
*/
|
||||
$GLOBALS['_PEAR_Command_commanddesc'] = array();
|
||||
|
||||
/**
|
||||
* List of shortcuts to common commands.
|
||||
* @var array shortcut => command
|
||||
@@ -39,18 +46,6 @@ $GLOBALS['_PEAR_Command_shortcuts'] = array();
|
||||
*/
|
||||
$GLOBALS['_PEAR_Command_objects'] = array();
|
||||
|
||||
/**
|
||||
* Which user interface class is being used.
|
||||
* @var string class name
|
||||
*/
|
||||
$GLOBALS['_PEAR_Command_uiclass'] = 'PEAR_Frontend_CLI';
|
||||
|
||||
/**
|
||||
* Instance of $_PEAR_Command_uiclass.
|
||||
* @var object
|
||||
*/
|
||||
$GLOBALS['_PEAR_Command_uiobject'] = null;
|
||||
|
||||
/**
|
||||
* PEAR command class, a simple factory class for administrative
|
||||
* commands.
|
||||
@@ -93,6 +88,15 @@ $GLOBALS['_PEAR_Command_uiobject'] = null;
|
||||
* - DON'T USE EXIT OR DIE! Always use pear errors. From static
|
||||
* classes do PEAR::raiseError(), from other classes do
|
||||
* $this->raiseError().
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Stig Bakken <ssb@php.net>
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version Release: 1.9.4
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since Class available since Release 0.1
|
||||
*/
|
||||
class PEAR_Command
|
||||
{
|
||||
@@ -109,7 +113,7 @@ class PEAR_Command
|
||||
* @access public
|
||||
* @static
|
||||
*/
|
||||
function factory($command, &$config)
|
||||
function &factory($command, &$config)
|
||||
{
|
||||
if (empty($GLOBALS['_PEAR_Command_commandlist'])) {
|
||||
PEAR_Command::registerCommands();
|
||||
@@ -118,13 +122,35 @@ class PEAR_Command
|
||||
$command = $GLOBALS['_PEAR_Command_shortcuts'][$command];
|
||||
}
|
||||
if (!isset($GLOBALS['_PEAR_Command_commandlist'][$command])) {
|
||||
return PEAR::raiseError("unknown command `$command'");
|
||||
$a = PEAR::raiseError("unknown command `$command'");
|
||||
return $a;
|
||||
}
|
||||
$class = $GLOBALS['_PEAR_Command_commandlist'][$command];
|
||||
if (!class_exists($class)) {
|
||||
require_once $GLOBALS['_PEAR_Command_objects'][$class];
|
||||
}
|
||||
if (!class_exists($class)) {
|
||||
$a = PEAR::raiseError("unknown command `$command'");
|
||||
return $a;
|
||||
}
|
||||
$ui = PEAR_Command::getFrontendObject();
|
||||
$obj = new $class($ui, $config);
|
||||
return $obj;
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ & getObject()
|
||||
function &getObject($command)
|
||||
{
|
||||
$class = $GLOBALS['_PEAR_Command_commandlist'][$command];
|
||||
if (!class_exists($class)) {
|
||||
require_once $GLOBALS['_PEAR_Command_objects'][$class];
|
||||
}
|
||||
if (!class_exists($class)) {
|
||||
return PEAR::raiseError("unknown command `$command'");
|
||||
}
|
||||
$ui =& PEAR_Command::getFrontendObject();
|
||||
$ui = PEAR_Command::getFrontendObject();
|
||||
$config = &PEAR_Config::singleton();
|
||||
$obj = &new $class($ui, $config);
|
||||
return $obj;
|
||||
}
|
||||
@@ -135,15 +161,13 @@ class PEAR_Command
|
||||
/**
|
||||
* Get instance of frontend object.
|
||||
*
|
||||
* @return object
|
||||
* @return object|PEAR_Error
|
||||
* @static
|
||||
*/
|
||||
function &getFrontendObject()
|
||||
{
|
||||
if (empty($GLOBALS['_PEAR_Command_uiobject'])) {
|
||||
$GLOBALS['_PEAR_Command_uiobject'] = &new $GLOBALS['_PEAR_Command_uiclass'];
|
||||
}
|
||||
return $GLOBALS['_PEAR_Command_uiobject'];
|
||||
$a = &PEAR_Frontend::singleton();
|
||||
return $a;
|
||||
}
|
||||
|
||||
// }}}
|
||||
@@ -159,59 +183,13 @@ class PEAR_Command
|
||||
*/
|
||||
function &setFrontendClass($uiclass)
|
||||
{
|
||||
if (is_object($GLOBALS['_PEAR_Command_uiobject']) &&
|
||||
is_a($GLOBALS['_PEAR_Command_uiobject'], $uiclass)) {
|
||||
return $GLOBALS['_PEAR_Command_uiobject'];
|
||||
}
|
||||
if (!class_exists($uiclass)) {
|
||||
$file = str_replace('_', '/', $uiclass) . '.php';
|
||||
if (PEAR_Command::isIncludeable($file)) {
|
||||
include_once $file;
|
||||
}
|
||||
}
|
||||
if (class_exists($uiclass)) {
|
||||
$obj = &new $uiclass;
|
||||
// quick test to see if this class implements a few of the most
|
||||
// important frontend methods
|
||||
if (method_exists($obj, 'userConfirm')) {
|
||||
$GLOBALS['_PEAR_Command_uiobject'] = &$obj;
|
||||
$GLOBALS['_PEAR_Command_uiclass'] = $uiclass;
|
||||
return $obj;
|
||||
} else {
|
||||
$err = PEAR::raiseError("not a frontend class: $uiclass");
|
||||
return $err;
|
||||
}
|
||||
}
|
||||
$err = PEAR::raiseError("no such class: $uiclass");
|
||||
return $err;
|
||||
$a = &PEAR_Frontend::setFrontendClass($uiclass);
|
||||
return $a;
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ setFrontendType()
|
||||
|
||||
// }}}
|
||||
// {{{ isIncludeable()
|
||||
|
||||
/**
|
||||
* @param string $path relative or absolute include path
|
||||
* @return boolean
|
||||
* @static
|
||||
*/
|
||||
function isIncludeable($path)
|
||||
{
|
||||
if (file_exists($path) && is_readable($path)) {
|
||||
return true;
|
||||
}
|
||||
$ipath = explode(PATH_SEPARATOR, ini_get('include_path'));
|
||||
foreach ($ipath as $include) {
|
||||
$test = realpath($include . DIRECTORY_SEPARATOR . $path);
|
||||
if (file_exists($test) && is_readable($test)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set current frontend.
|
||||
*
|
||||
@@ -249,9 +227,13 @@ class PEAR_Command
|
||||
*/
|
||||
function registerCommands($merge = false, $dir = null)
|
||||
{
|
||||
$parser = new PEAR_XMLParser;
|
||||
if ($dir === null) {
|
||||
$dir = dirname(__FILE__) . '/Command';
|
||||
}
|
||||
if (!is_dir($dir)) {
|
||||
return PEAR::raiseError("registerCommands: opendir($dir) '$dir' does not exist or is not a directory");
|
||||
}
|
||||
$dp = @opendir($dir);
|
||||
if (empty($dp)) {
|
||||
return PEAR::raiseError("registerCommands: opendir($dir) failed");
|
||||
@@ -259,27 +241,58 @@ class PEAR_Command
|
||||
if (!$merge) {
|
||||
$GLOBALS['_PEAR_Command_commandlist'] = array();
|
||||
}
|
||||
while ($entry = readdir($dp)) {
|
||||
if ($entry{0} == '.' || substr($entry, -4) != '.php' || $entry == 'Common.php') {
|
||||
|
||||
while ($file = readdir($dp)) {
|
||||
if ($file{0} == '.' || substr($file, -4) != '.xml') {
|
||||
continue;
|
||||
}
|
||||
$class = "PEAR_Command_".substr($entry, 0, -4);
|
||||
$file = "$dir/$entry";
|
||||
include_once $file;
|
||||
|
||||
$f = substr($file, 0, -4);
|
||||
$class = "PEAR_Command_" . $f;
|
||||
// List of commands
|
||||
if (empty($GLOBALS['_PEAR_Command_objects'][$class])) {
|
||||
$GLOBALS['_PEAR_Command_objects'][$class] = &new $class($ui, $config);
|
||||
$GLOBALS['_PEAR_Command_objects'][$class] = "$dir/" . $f . '.php';
|
||||
}
|
||||
$implements = $GLOBALS['_PEAR_Command_objects'][$class]->getCommands();
|
||||
|
||||
$parser->parse(file_get_contents("$dir/$file"));
|
||||
$implements = $parser->getData();
|
||||
foreach ($implements as $command => $desc) {
|
||||
if ($command == 'attribs') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (isset($GLOBALS['_PEAR_Command_commandlist'][$command])) {
|
||||
return PEAR::raiseError('Command "' . $command . '" already registered in ' .
|
||||
'class "' . $GLOBALS['_PEAR_Command_commandlist'][$command] . '"');
|
||||
}
|
||||
|
||||
$GLOBALS['_PEAR_Command_commandlist'][$command] = $class;
|
||||
$GLOBALS['_PEAR_Command_commanddesc'][$command] = $desc;
|
||||
}
|
||||
$shortcuts = $GLOBALS['_PEAR_Command_objects'][$class]->getShortcuts();
|
||||
foreach ($shortcuts as $shortcut => $command) {
|
||||
$GLOBALS['_PEAR_Command_shortcuts'][$shortcut] = $command;
|
||||
$GLOBALS['_PEAR_Command_commanddesc'][$command] = $desc['summary'];
|
||||
if (isset($desc['shortcut'])) {
|
||||
$shortcut = $desc['shortcut'];
|
||||
if (isset($GLOBALS['_PEAR_Command_shortcuts'][$shortcut])) {
|
||||
return PEAR::raiseError('Command shortcut "' . $shortcut . '" already ' .
|
||||
'registered to command "' . $command . '" in class "' .
|
||||
$GLOBALS['_PEAR_Command_commandlist'][$command] . '"');
|
||||
}
|
||||
$GLOBALS['_PEAR_Command_shortcuts'][$shortcut] = $command;
|
||||
}
|
||||
|
||||
if (isset($desc['options']) && $desc['options']) {
|
||||
foreach ($desc['options'] as $oname => $option) {
|
||||
if (isset($option['shortopt']) && strlen($option['shortopt']) > 1) {
|
||||
return PEAR::raiseError('Option "' . $oname . '" short option "' .
|
||||
$option['shortopt'] . '" must be ' .
|
||||
'only 1 character in Command "' . $command . '" in class "' .
|
||||
$class . '"');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ksort($GLOBALS['_PEAR_Command_shortcuts']);
|
||||
ksort($GLOBALS['_PEAR_Command_commandlist']);
|
||||
@closedir($dp);
|
||||
return true;
|
||||
}
|
||||
@@ -343,11 +356,13 @@ class PEAR_Command
|
||||
if (empty($GLOBALS['_PEAR_Command_commandlist'])) {
|
||||
PEAR_Command::registerCommands();
|
||||
}
|
||||
if (isset($GLOBALS['_PEAR_Command_shortcuts'][$command])) {
|
||||
$command = $GLOBALS['_PEAR_Command_shortcuts'][$command];
|
||||
}
|
||||
if (!isset($GLOBALS['_PEAR_Command_commandlist'][$command])) {
|
||||
return null;
|
||||
}
|
||||
$class = $GLOBALS['_PEAR_Command_commandlist'][$command];
|
||||
$obj = &$GLOBALS['_PEAR_Command_objects'][$class];
|
||||
$obj = &PEAR_Command::getObject($command);
|
||||
return $obj->getGetoptArgs($command, $short_args, $long_args);
|
||||
}
|
||||
|
||||
@@ -386,13 +401,14 @@ class PEAR_Command
|
||||
function getHelp($command)
|
||||
{
|
||||
$cmds = PEAR_Command::getCommands();
|
||||
if (isset($GLOBALS['_PEAR_Command_shortcuts'][$command])) {
|
||||
$command = $GLOBALS['_PEAR_Command_shortcuts'][$command];
|
||||
}
|
||||
if (isset($cmds[$command])) {
|
||||
$class = $cmds[$command];
|
||||
return $GLOBALS['_PEAR_Command_objects'][$class]->getHelp($command);
|
||||
$obj = &PEAR_Command::getObject($command);
|
||||
return $obj->getHelp($command);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
// }}}
|
||||
}
|
||||
|
||||
?>
|
||||
}
|
||||
Vendored
+81
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
/**
|
||||
* PEAR_Command_Auth (login, logout commands)
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Stig Bakken <ssb@php.net>
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version CVS: $Id: Auth.php 313023 2011-07-06 19:17:11Z dufuz $
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since File available since Release 0.1
|
||||
* @deprecated since 1.8.0alpha1
|
||||
*/
|
||||
|
||||
/**
|
||||
* base class
|
||||
*/
|
||||
require_once 'PEAR/Command/Channels.php';
|
||||
|
||||
/**
|
||||
* PEAR commands for login/logout
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Stig Bakken <ssb@php.net>
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version Release: 1.9.4
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since Class available since Release 0.1
|
||||
* @deprecated since 1.8.0alpha1
|
||||
*/
|
||||
class PEAR_Command_Auth extends PEAR_Command_Channels
|
||||
{
|
||||
var $commands = array(
|
||||
'login' => array(
|
||||
'summary' => 'Connects and authenticates to remote server [Deprecated in favor of channel-login]',
|
||||
'shortcut' => 'li',
|
||||
'function' => 'doLogin',
|
||||
'options' => array(),
|
||||
'doc' => '<channel name>
|
||||
WARNING: This function is deprecated in favor of using channel-login
|
||||
|
||||
Log in to a remote channel server. If <channel name> is not supplied,
|
||||
the default channel is used. To use remote functions in the installer
|
||||
that require any kind of privileges, you need to log in first. The
|
||||
username and password you enter here will be stored in your per-user
|
||||
PEAR configuration (~/.pearrc on Unix-like systems). After logging
|
||||
in, your username and password will be sent along in subsequent
|
||||
operations on the remote server.',
|
||||
),
|
||||
'logout' => array(
|
||||
'summary' => 'Logs out from the remote server [Deprecated in favor of channel-logout]',
|
||||
'shortcut' => 'lo',
|
||||
'function' => 'doLogout',
|
||||
'options' => array(),
|
||||
'doc' => '
|
||||
WARNING: This function is deprecated in favor of using channel-logout
|
||||
|
||||
Logs out from the remote server. This command does not actually
|
||||
connect to the remote server, it only deletes the stored username and
|
||||
password from your user configuration.',
|
||||
)
|
||||
|
||||
);
|
||||
|
||||
/**
|
||||
* PEAR_Command_Auth constructor.
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PEAR_Command_Auth(&$ui, &$config)
|
||||
{
|
||||
parent::PEAR_Command_Channels($ui, $config);
|
||||
}
|
||||
}
|
||||
Vendored
+30
@@ -0,0 +1,30 @@
|
||||
<commands version="1.0">
|
||||
<login>
|
||||
<summary>Connects and authenticates to remote server [Deprecated in favor of channel-login]</summary>
|
||||
<function>doLogin</function>
|
||||
<shortcut>li</shortcut>
|
||||
<options />
|
||||
<doc><channel name>
|
||||
WARNING: This function is deprecated in favor of using channel-login
|
||||
|
||||
Log in to a remote channel server. If <channel name> is not supplied,
|
||||
the default channel is used. To use remote functions in the installer
|
||||
that require any kind of privileges, you need to log in first. The
|
||||
username and password you enter here will be stored in your per-user
|
||||
PEAR configuration (~/.pearrc on Unix-like systems). After logging
|
||||
in, your username and password will be sent along in subsequent
|
||||
operations on the remote server.</doc>
|
||||
</login>
|
||||
<logout>
|
||||
<summary>Logs out from the remote server [Deprecated in favor of channel-logout]</summary>
|
||||
<function>doLogout</function>
|
||||
<shortcut>lo</shortcut>
|
||||
<options />
|
||||
<doc>
|
||||
WARNING: This function is deprecated in favor of using channel-logout
|
||||
|
||||
Logs out from the remote server. This command does not actually
|
||||
connect to the remote server, it only deletes the stored username and
|
||||
password from your user configuration.</doc>
|
||||
</logout>
|
||||
</commands>
|
||||
Vendored
+85
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
/**
|
||||
* PEAR_Command_Auth (build command)
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Stig Bakken <ssb@php.net>
|
||||
* @author Tomas V.V.Cox <cox@idecnet.com>
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version CVS: $Id: Build.php 313023 2011-07-06 19:17:11Z dufuz $
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since File available since Release 0.1
|
||||
*/
|
||||
|
||||
/**
|
||||
* base class
|
||||
*/
|
||||
require_once 'PEAR/Command/Common.php';
|
||||
|
||||
/**
|
||||
* PEAR commands for building extensions.
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Stig Bakken <ssb@php.net>
|
||||
* @author Tomas V.V.Cox <cox@idecnet.com>
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version Release: 1.9.4
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since Class available since Release 0.1
|
||||
*/
|
||||
class PEAR_Command_Build extends PEAR_Command_Common
|
||||
{
|
||||
var $commands = array(
|
||||
'build' => array(
|
||||
'summary' => 'Build an Extension From C Source',
|
||||
'function' => 'doBuild',
|
||||
'shortcut' => 'b',
|
||||
'options' => array(),
|
||||
'doc' => '[package.xml]
|
||||
Builds one or more extensions contained in a package.'
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
* PEAR_Command_Build constructor.
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PEAR_Command_Build(&$ui, &$config)
|
||||
{
|
||||
parent::PEAR_Command_Common($ui, $config);
|
||||
}
|
||||
|
||||
function doBuild($command, $options, $params)
|
||||
{
|
||||
require_once 'PEAR/Builder.php';
|
||||
if (sizeof($params) < 1) {
|
||||
$params[0] = 'package.xml';
|
||||
}
|
||||
|
||||
$builder = &new PEAR_Builder($this->ui);
|
||||
$this->debug = $this->config->get('verbose');
|
||||
$err = $builder->build($params[0], array(&$this, 'buildCallback'));
|
||||
if (PEAR::isError($err)) {
|
||||
return $err;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function buildCallback($what, $data)
|
||||
{
|
||||
if (($what == 'cmdoutput' && $this->debug > 1) ||
|
||||
($what == 'output' && $this->debug > 0)) {
|
||||
$this->ui->outputData(rtrim($data), 'build');
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
<commands version="1.0">
|
||||
<build>
|
||||
<summary>Build an Extension From C Source</summary>
|
||||
<function>doBuild</function>
|
||||
<shortcut>b</shortcut>
|
||||
<options />
|
||||
<doc>[package.xml]
|
||||
Builds one or more extensions contained in a package.</doc>
|
||||
</build>
|
||||
</commands>
|
||||
Vendored
+883
@@ -0,0 +1,883 @@
|
||||
<?php
|
||||
// /* vim: set expandtab tabstop=4 shiftwidth=4: */
|
||||
/**
|
||||
* PEAR_Command_Channels (list-channels, update-channels, channel-delete, channel-add,
|
||||
* channel-update, channel-info, channel-alias, channel-discover commands)
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Stig Bakken <ssb@php.net>
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version CVS: $Id: Channels.php 313023 2011-07-06 19:17:11Z dufuz $
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since File available since Release 1.4.0a1
|
||||
*/
|
||||
|
||||
/**
|
||||
* base class
|
||||
*/
|
||||
require_once 'PEAR/Command/Common.php';
|
||||
|
||||
define('PEAR_COMMAND_CHANNELS_CHANNEL_EXISTS', -500);
|
||||
|
||||
/**
|
||||
* PEAR commands for managing channels.
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version Release: 1.9.4
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since Class available since Release 1.4.0a1
|
||||
*/
|
||||
class PEAR_Command_Channels extends PEAR_Command_Common
|
||||
{
|
||||
var $commands = array(
|
||||
'list-channels' => array(
|
||||
'summary' => 'List Available Channels',
|
||||
'function' => 'doList',
|
||||
'shortcut' => 'lc',
|
||||
'options' => array(),
|
||||
'doc' => '
|
||||
List all available channels for installation.
|
||||
',
|
||||
),
|
||||
'update-channels' => array(
|
||||
'summary' => 'Update the Channel List',
|
||||
'function' => 'doUpdateAll',
|
||||
'shortcut' => 'uc',
|
||||
'options' => array(),
|
||||
'doc' => '
|
||||
List all installed packages in all channels.
|
||||
'
|
||||
),
|
||||
'channel-delete' => array(
|
||||
'summary' => 'Remove a Channel From the List',
|
||||
'function' => 'doDelete',
|
||||
'shortcut' => 'cde',
|
||||
'options' => array(),
|
||||
'doc' => '<channel name>
|
||||
Delete a channel from the registry. You may not
|
||||
remove any channel that has installed packages.
|
||||
'
|
||||
),
|
||||
'channel-add' => array(
|
||||
'summary' => 'Add a Channel',
|
||||
'function' => 'doAdd',
|
||||
'shortcut' => 'ca',
|
||||
'options' => array(),
|
||||
'doc' => '<channel.xml>
|
||||
Add a private channel to the channel list. Note that all
|
||||
public channels should be synced using "update-channels".
|
||||
Parameter may be either a local file or remote URL to a
|
||||
channel.xml.
|
||||
'
|
||||
),
|
||||
'channel-update' => array(
|
||||
'summary' => 'Update an Existing Channel',
|
||||
'function' => 'doUpdate',
|
||||
'shortcut' => 'cu',
|
||||
'options' => array(
|
||||
'force' => array(
|
||||
'shortopt' => 'f',
|
||||
'doc' => 'will force download of new channel.xml if an existing channel name is used',
|
||||
),
|
||||
'channel' => array(
|
||||
'shortopt' => 'c',
|
||||
'arg' => 'CHANNEL',
|
||||
'doc' => 'will force download of new channel.xml if an existing channel name is used',
|
||||
),
|
||||
),
|
||||
'doc' => '[<channel.xml>|<channel name>]
|
||||
Update a channel in the channel list directly. Note that all
|
||||
public channels can be synced using "update-channels".
|
||||
Parameter may be a local or remote channel.xml, or the name of
|
||||
an existing channel.
|
||||
'
|
||||
),
|
||||
'channel-info' => array(
|
||||
'summary' => 'Retrieve Information on a Channel',
|
||||
'function' => 'doInfo',
|
||||
'shortcut' => 'ci',
|
||||
'options' => array(),
|
||||
'doc' => '<package>
|
||||
List the files in an installed package.
|
||||
'
|
||||
),
|
||||
'channel-alias' => array(
|
||||
'summary' => 'Specify an alias to a channel name',
|
||||
'function' => 'doAlias',
|
||||
'shortcut' => 'cha',
|
||||
'options' => array(),
|
||||
'doc' => '<channel> <alias>
|
||||
Specify a specific alias to use for a channel name.
|
||||
The alias may not be an existing channel name or
|
||||
alias.
|
||||
'
|
||||
),
|
||||
'channel-discover' => array(
|
||||
'summary' => 'Initialize a Channel from its server',
|
||||
'function' => 'doDiscover',
|
||||
'shortcut' => 'di',
|
||||
'options' => array(),
|
||||
'doc' => '[<channel.xml>|<channel name>]
|
||||
Initialize a channel from its server and create a local channel.xml.
|
||||
If <channel name> is in the format "<username>:<password>@<channel>" then
|
||||
<username> and <password> will be set as the login username/password for
|
||||
<channel>. Use caution when passing the username/password in this way, as
|
||||
it may allow other users on your computer to briefly view your username/
|
||||
password via the system\'s process list.
|
||||
'
|
||||
),
|
||||
'channel-login' => array(
|
||||
'summary' => 'Connects and authenticates to remote channel server',
|
||||
'shortcut' => 'cli',
|
||||
'function' => 'doLogin',
|
||||
'options' => array(),
|
||||
'doc' => '<channel name>
|
||||
Log in to a remote channel server. If <channel name> is not supplied,
|
||||
the default channel is used. To use remote functions in the installer
|
||||
that require any kind of privileges, you need to log in first. The
|
||||
username and password you enter here will be stored in your per-user
|
||||
PEAR configuration (~/.pearrc on Unix-like systems). After logging
|
||||
in, your username and password will be sent along in subsequent
|
||||
operations on the remote server.',
|
||||
),
|
||||
'channel-logout' => array(
|
||||
'summary' => 'Logs out from the remote channel server',
|
||||
'shortcut' => 'clo',
|
||||
'function' => 'doLogout',
|
||||
'options' => array(),
|
||||
'doc' => '<channel name>
|
||||
Logs out from a remote channel server. If <channel name> is not supplied,
|
||||
the default channel is used. This command does not actually connect to the
|
||||
remote server, it only deletes the stored username and password from your user
|
||||
configuration.',
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
* PEAR_Command_Registry constructor.
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PEAR_Command_Channels(&$ui, &$config)
|
||||
{
|
||||
parent::PEAR_Command_Common($ui, $config);
|
||||
}
|
||||
|
||||
function _sortChannels($a, $b)
|
||||
{
|
||||
return strnatcasecmp($a->getName(), $b->getName());
|
||||
}
|
||||
|
||||
function doList($command, $options, $params)
|
||||
{
|
||||
$reg = &$this->config->getRegistry();
|
||||
$registered = $reg->getChannels();
|
||||
usort($registered, array(&$this, '_sortchannels'));
|
||||
$i = $j = 0;
|
||||
$data = array(
|
||||
'caption' => 'Registered Channels:',
|
||||
'border' => true,
|
||||
'headline' => array('Channel', 'Alias', 'Summary')
|
||||
);
|
||||
foreach ($registered as $channel) {
|
||||
$data['data'][] = array($channel->getName(),
|
||||
$channel->getAlias(),
|
||||
$channel->getSummary());
|
||||
}
|
||||
|
||||
if (count($registered) === 0) {
|
||||
$data = '(no registered channels)';
|
||||
}
|
||||
$this->ui->outputData($data, $command);
|
||||
return true;
|
||||
}
|
||||
|
||||
function doUpdateAll($command, $options, $params)
|
||||
{
|
||||
$reg = &$this->config->getRegistry();
|
||||
$channels = $reg->getChannels();
|
||||
|
||||
$success = true;
|
||||
foreach ($channels as $channel) {
|
||||
if ($channel->getName() != '__uri') {
|
||||
PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);
|
||||
$err = $this->doUpdate('channel-update',
|
||||
$options,
|
||||
array($channel->getName()));
|
||||
if (PEAR::isError($err)) {
|
||||
$this->ui->outputData($err->getMessage(), $command);
|
||||
$success = false;
|
||||
} else {
|
||||
$success &= $err;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $success;
|
||||
}
|
||||
|
||||
function doInfo($command, $options, $params)
|
||||
{
|
||||
if (count($params) !== 1) {
|
||||
return $this->raiseError("No channel specified");
|
||||
}
|
||||
|
||||
$reg = &$this->config->getRegistry();
|
||||
$channel = strtolower($params[0]);
|
||||
if ($reg->channelExists($channel)) {
|
||||
$chan = $reg->getChannel($channel);
|
||||
if (PEAR::isError($chan)) {
|
||||
return $this->raiseError($chan);
|
||||
}
|
||||
} else {
|
||||
if (strpos($channel, '://')) {
|
||||
$downloader = &$this->getDownloader();
|
||||
$tmpdir = $this->config->get('temp_dir');
|
||||
PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);
|
||||
$loc = $downloader->downloadHttp($channel, $this->ui, $tmpdir);
|
||||
PEAR::staticPopErrorHandling();
|
||||
if (PEAR::isError($loc)) {
|
||||
return $this->raiseError('Cannot open "' . $channel .
|
||||
'" (' . $loc->getMessage() . ')');
|
||||
} else {
|
||||
$contents = implode('', file($loc));
|
||||
}
|
||||
} else {
|
||||
if (!file_exists($params[0])) {
|
||||
return $this->raiseError('Unknown channel "' . $channel . '"');
|
||||
}
|
||||
|
||||
$fp = fopen($params[0], 'r');
|
||||
if (!$fp) {
|
||||
return $this->raiseError('Cannot open "' . $params[0] . '"');
|
||||
}
|
||||
|
||||
$contents = '';
|
||||
while (!feof($fp)) {
|
||||
$contents .= fread($fp, 1024);
|
||||
}
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
if (!class_exists('PEAR_ChannelFile')) {
|
||||
require_once 'PEAR/ChannelFile.php';
|
||||
}
|
||||
|
||||
$chan = new PEAR_ChannelFile;
|
||||
$chan->fromXmlString($contents);
|
||||
$chan->validate();
|
||||
if ($errs = $chan->getErrors(true)) {
|
||||
foreach ($errs as $err) {
|
||||
$this->ui->outputData($err['level'] . ': ' . $err['message']);
|
||||
}
|
||||
return $this->raiseError('Channel file "' . $params[0] . '" is not valid');
|
||||
}
|
||||
}
|
||||
|
||||
if (!$chan) {
|
||||
return $this->raiseError('Serious error: Channel "' . $params[0] .
|
||||
'" has a corrupted registry entry');
|
||||
}
|
||||
|
||||
$channel = $chan->getName();
|
||||
$caption = 'Channel ' . $channel . ' Information:';
|
||||
$data1 = array(
|
||||
'caption' => $caption,
|
||||
'border' => true);
|
||||
$data1['data']['server'] = array('Name and Server', $chan->getName());
|
||||
if ($chan->getAlias() != $chan->getName()) {
|
||||
$data1['data']['alias'] = array('Alias', $chan->getAlias());
|
||||
}
|
||||
|
||||
$data1['data']['summary'] = array('Summary', $chan->getSummary());
|
||||
$validate = $chan->getValidationPackage();
|
||||
$data1['data']['vpackage'] = array('Validation Package Name', $validate['_content']);
|
||||
$data1['data']['vpackageversion'] =
|
||||
array('Validation Package Version', $validate['attribs']['version']);
|
||||
$d = array();
|
||||
$d['main'] = $data1;
|
||||
|
||||
$data['data'] = array();
|
||||
$data['caption'] = 'Server Capabilities';
|
||||
$data['headline'] = array('Type', 'Version/REST type', 'Function Name/REST base');
|
||||
if ($chan->supportsREST()) {
|
||||
if ($chan->supportsREST()) {
|
||||
$funcs = $chan->getFunctions('rest');
|
||||
if (!isset($funcs[0])) {
|
||||
$funcs = array($funcs);
|
||||
}
|
||||
foreach ($funcs as $protocol) {
|
||||
$data['data'][] = array('rest', $protocol['attribs']['type'],
|
||||
$protocol['_content']);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$data['data'][] = array('No supported protocols');
|
||||
}
|
||||
|
||||
$d['protocols'] = $data;
|
||||
$data['data'] = array();
|
||||
$mirrors = $chan->getMirrors();
|
||||
if ($mirrors) {
|
||||
$data['caption'] = 'Channel ' . $channel . ' Mirrors:';
|
||||
unset($data['headline']);
|
||||
foreach ($mirrors as $mirror) {
|
||||
$data['data'][] = array($mirror['attribs']['host']);
|
||||
$d['mirrors'] = $data;
|
||||
}
|
||||
|
||||
foreach ($mirrors as $i => $mirror) {
|
||||
$data['data'] = array();
|
||||
$data['caption'] = 'Mirror ' . $mirror['attribs']['host'] . ' Capabilities';
|
||||
$data['headline'] = array('Type', 'Version/REST type', 'Function Name/REST base');
|
||||
if ($chan->supportsREST($mirror['attribs']['host'])) {
|
||||
if ($chan->supportsREST($mirror['attribs']['host'])) {
|
||||
$funcs = $chan->getFunctions('rest', $mirror['attribs']['host']);
|
||||
if (!isset($funcs[0])) {
|
||||
$funcs = array($funcs);
|
||||
}
|
||||
|
||||
foreach ($funcs as $protocol) {
|
||||
$data['data'][] = array('rest', $protocol['attribs']['type'],
|
||||
$protocol['_content']);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$data['data'][] = array('No supported protocols');
|
||||
}
|
||||
$d['mirrorprotocols' . $i] = $data;
|
||||
}
|
||||
}
|
||||
$this->ui->outputData($d, 'channel-info');
|
||||
}
|
||||
|
||||
// }}}
|
||||
|
||||
function doDelete($command, $options, $params)
|
||||
{
|
||||
if (count($params) !== 1) {
|
||||
return $this->raiseError('channel-delete: no channel specified');
|
||||
}
|
||||
|
||||
$reg = &$this->config->getRegistry();
|
||||
if (!$reg->channelExists($params[0])) {
|
||||
return $this->raiseError('channel-delete: channel "' . $params[0] . '" does not exist');
|
||||
}
|
||||
|
||||
$channel = $reg->channelName($params[0]);
|
||||
if ($channel == 'pear.php.net') {
|
||||
return $this->raiseError('Cannot delete the pear.php.net channel');
|
||||
}
|
||||
|
||||
if ($channel == 'pecl.php.net') {
|
||||
return $this->raiseError('Cannot delete the pecl.php.net channel');
|
||||
}
|
||||
|
||||
if ($channel == 'doc.php.net') {
|
||||
return $this->raiseError('Cannot delete the doc.php.net channel');
|
||||
}
|
||||
|
||||
if ($channel == '__uri') {
|
||||
return $this->raiseError('Cannot delete the __uri pseudo-channel');
|
||||
}
|
||||
|
||||
if (PEAR::isError($err = $reg->listPackages($channel))) {
|
||||
return $err;
|
||||
}
|
||||
|
||||
if (count($err)) {
|
||||
return $this->raiseError('Channel "' . $channel .
|
||||
'" has installed packages, cannot delete');
|
||||
}
|
||||
|
||||
if (!$reg->deleteChannel($channel)) {
|
||||
return $this->raiseError('Channel "' . $channel . '" deletion failed');
|
||||
} else {
|
||||
$this->config->deleteChannel($channel);
|
||||
$this->ui->outputData('Channel "' . $channel . '" deleted', $command);
|
||||
}
|
||||
}
|
||||
|
||||
function doAdd($command, $options, $params)
|
||||
{
|
||||
if (count($params) !== 1) {
|
||||
return $this->raiseError('channel-add: no channel file specified');
|
||||
}
|
||||
|
||||
if (strpos($params[0], '://')) {
|
||||
$downloader = &$this->getDownloader();
|
||||
$tmpdir = $this->config->get('temp_dir');
|
||||
if (!file_exists($tmpdir)) {
|
||||
require_once 'System.php';
|
||||
PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);
|
||||
$err = System::mkdir(array('-p', $tmpdir));
|
||||
PEAR::staticPopErrorHandling();
|
||||
if (PEAR::isError($err)) {
|
||||
return $this->raiseError('channel-add: temp_dir does not exist: "' .
|
||||
$tmpdir .
|
||||
'" - You can change this location with "pear config-set temp_dir"');
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_writable($tmpdir)) {
|
||||
return $this->raiseError('channel-add: temp_dir is not writable: "' .
|
||||
$tmpdir .
|
||||
'" - You can change this location with "pear config-set temp_dir"');
|
||||
}
|
||||
|
||||
PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);
|
||||
$loc = $downloader->downloadHttp($params[0], $this->ui, $tmpdir, null, false);
|
||||
PEAR::staticPopErrorHandling();
|
||||
if (PEAR::isError($loc)) {
|
||||
return $this->raiseError('channel-add: Cannot open "' . $params[0] .
|
||||
'" (' . $loc->getMessage() . ')');
|
||||
}
|
||||
|
||||
list($loc, $lastmodified) = $loc;
|
||||
$contents = implode('', file($loc));
|
||||
} else {
|
||||
$lastmodified = $fp = false;
|
||||
if (file_exists($params[0])) {
|
||||
$fp = fopen($params[0], 'r');
|
||||
}
|
||||
|
||||
if (!$fp) {
|
||||
return $this->raiseError('channel-add: cannot open "' . $params[0] . '"');
|
||||
}
|
||||
|
||||
$contents = '';
|
||||
while (!feof($fp)) {
|
||||
$contents .= fread($fp, 1024);
|
||||
}
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
if (!class_exists('PEAR_ChannelFile')) {
|
||||
require_once 'PEAR/ChannelFile.php';
|
||||
}
|
||||
|
||||
$channel = new PEAR_ChannelFile;
|
||||
PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);
|
||||
$result = $channel->fromXmlString($contents);
|
||||
PEAR::staticPopErrorHandling();
|
||||
if (!$result) {
|
||||
$exit = false;
|
||||
if (count($errors = $channel->getErrors(true))) {
|
||||
foreach ($errors as $error) {
|
||||
$this->ui->outputData(ucfirst($error['level'] . ': ' . $error['message']));
|
||||
if (!$exit) {
|
||||
$exit = $error['level'] == 'error' ? true : false;
|
||||
}
|
||||
}
|
||||
if ($exit) {
|
||||
return $this->raiseError('channel-add: invalid channel.xml file');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$reg = &$this->config->getRegistry();
|
||||
if ($reg->channelExists($channel->getName())) {
|
||||
return $this->raiseError('channel-add: Channel "' . $channel->getName() .
|
||||
'" exists, use channel-update to update entry', PEAR_COMMAND_CHANNELS_CHANNEL_EXISTS);
|
||||
}
|
||||
|
||||
$ret = $reg->addChannel($channel, $lastmodified);
|
||||
if (PEAR::isError($ret)) {
|
||||
return $ret;
|
||||
}
|
||||
|
||||
if (!$ret) {
|
||||
return $this->raiseError('channel-add: adding Channel "' . $channel->getName() .
|
||||
'" to registry failed');
|
||||
}
|
||||
|
||||
$this->config->setChannels($reg->listChannels());
|
||||
$this->config->writeConfigFile();
|
||||
$this->ui->outputData('Adding Channel "' . $channel->getName() . '" succeeded', $command);
|
||||
}
|
||||
|
||||
function doUpdate($command, $options, $params)
|
||||
{
|
||||
if (count($params) !== 1) {
|
||||
return $this->raiseError("No channel file specified");
|
||||
}
|
||||
|
||||
$tmpdir = $this->config->get('temp_dir');
|
||||
if (!file_exists($tmpdir)) {
|
||||
require_once 'System.php';
|
||||
PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);
|
||||
$err = System::mkdir(array('-p', $tmpdir));
|
||||
PEAR::staticPopErrorHandling();
|
||||
if (PEAR::isError($err)) {
|
||||
return $this->raiseError('channel-add: temp_dir does not exist: "' .
|
||||
$tmpdir .
|
||||
'" - You can change this location with "pear config-set temp_dir"');
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_writable($tmpdir)) {
|
||||
return $this->raiseError('channel-add: temp_dir is not writable: "' .
|
||||
$tmpdir .
|
||||
'" - You can change this location with "pear config-set temp_dir"');
|
||||
}
|
||||
|
||||
$reg = &$this->config->getRegistry();
|
||||
$lastmodified = false;
|
||||
if ((!file_exists($params[0]) || is_dir($params[0]))
|
||||
&& $reg->channelExists(strtolower($params[0]))) {
|
||||
$c = $reg->getChannel(strtolower($params[0]));
|
||||
if (PEAR::isError($c)) {
|
||||
return $this->raiseError($c);
|
||||
}
|
||||
|
||||
$this->ui->outputData("Updating channel \"$params[0]\"", $command);
|
||||
$dl = &$this->getDownloader(array());
|
||||
// if force is specified, use a timestamp of "1" to force retrieval
|
||||
$lastmodified = isset($options['force']) ? false : $c->lastModified();
|
||||
PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);
|
||||
$contents = $dl->downloadHttp('http://' . $c->getName() . '/channel.xml',
|
||||
$this->ui, $tmpdir, null, $lastmodified);
|
||||
PEAR::staticPopErrorHandling();
|
||||
if (PEAR::isError($contents)) {
|
||||
// Attempt to fall back to https
|
||||
$this->ui->outputData("Channel \"$params[0]\" is not responding over http://, failed with message: " . $contents->getMessage());
|
||||
$this->ui->outputData("Trying channel \"$params[0]\" over https:// instead");
|
||||
PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);
|
||||
$contents = $dl->downloadHttp('https://' . $c->getName() . '/channel.xml',
|
||||
$this->ui, $tmpdir, null, $lastmodified);
|
||||
PEAR::staticPopErrorHandling();
|
||||
if (PEAR::isError($contents)) {
|
||||
return $this->raiseError('Cannot retrieve channel.xml for channel "' .
|
||||
$c->getName() . '" (' . $contents->getMessage() . ')');
|
||||
}
|
||||
}
|
||||
|
||||
list($contents, $lastmodified) = $contents;
|
||||
if (!$contents) {
|
||||
$this->ui->outputData("Channel \"$params[0]\" is up to date");
|
||||
return;
|
||||
}
|
||||
|
||||
$contents = implode('', file($contents));
|
||||
if (!class_exists('PEAR_ChannelFile')) {
|
||||
require_once 'PEAR/ChannelFile.php';
|
||||
}
|
||||
|
||||
$channel = new PEAR_ChannelFile;
|
||||
$channel->fromXmlString($contents);
|
||||
if (!$channel->getErrors()) {
|
||||
// security check: is the downloaded file for the channel we got it from?
|
||||
if (strtolower($channel->getName()) != strtolower($c->getName())) {
|
||||
if (!isset($options['force'])) {
|
||||
return $this->raiseError('ERROR: downloaded channel definition file' .
|
||||
' for channel "' . $channel->getName() . '" from channel "' .
|
||||
strtolower($c->getName()) . '"');
|
||||
}
|
||||
|
||||
$this->ui->log(0, 'WARNING: downloaded channel definition file' .
|
||||
' for channel "' . $channel->getName() . '" from channel "' .
|
||||
strtolower($c->getName()) . '"');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (strpos($params[0], '://')) {
|
||||
$dl = &$this->getDownloader();
|
||||
PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);
|
||||
$loc = $dl->downloadHttp($params[0],
|
||||
$this->ui, $tmpdir, null, $lastmodified);
|
||||
PEAR::staticPopErrorHandling();
|
||||
if (PEAR::isError($loc)) {
|
||||
return $this->raiseError("Cannot open " . $params[0] .
|
||||
' (' . $loc->getMessage() . ')');
|
||||
}
|
||||
|
||||
list($loc, $lastmodified) = $loc;
|
||||
$contents = implode('', file($loc));
|
||||
} else {
|
||||
$fp = false;
|
||||
if (file_exists($params[0])) {
|
||||
$fp = fopen($params[0], 'r');
|
||||
}
|
||||
|
||||
if (!$fp) {
|
||||
return $this->raiseError("Cannot open " . $params[0]);
|
||||
}
|
||||
|
||||
$contents = '';
|
||||
while (!feof($fp)) {
|
||||
$contents .= fread($fp, 1024);
|
||||
}
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
if (!class_exists('PEAR_ChannelFile')) {
|
||||
require_once 'PEAR/ChannelFile.php';
|
||||
}
|
||||
|
||||
$channel = new PEAR_ChannelFile;
|
||||
$channel->fromXmlString($contents);
|
||||
}
|
||||
|
||||
$exit = false;
|
||||
if (count($errors = $channel->getErrors(true))) {
|
||||
foreach ($errors as $error) {
|
||||
$this->ui->outputData(ucfirst($error['level'] . ': ' . $error['message']));
|
||||
if (!$exit) {
|
||||
$exit = $error['level'] == 'error' ? true : false;
|
||||
}
|
||||
}
|
||||
if ($exit) {
|
||||
return $this->raiseError('Invalid channel.xml file');
|
||||
}
|
||||
}
|
||||
|
||||
if (!$reg->channelExists($channel->getName())) {
|
||||
return $this->raiseError('Error: Channel "' . $channel->getName() .
|
||||
'" does not exist, use channel-add to add an entry');
|
||||
}
|
||||
|
||||
$ret = $reg->updateChannel($channel, $lastmodified);
|
||||
if (PEAR::isError($ret)) {
|
||||
return $ret;
|
||||
}
|
||||
|
||||
if (!$ret) {
|
||||
return $this->raiseError('Updating Channel "' . $channel->getName() .
|
||||
'" in registry failed');
|
||||
}
|
||||
|
||||
$this->config->setChannels($reg->listChannels());
|
||||
$this->config->writeConfigFile();
|
||||
$this->ui->outputData('Update of Channel "' . $channel->getName() . '" succeeded');
|
||||
}
|
||||
|
||||
function &getDownloader()
|
||||
{
|
||||
if (!class_exists('PEAR_Downloader')) {
|
||||
require_once 'PEAR/Downloader.php';
|
||||
}
|
||||
$a = new PEAR_Downloader($this->ui, array(), $this->config);
|
||||
return $a;
|
||||
}
|
||||
|
||||
function doAlias($command, $options, $params)
|
||||
{
|
||||
if (count($params) === 1) {
|
||||
return $this->raiseError('No channel alias specified');
|
||||
}
|
||||
|
||||
if (count($params) !== 2 || (!empty($params[1]) && $params[1]{0} == '-')) {
|
||||
return $this->raiseError(
|
||||
'Invalid format, correct is: channel-alias channel alias');
|
||||
}
|
||||
|
||||
$reg = &$this->config->getRegistry();
|
||||
if (!$reg->channelExists($params[0], true)) {
|
||||
$extra = '';
|
||||
if ($reg->isAlias($params[0])) {
|
||||
$extra = ' (use "channel-alias ' . $reg->channelName($params[0]) . ' ' .
|
||||
strtolower($params[1]) . '")';
|
||||
}
|
||||
|
||||
return $this->raiseError('"' . $params[0] . '" is not a valid channel' . $extra);
|
||||
}
|
||||
|
||||
if ($reg->isAlias($params[1])) {
|
||||
return $this->raiseError('Channel "' . $reg->channelName($params[1]) . '" is ' .
|
||||
'already aliased to "' . strtolower($params[1]) . '", cannot re-alias');
|
||||
}
|
||||
|
||||
$chan = &$reg->getChannel($params[0]);
|
||||
if (PEAR::isError($chan)) {
|
||||
return $this->raiseError('Corrupt registry? Error retrieving channel "' . $params[0] .
|
||||
'" information (' . $chan->getMessage() . ')');
|
||||
}
|
||||
|
||||
// make it a local alias
|
||||
if (!$chan->setAlias(strtolower($params[1]), true)) {
|
||||
return $this->raiseError('Alias "' . strtolower($params[1]) .
|
||||
'" is not a valid channel alias');
|
||||
}
|
||||
|
||||
$reg->updateChannel($chan);
|
||||
$this->ui->outputData('Channel "' . $chan->getName() . '" aliased successfully to "' .
|
||||
strtolower($params[1]) . '"');
|
||||
}
|
||||
|
||||
/**
|
||||
* The channel-discover command
|
||||
*
|
||||
* @param string $command command name
|
||||
* @param array $options option_name => value
|
||||
* @param array $params list of additional parameters.
|
||||
* $params[0] should contain a string with either:
|
||||
* - <channel name> or
|
||||
* - <username>:<password>@<channel name>
|
||||
* @return null|PEAR_Error
|
||||
*/
|
||||
function doDiscover($command, $options, $params)
|
||||
{
|
||||
if (count($params) !== 1) {
|
||||
return $this->raiseError("No channel server specified");
|
||||
}
|
||||
|
||||
// Look for the possible input format "<username>:<password>@<channel>"
|
||||
if (preg_match('/^(.+):(.+)@(.+)\\z/', $params[0], $matches)) {
|
||||
$username = $matches[1];
|
||||
$password = $matches[2];
|
||||
$channel = $matches[3];
|
||||
} else {
|
||||
$channel = $params[0];
|
||||
}
|
||||
|
||||
$reg = &$this->config->getRegistry();
|
||||
if ($reg->channelExists($channel)) {
|
||||
if (!$reg->isAlias($channel)) {
|
||||
return $this->raiseError("Channel \"$channel\" is already initialized", PEAR_COMMAND_CHANNELS_CHANNEL_EXISTS);
|
||||
}
|
||||
|
||||
return $this->raiseError("A channel alias named \"$channel\" " .
|
||||
'already exists, aliasing channel "' . $reg->channelName($channel)
|
||||
. '"');
|
||||
}
|
||||
|
||||
$this->pushErrorHandling(PEAR_ERROR_RETURN);
|
||||
$err = $this->doAdd($command, $options, array('http://' . $channel . '/channel.xml'));
|
||||
$this->popErrorHandling();
|
||||
if (PEAR::isError($err)) {
|
||||
if ($err->getCode() === PEAR_COMMAND_CHANNELS_CHANNEL_EXISTS) {
|
||||
return $this->raiseError("Discovery of channel \"$channel\" failed (" .
|
||||
$err->getMessage() . ')');
|
||||
}
|
||||
// Attempt fetch via https
|
||||
$this->ui->outputData("Discovering channel $channel over http:// failed with message: " . $err->getMessage());
|
||||
$this->ui->outputData("Trying to discover channel $channel over https:// instead");
|
||||
$this->pushErrorHandling(PEAR_ERROR_RETURN);
|
||||
$err = $this->doAdd($command, $options, array('https://' . $channel . '/channel.xml'));
|
||||
$this->popErrorHandling();
|
||||
if (PEAR::isError($err)) {
|
||||
return $this->raiseError("Discovery of channel \"$channel\" failed (" .
|
||||
$err->getMessage() . ')');
|
||||
}
|
||||
}
|
||||
|
||||
// Store username/password if they were given
|
||||
// Arguably we should do a logintest on the channel here, but since
|
||||
// that's awkward on a REST-based channel (even "pear login" doesn't
|
||||
// do it for those), and XML-RPC is deprecated, it's fairly pointless.
|
||||
if (isset($username)) {
|
||||
$this->config->set('username', $username, 'user', $channel);
|
||||
$this->config->set('password', $password, 'user', $channel);
|
||||
$this->config->store();
|
||||
$this->ui->outputData("Stored login for channel \"$channel\" using username \"$username\"", $command);
|
||||
}
|
||||
|
||||
$this->ui->outputData("Discovery of channel \"$channel\" succeeded", $command);
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the 'login' command.
|
||||
*
|
||||
* @param string $command command name
|
||||
* @param array $options option_name => value
|
||||
* @param array $params list of additional parameters
|
||||
*
|
||||
* @return bool TRUE on success or
|
||||
* a PEAR error on failure
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function doLogin($command, $options, $params)
|
||||
{
|
||||
$reg = &$this->config->getRegistry();
|
||||
|
||||
// If a parameter is supplied, use that as the channel to log in to
|
||||
$channel = isset($params[0]) ? $params[0] : $this->config->get('default_channel');
|
||||
|
||||
$chan = $reg->getChannel($channel);
|
||||
if (PEAR::isError($chan)) {
|
||||
return $this->raiseError($chan);
|
||||
}
|
||||
|
||||
$server = $this->config->get('preferred_mirror', null, $channel);
|
||||
$username = $this->config->get('username', null, $channel);
|
||||
if (empty($username)) {
|
||||
$username = isset($_ENV['USER']) ? $_ENV['USER'] : null;
|
||||
}
|
||||
$this->ui->outputData("Logging in to $server.", $command);
|
||||
|
||||
list($username, $password) = $this->ui->userDialog(
|
||||
$command,
|
||||
array('Username', 'Password'),
|
||||
array('text', 'password'),
|
||||
array($username, '')
|
||||
);
|
||||
$username = trim($username);
|
||||
$password = trim($password);
|
||||
|
||||
$ourfile = $this->config->getConfFile('user');
|
||||
if (!$ourfile) {
|
||||
$ourfile = $this->config->getConfFile('system');
|
||||
}
|
||||
|
||||
$this->config->set('username', $username, 'user', $channel);
|
||||
$this->config->set('password', $password, 'user', $channel);
|
||||
|
||||
if ($chan->supportsREST()) {
|
||||
$ok = true;
|
||||
}
|
||||
|
||||
if ($ok !== true) {
|
||||
return $this->raiseError('Login failed!');
|
||||
}
|
||||
|
||||
$this->ui->outputData("Logged in.", $command);
|
||||
// avoid changing any temporary settings changed with -d
|
||||
$ourconfig = new PEAR_Config($ourfile, $ourfile);
|
||||
$ourconfig->set('username', $username, 'user', $channel);
|
||||
$ourconfig->set('password', $password, 'user', $channel);
|
||||
$ourconfig->store();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the 'logout' command.
|
||||
*
|
||||
* @param string $command command name
|
||||
* @param array $options option_name => value
|
||||
* @param array $params list of additional parameters
|
||||
*
|
||||
* @return bool TRUE on success or
|
||||
* a PEAR error on failure
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function doLogout($command, $options, $params)
|
||||
{
|
||||
$reg = &$this->config->getRegistry();
|
||||
|
||||
// If a parameter is supplied, use that as the channel to log in to
|
||||
$channel = isset($params[0]) ? $params[0] : $this->config->get('default_channel');
|
||||
|
||||
$chan = $reg->getChannel($channel);
|
||||
if (PEAR::isError($chan)) {
|
||||
return $this->raiseError($chan);
|
||||
}
|
||||
|
||||
$server = $this->config->get('preferred_mirror', null, $channel);
|
||||
$this->ui->outputData("Logging out from $server.", $command);
|
||||
$this->config->remove('username', 'user', $channel);
|
||||
$this->config->remove('password', 'user', $channel);
|
||||
$this->config->store();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Vendored
+123
@@ -0,0 +1,123 @@
|
||||
<commands version="1.0">
|
||||
<list-channels>
|
||||
<summary>List Available Channels</summary>
|
||||
<function>doList</function>
|
||||
<shortcut>lc</shortcut>
|
||||
<options />
|
||||
<doc>
|
||||
List all available channels for installation.
|
||||
</doc>
|
||||
</list-channels>
|
||||
<update-channels>
|
||||
<summary>Update the Channel List</summary>
|
||||
<function>doUpdateAll</function>
|
||||
<shortcut>uc</shortcut>
|
||||
<options />
|
||||
<doc>
|
||||
List all installed packages in all channels.
|
||||
</doc>
|
||||
</update-channels>
|
||||
<channel-delete>
|
||||
<summary>Remove a Channel From the List</summary>
|
||||
<function>doDelete</function>
|
||||
<shortcut>cde</shortcut>
|
||||
<options />
|
||||
<doc><channel name>
|
||||
Delete a channel from the registry. You may not
|
||||
remove any channel that has installed packages.
|
||||
</doc>
|
||||
</channel-delete>
|
||||
<channel-add>
|
||||
<summary>Add a Channel</summary>
|
||||
<function>doAdd</function>
|
||||
<shortcut>ca</shortcut>
|
||||
<options />
|
||||
<doc><channel.xml>
|
||||
Add a private channel to the channel list. Note that all
|
||||
public channels should be synced using "update-channels".
|
||||
Parameter may be either a local file or remote URL to a
|
||||
channel.xml.
|
||||
</doc>
|
||||
</channel-add>
|
||||
<channel-update>
|
||||
<summary>Update an Existing Channel</summary>
|
||||
<function>doUpdate</function>
|
||||
<shortcut>cu</shortcut>
|
||||
<options>
|
||||
<force>
|
||||
<shortopt>f</shortopt>
|
||||
<doc>will force download of new channel.xml if an existing channel name is used</doc>
|
||||
</force>
|
||||
<channel>
|
||||
<shortopt>c</shortopt>
|
||||
<doc>will force download of new channel.xml if an existing channel name is used</doc>
|
||||
<arg>CHANNEL</arg>
|
||||
</channel>
|
||||
</options>
|
||||
<doc>[<channel.xml>|<channel name>]
|
||||
Update a channel in the channel list directly. Note that all
|
||||
public channels can be synced using "update-channels".
|
||||
Parameter may be a local or remote channel.xml, or the name of
|
||||
an existing channel.
|
||||
</doc>
|
||||
</channel-update>
|
||||
<channel-info>
|
||||
<summary>Retrieve Information on a Channel</summary>
|
||||
<function>doInfo</function>
|
||||
<shortcut>ci</shortcut>
|
||||
<options />
|
||||
<doc><package>
|
||||
List the files in an installed package.
|
||||
</doc>
|
||||
</channel-info>
|
||||
<channel-alias>
|
||||
<summary>Specify an alias to a channel name</summary>
|
||||
<function>doAlias</function>
|
||||
<shortcut>cha</shortcut>
|
||||
<options />
|
||||
<doc><channel> <alias>
|
||||
Specify a specific alias to use for a channel name.
|
||||
The alias may not be an existing channel name or
|
||||
alias.
|
||||
</doc>
|
||||
</channel-alias>
|
||||
<channel-discover>
|
||||
<summary>Initialize a Channel from its server</summary>
|
||||
<function>doDiscover</function>
|
||||
<shortcut>di</shortcut>
|
||||
<options />
|
||||
<doc>[<channel.xml>|<channel name>]
|
||||
Initialize a channel from its server and create a local channel.xml.
|
||||
If <channel name> is in the format "<username>:<password>@<channel>" then
|
||||
<username> and <password> will be set as the login username/password for
|
||||
<channel>. Use caution when passing the username/password in this way, as
|
||||
it may allow other users on your computer to briefly view your username/
|
||||
password via the system's process list.
|
||||
</doc>
|
||||
</channel-discover>
|
||||
<channel-login>
|
||||
<summary>Connects and authenticates to remote channel server</summary>
|
||||
<function>doLogin</function>
|
||||
<shortcut>cli</shortcut>
|
||||
<options />
|
||||
<doc><channel name>
|
||||
Log in to a remote channel server. If <channel name> is not supplied,
|
||||
the default channel is used. To use remote functions in the installer
|
||||
that require any kind of privileges, you need to log in first. The
|
||||
username and password you enter here will be stored in your per-user
|
||||
PEAR configuration (~/.pearrc on Unix-like systems). After logging
|
||||
in, your username and password will be sent along in subsequent
|
||||
operations on the remote server.</doc>
|
||||
</channel-login>
|
||||
<channel-logout>
|
||||
<summary>Logs out from the remote channel server</summary>
|
||||
<function>doLogout</function>
|
||||
<shortcut>clo</shortcut>
|
||||
<options />
|
||||
<doc><channel name>
|
||||
Logs out from a remote channel server. If <channel name> is not supplied,
|
||||
the default channel is used. This command does not actually connect to the
|
||||
remote server, it only deletes the stored username and password from your user
|
||||
configuration.</doc>
|
||||
</channel-logout>
|
||||
</commands>
|
||||
+95
-71
@@ -1,36 +1,52 @@
|
||||
<?php
|
||||
//
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 5 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available through the world-wide-web at the following url: |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Author: Stig Sæther Bakken <ssb@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: Common.php,v 1.24 2004/01/08 17:33:13 sniper Exp $
|
||||
/**
|
||||
* PEAR_Command_Common base class
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Stig Bakken <ssb@php.net>
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version CVS: $Id: Common.php 313023 2011-07-06 19:17:11Z dufuz $
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since File available since Release 0.1
|
||||
*/
|
||||
|
||||
require_once "PEAR.php";
|
||||
/**
|
||||
* base class
|
||||
*/
|
||||
require_once 'PEAR.php';
|
||||
|
||||
/**
|
||||
* PEAR commands base class
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Stig Bakken <ssb@php.net>
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version Release: 1.9.4
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since Class available since Release 0.1
|
||||
*/
|
||||
class PEAR_Command_Common extends PEAR
|
||||
{
|
||||
// {{{ properties
|
||||
|
||||
/**
|
||||
* PEAR_Config object used to pass user system and configuration
|
||||
* on when executing commands
|
||||
*
|
||||
* @var object
|
||||
* @var PEAR_Config
|
||||
*/
|
||||
var $config;
|
||||
/**
|
||||
* @var PEAR_Registry
|
||||
* @access protected
|
||||
*/
|
||||
var $_registry;
|
||||
|
||||
/**
|
||||
* User Interface object, for all interaction with the user.
|
||||
@@ -50,7 +66,7 @@ class PEAR_Command_Common extends PEAR
|
||||
|
||||
var $_deps_type_trans = array(
|
||||
'pkg' => 'package',
|
||||
'extension' => 'extension',
|
||||
'ext' => 'extension',
|
||||
'php' => 'PHP',
|
||||
'prog' => 'external program',
|
||||
'ldlib' => 'external library for linking',
|
||||
@@ -60,9 +76,6 @@ class PEAR_Command_Common extends PEAR
|
||||
'sapi' => 'SAPI backend'
|
||||
);
|
||||
|
||||
// }}}
|
||||
// {{{ constructor
|
||||
|
||||
/**
|
||||
* PEAR_Command_Common constructor.
|
||||
*
|
||||
@@ -75,10 +88,6 @@ class PEAR_Command_Common extends PEAR
|
||||
$this->ui = &$ui;
|
||||
}
|
||||
|
||||
// }}}
|
||||
|
||||
// {{{ getCommands()
|
||||
|
||||
/**
|
||||
* Return a list of all the commands defined by this class.
|
||||
* @return array list of commands
|
||||
@@ -90,12 +99,10 @@ class PEAR_Command_Common extends PEAR
|
||||
foreach (array_keys($this->commands) as $command) {
|
||||
$ret[$command] = $this->commands[$command]['summary'];
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ getShortcuts()
|
||||
|
||||
/**
|
||||
* Return a list of all the command shortcuts defined by this class.
|
||||
* @return array shortcut => command
|
||||
@@ -109,28 +116,34 @@ class PEAR_Command_Common extends PEAR
|
||||
$ret[$this->commands[$command]['shortcut']] = $command;
|
||||
}
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ getOptions()
|
||||
|
||||
function getOptions($command)
|
||||
{
|
||||
return @$this->commands[$command]['options'];
|
||||
}
|
||||
$shortcuts = $this->getShortcuts();
|
||||
if (isset($shortcuts[$command])) {
|
||||
$command = $shortcuts[$command];
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ getGetoptArgs()
|
||||
if (isset($this->commands[$command]) &&
|
||||
isset($this->commands[$command]['options'])) {
|
||||
return $this->commands[$command]['options'];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function getGetoptArgs($command, &$short_args, &$long_args)
|
||||
{
|
||||
$short_args = "";
|
||||
$short_args = '';
|
||||
$long_args = array();
|
||||
if (empty($this->commands[$command])) {
|
||||
if (empty($this->commands[$command]) || empty($this->commands[$command]['options'])) {
|
||||
return;
|
||||
}
|
||||
reset($this->commands[$command]);
|
||||
|
||||
reset($this->commands[$command]['options']);
|
||||
while (list($option, $info) = each($this->commands[$command]['options'])) {
|
||||
$larg = $sarg = '';
|
||||
if (isset($info['arg'])) {
|
||||
@@ -144,15 +157,15 @@ class PEAR_Command_Common extends PEAR
|
||||
$arg = $info['arg'];
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($info['shortopt'])) {
|
||||
$short_args .= $info['shortopt'] . $sarg;
|
||||
}
|
||||
|
||||
$long_args[] = $option . $larg;
|
||||
}
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ getHelp()
|
||||
/**
|
||||
* Returns the help message for the given command
|
||||
*
|
||||
@@ -164,29 +177,38 @@ class PEAR_Command_Common extends PEAR
|
||||
function getHelp($command)
|
||||
{
|
||||
$config = &PEAR_Config::singleton();
|
||||
$help = @$this->commands[$command]['doc'];
|
||||
if (!isset($this->commands[$command])) {
|
||||
return "No such command \"$command\"";
|
||||
}
|
||||
|
||||
$help = null;
|
||||
if (isset($this->commands[$command]['doc'])) {
|
||||
$help = $this->commands[$command]['doc'];
|
||||
}
|
||||
|
||||
if (empty($help)) {
|
||||
// XXX (cox) Fallback to summary if there is no doc (show both?)
|
||||
if (!$help = @$this->commands[$command]['summary']) {
|
||||
if (!isset($this->commands[$command]['summary'])) {
|
||||
return "No help for command \"$command\"";
|
||||
}
|
||||
$help = $this->commands[$command]['summary'];
|
||||
}
|
||||
|
||||
if (preg_match_all('/{config\s+([^\}]+)}/e', $help, $matches)) {
|
||||
foreach($matches[0] as $k => $v) {
|
||||
$help = preg_replace("/$v/", $config->get($matches[1][$k]), $help);
|
||||
}
|
||||
}
|
||||
|
||||
return array($help, $this->getHelpArgs($command));
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ getHelpArgs()
|
||||
/**
|
||||
* Returns the help for the accepted arguments of a command
|
||||
*
|
||||
* @param string $command
|
||||
* @return string The help string
|
||||
*/
|
||||
* Returns the help for the accepted arguments of a command
|
||||
*
|
||||
* @param string $command
|
||||
* @return string The help string
|
||||
*/
|
||||
function getHelpArgs($command)
|
||||
{
|
||||
if (isset($this->commands[$command]['options']) &&
|
||||
@@ -195,7 +217,7 @@ class PEAR_Command_Common extends PEAR
|
||||
$help = "Options:\n";
|
||||
foreach ($this->commands[$command]['options'] as $k => $v) {
|
||||
if (isset($v['arg'])) {
|
||||
if ($v['arg']{0} == '(') {
|
||||
if ($v['arg'][0] == '(') {
|
||||
$arg = substr($v['arg'], 1, -1);
|
||||
$sapp = " [$arg]";
|
||||
$lapp = "[=$arg]";
|
||||
@@ -206,44 +228,46 @@ class PEAR_Command_Common extends PEAR
|
||||
} else {
|
||||
$sapp = $lapp = "";
|
||||
}
|
||||
|
||||
if (isset($v['shortopt'])) {
|
||||
$s = $v['shortopt'];
|
||||
@$help .= " -$s$sapp, --$k$lapp\n";
|
||||
$help .= " -$s$sapp, --$k$lapp\n";
|
||||
} else {
|
||||
@$help .= " --$k$lapp\n";
|
||||
$help .= " --$k$lapp\n";
|
||||
}
|
||||
|
||||
$p = " ";
|
||||
$doc = rtrim(str_replace("\n", "\n$p", $v['doc']));
|
||||
$help .= " $doc\n";
|
||||
}
|
||||
|
||||
return $help;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ run()
|
||||
|
||||
function run($command, $options, $params)
|
||||
{
|
||||
$func = @$this->commands[$command]['function'];
|
||||
if (empty($func)) {
|
||||
if (empty($this->commands[$command]['function'])) {
|
||||
// look for shortcuts
|
||||
foreach (array_keys($this->commands) as $cmd) {
|
||||
if (@$this->commands[$cmd]['shortcut'] == $command) {
|
||||
$command = $cmd;
|
||||
$func = @$this->commands[$command]['function'];
|
||||
if (empty($func)) {
|
||||
if (isset($this->commands[$cmd]['shortcut']) && $this->commands[$cmd]['shortcut'] == $command) {
|
||||
if (empty($this->commands[$cmd]['function'])) {
|
||||
return $this->raiseError("unknown command `$command'");
|
||||
} else {
|
||||
$func = $this->commands[$cmd]['function'];
|
||||
}
|
||||
$command = $cmd;
|
||||
|
||||
//$command = $this->commands[$cmd]['function'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$func = $this->commands[$command]['function'];
|
||||
}
|
||||
|
||||
return $this->$func($command, $options, $params);
|
||||
}
|
||||
|
||||
// }}}
|
||||
}
|
||||
|
||||
?>
|
||||
}
|
||||
Vendored
+414
@@ -0,0 +1,414 @@
|
||||
<?php
|
||||
/**
|
||||
* PEAR_Command_Config (config-show, config-get, config-set, config-help, config-create commands)
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Stig Bakken <ssb@php.net>
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version CVS: $Id: Config.php 313024 2011-07-06 19:51:24Z dufuz $
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since File available since Release 0.1
|
||||
*/
|
||||
|
||||
/**
|
||||
* base class
|
||||
*/
|
||||
require_once 'PEAR/Command/Common.php';
|
||||
|
||||
/**
|
||||
* PEAR commands for managing configuration data.
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Stig Bakken <ssb@php.net>
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version Release: 1.9.4
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since Class available since Release 0.1
|
||||
*/
|
||||
class PEAR_Command_Config extends PEAR_Command_Common
|
||||
{
|
||||
var $commands = array(
|
||||
'config-show' => array(
|
||||
'summary' => 'Show All Settings',
|
||||
'function' => 'doConfigShow',
|
||||
'shortcut' => 'csh',
|
||||
'options' => array(
|
||||
'channel' => array(
|
||||
'shortopt' => 'c',
|
||||
'doc' => 'show configuration variables for another channel',
|
||||
'arg' => 'CHAN',
|
||||
),
|
||||
),
|
||||
'doc' => '[layer]
|
||||
Displays all configuration values. An optional argument
|
||||
may be used to tell which configuration layer to display. Valid
|
||||
configuration layers are "user", "system" and "default". To display
|
||||
configurations for different channels, set the default_channel
|
||||
configuration variable and run config-show again.
|
||||
',
|
||||
),
|
||||
'config-get' => array(
|
||||
'summary' => 'Show One Setting',
|
||||
'function' => 'doConfigGet',
|
||||
'shortcut' => 'cg',
|
||||
'options' => array(
|
||||
'channel' => array(
|
||||
'shortopt' => 'c',
|
||||
'doc' => 'show configuration variables for another channel',
|
||||
'arg' => 'CHAN',
|
||||
),
|
||||
),
|
||||
'doc' => '<parameter> [layer]
|
||||
Displays the value of one configuration parameter. The
|
||||
first argument is the name of the parameter, an optional second argument
|
||||
may be used to tell which configuration layer to look in. Valid configuration
|
||||
layers are "user", "system" and "default". If no layer is specified, a value
|
||||
will be picked from the first layer that defines the parameter, in the order
|
||||
just specified. The configuration value will be retrieved for the channel
|
||||
specified by the default_channel configuration variable.
|
||||
',
|
||||
),
|
||||
'config-set' => array(
|
||||
'summary' => 'Change Setting',
|
||||
'function' => 'doConfigSet',
|
||||
'shortcut' => 'cs',
|
||||
'options' => array(
|
||||
'channel' => array(
|
||||
'shortopt' => 'c',
|
||||
'doc' => 'show configuration variables for another channel',
|
||||
'arg' => 'CHAN',
|
||||
),
|
||||
),
|
||||
'doc' => '<parameter> <value> [layer]
|
||||
Sets the value of one configuration parameter. The first argument is
|
||||
the name of the parameter, the second argument is the new value. Some
|
||||
parameters are subject to validation, and the command will fail with
|
||||
an error message if the new value does not make sense. An optional
|
||||
third argument may be used to specify in which layer to set the
|
||||
configuration parameter. The default layer is "user". The
|
||||
configuration value will be set for the current channel, which
|
||||
is controlled by the default_channel configuration variable.
|
||||
',
|
||||
),
|
||||
'config-help' => array(
|
||||
'summary' => 'Show Information About Setting',
|
||||
'function' => 'doConfigHelp',
|
||||
'shortcut' => 'ch',
|
||||
'options' => array(),
|
||||
'doc' => '[parameter]
|
||||
Displays help for a configuration parameter. Without arguments it
|
||||
displays help for all configuration parameters.
|
||||
',
|
||||
),
|
||||
'config-create' => array(
|
||||
'summary' => 'Create a Default configuration file',
|
||||
'function' => 'doConfigCreate',
|
||||
'shortcut' => 'coc',
|
||||
'options' => array(
|
||||
'windows' => array(
|
||||
'shortopt' => 'w',
|
||||
'doc' => 'create a config file for a windows install',
|
||||
),
|
||||
),
|
||||
'doc' => '<root path> <filename>
|
||||
Create a default configuration file with all directory configuration
|
||||
variables set to subdirectories of <root path>, and save it as <filename>.
|
||||
This is useful especially for creating a configuration file for a remote
|
||||
PEAR installation (using the --remoteconfig option of install, upgrade,
|
||||
and uninstall).
|
||||
',
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
* PEAR_Command_Config constructor.
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PEAR_Command_Config(&$ui, &$config)
|
||||
{
|
||||
parent::PEAR_Command_Common($ui, $config);
|
||||
}
|
||||
|
||||
function doConfigShow($command, $options, $params)
|
||||
{
|
||||
$layer = null;
|
||||
if (is_array($params)) {
|
||||
$layer = isset($params[0]) ? $params[0] : null;
|
||||
}
|
||||
|
||||
// $params[0] -> the layer
|
||||
if ($error = $this->_checkLayer($layer)) {
|
||||
return $this->raiseError("config-show:$error");
|
||||
}
|
||||
|
||||
$keys = $this->config->getKeys();
|
||||
sort($keys);
|
||||
$channel = isset($options['channel']) ? $options['channel'] :
|
||||
$this->config->get('default_channel');
|
||||
$reg = &$this->config->getRegistry();
|
||||
if (!$reg->channelExists($channel)) {
|
||||
return $this->raiseError('Channel "' . $channel . '" does not exist');
|
||||
}
|
||||
|
||||
$channel = $reg->channelName($channel);
|
||||
$data = array('caption' => 'Configuration (channel ' . $channel . '):');
|
||||
foreach ($keys as $key) {
|
||||
$type = $this->config->getType($key);
|
||||
$value = $this->config->get($key, $layer, $channel);
|
||||
if ($type == 'password' && $value) {
|
||||
$value = '********';
|
||||
}
|
||||
|
||||
if ($value === false) {
|
||||
$value = 'false';
|
||||
} elseif ($value === true) {
|
||||
$value = 'true';
|
||||
}
|
||||
|
||||
$data['data'][$this->config->getGroup($key)][] = array($this->config->getPrompt($key) , $key, $value);
|
||||
}
|
||||
|
||||
foreach ($this->config->getLayers() as $layer) {
|
||||
$data['data']['Config Files'][] = array(ucfirst($layer) . ' Configuration File', 'Filename' , $this->config->getConfFile($layer));
|
||||
}
|
||||
|
||||
$this->ui->outputData($data, $command);
|
||||
return true;
|
||||
}
|
||||
|
||||
function doConfigGet($command, $options, $params)
|
||||
{
|
||||
$args_cnt = is_array($params) ? count($params) : 0;
|
||||
switch ($args_cnt) {
|
||||
case 1:
|
||||
$config_key = $params[0];
|
||||
$layer = null;
|
||||
break;
|
||||
case 2:
|
||||
$config_key = $params[0];
|
||||
$layer = $params[1];
|
||||
if ($error = $this->_checkLayer($layer)) {
|
||||
return $this->raiseError("config-get:$error");
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
default:
|
||||
return $this->raiseError("config-get expects 1 or 2 parameters");
|
||||
}
|
||||
|
||||
$reg = &$this->config->getRegistry();
|
||||
$channel = isset($options['channel']) ? $options['channel'] : $this->config->get('default_channel');
|
||||
if (!$reg->channelExists($channel)) {
|
||||
return $this->raiseError('Channel "' . $channel . '" does not exist');
|
||||
}
|
||||
|
||||
$channel = $reg->channelName($channel);
|
||||
$this->ui->outputData($this->config->get($config_key, $layer, $channel), $command);
|
||||
return true;
|
||||
}
|
||||
|
||||
function doConfigSet($command, $options, $params)
|
||||
{
|
||||
// $param[0] -> a parameter to set
|
||||
// $param[1] -> the value for the parameter
|
||||
// $param[2] -> the layer
|
||||
$failmsg = '';
|
||||
if (count($params) < 2 || count($params) > 3) {
|
||||
$failmsg .= "config-set expects 2 or 3 parameters";
|
||||
return PEAR::raiseError($failmsg);
|
||||
}
|
||||
|
||||
if (isset($params[2]) && ($error = $this->_checkLayer($params[2]))) {
|
||||
$failmsg .= $error;
|
||||
return PEAR::raiseError("config-set:$failmsg");
|
||||
}
|
||||
|
||||
$channel = isset($options['channel']) ? $options['channel'] : $this->config->get('default_channel');
|
||||
$reg = &$this->config->getRegistry();
|
||||
if (!$reg->channelExists($channel)) {
|
||||
return $this->raiseError('Channel "' . $channel . '" does not exist');
|
||||
}
|
||||
|
||||
$channel = $reg->channelName($channel);
|
||||
if ($params[0] == 'default_channel' && !$reg->channelExists($params[1])) {
|
||||
return $this->raiseError('Channel "' . $params[1] . '" does not exist');
|
||||
}
|
||||
|
||||
if ($params[0] == 'preferred_mirror'
|
||||
&& (
|
||||
!$reg->mirrorExists($channel, $params[1]) &&
|
||||
(!$reg->channelExists($params[1]) || $channel != $params[1])
|
||||
)
|
||||
) {
|
||||
$msg = 'Channel Mirror "' . $params[1] . '" does not exist';
|
||||
$msg .= ' in your registry for channel "' . $channel . '".';
|
||||
$msg .= "\n" . 'Attempt to run "pear channel-update ' . $channel .'"';
|
||||
$msg .= ' if you believe this mirror should exist as you may';
|
||||
$msg .= ' have outdated channel information.';
|
||||
return $this->raiseError($msg);
|
||||
}
|
||||
|
||||
if (count($params) == 2) {
|
||||
array_push($params, 'user');
|
||||
$layer = 'user';
|
||||
} else {
|
||||
$layer = $params[2];
|
||||
}
|
||||
|
||||
array_push($params, $channel);
|
||||
if (!call_user_func_array(array(&$this->config, 'set'), $params)) {
|
||||
array_pop($params);
|
||||
$failmsg = "config-set (" . implode(", ", $params) . ") failed, channel $channel";
|
||||
} else {
|
||||
$this->config->store($layer);
|
||||
}
|
||||
|
||||
if ($failmsg) {
|
||||
return $this->raiseError($failmsg);
|
||||
}
|
||||
|
||||
$this->ui->outputData('config-set succeeded', $command);
|
||||
return true;
|
||||
}
|
||||
|
||||
function doConfigHelp($command, $options, $params)
|
||||
{
|
||||
if (empty($params)) {
|
||||
$params = $this->config->getKeys();
|
||||
}
|
||||
|
||||
$data['caption'] = "Config help" . ((count($params) == 1) ? " for $params[0]" : '');
|
||||
$data['headline'] = array('Name', 'Type', 'Description');
|
||||
$data['border'] = true;
|
||||
foreach ($params as $name) {
|
||||
$type = $this->config->getType($name);
|
||||
$docs = $this->config->getDocs($name);
|
||||
if ($type == 'set') {
|
||||
$docs = rtrim($docs) . "\nValid set: " .
|
||||
implode(' ', $this->config->getSetValues($name));
|
||||
}
|
||||
|
||||
$data['data'][] = array($name, $type, $docs);
|
||||
}
|
||||
|
||||
$this->ui->outputData($data, $command);
|
||||
}
|
||||
|
||||
function doConfigCreate($command, $options, $params)
|
||||
{
|
||||
if (count($params) != 2) {
|
||||
return PEAR::raiseError('config-create: must have 2 parameters, root path and ' .
|
||||
'filename to save as');
|
||||
}
|
||||
|
||||
$root = $params[0];
|
||||
// Clean up the DIRECTORY_SEPARATOR mess
|
||||
$ds2 = DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR;
|
||||
$root = preg_replace(array('!\\\\+!', '!/+!', "!$ds2+!"),
|
||||
array('/', '/', '/'),
|
||||
$root);
|
||||
if ($root{0} != '/') {
|
||||
if (!isset($options['windows'])) {
|
||||
return PEAR::raiseError('Root directory must be an absolute path beginning ' .
|
||||
'with "/", was: "' . $root . '"');
|
||||
}
|
||||
|
||||
if (!preg_match('/^[A-Za-z]:/', $root)) {
|
||||
return PEAR::raiseError('Root directory must be an absolute path beginning ' .
|
||||
'with "\\" or "C:\\", was: "' . $root . '"');
|
||||
}
|
||||
}
|
||||
|
||||
$windows = isset($options['windows']);
|
||||
if ($windows) {
|
||||
$root = str_replace('/', '\\', $root);
|
||||
}
|
||||
|
||||
if (!file_exists($params[1]) && !@touch($params[1])) {
|
||||
return PEAR::raiseError('Could not create "' . $params[1] . '"');
|
||||
}
|
||||
|
||||
$params[1] = realpath($params[1]);
|
||||
$config = &new PEAR_Config($params[1], '#no#system#config#', false, false);
|
||||
if ($root{strlen($root) - 1} == '/') {
|
||||
$root = substr($root, 0, strlen($root) - 1);
|
||||
}
|
||||
|
||||
$config->noRegistry();
|
||||
$config->set('php_dir', $windows ? "$root\\pear\\php" : "$root/pear/php", 'user');
|
||||
$config->set('data_dir', $windows ? "$root\\pear\\data" : "$root/pear/data");
|
||||
$config->set('www_dir', $windows ? "$root\\pear\\www" : "$root/pear/www");
|
||||
$config->set('cfg_dir', $windows ? "$root\\pear\\cfg" : "$root/pear/cfg");
|
||||
$config->set('ext_dir', $windows ? "$root\\pear\\ext" : "$root/pear/ext");
|
||||
$config->set('doc_dir', $windows ? "$root\\pear\\docs" : "$root/pear/docs");
|
||||
$config->set('test_dir', $windows ? "$root\\pear\\tests" : "$root/pear/tests");
|
||||
$config->set('cache_dir', $windows ? "$root\\pear\\cache" : "$root/pear/cache");
|
||||
$config->set('download_dir', $windows ? "$root\\pear\\download" : "$root/pear/download");
|
||||
$config->set('temp_dir', $windows ? "$root\\pear\\temp" : "$root/pear/temp");
|
||||
$config->set('bin_dir', $windows ? "$root\\pear" : "$root/pear");
|
||||
$config->writeConfigFile();
|
||||
$this->_showConfig($config);
|
||||
$this->ui->outputData('Successfully created default configuration file "' . $params[1] . '"',
|
||||
$command);
|
||||
}
|
||||
|
||||
function _showConfig(&$config)
|
||||
{
|
||||
$params = array('user');
|
||||
$keys = $config->getKeys();
|
||||
sort($keys);
|
||||
$channel = 'pear.php.net';
|
||||
$data = array('caption' => 'Configuration (channel ' . $channel . '):');
|
||||
foreach ($keys as $key) {
|
||||
$type = $config->getType($key);
|
||||
$value = $config->get($key, 'user', $channel);
|
||||
if ($type == 'password' && $value) {
|
||||
$value = '********';
|
||||
}
|
||||
|
||||
if ($value === false) {
|
||||
$value = 'false';
|
||||
} elseif ($value === true) {
|
||||
$value = 'true';
|
||||
}
|
||||
$data['data'][$config->getGroup($key)][] =
|
||||
array($config->getPrompt($key) , $key, $value);
|
||||
}
|
||||
|
||||
foreach ($config->getLayers() as $layer) {
|
||||
$data['data']['Config Files'][] =
|
||||
array(ucfirst($layer) . ' Configuration File', 'Filename' ,
|
||||
$config->getConfFile($layer));
|
||||
}
|
||||
|
||||
$this->ui->outputData($data, 'config-show');
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a layer is defined or not
|
||||
*
|
||||
* @param string $layer The layer to search for
|
||||
* @return mixed False on no error or the error message
|
||||
*/
|
||||
function _checkLayer($layer = null)
|
||||
{
|
||||
if (!empty($layer) && $layer != 'default') {
|
||||
$layers = $this->config->getLayers();
|
||||
if (!in_array($layer, $layers)) {
|
||||
return " only the layers: \"" . implode('" or "', $layers) . "\" are supported";
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Vendored
+92
@@ -0,0 +1,92 @@
|
||||
<commands version="1.0">
|
||||
<config-show>
|
||||
<summary>Show All Settings</summary>
|
||||
<function>doConfigShow</function>
|
||||
<shortcut>csh</shortcut>
|
||||
<options>
|
||||
<channel>
|
||||
<shortopt>c</shortopt>
|
||||
<doc>show configuration variables for another channel</doc>
|
||||
<arg>CHAN</arg>
|
||||
</channel>
|
||||
</options>
|
||||
<doc>[layer]
|
||||
Displays all configuration values. An optional argument
|
||||
may be used to tell which configuration layer to display. Valid
|
||||
configuration layers are "user", "system" and "default". To display
|
||||
configurations for different channels, set the default_channel
|
||||
configuration variable and run config-show again.
|
||||
</doc>
|
||||
</config-show>
|
||||
<config-get>
|
||||
<summary>Show One Setting</summary>
|
||||
<function>doConfigGet</function>
|
||||
<shortcut>cg</shortcut>
|
||||
<options>
|
||||
<channel>
|
||||
<shortopt>c</shortopt>
|
||||
<doc>show configuration variables for another channel</doc>
|
||||
<arg>CHAN</arg>
|
||||
</channel>
|
||||
</options>
|
||||
<doc><parameter> [layer]
|
||||
Displays the value of one configuration parameter. The
|
||||
first argument is the name of the parameter, an optional second argument
|
||||
may be used to tell which configuration layer to look in. Valid configuration
|
||||
layers are "user", "system" and "default". If no layer is specified, a value
|
||||
will be picked from the first layer that defines the parameter, in the order
|
||||
just specified. The configuration value will be retrieved for the channel
|
||||
specified by the default_channel configuration variable.
|
||||
</doc>
|
||||
</config-get>
|
||||
<config-set>
|
||||
<summary>Change Setting</summary>
|
||||
<function>doConfigSet</function>
|
||||
<shortcut>cs</shortcut>
|
||||
<options>
|
||||
<channel>
|
||||
<shortopt>c</shortopt>
|
||||
<doc>show configuration variables for another channel</doc>
|
||||
<arg>CHAN</arg>
|
||||
</channel>
|
||||
</options>
|
||||
<doc><parameter> <value> [layer]
|
||||
Sets the value of one configuration parameter. The first argument is
|
||||
the name of the parameter, the second argument is the new value. Some
|
||||
parameters are subject to validation, and the command will fail with
|
||||
an error message if the new value does not make sense. An optional
|
||||
third argument may be used to specify in which layer to set the
|
||||
configuration parameter. The default layer is "user". The
|
||||
configuration value will be set for the current channel, which
|
||||
is controlled by the default_channel configuration variable.
|
||||
</doc>
|
||||
</config-set>
|
||||
<config-help>
|
||||
<summary>Show Information About Setting</summary>
|
||||
<function>doConfigHelp</function>
|
||||
<shortcut>ch</shortcut>
|
||||
<options />
|
||||
<doc>[parameter]
|
||||
Displays help for a configuration parameter. Without arguments it
|
||||
displays help for all configuration parameters.
|
||||
</doc>
|
||||
</config-help>
|
||||
<config-create>
|
||||
<summary>Create a Default configuration file</summary>
|
||||
<function>doConfigCreate</function>
|
||||
<shortcut>coc</shortcut>
|
||||
<options>
|
||||
<windows>
|
||||
<shortopt>w</shortopt>
|
||||
<doc>create a config file for a windows install</doc>
|
||||
</windows>
|
||||
</options>
|
||||
<doc><root path> <filename>
|
||||
Create a default configuration file with all directory configuration
|
||||
variables set to subdirectories of <root path>, and save it as <filename>.
|
||||
This is useful especially for creating a configuration file for a remote
|
||||
PEAR installation (using the --remoteconfig option of install, upgrade,
|
||||
and uninstall).
|
||||
</doc>
|
||||
</config-create>
|
||||
</commands>
|
||||
Vendored
+1268
File diff suppressed because it is too large
Load Diff
Vendored
+276
@@ -0,0 +1,276 @@
|
||||
<commands version="1.0">
|
||||
<install>
|
||||
<summary>Install Package</summary>
|
||||
<function>doInstall</function>
|
||||
<shortcut>i</shortcut>
|
||||
<options>
|
||||
<force>
|
||||
<shortopt>f</shortopt>
|
||||
<doc>will overwrite newer installed packages</doc>
|
||||
</force>
|
||||
<loose>
|
||||
<shortopt>l</shortopt>
|
||||
<doc>do not check for recommended dependency version</doc>
|
||||
</loose>
|
||||
<nodeps>
|
||||
<shortopt>n</shortopt>
|
||||
<doc>ignore dependencies, install anyway</doc>
|
||||
</nodeps>
|
||||
<register-only>
|
||||
<shortopt>r</shortopt>
|
||||
<doc>do not install files, only register the package as installed</doc>
|
||||
</register-only>
|
||||
<soft>
|
||||
<shortopt>s</shortopt>
|
||||
<doc>soft install, fail silently, or upgrade if already installed</doc>
|
||||
</soft>
|
||||
<nobuild>
|
||||
<shortopt>B</shortopt>
|
||||
<doc>don't build C extensions</doc>
|
||||
</nobuild>
|
||||
<nocompress>
|
||||
<shortopt>Z</shortopt>
|
||||
<doc>request uncompressed files when downloading</doc>
|
||||
</nocompress>
|
||||
<installroot>
|
||||
<shortopt>R</shortopt>
|
||||
<doc>root directory used when installing files (ala PHP's INSTALL_ROOT), use packagingroot for RPM</doc>
|
||||
<arg>DIR</arg>
|
||||
</installroot>
|
||||
<packagingroot>
|
||||
<shortopt>P</shortopt>
|
||||
<doc>root directory used when packaging files, like RPM packaging</doc>
|
||||
<arg>DIR</arg>
|
||||
</packagingroot>
|
||||
<ignore-errors>
|
||||
<shortopt></shortopt>
|
||||
<doc>force install even if there were errors</doc>
|
||||
</ignore-errors>
|
||||
<alldeps>
|
||||
<shortopt>a</shortopt>
|
||||
<doc>install all required and optional dependencies</doc>
|
||||
</alldeps>
|
||||
<onlyreqdeps>
|
||||
<shortopt>o</shortopt>
|
||||
<doc>install all required dependencies</doc>
|
||||
</onlyreqdeps>
|
||||
<offline>
|
||||
<shortopt>O</shortopt>
|
||||
<doc>do not attempt to download any urls or contact channels</doc>
|
||||
</offline>
|
||||
<pretend>
|
||||
<shortopt>p</shortopt>
|
||||
<doc>Only list the packages that would be downloaded</doc>
|
||||
</pretend>
|
||||
</options>
|
||||
<doc>[channel/]<package> ...
|
||||
Installs one or more PEAR packages. You can specify a package to
|
||||
install in four ways:
|
||||
|
||||
"Package-1.0.tgz" : installs from a local file
|
||||
|
||||
"http://example.com/Package-1.0.tgz" : installs from
|
||||
anywhere on the net.
|
||||
|
||||
"package.xml" : installs the package described in
|
||||
package.xml. Useful for testing, or for wrapping a PEAR package in
|
||||
another package manager such as RPM.
|
||||
|
||||
"Package[-version/state][.tar]" : queries your default channel's server
|
||||
({config master_server}) and downloads the newest package with
|
||||
the preferred quality/state ({config preferred_state}).
|
||||
|
||||
To retrieve Package version 1.1, use "Package-1.1," to retrieve
|
||||
Package state beta, use "Package-beta." To retrieve an uncompressed
|
||||
file, append .tar (make sure there is no file by the same name first)
|
||||
|
||||
To download a package from another channel, prefix with the channel name like
|
||||
"channel/Package"
|
||||
|
||||
More than one package may be specified at once. It is ok to mix these
|
||||
four ways of specifying packages.
|
||||
</doc>
|
||||
</install>
|
||||
<upgrade>
|
||||
<summary>Upgrade Package</summary>
|
||||
<function>doInstall</function>
|
||||
<shortcut>up</shortcut>
|
||||
<options>
|
||||
<channel>
|
||||
<shortopt>c</shortopt>
|
||||
<doc>upgrade packages from a specific channel</doc>
|
||||
<arg>CHAN</arg>
|
||||
</channel>
|
||||
<force>
|
||||
<shortopt>f</shortopt>
|
||||
<doc>overwrite newer installed packages</doc>
|
||||
</force>
|
||||
<loose>
|
||||
<shortopt>l</shortopt>
|
||||
<doc>do not check for recommended dependency version</doc>
|
||||
</loose>
|
||||
<nodeps>
|
||||
<shortopt>n</shortopt>
|
||||
<doc>ignore dependencies, upgrade anyway</doc>
|
||||
</nodeps>
|
||||
<register-only>
|
||||
<shortopt>r</shortopt>
|
||||
<doc>do not install files, only register the package as upgraded</doc>
|
||||
</register-only>
|
||||
<nobuild>
|
||||
<shortopt>B</shortopt>
|
||||
<doc>don't build C extensions</doc>
|
||||
</nobuild>
|
||||
<nocompress>
|
||||
<shortopt>Z</shortopt>
|
||||
<doc>request uncompressed files when downloading</doc>
|
||||
</nocompress>
|
||||
<installroot>
|
||||
<shortopt>R</shortopt>
|
||||
<doc>root directory used when installing files (ala PHP's INSTALL_ROOT)</doc>
|
||||
<arg>DIR</arg>
|
||||
</installroot>
|
||||
<ignore-errors>
|
||||
<shortopt></shortopt>
|
||||
<doc>force install even if there were errors</doc>
|
||||
</ignore-errors>
|
||||
<alldeps>
|
||||
<shortopt>a</shortopt>
|
||||
<doc>install all required and optional dependencies</doc>
|
||||
</alldeps>
|
||||
<onlyreqdeps>
|
||||
<shortopt>o</shortopt>
|
||||
<doc>install all required dependencies</doc>
|
||||
</onlyreqdeps>
|
||||
<offline>
|
||||
<shortopt>O</shortopt>
|
||||
<doc>do not attempt to download any urls or contact channels</doc>
|
||||
</offline>
|
||||
<pretend>
|
||||
<shortopt>p</shortopt>
|
||||
<doc>Only list the packages that would be downloaded</doc>
|
||||
</pretend>
|
||||
</options>
|
||||
<doc><package> ...
|
||||
Upgrades one or more PEAR packages. See documentation for the
|
||||
"install" command for ways to specify a package.
|
||||
|
||||
When upgrading, your package will be updated if the provided new
|
||||
package has a higher version number (use the -f option if you need to
|
||||
upgrade anyway).
|
||||
|
||||
More than one package may be specified at once.
|
||||
</doc>
|
||||
</upgrade>
|
||||
<upgrade-all>
|
||||
<summary>Upgrade All Packages [Deprecated in favor of calling upgrade with no parameters]</summary>
|
||||
<function>doUpgradeAll</function>
|
||||
<shortcut>ua</shortcut>
|
||||
<options>
|
||||
<channel>
|
||||
<shortopt>c</shortopt>
|
||||
<doc>upgrade packages from a specific channel</doc>
|
||||
<arg>CHAN</arg>
|
||||
</channel>
|
||||
<nodeps>
|
||||
<shortopt>n</shortopt>
|
||||
<doc>ignore dependencies, upgrade anyway</doc>
|
||||
</nodeps>
|
||||
<register-only>
|
||||
<shortopt>r</shortopt>
|
||||
<doc>do not install files, only register the package as upgraded</doc>
|
||||
</register-only>
|
||||
<nobuild>
|
||||
<shortopt>B</shortopt>
|
||||
<doc>don't build C extensions</doc>
|
||||
</nobuild>
|
||||
<nocompress>
|
||||
<shortopt>Z</shortopt>
|
||||
<doc>request uncompressed files when downloading</doc>
|
||||
</nocompress>
|
||||
<installroot>
|
||||
<shortopt>R</shortopt>
|
||||
<doc>root directory used when installing files (ala PHP's INSTALL_ROOT), use packagingroot for RPM</doc>
|
||||
<arg>DIR</arg>
|
||||
</installroot>
|
||||
<ignore-errors>
|
||||
<shortopt></shortopt>
|
||||
<doc>force install even if there were errors</doc>
|
||||
</ignore-errors>
|
||||
<loose>
|
||||
<shortopt></shortopt>
|
||||
<doc>do not check for recommended dependency version</doc>
|
||||
</loose>
|
||||
</options>
|
||||
<doc>
|
||||
WARNING: This function is deprecated in favor of using the upgrade command with no params
|
||||
|
||||
Upgrades all packages that have a newer release available. Upgrades are
|
||||
done only if there is a release available of the state specified in
|
||||
"preferred_state" (currently {config preferred_state}), or a state considered
|
||||
more stable.
|
||||
</doc>
|
||||
</upgrade-all>
|
||||
<uninstall>
|
||||
<summary>Un-install Package</summary>
|
||||
<function>doUninstall</function>
|
||||
<shortcut>un</shortcut>
|
||||
<options>
|
||||
<nodeps>
|
||||
<shortopt>n</shortopt>
|
||||
<doc>ignore dependencies, uninstall anyway</doc>
|
||||
</nodeps>
|
||||
<register-only>
|
||||
<shortopt>r</shortopt>
|
||||
<doc>do not remove files, only register the packages as not installed</doc>
|
||||
</register-only>
|
||||
<installroot>
|
||||
<shortopt>R</shortopt>
|
||||
<doc>root directory used when installing files (ala PHP's INSTALL_ROOT)</doc>
|
||||
<arg>DIR</arg>
|
||||
</installroot>
|
||||
<ignore-errors>
|
||||
<shortopt></shortopt>
|
||||
<doc>force install even if there were errors</doc>
|
||||
</ignore-errors>
|
||||
<offline>
|
||||
<shortopt>O</shortopt>
|
||||
<doc>do not attempt to uninstall remotely</doc>
|
||||
</offline>
|
||||
</options>
|
||||
<doc>[channel/]<package> ...
|
||||
Uninstalls one or more PEAR packages. More than one package may be
|
||||
specified at once. Prefix with channel name to uninstall from a
|
||||
channel not in your default channel ({config default_channel})
|
||||
</doc>
|
||||
</uninstall>
|
||||
<bundle>
|
||||
<summary>Unpacks a Pecl Package</summary>
|
||||
<function>doBundle</function>
|
||||
<shortcut>bun</shortcut>
|
||||
<options>
|
||||
<destination>
|
||||
<shortopt>d</shortopt>
|
||||
<doc>Optional destination directory for unpacking (defaults to current path or "ext" if exists)</doc>
|
||||
<arg>DIR</arg>
|
||||
</destination>
|
||||
<force>
|
||||
<shortopt>f</shortopt>
|
||||
<doc>Force the unpacking even if there were errors in the package</doc>
|
||||
</force>
|
||||
</options>
|
||||
<doc><package>
|
||||
Unpacks a Pecl Package into the selected location. It will download the
|
||||
package if needed.
|
||||
</doc>
|
||||
</bundle>
|
||||
<run-scripts>
|
||||
<summary>Run Post-Install Scripts bundled with a package</summary>
|
||||
<function>doRunScripts</function>
|
||||
<shortcut>rs</shortcut>
|
||||
<options />
|
||||
<doc><package>
|
||||
Run post-installation scripts in package <package>, if any exist.
|
||||
</doc>
|
||||
</run-scripts>
|
||||
</commands>
|
||||
Vendored
+139
@@ -0,0 +1,139 @@
|
||||
<?php
|
||||
/**
|
||||
* PEAR_Command_Mirror (download-all command)
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Alexander Merz <alexmerz@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version CVS: $Id: Mirror.php 313023 2011-07-06 19:17:11Z dufuz $
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since File available since Release 1.2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* base class
|
||||
*/
|
||||
require_once 'PEAR/Command/Common.php';
|
||||
|
||||
/**
|
||||
* PEAR commands for providing file mirrors
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Alexander Merz <alexmerz@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version Release: 1.9.4
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since Class available since Release 1.2.0
|
||||
*/
|
||||
class PEAR_Command_Mirror extends PEAR_Command_Common
|
||||
{
|
||||
var $commands = array(
|
||||
'download-all' => array(
|
||||
'summary' => 'Downloads each available package from the default channel',
|
||||
'function' => 'doDownloadAll',
|
||||
'shortcut' => 'da',
|
||||
'options' => array(
|
||||
'channel' =>
|
||||
array(
|
||||
'shortopt' => 'c',
|
||||
'doc' => 'specify a channel other than the default channel',
|
||||
'arg' => 'CHAN',
|
||||
),
|
||||
),
|
||||
'doc' => '
|
||||
Requests a list of available packages from the default channel ({config default_channel})
|
||||
and downloads them to current working directory. Note: only
|
||||
packages within preferred_state ({config preferred_state}) will be downloaded'
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
* PEAR_Command_Mirror constructor.
|
||||
*
|
||||
* @access public
|
||||
* @param object PEAR_Frontend a reference to an frontend
|
||||
* @param object PEAR_Config a reference to the configuration data
|
||||
*/
|
||||
function PEAR_Command_Mirror(&$ui, &$config)
|
||||
{
|
||||
parent::PEAR_Command_Common($ui, $config);
|
||||
}
|
||||
|
||||
/**
|
||||
* For unit-testing
|
||||
*/
|
||||
function &factory($a)
|
||||
{
|
||||
$a = &PEAR_Command::factory($a, $this->config);
|
||||
return $a;
|
||||
}
|
||||
|
||||
/**
|
||||
* retrieves a list of avaible Packages from master server
|
||||
* and downloads them
|
||||
*
|
||||
* @access public
|
||||
* @param string $command the command
|
||||
* @param array $options the command options before the command
|
||||
* @param array $params the stuff after the command name
|
||||
* @return bool true if succesful
|
||||
* @throw PEAR_Error
|
||||
*/
|
||||
function doDownloadAll($command, $options, $params)
|
||||
{
|
||||
$savechannel = $this->config->get('default_channel');
|
||||
$reg = &$this->config->getRegistry();
|
||||
$channel = isset($options['channel']) ? $options['channel'] :
|
||||
$this->config->get('default_channel');
|
||||
if (!$reg->channelExists($channel)) {
|
||||
$this->config->set('default_channel', $savechannel);
|
||||
return $this->raiseError('Channel "' . $channel . '" does not exist');
|
||||
}
|
||||
$this->config->set('default_channel', $channel);
|
||||
|
||||
$this->ui->outputData('Using Channel ' . $this->config->get('default_channel'));
|
||||
$chan = $reg->getChannel($channel);
|
||||
if (PEAR::isError($chan)) {
|
||||
return $this->raiseError($chan);
|
||||
}
|
||||
|
||||
if ($chan->supportsREST($this->config->get('preferred_mirror')) &&
|
||||
$base = $chan->getBaseURL('REST1.0', $this->config->get('preferred_mirror'))) {
|
||||
$rest = &$this->config->getREST('1.0', array());
|
||||
$remoteInfo = array_flip($rest->listPackages($base, $channel));
|
||||
}
|
||||
|
||||
if (PEAR::isError($remoteInfo)) {
|
||||
return $remoteInfo;
|
||||
}
|
||||
|
||||
$cmd = &$this->factory("download");
|
||||
if (PEAR::isError($cmd)) {
|
||||
return $cmd;
|
||||
}
|
||||
|
||||
$this->ui->outputData('Using Preferred State of ' .
|
||||
$this->config->get('preferred_state'));
|
||||
$this->ui->outputData('Gathering release information, please wait...');
|
||||
|
||||
/**
|
||||
* Error handling not necessary, because already done by
|
||||
* the download command
|
||||
*/
|
||||
PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);
|
||||
$err = $cmd->run('download', array('downloadonly' => true), array_keys($remoteInfo));
|
||||
PEAR::staticPopErrorHandling();
|
||||
$this->config->set('default_channel', $savechannel);
|
||||
if (PEAR::isError($err)) {
|
||||
$this->ui->outputData($err->getMessage());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
<commands version="1.0">
|
||||
<download-all>
|
||||
<summary>Downloads each available package from the default channel</summary>
|
||||
<function>doDownloadAll</function>
|
||||
<shortcut>da</shortcut>
|
||||
<options>
|
||||
<channel>
|
||||
<shortopt>c</shortopt>
|
||||
<doc>specify a channel other than the default channel</doc>
|
||||
<arg>CHAN</arg>
|
||||
</channel>
|
||||
</options>
|
||||
<doc>
|
||||
Requests a list of available packages from the default channel ({config default_channel})
|
||||
and downloads them to current working directory. Note: only
|
||||
packages within preferred_state ({config preferred_state}) will be downloaded</doc>
|
||||
</download-all>
|
||||
</commands>
|
||||
Vendored
+1124
File diff suppressed because it is too large
Load Diff
Vendored
+237
@@ -0,0 +1,237 @@
|
||||
<commands version="1.0">
|
||||
<package>
|
||||
<summary>Build Package</summary>
|
||||
<function>doPackage</function>
|
||||
<shortcut>p</shortcut>
|
||||
<options>
|
||||
<nocompress>
|
||||
<shortopt>Z</shortopt>
|
||||
<doc>Do not gzip the package file</doc>
|
||||
</nocompress>
|
||||
<showname>
|
||||
<shortopt>n</shortopt>
|
||||
<doc>Print the name of the packaged file.</doc>
|
||||
</showname>
|
||||
</options>
|
||||
<doc>[descfile] [descfile2]
|
||||
Creates a PEAR package from its description file (usually called
|
||||
package.xml). If a second packagefile is passed in, then
|
||||
the packager will check to make sure that one is a package.xml
|
||||
version 1.0, and the other is a package.xml version 2.0. The
|
||||
package.xml version 1.0 will be saved as "package.xml" in the archive,
|
||||
and the other as "package2.xml" in the archive"
|
||||
</doc>
|
||||
</package>
|
||||
<package-validate>
|
||||
<summary>Validate Package Consistency</summary>
|
||||
<function>doPackageValidate</function>
|
||||
<shortcut>pv</shortcut>
|
||||
<options />
|
||||
<doc>
|
||||
</doc>
|
||||
</package-validate>
|
||||
<cvsdiff>
|
||||
<summary>Run a "cvs diff" for all files in a package</summary>
|
||||
<function>doCvsDiff</function>
|
||||
<shortcut>cd</shortcut>
|
||||
<options>
|
||||
<quiet>
|
||||
<shortopt>q</shortopt>
|
||||
<doc>Be quiet</doc>
|
||||
</quiet>
|
||||
<reallyquiet>
|
||||
<shortopt>Q</shortopt>
|
||||
<doc>Be really quiet</doc>
|
||||
</reallyquiet>
|
||||
<date>
|
||||
<shortopt>D</shortopt>
|
||||
<doc>Diff against revision of DATE</doc>
|
||||
<arg>DATE</arg>
|
||||
</date>
|
||||
<release>
|
||||
<shortopt>R</shortopt>
|
||||
<doc>Diff against tag for package release REL</doc>
|
||||
<arg>REL</arg>
|
||||
</release>
|
||||
<revision>
|
||||
<shortopt>r</shortopt>
|
||||
<doc>Diff against revision REV</doc>
|
||||
<arg>REV</arg>
|
||||
</revision>
|
||||
<context>
|
||||
<shortopt>c</shortopt>
|
||||
<doc>Generate context diff</doc>
|
||||
</context>
|
||||
<unified>
|
||||
<shortopt>u</shortopt>
|
||||
<doc>Generate unified diff</doc>
|
||||
</unified>
|
||||
<ignore-case>
|
||||
<shortopt>i</shortopt>
|
||||
<doc>Ignore case, consider upper- and lower-case letters equivalent</doc>
|
||||
</ignore-case>
|
||||
<ignore-whitespace>
|
||||
<shortopt>b</shortopt>
|
||||
<doc>Ignore changes in amount of white space</doc>
|
||||
</ignore-whitespace>
|
||||
<ignore-blank-lines>
|
||||
<shortopt>B</shortopt>
|
||||
<doc>Ignore changes that insert or delete blank lines</doc>
|
||||
</ignore-blank-lines>
|
||||
<brief>
|
||||
<shortopt></shortopt>
|
||||
<doc>Report only whether the files differ, no details</doc>
|
||||
</brief>
|
||||
<dry-run>
|
||||
<shortopt>n</shortopt>
|
||||
<doc>Don't do anything, just pretend</doc>
|
||||
</dry-run>
|
||||
</options>
|
||||
<doc><package.xml>
|
||||
Compares all the files in a package. Without any options, this
|
||||
command will compare the current code with the last checked-in code.
|
||||
Using the -r or -R option you may compare the current code with that
|
||||
of a specific release.
|
||||
</doc>
|
||||
</cvsdiff>
|
||||
<svntag>
|
||||
<summary>Set SVN Release Tag</summary>
|
||||
<function>doSvnTag</function>
|
||||
<shortcut>sv</shortcut>
|
||||
<options>
|
||||
<quiet>
|
||||
<shortopt>q</shortopt>
|
||||
<doc>Be quiet</doc>
|
||||
</quiet>
|
||||
<slide>
|
||||
<shortopt>F</shortopt>
|
||||
<doc>Move (slide) tag if it exists</doc>
|
||||
</slide>
|
||||
<delete>
|
||||
<shortopt>d</shortopt>
|
||||
<doc>Remove tag</doc>
|
||||
</delete>
|
||||
<dry-run>
|
||||
<shortopt>n</shortopt>
|
||||
<doc>Don't do anything, just pretend</doc>
|
||||
</dry-run>
|
||||
</options>
|
||||
<doc><package.xml> [files...]
|
||||
Sets a SVN tag on all files in a package. Use this command after you have
|
||||
packaged a distribution tarball with the "package" command to tag what
|
||||
revisions of what files were in that release. If need to fix something
|
||||
after running svntag once, but before the tarball is released to the public,
|
||||
use the "slide" option to move the release tag.
|
||||
|
||||
to include files (such as a second package.xml, or tests not included in the
|
||||
release), pass them as additional parameters.
|
||||
</doc>
|
||||
</svntag>
|
||||
<cvstag>
|
||||
<summary>Set CVS Release Tag</summary>
|
||||
<function>doCvsTag</function>
|
||||
<shortcut>ct</shortcut>
|
||||
<options>
|
||||
<quiet>
|
||||
<shortopt>q</shortopt>
|
||||
<doc>Be quiet</doc>
|
||||
</quiet>
|
||||
<reallyquiet>
|
||||
<shortopt>Q</shortopt>
|
||||
<doc>Be really quiet</doc>
|
||||
</reallyquiet>
|
||||
<slide>
|
||||
<shortopt>F</shortopt>
|
||||
<doc>Move (slide) tag if it exists</doc>
|
||||
</slide>
|
||||
<delete>
|
||||
<shortopt>d</shortopt>
|
||||
<doc>Remove tag</doc>
|
||||
</delete>
|
||||
<dry-run>
|
||||
<shortopt>n</shortopt>
|
||||
<doc>Don't do anything, just pretend</doc>
|
||||
</dry-run>
|
||||
</options>
|
||||
<doc><package.xml> [files...]
|
||||
Sets a CVS tag on all files in a package. Use this command after you have
|
||||
packaged a distribution tarball with the "package" command to tag what
|
||||
revisions of what files were in that release. If need to fix something
|
||||
after running cvstag once, but before the tarball is released to the public,
|
||||
use the "slide" option to move the release tag.
|
||||
|
||||
to include files (such as a second package.xml, or tests not included in the
|
||||
release), pass them as additional parameters.
|
||||
</doc>
|
||||
</cvstag>
|
||||
<package-dependencies>
|
||||
<summary>Show package dependencies</summary>
|
||||
<function>doPackageDependencies</function>
|
||||
<shortcut>pd</shortcut>
|
||||
<options />
|
||||
<doc><package-file> or <package.xml> or <install-package-name>
|
||||
List all dependencies the package has.
|
||||
Can take a tgz / tar file, package.xml or a package name of an installed package.</doc>
|
||||
</package-dependencies>
|
||||
<sign>
|
||||
<summary>Sign a package distribution file</summary>
|
||||
<function>doSign</function>
|
||||
<shortcut>si</shortcut>
|
||||
<options>
|
||||
<verbose>
|
||||
<shortopt>v</shortopt>
|
||||
<doc>Display GnuPG output</doc>
|
||||
</verbose>
|
||||
</options>
|
||||
<doc><package-file>
|
||||
Signs a package distribution (.tar or .tgz) file with GnuPG.</doc>
|
||||
</sign>
|
||||
<makerpm>
|
||||
<summary>Builds an RPM spec file from a PEAR package</summary>
|
||||
<function>doMakeRPM</function>
|
||||
<shortcut>rpm</shortcut>
|
||||
<options>
|
||||
<spec-template>
|
||||
<shortopt>t</shortopt>
|
||||
<doc>Use FILE as RPM spec file template</doc>
|
||||
<arg>FILE</arg>
|
||||
</spec-template>
|
||||
<rpm-pkgname>
|
||||
<shortopt>p</shortopt>
|
||||
<doc>Use FORMAT as format string for RPM package name, %s is replaced
|
||||
by the PEAR package name, defaults to "PEAR::%s".</doc>
|
||||
<arg>FORMAT</arg>
|
||||
</rpm-pkgname>
|
||||
</options>
|
||||
<doc><package-file>
|
||||
|
||||
Creates an RPM .spec file for wrapping a PEAR package inside an RPM
|
||||
package. Intended to be used from the SPECS directory, with the PEAR
|
||||
package tarball in the SOURCES directory:
|
||||
|
||||
$ pear makerpm ../SOURCES/Net_Socket-1.0.tgz
|
||||
Wrote RPM spec file PEAR::Net_Geo-1.0.spec
|
||||
$ rpm -bb PEAR::Net_Socket-1.0.spec
|
||||
...
|
||||
Wrote: /usr/src/redhat/RPMS/i386/PEAR::Net_Socket-1.0-1.i386.rpm
|
||||
</doc>
|
||||
</makerpm>
|
||||
<convert>
|
||||
<summary>Convert a package.xml 1.0 to package.xml 2.0 format</summary>
|
||||
<function>doConvert</function>
|
||||
<shortcut>c2</shortcut>
|
||||
<options>
|
||||
<flat>
|
||||
<shortopt>f</shortopt>
|
||||
<doc>do not beautify the filelist.</doc>
|
||||
</flat>
|
||||
</options>
|
||||
<doc>[descfile] [descfile2]
|
||||
Converts a package.xml in 1.0 format into a package.xml
|
||||
in 2.0 format. The new file will be named package2.xml by default,
|
||||
and package.xml will be used as the old file by default.
|
||||
This is not the most intelligent conversion, and should only be
|
||||
used for automated conversion or learning the format.
|
||||
</doc>
|
||||
</convert>
|
||||
</commands>
|
||||
Vendored
+421
@@ -0,0 +1,421 @@
|
||||
<?php
|
||||
/**
|
||||
* PEAR_Command_Pickle (pickle command)
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 2005-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version CVS: $Id: Pickle.php 313023 2011-07-06 19:17:11Z dufuz $
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since File available since Release 1.4.1
|
||||
*/
|
||||
|
||||
/**
|
||||
* base class
|
||||
*/
|
||||
require_once 'PEAR/Command/Common.php';
|
||||
|
||||
/**
|
||||
* PEAR commands for login/logout
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 2005-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version Release: 1.9.4
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since Class available since Release 1.4.1
|
||||
*/
|
||||
|
||||
class PEAR_Command_Pickle extends PEAR_Command_Common
|
||||
{
|
||||
var $commands = array(
|
||||
'pickle' => array(
|
||||
'summary' => 'Build PECL Package',
|
||||
'function' => 'doPackage',
|
||||
'shortcut' => 'pi',
|
||||
'options' => array(
|
||||
'nocompress' => array(
|
||||
'shortopt' => 'Z',
|
||||
'doc' => 'Do not gzip the package file'
|
||||
),
|
||||
'showname' => array(
|
||||
'shortopt' => 'n',
|
||||
'doc' => 'Print the name of the packaged file.',
|
||||
),
|
||||
),
|
||||
'doc' => '[descfile]
|
||||
Creates a PECL package from its package2.xml file.
|
||||
|
||||
An automatic conversion will be made to a package.xml 1.0 and written out to
|
||||
disk in the current directory as "package.xml". Note that
|
||||
only simple package.xml 2.0 will be converted. package.xml 2.0 with:
|
||||
|
||||
- dependency types other than required/optional PECL package/ext/php/pearinstaller
|
||||
- more than one extsrcrelease or zendextsrcrelease
|
||||
- zendextbinrelease, extbinrelease, phprelease, or bundle release type
|
||||
- dependency groups
|
||||
- ignore tags in release filelist
|
||||
- tasks other than replace
|
||||
- custom roles
|
||||
|
||||
will cause pickle to fail, and output an error message. If your package2.xml
|
||||
uses any of these features, you are best off using PEAR_PackageFileManager to
|
||||
generate both package.xml.
|
||||
'
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
* PEAR_Command_Package constructor.
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PEAR_Command_Pickle(&$ui, &$config)
|
||||
{
|
||||
parent::PEAR_Command_Common($ui, $config);
|
||||
}
|
||||
|
||||
/**
|
||||
* For unit-testing ease
|
||||
*
|
||||
* @return PEAR_Packager
|
||||
*/
|
||||
function &getPackager()
|
||||
{
|
||||
if (!class_exists('PEAR_Packager')) {
|
||||
require_once 'PEAR/Packager.php';
|
||||
}
|
||||
|
||||
$a = &new PEAR_Packager;
|
||||
return $a;
|
||||
}
|
||||
|
||||
/**
|
||||
* For unit-testing ease
|
||||
*
|
||||
* @param PEAR_Config $config
|
||||
* @param bool $debug
|
||||
* @param string|null $tmpdir
|
||||
* @return PEAR_PackageFile
|
||||
*/
|
||||
function &getPackageFile($config, $debug = false)
|
||||
{
|
||||
if (!class_exists('PEAR_Common')) {
|
||||
require_once 'PEAR/Common.php';
|
||||
}
|
||||
|
||||
if (!class_exists('PEAR_PackageFile')) {
|
||||
require_once 'PEAR/PackageFile.php';
|
||||
}
|
||||
|
||||
$a = &new PEAR_PackageFile($config, $debug);
|
||||
$common = new PEAR_Common;
|
||||
$common->ui = $this->ui;
|
||||
$a->setLogger($common);
|
||||
return $a;
|
||||
}
|
||||
|
||||
function doPackage($command, $options, $params)
|
||||
{
|
||||
$this->output = '';
|
||||
$pkginfofile = isset($params[0]) ? $params[0] : 'package2.xml';
|
||||
$packager = &$this->getPackager();
|
||||
if (PEAR::isError($err = $this->_convertPackage($pkginfofile))) {
|
||||
return $err;
|
||||
}
|
||||
|
||||
$compress = empty($options['nocompress']) ? true : false;
|
||||
$result = $packager->package($pkginfofile, $compress, 'package.xml');
|
||||
if (PEAR::isError($result)) {
|
||||
return $this->raiseError($result);
|
||||
}
|
||||
|
||||
// Don't want output, only the package file name just created
|
||||
if (isset($options['showname'])) {
|
||||
$this->ui->outputData($result, $command);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function _convertPackage($packagexml)
|
||||
{
|
||||
$pkg = &$this->getPackageFile($this->config);
|
||||
$pf2 = &$pkg->fromPackageFile($packagexml, PEAR_VALIDATE_NORMAL);
|
||||
if (!is_a($pf2, 'PEAR_PackageFile_v2')) {
|
||||
return $this->raiseError('Cannot process "' .
|
||||
$packagexml . '", is not a package.xml 2.0');
|
||||
}
|
||||
|
||||
require_once 'PEAR/PackageFile/v1.php';
|
||||
$pf = new PEAR_PackageFile_v1;
|
||||
$pf->setConfig($this->config);
|
||||
if ($pf2->getPackageType() != 'extsrc' && $pf2->getPackageType() != 'zendextsrc') {
|
||||
return $this->raiseError('Cannot safely convert "' . $packagexml .
|
||||
'", is not an extension source package. Using a PEAR_PackageFileManager-based ' .
|
||||
'script is an option');
|
||||
}
|
||||
|
||||
if (is_array($pf2->getUsesRole())) {
|
||||
return $this->raiseError('Cannot safely convert "' . $packagexml .
|
||||
'", contains custom roles. Using a PEAR_PackageFileManager-based script or ' .
|
||||
'the convert command is an option');
|
||||
}
|
||||
|
||||
if (is_array($pf2->getUsesTask())) {
|
||||
return $this->raiseError('Cannot safely convert "' . $packagexml .
|
||||
'", contains custom tasks. Using a PEAR_PackageFileManager-based script or ' .
|
||||
'the convert command is an option');
|
||||
}
|
||||
|
||||
$deps = $pf2->getDependencies();
|
||||
if (isset($deps['group'])) {
|
||||
return $this->raiseError('Cannot safely convert "' . $packagexml .
|
||||
'", contains dependency groups. Using a PEAR_PackageFileManager-based script ' .
|
||||
'or the convert command is an option');
|
||||
}
|
||||
|
||||
if (isset($deps['required']['subpackage']) ||
|
||||
isset($deps['optional']['subpackage'])) {
|
||||
return $this->raiseError('Cannot safely convert "' . $packagexml .
|
||||
'", contains subpackage dependencies. Using a PEAR_PackageFileManager-based '.
|
||||
'script is an option');
|
||||
}
|
||||
|
||||
if (isset($deps['required']['os'])) {
|
||||
return $this->raiseError('Cannot safely convert "' . $packagexml .
|
||||
'", contains os dependencies. Using a PEAR_PackageFileManager-based '.
|
||||
'script is an option');
|
||||
}
|
||||
|
||||
if (isset($deps['required']['arch'])) {
|
||||
return $this->raiseError('Cannot safely convert "' . $packagexml .
|
||||
'", contains arch dependencies. Using a PEAR_PackageFileManager-based '.
|
||||
'script is an option');
|
||||
}
|
||||
|
||||
$pf->setPackage($pf2->getPackage());
|
||||
$pf->setSummary($pf2->getSummary());
|
||||
$pf->setDescription($pf2->getDescription());
|
||||
foreach ($pf2->getMaintainers() as $maintainer) {
|
||||
$pf->addMaintainer($maintainer['role'], $maintainer['handle'],
|
||||
$maintainer['name'], $maintainer['email']);
|
||||
}
|
||||
|
||||
$pf->setVersion($pf2->getVersion());
|
||||
$pf->setDate($pf2->getDate());
|
||||
$pf->setLicense($pf2->getLicense());
|
||||
$pf->setState($pf2->getState());
|
||||
$pf->setNotes($pf2->getNotes());
|
||||
$pf->addPhpDep($deps['required']['php']['min'], 'ge');
|
||||
if (isset($deps['required']['php']['max'])) {
|
||||
$pf->addPhpDep($deps['required']['php']['max'], 'le');
|
||||
}
|
||||
|
||||
if (isset($deps['required']['package'])) {
|
||||
if (!isset($deps['required']['package'][0])) {
|
||||
$deps['required']['package'] = array($deps['required']['package']);
|
||||
}
|
||||
|
||||
foreach ($deps['required']['package'] as $dep) {
|
||||
if (!isset($dep['channel'])) {
|
||||
return $this->raiseError('Cannot safely convert "' . $packagexml . '"' .
|
||||
' contains uri-based dependency on a package. Using a ' .
|
||||
'PEAR_PackageFileManager-based script is an option');
|
||||
}
|
||||
|
||||
if ($dep['channel'] != 'pear.php.net'
|
||||
&& $dep['channel'] != 'pecl.php.net'
|
||||
&& $dep['channel'] != 'doc.php.net') {
|
||||
return $this->raiseError('Cannot safely convert "' . $packagexml . '"' .
|
||||
' contains dependency on a non-standard channel package. Using a ' .
|
||||
'PEAR_PackageFileManager-based script is an option');
|
||||
}
|
||||
|
||||
if (isset($dep['conflicts'])) {
|
||||
return $this->raiseError('Cannot safely convert "' . $packagexml . '"' .
|
||||
' contains conflicts dependency. Using a ' .
|
||||
'PEAR_PackageFileManager-based script is an option');
|
||||
}
|
||||
|
||||
if (isset($dep['exclude'])) {
|
||||
$this->ui->outputData('WARNING: exclude tags are ignored in conversion');
|
||||
}
|
||||
|
||||
if (isset($dep['min'])) {
|
||||
$pf->addPackageDep($dep['name'], $dep['min'], 'ge');
|
||||
}
|
||||
|
||||
if (isset($dep['max'])) {
|
||||
$pf->addPackageDep($dep['name'], $dep['max'], 'le');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($deps['required']['extension'])) {
|
||||
if (!isset($deps['required']['extension'][0])) {
|
||||
$deps['required']['extension'] = array($deps['required']['extension']);
|
||||
}
|
||||
|
||||
foreach ($deps['required']['extension'] as $dep) {
|
||||
if (isset($dep['conflicts'])) {
|
||||
return $this->raiseError('Cannot safely convert "' . $packagexml . '"' .
|
||||
' contains conflicts dependency. Using a ' .
|
||||
'PEAR_PackageFileManager-based script is an option');
|
||||
}
|
||||
|
||||
if (isset($dep['exclude'])) {
|
||||
$this->ui->outputData('WARNING: exclude tags are ignored in conversion');
|
||||
}
|
||||
|
||||
if (isset($dep['min'])) {
|
||||
$pf->addExtensionDep($dep['name'], $dep['min'], 'ge');
|
||||
}
|
||||
|
||||
if (isset($dep['max'])) {
|
||||
$pf->addExtensionDep($dep['name'], $dep['max'], 'le');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($deps['optional']['package'])) {
|
||||
if (!isset($deps['optional']['package'][0])) {
|
||||
$deps['optional']['package'] = array($deps['optional']['package']);
|
||||
}
|
||||
|
||||
foreach ($deps['optional']['package'] as $dep) {
|
||||
if (!isset($dep['channel'])) {
|
||||
return $this->raiseError('Cannot safely convert "' . $packagexml . '"' .
|
||||
' contains uri-based dependency on a package. Using a ' .
|
||||
'PEAR_PackageFileManager-based script is an option');
|
||||
}
|
||||
|
||||
if ($dep['channel'] != 'pear.php.net'
|
||||
&& $dep['channel'] != 'pecl.php.net'
|
||||
&& $dep['channel'] != 'doc.php.net') {
|
||||
return $this->raiseError('Cannot safely convert "' . $packagexml . '"' .
|
||||
' contains dependency on a non-standard channel package. Using a ' .
|
||||
'PEAR_PackageFileManager-based script is an option');
|
||||
}
|
||||
|
||||
if (isset($dep['exclude'])) {
|
||||
$this->ui->outputData('WARNING: exclude tags are ignored in conversion');
|
||||
}
|
||||
|
||||
if (isset($dep['min'])) {
|
||||
$pf->addPackageDep($dep['name'], $dep['min'], 'ge', 'yes');
|
||||
}
|
||||
|
||||
if (isset($dep['max'])) {
|
||||
$pf->addPackageDep($dep['name'], $dep['max'], 'le', 'yes');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($deps['optional']['extension'])) {
|
||||
if (!isset($deps['optional']['extension'][0])) {
|
||||
$deps['optional']['extension'] = array($deps['optional']['extension']);
|
||||
}
|
||||
|
||||
foreach ($deps['optional']['extension'] as $dep) {
|
||||
if (isset($dep['exclude'])) {
|
||||
$this->ui->outputData('WARNING: exclude tags are ignored in conversion');
|
||||
}
|
||||
|
||||
if (isset($dep['min'])) {
|
||||
$pf->addExtensionDep($dep['name'], $dep['min'], 'ge', 'yes');
|
||||
}
|
||||
|
||||
if (isset($dep['max'])) {
|
||||
$pf->addExtensionDep($dep['name'], $dep['max'], 'le', 'yes');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$contents = $pf2->getContents();
|
||||
$release = $pf2->getReleases();
|
||||
if (isset($releases[0])) {
|
||||
return $this->raiseError('Cannot safely process "' . $packagexml . '" contains '
|
||||
. 'multiple extsrcrelease/zendextsrcrelease tags. Using a PEAR_PackageFileManager-based script ' .
|
||||
'or the convert command is an option');
|
||||
}
|
||||
|
||||
if ($configoptions = $pf2->getConfigureOptions()) {
|
||||
foreach ($configoptions as $option) {
|
||||
$default = isset($option['default']) ? $option['default'] : false;
|
||||
$pf->addConfigureOption($option['name'], $option['prompt'], $default);
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($release['filelist']['ignore'])) {
|
||||
return $this->raiseError('Cannot safely process "' . $packagexml . '" contains '
|
||||
. 'ignore tags. Using a PEAR_PackageFileManager-based script or the convert' .
|
||||
' command is an option');
|
||||
}
|
||||
|
||||
if (isset($release['filelist']['install']) &&
|
||||
!isset($release['filelist']['install'][0])) {
|
||||
$release['filelist']['install'] = array($release['filelist']['install']);
|
||||
}
|
||||
|
||||
if (isset($contents['dir']['attribs']['baseinstalldir'])) {
|
||||
$baseinstalldir = $contents['dir']['attribs']['baseinstalldir'];
|
||||
} else {
|
||||
$baseinstalldir = false;
|
||||
}
|
||||
|
||||
if (!isset($contents['dir']['file'][0])) {
|
||||
$contents['dir']['file'] = array($contents['dir']['file']);
|
||||
}
|
||||
|
||||
foreach ($contents['dir']['file'] as $file) {
|
||||
if ($baseinstalldir && !isset($file['attribs']['baseinstalldir'])) {
|
||||
$file['attribs']['baseinstalldir'] = $baseinstalldir;
|
||||
}
|
||||
|
||||
$processFile = $file;
|
||||
unset($processFile['attribs']);
|
||||
if (count($processFile)) {
|
||||
foreach ($processFile as $name => $task) {
|
||||
if ($name != $pf2->getTasksNs() . ':replace') {
|
||||
return $this->raiseError('Cannot safely process "' . $packagexml .
|
||||
'" contains tasks other than replace. Using a ' .
|
||||
'PEAR_PackageFileManager-based script is an option.');
|
||||
}
|
||||
$file['attribs']['replace'][] = $task;
|
||||
}
|
||||
}
|
||||
|
||||
if (!in_array($file['attribs']['role'], PEAR_Common::getFileRoles())) {
|
||||
return $this->raiseError('Cannot safely convert "' . $packagexml .
|
||||
'", contains custom roles. Using a PEAR_PackageFileManager-based script ' .
|
||||
'or the convert command is an option');
|
||||
}
|
||||
|
||||
if (isset($release['filelist']['install'])) {
|
||||
foreach ($release['filelist']['install'] as $installas) {
|
||||
if ($installas['attribs']['name'] == $file['attribs']['name']) {
|
||||
$file['attribs']['install-as'] = $installas['attribs']['as'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$pf->addFile('/', $file['attribs']['name'], $file['attribs']);
|
||||
}
|
||||
|
||||
if ($pf2->getChangeLog()) {
|
||||
$this->ui->outputData('WARNING: changelog is not translated to package.xml ' .
|
||||
'1.0, use PEAR_PackageFileManager-based script if you need changelog-' .
|
||||
'translation for package.xml 1.0');
|
||||
}
|
||||
|
||||
$gen = &$pf->getDefaultGenerator();
|
||||
$gen->toPackageFile('.');
|
||||
}
|
||||
}
|
||||
Vendored
+36
@@ -0,0 +1,36 @@
|
||||
<commands version="1.0">
|
||||
<pickle>
|
||||
<summary>Build PECL Package</summary>
|
||||
<function>doPackage</function>
|
||||
<shortcut>pi</shortcut>
|
||||
<options>
|
||||
<nocompress>
|
||||
<shortopt>Z</shortopt>
|
||||
<doc>Do not gzip the package file</doc>
|
||||
</nocompress>
|
||||
<showname>
|
||||
<shortopt>n</shortopt>
|
||||
<doc>Print the name of the packaged file.</doc>
|
||||
</showname>
|
||||
</options>
|
||||
<doc>[descfile]
|
||||
Creates a PECL package from its package2.xml file.
|
||||
|
||||
An automatic conversion will be made to a package.xml 1.0 and written out to
|
||||
disk in the current directory as "package.xml". Note that
|
||||
only simple package.xml 2.0 will be converted. package.xml 2.0 with:
|
||||
|
||||
- dependency types other than required/optional PECL package/ext/php/pearinstaller
|
||||
- more than one extsrcrelease or zendextsrcrelease
|
||||
- zendextbinrelease, extbinrelease, phprelease, or bundle release type
|
||||
- dependency groups
|
||||
- ignore tags in release filelist
|
||||
- tasks other than replace
|
||||
- custom roles
|
||||
|
||||
will cause pickle to fail, and output an error message. If your package2.xml
|
||||
uses any of these features, you are best off using PEAR_PackageFileManager to
|
||||
generate both package.xml.
|
||||
</doc>
|
||||
</pickle>
|
||||
</commands>
|
||||
Vendored
+1145
File diff suppressed because it is too large
Load Diff
Vendored
+58
@@ -0,0 +1,58 @@
|
||||
<commands version="1.0">
|
||||
<list>
|
||||
<summary>List Installed Packages In The Default Channel</summary>
|
||||
<function>doList</function>
|
||||
<shortcut>l</shortcut>
|
||||
<options>
|
||||
<channel>
|
||||
<shortopt>c</shortopt>
|
||||
<doc>list installed packages from this channel</doc>
|
||||
<arg>CHAN</arg>
|
||||
</channel>
|
||||
<allchannels>
|
||||
<shortopt>a</shortopt>
|
||||
<doc>list installed packages from all channels</doc>
|
||||
</allchannels>
|
||||
<channelinfo>
|
||||
<shortopt>i</shortopt>
|
||||
<doc>output fully channel-aware data, even on failure</doc>
|
||||
</channelinfo>
|
||||
</options>
|
||||
<doc><package>
|
||||
If invoked without parameters, this command lists the PEAR packages
|
||||
installed in your php_dir ({config php_dir}). With a parameter, it
|
||||
lists the files in a package.
|
||||
</doc>
|
||||
</list>
|
||||
<list-files>
|
||||
<summary>List Files In Installed Package</summary>
|
||||
<function>doFileList</function>
|
||||
<shortcut>fl</shortcut>
|
||||
<options />
|
||||
<doc><package>
|
||||
List the files in an installed package.
|
||||
</doc>
|
||||
</list-files>
|
||||
<shell-test>
|
||||
<summary>Shell Script Test</summary>
|
||||
<function>doShellTest</function>
|
||||
<shortcut>st</shortcut>
|
||||
<options />
|
||||
<doc><package> [[relation] version]
|
||||
Tests if a package is installed in the system. Will exit(1) if it is not.
|
||||
<relation> The version comparison operator. One of:
|
||||
<, lt, <=, le, >, gt, >=, ge, ==, =, eq, !=, <>, ne
|
||||
<version> The version to compare with
|
||||
</doc>
|
||||
</shell-test>
|
||||
<info>
|
||||
<summary>Display information about a package</summary>
|
||||
<function>doInfo</function>
|
||||
<shortcut>in</shortcut>
|
||||
<options />
|
||||
<doc><package>
|
||||
Displays information about a package. The package argument may be a
|
||||
local package file, an URL to a package file, or the name of an
|
||||
installed package.</doc>
|
||||
</info>
|
||||
</commands>
|
||||
Vendored
+810
@@ -0,0 +1,810 @@
|
||||
<?php
|
||||
/**
|
||||
* PEAR_Command_Remote (remote-info, list-upgrades, remote-list, search, list-all, download,
|
||||
* clear-cache commands)
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Stig Bakken <ssb@php.net>
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version CVS: $Id: Remote.php 313023 2011-07-06 19:17:11Z dufuz $
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since File available since Release 0.1
|
||||
*/
|
||||
|
||||
/**
|
||||
* base class
|
||||
*/
|
||||
require_once 'PEAR/Command/Common.php';
|
||||
require_once 'PEAR/REST.php';
|
||||
|
||||
/**
|
||||
* PEAR commands for remote server querying
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Stig Bakken <ssb@php.net>
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version Release: 1.9.4
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since Class available since Release 0.1
|
||||
*/
|
||||
class PEAR_Command_Remote extends PEAR_Command_Common
|
||||
{
|
||||
var $commands = array(
|
||||
'remote-info' => array(
|
||||
'summary' => 'Information About Remote Packages',
|
||||
'function' => 'doRemoteInfo',
|
||||
'shortcut' => 'ri',
|
||||
'options' => array(),
|
||||
'doc' => '<package>
|
||||
Get details on a package from the server.',
|
||||
),
|
||||
'list-upgrades' => array(
|
||||
'summary' => 'List Available Upgrades',
|
||||
'function' => 'doListUpgrades',
|
||||
'shortcut' => 'lu',
|
||||
'options' => array(
|
||||
'channelinfo' => array(
|
||||
'shortopt' => 'i',
|
||||
'doc' => 'output fully channel-aware data, even on failure',
|
||||
),
|
||||
),
|
||||
'doc' => '[preferred_state]
|
||||
List releases on the server of packages you have installed where
|
||||
a newer version is available with the same release state (stable etc.)
|
||||
or the state passed as the second parameter.'
|
||||
),
|
||||
'remote-list' => array(
|
||||
'summary' => 'List Remote Packages',
|
||||
'function' => 'doRemoteList',
|
||||
'shortcut' => 'rl',
|
||||
'options' => array(
|
||||
'channel' =>
|
||||
array(
|
||||
'shortopt' => 'c',
|
||||
'doc' => 'specify a channel other than the default channel',
|
||||
'arg' => 'CHAN',
|
||||
)
|
||||
),
|
||||
'doc' => '
|
||||
Lists the packages available on the configured server along with the
|
||||
latest stable release of each package.',
|
||||
),
|
||||
'search' => array(
|
||||
'summary' => 'Search remote package database',
|
||||
'function' => 'doSearch',
|
||||
'shortcut' => 'sp',
|
||||
'options' => array(
|
||||
'channel' =>
|
||||
array(
|
||||
'shortopt' => 'c',
|
||||
'doc' => 'specify a channel other than the default channel',
|
||||
'arg' => 'CHAN',
|
||||
),
|
||||
'allchannels' => array(
|
||||
'shortopt' => 'a',
|
||||
'doc' => 'search packages from all known channels',
|
||||
),
|
||||
'channelinfo' => array(
|
||||
'shortopt' => 'i',
|
||||
'doc' => 'output fully channel-aware data, even on failure',
|
||||
),
|
||||
),
|
||||
'doc' => '[packagename] [packageinfo]
|
||||
Lists all packages which match the search parameters. The first
|
||||
parameter is a fragment of a packagename. The default channel
|
||||
will be used unless explicitly overridden. The second parameter
|
||||
will be used to match any portion of the summary/description',
|
||||
),
|
||||
'list-all' => array(
|
||||
'summary' => 'List All Packages',
|
||||
'function' => 'doListAll',
|
||||
'shortcut' => 'la',
|
||||
'options' => array(
|
||||
'channel' =>
|
||||
array(
|
||||
'shortopt' => 'c',
|
||||
'doc' => 'specify a channel other than the default channel',
|
||||
'arg' => 'CHAN',
|
||||
),
|
||||
'channelinfo' => array(
|
||||
'shortopt' => 'i',
|
||||
'doc' => 'output fully channel-aware data, even on failure',
|
||||
),
|
||||
),
|
||||
'doc' => '
|
||||
Lists the packages available on the configured server along with the
|
||||
latest stable release of each package.',
|
||||
),
|
||||
'download' => array(
|
||||
'summary' => 'Download Package',
|
||||
'function' => 'doDownload',
|
||||
'shortcut' => 'd',
|
||||
'options' => array(
|
||||
'nocompress' => array(
|
||||
'shortopt' => 'Z',
|
||||
'doc' => 'download an uncompressed (.tar) file',
|
||||
),
|
||||
),
|
||||
'doc' => '<package>...
|
||||
Download package tarballs. The files will be named as suggested by the
|
||||
server, for example if you download the DB package and the latest stable
|
||||
version of DB is 1.6.5, the downloaded file will be DB-1.6.5.tgz.',
|
||||
),
|
||||
'clear-cache' => array(
|
||||
'summary' => 'Clear Web Services Cache',
|
||||
'function' => 'doClearCache',
|
||||
'shortcut' => 'cc',
|
||||
'options' => array(),
|
||||
'doc' => '
|
||||
Clear the REST cache. See also the cache_ttl configuration
|
||||
parameter.
|
||||
',
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
* PEAR_Command_Remote constructor.
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PEAR_Command_Remote(&$ui, &$config)
|
||||
{
|
||||
parent::PEAR_Command_Common($ui, $config);
|
||||
}
|
||||
|
||||
function _checkChannelForStatus($channel, $chan)
|
||||
{
|
||||
if (PEAR::isError($chan)) {
|
||||
$this->raiseError($chan);
|
||||
}
|
||||
if (!is_a($chan, 'PEAR_ChannelFile')) {
|
||||
return $this->raiseError('Internal corruption error: invalid channel "' .
|
||||
$channel . '"');
|
||||
}
|
||||
$rest = new PEAR_REST($this->config);
|
||||
PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);
|
||||
$mirror = $this->config->get('preferred_mirror', null,
|
||||
$channel);
|
||||
$a = $rest->downloadHttp('http://' . $channel .
|
||||
'/channel.xml', $chan->lastModified());
|
||||
PEAR::staticPopErrorHandling();
|
||||
if (!PEAR::isError($a) && $a) {
|
||||
$this->ui->outputData('WARNING: channel "' . $channel . '" has ' .
|
||||
'updated its protocols, use "' . PEAR_RUNTYPE . ' channel-update ' . $channel .
|
||||
'" to update');
|
||||
}
|
||||
}
|
||||
|
||||
function doRemoteInfo($command, $options, $params)
|
||||
{
|
||||
if (sizeof($params) != 1) {
|
||||
return $this->raiseError("$command expects one param: the remote package name");
|
||||
}
|
||||
$savechannel = $channel = $this->config->get('default_channel');
|
||||
$reg = &$this->config->getRegistry();
|
||||
$package = $params[0];
|
||||
$parsed = $reg->parsePackageName($package, $channel);
|
||||
if (PEAR::isError($parsed)) {
|
||||
return $this->raiseError('Invalid package name "' . $package . '"');
|
||||
}
|
||||
|
||||
$channel = $parsed['channel'];
|
||||
$this->config->set('default_channel', $channel);
|
||||
$chan = $reg->getChannel($channel);
|
||||
if (PEAR::isError($e = $this->_checkChannelForStatus($channel, $chan))) {
|
||||
return $e;
|
||||
}
|
||||
|
||||
$mirror = $this->config->get('preferred_mirror');
|
||||
if ($chan->supportsREST($mirror) && $base = $chan->getBaseURL('REST1.0', $mirror)) {
|
||||
$rest = &$this->config->getREST('1.0', array());
|
||||
$info = $rest->packageInfo($base, $parsed['package'], $channel);
|
||||
}
|
||||
|
||||
if (!isset($info)) {
|
||||
return $this->raiseError('No supported protocol was found');
|
||||
}
|
||||
|
||||
if (PEAR::isError($info)) {
|
||||
$this->config->set('default_channel', $savechannel);
|
||||
return $this->raiseError($info);
|
||||
}
|
||||
|
||||
if (!isset($info['name'])) {
|
||||
return $this->raiseError('No remote package "' . $package . '" was found');
|
||||
}
|
||||
|
||||
$installed = $reg->packageInfo($info['name'], null, $channel);
|
||||
$info['installed'] = $installed['version'] ? $installed['version'] : '- no -';
|
||||
if (is_array($info['installed'])) {
|
||||
$info['installed'] = $info['installed']['release'];
|
||||
}
|
||||
|
||||
$this->ui->outputData($info, $command);
|
||||
$this->config->set('default_channel', $savechannel);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function doRemoteList($command, $options, $params)
|
||||
{
|
||||
$savechannel = $channel = $this->config->get('default_channel');
|
||||
$reg = &$this->config->getRegistry();
|
||||
if (isset($options['channel'])) {
|
||||
$channel = $options['channel'];
|
||||
if (!$reg->channelExists($channel)) {
|
||||
return $this->raiseError('Channel "' . $channel . '" does not exist');
|
||||
}
|
||||
|
||||
$this->config->set('default_channel', $channel);
|
||||
}
|
||||
|
||||
$chan = $reg->getChannel($channel);
|
||||
if (PEAR::isError($e = $this->_checkChannelForStatus($channel, $chan))) {
|
||||
return $e;
|
||||
}
|
||||
|
||||
$list_options = false;
|
||||
if ($this->config->get('preferred_state') == 'stable') {
|
||||
$list_options = true;
|
||||
}
|
||||
|
||||
$available = array();
|
||||
if ($chan->supportsREST($this->config->get('preferred_mirror')) &&
|
||||
$base = $chan->getBaseURL('REST1.1', $this->config->get('preferred_mirror'))
|
||||
) {
|
||||
// use faster list-all if available
|
||||
$rest = &$this->config->getREST('1.1', array());
|
||||
$available = $rest->listAll($base, $list_options, true, false, false, $chan->getName());
|
||||
} elseif ($chan->supportsREST($this->config->get('preferred_mirror')) &&
|
||||
$base = $chan->getBaseURL('REST1.0', $this->config->get('preferred_mirror'))) {
|
||||
$rest = &$this->config->getREST('1.0', array());
|
||||
$available = $rest->listAll($base, $list_options, true, false, false, $chan->getName());
|
||||
}
|
||||
|
||||
if (PEAR::isError($available)) {
|
||||
$this->config->set('default_channel', $savechannel);
|
||||
return $this->raiseError($available);
|
||||
}
|
||||
|
||||
$i = $j = 0;
|
||||
$data = array(
|
||||
'caption' => 'Channel ' . $channel . ' Available packages:',
|
||||
'border' => true,
|
||||
'headline' => array('Package', 'Version'),
|
||||
'channel' => $channel
|
||||
);
|
||||
|
||||
if (count($available) == 0) {
|
||||
$data = '(no packages available yet)';
|
||||
} else {
|
||||
foreach ($available as $name => $info) {
|
||||
$version = (isset($info['stable']) && $info['stable']) ? $info['stable'] : '-n/a-';
|
||||
$data['data'][] = array($name, $version);
|
||||
}
|
||||
}
|
||||
$this->ui->outputData($data, $command);
|
||||
$this->config->set('default_channel', $savechannel);
|
||||
return true;
|
||||
}
|
||||
|
||||
function doListAll($command, $options, $params)
|
||||
{
|
||||
$savechannel = $channel = $this->config->get('default_channel');
|
||||
$reg = &$this->config->getRegistry();
|
||||
if (isset($options['channel'])) {
|
||||
$channel = $options['channel'];
|
||||
if (!$reg->channelExists($channel)) {
|
||||
return $this->raiseError("Channel \"$channel\" does not exist");
|
||||
}
|
||||
|
||||
$this->config->set('default_channel', $channel);
|
||||
}
|
||||
|
||||
$list_options = false;
|
||||
if ($this->config->get('preferred_state') == 'stable') {
|
||||
$list_options = true;
|
||||
}
|
||||
|
||||
$chan = $reg->getChannel($channel);
|
||||
if (PEAR::isError($e = $this->_checkChannelForStatus($channel, $chan))) {
|
||||
return $e;
|
||||
}
|
||||
|
||||
if ($chan->supportsREST($this->config->get('preferred_mirror')) &&
|
||||
$base = $chan->getBaseURL('REST1.1', $this->config->get('preferred_mirror'))) {
|
||||
// use faster list-all if available
|
||||
$rest = &$this->config->getREST('1.1', array());
|
||||
$available = $rest->listAll($base, $list_options, false, false, false, $chan->getName());
|
||||
} elseif ($chan->supportsREST($this->config->get('preferred_mirror')) &&
|
||||
$base = $chan->getBaseURL('REST1.0', $this->config->get('preferred_mirror'))) {
|
||||
$rest = &$this->config->getREST('1.0', array());
|
||||
$available = $rest->listAll($base, $list_options, false, false, false, $chan->getName());
|
||||
}
|
||||
|
||||
if (PEAR::isError($available)) {
|
||||
$this->config->set('default_channel', $savechannel);
|
||||
return $this->raiseError('The package list could not be fetched from the remote server. Please try again. (Debug info: "' . $available->getMessage() . '")');
|
||||
}
|
||||
|
||||
$data = array(
|
||||
'caption' => 'All packages [Channel ' . $channel . ']:',
|
||||
'border' => true,
|
||||
'headline' => array('Package', 'Latest', 'Local'),
|
||||
'channel' => $channel,
|
||||
);
|
||||
|
||||
if (isset($options['channelinfo'])) {
|
||||
// add full channelinfo
|
||||
$data['caption'] = 'Channel ' . $channel . ' All packages:';
|
||||
$data['headline'] = array('Channel', 'Package', 'Latest', 'Local',
|
||||
'Description', 'Dependencies');
|
||||
}
|
||||
$local_pkgs = $reg->listPackages($channel);
|
||||
|
||||
foreach ($available as $name => $info) {
|
||||
$installed = $reg->packageInfo($name, null, $channel);
|
||||
if (is_array($installed['version'])) {
|
||||
$installed['version'] = $installed['version']['release'];
|
||||
}
|
||||
$desc = $info['summary'];
|
||||
if (isset($params[$name])) {
|
||||
$desc .= "\n\n".$info['description'];
|
||||
}
|
||||
if (isset($options['mode']))
|
||||
{
|
||||
if ($options['mode'] == 'installed' && !isset($installed['version'])) {
|
||||
continue;
|
||||
}
|
||||
if ($options['mode'] == 'notinstalled' && isset($installed['version'])) {
|
||||
continue;
|
||||
}
|
||||
if ($options['mode'] == 'upgrades'
|
||||
&& (!isset($installed['version']) || version_compare($installed['version'],
|
||||
$info['stable'], '>='))) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
$pos = array_search(strtolower($name), $local_pkgs);
|
||||
if ($pos !== false) {
|
||||
unset($local_pkgs[$pos]);
|
||||
}
|
||||
|
||||
if (isset($info['stable']) && !$info['stable']) {
|
||||
$info['stable'] = null;
|
||||
}
|
||||
|
||||
if (isset($options['channelinfo'])) {
|
||||
// add full channelinfo
|
||||
if ($info['stable'] === $info['unstable']) {
|
||||
$state = $info['state'];
|
||||
} else {
|
||||
$state = 'stable';
|
||||
}
|
||||
$latest = $info['stable'].' ('.$state.')';
|
||||
$local = '';
|
||||
if (isset($installed['version'])) {
|
||||
$inst_state = $reg->packageInfo($name, 'release_state', $channel);
|
||||
$local = $installed['version'].' ('.$inst_state.')';
|
||||
}
|
||||
|
||||
$packageinfo = array(
|
||||
$channel,
|
||||
$name,
|
||||
$latest,
|
||||
$local,
|
||||
isset($desc) ? $desc : null,
|
||||
isset($info['deps']) ? $info['deps'] : null,
|
||||
);
|
||||
} else {
|
||||
$packageinfo = array(
|
||||
$reg->channelAlias($channel) . '/' . $name,
|
||||
isset($info['stable']) ? $info['stable'] : null,
|
||||
isset($installed['version']) ? $installed['version'] : null,
|
||||
isset($desc) ? $desc : null,
|
||||
isset($info['deps']) ? $info['deps'] : null,
|
||||
);
|
||||
}
|
||||
$data['data'][$info['category']][] = $packageinfo;
|
||||
}
|
||||
|
||||
if (isset($options['mode']) && in_array($options['mode'], array('notinstalled', 'upgrades'))) {
|
||||
$this->config->set('default_channel', $savechannel);
|
||||
$this->ui->outputData($data, $command);
|
||||
return true;
|
||||
}
|
||||
|
||||
foreach ($local_pkgs as $name) {
|
||||
$info = &$reg->getPackage($name, $channel);
|
||||
$data['data']['Local'][] = array(
|
||||
$reg->channelAlias($channel) . '/' . $info->getPackage(),
|
||||
'',
|
||||
$info->getVersion(),
|
||||
$info->getSummary(),
|
||||
$info->getDeps()
|
||||
);
|
||||
}
|
||||
|
||||
$this->config->set('default_channel', $savechannel);
|
||||
$this->ui->outputData($data, $command);
|
||||
return true;
|
||||
}
|
||||
|
||||
function doSearch($command, $options, $params)
|
||||
{
|
||||
if ((!isset($params[0]) || empty($params[0]))
|
||||
&& (!isset($params[1]) || empty($params[1])))
|
||||
{
|
||||
return $this->raiseError('no valid search string supplied');
|
||||
}
|
||||
|
||||
$channelinfo = isset($options['channelinfo']);
|
||||
$reg = &$this->config->getRegistry();
|
||||
if (isset($options['allchannels'])) {
|
||||
// search all channels
|
||||
unset($options['allchannels']);
|
||||
$channels = $reg->getChannels();
|
||||
$errors = array();
|
||||
PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);
|
||||
foreach ($channels as $channel) {
|
||||
if ($channel->getName() != '__uri') {
|
||||
$options['channel'] = $channel->getName();
|
||||
$ret = $this->doSearch($command, $options, $params);
|
||||
if (PEAR::isError($ret)) {
|
||||
$errors[] = $ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PEAR::staticPopErrorHandling();
|
||||
if (count($errors) !== 0) {
|
||||
// for now, only give first error
|
||||
return PEAR::raiseError($errors[0]);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
$savechannel = $channel = $this->config->get('default_channel');
|
||||
$package = strtolower($params[0]);
|
||||
$summary = isset($params[1]) ? $params[1] : false;
|
||||
if (isset($options['channel'])) {
|
||||
$reg = &$this->config->getRegistry();
|
||||
$channel = $options['channel'];
|
||||
if (!$reg->channelExists($channel)) {
|
||||
return $this->raiseError('Channel "' . $channel . '" does not exist');
|
||||
}
|
||||
|
||||
$this->config->set('default_channel', $channel);
|
||||
}
|
||||
|
||||
$chan = $reg->getChannel($channel);
|
||||
if (PEAR::isError($e = $this->_checkChannelForStatus($channel, $chan))) {
|
||||
return $e;
|
||||
}
|
||||
|
||||
if ($chan->supportsREST($this->config->get('preferred_mirror')) &&
|
||||
$base = $chan->getBaseURL('REST1.0', $this->config->get('preferred_mirror'))) {
|
||||
$rest = &$this->config->getREST('1.0', array());
|
||||
$available = $rest->listAll($base, false, false, $package, $summary, $chan->getName());
|
||||
}
|
||||
|
||||
if (PEAR::isError($available)) {
|
||||
$this->config->set('default_channel', $savechannel);
|
||||
return $this->raiseError($available);
|
||||
}
|
||||
|
||||
if (!$available && !$channelinfo) {
|
||||
// clean exit when not found, no error !
|
||||
$data = 'no packages found that match pattern "' . $package . '", for channel '.$channel.'.';
|
||||
$this->ui->outputData($data);
|
||||
$this->config->set('default_channel', $channel);
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($channelinfo) {
|
||||
$data = array(
|
||||
'caption' => 'Matched packages, channel ' . $channel . ':',
|
||||
'border' => true,
|
||||
'headline' => array('Channel', 'Package', 'Stable/(Latest)', 'Local'),
|
||||
'channel' => $channel
|
||||
);
|
||||
} else {
|
||||
$data = array(
|
||||
'caption' => 'Matched packages, channel ' . $channel . ':',
|
||||
'border' => true,
|
||||
'headline' => array('Package', 'Stable/(Latest)', 'Local'),
|
||||
'channel' => $channel
|
||||
);
|
||||
}
|
||||
|
||||
if (!$available && $channelinfo) {
|
||||
unset($data['headline']);
|
||||
$data['data'] = 'No packages found that match pattern "' . $package . '".';
|
||||
$available = array();
|
||||
}
|
||||
|
||||
foreach ($available as $name => $info) {
|
||||
$installed = $reg->packageInfo($name, null, $channel);
|
||||
$desc = $info['summary'];
|
||||
if (isset($params[$name]))
|
||||
$desc .= "\n\n".$info['description'];
|
||||
|
||||
if (!isset($info['stable']) || !$info['stable']) {
|
||||
$version_remote = 'none';
|
||||
} else {
|
||||
if ($info['unstable']) {
|
||||
$version_remote = $info['unstable'];
|
||||
} else {
|
||||
$version_remote = $info['stable'];
|
||||
}
|
||||
$version_remote .= ' ('.$info['state'].')';
|
||||
}
|
||||
$version = is_array($installed['version']) ? $installed['version']['release'] :
|
||||
$installed['version'];
|
||||
if ($channelinfo) {
|
||||
$packageinfo = array(
|
||||
$channel,
|
||||
$name,
|
||||
$version_remote,
|
||||
$version,
|
||||
$desc,
|
||||
);
|
||||
} else {
|
||||
$packageinfo = array(
|
||||
$name,
|
||||
$version_remote,
|
||||
$version,
|
||||
$desc,
|
||||
);
|
||||
}
|
||||
$data['data'][$info['category']][] = $packageinfo;
|
||||
}
|
||||
|
||||
$this->ui->outputData($data, $command);
|
||||
$this->config->set('default_channel', $channel);
|
||||
return true;
|
||||
}
|
||||
|
||||
function &getDownloader($options)
|
||||
{
|
||||
if (!class_exists('PEAR_Downloader')) {
|
||||
require_once 'PEAR/Downloader.php';
|
||||
}
|
||||
$a = &new PEAR_Downloader($this->ui, $options, $this->config);
|
||||
return $a;
|
||||
}
|
||||
|
||||
function doDownload($command, $options, $params)
|
||||
{
|
||||
// make certain that dependencies are ignored
|
||||
$options['downloadonly'] = 1;
|
||||
|
||||
// eliminate error messages for preferred_state-related errors
|
||||
/* TODO: Should be an option, but until now download does respect
|
||||
prefered state */
|
||||
/* $options['ignorepreferred_state'] = 1; */
|
||||
// eliminate error messages for preferred_state-related errors
|
||||
|
||||
$downloader = &$this->getDownloader($options);
|
||||
PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);
|
||||
$e = $downloader->setDownloadDir(getcwd());
|
||||
PEAR::staticPopErrorHandling();
|
||||
if (PEAR::isError($e)) {
|
||||
return $this->raiseError('Current directory is not writeable, cannot download');
|
||||
}
|
||||
|
||||
$errors = array();
|
||||
$downloaded = array();
|
||||
$err = $downloader->download($params);
|
||||
if (PEAR::isError($err)) {
|
||||
return $err;
|
||||
}
|
||||
|
||||
$errors = $downloader->getErrorMsgs();
|
||||
if (count($errors)) {
|
||||
foreach ($errors as $error) {
|
||||
if ($error !== null) {
|
||||
$this->ui->outputData($error);
|
||||
}
|
||||
}
|
||||
|
||||
return $this->raiseError("$command failed");
|
||||
}
|
||||
|
||||
$downloaded = $downloader->getDownloadedPackages();
|
||||
foreach ($downloaded as $pkg) {
|
||||
$this->ui->outputData("File $pkg[file] downloaded", $command);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function downloadCallback($msg, $params = null)
|
||||
{
|
||||
if ($msg == 'done') {
|
||||
$this->bytes_downloaded = $params;
|
||||
}
|
||||
}
|
||||
|
||||
function doListUpgrades($command, $options, $params)
|
||||
{
|
||||
require_once 'PEAR/Common.php';
|
||||
if (isset($params[0]) && !is_array(PEAR_Common::betterStates($params[0]))) {
|
||||
return $this->raiseError($params[0] . ' is not a valid state (stable/beta/alpha/devel/etc.) try "pear help list-upgrades"');
|
||||
}
|
||||
|
||||
$savechannel = $channel = $this->config->get('default_channel');
|
||||
$reg = &$this->config->getRegistry();
|
||||
foreach ($reg->listChannels() as $channel) {
|
||||
$inst = array_flip($reg->listPackages($channel));
|
||||
if (!count($inst)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($channel == '__uri') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->config->set('default_channel', $channel);
|
||||
$state = empty($params[0]) ? $this->config->get('preferred_state') : $params[0];
|
||||
|
||||
$caption = $channel . ' Available Upgrades';
|
||||
$chan = $reg->getChannel($channel);
|
||||
if (PEAR::isError($e = $this->_checkChannelForStatus($channel, $chan))) {
|
||||
return $e;
|
||||
}
|
||||
|
||||
$latest = array();
|
||||
$base2 = false;
|
||||
$preferred_mirror = $this->config->get('preferred_mirror');
|
||||
if ($chan->supportsREST($preferred_mirror) &&
|
||||
(
|
||||
//($base2 = $chan->getBaseURL('REST1.4', $preferred_mirror)) ||
|
||||
($base = $chan->getBaseURL('REST1.0', $preferred_mirror))
|
||||
)
|
||||
|
||||
) {
|
||||
if ($base2) {
|
||||
$rest = &$this->config->getREST('1.4', array());
|
||||
$base = $base2;
|
||||
} else {
|
||||
$rest = &$this->config->getREST('1.0', array());
|
||||
}
|
||||
|
||||
if (empty($state) || $state == 'any') {
|
||||
$state = false;
|
||||
} else {
|
||||
$caption .= ' (' . implode(', ', PEAR_Common::betterStates($state, true)) . ')';
|
||||
}
|
||||
|
||||
PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);
|
||||
$latest = $rest->listLatestUpgrades($base, $state, $inst, $channel, $reg);
|
||||
PEAR::staticPopErrorHandling();
|
||||
}
|
||||
|
||||
if (PEAR::isError($latest)) {
|
||||
$this->ui->outputData($latest->getMessage());
|
||||
continue;
|
||||
}
|
||||
|
||||
$caption .= ':';
|
||||
if (PEAR::isError($latest)) {
|
||||
$this->config->set('default_channel', $savechannel);
|
||||
return $latest;
|
||||
}
|
||||
|
||||
$data = array(
|
||||
'caption' => $caption,
|
||||
'border' => 1,
|
||||
'headline' => array('Channel', 'Package', 'Local', 'Remote', 'Size'),
|
||||
'channel' => $channel
|
||||
);
|
||||
|
||||
foreach ((array)$latest as $pkg => $info) {
|
||||
$package = strtolower($pkg);
|
||||
if (!isset($inst[$package])) {
|
||||
// skip packages we don't have installed
|
||||
continue;
|
||||
}
|
||||
|
||||
extract($info);
|
||||
$inst_version = $reg->packageInfo($package, 'version', $channel);
|
||||
$inst_state = $reg->packageInfo($package, 'release_state', $channel);
|
||||
if (version_compare("$version", "$inst_version", "le")) {
|
||||
// installed version is up-to-date
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($filesize >= 20480) {
|
||||
$filesize += 1024 - ($filesize % 1024);
|
||||
$fs = sprintf("%dkB", $filesize / 1024);
|
||||
} elseif ($filesize > 0) {
|
||||
$filesize += 103 - ($filesize % 103);
|
||||
$fs = sprintf("%.1fkB", $filesize / 1024.0);
|
||||
} else {
|
||||
$fs = " -"; // XXX center instead
|
||||
}
|
||||
|
||||
$data['data'][] = array($channel, $pkg, "$inst_version ($inst_state)", "$version ($state)", $fs);
|
||||
}
|
||||
|
||||
if (isset($options['channelinfo'])) {
|
||||
if (empty($data['data'])) {
|
||||
unset($data['headline']);
|
||||
if (count($inst) == 0) {
|
||||
$data['data'] = '(no packages installed)';
|
||||
} else {
|
||||
$data['data'] = '(no upgrades available)';
|
||||
}
|
||||
}
|
||||
$this->ui->outputData($data, $command);
|
||||
} else {
|
||||
if (empty($data['data'])) {
|
||||
$this->ui->outputData('Channel ' . $channel . ': No upgrades available');
|
||||
} else {
|
||||
$this->ui->outputData($data, $command);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->config->set('default_channel', $savechannel);
|
||||
return true;
|
||||
}
|
||||
|
||||
function doClearCache($command, $options, $params)
|
||||
{
|
||||
$cache_dir = $this->config->get('cache_dir');
|
||||
$verbose = $this->config->get('verbose');
|
||||
$output = '';
|
||||
if (!file_exists($cache_dir) || !is_dir($cache_dir)) {
|
||||
return $this->raiseError("$cache_dir does not exist or is not a directory");
|
||||
}
|
||||
|
||||
if (!($dp = @opendir($cache_dir))) {
|
||||
return $this->raiseError("opendir($cache_dir) failed: $php_errormsg");
|
||||
}
|
||||
|
||||
if ($verbose >= 1) {
|
||||
$output .= "reading directory $cache_dir\n";
|
||||
}
|
||||
|
||||
$num = 0;
|
||||
while ($ent = readdir($dp)) {
|
||||
if (preg_match('/rest.cache(file|id)\\z/', $ent)) {
|
||||
$path = $cache_dir . DIRECTORY_SEPARATOR . $ent;
|
||||
if (file_exists($path)) {
|
||||
$ok = @unlink($path);
|
||||
} else {
|
||||
$ok = false;
|
||||
$php_errormsg = '';
|
||||
}
|
||||
|
||||
if ($ok) {
|
||||
if ($verbose >= 2) {
|
||||
$output .= "deleted $path\n";
|
||||
}
|
||||
$num++;
|
||||
} elseif ($verbose >= 1) {
|
||||
$output .= "failed to delete $path $php_errormsg\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
closedir($dp);
|
||||
if ($verbose >= 1) {
|
||||
$output .= "$num cache entries cleared\n";
|
||||
}
|
||||
|
||||
$this->ui->outputData(rtrim($output), $command);
|
||||
return $num;
|
||||
}
|
||||
}
|
||||
Vendored
+109
@@ -0,0 +1,109 @@
|
||||
<commands version="1.0">
|
||||
<remote-info>
|
||||
<summary>Information About Remote Packages</summary>
|
||||
<function>doRemoteInfo</function>
|
||||
<shortcut>ri</shortcut>
|
||||
<options />
|
||||
<doc><package>
|
||||
Get details on a package from the server.</doc>
|
||||
</remote-info>
|
||||
<list-upgrades>
|
||||
<summary>List Available Upgrades</summary>
|
||||
<function>doListUpgrades</function>
|
||||
<shortcut>lu</shortcut>
|
||||
<options>
|
||||
<channelinfo>
|
||||
<shortopt>i</shortopt>
|
||||
<doc>output fully channel-aware data, even on failure</doc>
|
||||
</channelinfo>
|
||||
</options>
|
||||
<doc>[preferred_state]
|
||||
List releases on the server of packages you have installed where
|
||||
a newer version is available with the same release state (stable etc.)
|
||||
or the state passed as the second parameter.</doc>
|
||||
</list-upgrades>
|
||||
<remote-list>
|
||||
<summary>List Remote Packages</summary>
|
||||
<function>doRemoteList</function>
|
||||
<shortcut>rl</shortcut>
|
||||
<options>
|
||||
<channel>
|
||||
<shortopt>c</shortopt>
|
||||
<doc>specify a channel other than the default channel</doc>
|
||||
<arg>CHAN</arg>
|
||||
</channel>
|
||||
</options>
|
||||
<doc>
|
||||
Lists the packages available on the configured server along with the
|
||||
latest stable release of each package.</doc>
|
||||
</remote-list>
|
||||
<search>
|
||||
<summary>Search remote package database</summary>
|
||||
<function>doSearch</function>
|
||||
<shortcut>sp</shortcut>
|
||||
<options>
|
||||
<channel>
|
||||
<shortopt>c</shortopt>
|
||||
<doc>specify a channel other than the default channel</doc>
|
||||
<arg>CHAN</arg>
|
||||
</channel>
|
||||
<allchannels>
|
||||
<shortopt>a</shortopt>
|
||||
<doc>search packages from all known channels</doc>
|
||||
</allchannels>
|
||||
<channelinfo>
|
||||
<shortopt>i</shortopt>
|
||||
<doc>output fully channel-aware data, even on failure</doc>
|
||||
</channelinfo>
|
||||
</options>
|
||||
<doc>[packagename] [packageinfo]
|
||||
Lists all packages which match the search parameters. The first
|
||||
parameter is a fragment of a packagename. The default channel
|
||||
will be used unless explicitly overridden. The second parameter
|
||||
will be used to match any portion of the summary/description</doc>
|
||||
</search>
|
||||
<list-all>
|
||||
<summary>List All Packages</summary>
|
||||
<function>doListAll</function>
|
||||
<shortcut>la</shortcut>
|
||||
<options>
|
||||
<channel>
|
||||
<shortopt>c</shortopt>
|
||||
<doc>specify a channel other than the default channel</doc>
|
||||
<arg>CHAN</arg>
|
||||
</channel>
|
||||
<channelinfo>
|
||||
<shortopt>i</shortopt>
|
||||
<doc>output fully channel-aware data, even on failure</doc>
|
||||
</channelinfo>
|
||||
</options>
|
||||
<doc>
|
||||
Lists the packages available on the configured server along with the
|
||||
latest stable release of each package.</doc>
|
||||
</list-all>
|
||||
<download>
|
||||
<summary>Download Package</summary>
|
||||
<function>doDownload</function>
|
||||
<shortcut>d</shortcut>
|
||||
<options>
|
||||
<nocompress>
|
||||
<shortopt>Z</shortopt>
|
||||
<doc>download an uncompressed (.tar) file</doc>
|
||||
</nocompress>
|
||||
</options>
|
||||
<doc><package>...
|
||||
Download package tarballs. The files will be named as suggested by the
|
||||
server, for example if you download the DB package and the latest stable
|
||||
version of DB is 1.6.5, the downloaded file will be DB-1.6.5.tgz.</doc>
|
||||
</download>
|
||||
<clear-cache>
|
||||
<summary>Clear Web Services Cache</summary>
|
||||
<function>doClearCache</function>
|
||||
<shortcut>cc</shortcut>
|
||||
<options />
|
||||
<doc>
|
||||
Clear the XML-RPC/REST cache. See also the cache_ttl configuration
|
||||
parameter.
|
||||
</doc>
|
||||
</clear-cache>
|
||||
</commands>
|
||||
Vendored
+337
@@ -0,0 +1,337 @@
|
||||
<?php
|
||||
/**
|
||||
* PEAR_Command_Test (run-tests)
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Stig Bakken <ssb@php.net>
|
||||
* @author Martin Jansen <mj@php.net>
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version CVS: $Id: Test.php 313023 2011-07-06 19:17:11Z dufuz $
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since File available since Release 0.1
|
||||
*/
|
||||
|
||||
/**
|
||||
* base class
|
||||
*/
|
||||
require_once 'PEAR/Command/Common.php';
|
||||
|
||||
/**
|
||||
* PEAR commands for login/logout
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Stig Bakken <ssb@php.net>
|
||||
* @author Martin Jansen <mj@php.net>
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version Release: 1.9.4
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since Class available since Release 0.1
|
||||
*/
|
||||
|
||||
class PEAR_Command_Test extends PEAR_Command_Common
|
||||
{
|
||||
var $commands = array(
|
||||
'run-tests' => array(
|
||||
'summary' => 'Run Regression Tests',
|
||||
'function' => 'doRunTests',
|
||||
'shortcut' => 'rt',
|
||||
'options' => array(
|
||||
'recur' => array(
|
||||
'shortopt' => 'r',
|
||||
'doc' => 'Run tests in child directories, recursively. 4 dirs deep maximum',
|
||||
),
|
||||
'ini' => array(
|
||||
'shortopt' => 'i',
|
||||
'doc' => 'actual string of settings to pass to php in format " -d setting=blah"',
|
||||
'arg' => 'SETTINGS'
|
||||
),
|
||||
'realtimelog' => array(
|
||||
'shortopt' => 'l',
|
||||
'doc' => 'Log test runs/results as they are run',
|
||||
),
|
||||
'quiet' => array(
|
||||
'shortopt' => 'q',
|
||||
'doc' => 'Only display detail for failed tests',
|
||||
),
|
||||
'simple' => array(
|
||||
'shortopt' => 's',
|
||||
'doc' => 'Display simple output for all tests',
|
||||
),
|
||||
'package' => array(
|
||||
'shortopt' => 'p',
|
||||
'doc' => 'Treat parameters as installed packages from which to run tests',
|
||||
),
|
||||
'phpunit' => array(
|
||||
'shortopt' => 'u',
|
||||
'doc' => 'Search parameters for AllTests.php, and use that to run phpunit-based tests
|
||||
If none is found, all .phpt tests will be tried instead.',
|
||||
),
|
||||
'tapoutput' => array(
|
||||
'shortopt' => 't',
|
||||
'doc' => 'Output run-tests.log in TAP-compliant format',
|
||||
),
|
||||
'cgi' => array(
|
||||
'shortopt' => 'c',
|
||||
'doc' => 'CGI php executable (needed for tests with POST/GET section)',
|
||||
'arg' => 'PHPCGI',
|
||||
),
|
||||
'coverage' => array(
|
||||
'shortopt' => 'x',
|
||||
'doc' => 'Generate a code coverage report (requires Xdebug 2.0.0+)',
|
||||
),
|
||||
),
|
||||
'doc' => '[testfile|dir ...]
|
||||
Run regression tests with PHP\'s regression testing script (run-tests.php).',
|
||||
),
|
||||
);
|
||||
|
||||
var $output;
|
||||
|
||||
/**
|
||||
* PEAR_Command_Test constructor.
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PEAR_Command_Test(&$ui, &$config)
|
||||
{
|
||||
parent::PEAR_Command_Common($ui, $config);
|
||||
}
|
||||
|
||||
function doRunTests($command, $options, $params)
|
||||
{
|
||||
if (isset($options['phpunit']) && isset($options['tapoutput'])) {
|
||||
return $this->raiseError('ERROR: cannot use both --phpunit and --tapoutput at the same time');
|
||||
}
|
||||
|
||||
require_once 'PEAR/Common.php';
|
||||
require_once 'System.php';
|
||||
$log = new PEAR_Common;
|
||||
$log->ui = &$this->ui; // slightly hacky, but it will work
|
||||
$tests = array();
|
||||
$depth = isset($options['recur']) ? 14 : 1;
|
||||
|
||||
if (!count($params)) {
|
||||
$params[] = '.';
|
||||
}
|
||||
|
||||
if (isset($options['package'])) {
|
||||
$oldparams = $params;
|
||||
$params = array();
|
||||
$reg = &$this->config->getRegistry();
|
||||
foreach ($oldparams as $param) {
|
||||
$pname = $reg->parsePackageName($param, $this->config->get('default_channel'));
|
||||
if (PEAR::isError($pname)) {
|
||||
return $this->raiseError($pname);
|
||||
}
|
||||
|
||||
$package = &$reg->getPackage($pname['package'], $pname['channel']);
|
||||
if (!$package) {
|
||||
return PEAR::raiseError('Unknown package "' .
|
||||
$reg->parsedPackageNameToString($pname) . '"');
|
||||
}
|
||||
|
||||
$filelist = $package->getFilelist();
|
||||
foreach ($filelist as $name => $atts) {
|
||||
if (isset($atts['role']) && $atts['role'] != 'test') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (isset($options['phpunit']) && preg_match('/AllTests\.php\\z/i', $name)) {
|
||||
$params[] = $atts['installed_as'];
|
||||
continue;
|
||||
} elseif (!preg_match('/\.phpt\\z/', $name)) {
|
||||
continue;
|
||||
}
|
||||
$params[] = $atts['installed_as'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($params as $p) {
|
||||
if (is_dir($p)) {
|
||||
if (isset($options['phpunit'])) {
|
||||
$dir = System::find(array($p, '-type', 'f',
|
||||
'-maxdepth', $depth,
|
||||
'-name', 'AllTests.php'));
|
||||
if (count($dir)) {
|
||||
foreach ($dir as $p) {
|
||||
$p = realpath($p);
|
||||
if (!count($tests) ||
|
||||
(count($tests) && strlen($p) < strlen($tests[0]))) {
|
||||
// this is in a higher-level directory, use this one instead.
|
||||
$tests = array($p);
|
||||
}
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
$args = array($p, '-type', 'f', '-name', '*.phpt');
|
||||
} else {
|
||||
if (isset($options['phpunit'])) {
|
||||
if (preg_match('/AllTests\.php\\z/i', $p)) {
|
||||
$p = realpath($p);
|
||||
if (!count($tests) ||
|
||||
(count($tests) && strlen($p) < strlen($tests[0]))) {
|
||||
// this is in a higher-level directory, use this one instead.
|
||||
$tests = array($p);
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (file_exists($p) && preg_match('/\.phpt$/', $p)) {
|
||||
$tests[] = $p;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!preg_match('/\.phpt\\z/', $p)) {
|
||||
$p .= '.phpt';
|
||||
}
|
||||
|
||||
$args = array(dirname($p), '-type', 'f', '-name', $p);
|
||||
}
|
||||
|
||||
if (!isset($options['recur'])) {
|
||||
$args[] = '-maxdepth';
|
||||
$args[] = 1;
|
||||
}
|
||||
|
||||
$dir = System::find($args);
|
||||
$tests = array_merge($tests, $dir);
|
||||
}
|
||||
|
||||
$ini_settings = '';
|
||||
if (isset($options['ini'])) {
|
||||
$ini_settings .= $options['ini'];
|
||||
}
|
||||
|
||||
if (isset($_ENV['TEST_PHP_INCLUDE_PATH'])) {
|
||||
$ini_settings .= " -d include_path={$_ENV['TEST_PHP_INCLUDE_PATH']}";
|
||||
}
|
||||
|
||||
if ($ini_settings) {
|
||||
$this->ui->outputData('Using INI settings: "' . $ini_settings . '"');
|
||||
}
|
||||
|
||||
$skipped = $passed = $failed = array();
|
||||
$tests_count = count($tests);
|
||||
$this->ui->outputData('Running ' . $tests_count . ' tests', $command);
|
||||
$start = time();
|
||||
if (isset($options['realtimelog']) && file_exists('run-tests.log')) {
|
||||
unlink('run-tests.log');
|
||||
}
|
||||
|
||||
if (isset($options['tapoutput'])) {
|
||||
$tap = '1..' . $tests_count . "\n";
|
||||
}
|
||||
|
||||
require_once 'PEAR/RunTest.php';
|
||||
$run = new PEAR_RunTest($log, $options);
|
||||
$run->tests_count = $tests_count;
|
||||
|
||||
if (isset($options['coverage']) && extension_loaded('xdebug')){
|
||||
$run->xdebug_loaded = true;
|
||||
} else {
|
||||
$run->xdebug_loaded = false;
|
||||
}
|
||||
|
||||
$j = $i = 1;
|
||||
foreach ($tests as $t) {
|
||||
if (isset($options['realtimelog'])) {
|
||||
$fp = @fopen('run-tests.log', 'a');
|
||||
if ($fp) {
|
||||
fwrite($fp, "Running test [$i / $tests_count] $t...");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);
|
||||
if (isset($options['phpunit'])) {
|
||||
$result = $run->runPHPUnit($t, $ini_settings);
|
||||
} else {
|
||||
$result = $run->run($t, $ini_settings, $j);
|
||||
}
|
||||
PEAR::staticPopErrorHandling();
|
||||
if (PEAR::isError($result)) {
|
||||
$this->ui->log($result->getMessage());
|
||||
continue;
|
||||
}
|
||||
|
||||
if (isset($options['tapoutput'])) {
|
||||
$tap .= $result[0] . ' ' . $i . $result[1] . "\n";
|
||||
continue;
|
||||
}
|
||||
|
||||
if (isset($options['realtimelog'])) {
|
||||
$fp = @fopen('run-tests.log', 'a');
|
||||
if ($fp) {
|
||||
fwrite($fp, "$result\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
|
||||
if ($result == 'FAILED') {
|
||||
$failed[] = $t;
|
||||
}
|
||||
if ($result == 'PASSED') {
|
||||
$passed[] = $t;
|
||||
}
|
||||
if ($result == 'SKIPPED') {
|
||||
$skipped[] = $t;
|
||||
}
|
||||
|
||||
$j++;
|
||||
}
|
||||
|
||||
$total = date('i:s', time() - $start);
|
||||
if (isset($options['tapoutput'])) {
|
||||
$fp = @fopen('run-tests.log', 'w');
|
||||
if ($fp) {
|
||||
fwrite($fp, $tap, strlen($tap));
|
||||
fclose($fp);
|
||||
$this->ui->outputData('wrote TAP-format log to "' .realpath('run-tests.log') .
|
||||
'"', $command);
|
||||
}
|
||||
} else {
|
||||
if (count($failed)) {
|
||||
$output = "TOTAL TIME: $total\n";
|
||||
$output .= count($passed) . " PASSED TESTS\n";
|
||||
$output .= count($skipped) . " SKIPPED TESTS\n";
|
||||
$output .= count($failed) . " FAILED TESTS:\n";
|
||||
foreach ($failed as $failure) {
|
||||
$output .= $failure . "\n";
|
||||
}
|
||||
|
||||
$mode = isset($options['realtimelog']) ? 'a' : 'w';
|
||||
$fp = @fopen('run-tests.log', $mode);
|
||||
|
||||
if ($fp) {
|
||||
fwrite($fp, $output, strlen($output));
|
||||
fclose($fp);
|
||||
$this->ui->outputData('wrote log to "' . realpath('run-tests.log') . '"', $command);
|
||||
}
|
||||
} elseif (file_exists('run-tests.log') && !is_dir('run-tests.log')) {
|
||||
@unlink('run-tests.log');
|
||||
}
|
||||
}
|
||||
$this->ui->outputData('TOTAL TIME: ' . $total);
|
||||
$this->ui->outputData(count($passed) . ' PASSED TESTS', $command);
|
||||
$this->ui->outputData(count($skipped) . ' SKIPPED TESTS', $command);
|
||||
if (count($failed)) {
|
||||
$this->ui->outputData(count($failed) . ' FAILED TESTS:', $command);
|
||||
foreach ($failed as $failure) {
|
||||
$this->ui->outputData($failure, $command);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Vendored
+54
@@ -0,0 +1,54 @@
|
||||
<commands version="1.0">
|
||||
<run-tests>
|
||||
<summary>Run Regression Tests</summary>
|
||||
<function>doRunTests</function>
|
||||
<shortcut>rt</shortcut>
|
||||
<options>
|
||||
<recur>
|
||||
<shortopt>r</shortopt>
|
||||
<doc>Run tests in child directories, recursively. 4 dirs deep maximum</doc>
|
||||
</recur>
|
||||
<ini>
|
||||
<shortopt>i</shortopt>
|
||||
<doc>actual string of settings to pass to php in format " -d setting=blah"</doc>
|
||||
<arg>SETTINGS</arg>
|
||||
</ini>
|
||||
<realtimelog>
|
||||
<shortopt>l</shortopt>
|
||||
<doc>Log test runs/results as they are run</doc>
|
||||
</realtimelog>
|
||||
<quiet>
|
||||
<shortopt>q</shortopt>
|
||||
<doc>Only display detail for failed tests</doc>
|
||||
</quiet>
|
||||
<simple>
|
||||
<shortopt>s</shortopt>
|
||||
<doc>Display simple output for all tests</doc>
|
||||
</simple>
|
||||
<package>
|
||||
<shortopt>p</shortopt>
|
||||
<doc>Treat parameters as installed packages from which to run tests</doc>
|
||||
</package>
|
||||
<phpunit>
|
||||
<shortopt>u</shortopt>
|
||||
<doc>Search parameters for AllTests.php, and use that to run phpunit-based tests
|
||||
If none is found, all .phpt tests will be tried instead.</doc>
|
||||
</phpunit>
|
||||
<tapoutput>
|
||||
<shortopt>t</shortopt>
|
||||
<doc>Output run-tests.log in TAP-compliant format</doc>
|
||||
</tapoutput>
|
||||
<cgi>
|
||||
<shortopt>c</shortopt>
|
||||
<doc>CGI php executable (needed for tests with POST/GET section)</doc>
|
||||
<arg>PHPCGI</arg>
|
||||
</cgi>
|
||||
<coverage>
|
||||
<shortopt>x</shortopt>
|
||||
<doc>Generate a code coverage report (requires Xdebug 2.0.0+)</doc>
|
||||
</coverage>
|
||||
</options>
|
||||
<doc>[testfile|dir ...]
|
||||
Run regression tests with PHP's regression testing script (run-tests.php).</doc>
|
||||
</run-tests>
|
||||
</commands>
|
||||
Vendored
+837
@@ -0,0 +1,837 @@
|
||||
<?php
|
||||
/**
|
||||
* PEAR_Common, the base class for the PEAR Installer
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Stig Bakken <ssb@php.net>
|
||||
* @author Tomas V. V. Cox <cox@idecnet.com>
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version CVS: $Id: Common.php 313023 2011-07-06 19:17:11Z dufuz $
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since File available since Release 0.1.0
|
||||
* @deprecated File deprecated since Release 1.4.0a1
|
||||
*/
|
||||
|
||||
/**
|
||||
* Include error handling
|
||||
*/
|
||||
require_once 'PEAR.php';
|
||||
|
||||
/**
|
||||
* PEAR_Common error when an invalid PHP file is passed to PEAR_Common::analyzeSourceCode()
|
||||
*/
|
||||
define('PEAR_COMMON_ERROR_INVALIDPHP', 1);
|
||||
define('_PEAR_COMMON_PACKAGE_NAME_PREG', '[A-Za-z][a-zA-Z0-9_]+');
|
||||
define('PEAR_COMMON_PACKAGE_NAME_PREG', '/^' . _PEAR_COMMON_PACKAGE_NAME_PREG . '\\z/');
|
||||
|
||||
// this should allow: 1, 1.0, 1.0RC1, 1.0dev, 1.0dev123234234234, 1.0a1, 1.0b1, 1.0pl1
|
||||
define('_PEAR_COMMON_PACKAGE_VERSION_PREG', '\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?');
|
||||
define('PEAR_COMMON_PACKAGE_VERSION_PREG', '/^' . _PEAR_COMMON_PACKAGE_VERSION_PREG . '\\z/i');
|
||||
|
||||
// XXX far from perfect :-)
|
||||
define('_PEAR_COMMON_PACKAGE_DOWNLOAD_PREG', '(' . _PEAR_COMMON_PACKAGE_NAME_PREG .
|
||||
')(-([.0-9a-zA-Z]+))?');
|
||||
define('PEAR_COMMON_PACKAGE_DOWNLOAD_PREG', '/^' . _PEAR_COMMON_PACKAGE_DOWNLOAD_PREG .
|
||||
'\\z/');
|
||||
|
||||
define('_PEAR_CHANNELS_NAME_PREG', '[A-Za-z][a-zA-Z0-9\.]+');
|
||||
define('PEAR_CHANNELS_NAME_PREG', '/^' . _PEAR_CHANNELS_NAME_PREG . '\\z/');
|
||||
|
||||
// this should allow any dns or IP address, plus a path - NO UNDERSCORES ALLOWED
|
||||
define('_PEAR_CHANNELS_SERVER_PREG', '[a-zA-Z0-9\-]+(?:\.[a-zA-Z0-9\-]+)*(\/[a-zA-Z0-9\-]+)*');
|
||||
define('PEAR_CHANNELS_SERVER_PREG', '/^' . _PEAR_CHANNELS_SERVER_PREG . '\\z/i');
|
||||
|
||||
define('_PEAR_CHANNELS_PACKAGE_PREG', '(' ._PEAR_CHANNELS_SERVER_PREG . ')\/('
|
||||
. _PEAR_COMMON_PACKAGE_NAME_PREG . ')');
|
||||
define('PEAR_CHANNELS_PACKAGE_PREG', '/^' . _PEAR_CHANNELS_PACKAGE_PREG . '\\z/i');
|
||||
|
||||
define('_PEAR_COMMON_CHANNEL_DOWNLOAD_PREG', '(' . _PEAR_CHANNELS_NAME_PREG . ')::('
|
||||
. _PEAR_COMMON_PACKAGE_NAME_PREG . ')(-([.0-9a-zA-Z]+))?');
|
||||
define('PEAR_COMMON_CHANNEL_DOWNLOAD_PREG', '/^' . _PEAR_COMMON_CHANNEL_DOWNLOAD_PREG . '\\z/');
|
||||
|
||||
/**
|
||||
* List of temporary files and directories registered by
|
||||
* PEAR_Common::addTempFile().
|
||||
* @var array
|
||||
*/
|
||||
$GLOBALS['_PEAR_Common_tempfiles'] = array();
|
||||
|
||||
/**
|
||||
* Valid maintainer roles
|
||||
* @var array
|
||||
*/
|
||||
$GLOBALS['_PEAR_Common_maintainer_roles'] = array('lead','developer','contributor','helper');
|
||||
|
||||
/**
|
||||
* Valid release states
|
||||
* @var array
|
||||
*/
|
||||
$GLOBALS['_PEAR_Common_release_states'] = array('alpha','beta','stable','snapshot','devel');
|
||||
|
||||
/**
|
||||
* Valid dependency types
|
||||
* @var array
|
||||
*/
|
||||
$GLOBALS['_PEAR_Common_dependency_types'] = array('pkg','ext','php','prog','ldlib','rtlib','os','websrv','sapi');
|
||||
|
||||
/**
|
||||
* Valid dependency relations
|
||||
* @var array
|
||||
*/
|
||||
$GLOBALS['_PEAR_Common_dependency_relations'] = array('has','eq','lt','le','gt','ge','not', 'ne');
|
||||
|
||||
/**
|
||||
* Valid file roles
|
||||
* @var array
|
||||
*/
|
||||
$GLOBALS['_PEAR_Common_file_roles'] = array('php','ext','test','doc','data','src','script');
|
||||
|
||||
/**
|
||||
* Valid replacement types
|
||||
* @var array
|
||||
*/
|
||||
$GLOBALS['_PEAR_Common_replacement_types'] = array('php-const', 'pear-config', 'package-info');
|
||||
|
||||
/**
|
||||
* Valid "provide" types
|
||||
* @var array
|
||||
*/
|
||||
$GLOBALS['_PEAR_Common_provide_types'] = array('ext', 'prog', 'class', 'function', 'feature', 'api');
|
||||
|
||||
/**
|
||||
* Valid "provide" types
|
||||
* @var array
|
||||
*/
|
||||
$GLOBALS['_PEAR_Common_script_phases'] = array('pre-install', 'post-install', 'pre-uninstall', 'post-uninstall', 'pre-build', 'post-build', 'pre-configure', 'post-configure', 'pre-setup', 'post-setup');
|
||||
|
||||
/**
|
||||
* Class providing common functionality for PEAR administration classes.
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Stig Bakken <ssb@php.net>
|
||||
* @author Tomas V. V. Cox <cox@idecnet.com>
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version Release: 1.9.4
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since Class available since Release 1.4.0a1
|
||||
* @deprecated This class will disappear, and its components will be spread
|
||||
* into smaller classes, like the AT&T breakup, as of Release 1.4.0a1
|
||||
*/
|
||||
class PEAR_Common extends PEAR
|
||||
{
|
||||
/**
|
||||
* User Interface object (PEAR_Frontend_* class). If null,
|
||||
* the log() method uses print.
|
||||
* @var object
|
||||
*/
|
||||
var $ui = null;
|
||||
|
||||
/**
|
||||
* Configuration object (PEAR_Config).
|
||||
* @var PEAR_Config
|
||||
*/
|
||||
var $config = null;
|
||||
|
||||
/** stack of elements, gives some sort of XML context */
|
||||
var $element_stack = array();
|
||||
|
||||
/** name of currently parsed XML element */
|
||||
var $current_element;
|
||||
|
||||
/** array of attributes of the currently parsed XML element */
|
||||
var $current_attributes = array();
|
||||
|
||||
/** assoc with information about a package */
|
||||
var $pkginfo = array();
|
||||
|
||||
var $current_path = null;
|
||||
|
||||
/**
|
||||
* Flag variable used to mark a valid package file
|
||||
* @var boolean
|
||||
* @access private
|
||||
*/
|
||||
var $_validPackageFile;
|
||||
|
||||
/**
|
||||
* PEAR_Common constructor
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PEAR_Common()
|
||||
{
|
||||
parent::PEAR();
|
||||
$this->config = PEAR_Config::singleton();
|
||||
$this->debug = $this->config->get('verbose');
|
||||
}
|
||||
|
||||
/**
|
||||
* PEAR_Common destructor
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
function _PEAR_Common()
|
||||
{
|
||||
// doesn't work due to bug #14744
|
||||
//$tempfiles = $this->_tempfiles;
|
||||
$tempfiles =& $GLOBALS['_PEAR_Common_tempfiles'];
|
||||
while ($file = array_shift($tempfiles)) {
|
||||
if (@is_dir($file)) {
|
||||
if (!class_exists('System')) {
|
||||
require_once 'System.php';
|
||||
}
|
||||
|
||||
System::rm(array('-rf', $file));
|
||||
} elseif (file_exists($file)) {
|
||||
unlink($file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a temporary file or directory. When the destructor is
|
||||
* executed, all registered temporary files and directories are
|
||||
* removed.
|
||||
*
|
||||
* @param string $file name of file or directory
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function addTempFile($file)
|
||||
{
|
||||
if (!class_exists('PEAR_Frontend')) {
|
||||
require_once 'PEAR/Frontend.php';
|
||||
}
|
||||
PEAR_Frontend::addTempFile($file);
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper to System::mkDir(), creates a directory as well as
|
||||
* any necessary parent directories.
|
||||
*
|
||||
* @param string $dir directory name
|
||||
*
|
||||
* @return bool TRUE on success, or a PEAR error
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function mkDirHier($dir)
|
||||
{
|
||||
// Only used in Installer - move it there ?
|
||||
$this->log(2, "+ create dir $dir");
|
||||
if (!class_exists('System')) {
|
||||
require_once 'System.php';
|
||||
}
|
||||
return System::mkDir(array('-p', $dir));
|
||||
}
|
||||
|
||||
/**
|
||||
* Logging method.
|
||||
*
|
||||
* @param int $level log level (0 is quiet, higher is noisier)
|
||||
* @param string $msg message to write to the log
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @access public
|
||||
* @static
|
||||
*/
|
||||
function log($level, $msg, $append_crlf = true)
|
||||
{
|
||||
if ($this->debug >= $level) {
|
||||
if (!class_exists('PEAR_Frontend')) {
|
||||
require_once 'PEAR/Frontend.php';
|
||||
}
|
||||
|
||||
$ui = &PEAR_Frontend::singleton();
|
||||
if (is_a($ui, 'PEAR_Frontend')) {
|
||||
$ui->log($msg, $append_crlf);
|
||||
} else {
|
||||
print "$msg\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create and register a temporary directory.
|
||||
*
|
||||
* @param string $tmpdir (optional) Directory to use as tmpdir.
|
||||
* Will use system defaults (for example
|
||||
* /tmp or c:\windows\temp) if not specified
|
||||
*
|
||||
* @return string name of created directory
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function mkTempDir($tmpdir = '')
|
||||
{
|
||||
$topt = $tmpdir ? array('-t', $tmpdir) : array();
|
||||
$topt = array_merge($topt, array('-d', 'pear'));
|
||||
if (!class_exists('System')) {
|
||||
require_once 'System.php';
|
||||
}
|
||||
|
||||
if (!$tmpdir = System::mktemp($topt)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->addTempFile($tmpdir);
|
||||
return $tmpdir;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set object that represents the frontend to be used.
|
||||
*
|
||||
* @param object Reference of the frontend object
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function setFrontendObject(&$ui)
|
||||
{
|
||||
$this->ui = &$ui;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an array containing all of the states that are more stable than
|
||||
* or equal to the passed in state
|
||||
*
|
||||
* @param string Release state
|
||||
* @param boolean Determines whether to include $state in the list
|
||||
* @return false|array False if $state is not a valid release state
|
||||
*/
|
||||
function betterStates($state, $include = false)
|
||||
{
|
||||
static $states = array('snapshot', 'devel', 'alpha', 'beta', 'stable');
|
||||
$i = array_search($state, $states);
|
||||
if ($i === false) {
|
||||
return false;
|
||||
}
|
||||
if ($include) {
|
||||
$i--;
|
||||
}
|
||||
return array_slice($states, $i + 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the valid roles for a PEAR package maintainer
|
||||
*
|
||||
* @return array
|
||||
* @static
|
||||
*/
|
||||
function getUserRoles()
|
||||
{
|
||||
return $GLOBALS['_PEAR_Common_maintainer_roles'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the valid package release states of packages
|
||||
*
|
||||
* @return array
|
||||
* @static
|
||||
*/
|
||||
function getReleaseStates()
|
||||
{
|
||||
return $GLOBALS['_PEAR_Common_release_states'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the implemented dependency types (php, ext, pkg etc.)
|
||||
*
|
||||
* @return array
|
||||
* @static
|
||||
*/
|
||||
function getDependencyTypes()
|
||||
{
|
||||
return $GLOBALS['_PEAR_Common_dependency_types'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the implemented dependency relations (has, lt, ge etc.)
|
||||
*
|
||||
* @return array
|
||||
* @static
|
||||
*/
|
||||
function getDependencyRelations()
|
||||
{
|
||||
return $GLOBALS['_PEAR_Common_dependency_relations'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the implemented file roles
|
||||
*
|
||||
* @return array
|
||||
* @static
|
||||
*/
|
||||
function getFileRoles()
|
||||
{
|
||||
return $GLOBALS['_PEAR_Common_file_roles'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the implemented file replacement types in
|
||||
*
|
||||
* @return array
|
||||
* @static
|
||||
*/
|
||||
function getReplacementTypes()
|
||||
{
|
||||
return $GLOBALS['_PEAR_Common_replacement_types'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the implemented file replacement types in
|
||||
*
|
||||
* @return array
|
||||
* @static
|
||||
*/
|
||||
function getProvideTypes()
|
||||
{
|
||||
return $GLOBALS['_PEAR_Common_provide_types'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the implemented file replacement types in
|
||||
*
|
||||
* @return array
|
||||
* @static
|
||||
*/
|
||||
function getScriptPhases()
|
||||
{
|
||||
return $GLOBALS['_PEAR_Common_script_phases'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Test whether a string contains a valid package name.
|
||||
*
|
||||
* @param string $name the package name to test
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function validPackageName($name)
|
||||
{
|
||||
return (bool)preg_match(PEAR_COMMON_PACKAGE_NAME_PREG, $name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test whether a string contains a valid package version.
|
||||
*
|
||||
* @param string $ver the package version to test
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function validPackageVersion($ver)
|
||||
{
|
||||
return (bool)preg_match(PEAR_COMMON_PACKAGE_VERSION_PREG, $ver);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $path relative or absolute include path
|
||||
* @return boolean
|
||||
* @static
|
||||
*/
|
||||
function isIncludeable($path)
|
||||
{
|
||||
if (file_exists($path) && is_readable($path)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$ipath = explode(PATH_SEPARATOR, ini_get('include_path'));
|
||||
foreach ($ipath as $include) {
|
||||
$test = realpath($include . DIRECTORY_SEPARATOR . $path);
|
||||
if (file_exists($test) && is_readable($test)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function _postProcessChecks($pf)
|
||||
{
|
||||
if (!PEAR::isError($pf)) {
|
||||
return $this->_postProcessValidPackagexml($pf);
|
||||
}
|
||||
|
||||
$errs = $pf->getUserinfo();
|
||||
if (is_array($errs)) {
|
||||
foreach ($errs as $error) {
|
||||
$e = $this->raiseError($error['message'], $error['code'], null, null, $error);
|
||||
}
|
||||
}
|
||||
|
||||
return $pf;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns information about a package file. Expects the name of
|
||||
* a gzipped tar file as input.
|
||||
*
|
||||
* @param string $file name of .tgz file
|
||||
*
|
||||
* @return array array with package information
|
||||
*
|
||||
* @access public
|
||||
* @deprecated use PEAR_PackageFile->fromTgzFile() instead
|
||||
*
|
||||
*/
|
||||
function infoFromTgzFile($file)
|
||||
{
|
||||
$packagefile = &new PEAR_PackageFile($this->config);
|
||||
$pf = &$packagefile->fromTgzFile($file, PEAR_VALIDATE_NORMAL);
|
||||
return $this->_postProcessChecks($pf);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns information about a package file. Expects the name of
|
||||
* a package xml file as input.
|
||||
*
|
||||
* @param string $descfile name of package xml file
|
||||
*
|
||||
* @return array array with package information
|
||||
*
|
||||
* @access public
|
||||
* @deprecated use PEAR_PackageFile->fromPackageFile() instead
|
||||
*
|
||||
*/
|
||||
function infoFromDescriptionFile($descfile)
|
||||
{
|
||||
$packagefile = &new PEAR_PackageFile($this->config);
|
||||
$pf = &$packagefile->fromPackageFile($descfile, PEAR_VALIDATE_NORMAL);
|
||||
return $this->_postProcessChecks($pf);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns information about a package file. Expects the contents
|
||||
* of a package xml file as input.
|
||||
*
|
||||
* @param string $data contents of package.xml file
|
||||
*
|
||||
* @return array array with package information
|
||||
*
|
||||
* @access public
|
||||
* @deprecated use PEAR_PackageFile->fromXmlstring() instead
|
||||
*
|
||||
*/
|
||||
function infoFromString($data)
|
||||
{
|
||||
$packagefile = &new PEAR_PackageFile($this->config);
|
||||
$pf = &$packagefile->fromXmlString($data, PEAR_VALIDATE_NORMAL, false);
|
||||
return $this->_postProcessChecks($pf);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param PEAR_PackageFile_v1|PEAR_PackageFile_v2
|
||||
* @return array
|
||||
*/
|
||||
function _postProcessValidPackagexml(&$pf)
|
||||
{
|
||||
if (!is_a($pf, 'PEAR_PackageFile_v2')) {
|
||||
$this->pkginfo = $pf->toArray();
|
||||
return $this->pkginfo;
|
||||
}
|
||||
|
||||
// sort of make this into a package.xml 1.0-style array
|
||||
// changelog is not converted to old format.
|
||||
$arr = $pf->toArray(true);
|
||||
$arr = array_merge($arr, $arr['old']);
|
||||
unset($arr['old'], $arr['xsdversion'], $arr['contents'], $arr['compatible'],
|
||||
$arr['channel'], $arr['uri'], $arr['dependencies'], $arr['phprelease'],
|
||||
$arr['extsrcrelease'], $arr['zendextsrcrelease'], $arr['extbinrelease'],
|
||||
$arr['zendextbinrelease'], $arr['bundle'], $arr['lead'], $arr['developer'],
|
||||
$arr['helper'], $arr['contributor']);
|
||||
$arr['filelist'] = $pf->getFilelist();
|
||||
$this->pkginfo = $arr;
|
||||
return $arr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns package information from different sources
|
||||
*
|
||||
* This method is able to extract information about a package
|
||||
* from a .tgz archive or from a XML package definition file.
|
||||
*
|
||||
* @access public
|
||||
* @param string Filename of the source ('package.xml', '<package>.tgz')
|
||||
* @return string
|
||||
* @deprecated use PEAR_PackageFile->fromAnyFile() instead
|
||||
*/
|
||||
function infoFromAny($info)
|
||||
{
|
||||
if (is_string($info) && file_exists($info)) {
|
||||
$packagefile = &new PEAR_PackageFile($this->config);
|
||||
$pf = &$packagefile->fromAnyFile($info, PEAR_VALIDATE_NORMAL);
|
||||
if (PEAR::isError($pf)) {
|
||||
$errs = $pf->getUserinfo();
|
||||
if (is_array($errs)) {
|
||||
foreach ($errs as $error) {
|
||||
$e = $this->raiseError($error['message'], $error['code'], null, null, $error);
|
||||
}
|
||||
}
|
||||
|
||||
return $pf;
|
||||
}
|
||||
|
||||
return $this->_postProcessValidPackagexml($pf);
|
||||
}
|
||||
|
||||
return $info;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an XML document based on the package info (as returned
|
||||
* by the PEAR_Common::infoFrom* methods).
|
||||
*
|
||||
* @param array $pkginfo package info
|
||||
*
|
||||
* @return string XML data
|
||||
*
|
||||
* @access public
|
||||
* @deprecated use a PEAR_PackageFile_v* object's generator instead
|
||||
*/
|
||||
function xmlFromInfo($pkginfo)
|
||||
{
|
||||
$config = &PEAR_Config::singleton();
|
||||
$packagefile = &new PEAR_PackageFile($config);
|
||||
$pf = &$packagefile->fromArray($pkginfo);
|
||||
$gen = &$pf->getDefaultGenerator();
|
||||
return $gen->toXml(PEAR_VALIDATE_PACKAGING);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate XML package definition file.
|
||||
*
|
||||
* @param string $info Filename of the package archive or of the
|
||||
* package definition file
|
||||
* @param array $errors Array that will contain the errors
|
||||
* @param array $warnings Array that will contain the warnings
|
||||
* @param string $dir_prefix (optional) directory where source files
|
||||
* may be found, or empty if they are not available
|
||||
* @access public
|
||||
* @return boolean
|
||||
* @deprecated use the validation of PEAR_PackageFile objects
|
||||
*/
|
||||
function validatePackageInfo($info, &$errors, &$warnings, $dir_prefix = '')
|
||||
{
|
||||
$config = &PEAR_Config::singleton();
|
||||
$packagefile = &new PEAR_PackageFile($config);
|
||||
PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);
|
||||
if (strpos($info, '<?xml') !== false) {
|
||||
$pf = &$packagefile->fromXmlString($info, PEAR_VALIDATE_NORMAL, '');
|
||||
} else {
|
||||
$pf = &$packagefile->fromAnyFile($info, PEAR_VALIDATE_NORMAL);
|
||||
}
|
||||
|
||||
PEAR::staticPopErrorHandling();
|
||||
if (PEAR::isError($pf)) {
|
||||
$errs = $pf->getUserinfo();
|
||||
if (is_array($errs)) {
|
||||
foreach ($errs as $error) {
|
||||
if ($error['level'] == 'error') {
|
||||
$errors[] = $error['message'];
|
||||
} else {
|
||||
$warnings[] = $error['message'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a "provides" array from data returned by
|
||||
* analyzeSourceCode(). The format of the built array is like
|
||||
* this:
|
||||
*
|
||||
* array(
|
||||
* 'class;MyClass' => 'array('type' => 'class', 'name' => 'MyClass'),
|
||||
* ...
|
||||
* )
|
||||
*
|
||||
*
|
||||
* @param array $srcinfo array with information about a source file
|
||||
* as returned by the analyzeSourceCode() method.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
*/
|
||||
function buildProvidesArray($srcinfo)
|
||||
{
|
||||
$file = basename($srcinfo['source_file']);
|
||||
$pn = '';
|
||||
if (isset($this->_packageName)) {
|
||||
$pn = $this->_packageName;
|
||||
}
|
||||
|
||||
$pnl = strlen($pn);
|
||||
foreach ($srcinfo['declared_classes'] as $class) {
|
||||
$key = "class;$class";
|
||||
if (isset($this->pkginfo['provides'][$key])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->pkginfo['provides'][$key] =
|
||||
array('file'=> $file, 'type' => 'class', 'name' => $class);
|
||||
if (isset($srcinfo['inheritance'][$class])) {
|
||||
$this->pkginfo['provides'][$key]['extends'] =
|
||||
$srcinfo['inheritance'][$class];
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($srcinfo['declared_methods'] as $class => $methods) {
|
||||
foreach ($methods as $method) {
|
||||
$function = "$class::$method";
|
||||
$key = "function;$function";
|
||||
if ($method{0} == '_' || !strcasecmp($method, $class) ||
|
||||
isset($this->pkginfo['provides'][$key])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->pkginfo['provides'][$key] =
|
||||
array('file'=> $file, 'type' => 'function', 'name' => $function);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($srcinfo['declared_functions'] as $function) {
|
||||
$key = "function;$function";
|
||||
if ($function{0} == '_' || isset($this->pkginfo['provides'][$key])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!strstr($function, '::') && strncasecmp($function, $pn, $pnl)) {
|
||||
$warnings[] = "in1 " . $file . ": function \"$function\" not prefixed with package name \"$pn\"";
|
||||
}
|
||||
|
||||
$this->pkginfo['provides'][$key] =
|
||||
array('file'=> $file, 'type' => 'function', 'name' => $function);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Analyze the source code of the given PHP file
|
||||
*
|
||||
* @param string Filename of the PHP file
|
||||
* @return mixed
|
||||
* @access public
|
||||
*/
|
||||
function analyzeSourceCode($file)
|
||||
{
|
||||
if (!class_exists('PEAR_PackageFile_v2_Validator')) {
|
||||
require_once 'PEAR/PackageFile/v2/Validator.php';
|
||||
}
|
||||
|
||||
$a = new PEAR_PackageFile_v2_Validator;
|
||||
return $a->analyzeSourceCode($file);
|
||||
}
|
||||
|
||||
function detectDependencies($any, $status_callback = null)
|
||||
{
|
||||
if (!function_exists("token_get_all")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (PEAR::isError($info = $this->infoFromAny($any))) {
|
||||
return $this->raiseError($info);
|
||||
}
|
||||
|
||||
if (!is_array($info)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$deps = array();
|
||||
$used_c = $decl_c = $decl_f = $decl_m = array();
|
||||
foreach ($info['filelist'] as $file => $fa) {
|
||||
$tmp = $this->analyzeSourceCode($file);
|
||||
$used_c = @array_merge($used_c, $tmp['used_classes']);
|
||||
$decl_c = @array_merge($decl_c, $tmp['declared_classes']);
|
||||
$decl_f = @array_merge($decl_f, $tmp['declared_functions']);
|
||||
$decl_m = @array_merge($decl_m, $tmp['declared_methods']);
|
||||
$inheri = @array_merge($inheri, $tmp['inheritance']);
|
||||
}
|
||||
|
||||
$used_c = array_unique($used_c);
|
||||
$decl_c = array_unique($decl_c);
|
||||
$undecl_c = array_diff($used_c, $decl_c);
|
||||
|
||||
return array('used_classes' => $used_c,
|
||||
'declared_classes' => $decl_c,
|
||||
'declared_methods' => $decl_m,
|
||||
'declared_functions' => $decl_f,
|
||||
'undeclared_classes' => $undecl_c,
|
||||
'inheritance' => $inheri,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Download a file through HTTP. Considers suggested file name in
|
||||
* Content-disposition: header and can run a callback function for
|
||||
* different events. The callback will be called with two
|
||||
* parameters: the callback type, and parameters. The implemented
|
||||
* callback types are:
|
||||
*
|
||||
* 'setup' called at the very beginning, parameter is a UI object
|
||||
* that should be used for all output
|
||||
* 'message' the parameter is a string with an informational message
|
||||
* 'saveas' may be used to save with a different file name, the
|
||||
* parameter is the filename that is about to be used.
|
||||
* If a 'saveas' callback returns a non-empty string,
|
||||
* that file name will be used as the filename instead.
|
||||
* Note that $save_dir will not be affected by this, only
|
||||
* the basename of the file.
|
||||
* 'start' download is starting, parameter is number of bytes
|
||||
* that are expected, or -1 if unknown
|
||||
* 'bytesread' parameter is the number of bytes read so far
|
||||
* 'done' download is complete, parameter is the total number
|
||||
* of bytes read
|
||||
* 'connfailed' if the TCP connection fails, this callback is called
|
||||
* with array(host,port,errno,errmsg)
|
||||
* 'writefailed' if writing to disk fails, this callback is called
|
||||
* with array(destfile,errmsg)
|
||||
*
|
||||
* If an HTTP proxy has been configured (http_proxy PEAR_Config
|
||||
* setting), the proxy will be used.
|
||||
*
|
||||
* @param string $url the URL to download
|
||||
* @param object $ui PEAR_Frontend_* instance
|
||||
* @param object $config PEAR_Config instance
|
||||
* @param string $save_dir (optional) directory to save file in
|
||||
* @param mixed $callback (optional) function/method to call for status
|
||||
* updates
|
||||
*
|
||||
* @return string Returns the full path of the downloaded file or a PEAR
|
||||
* error on failure. If the error is caused by
|
||||
* socket-related errors, the error object will
|
||||
* have the fsockopen error code available through
|
||||
* getCode().
|
||||
*
|
||||
* @access public
|
||||
* @deprecated in favor of PEAR_Downloader::downloadHttp()
|
||||
*/
|
||||
function downloadHttp($url, &$ui, $save_dir = '.', $callback = null)
|
||||
{
|
||||
if (!class_exists('PEAR_Downloader')) {
|
||||
require_once 'PEAR/Downloader.php';
|
||||
}
|
||||
return PEAR_Downloader::downloadHttp($url, $ui, $save_dir, $callback);
|
||||
}
|
||||
}
|
||||
|
||||
require_once 'PEAR/Config.php';
|
||||
require_once 'PEAR/PackageFile.php';
|
||||
Vendored
+2097
File diff suppressed because it is too large
Load Diff
Vendored
+1358
File diff suppressed because it is too large
Load Diff
Vendored
+769
@@ -0,0 +1,769 @@
|
||||
<?php
|
||||
/**
|
||||
* PEAR_DependencyDB, advanced installed packages dependency database
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Tomas V. V. Cox <cox@idecnet.com>
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version CVS: $Id: DependencyDB.php 313023 2011-07-06 19:17:11Z dufuz $
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since File available since Release 1.4.0a1
|
||||
*/
|
||||
|
||||
/**
|
||||
* Needed for error handling
|
||||
*/
|
||||
require_once 'PEAR.php';
|
||||
require_once 'PEAR/Config.php';
|
||||
|
||||
$GLOBALS['_PEAR_DEPENDENCYDB_INSTANCE'] = array();
|
||||
/**
|
||||
* Track dependency relationships between installed packages
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @author Tomas V.V.Cox <cox@idec.net.com>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version Release: 1.9.4
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since Class available since Release 1.4.0a1
|
||||
*/
|
||||
class PEAR_DependencyDB
|
||||
{
|
||||
// {{{ properties
|
||||
|
||||
/**
|
||||
* This is initialized by {@link setConfig()}
|
||||
* @var PEAR_Config
|
||||
* @access private
|
||||
*/
|
||||
var $_config;
|
||||
/**
|
||||
* This is initialized by {@link setConfig()}
|
||||
* @var PEAR_Registry
|
||||
* @access private
|
||||
*/
|
||||
var $_registry;
|
||||
/**
|
||||
* Filename of the dependency DB (usually .depdb)
|
||||
* @var string
|
||||
* @access private
|
||||
*/
|
||||
var $_depdb = false;
|
||||
/**
|
||||
* File name of the lockfile (usually .depdblock)
|
||||
* @var string
|
||||
* @access private
|
||||
*/
|
||||
var $_lockfile = false;
|
||||
/**
|
||||
* Open file resource for locking the lockfile
|
||||
* @var resource|false
|
||||
* @access private
|
||||
*/
|
||||
var $_lockFp = false;
|
||||
/**
|
||||
* API version of this class, used to validate a file on-disk
|
||||
* @var string
|
||||
* @access private
|
||||
*/
|
||||
var $_version = '1.0';
|
||||
/**
|
||||
* Cached dependency database file
|
||||
* @var array|null
|
||||
* @access private
|
||||
*/
|
||||
var $_cache;
|
||||
|
||||
// }}}
|
||||
// {{{ & singleton()
|
||||
|
||||
/**
|
||||
* Get a raw dependency database. Calls setConfig() and assertDepsDB()
|
||||
* @param PEAR_Config
|
||||
* @param string|false full path to the dependency database, or false to use default
|
||||
* @return PEAR_DependencyDB|PEAR_Error
|
||||
* @static
|
||||
*/
|
||||
function &singleton(&$config, $depdb = false)
|
||||
{
|
||||
$phpdir = $config->get('php_dir', null, 'pear.php.net');
|
||||
if (!isset($GLOBALS['_PEAR_DEPENDENCYDB_INSTANCE'][$phpdir])) {
|
||||
$a = new PEAR_DependencyDB;
|
||||
$GLOBALS['_PEAR_DEPENDENCYDB_INSTANCE'][$phpdir] = &$a;
|
||||
$a->setConfig($config, $depdb);
|
||||
$e = $a->assertDepsDB();
|
||||
if (PEAR::isError($e)) {
|
||||
return $e;
|
||||
}
|
||||
}
|
||||
|
||||
return $GLOBALS['_PEAR_DEPENDENCYDB_INSTANCE'][$phpdir];
|
||||
}
|
||||
|
||||
/**
|
||||
* Set up the registry/location of dependency DB
|
||||
* @param PEAR_Config|false
|
||||
* @param string|false full path to the dependency database, or false to use default
|
||||
*/
|
||||
function setConfig(&$config, $depdb = false)
|
||||
{
|
||||
if (!$config) {
|
||||
$this->_config = &PEAR_Config::singleton();
|
||||
} else {
|
||||
$this->_config = &$config;
|
||||
}
|
||||
|
||||
$this->_registry = &$this->_config->getRegistry();
|
||||
if (!$depdb) {
|
||||
$this->_depdb = $this->_config->get('php_dir', null, 'pear.php.net') .
|
||||
DIRECTORY_SEPARATOR . '.depdb';
|
||||
} else {
|
||||
$this->_depdb = $depdb;
|
||||
}
|
||||
|
||||
$this->_lockfile = dirname($this->_depdb) . DIRECTORY_SEPARATOR . '.depdblock';
|
||||
}
|
||||
// }}}
|
||||
|
||||
function hasWriteAccess()
|
||||
{
|
||||
if (!file_exists($this->_depdb)) {
|
||||
$dir = $this->_depdb;
|
||||
while ($dir && $dir != '.') {
|
||||
$dir = dirname($dir); // cd ..
|
||||
if ($dir != '.' && file_exists($dir)) {
|
||||
if (is_writeable($dir)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return is_writeable($this->_depdb);
|
||||
}
|
||||
|
||||
// {{{ assertDepsDB()
|
||||
|
||||
/**
|
||||
* Create the dependency database, if it doesn't exist. Error if the database is
|
||||
* newer than the code reading it.
|
||||
* @return void|PEAR_Error
|
||||
*/
|
||||
function assertDepsDB()
|
||||
{
|
||||
if (!is_file($this->_depdb)) {
|
||||
$this->rebuildDB();
|
||||
return;
|
||||
}
|
||||
|
||||
$depdb = $this->_getDepDB();
|
||||
// Datatype format has been changed, rebuild the Deps DB
|
||||
if ($depdb['_version'] < $this->_version) {
|
||||
$this->rebuildDB();
|
||||
}
|
||||
|
||||
if ($depdb['_version']{0} > $this->_version{0}) {
|
||||
return PEAR::raiseError('Dependency database is version ' .
|
||||
$depdb['_version'] . ', and we are version ' .
|
||||
$this->_version . ', cannot continue');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of installed packages that depend on this package
|
||||
* @param PEAR_PackageFile_v1|PEAR_PackageFile_v2|array
|
||||
* @return array|false
|
||||
*/
|
||||
function getDependentPackages(&$pkg)
|
||||
{
|
||||
$data = $this->_getDepDB();
|
||||
if (is_object($pkg)) {
|
||||
$channel = strtolower($pkg->getChannel());
|
||||
$package = strtolower($pkg->getPackage());
|
||||
} else {
|
||||
$channel = strtolower($pkg['channel']);
|
||||
$package = strtolower($pkg['package']);
|
||||
}
|
||||
|
||||
if (isset($data['packages'][$channel][$package])) {
|
||||
return $data['packages'][$channel][$package];
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of the actual dependencies of installed packages that depend on
|
||||
* a package.
|
||||
* @param PEAR_PackageFile_v1|PEAR_PackageFile_v2|array
|
||||
* @return array|false
|
||||
*/
|
||||
function getDependentPackageDependencies(&$pkg)
|
||||
{
|
||||
$data = $this->_getDepDB();
|
||||
if (is_object($pkg)) {
|
||||
$channel = strtolower($pkg->getChannel());
|
||||
$package = strtolower($pkg->getPackage());
|
||||
} else {
|
||||
$channel = strtolower($pkg['channel']);
|
||||
$package = strtolower($pkg['package']);
|
||||
}
|
||||
|
||||
$depend = $this->getDependentPackages($pkg);
|
||||
if (!$depend) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$dependencies = array();
|
||||
foreach ($depend as $info) {
|
||||
$temp = $this->getDependencies($info);
|
||||
foreach ($temp as $dep) {
|
||||
if (
|
||||
isset($dep['dep'], $dep['dep']['channel'], $dep['dep']['name']) &&
|
||||
strtolower($dep['dep']['channel']) == $channel &&
|
||||
strtolower($dep['dep']['name']) == $package
|
||||
) {
|
||||
if (!isset($dependencies[$info['channel']])) {
|
||||
$dependencies[$info['channel']] = array();
|
||||
}
|
||||
|
||||
if (!isset($dependencies[$info['channel']][$info['package']])) {
|
||||
$dependencies[$info['channel']][$info['package']] = array();
|
||||
}
|
||||
$dependencies[$info['channel']][$info['package']][] = $dep;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $dependencies;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of dependencies of this installed package
|
||||
* @param PEAR_PackageFile_v1|PEAR_PackageFile_v2|array
|
||||
* @return array|false
|
||||
*/
|
||||
function getDependencies(&$pkg)
|
||||
{
|
||||
if (is_object($pkg)) {
|
||||
$channel = strtolower($pkg->getChannel());
|
||||
$package = strtolower($pkg->getPackage());
|
||||
} else {
|
||||
$channel = strtolower($pkg['channel']);
|
||||
$package = strtolower($pkg['package']);
|
||||
}
|
||||
|
||||
$data = $this->_getDepDB();
|
||||
if (isset($data['dependencies'][$channel][$package])) {
|
||||
return $data['dependencies'][$channel][$package];
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether $parent depends on $child, near or deep
|
||||
* @param array|PEAR_PackageFile_v2|PEAR_PackageFile_v2
|
||||
* @param array|PEAR_PackageFile_v2|PEAR_PackageFile_v2
|
||||
*/
|
||||
function dependsOn($parent, $child)
|
||||
{
|
||||
$c = array();
|
||||
$this->_getDepDB();
|
||||
return $this->_dependsOn($parent, $child, $c);
|
||||
}
|
||||
|
||||
function _dependsOn($parent, $child, &$checked)
|
||||
{
|
||||
if (is_object($parent)) {
|
||||
$channel = strtolower($parent->getChannel());
|
||||
$package = strtolower($parent->getPackage());
|
||||
} else {
|
||||
$channel = strtolower($parent['channel']);
|
||||
$package = strtolower($parent['package']);
|
||||
}
|
||||
|
||||
if (is_object($child)) {
|
||||
$depchannel = strtolower($child->getChannel());
|
||||
$deppackage = strtolower($child->getPackage());
|
||||
} else {
|
||||
$depchannel = strtolower($child['channel']);
|
||||
$deppackage = strtolower($child['package']);
|
||||
}
|
||||
|
||||
if (isset($checked[$channel][$package][$depchannel][$deppackage])) {
|
||||
return false; // avoid endless recursion
|
||||
}
|
||||
|
||||
$checked[$channel][$package][$depchannel][$deppackage] = true;
|
||||
if (!isset($this->_cache['dependencies'][$channel][$package])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ($this->_cache['dependencies'][$channel][$package] as $info) {
|
||||
if (isset($info['dep']['uri'])) {
|
||||
if (is_object($child)) {
|
||||
if ($info['dep']['uri'] == $child->getURI()) {
|
||||
return true;
|
||||
}
|
||||
} elseif (isset($child['uri'])) {
|
||||
if ($info['dep']['uri'] == $child['uri']) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if (strtolower($info['dep']['channel']) == $depchannel &&
|
||||
strtolower($info['dep']['name']) == $deppackage) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($this->_cache['dependencies'][$channel][$package] as $info) {
|
||||
if (isset($info['dep']['uri'])) {
|
||||
if ($this->_dependsOn(array(
|
||||
'uri' => $info['dep']['uri'],
|
||||
'package' => $info['dep']['name']), $child, $checked)) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if ($this->_dependsOn(array(
|
||||
'channel' => $info['dep']['channel'],
|
||||
'package' => $info['dep']['name']), $child, $checked)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register dependencies of a package that is being installed or upgraded
|
||||
* @param PEAR_PackageFile_v2|PEAR_PackageFile_v2
|
||||
*/
|
||||
function installPackage(&$package)
|
||||
{
|
||||
$data = $this->_getDepDB();
|
||||
unset($this->_cache);
|
||||
$this->_setPackageDeps($data, $package);
|
||||
$this->_writeDepDB($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove dependencies of a package that is being uninstalled, or upgraded.
|
||||
*
|
||||
* Upgraded packages first uninstall, then install
|
||||
* @param PEAR_PackageFile_v1|PEAR_PackageFile_v2|array If an array, then it must have
|
||||
* indices 'channel' and 'package'
|
||||
*/
|
||||
function uninstallPackage(&$pkg)
|
||||
{
|
||||
$data = $this->_getDepDB();
|
||||
unset($this->_cache);
|
||||
if (is_object($pkg)) {
|
||||
$channel = strtolower($pkg->getChannel());
|
||||
$package = strtolower($pkg->getPackage());
|
||||
} else {
|
||||
$channel = strtolower($pkg['channel']);
|
||||
$package = strtolower($pkg['package']);
|
||||
}
|
||||
|
||||
if (!isset($data['dependencies'][$channel][$package])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
foreach ($data['dependencies'][$channel][$package] as $dep) {
|
||||
$found = false;
|
||||
$depchannel = isset($dep['dep']['uri']) ? '__uri' : strtolower($dep['dep']['channel']);
|
||||
$depname = strtolower($dep['dep']['name']);
|
||||
if (isset($data['packages'][$depchannel][$depname])) {
|
||||
foreach ($data['packages'][$depchannel][$depname] as $i => $info) {
|
||||
if ($info['channel'] == $channel && $info['package'] == $package) {
|
||||
$found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($found) {
|
||||
unset($data['packages'][$depchannel][$depname][$i]);
|
||||
if (!count($data['packages'][$depchannel][$depname])) {
|
||||
unset($data['packages'][$depchannel][$depname]);
|
||||
if (!count($data['packages'][$depchannel])) {
|
||||
unset($data['packages'][$depchannel]);
|
||||
}
|
||||
} else {
|
||||
$data['packages'][$depchannel][$depname] =
|
||||
array_values($data['packages'][$depchannel][$depname]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unset($data['dependencies'][$channel][$package]);
|
||||
if (!count($data['dependencies'][$channel])) {
|
||||
unset($data['dependencies'][$channel]);
|
||||
}
|
||||
|
||||
if (!count($data['dependencies'])) {
|
||||
unset($data['dependencies']);
|
||||
}
|
||||
|
||||
if (!count($data['packages'])) {
|
||||
unset($data['packages']);
|
||||
}
|
||||
|
||||
$this->_writeDepDB($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebuild the dependency DB by reading registry entries.
|
||||
* @return true|PEAR_Error
|
||||
*/
|
||||
function rebuildDB()
|
||||
{
|
||||
$depdb = array('_version' => $this->_version);
|
||||
if (!$this->hasWriteAccess()) {
|
||||
// allow startup for read-only with older Registry
|
||||
return $depdb;
|
||||
}
|
||||
|
||||
$packages = $this->_registry->listAllPackages();
|
||||
if (PEAR::isError($packages)) {
|
||||
return $packages;
|
||||
}
|
||||
|
||||
foreach ($packages as $channel => $ps) {
|
||||
foreach ($ps as $package) {
|
||||
$package = $this->_registry->getPackage($package, $channel);
|
||||
if (PEAR::isError($package)) {
|
||||
return $package;
|
||||
}
|
||||
$this->_setPackageDeps($depdb, $package);
|
||||
}
|
||||
}
|
||||
|
||||
$error = $this->_writeDepDB($depdb);
|
||||
if (PEAR::isError($error)) {
|
||||
return $error;
|
||||
}
|
||||
|
||||
$this->_cache = $depdb;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register usage of the dependency DB to prevent race conditions
|
||||
* @param int one of the LOCK_* constants
|
||||
* @return true|PEAR_Error
|
||||
* @access private
|
||||
*/
|
||||
function _lock($mode = LOCK_EX)
|
||||
{
|
||||
if (stristr(php_uname(), 'Windows 9')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($mode != LOCK_UN && is_resource($this->_lockFp)) {
|
||||
// XXX does not check type of lock (LOCK_SH/LOCK_EX)
|
||||
return true;
|
||||
}
|
||||
|
||||
$open_mode = 'w';
|
||||
// XXX People reported problems with LOCK_SH and 'w'
|
||||
if ($mode === LOCK_SH) {
|
||||
if (!file_exists($this->_lockfile)) {
|
||||
touch($this->_lockfile);
|
||||
} elseif (!is_file($this->_lockfile)) {
|
||||
return PEAR::raiseError('could not create Dependency lock file, ' .
|
||||
'it exists and is not a regular file');
|
||||
}
|
||||
$open_mode = 'r';
|
||||
}
|
||||
|
||||
if (!is_resource($this->_lockFp)) {
|
||||
$this->_lockFp = @fopen($this->_lockfile, $open_mode);
|
||||
}
|
||||
|
||||
if (!is_resource($this->_lockFp)) {
|
||||
return PEAR::raiseError("could not create Dependency lock file" .
|
||||
(isset($php_errormsg) ? ": " . $php_errormsg : ""));
|
||||
}
|
||||
|
||||
if (!(int)flock($this->_lockFp, $mode)) {
|
||||
switch ($mode) {
|
||||
case LOCK_SH: $str = 'shared'; break;
|
||||
case LOCK_EX: $str = 'exclusive'; break;
|
||||
case LOCK_UN: $str = 'unlock'; break;
|
||||
default: $str = 'unknown'; break;
|
||||
}
|
||||
|
||||
return PEAR::raiseError("could not acquire $str lock ($this->_lockfile)");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Release usage of dependency DB
|
||||
* @return true|PEAR_Error
|
||||
* @access private
|
||||
*/
|
||||
function _unlock()
|
||||
{
|
||||
$ret = $this->_lock(LOCK_UN);
|
||||
if (is_resource($this->_lockFp)) {
|
||||
fclose($this->_lockFp);
|
||||
}
|
||||
$this->_lockFp = null;
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the dependency database from disk, or return the cache
|
||||
* @return array|PEAR_Error
|
||||
*/
|
||||
function _getDepDB()
|
||||
{
|
||||
if (!$this->hasWriteAccess()) {
|
||||
return array('_version' => $this->_version);
|
||||
}
|
||||
|
||||
if (isset($this->_cache)) {
|
||||
return $this->_cache;
|
||||
}
|
||||
|
||||
if (!$fp = fopen($this->_depdb, 'r')) {
|
||||
$err = PEAR::raiseError("Could not open dependencies file `".$this->_depdb."'");
|
||||
return $err;
|
||||
}
|
||||
|
||||
$rt = get_magic_quotes_runtime();
|
||||
set_magic_quotes_runtime(0);
|
||||
clearstatcache();
|
||||
fclose($fp);
|
||||
$data = unserialize(file_get_contents($this->_depdb));
|
||||
set_magic_quotes_runtime($rt);
|
||||
$this->_cache = $data;
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Write out the dependency database to disk
|
||||
* @param array the database
|
||||
* @return true|PEAR_Error
|
||||
* @access private
|
||||
*/
|
||||
function _writeDepDB(&$deps)
|
||||
{
|
||||
if (PEAR::isError($e = $this->_lock(LOCK_EX))) {
|
||||
return $e;
|
||||
}
|
||||
|
||||
if (!$fp = fopen($this->_depdb, 'wb')) {
|
||||
$this->_unlock();
|
||||
return PEAR::raiseError("Could not open dependencies file `".$this->_depdb."' for writing");
|
||||
}
|
||||
|
||||
$rt = get_magic_quotes_runtime();
|
||||
set_magic_quotes_runtime(0);
|
||||
fwrite($fp, serialize($deps));
|
||||
set_magic_quotes_runtime($rt);
|
||||
fclose($fp);
|
||||
$this->_unlock();
|
||||
$this->_cache = $deps;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register all dependencies from a package in the dependencies database, in essence
|
||||
* "installing" the package's dependency information
|
||||
* @param array the database
|
||||
* @param PEAR_PackageFile_v1|PEAR_PackageFile_v2
|
||||
* @access private
|
||||
*/
|
||||
function _setPackageDeps(&$data, &$pkg)
|
||||
{
|
||||
$pkg->setConfig($this->_config);
|
||||
if ($pkg->getPackagexmlVersion() == '1.0') {
|
||||
$gen = &$pkg->getDefaultGenerator();
|
||||
$deps = $gen->dependenciesToV2();
|
||||
} else {
|
||||
$deps = $pkg->getDeps(true);
|
||||
}
|
||||
|
||||
if (!$deps) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!is_array($data)) {
|
||||
$data = array();
|
||||
}
|
||||
|
||||
if (!isset($data['dependencies'])) {
|
||||
$data['dependencies'] = array();
|
||||
}
|
||||
|
||||
$channel = strtolower($pkg->getChannel());
|
||||
$package = strtolower($pkg->getPackage());
|
||||
|
||||
if (!isset($data['dependencies'][$channel])) {
|
||||
$data['dependencies'][$channel] = array();
|
||||
}
|
||||
|
||||
$data['dependencies'][$channel][$package] = array();
|
||||
if (isset($deps['required']['package'])) {
|
||||
if (!isset($deps['required']['package'][0])) {
|
||||
$deps['required']['package'] = array($deps['required']['package']);
|
||||
}
|
||||
|
||||
foreach ($deps['required']['package'] as $dep) {
|
||||
$this->_registerDep($data, $pkg, $dep, 'required');
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($deps['optional']['package'])) {
|
||||
if (!isset($deps['optional']['package'][0])) {
|
||||
$deps['optional']['package'] = array($deps['optional']['package']);
|
||||
}
|
||||
|
||||
foreach ($deps['optional']['package'] as $dep) {
|
||||
$this->_registerDep($data, $pkg, $dep, 'optional');
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($deps['required']['subpackage'])) {
|
||||
if (!isset($deps['required']['subpackage'][0])) {
|
||||
$deps['required']['subpackage'] = array($deps['required']['subpackage']);
|
||||
}
|
||||
|
||||
foreach ($deps['required']['subpackage'] as $dep) {
|
||||
$this->_registerDep($data, $pkg, $dep, 'required');
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($deps['optional']['subpackage'])) {
|
||||
if (!isset($deps['optional']['subpackage'][0])) {
|
||||
$deps['optional']['subpackage'] = array($deps['optional']['subpackage']);
|
||||
}
|
||||
|
||||
foreach ($deps['optional']['subpackage'] as $dep) {
|
||||
$this->_registerDep($data, $pkg, $dep, 'optional');
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($deps['group'])) {
|
||||
if (!isset($deps['group'][0])) {
|
||||
$deps['group'] = array($deps['group']);
|
||||
}
|
||||
|
||||
foreach ($deps['group'] as $group) {
|
||||
if (isset($group['package'])) {
|
||||
if (!isset($group['package'][0])) {
|
||||
$group['package'] = array($group['package']);
|
||||
}
|
||||
|
||||
foreach ($group['package'] as $dep) {
|
||||
$this->_registerDep($data, $pkg, $dep, 'optional',
|
||||
$group['attribs']['name']);
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($group['subpackage'])) {
|
||||
if (!isset($group['subpackage'][0])) {
|
||||
$group['subpackage'] = array($group['subpackage']);
|
||||
}
|
||||
|
||||
foreach ($group['subpackage'] as $dep) {
|
||||
$this->_registerDep($data, $pkg, $dep, 'optional',
|
||||
$group['attribs']['name']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($data['dependencies'][$channel][$package] == array()) {
|
||||
unset($data['dependencies'][$channel][$package]);
|
||||
if (!count($data['dependencies'][$channel])) {
|
||||
unset($data['dependencies'][$channel]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array the database
|
||||
* @param PEAR_PackageFile_v1|PEAR_PackageFile_v2
|
||||
* @param array the specific dependency
|
||||
* @param required|optional whether this is a required or an optional dep
|
||||
* @param string|false dependency group this dependency is from, or false for ordinary dep
|
||||
*/
|
||||
function _registerDep(&$data, &$pkg, $dep, $type, $group = false)
|
||||
{
|
||||
$info = array(
|
||||
'dep' => $dep,
|
||||
'type' => $type,
|
||||
'group' => $group
|
||||
);
|
||||
|
||||
$dep = array_map('strtolower', $dep);
|
||||
$depchannel = isset($dep['channel']) ? $dep['channel'] : '__uri';
|
||||
if (!isset($data['dependencies'])) {
|
||||
$data['dependencies'] = array();
|
||||
}
|
||||
|
||||
$channel = strtolower($pkg->getChannel());
|
||||
$package = strtolower($pkg->getPackage());
|
||||
|
||||
if (!isset($data['dependencies'][$channel])) {
|
||||
$data['dependencies'][$channel] = array();
|
||||
}
|
||||
|
||||
if (!isset($data['dependencies'][$channel][$package])) {
|
||||
$data['dependencies'][$channel][$package] = array();
|
||||
}
|
||||
|
||||
$data['dependencies'][$channel][$package][] = $info;
|
||||
if (isset($data['packages'][$depchannel][$dep['name']])) {
|
||||
$found = false;
|
||||
foreach ($data['packages'][$depchannel][$dep['name']] as $i => $p) {
|
||||
if ($p['channel'] == $channel && $p['package'] == $package) {
|
||||
$found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!isset($data['packages'])) {
|
||||
$data['packages'] = array();
|
||||
}
|
||||
|
||||
if (!isset($data['packages'][$depchannel])) {
|
||||
$data['packages'][$depchannel] = array();
|
||||
}
|
||||
|
||||
if (!isset($data['packages'][$depchannel][$dep['name']])) {
|
||||
$data['packages'][$depchannel][$dep['name']] = array();
|
||||
}
|
||||
|
||||
$found = false;
|
||||
}
|
||||
|
||||
if (!$found) {
|
||||
$data['packages'][$depchannel][$dep['name']][] = array(
|
||||
'channel' => $channel,
|
||||
'package' => $package
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+1766
File diff suppressed because it is too large
Load Diff
Vendored
+1988
File diff suppressed because it is too large
Load Diff
+62
-58
@@ -1,24 +1,4 @@
|
||||
<?php
|
||||
//
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 5 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available through the world-wide-web at the following url: |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Author: Gregory Beaver <cellog@php.net> |
|
||||
// | |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: ErrorStack.php,v 1.7.2.5 2005/01/01 21:26:51 cellog Exp $
|
||||
|
||||
/**
|
||||
* Error Stack Implementation
|
||||
*
|
||||
@@ -38,11 +18,13 @@
|
||||
*
|
||||
* Since version PEAR1.3.2, ErrorStack no longer instantiates an exception class. This can
|
||||
* still be done quite handily in an error callback or by manipulating the returned array
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @version PEAR1.3.2 (beta)
|
||||
* @package PEAR_ErrorStack
|
||||
* @category Debugging
|
||||
* @license http://www.php.net/license/3_0.txt PHP License v3.0
|
||||
* @category Debugging
|
||||
* @package PEAR_ErrorStack
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 2004-2008 Greg Beaver
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version CVS: $Id: ErrorStack.php 313023 2011-07-06 19:17:11Z dufuz $
|
||||
* @link http://pear.php.net/package/PEAR_ErrorStack
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -149,9 +131,14 @@ define('PEAR_ERRORSTACK_ERR_OBJTOSTRING', 2);
|
||||
* // local error stack
|
||||
* $local_stack = new PEAR_ErrorStack('MyPackage');
|
||||
* </code>
|
||||
* @copyright 2004 Gregory Beaver
|
||||
* @package PEAR_ErrorStack
|
||||
* @license http://www.php.net/license/3_0.txt PHP License
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @version 1.9.4
|
||||
* @package PEAR_ErrorStack
|
||||
* @category Debugging
|
||||
* @copyright 2004-2008 Greg Beaver
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version CVS: $Id: ErrorStack.php 313023 2011-07-06 19:17:11Z dufuz $
|
||||
* @link http://pear.php.net/package/PEAR_ErrorStack
|
||||
*/
|
||||
class PEAR_ErrorStack {
|
||||
/**
|
||||
@@ -281,8 +268,10 @@ class PEAR_ErrorStack {
|
||||
'stack class "%stackclass%" is not a valid class name (should be like PEAR_ErrorStack)',
|
||||
false, $trace);
|
||||
}
|
||||
return $GLOBALS['_PEAR_ERRORSTACK_SINGLETON'][$package] =
|
||||
&new $stackClass($package, $msgCallback, $contextCallback, $throwPEAR_Error);
|
||||
$GLOBALS['_PEAR_ERRORSTACK_SINGLETON'][$package] =
|
||||
new $stackClass($package, $msgCallback, $contextCallback, $throwPEAR_Error);
|
||||
|
||||
return $GLOBALS['_PEAR_ERRORSTACK_SINGLETON'][$package];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -487,19 +476,10 @@ class PEAR_ErrorStack {
|
||||
* @param array $backtrace Protected parameter: use this to pass in the
|
||||
* {@link debug_backtrace()} that should be used
|
||||
* to find error context
|
||||
* @return PEAR_Error|array|Exception
|
||||
* if compatibility mode is on, a PEAR_Error is also
|
||||
* thrown. If the class Exception exists, then one
|
||||
* is returned to allow code like:
|
||||
* <code>
|
||||
* throw ($stack->push(MY_ERROR_CODE, 'error', array('username' => 'grob')));
|
||||
* </code>
|
||||
* @return PEAR_Error|array if compatibility mode is on, a PEAR_Error is also
|
||||
* thrown. If a PEAR_Error is returned, the userinfo
|
||||
* property is set to the following array:
|
||||
*
|
||||
* The errorData property of the exception class will be set to the array
|
||||
* that would normally be returned. If a PEAR_Error is returned, the userinfo
|
||||
* property is set to the array
|
||||
*
|
||||
* Otherwise, an array is returned in this format:
|
||||
* <code>
|
||||
* array(
|
||||
* 'code' => $code,
|
||||
@@ -512,6 +492,8 @@ class PEAR_ErrorStack {
|
||||
* //['repackage' => $err] repackaged error array/Exception class
|
||||
* );
|
||||
* </code>
|
||||
*
|
||||
* Normally, the previous array is returned.
|
||||
*/
|
||||
function push($code, $level = 'error', $params = array(), $msg = false,
|
||||
$repackage = false, $backtrace = false)
|
||||
@@ -538,16 +520,16 @@ class PEAR_ErrorStack {
|
||||
'message' => $msg,
|
||||
);
|
||||
|
||||
if ($repackage) {
|
||||
$err['repackage'] = $repackage;
|
||||
}
|
||||
|
||||
// set up the error message, if necessary
|
||||
if ($this->_msgCallback) {
|
||||
$msg = call_user_func_array($this->_msgCallback,
|
||||
array(&$this, $err));
|
||||
$err['message'] = $msg;
|
||||
}
|
||||
|
||||
if ($repackage) {
|
||||
$err['repackage'] = $repackage;
|
||||
}
|
||||
$push = $log = true;
|
||||
$die = false;
|
||||
// try the overriding callback first
|
||||
@@ -586,6 +568,9 @@ class PEAR_ErrorStack {
|
||||
}
|
||||
if ($push) {
|
||||
array_unshift($this->_errors, $err);
|
||||
if (!isset($this->_errorsByLevel[$err['level']])) {
|
||||
$this->_errorsByLevel[$err['level']] = array();
|
||||
}
|
||||
$this->_errorsByLevel[$err['level']][] = &$this->_errors[0];
|
||||
}
|
||||
if ($log) {
|
||||
@@ -617,13 +602,8 @@ class PEAR_ErrorStack {
|
||||
* @param array $backtrace Protected parameter: use this to pass in the
|
||||
* {@link debug_backtrace()} that should be used
|
||||
* to find error context
|
||||
* @return PEAR_Error|null|Exception
|
||||
* if compatibility mode is on, a PEAR_Error is also
|
||||
* thrown. If the class Exception exists, then one
|
||||
* is returned to allow code like:
|
||||
* <code>
|
||||
* throw ($stack->push(MY_ERROR_CODE, 'error', array('username' => 'grob')));
|
||||
* </code>
|
||||
* @return PEAR_Error|array if compatibility mode is on, a PEAR_Error is also
|
||||
* thrown. see docs for {@link push()}
|
||||
* @static
|
||||
*/
|
||||
function staticPush($package, $code, $level = 'error', $params = array(),
|
||||
@@ -684,9 +664,33 @@ class PEAR_ErrorStack {
|
||||
*/
|
||||
function pop()
|
||||
{
|
||||
return @array_shift($this->_errors);
|
||||
$err = @array_shift($this->_errors);
|
||||
if (!is_null($err)) {
|
||||
@array_pop($this->_errorsByLevel[$err['level']]);
|
||||
if (!count($this->_errorsByLevel[$err['level']])) {
|
||||
unset($this->_errorsByLevel[$err['level']]);
|
||||
}
|
||||
}
|
||||
return $err;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Pop an error off of the error stack, static method
|
||||
*
|
||||
* @param string package name
|
||||
* @return boolean
|
||||
* @since PEAR1.5.0a1
|
||||
*/
|
||||
function staticPop($package)
|
||||
{
|
||||
if ($package) {
|
||||
if (!isset($GLOBALS['_PEAR_ERRORSTACK_SINGLETON'][$package])) {
|
||||
return false;
|
||||
}
|
||||
return $GLOBALS['_PEAR_ERRORSTACK_SINGLETON'][$package]->pop();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether there are any errors on the stack
|
||||
* @param string|array Level name. Use to determine if any errors
|
||||
@@ -853,7 +857,7 @@ class PEAR_ErrorStack {
|
||||
'line' => $filebacktrace['line']);
|
||||
// rearrange for eval'd code or create function errors
|
||||
if (strpos($filebacktrace['file'], '(') &&
|
||||
preg_match(';^(.*?)\((\d+)\) : (.*?)$;', $filebacktrace['file'],
|
||||
preg_match(';^(.*?)\((\d+)\) : (.*?)\\z;', $filebacktrace['file'],
|
||||
$matches)) {
|
||||
$ret['file'] = $matches[1];
|
||||
$ret['line'] = $matches[2] + 0;
|
||||
@@ -910,7 +914,7 @@ class PEAR_ErrorStack {
|
||||
$mainmsg = $stack->getErrorMessageTemplate($err['code']);
|
||||
}
|
||||
$mainmsg = str_replace('%__msg%', $err['message'], $mainmsg);
|
||||
if (count($err['params'])) {
|
||||
if (is_array($err['params']) && count($err['params'])) {
|
||||
foreach ($err['params'] as $name => $val) {
|
||||
if (is_array($val)) {
|
||||
// @ is needed in case $val is a multi-dimensional array
|
||||
@@ -978,4 +982,4 @@ class PEAR_ErrorStack {
|
||||
}
|
||||
$stack = &PEAR_ErrorStack::singleton('PEAR_ErrorStack');
|
||||
$stack->pushCallback(array('PEAR_ErrorStack', '_handleError'));
|
||||
?>
|
||||
?>
|
||||
+84
-54
@@ -1,34 +1,27 @@
|
||||
<?php
|
||||
/* vim: set expandtab tabstop=4 shiftwidth=4 foldmethod=marker: */
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PEAR_Exception |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 2004 The PEAR Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Tomas V.V.Cox <cox@idecnet.com> |
|
||||
// | Hans Lellelid <hans@velum.net> |
|
||||
// | Bertrand Mansion <bmansion@mamasam.com> |
|
||||
// | Greg Beaver <cellog@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: Exception.php,v 1.4.2.2 2004/12/31 19:01:52 cellog Exp $
|
||||
/**
|
||||
* PEAR_Exception
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Tomas V. V. Cox <cox@idecnet.com>
|
||||
* @author Hans Lellelid <hans@velum.net>
|
||||
* @author Bertrand Mansion <bmansion@mamasam.com>
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version CVS: $Id: Exception.php 313023 2011-07-06 19:17:11Z dufuz $
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since File available since Release 1.3.3
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Base PEAR_Exception Class
|
||||
*
|
||||
* WARNING: This code should be considered stable, but the API is
|
||||
* subject to immediate and drastic change, so API stability is
|
||||
* at best alpha
|
||||
*
|
||||
* 1) Features:
|
||||
*
|
||||
* - Nestable exceptions (throw new PEAR_Exception($msg, $prev_exception))
|
||||
@@ -88,12 +81,17 @@
|
||||
* }
|
||||
* </code>
|
||||
*
|
||||
* @since PHP 5
|
||||
* @package PEAR
|
||||
* @version $Revision: 1.4.2.2 $
|
||||
* @author Tomas V.V.Cox <cox@idecnet.com>
|
||||
* @author Hans Lellelid <hans@velum.net>
|
||||
* @author Bertrand Mansion <bmansion@mamasam.com>
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Tomas V.V.Cox <cox@idecnet.com>
|
||||
* @author Hans Lellelid <hans@velum.net>
|
||||
* @author Bertrand Mansion <bmansion@mamasam.com>
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version Release: 1.9.4
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since Class available since Release 1.3.3
|
||||
*
|
||||
*/
|
||||
class PEAR_Exception extends Exception
|
||||
@@ -108,19 +106,31 @@ class PEAR_Exception extends Exception
|
||||
|
||||
/**
|
||||
* Supported signatures:
|
||||
* PEAR_Exception(string $message);
|
||||
* PEAR_Exception(string $message, int $code);
|
||||
* PEAR_Exception(string $message, Exception $cause);
|
||||
* PEAR_Exception(string $message, Exception $cause, int $code);
|
||||
* PEAR_Exception(string $message, array $causes);
|
||||
* PEAR_Exception(string $message, array $causes, int $code);
|
||||
* - PEAR_Exception(string $message);
|
||||
* - PEAR_Exception(string $message, int $code);
|
||||
* - PEAR_Exception(string $message, Exception $cause);
|
||||
* - PEAR_Exception(string $message, Exception $cause, int $code);
|
||||
* - PEAR_Exception(string $message, PEAR_Error $cause);
|
||||
* - PEAR_Exception(string $message, PEAR_Error $cause, int $code);
|
||||
* - PEAR_Exception(string $message, array $causes);
|
||||
* - PEAR_Exception(string $message, array $causes, int $code);
|
||||
* @param string exception message
|
||||
* @param int|Exception|PEAR_Error|array|null exception cause
|
||||
* @param int|null exception code or null
|
||||
*/
|
||||
public function __construct($message, $p2 = null, $p3 = null)
|
||||
{
|
||||
if (is_int($p2)) {
|
||||
$code = $p2;
|
||||
$this->cause = null;
|
||||
} elseif ($p2 instanceof Exception || is_array($p2)) {
|
||||
} elseif (is_object($p2) || is_array($p2)) {
|
||||
// using is_object allows both Exception and PEAR_Error
|
||||
if (is_object($p2) && !($p2 instanceof Exception)) {
|
||||
if (!class_exists('PEAR_Error') || !($p2 instanceof PEAR_Error)) {
|
||||
throw new PEAR_Exception('exception cause must be Exception, ' .
|
||||
'array, or PEAR_Error');
|
||||
}
|
||||
}
|
||||
$code = $p3;
|
||||
if (is_array($p2) && isset($p2['message'])) {
|
||||
// fix potential problem of passing in a single warning
|
||||
@@ -128,7 +138,7 @@ class PEAR_Exception extends Exception
|
||||
}
|
||||
$this->cause = $p2;
|
||||
} else {
|
||||
$code = null;
|
||||
$code = null;
|
||||
$this->cause = null;
|
||||
}
|
||||
parent::__construct($message, $code);
|
||||
@@ -234,13 +244,33 @@ class PEAR_Exception extends Exception
|
||||
$cause['line'] = $trace[0]['line'];
|
||||
}
|
||||
}
|
||||
$causes[] = $cause;
|
||||
if ($this->cause instanceof PEAR_Exception) {
|
||||
$this->cause->getCauseMessage($causes);
|
||||
}
|
||||
if (is_array($this->cause)) {
|
||||
} elseif ($this->cause instanceof Exception) {
|
||||
$causes[] = array('class' => get_class($this->cause),
|
||||
'message' => $this->cause->getMessage(),
|
||||
'file' => $this->cause->getFile(),
|
||||
'line' => $this->cause->getLine());
|
||||
} elseif (class_exists('PEAR_Error') && $this->cause instanceof PEAR_Error) {
|
||||
$causes[] = array('class' => get_class($this->cause),
|
||||
'message' => $this->cause->getMessage(),
|
||||
'file' => 'unknown',
|
||||
'line' => 'unknown');
|
||||
} elseif (is_array($this->cause)) {
|
||||
foreach ($this->cause as $cause) {
|
||||
if ($cause instanceof PEAR_Exception) {
|
||||
$cause->getCauseMessage($causes);
|
||||
} elseif ($cause instanceof Exception) {
|
||||
$causes[] = array('class' => get_class($cause),
|
||||
'message' => $cause->getMessage(),
|
||||
'file' => $cause->getFile(),
|
||||
'line' => $cause->getLine());
|
||||
} elseif (class_exists('PEAR_Error') && $cause instanceof PEAR_Error) {
|
||||
$causes[] = array('class' => get_class($cause),
|
||||
'message' => $cause->getMessage(),
|
||||
'file' => 'unknown',
|
||||
'line' => 'unknown');
|
||||
} elseif (is_array($cause) && isset($cause['message'])) {
|
||||
// PEAR_ErrorStack warning
|
||||
$causes[] = array(
|
||||
@@ -259,7 +289,7 @@ class PEAR_Exception extends Exception
|
||||
}
|
||||
|
||||
public function getTraceSafe()
|
||||
{
|
||||
{
|
||||
if (!isset($this->_trace)) {
|
||||
$this->_trace = $this->getTrace();
|
||||
if (empty($this->_trace)) {
|
||||
@@ -288,28 +318,28 @@ class PEAR_Exception extends Exception
|
||||
return $this->toHtml();
|
||||
}
|
||||
return $this->toText();
|
||||
}
|
||||
}
|
||||
|
||||
public function toHtml()
|
||||
{
|
||||
$trace = $this->getTraceSafe();
|
||||
$causes = array();
|
||||
$this->getCauseMessage($causes);
|
||||
$html = '<table border="1" cellspacing="0">' . "\n";
|
||||
$html = '<table style="border: 1px" cellspacing="0">' . "\n";
|
||||
foreach ($causes as $i => $cause) {
|
||||
$html .= '<tr><td colspan="3" bgcolor="#ff9999">'
|
||||
$html .= '<tr><td colspan="3" style="background: #ff9999">'
|
||||
. str_repeat('-', $i) . ' <b>' . $cause['class'] . '</b>: '
|
||||
. htmlspecialchars($cause['message']) . ' in <b>' . $cause['file'] . '</b> '
|
||||
. 'on line <b>' . $cause['line'] . '</b>'
|
||||
. "</td></tr>\n";
|
||||
}
|
||||
$html .= '<tr><td colspan="3" bgcolor="#aaaaaa" align="center"><b>Exception trace</b></td></tr>' . "\n"
|
||||
. '<tr><td align="center" bgcolor="#cccccc" width="20"><b>#</b></td>'
|
||||
. '<td align="center" bgcolor="#cccccc"><b>Function</b></td>'
|
||||
. '<td align="center" bgcolor="#cccccc"><b>Location</b></td></tr>' . "\n";
|
||||
$html .= '<tr><td colspan="3" style="background-color: #aaaaaa; text-align: center; font-weight: bold;">Exception trace</td></tr>' . "\n"
|
||||
. '<tr><td style="text-align: center; background: #cccccc; width:20px; font-weight: bold;">#</td>'
|
||||
. '<td style="text-align: center; background: #cccccc; font-weight: bold;">Function</td>'
|
||||
. '<td style="text-align: center; background: #cccccc; font-weight: bold;">Location</td></tr>' . "\n";
|
||||
|
||||
foreach ($trace as $k => $v) {
|
||||
$html .= '<tr><td align="center">' . $k . '</td>'
|
||||
$html .= '<tr><td style="text-align: center;">' . $k . '</td>'
|
||||
. '<td>';
|
||||
if (!empty($v['class'])) {
|
||||
$html .= $v['class'] . $v['type'];
|
||||
@@ -333,9 +363,11 @@ class PEAR_Exception extends Exception
|
||||
}
|
||||
$html .= '(' . implode(', ',$args) . ')'
|
||||
. '</td>'
|
||||
. '<td>' . $v['file'] . ':' . $v['line'] . '</td></tr>' . "\n";
|
||||
. '<td>' . (isset($v['file']) ? $v['file'] : 'unknown')
|
||||
. ':' . (isset($v['line']) ? $v['line'] : 'unknown')
|
||||
. '</td></tr>' . "\n";
|
||||
}
|
||||
$html .= '<tr><td align="center">' . ($k+1) . '</td>'
|
||||
$html .= '<tr><td style="text-align: center;">' . ($k+1) . '</td>'
|
||||
. '<td>{main}</td>'
|
||||
. '<td> </td></tr>' . "\n"
|
||||
. '</table>';
|
||||
@@ -354,6 +386,4 @@ class PEAR_Exception extends Exception
|
||||
}
|
||||
return $causeMsg . $this->getTraceAsString();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
if ($skipmsg) {
|
||||
$a = &new $ec($code, $mode, $options, $userinfo);
|
||||
} else {
|
||||
$a = &new $ec($message, $code, $mode, $options, $userinfo);
|
||||
}
|
||||
?>
|
||||
Vendored
+228
@@ -0,0 +1,228 @@
|
||||
<?php
|
||||
/**
|
||||
* PEAR_Frontend, the singleton-based frontend for user input/output
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version CVS: $Id: Frontend.php 313023 2011-07-06 19:17:11Z dufuz $
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since File available since Release 1.4.0a1
|
||||
*/
|
||||
|
||||
/**
|
||||
* Include error handling
|
||||
*/
|
||||
//require_once 'PEAR.php';
|
||||
|
||||
/**
|
||||
* Which user interface class is being used.
|
||||
* @var string class name
|
||||
*/
|
||||
$GLOBALS['_PEAR_FRONTEND_CLASS'] = 'PEAR_Frontend_CLI';
|
||||
|
||||
/**
|
||||
* Instance of $_PEAR_Command_uiclass.
|
||||
* @var object
|
||||
*/
|
||||
$GLOBALS['_PEAR_FRONTEND_SINGLETON'] = null;
|
||||
|
||||
/**
|
||||
* Singleton-based frontend for PEAR user input/output
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version Release: 1.9.4
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since Class available since Release 1.4.0a1
|
||||
*/
|
||||
class PEAR_Frontend extends PEAR
|
||||
{
|
||||
/**
|
||||
* Retrieve the frontend object
|
||||
* @return PEAR_Frontend_CLI|PEAR_Frontend_Web|PEAR_Frontend_Gtk
|
||||
* @static
|
||||
*/
|
||||
function &singleton($type = null)
|
||||
{
|
||||
if ($type === null) {
|
||||
if (!isset($GLOBALS['_PEAR_FRONTEND_SINGLETON'])) {
|
||||
$a = false;
|
||||
return $a;
|
||||
}
|
||||
return $GLOBALS['_PEAR_FRONTEND_SINGLETON'];
|
||||
}
|
||||
|
||||
$a = PEAR_Frontend::setFrontendClass($type);
|
||||
return $a;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the frontend class that will be used by calls to {@link singleton()}
|
||||
*
|
||||
* Frontends are expected to conform to the PEAR naming standard of
|
||||
* _ => DIRECTORY_SEPARATOR (PEAR_Frontend_CLI is in PEAR/Frontend/CLI.php)
|
||||
* @param string $uiclass full class name
|
||||
* @return PEAR_Frontend
|
||||
* @static
|
||||
*/
|
||||
function &setFrontendClass($uiclass)
|
||||
{
|
||||
if (is_object($GLOBALS['_PEAR_FRONTEND_SINGLETON']) &&
|
||||
is_a($GLOBALS['_PEAR_FRONTEND_SINGLETON'], $uiclass)) {
|
||||
return $GLOBALS['_PEAR_FRONTEND_SINGLETON'];
|
||||
}
|
||||
|
||||
if (!class_exists($uiclass)) {
|
||||
$file = str_replace('_', '/', $uiclass) . '.php';
|
||||
if (PEAR_Frontend::isIncludeable($file)) {
|
||||
include_once $file;
|
||||
}
|
||||
}
|
||||
|
||||
if (class_exists($uiclass)) {
|
||||
$obj = &new $uiclass;
|
||||
// quick test to see if this class implements a few of the most
|
||||
// important frontend methods
|
||||
if (is_a($obj, 'PEAR_Frontend')) {
|
||||
$GLOBALS['_PEAR_FRONTEND_SINGLETON'] = &$obj;
|
||||
$GLOBALS['_PEAR_FRONTEND_CLASS'] = $uiclass;
|
||||
return $obj;
|
||||
}
|
||||
|
||||
$err = PEAR::raiseError("not a frontend class: $uiclass");
|
||||
return $err;
|
||||
}
|
||||
|
||||
$err = PEAR::raiseError("no such class: $uiclass");
|
||||
return $err;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the frontend class that will be used by calls to {@link singleton()}
|
||||
*
|
||||
* Frontends are expected to be a descendant of PEAR_Frontend
|
||||
* @param PEAR_Frontend
|
||||
* @return PEAR_Frontend
|
||||
* @static
|
||||
*/
|
||||
function &setFrontendObject($uiobject)
|
||||
{
|
||||
if (is_object($GLOBALS['_PEAR_FRONTEND_SINGLETON']) &&
|
||||
is_a($GLOBALS['_PEAR_FRONTEND_SINGLETON'], get_class($uiobject))) {
|
||||
return $GLOBALS['_PEAR_FRONTEND_SINGLETON'];
|
||||
}
|
||||
|
||||
if (!is_a($uiobject, 'PEAR_Frontend')) {
|
||||
$err = PEAR::raiseError('not a valid frontend class: (' .
|
||||
get_class($uiobject) . ')');
|
||||
return $err;
|
||||
}
|
||||
|
||||
$GLOBALS['_PEAR_FRONTEND_SINGLETON'] = &$uiobject;
|
||||
$GLOBALS['_PEAR_FRONTEND_CLASS'] = get_class($uiobject);
|
||||
return $uiobject;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $path relative or absolute include path
|
||||
* @return boolean
|
||||
* @static
|
||||
*/
|
||||
function isIncludeable($path)
|
||||
{
|
||||
if (file_exists($path) && is_readable($path)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$fp = @fopen($path, 'r', true);
|
||||
if ($fp) {
|
||||
fclose($fp);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param PEAR_Config
|
||||
*/
|
||||
function setConfig(&$config)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* This can be overridden to allow session-based temporary file management
|
||||
*
|
||||
* By default, all files are deleted at the end of a session. The web installer
|
||||
* needs to be able to sustain a list over many sessions in order to support
|
||||
* user interaction with install scripts
|
||||
*/
|
||||
function addTempFile($file)
|
||||
{
|
||||
$GLOBALS['_PEAR_Common_tempfiles'][] = $file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Log an action
|
||||
*
|
||||
* @param string $msg the message to log
|
||||
* @param boolean $append_crlf
|
||||
* @return boolean true
|
||||
* @abstract
|
||||
*/
|
||||
function log($msg, $append_crlf = true)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Run a post-installation script
|
||||
*
|
||||
* @param array $scripts array of post-install scripts
|
||||
* @abstract
|
||||
*/
|
||||
function runPostinstallScripts(&$scripts)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Display human-friendly output formatted depending on the
|
||||
* $command parameter.
|
||||
*
|
||||
* This should be able to handle basic output data with no command
|
||||
* @param mixed $data data structure containing the information to display
|
||||
* @param string $command command from which this method was called
|
||||
* @abstract
|
||||
*/
|
||||
function outputData($data, $command = '_default')
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a modal form dialog and return the given input
|
||||
*
|
||||
* A frontend that requires multiple requests to retrieve and process
|
||||
* data must take these needs into account, and implement the request
|
||||
* handling code.
|
||||
* @param string $command command from which this method was called
|
||||
* @param array $prompts associative array. keys are the input field names
|
||||
* and values are the description
|
||||
* @param array $types array of input field types (text, password,
|
||||
* etc.) keys have to be the same like in $prompts
|
||||
* @param array $defaults array of default values. again keys have
|
||||
* to be the same like in $prompts. Do not depend
|
||||
* on a default value being set.
|
||||
* @return array input sent by the user
|
||||
* @abstract
|
||||
*/
|
||||
function userDialog($command, $prompts, $types = array(), $defaults = array())
|
||||
{
|
||||
}
|
||||
}
|
||||
Vendored
+751
@@ -0,0 +1,751 @@
|
||||
<?php
|
||||
/**
|
||||
* PEAR_Frontend_CLI
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Stig Bakken <ssb@php.net>
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version CVS: $Id: CLI.php 313023 2011-07-06 19:17:11Z dufuz $
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since File available since Release 0.1
|
||||
*/
|
||||
/**
|
||||
* base class
|
||||
*/
|
||||
require_once 'PEAR/Frontend.php';
|
||||
|
||||
/**
|
||||
* Command-line Frontend for the PEAR Installer
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Stig Bakken <ssb@php.net>
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version Release: 1.9.4
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since Class available since Release 0.1
|
||||
*/
|
||||
class PEAR_Frontend_CLI extends PEAR_Frontend
|
||||
{
|
||||
/**
|
||||
* What type of user interface this frontend is for.
|
||||
* @var string
|
||||
* @access public
|
||||
*/
|
||||
var $type = 'CLI';
|
||||
var $lp = ''; // line prefix
|
||||
|
||||
var $params = array();
|
||||
var $term = array(
|
||||
'bold' => '',
|
||||
'normal' => '',
|
||||
);
|
||||
|
||||
function PEAR_Frontend_CLI()
|
||||
{
|
||||
parent::PEAR();
|
||||
$term = getenv('TERM'); //(cox) $_ENV is empty for me in 4.1.1
|
||||
if (function_exists('posix_isatty') && !posix_isatty(1)) {
|
||||
// output is being redirected to a file or through a pipe
|
||||
} elseif ($term) {
|
||||
if (preg_match('/^(xterm|vt220|linux)/', $term)) {
|
||||
$this->term['bold'] = sprintf("%c%c%c%c", 27, 91, 49, 109);
|
||||
$this->term['normal'] = sprintf("%c%c%c", 27, 91, 109);
|
||||
} elseif (preg_match('/^vt100/', $term)) {
|
||||
$this->term['bold'] = sprintf("%c%c%c%c%c%c", 27, 91, 49, 109, 0, 0);
|
||||
$this->term['normal'] = sprintf("%c%c%c%c%c", 27, 91, 109, 0, 0);
|
||||
}
|
||||
} elseif (OS_WINDOWS) {
|
||||
// XXX add ANSI codes here
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param object PEAR_Error object
|
||||
*/
|
||||
function displayError($e)
|
||||
{
|
||||
return $this->_displayLine($e->getMessage());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param object PEAR_Error object
|
||||
*/
|
||||
function displayFatalError($eobj)
|
||||
{
|
||||
$this->displayError($eobj);
|
||||
if (class_exists('PEAR_Config')) {
|
||||
$config = &PEAR_Config::singleton();
|
||||
if ($config->get('verbose') > 5) {
|
||||
if (function_exists('debug_print_backtrace')) {
|
||||
debug_print_backtrace();
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$raised = false;
|
||||
foreach (debug_backtrace() as $i => $frame) {
|
||||
if (!$raised) {
|
||||
if (isset($frame['class'])
|
||||
&& strtolower($frame['class']) == 'pear'
|
||||
&& strtolower($frame['function']) == 'raiseerror'
|
||||
) {
|
||||
$raised = true;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$frame['class'] = !isset($frame['class']) ? '' : $frame['class'];
|
||||
$frame['type'] = !isset($frame['type']) ? '' : $frame['type'];
|
||||
$frame['function'] = !isset($frame['function']) ? '' : $frame['function'];
|
||||
$frame['line'] = !isset($frame['line']) ? '' : $frame['line'];
|
||||
$this->_displayLine("#$i: $frame[class]$frame[type]$frame[function] $frame[line]");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Instruct the runInstallScript method to skip a paramgroup that matches the
|
||||
* id value passed in.
|
||||
*
|
||||
* This method is useful for dynamically configuring which sections of a post-install script
|
||||
* will be run based on the user's setup, which is very useful for making flexible
|
||||
* post-install scripts without losing the cross-Frontend ability to retrieve user input
|
||||
* @param string
|
||||
*/
|
||||
function skipParamgroup($id)
|
||||
{
|
||||
$this->_skipSections[$id] = true;
|
||||
}
|
||||
|
||||
function runPostinstallScripts(&$scripts)
|
||||
{
|
||||
foreach ($scripts as $i => $script) {
|
||||
$this->runInstallScript($scripts[$i]->_params, $scripts[$i]->_obj);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $xml contents of postinstallscript tag
|
||||
* @param object $script post-installation script
|
||||
* @param string install|upgrade
|
||||
*/
|
||||
function runInstallScript($xml, &$script)
|
||||
{
|
||||
$this->_skipSections = array();
|
||||
if (!is_array($xml) || !isset($xml['paramgroup'])) {
|
||||
$script->run(array(), '_default');
|
||||
return;
|
||||
}
|
||||
|
||||
$completedPhases = array();
|
||||
if (!isset($xml['paramgroup'][0])) {
|
||||
$xml['paramgroup'] = array($xml['paramgroup']);
|
||||
}
|
||||
|
||||
foreach ($xml['paramgroup'] as $group) {
|
||||
if (isset($this->_skipSections[$group['id']])) {
|
||||
// the post-install script chose to skip this section dynamically
|
||||
continue;
|
||||
}
|
||||
|
||||
if (isset($group['name'])) {
|
||||
$paramname = explode('::', $group['name']);
|
||||
if ($lastgroup['id'] != $paramname[0]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$group['name'] = $paramname[1];
|
||||
if (!isset($answers)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isset($answers[$group['name']])) {
|
||||
switch ($group['conditiontype']) {
|
||||
case '=' :
|
||||
if ($answers[$group['name']] != $group['value']) {
|
||||
continue 2;
|
||||
}
|
||||
break;
|
||||
case '!=' :
|
||||
if ($answers[$group['name']] == $group['value']) {
|
||||
continue 2;
|
||||
}
|
||||
break;
|
||||
case 'preg_match' :
|
||||
if (!@preg_match('/' . $group['value'] . '/',
|
||||
$answers[$group['name']])) {
|
||||
continue 2;
|
||||
}
|
||||
break;
|
||||
default :
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$lastgroup = $group;
|
||||
if (isset($group['instructions'])) {
|
||||
$this->_display($group['instructions']);
|
||||
}
|
||||
|
||||
if (!isset($group['param'][0])) {
|
||||
$group['param'] = array($group['param']);
|
||||
}
|
||||
|
||||
if (isset($group['param'])) {
|
||||
if (method_exists($script, 'postProcessPrompts')) {
|
||||
$prompts = $script->postProcessPrompts($group['param'], $group['id']);
|
||||
if (!is_array($prompts) || count($prompts) != count($group['param'])) {
|
||||
$this->outputData('postinstall', 'Error: post-install script did not ' .
|
||||
'return proper post-processed prompts');
|
||||
$prompts = $group['param'];
|
||||
} else {
|
||||
foreach ($prompts as $i => $var) {
|
||||
if (!is_array($var) || !isset($var['prompt']) ||
|
||||
!isset($var['name']) ||
|
||||
($var['name'] != $group['param'][$i]['name']) ||
|
||||
($var['type'] != $group['param'][$i]['type'])
|
||||
) {
|
||||
$this->outputData('postinstall', 'Error: post-install script ' .
|
||||
'modified the variables or prompts, severe security risk. ' .
|
||||
'Will instead use the defaults from the package.xml');
|
||||
$prompts = $group['param'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$answers = $this->confirmDialog($prompts);
|
||||
} else {
|
||||
$answers = $this->confirmDialog($group['param']);
|
||||
}
|
||||
}
|
||||
|
||||
if ((isset($answers) && $answers) || !isset($group['param'])) {
|
||||
if (!isset($answers)) {
|
||||
$answers = array();
|
||||
}
|
||||
|
||||
array_unshift($completedPhases, $group['id']);
|
||||
if (!$script->run($answers, $group['id'])) {
|
||||
$script->run($completedPhases, '_undoOnError');
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
$script->run($completedPhases, '_undoOnError');
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ask for user input, confirm the answers and continue until the user is satisfied
|
||||
* @param array an array of arrays, format array('name' => 'paramname', 'prompt' =>
|
||||
* 'text to display', 'type' => 'string'[, default => 'default value'])
|
||||
* @return array
|
||||
*/
|
||||
function confirmDialog($params)
|
||||
{
|
||||
$answers = $prompts = $types = array();
|
||||
foreach ($params as $param) {
|
||||
$prompts[$param['name']] = $param['prompt'];
|
||||
$types[$param['name']] = $param['type'];
|
||||
$answers[$param['name']] = isset($param['default']) ? $param['default'] : '';
|
||||
}
|
||||
|
||||
$tried = false;
|
||||
do {
|
||||
if ($tried) {
|
||||
$i = 1;
|
||||
foreach ($answers as $var => $value) {
|
||||
if (!strlen($value)) {
|
||||
echo $this->bold("* Enter an answer for #" . $i . ": ({$prompts[$var]})\n");
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
$answers = $this->userDialog('', $prompts, $types, $answers);
|
||||
$tried = true;
|
||||
} while (is_array($answers) && count(array_filter($answers)) != count($prompts));
|
||||
|
||||
return $answers;
|
||||
}
|
||||
|
||||
function userDialog($command, $prompts, $types = array(), $defaults = array(), $screensize = 20)
|
||||
{
|
||||
if (!is_array($prompts)) {
|
||||
return array();
|
||||
}
|
||||
|
||||
$testprompts = array_keys($prompts);
|
||||
$result = $defaults;
|
||||
|
||||
reset($prompts);
|
||||
if (count($prompts) === 1) {
|
||||
foreach ($prompts as $key => $prompt) {
|
||||
$type = $types[$key];
|
||||
$default = @$defaults[$key];
|
||||
print "$prompt ";
|
||||
if ($default) {
|
||||
print "[$default] ";
|
||||
}
|
||||
print ": ";
|
||||
|
||||
$line = fgets(STDIN, 2048);
|
||||
$result[$key] = ($default && trim($line) == '') ? $default : trim($line);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
$first_run = true;
|
||||
while (true) {
|
||||
$descLength = max(array_map('strlen', $prompts));
|
||||
$descFormat = "%-{$descLength}s";
|
||||
$last = count($prompts);
|
||||
|
||||
$i = 0;
|
||||
foreach ($prompts as $n => $var) {
|
||||
$res = isset($result[$n]) ? $result[$n] : null;
|
||||
printf("%2d. $descFormat : %s\n", ++$i, $prompts[$n], $res);
|
||||
}
|
||||
print "\n1-$last, 'all', 'abort', or Enter to continue: ";
|
||||
|
||||
$tmp = trim(fgets(STDIN, 1024));
|
||||
if (empty($tmp)) {
|
||||
break;
|
||||
}
|
||||
|
||||
if ($tmp == 'abort') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isset($testprompts[(int)$tmp - 1])) {
|
||||
$var = $testprompts[(int)$tmp - 1];
|
||||
$desc = $prompts[$var];
|
||||
$current = @$result[$var];
|
||||
print "$desc [$current] : ";
|
||||
$tmp = trim(fgets(STDIN, 1024));
|
||||
if ($tmp !== '') {
|
||||
$result[$var] = $tmp;
|
||||
}
|
||||
} elseif ($tmp == 'all') {
|
||||
foreach ($prompts as $var => $desc) {
|
||||
$current = $result[$var];
|
||||
print "$desc [$current] : ";
|
||||
$tmp = trim(fgets(STDIN, 1024));
|
||||
if (trim($tmp) !== '') {
|
||||
$result[$var] = trim($tmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$first_run = false;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
function userConfirm($prompt, $default = 'yes')
|
||||
{
|
||||
trigger_error("PEAR_Frontend_CLI::userConfirm not yet converted", E_USER_ERROR);
|
||||
static $positives = array('y', 'yes', 'on', '1');
|
||||
static $negatives = array('n', 'no', 'off', '0');
|
||||
print "$this->lp$prompt [$default] : ";
|
||||
$fp = fopen("php://stdin", "r");
|
||||
$line = fgets($fp, 2048);
|
||||
fclose($fp);
|
||||
$answer = strtolower(trim($line));
|
||||
if (empty($answer)) {
|
||||
$answer = $default;
|
||||
}
|
||||
if (in_array($answer, $positives)) {
|
||||
return true;
|
||||
}
|
||||
if (in_array($answer, $negatives)) {
|
||||
return false;
|
||||
}
|
||||
if (in_array($default, $positives)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function outputData($data, $command = '_default')
|
||||
{
|
||||
switch ($command) {
|
||||
case 'channel-info':
|
||||
foreach ($data as $type => $section) {
|
||||
if ($type == 'main') {
|
||||
$section['data'] = array_values($section['data']);
|
||||
}
|
||||
|
||||
$this->outputData($section);
|
||||
}
|
||||
break;
|
||||
case 'install':
|
||||
case 'upgrade':
|
||||
case 'upgrade-all':
|
||||
if (is_array($data) && isset($data['release_warnings'])) {
|
||||
$this->_displayLine('');
|
||||
$this->_startTable(array(
|
||||
'border' => false,
|
||||
'caption' => 'Release Warnings'
|
||||
));
|
||||
$this->_tableRow(array($data['release_warnings']), null, array(1 => array('wrap' => 55)));
|
||||
$this->_endTable();
|
||||
$this->_displayLine('');
|
||||
}
|
||||
|
||||
$this->_displayLine(is_array($data) ? $data['data'] : $data);
|
||||
break;
|
||||
case 'search':
|
||||
$this->_startTable($data);
|
||||
if (isset($data['headline']) && is_array($data['headline'])) {
|
||||
$this->_tableRow($data['headline'], array('bold' => true), array(1 => array('wrap' => 55)));
|
||||
}
|
||||
|
||||
$packages = array();
|
||||
foreach($data['data'] as $category) {
|
||||
foreach($category as $name => $pkg) {
|
||||
$packages[$pkg[0]] = $pkg;
|
||||
}
|
||||
}
|
||||
|
||||
$p = array_keys($packages);
|
||||
natcasesort($p);
|
||||
foreach ($p as $name) {
|
||||
$this->_tableRow($packages[$name], null, array(1 => array('wrap' => 55)));
|
||||
}
|
||||
|
||||
$this->_endTable();
|
||||
break;
|
||||
case 'list-all':
|
||||
if (!isset($data['data'])) {
|
||||
$this->_displayLine('No packages in channel');
|
||||
break;
|
||||
}
|
||||
|
||||
$this->_startTable($data);
|
||||
if (isset($data['headline']) && is_array($data['headline'])) {
|
||||
$this->_tableRow($data['headline'], array('bold' => true), array(1 => array('wrap' => 55)));
|
||||
}
|
||||
|
||||
$packages = array();
|
||||
foreach($data['data'] as $category) {
|
||||
foreach($category as $name => $pkg) {
|
||||
$packages[$pkg[0]] = $pkg;
|
||||
}
|
||||
}
|
||||
|
||||
$p = array_keys($packages);
|
||||
natcasesort($p);
|
||||
foreach ($p as $name) {
|
||||
$pkg = $packages[$name];
|
||||
unset($pkg[4], $pkg[5]);
|
||||
$this->_tableRow($pkg, null, array(1 => array('wrap' => 55)));
|
||||
}
|
||||
|
||||
$this->_endTable();
|
||||
break;
|
||||
case 'config-show':
|
||||
$data['border'] = false;
|
||||
$opts = array(
|
||||
0 => array('wrap' => 30),
|
||||
1 => array('wrap' => 20),
|
||||
2 => array('wrap' => 35)
|
||||
);
|
||||
|
||||
$this->_startTable($data);
|
||||
if (isset($data['headline']) && is_array($data['headline'])) {
|
||||
$this->_tableRow($data['headline'], array('bold' => true), $opts);
|
||||
}
|
||||
|
||||
foreach ($data['data'] as $group) {
|
||||
foreach ($group as $value) {
|
||||
if ($value[2] == '') {
|
||||
$value[2] = "<not set>";
|
||||
}
|
||||
|
||||
$this->_tableRow($value, null, $opts);
|
||||
}
|
||||
}
|
||||
|
||||
$this->_endTable();
|
||||
break;
|
||||
case 'remote-info':
|
||||
$d = $data;
|
||||
$data = array(
|
||||
'caption' => 'Package details:',
|
||||
'border' => false,
|
||||
'data' => array(
|
||||
array("Latest", $data['stable']),
|
||||
array("Installed", $data['installed']),
|
||||
array("Package", $data['name']),
|
||||
array("License", $data['license']),
|
||||
array("Category", $data['category']),
|
||||
array("Summary", $data['summary']),
|
||||
array("Description", $data['description']),
|
||||
),
|
||||
);
|
||||
|
||||
if (isset($d['deprecated']) && $d['deprecated']) {
|
||||
$conf = &PEAR_Config::singleton();
|
||||
$reg = $conf->getRegistry();
|
||||
$name = $reg->parsedPackageNameToString($d['deprecated'], true);
|
||||
$data['data'][] = array('Deprecated! use', $name);
|
||||
}
|
||||
default: {
|
||||
if (is_array($data)) {
|
||||
$this->_startTable($data);
|
||||
$count = count($data['data'][0]);
|
||||
if ($count == 2) {
|
||||
$opts = array(0 => array('wrap' => 25),
|
||||
1 => array('wrap' => 48)
|
||||
);
|
||||
} elseif ($count == 3) {
|
||||
$opts = array(0 => array('wrap' => 30),
|
||||
1 => array('wrap' => 20),
|
||||
2 => array('wrap' => 35)
|
||||
);
|
||||
} else {
|
||||
$opts = null;
|
||||
}
|
||||
if (isset($data['headline']) && is_array($data['headline'])) {
|
||||
$this->_tableRow($data['headline'],
|
||||
array('bold' => true),
|
||||
$opts);
|
||||
}
|
||||
|
||||
if (is_array($data['data'])) {
|
||||
foreach($data['data'] as $row) {
|
||||
$this->_tableRow($row, null, $opts);
|
||||
}
|
||||
} else {
|
||||
$this->_tableRow(array($data['data']), null, $opts);
|
||||
}
|
||||
$this->_endTable();
|
||||
} else {
|
||||
$this->_displayLine($data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function log($text, $append_crlf = true)
|
||||
{
|
||||
if ($append_crlf) {
|
||||
return $this->_displayLine($text);
|
||||
}
|
||||
|
||||
return $this->_display($text);
|
||||
}
|
||||
|
||||
function bold($text)
|
||||
{
|
||||
if (empty($this->term['bold'])) {
|
||||
return strtoupper($text);
|
||||
}
|
||||
|
||||
return $this->term['bold'] . $text . $this->term['normal'];
|
||||
}
|
||||
|
||||
function _displayHeading($title)
|
||||
{
|
||||
print $this->lp.$this->bold($title)."\n";
|
||||
print $this->lp.str_repeat("=", strlen($title))."\n";
|
||||
}
|
||||
|
||||
function _startTable($params = array())
|
||||
{
|
||||
$params['table_data'] = array();
|
||||
$params['widest'] = array(); // indexed by column
|
||||
$params['highest'] = array(); // indexed by row
|
||||
$params['ncols'] = 0;
|
||||
$this->params = $params;
|
||||
}
|
||||
|
||||
function _tableRow($columns, $rowparams = array(), $colparams = array())
|
||||
{
|
||||
$highest = 1;
|
||||
for ($i = 0; $i < count($columns); $i++) {
|
||||
$col = &$columns[$i];
|
||||
if (isset($colparams[$i]) && !empty($colparams[$i]['wrap'])) {
|
||||
$col = wordwrap($col, $colparams[$i]['wrap']);
|
||||
}
|
||||
|
||||
if (strpos($col, "\n") !== false) {
|
||||
$multiline = explode("\n", $col);
|
||||
$w = 0;
|
||||
foreach ($multiline as $n => $line) {
|
||||
$len = strlen($line);
|
||||
if ($len > $w) {
|
||||
$w = $len;
|
||||
}
|
||||
}
|
||||
$lines = count($multiline);
|
||||
} else {
|
||||
$w = strlen($col);
|
||||
}
|
||||
|
||||
if (isset($this->params['widest'][$i])) {
|
||||
if ($w > $this->params['widest'][$i]) {
|
||||
$this->params['widest'][$i] = $w;
|
||||
}
|
||||
} else {
|
||||
$this->params['widest'][$i] = $w;
|
||||
}
|
||||
|
||||
$tmp = count_chars($columns[$i], 1);
|
||||
// handle unix, mac and windows formats
|
||||
$lines = (isset($tmp[10]) ? $tmp[10] : (isset($tmp[13]) ? $tmp[13] : 0)) + 1;
|
||||
if ($lines > $highest) {
|
||||
$highest = $lines;
|
||||
}
|
||||
}
|
||||
|
||||
if (count($columns) > $this->params['ncols']) {
|
||||
$this->params['ncols'] = count($columns);
|
||||
}
|
||||
|
||||
$new_row = array(
|
||||
'data' => $columns,
|
||||
'height' => $highest,
|
||||
'rowparams' => $rowparams,
|
||||
'colparams' => $colparams,
|
||||
);
|
||||
$this->params['table_data'][] = $new_row;
|
||||
}
|
||||
|
||||
function _endTable()
|
||||
{
|
||||
extract($this->params);
|
||||
if (!empty($caption)) {
|
||||
$this->_displayHeading($caption);
|
||||
}
|
||||
|
||||
if (count($table_data) === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isset($width)) {
|
||||
$width = $widest;
|
||||
} else {
|
||||
for ($i = 0; $i < $ncols; $i++) {
|
||||
if (!isset($width[$i])) {
|
||||
$width[$i] = $widest[$i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$border = false;
|
||||
if (empty($border)) {
|
||||
$cellstart = '';
|
||||
$cellend = ' ';
|
||||
$rowend = '';
|
||||
$padrowend = false;
|
||||
$borderline = '';
|
||||
} else {
|
||||
$cellstart = '| ';
|
||||
$cellend = ' ';
|
||||
$rowend = '|';
|
||||
$padrowend = true;
|
||||
$borderline = '+';
|
||||
foreach ($width as $w) {
|
||||
$borderline .= str_repeat('-', $w + strlen($cellstart) + strlen($cellend) - 1);
|
||||
$borderline .= '+';
|
||||
}
|
||||
}
|
||||
|
||||
if ($borderline) {
|
||||
$this->_displayLine($borderline);
|
||||
}
|
||||
|
||||
for ($i = 0; $i < count($table_data); $i++) {
|
||||
extract($table_data[$i]);
|
||||
if (!is_array($rowparams)) {
|
||||
$rowparams = array();
|
||||
}
|
||||
|
||||
if (!is_array($colparams)) {
|
||||
$colparams = array();
|
||||
}
|
||||
|
||||
$rowlines = array();
|
||||
if ($height > 1) {
|
||||
for ($c = 0; $c < count($data); $c++) {
|
||||
$rowlines[$c] = preg_split('/(\r?\n|\r)/', $data[$c]);
|
||||
if (count($rowlines[$c]) < $height) {
|
||||
$rowlines[$c] = array_pad($rowlines[$c], $height, '');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for ($c = 0; $c < count($data); $c++) {
|
||||
$rowlines[$c] = array($data[$c]);
|
||||
}
|
||||
}
|
||||
|
||||
for ($r = 0; $r < $height; $r++) {
|
||||
$rowtext = '';
|
||||
for ($c = 0; $c < count($data); $c++) {
|
||||
if (isset($colparams[$c])) {
|
||||
$attribs = array_merge($rowparams, $colparams);
|
||||
} else {
|
||||
$attribs = $rowparams;
|
||||
}
|
||||
|
||||
$w = isset($width[$c]) ? $width[$c] : 0;
|
||||
//$cell = $data[$c];
|
||||
$cell = $rowlines[$c][$r];
|
||||
$l = strlen($cell);
|
||||
if ($l > $w) {
|
||||
$cell = substr($cell, 0, $w);
|
||||
}
|
||||
|
||||
if (isset($attribs['bold'])) {
|
||||
$cell = $this->bold($cell);
|
||||
}
|
||||
|
||||
if ($l < $w) {
|
||||
// not using str_pad here because we may
|
||||
// add bold escape characters to $cell
|
||||
$cell .= str_repeat(' ', $w - $l);
|
||||
}
|
||||
|
||||
$rowtext .= $cellstart . $cell . $cellend;
|
||||
}
|
||||
|
||||
if (!$border) {
|
||||
$rowtext = rtrim($rowtext);
|
||||
}
|
||||
|
||||
$rowtext .= $rowend;
|
||||
$this->_displayLine($rowtext);
|
||||
}
|
||||
}
|
||||
|
||||
if ($borderline) {
|
||||
$this->_displayLine($borderline);
|
||||
}
|
||||
}
|
||||
|
||||
function _displayLine($text)
|
||||
{
|
||||
print "$this->lp$text\n";
|
||||
}
|
||||
|
||||
function _display($text)
|
||||
{
|
||||
print $text;
|
||||
}
|
||||
}
|
||||
Vendored
+1823
File diff suppressed because it is too large
Load Diff
Vendored
+276
@@ -0,0 +1,276 @@
|
||||
<?php
|
||||
/**
|
||||
* PEAR_Installer_Role
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version CVS: $Id: Role.php 313023 2011-07-06 19:17:11Z dufuz $
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since File available since Release 1.4.0a1
|
||||
*/
|
||||
|
||||
/**
|
||||
* base class for installer roles
|
||||
*/
|
||||
require_once 'PEAR/Installer/Role/Common.php';
|
||||
require_once 'PEAR/XMLParser.php';
|
||||
/**
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version Release: 1.9.4
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since Class available since Release 1.4.0a1
|
||||
*/
|
||||
class PEAR_Installer_Role
|
||||
{
|
||||
/**
|
||||
* Set up any additional configuration variables that file roles require
|
||||
*
|
||||
* Never call this directly, it is called by the PEAR_Config constructor
|
||||
* @param PEAR_Config
|
||||
* @access private
|
||||
* @static
|
||||
*/
|
||||
function initializeConfig(&$config)
|
||||
{
|
||||
if (!isset($GLOBALS['_PEAR_INSTALLER_ROLES'])) {
|
||||
PEAR_Installer_Role::registerRoles();
|
||||
}
|
||||
|
||||
foreach ($GLOBALS['_PEAR_INSTALLER_ROLES'] as $class => $info) {
|
||||
if (!$info['config_vars']) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$config->_addConfigVars($class, $info['config_vars']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param PEAR_PackageFile_v2
|
||||
* @param string role name
|
||||
* @param PEAR_Config
|
||||
* @return PEAR_Installer_Role_Common
|
||||
* @static
|
||||
*/
|
||||
function &factory($pkg, $role, &$config)
|
||||
{
|
||||
if (!isset($GLOBALS['_PEAR_INSTALLER_ROLES'])) {
|
||||
PEAR_Installer_Role::registerRoles();
|
||||
}
|
||||
|
||||
if (!in_array($role, PEAR_Installer_Role::getValidRoles($pkg->getPackageType()))) {
|
||||
$a = false;
|
||||
return $a;
|
||||
}
|
||||
|
||||
$a = 'PEAR_Installer_Role_' . ucfirst($role);
|
||||
if (!class_exists($a)) {
|
||||
require_once str_replace('_', '/', $a) . '.php';
|
||||
}
|
||||
|
||||
$b = new $a($config);
|
||||
return $b;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of file roles that are valid for the particular release type.
|
||||
*
|
||||
* For instance, src files serve no purpose in regular php releases.
|
||||
* @param string
|
||||
* @param bool clear cache
|
||||
* @return array
|
||||
* @static
|
||||
*/
|
||||
function getValidRoles($release, $clear = false)
|
||||
{
|
||||
if (!isset($GLOBALS['_PEAR_INSTALLER_ROLES'])) {
|
||||
PEAR_Installer_Role::registerRoles();
|
||||
}
|
||||
|
||||
static $ret = array();
|
||||
if ($clear) {
|
||||
$ret = array();
|
||||
}
|
||||
|
||||
if (isset($ret[$release])) {
|
||||
return $ret[$release];
|
||||
}
|
||||
|
||||
$ret[$release] = array();
|
||||
foreach ($GLOBALS['_PEAR_INSTALLER_ROLES'] as $role => $okreleases) {
|
||||
if (in_array($release, $okreleases['releasetypes'])) {
|
||||
$ret[$release][] = strtolower(str_replace('PEAR_Installer_Role_', '', $role));
|
||||
}
|
||||
}
|
||||
|
||||
return $ret[$release];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of roles that require their files to be installed
|
||||
*
|
||||
* Most roles must be installed, but src and package roles, for instance
|
||||
* are pseudo-roles. src files are compiled into a new extension. Package
|
||||
* roles are actually fully bundled releases of a package
|
||||
* @param bool clear cache
|
||||
* @return array
|
||||
* @static
|
||||
*/
|
||||
function getInstallableRoles($clear = false)
|
||||
{
|
||||
if (!isset($GLOBALS['_PEAR_INSTALLER_ROLES'])) {
|
||||
PEAR_Installer_Role::registerRoles();
|
||||
}
|
||||
|
||||
static $ret;
|
||||
if ($clear) {
|
||||
unset($ret);
|
||||
}
|
||||
|
||||
if (isset($ret)) {
|
||||
return $ret;
|
||||
}
|
||||
|
||||
$ret = array();
|
||||
foreach ($GLOBALS['_PEAR_INSTALLER_ROLES'] as $role => $okreleases) {
|
||||
if ($okreleases['installable']) {
|
||||
$ret[] = strtolower(str_replace('PEAR_Installer_Role_', '', $role));
|
||||
}
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an array of roles that are affected by the baseinstalldir attribute
|
||||
*
|
||||
* Most roles ignore this attribute, and instead install directly into:
|
||||
* PackageName/filepath
|
||||
* so a tests file tests/file.phpt is installed into PackageName/tests/filepath.php
|
||||
* @param bool clear cache
|
||||
* @return array
|
||||
* @static
|
||||
*/
|
||||
function getBaseinstallRoles($clear = false)
|
||||
{
|
||||
if (!isset($GLOBALS['_PEAR_INSTALLER_ROLES'])) {
|
||||
PEAR_Installer_Role::registerRoles();
|
||||
}
|
||||
|
||||
static $ret;
|
||||
if ($clear) {
|
||||
unset($ret);
|
||||
}
|
||||
|
||||
if (isset($ret)) {
|
||||
return $ret;
|
||||
}
|
||||
|
||||
$ret = array();
|
||||
foreach ($GLOBALS['_PEAR_INSTALLER_ROLES'] as $role => $okreleases) {
|
||||
if ($okreleases['honorsbaseinstall']) {
|
||||
$ret[] = strtolower(str_replace('PEAR_Installer_Role_', '', $role));
|
||||
}
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an array of file roles that should be analyzed for PHP content at package time,
|
||||
* like the "php" role.
|
||||
* @param bool clear cache
|
||||
* @return array
|
||||
* @static
|
||||
*/
|
||||
function getPhpRoles($clear = false)
|
||||
{
|
||||
if (!isset($GLOBALS['_PEAR_INSTALLER_ROLES'])) {
|
||||
PEAR_Installer_Role::registerRoles();
|
||||
}
|
||||
|
||||
static $ret;
|
||||
if ($clear) {
|
||||
unset($ret);
|
||||
}
|
||||
|
||||
if (isset($ret)) {
|
||||
return $ret;
|
||||
}
|
||||
|
||||
$ret = array();
|
||||
foreach ($GLOBALS['_PEAR_INSTALLER_ROLES'] as $role => $okreleases) {
|
||||
if ($okreleases['phpfile']) {
|
||||
$ret[] = strtolower(str_replace('PEAR_Installer_Role_', '', $role));
|
||||
}
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Scan through the Command directory looking for classes
|
||||
* and see what commands they implement.
|
||||
* @param string which directory to look for classes, defaults to
|
||||
* the Installer/Roles subdirectory of
|
||||
* the directory from where this file (__FILE__) is
|
||||
* included.
|
||||
*
|
||||
* @return bool TRUE on success, a PEAR error on failure
|
||||
* @access public
|
||||
* @static
|
||||
*/
|
||||
function registerRoles($dir = null)
|
||||
{
|
||||
$GLOBALS['_PEAR_INSTALLER_ROLES'] = array();
|
||||
$parser = new PEAR_XMLParser;
|
||||
if ($dir === null) {
|
||||
$dir = dirname(__FILE__) . '/Role';
|
||||
}
|
||||
|
||||
if (!file_exists($dir) || !is_dir($dir)) {
|
||||
return PEAR::raiseError("registerRoles: opendir($dir) failed: does not exist/is not directory");
|
||||
}
|
||||
|
||||
$dp = @opendir($dir);
|
||||
if (empty($dp)) {
|
||||
return PEAR::raiseError("registerRoles: opendir($dir) failed: $php_errmsg");
|
||||
}
|
||||
|
||||
while ($entry = readdir($dp)) {
|
||||
if ($entry{0} == '.' || substr($entry, -4) != '.xml') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$class = "PEAR_Installer_Role_".substr($entry, 0, -4);
|
||||
// List of roles
|
||||
if (!isset($GLOBALS['_PEAR_INSTALLER_ROLES'][$class])) {
|
||||
$file = "$dir/$entry";
|
||||
$parser->parse(file_get_contents($file));
|
||||
$data = $parser->getData();
|
||||
if (!is_array($data['releasetypes'])) {
|
||||
$data['releasetypes'] = array($data['releasetypes']);
|
||||
}
|
||||
|
||||
$GLOBALS['_PEAR_INSTALLER_ROLES'][$class] = $data;
|
||||
}
|
||||
}
|
||||
|
||||
closedir($dp);
|
||||
ksort($GLOBALS['_PEAR_INSTALLER_ROLES']);
|
||||
PEAR_Installer_Role::getBaseinstallRoles(true);
|
||||
PEAR_Installer_Role::getInstallableRoles(true);
|
||||
PEAR_Installer_Role::getPhpRoles(true);
|
||||
PEAR_Installer_Role::getValidRoles('****', true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Vendored
+106
@@ -0,0 +1,106 @@
|
||||
<?php
|
||||
/**
|
||||
* PEAR_Installer_Role_Cfg
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 2007-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version CVS: $Id: Cfg.php 313023 2011-07-06 19:17:11Z dufuz $
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since File available since Release 1.7.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 2007-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version Release: 1.9.4
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since Class available since Release 1.7.0
|
||||
*/
|
||||
class PEAR_Installer_Role_Cfg extends PEAR_Installer_Role_Common
|
||||
{
|
||||
/**
|
||||
* @var PEAR_Installer
|
||||
*/
|
||||
var $installer;
|
||||
|
||||
/**
|
||||
* the md5 of the original file
|
||||
*
|
||||
* @var unknown_type
|
||||
*/
|
||||
var $md5 = null;
|
||||
|
||||
/**
|
||||
* Do any unusual setup here
|
||||
* @param PEAR_Installer
|
||||
* @param PEAR_PackageFile_v2
|
||||
* @param array file attributes
|
||||
* @param string file name
|
||||
*/
|
||||
function setup(&$installer, $pkg, $atts, $file)
|
||||
{
|
||||
$this->installer = &$installer;
|
||||
$reg = &$this->installer->config->getRegistry();
|
||||
$package = $reg->getPackage($pkg->getPackage(), $pkg->getChannel());
|
||||
if ($package) {
|
||||
$filelist = $package->getFilelist();
|
||||
if (isset($filelist[$file]) && isset($filelist[$file]['md5sum'])) {
|
||||
$this->md5 = $filelist[$file]['md5sum'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function processInstallation($pkg, $atts, $file, $tmp_path, $layer = null)
|
||||
{
|
||||
$test = parent::processInstallation($pkg, $atts, $file, $tmp_path, $layer);
|
||||
if (@file_exists($test[2]) && @file_exists($test[3])) {
|
||||
$md5 = md5_file($test[2]);
|
||||
// configuration has already been installed, check for mods
|
||||
if ($md5 !== $this->md5 && $md5 !== md5_file($test[3])) {
|
||||
// configuration has been modified, so save our version as
|
||||
// configfile-version
|
||||
$old = $test[2];
|
||||
$test[2] .= '.new-' . $pkg->getVersion();
|
||||
// backup original and re-install it
|
||||
PEAR::pushErrorHandling(PEAR_ERROR_RETURN);
|
||||
$tmpcfg = $this->config->get('temp_dir');
|
||||
$newloc = System::mkdir(array('-p', $tmpcfg));
|
||||
if (!$newloc) {
|
||||
// try temp_dir
|
||||
$newloc = System::mktemp(array('-d'));
|
||||
if (!$newloc || PEAR::isError($newloc)) {
|
||||
PEAR::popErrorHandling();
|
||||
return PEAR::raiseError('Could not save existing configuration file '.
|
||||
$old . ', unable to install. Please set temp_dir ' .
|
||||
'configuration variable to a writeable location and try again');
|
||||
}
|
||||
} else {
|
||||
$newloc = $tmpcfg;
|
||||
}
|
||||
|
||||
$temp_file = $newloc . DIRECTORY_SEPARATOR . uniqid('savefile');
|
||||
if (!@copy($old, $temp_file)) {
|
||||
PEAR::popErrorHandling();
|
||||
return PEAR::raiseError('Could not save existing configuration file '.
|
||||
$old . ', unable to install. Please set temp_dir ' .
|
||||
'configuration variable to a writeable location and try again');
|
||||
}
|
||||
|
||||
PEAR::popErrorHandling();
|
||||
$this->installer->log(0, "WARNING: configuration file $old is being installed as $test[2], you should manually merge in changes to the existing configuration file");
|
||||
$this->installer->addFileOperation('rename', array($temp_file, $old, false));
|
||||
$this->installer->addFileOperation('delete', array($temp_file));
|
||||
}
|
||||
}
|
||||
|
||||
return $test;
|
||||
}
|
||||
}
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
<role version="1.0">
|
||||
<releasetypes>php</releasetypes>
|
||||
<releasetypes>extsrc</releasetypes>
|
||||
<releasetypes>extbin</releasetypes>
|
||||
<releasetypes>zendextsrc</releasetypes>
|
||||
<releasetypes>zendextbin</releasetypes>
|
||||
<installable>1</installable>
|
||||
<locationconfig>cfg_dir</locationconfig>
|
||||
<honorsbaseinstall />
|
||||
<unusualbaseinstall>1</unusualbaseinstall>
|
||||
<phpfile />
|
||||
<executable />
|
||||
<phpextension />
|
||||
<config_vars />
|
||||
</role>
|
||||
+174
@@ -0,0 +1,174 @@
|
||||
<?php
|
||||
/**
|
||||
* Base class for all installation roles.
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2006 The PHP Group
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version CVS: $Id: Common.php 313023 2011-07-06 19:17:11Z dufuz $
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since File available since Release 1.4.0a1
|
||||
*/
|
||||
/**
|
||||
* Base class for all installation roles.
|
||||
*
|
||||
* This class allows extensibility of file roles. Packages with complex
|
||||
* customization can now provide custom file roles along with the possibility of
|
||||
* adding configuration values to match.
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2006 The PHP Group
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version Release: 1.9.4
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since Class available since Release 1.4.0a1
|
||||
*/
|
||||
class PEAR_Installer_Role_Common
|
||||
{
|
||||
/**
|
||||
* @var PEAR_Config
|
||||
* @access protected
|
||||
*/
|
||||
var $config;
|
||||
|
||||
/**
|
||||
* @param PEAR_Config
|
||||
*/
|
||||
function PEAR_Installer_Role_Common(&$config)
|
||||
{
|
||||
$this->config = $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve configuration information about a file role from its XML info
|
||||
*
|
||||
* @param string $role Role Classname, as in "PEAR_Installer_Role_Data"
|
||||
* @return array
|
||||
*/
|
||||
function getInfo($role)
|
||||
{
|
||||
if (empty($GLOBALS['_PEAR_INSTALLER_ROLES'][$role])) {
|
||||
return PEAR::raiseError('Unknown Role class: "' . $role . '"');
|
||||
}
|
||||
return $GLOBALS['_PEAR_INSTALLER_ROLES'][$role];
|
||||
}
|
||||
|
||||
/**
|
||||
* This is called for each file to set up the directories and files
|
||||
* @param PEAR_PackageFile_v1|PEAR_PackageFile_v2
|
||||
* @param array attributes from the <file> tag
|
||||
* @param string file name
|
||||
* @return array an array consisting of:
|
||||
*
|
||||
* 1 the original, pre-baseinstalldir installation directory
|
||||
* 2 the final installation directory
|
||||
* 3 the full path to the final location of the file
|
||||
* 4 the location of the pre-installation file
|
||||
*/
|
||||
function processInstallation($pkg, $atts, $file, $tmp_path, $layer = null)
|
||||
{
|
||||
$roleInfo = PEAR_Installer_Role_Common::getInfo('PEAR_Installer_Role_' .
|
||||
ucfirst(str_replace('pear_installer_role_', '', strtolower(get_class($this)))));
|
||||
if (PEAR::isError($roleInfo)) {
|
||||
return $roleInfo;
|
||||
}
|
||||
if (!$roleInfo['locationconfig']) {
|
||||
return false;
|
||||
}
|
||||
if ($roleInfo['honorsbaseinstall']) {
|
||||
$dest_dir = $save_destdir = $this->config->get($roleInfo['locationconfig'], $layer,
|
||||
$pkg->getChannel());
|
||||
if (!empty($atts['baseinstalldir'])) {
|
||||
$dest_dir .= DIRECTORY_SEPARATOR . $atts['baseinstalldir'];
|
||||
}
|
||||
} elseif ($roleInfo['unusualbaseinstall']) {
|
||||
$dest_dir = $save_destdir = $this->config->get($roleInfo['locationconfig'],
|
||||
$layer, $pkg->getChannel()) . DIRECTORY_SEPARATOR . $pkg->getPackage();
|
||||
if (!empty($atts['baseinstalldir'])) {
|
||||
$dest_dir .= DIRECTORY_SEPARATOR . $atts['baseinstalldir'];
|
||||
}
|
||||
} else {
|
||||
$dest_dir = $save_destdir = $this->config->get($roleInfo['locationconfig'],
|
||||
$layer, $pkg->getChannel()) . DIRECTORY_SEPARATOR . $pkg->getPackage();
|
||||
}
|
||||
if (dirname($file) != '.' && empty($atts['install-as'])) {
|
||||
$dest_dir .= DIRECTORY_SEPARATOR . dirname($file);
|
||||
}
|
||||
if (empty($atts['install-as'])) {
|
||||
$dest_file = $dest_dir . DIRECTORY_SEPARATOR . basename($file);
|
||||
} else {
|
||||
$dest_file = $dest_dir . DIRECTORY_SEPARATOR . $atts['install-as'];
|
||||
}
|
||||
$orig_file = $tmp_path . DIRECTORY_SEPARATOR . $file;
|
||||
|
||||
// Clean up the DIRECTORY_SEPARATOR mess
|
||||
$ds2 = DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR;
|
||||
|
||||
list($dest_dir, $dest_file, $orig_file) = preg_replace(array('!\\\\+!', '!/!', "!$ds2+!"),
|
||||
array(DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR,
|
||||
DIRECTORY_SEPARATOR),
|
||||
array($dest_dir, $dest_file, $orig_file));
|
||||
return array($save_destdir, $dest_dir, $dest_file, $orig_file);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the name of the configuration variable that specifies the location of this file
|
||||
* @return string|false
|
||||
*/
|
||||
function getLocationConfig()
|
||||
{
|
||||
$roleInfo = PEAR_Installer_Role_Common::getInfo('PEAR_Installer_Role_' .
|
||||
ucfirst(str_replace('pear_installer_role_', '', strtolower(get_class($this)))));
|
||||
if (PEAR::isError($roleInfo)) {
|
||||
return $roleInfo;
|
||||
}
|
||||
return $roleInfo['locationconfig'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Do any unusual setup here
|
||||
* @param PEAR_Installer
|
||||
* @param PEAR_PackageFile_v2
|
||||
* @param array file attributes
|
||||
* @param string file name
|
||||
*/
|
||||
function setup(&$installer, $pkg, $atts, $file)
|
||||
{
|
||||
}
|
||||
|
||||
function isExecutable()
|
||||
{
|
||||
$roleInfo = PEAR_Installer_Role_Common::getInfo('PEAR_Installer_Role_' .
|
||||
ucfirst(str_replace('pear_installer_role_', '', strtolower(get_class($this)))));
|
||||
if (PEAR::isError($roleInfo)) {
|
||||
return $roleInfo;
|
||||
}
|
||||
return $roleInfo['executable'];
|
||||
}
|
||||
|
||||
function isInstallable()
|
||||
{
|
||||
$roleInfo = PEAR_Installer_Role_Common::getInfo('PEAR_Installer_Role_' .
|
||||
ucfirst(str_replace('pear_installer_role_', '', strtolower(get_class($this)))));
|
||||
if (PEAR::isError($roleInfo)) {
|
||||
return $roleInfo;
|
||||
}
|
||||
return $roleInfo['installable'];
|
||||
}
|
||||
|
||||
function isExtension()
|
||||
{
|
||||
$roleInfo = PEAR_Installer_Role_Common::getInfo('PEAR_Installer_Role_' .
|
||||
ucfirst(str_replace('pear_installer_role_', '', strtolower(get_class($this)))));
|
||||
if (PEAR::isError($roleInfo)) {
|
||||
return $roleInfo;
|
||||
}
|
||||
return $roleInfo['phpextension'];
|
||||
}
|
||||
}
|
||||
?>
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* PEAR_Installer_Role_Data
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version CVS: $Id: Data.php 313023 2011-07-06 19:17:11Z dufuz $
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since File available since Release 1.4.0a1
|
||||
*/
|
||||
|
||||
/**
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version Release: 1.9.4
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since Class available since Release 1.4.0a1
|
||||
*/
|
||||
class PEAR_Installer_Role_Data extends PEAR_Installer_Role_Common {}
|
||||
?>
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<role version="1.0">
|
||||
<releasetypes>php</releasetypes>
|
||||
<releasetypes>extsrc</releasetypes>
|
||||
<releasetypes>extbin</releasetypes>
|
||||
<releasetypes>zendextsrc</releasetypes>
|
||||
<releasetypes>zendextbin</releasetypes>
|
||||
<installable>1</installable>
|
||||
<locationconfig>data_dir</locationconfig>
|
||||
<honorsbaseinstall />
|
||||
<unusualbaseinstall />
|
||||
<phpfile />
|
||||
<executable />
|
||||
<phpextension />
|
||||
<config_vars />
|
||||
</role>
|
||||
Vendored
+28
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* PEAR_Installer_Role_Doc
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version CVS: $Id: Doc.php 313023 2011-07-06 19:17:11Z dufuz $
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since File available since Release 1.4.0a1
|
||||
*/
|
||||
|
||||
/**
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version Release: 1.9.4
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since Class available since Release 1.4.0a1
|
||||
*/
|
||||
class PEAR_Installer_Role_Doc extends PEAR_Installer_Role_Common {}
|
||||
?>
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
<role version="1.0">
|
||||
<releasetypes>php</releasetypes>
|
||||
<releasetypes>extsrc</releasetypes>
|
||||
<releasetypes>extbin</releasetypes>
|
||||
<releasetypes>zendextsrc</releasetypes>
|
||||
<releasetypes>zendextbin</releasetypes>
|
||||
<installable>1</installable>
|
||||
<locationconfig>doc_dir</locationconfig>
|
||||
<honorsbaseinstall />
|
||||
<unusualbaseinstall />
|
||||
<phpfile />
|
||||
<executable />
|
||||
<phpextension />
|
||||
<config_vars />
|
||||
</role>
|
||||
Vendored
+28
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* PEAR_Installer_Role_Ext
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version CVS: $Id: Ext.php 313023 2011-07-06 19:17:11Z dufuz $
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since File available since Release 1.4.0a1
|
||||
*/
|
||||
|
||||
/**
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version Release: 1.9.4
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since Class available since Release 1.4.0a1
|
||||
*/
|
||||
class PEAR_Installer_Role_Ext extends PEAR_Installer_Role_Common {}
|
||||
?>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user