Lecture 1: Building a mall project (lecture 138th); Lecture 1: 138_PHP tutorial

Source: Internet
Author: User
Lecture 1: Building a mall project (Lecture 1); Lecture 1: 138th. Lecture 1: Building a mall project (Lecture 1); Lecture 1: example of building a mall framework: file storage directory Image 3: Code Part index. php code 1? Php2 ** 3 Lecture 1: Building a mall project (Lecture 2); Lecture 1: 138th

I. example of mall framework construction

II. file storage directory location images III. codeIndex. php code
1
 Host ."
";

Init. php code

1
 

Db. class. php

1
  AutoExecute ('user', array ('username' => 'zs', 'Email '=> 'zs @ qq.com', 'insert'); 46 is automatically converted: insert into user (username, email) values ('zs', 'zs @ qq.com '); 47 */48 public abstract function autoExecute ($ table, $ data, $ act = 'insert', $ where); 49}

Conf. class. php code

1
  Data = $ _ CFG; 17} 18 final protected function _ clone () {19} 20 // Singleton mode 21 public static function getIns () {22 if (self :: $ ins instanceof self) {23 return self: $ ins; 24} else {25 self: $ ins = new self (); 26 return self: $ ins; 27} 28} 29 // read the information in the data attribute by Magic 30 public function _ get ($ key) {31 if (array_key_exists ($ key, $ this-> data) {32 return $ this-> data [$ key]; 33} else {34 return null; 35} 36} 37 // during running, add or change the configuration option 38 public function _ set ($ key, $ value) {39 $ this-> data [$ key] = $ value; 40} 41} 42/* 43 // test code 44 // test whether a singleton mode object can be created 45 $ conf = conf: getIns (); 46 // read option 47 echo $ conf-> host."
"; 48 echo $ conf-> user ."
"; 49 // dynamic append option 50 $ conf-> template_dir =" D: \ LAMP \ Apache2.2 \ htdocs \ boolshop \ include "; 51 echo $ conf-> template_dir; 52 */53 config. inc. php code 54

Workshop (lecture 138th), Lecture 138 1: example of mall framework construction Figure 2: file storage directory location Image 3: Code Part index. php code 1? Php 2/** 3...

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.