Homemade a small website, one of the features always have questions, ask you to answer

Source: Internet
Author: User
Homemade a small website, one of the features always have a problem, ask you to answer?
One.php: (entry to start running)

/**
* index.php mylocalshop Entrance

* @copyright (C) 2013-2014 Mylocalshop
* @licensehttp://www.baidu.com/
* @lastmodify2013-01-07
*/


/**
* Site root directory path
* @var String
*/
Define (' Localshop_path ', DirName (__file__). Directory_separator);
Echo Localshop_path;

Require_once Localshop_path. ' /base.php ';
$mls = new MLS ();
$mls->load (' front/includes/', ' DINDEX.PHDP '); This is wrong, but why is it also shown correctly here?
$mls->load (' front/includes/', ' index.php '); This is the real file name.
?>


Dir_list.php: (Displays the directory tree structure used to determine whether the directory or file is in base.php)
 
!--? php
/**
* Displays the entire site's directory tree structure
* @author Administrator
*
*/
function Dir_list () {
return Array (
' admin ' = = = Array (
' CSS ',
' images ',
' includes ' = = Array (
') Libs '
),
' JS '
),
' common ' = = Array (
' config ' = = Array (
' admin ' = = = Array (
' config.php ')
),
' front ' = = Array (
' config.php '
),
' config.php ',
' dir_list.php '
),
' includes ' = Array (
' libs '
),
' JS ',
' languages ' = = Array (
' en_us ' = = Array (
' admin ' = = = Array (
') Common.php '
),
' front ' = = Array (
' common.php '
)
),
' zh_cn ' = = Array (
' admin ' = = Array (
' common.php '
),
' front ' = = Array (
' common.php '
)
)
),
' templates ' = = Array (
' templates.php '
)
),
' front ' = = Array (
' CSS ',
' images ',
' includes ' = = Array (
' libs '
) ,
' JS '
),
//' base.php ',
//' index.php '
);
}
?


base.php: (Used to check if the directory and file name exist, and then turn to the referring page)

/**
* Mylocalshop Frame Entrance
* @author Administrator
*
*/
Require_once Localshop_path. ' /common/config/dir_list.php ';

Class MLS {
/**
* Private Function. Determines whether the directory or file exists, returns True if none, and returns false
* @param string $target directory or file
* @return If the file type is determined to return "Befile", if the directory type is determined to return "Bedir", if neither the file nor the directory returns false.
*/
Private Function Hasdirectoryorfile ($target) {
$dirs = Mls::load_all_directory ();

foreach ($dirs as $key = = $value) {
if (In_array ($target, $value)) {
$suffix = substr ($target,-1, 4);
if ($suffix = = = '. php ')
/*if (STRRCHR ('. php ', $target) | | STRRCHR ('. html ', $target) | | strrchr ('. htm ', $target) | | strrchr ('. xhtm ', $target) | |
  • 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.