将 zend studio 与 codeigniter 结合使用

发布于 2024-08-10 17:43:32 字数 162 浏览 11 评论 0原文

我想使用 Zend Studio 来构建一个基于 CodeIgniter 的项目。但我希望能够使用 Zend 的调试功能。因此,我似乎无法让调试器正常工作,因为它不“理解”codeigniter。那么,为了使设置正常工作,我是否需要安装 Zend 服务器,以便在服务器端完成调试?有人可以向我解释一下吗?谢谢。

I want to use Zend Studio for a project built on CodeIgniter. But I want to be able to use the debugging functionality of Zend. Because of that, I cant seem to get the debugger to work properly cause it doesnt "understand" codeigniter. So, in order for the setup to work, do I need to install Zend server, so that the debugging is done serverside? Can someone explain this to me a bit? Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

杀お生予夺 2024-08-17 17:43:32

正如 Iraklis 所说,论坛有答案,为了节省人们额外的搜索,这对我有用:

第 1 步

添加:

<?php
class CI_Controller {
    /**
     *
     * @var CI_DB_active_record
     */
    public $db;

    /**
     *
     * @var CI_Loader
     */
    public $load;

    /**
     *
     * @var CI_Output
     */
    public $output;

    /**
     *
     * @var CI_Email
     */
    public $email;

    /**
     *
     * @var CI_Session
     */
    public $session;

    /**
     *
     * @var CI_Config
     */
    public $config;

    /**
     *
     * @var CI_Benchmark
     */
    public $benchmark;

    /**
     *
     * @var CI_Calendar
     */
    public $calendar;

    /**
     *
     * @var CI_Cart
     */
    public $cart;

    /**
     *
     * @var CI_Encrypt
     */
    public $encrypt;

    /**
     *
     * @var CI_Upload
     */
    public $upload;

    /**
     *
     * @var CI_Form_validation
     */
    public $form_validation;

    /**
     *
     * @var CI_FTP
     */
    public $ftp;

    /**
     *
     * @var CI_Table
     */
    public $table;

    /**
     *
     * @var CI_Image_lib
     */
    public $image_lib;

    /**
     *
     * @var CI_Input
     */
    public $input;

    /**
     *
     * @var CI_Language
     */
    public $lang;

    /**
     *
     * @var CI_Pagination
     */
    public $pagination;

    /**
     *
     * @var CI_Trackback
     */
    public $trackback;

    /**
     *
     * @var CI_Parser
     */
    public $parser;

    /**
     *
     * @var CI_Typography
     */
    public $typography;

    /**
     *
     * @var CI_Unit_test
     */
    public $unit;

    /**
     *
     * @var CI_URI
     */
    public $uri;

    /**
     *
     * @var CI_User_agent
     */
    public $agent;

    /**
     *
     * @var CI_Xmlrpcs
     */
    public $xmlrpcs;

    /**
     *
     * @var CI_Xmlrpc
     */
    public $xmlrpc;

    /**
     *
     * @var CI_Zip
     */
    public $zip;

}

<?php
/**
 * 
 * Enter description here ...
 * @return CI_Controller
 */
function get_instance()
{

}

到项目包含的文件中(为每个文件创建一个新文件,以确保安全并确保包含它)在构建路径中)

第 2 步

重新构建以确保 eclipse/zend 知道更改。

难以忽视的事实:

不幸的是,这不适用于视图变量,仅适用于 $this-> 调用,因为 Codeigniter 使用 arrays 来存储 变量名称 code>,因此 eclipse/zend 需要运行代码才能看到它们。为了使自动检测变得更加困难,这是跨文件完成的,并且文件名是使用变量设置的。

这是一个例子:

views/controllers/file.php 中,你输入:

$data['foo']='foo text';
$this->load->view("foo",$data);  //"foo" is the filename without the .php extension

views/foo.php 中,你得到:

echo $foo;
//outputs: "foo text"

但这就是 codeigniter 的工作方式。

来源:
https://github.com/scoumbourdis/codeigniter-autocomplete/tree /master/application/libraries/fake

完整教程:
http://www.web-and-development.com/codeigniter-和-eclipse-自动完成/

As Iraklis said, the forum had the answer, to save people some extra searching, here's what worked for me:

Step 1

add:

<?php
class CI_Controller {
    /**
     *
     * @var CI_DB_active_record
     */
    public $db;

    /**
     *
     * @var CI_Loader
     */
    public $load;

    /**
     *
     * @var CI_Output
     */
    public $output;

    /**
     *
     * @var CI_Email
     */
    public $email;

    /**
     *
     * @var CI_Session
     */
    public $session;

    /**
     *
     * @var CI_Config
     */
    public $config;

    /**
     *
     * @var CI_Benchmark
     */
    public $benchmark;

    /**
     *
     * @var CI_Calendar
     */
    public $calendar;

    /**
     *
     * @var CI_Cart
     */
    public $cart;

    /**
     *
     * @var CI_Encrypt
     */
    public $encrypt;

    /**
     *
     * @var CI_Upload
     */
    public $upload;

    /**
     *
     * @var CI_Form_validation
     */
    public $form_validation;

    /**
     *
     * @var CI_FTP
     */
    public $ftp;

    /**
     *
     * @var CI_Table
     */
    public $table;

    /**
     *
     * @var CI_Image_lib
     */
    public $image_lib;

    /**
     *
     * @var CI_Input
     */
    public $input;

    /**
     *
     * @var CI_Language
     */
    public $lang;

    /**
     *
     * @var CI_Pagination
     */
    public $pagination;

    /**
     *
     * @var CI_Trackback
     */
    public $trackback;

    /**
     *
     * @var CI_Parser
     */
    public $parser;

    /**
     *
     * @var CI_Typography
     */
    public $typography;

    /**
     *
     * @var CI_Unit_test
     */
    public $unit;

    /**
     *
     * @var CI_URI
     */
    public $uri;

    /**
     *
     * @var CI_User_agent
     */
    public $agent;

    /**
     *
     * @var CI_Xmlrpcs
     */
    public $xmlrpcs;

    /**
     *
     * @var CI_Xmlrpc
     */
    public $xmlrpc;

    /**
     *
     * @var CI_Zip
     */
    public $zip;

}

and

<?php
/**
 * 
 * Enter description here ...
 * @return CI_Controller
 */
function get_instance()
{

}

into files included by your project (create a new file for each just to be safe and make sure it's included in build path)

Step 2

Rebuild to make sure eclipse/zend is aware of the change.

The inconvenient truth:

Unfortunately this won't work for views variables, only for $this-> calls, because Codeigniter uses arrays to store variable names, so eclipse/zend would need to be running the code in order to see them. And to make things even harder to detect automatically, this is done cross-file and the filename is set using a variable.

here is one example:

in views/controllers/file.php you put:

$data['foo']='foo text';
$this->load->view("foo",$data);  //"foo" is the filename without the .php extension

in views/foo.php you get:

echo $foo;
//outputs: "foo text"

But this is just the way codeigniter works.

source:
https://github.com/scoumbourdis/codeigniter-autocomplete/tree/master/application/libraries/fake

full tutorial:
http://www.web-and-development.com/codeigniter-and-eclipse-autocomplete/

远昼 2024-08-17 17:43:32

我建议您搜索 codeigniter 的论坛。那里有一些讨论 Zend 集成的线程。

I would advise you to search codeigniter's forum. There are a few threads there discussing Zend integration.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文