我有一个app
文件夹,其中包含includes
和public
文件夹。
像这样:
包含文件夹包含以下文件:
bootstrap.php
config.php
config.php
包含以下代码:
<?php
return array(
'host' => 'localhost',
'username' => 'root',
'password' => '',
'db' => 'imagebox2016'
);
boostrap.php
包含以下代码:
<?php
// bootstrap code
$config = require_once 'config.php';
$dsn = "mysql:host=$config[host];dbname=$config[db]";
try {
$dbh = new PDO($dsn, $config['username'], $config['password']);
} catch(PDOException $e) {
echo 'Connection failed: ' . $e->getMessage();
}
在public
文件夹中有一个名为signup.php
它从这样开始并成功运行:
<?php
require_once '../includes/bootstrap.php';
我的问题是当我在boostrap.php
中加入signup.php
时,bootstrap.php
成功地包含config.php
的时间是{1}},而includes
是include_path
文件夹?
PHP states:
根据给定的文件路径包含文件,如果没有给出,则包含 指定的include_path。如果在。中找不到该文件 include_path,include将最终检入调用脚本自己的 失败前的目录和当前工作目录。该 如果找不到文件,include构造将发出警告
我没有修改我的function initialize() {
var secheltLoc = new google.maps.LatLng(49.47216, -123.76307);
var myMapOptions = {
zoom: 15,
center: secheltLoc,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var theMap = new google.maps.Map(document.getElementById("map_canvas"), myMapOptions);
var marker = new google.maps.Marker({
map: theMap,
draggable: true,
position: new google.maps.LatLng(49.47216, -123.76307),
visible: true
});
var boxText = document.createElement("div");
boxText.style.cssText = "border: 1px solid black; margin-top: 8px; background: white; padding: 5px; text-align: center;";
boxText.innerHTML = "Drag the map to re-center location";
var myOptions = {
content: boxText,
disableAutoPan: false,
maxWidth: 0,
pixelOffset: new google.maps.Size(-140, 0),
zIndex: null,
boxStyle: {
background: "url('http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/examples/tipbox.gif') no-repeat",
opacity: 0.75,
width: "280px"
},
closeBoxMargin: "10px 2px 2px 2px",
closeBoxURL: "http://www.google.com/intl/en_us/mapfiles/close.gif",
infoBoxClearance: new google.maps.Size(1, 1),
isHidden: false,
pane: "floatPane",
enableEventPropagation: false
};
google.maps.event.addListener(marker, "click", function(e) {
ib.open(theMap, this);
});
var ib = new InfoBox(myOptions);
ib.open(theMap, marker);
}
google.maps.event.addDomListener(window, 'load', initialize);