English 中文(简体)
PHP找不到我的班级吗?
原标题:PHP can not find my class?
  • 时间:2012-05-24 14:46:03
  •  标签:
  • php

我如何确定确切的绝对路径?

文件在此。 我像这样指定它 :

include "/home/core/public_html/d/core/source/class.Control.php";

但它告诉我它不是。

严重性 > 致命错误: 在 / home/ core/ public_ html/ d/ core/ sources/ sources/ class. ControlEntry.php 在 {%/ strong> 中找不到等级控制 。

守则:

 <?php 
class ControlEntry
{
    private $control_object;

    function __construct( $control_object )
    {
        $this->control_object = $control_object;
    }
    public function actuate()  
    {   
        if( isset($_POST[ ajax_type ]) )
        {
            $this->control_object->ajax( $_POST[ ajax_type ] );
        }
        else
        {
            $this->control_object->reload();
        }
    }
}
include "/home/core/public_html/d/core/source/class.Control.php"; // Can not find this f***ing file even though it is there.
$control_entry_object = new ControlEntry( new Control() );
$control_entry_object->actuate();

< 坚固> 卢布射击列表

最佳回答

错误起源于 class. controlEntry.php 。 请确定您在装入 ControlEntry之前装入 class. control.php

问题回答

这是绝对路径。 它看起来不像一个错误。 实际上它表示没有找到“ 类” 。 它没有表示找不到“ 类” 。 在您的类中, 我想应该是“ 文件” 。 控制 Entry.php 第3行引用了“ 控制” 。 您在使用它之前需要包含包含控件的文件 。

您重新包含 / home/ domain/ public_ html/ d/ core/ sources/ sources/ class. control. php ; ; 但错误显示为 < code>/ home/ domain/ public_ html/ d/ cocle/ sources/ class. > 。 您确定您是否包含正确的文件或即时排序?





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...