EllisLab text mark
Advanced Search
1 of 2
1
   
Aptana best IDE for CodeIgniter ? Debug, SVN, localhost, etc ... help to configure
Posted: 22 May 2009 06:09 PM
Joined: 2009-05-22
8 posts

I’ve read vs users have tried Eclipse, Aptana and others ... I’m trying to stick to Aptana since the full package is easy to install, comaptible with Windows / Mac / Linux, free and has tons of great features pre like Preview , Debug, access to versioning, etc ...

But I cannot make Preview nor Debug work with CI. Regular PHP code works, previews and debugs perfectly well right out of the box, but not CI. Tried both the internal host and an external one. Same problem, works with PHP, not with CI.

I’ve seen many of you already wrote and tried Eclipse and Aptana, but I can not figure out how to configure my CodeIgniter or Aptana IDE , again to PREVIEW and DEBUG correctly. Could anyone PLEASE let me know what you changed and configured to make it work or if there is any special setting for my host both in the IDE and CodeIgniter config.php ?

I am sure your configuration tips will help a lot of people like me to get a full IDE package to work with CI ( based on a great and widely available standard ( Eclipse ), full of features to code, debug and test CI code that is very upgradeable and works with most OSs ).

Thank you very much in advance !
(again, I searched and read everything I could before asking, really hope I’m not repeating something already asked and answered ).

 
Posted: 22 May 2009 06:17 PM   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2008-05-18
2398 posts

Hi, welcome to the forums
Although I don’t use Aptana, I use Ecplise PDT, so it’ll still be largeley relevant to you

By preview, do you mean a WYSIWYG representation of your views?
Debug is a tricky one, as the eclipse debugger hasn’t moved on, so still only really works with procedural… it doesn’t know what $this->library->something() is actually doing

I’m not sure if Aptana has full autocomplete for libraries out of the box, but Eclipse didn;t, so I added this to base4.php in CI core

// All of these are added so I get real auto complete
// I don't have to worry about it causing any problems with deployment
// as this file never gets called as I'm in PHP5 mode

// Core CI libraries
$config = new CI_Config();
$db = new CI_DB_active_record();
$email = new CI_Email();
$form_validation = new CI_Form_validation();
$input = new CI_Input();
$load = new CI_Loader();
$router = new CI_Router();
$session = new CI_Session();
$table = new CI_Table();
$unit = new CI_Unit_test();
$uri = new CI_URI(); 

If you’re running PHP4, put it in base5.php instead
If you put it in the version you’re actually using, you’ll get some errors

 Signature 

