我在Parse应用程序中遇到以下错误:PHP:
致命错误:在settings.php中找不到类'ParseQuery'
我设置文件的方式是我的所有Parse代码都在 index.php 中,并且该文件“包含”基于请求的“页面”的其他文件。
示例:
的index.php
<?php
// define location of Parse PHP SDK
define( 'PARSE_SDK_DIR', 'src/Parse/' );
// include Parse SDK autoloader
require_once( 'autoload.php' );
// Start session
session_start();
// Add the "use" declarations where you'll be using the classes
use Parse\ParseClient;
use Parse\ParseObject;
use Parse\ParseQuery;
use Parse\ParseACL;
use Parse\ParsePush;
use Parse\ParseUser;
use Parse\ParseInstallation;
use Parse\ParseException;
use Parse\ParseAnalytics;
use Parse\ParseFile;
use Parse\ParseCloud;
use Parse\ParseSessionStorage;
//Initialize Parse
ParseClient::initialize( 'xxx', 'yyy', 'zzz' );
//Check if the user is logged in
$currentUser = ParseUser::getCurrentUser();
if(!$currentUser){ header("Location: login.php"); }
// Load initial config & settins
require_once('settings.php');
?>
的settings.php
<?php
//General Settings
$query = new ParseQuery("Website_Settings");
try {
$settings = $query->find();
foreach($settings as $setting){
$config[$setting->get('name')] = $setting->get('value');
}
require_once(ABSPATH . 'load.php');
}
catch (ParseException $ex) {
print 'There was an error! Please forward this error to your system administrator: <br>'.$ex;
}
?>
包含的文件settings.php是否无法访问Parse类并在index.php中启动会话?