pear:faq
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
pear:faq [2010/08/17 00:52] – created clockwerx | pear:faq [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== FAQ ====== | ====== FAQ ====== | ||
.. and other mailing list answers. | .. and other mailing list answers. | ||
+ | |||
+ | This page is meant to be a quick and easy scratchpad of good answers and ideas - candidates to be polished and migrated into the proper FAQs. | ||
+ | |||
+ | ===== Where' | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | |||
+ | ===== How do I become a PEAR developer? ===== | ||
+ | http:// | ||
===== Non-PEAR, PHP package deployment through official PEAR channel? ===== | ===== Non-PEAR, PHP package deployment through official PEAR channel? ===== | ||
Line 21: | Line 30: | ||
http:// | http:// | ||
+ | |||
+ | ===== Fixing code ===== | ||
+ | Fixing a unit test / E_DEPRECATED problem: Let's take for example, [[pear: | ||
+ | |||
+ | <code bash> | ||
+ | # Check the open bugs to see if there is one already | ||
+ | # http:// | ||
+ | |||
+ | # Grab the code from svn: | ||
+ | $ svn co http:// | ||
+ | |||
+ | # Next, run the unit tests to make sure it all works on your environment: | ||
+ | $ cd Net_DNS | ||
+ | $ php tests/ | ||
+ | |||
+ | # If the tests don't run, you may need to install phpunit or other dependencies | ||
+ | $ pear channel-discover pear.phpunit.de | ||
+ | $ pear install phpunit/ | ||
+ | $ php tests/ | ||
+ | |||
+ | </ | ||
+ | |||
+ | Hopefully, they all pass! | ||
+ | |||
+ | So, there are things to fix with ereg. | ||
+ | < | ||
+ | WARNING: Function ' | ||
+ | |||
+ | WARNING: Function ' | ||
+ | WARNING: Function ' | ||
+ | |||
+ | WARNING: Function ' | ||
+ | WARNING: Function ' | ||
+ | </ | ||
+ | |||
+ | The first - the constructor of Net_DNS_RR_TXT has: | ||
+ | <code php> | ||
+ | ereg(' | ||
+ | </ | ||
+ | |||
+ | It's probably best to start with a unit test that shows the error up: | ||
+ | <code php> | ||
+ | function Net_DNS_RR_TXT(& | ||
+ | ... snip ... | ||
+ | if ($offset) { | ||
+ | .... snip ... | ||
+ | } elseif (is_array($data)) { | ||
+ | .... snip ... | ||
+ | } else { | ||
+ | $data = str_replace(' | ||
+ | $data = str_replace(' | ||
+ | |||
+ | ereg(' | ||
+ | $regs[1] = str_replace(chr(2) . chr(2), ' | ||
+ | $regs[1] = str_replace(chr(1) . chr(1), ' | ||
+ | $regs[1] = stripslashes($regs[1]); | ||
+ | |||
+ | $this-> | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Would be something like: | ||
+ | <code php> | ||
+ | class Net_DNS_RR_TXTTest extends PHPUnit_Framework_TestCase { | ||
+ | |||
+ | public function testShouldConstruct() { | ||
+ | $foo = new Net_DNS_RR_TXT(null, | ||
+ | | ||
+ | } | ||
+ | |||
+ | } | ||
+ | </ | ||
+ | Run it to check it fails: | ||
+ | <code bash> | ||
+ | $ php tests/ | ||
+ | </ | ||
+ | So; to make the actual change: | ||
+ | http:// | ||
+ | |||
+ | Make the change, run the tests, and hey presto everything should pass. | ||
+ | |||
+ | Make yourself a universal diff: | ||
+ | <code bash>$ svn diff > myPatch.txt</ | ||
+ | |||
+ | ... and upload it to a bug report / pastebin. | ||
+ | |||
+ | ===== How do I edit this freakin' | ||
+ | Login with your SVN credentials. | ||
+ | |||
+ |
pear/faq.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1