I’m building a Project Management System for my 3rd year Uni project, Sign up to the beta
Track my progress | Post of the day: UI Designs
Get full auto complete support for CodeIgniter in Eclipse

 
Posted: 22 May 2009 06:30 PM   [ # 2 ]   [ Rating: 0 ]
Joined: 2009-05-22
8 posts

By Preview I mean that any php code you can preview as you code ( you can choose to preview it with an internal tabs for your browsers, in my Mac, both Safari and Firefox ) - I guess it has an interpreter or Apache internal server. You can also specify another localhost both in Debug Preview and HTML Preview preference tabs.

Did you get the Debugger to work ? ( works fine with OOP and everything I tried, not CI though :( But I guess I have something that I need to change / configure since my previews work, again with regular PHP code )

 
Posted: 22 May 2009 06:39 PM   [ # 3 ]   [ Rating: 0 ]
Avatar
Joined: 2008-05-18
2398 posts

I’ve not really tried getting Debug to work, log messages and echos are all I need smile (And I don’t even need them all that much)

 Signature 

I’m building a Project Management System for my 3rd year Uni project, Sign up to the beta
Track my progress | Post of the day: UI Designs
Get full auto complete support for CodeIgniter in Eclipse

 
Posted: 27 August 2009 10:51 PM   [ # 4 ]   [ Rating: 0 ]
Joined: 2009-08-17
12 posts

Hi Dam1an, so I just paste it in base4.php? Outside the class and I’m all set? Thanks in advance!

Dam1an - 22 May 2009 10:17 PM

Hi, welcome to the forums
Although I don’t use Aptana, I use Ecplise PDT, so it’ll still be largeley relevant to you

By preview, do you mean a WYSIWYG representation of your views?
Debug is a tricky one, as the eclipse debugger hasn’t moved on, so still only really works with procedural… it doesn’t know what $this->library->something() is actually doing

I’m not sure if Aptana has full autocomplete for libraries out of the box, but Eclipse didn;t, so I added this to base4.php in CI core

// All of these are added so I get real auto complete
// I don't have to worry about it causing any problems with deployment
// as this file never gets called as I'm in PHP5 mode

// Core CI libraries
$config = new CI_Config();
$db = new CI_DB_active_record();
$email = new CI_Email();
$form_validation = new CI_Form_validation();
$input = new CI_Input();
$load = new CI_Loader();
$router = new CI_Router();
$session = new CI_Session();
$table = new CI_Table();
$unit = new CI_Unit_test();
$uri = new CI_URI(); 

If you’re running PHP4, put it in base5.php instead
If you put it in the version you’re actually using, you’ll get some errors

 
Posted: 03 January 2010 11:49 AM   [ # 5 ]   [ Rating: 0 ]
Avatar
Joined: 2009-10-29
42 posts

Don’t know if this can help you, but I am using Aptana + Xammp

Xampp (http://www.apachefriends.org/en/xampp.html) is a personal development server that runs on your local machine.  It contains:

- Apache
- Php
- Mysql
- Perl
- PhpMyAdmin

You can set up Apache so that the root directory is your project.  Then, surf to http://127.0.0.1 on your PC and see your work, check the apache php error logs for errors and debugging.

This is a very simplified explanation.  I had to google around to figure out how to edit my hosts file so I could work on more than one project at a time.  I had to add virtual hosts to my apache config for the same reason.  But it is all worth it.  You can preview the PHP output directly in Aptana 2.X, or you can just use Firefox to view it.  Want to mess around with CSS values and see the results?  Use Firefox + FireBug and include FirePHP so you can print debugging info from PHP directly to FireBug.

As far as debugging goes, there are the error logs.  But you can also overload PHP’s default error handling with your own functions that provide a backtrace when things go south.  Google that too, I use a similar approach for my debugging needs.

Let me know if you need more help.

 
Posted: 24 January 2010 02:37 PM   [ # 6 ]   [ Rating: 0 ]
Joined: 2010-01-09
2 posts

Ok, I must be missing something, but this technique is not working for me.

I’m using Code Igniter 1.7.2 and Eclipse 3.5.1 (PDT).

Since I’m using PHP 5, I added:

$config = new CI_Config();
$db = new CI_DB_active_record();
$email = new CI_Email();
$form_validation = new CI_Form_validation();
$input = new CI_Input();
$load = new CI_Loader();
$router = new CI_Router();
$session = new CI_Session();
$table = new CI_Table();
$unit = new CI_Unit_test();
$uri = new CI_URI(); 

Into Base4.php such that:

<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
 * CodeIgniter
 *
 * An open source application development framework for PHP 4.3.2 or newer
 *
 * @package        CodeIgniter
 * @author        ExpressionEngine Dev Team
 * @copyright    Copyright (c) 2008 - 2009, EllisLab, Inc.
 * @license        http://ellislab.com/codeigniter/user-guide/license.html
 * @link        http://codeigniter.com
 * @since        Version 1.3
 * @filesource
 */

// ------------------------------------------------------------------------

/**
 * CI_BASE - For PHP 4
 *
 * This file is used only when CodeIgniter is being run under PHP 4.
 *
 * In order to allow CI to work under PHP 4 we had to make the Loader class
 * the parent of the Controller Base class.  It's the only way we can
 * enable functions like $this->load->library('email') to instantiate
 * classes that can then be used within controllers as $this->email->send()
 *
 * PHP 4 also has trouble referencing the CI super object within application
 * constructors since objects do not exist until the class is fully
 * instantiated.  Basically PHP 4 sucks...
 *
 * Since PHP 5 doesn't suffer from this problem so we load one of
 * two files based on the version of PHP being run.
 *
 * @package        CodeIgniter
 * @subpackage    codeigniter
 * @category    front-controller
 * @author        ExpressionEngine Dev Team
 * @link        http://ellislab.com/codeigniter/user-guide/
 */

$config = new CI_Config();
$db = new CI_DB_active_record();
$email = new CI_Email();
$form_validation = new CI_Form_validation();
$input = new CI_Input();
$load = new CI_Loader();
$router = new CI_Router();
$session = new CI_Session();
$table = new CI_Table();
$unit = new CI_Unit_test();
$uri = new CI_URI(); 


However, still if I do the following:

<?php
class Test extends Controller {
    
function __construct()
    
{
        parent
::Controller();            
    
}
    
function mytest($abc,$def,$ghi)
    
{
        $this
->load->
    
}
}

?> 


I do not get auto-completion on the load function.

Am I missing something?

I’m new to this whole IDE thing, and I’m new to CodeIgniter, as I result I could be missing something really silly.

Typically I’ve always just used notepad2 and coded from scratch.

Thanks,
Doug

I’ve programmed a ton of stuff from scratch with notepad2

 
Posted: 26 January 2010 08:13 PM   [ # 7 ]   [ Rating: 0 ]
Joined: 2010-01-26
2 posts

To get it work must be like this

On system/codeigniter/Base4.php (if you are using php5)
otherwise
On system/codeigniter/Base5.php

class CI_Base extends CI_Loader {

    
/**
     * @var CI_Config
     */
    
var $config;
    
/**
     * @var CI_DB_active_record
     */
    
var $db;
    
/**
     * @var CI_Email
     */
    
var $email;
    
/**
     * @var CI_Form_validation
     */
    
var $form_validation;
    
/**
     * @var CI_Input
     */
    
var $input;
    
/**
     * @var CI_Loader
     */
    
var $load;
    
/**
     * @var CI_Router
     */
    
var $router;
    
/**
     * @var CI_Session
     */
    
var $session;
    
/**
     * @var CI_Table
     */
    
var $table;
    
/**
     * @var CI_Unit_test
     */
    
var $unit;
    
/**
     * @var CI_URI
     */
    
var $uri;
    
/**
     * @var CI_Pagination
     */
    
var $pagination;

/* ... */ 

And this also works for NuSphere(phpEd) and Aptana

 
Posted: 10 February 2010 02:55 PM   [ # 8 ]   [ Rating: 0 ]
Joined: 2009-10-20
30 posts
Sergio Loza - 27 January 2010 01:13 AM

To get it work must be like this

On system/codeigniter/Base4.php (if you are using php5)
otherwise
On system/codeigniter/Base5.php

class CI_Base extends CI_Loader {

    
/**
     * @var CI_Config
     */
    
var $config;
    
/**
     * @var CI_DB_active_record
     */
    
var $db;
    
/**
     * @var CI_Email
     */
    
var $email;
    
/**
     * @var CI_Form_validation
     */
    
var $form_validation;
    
/**
     * @var CI_Input
     */
    
var $input;
    
/**
     * @var CI_Loader
     */
    
var $load;
    
/**
     * @var CI_Router
     */
    
var $router;
    
/**
     * @var CI_Session
     */
    
var $session;
    
/**
     * @var CI_Table
     */
    
var $table;
    
/**
     * @var CI_Unit_test
     */
    
var $unit;
    
/**
     * @var CI_URI
     */
    
var $uri;
    
/**
     * @var CI_Pagination
     */
    
var $pagination;

/* ... */ 

And this also works for NuSphere(phpEd) and Aptana

Nope, this does’nt do the trick for me. Is there any additional settings required in Eclipse?

 
Posted: 10 February 2010 09:14 PM   [ # 9 ]   [ Rating: 0 ]
Joined: 2010-01-26
2 posts

Have you config the libraries for eclipse??

 
Posted: 23 February 2010 04:55 PM   [ # 10 ]   [ Rating: 0 ]
Joined: 2009-12-20
3 posts

For me work perfect Dam1an

I paste this at the end of the constructor of CI_Base in Base4.php

 
Posted: 23 February 2010 06:24 PM   [ # 11 ]   [ Rating: 0 ]
Avatar
Joined: 2007-11-25
195 posts

Are you trying to preview a controller or the index.php file? All requests are required to go through the index.php file. You your previewing a controller file it wont work.

 
Posted: 14 May 2010 12:11 PM   [ # 12 ]   [ Rating: 0 ]
Joined: 2009-03-24
27 posts

I use and suggest free PHP IDE - Codelobster PHP Edition with special CodeIgniter plug-in.

 
Posted: 14 May 2010 01:59 PM   [ # 13 ]   [ Rating: 0 ]
Avatar
Joined: 2009-12-08
1804 posts
clod - 14 May 2010 04:11 PM

I use and suggest free PHP IDE - Codelobster PHP Edition with special CodeIgniter plug-in.

($25)

 Signature 

@basdflasjk | BitAuth: Authentication and Role-based Permissions | Session Library Replacement


Please read the User Guide! (Upgrading from a previous version?)

 
Posted: 23 May 2010 11:58 PM   [ # 14 ]   [ Rating: 0 ]
Joined: 2010-05-23
3 posts

can u pls tell me how to configure aptana for php

 
Posted: 10 July 2010 08:15 AM   [ # 15 ]   [ Rating: 0 ]
Joined: 2010-06-29
2 posts

I also like to use Aptana because it is more easy to use and install easily. It is compatible with any operating system

 
1 of 2
1