Knit using the Installation

Source: Internet
Author: User
Tags pear

Rookie one, contact PHP soon.

Scenario One: Simplest: Under Windows, PHP file reference kint

    1. Put Kint into the C-plate php/pear, I generally change the Kint package name Kint

The structure is as follows:

c:/php/pear/kint/kint.class.php

    1. In the PHP file

      Require (/kint/kint.class.php);

      DDD ($a);

Scenario two, under Windows, in the project, take the ECOS framework I used as an example

Similar to the situation, in the index.php require, and then directly in the project to play DDD ();

?

Situation three, server, project

    1. Copy the Kint package to the project root directory
    2. When calling in the project, write:

      require (root_dir.'/kint/kint.class.php ');

      DDD (123);

Note: Root_dir is a constant of the ECOS framework. Different frameworks have different ways of identifying the root directory. (You can also use PHP to get the root directory of the way)

?

?

Finally, a summary of the work of the past few months to use the debugging method (only a few months! ~ Rookie ~ ~ ~)

    1. PHP's

      ?

      Echo "<pre>";

Var_dump ($_post); Die ;

(sometimes do not write die, as needed ~ ~ ~)

    1. Firefox plugin firephp (this has been mentioned by others, but in fact I did not use it once = =!)
    2. Debugging the console for JS

      Console.log ();

      Console.dir ();

    3. Write your own to write the debug data to the file, and then print it out (no way, the frame is too complex, with die truncation)

      The code is as follows:

function Filetest_array ($arr, $FN = ' Test ') {

$str = Serialize ($arr). "\ n";

$filename = "d:/mytest/$fn".". TXT ";

File_put_contents ($filename, $str, file_append);

}

?

function filetest_string ($str, $fn = ' teststring ') {

$str = serialize ($arr);

$str = $str."\ n";

$filename = "d:/mytest/$fn".". TXT ";

File_put_contents ($filename, $str, file_append);

}

?

put the two programs into the framework index.php in

called in the project. :

Filetest_array ($arr 1);

?

then open d disk mytest Span style= "font-family: Arial" > folder test.txt, Copy the serialized string inside Paste into the deserialization program ( Span style= "Font-family:courier New" >html page form submission automatically generate test data ... more lazy

The deserialization code is as follows :

???? $str = <<<eof

A:1:{s:7: "Payment"; A:6:{s:8: "order_id"; a:1:{i:0;s:15: "160111092399094";} S:9: "member_id"; S:2: "One"; s:10: "Return_url"; s:54: "/work/ecstore/paymentecs/index.php/member-balance.html"; s:7: " Sumoney "; s:6:" 885.84 "; s:5:" Money "; s:6:" 885.84 "; s:10:" pay_app_id "; s:6:" Alipay ";}}

EOF;

???? $arr = Unserialize ($STR);

???? echo "<pre>";

???? Var_dump ($arr);

?

?

Note The string does not wrap. .

Knit using the Installation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.