Teach you how to create a keyword matching Project (search engine) ---- day 10, teach you how to do things _ PHP Tutorial

Source: Internet
Author: User
Teach you how to create a keyword matching Project (search engine) ---- day 10, teach you to do day 10. Teach you how to create a keyword matching Project (search engine) ---- day 10, teach you how to do things day 10 start: 1. teach you how to create a keyword matching Project (search engine) ---- first teach you how to do a keyword matching Project (search engine) ---- day 10, teach you how to do the tenth day

Day 10

Start point:

1. teach you how to create a keyword matching Project (search engine) ---- day 1

Review:

9. teach you how to create a keyword matching Project (search engine) ---- the ninth day

After receiving the Log recording task, Shuai was relieved to study it...

In fact, according to the boss's level, he is familiar with the open-source framework, and it is easy to write a common Logger. Why does he want to do it?

At that time, he couldn't figure it out because he had never experienced that stage.

Shuai's idea is actually quite simple, that is, to complete the tasks assigned by the boss and become a good employee capable of the job.

Shuai is not sensitive to demands at this stage, so he will study technical details as soon as he receives the task. I don't know if the code has been written.

The first draft of Shuai is to try to use the object-oriented thinking ability to write this Log record task. The first draft is as follows:

class Logger {        public static function log($message){        $file = fopen('application.error.log', "a+");        fwrite($file, $message);        fclose($file);    }}

The code for TopClient is as follows:

class TopClient {    ......    protected function logCommunicationError($apiName, $requestUrl, $errorCode, $responseTxt)    {        $localIp = isset($_SERVER["SERVER_ADDR"]) ? $_SERVER["SERVER_ADDR"] : "CLI";        $logData = "API_NAME:$apiName,APP_KEY:$this->appkey,CLIENT_IP:$localIp,SDK_VERSION:$this->sdkVersion,REQUEST_URL:$requestUrl,ERROR_CODE:$errorCode,ERROR_MSG:".str_replace("\n","",$responseTxt);        Logger::log($logData);    }    ......}

In fact, this is an improvement, and Shuai is finally slowly changing his thinking ability.

When Shuai found the boss with this code, he was very worried about it, but not what he wanted, so he said to him:

1. if you want to record the error log, how do you expect it to be used and what information you want to see.

2. if you want to record the warning log, how do you expect it to be used and what information you want to see.

3. if you want to debug the code and want to see the code execution efficiency, how do you expect it to be used and what information you want to see.

Why did the three handsome guys overwhelm me? I was a little angry when I heard it.

In this way, handsome boy thinks about what the boss says.

When Shuai was lucky enough to understand the meaning, he learned more powerful ways of mind. we hope he will be able to get started.


In Baidu search engines, search words match promotion keywords, for example?

Currently, Baidu has three matching methods: precision, phrase, and broad. Generally, the golden match method is: wide match + search term Report + negative keyword. In terms of traffic, it is widely used> phrase> accurate. you can set it based on your actual situation!

Teach you how to build a ghost xp system!

Okay, give me the red flag,

Tips (search engine) ---- day 10, teach you to do day 10 Start point: 1. teach you to do keyword matching Project (search engine) ---- first...

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.