2013-03-15 18 views
5

मैं कोडइग्निटर फ्रेमवर्क का उपयोग करके एक PHP वेब एप्लिकेशन विकसित करने के लिए इंटेलिजे आईडीईए 12 का उपयोग कर रहा हूं। तरीके के कारण करने के लिए सीआई वस्तुओं और तरीकों को दर्शाता है, आईडिया सोचता है कि वे मौजूद नहीं है, जब वे कहा जाता है:IntelliJ IDEA 12 कोडइग्निटर कक्षाओं को नहीं ढूंढ रहा है, त्रुटियों को फेंक रहा है

enter image description here

आप देख सकते हैं, मैं हर एक CodeIgniter वर्ग/विधि के तहत उन लोगों कष्टप्रद नारंगी squigglies मिल मैं उपयोग करने की कोशिश करता हूँ।

यहाँ कैसे वे वस्तुओं बना रहे हैं में कुछ अंतर्दृष्टि दे CI_Controller वर्ग के लिए कोड है,:

class CI_Controller { 

    private static $instance; 

    /** 
    * Constructor 
    */ 
    public function __construct() 
    { 
     self::$instance =& $this; 

     // Assign all the class objects that were instantiated by the 
     // bootstrap file (CodeIgniter.php) to local class variables 
     // so that CI can run as one big super object. 
     foreach (is_loaded() as $var => $class) 
     { 
      $this->$var =& load_class($class); 
     } 

     $this->load =& load_class('Loader', 'core'); 

     $this->load->initialize(); 

     log_message('debug', "Controller Class Initialized"); 
    } 

    public static function &get_instance() 
    { 
     return self::$instance; 
    } 
} 

वहाँ किसी भी तरह से मैं IntelliJ विचार प्राप्त कर सकते हैं या तो इन त्रुटियों (लेकिन अन्य नहीं त्रुटियों को अनदेखा करने के लिए है), या वस्तुओं को खोजने के लिए इसे अपने आप प्राप्त करें?

नोट: मैं इंटेलिजे आईडीईए प्लेटफ़ॉर्म पर एक PHP आईडीई बिल्ड, PHPStorm का उपयोग करता था, और यह कोडइग्निटर पर आया था।

+0

'Aptana' का उपयोग करें। 'कोडिनेटर' के लिए यह सही है। –

+1

@ योगेश सुथार मैं इसे देख लूंगा, लेकिन मैं इंटेलिजे आईडीईए के साथ सीआई काम करने का समाधान पसंद करूंगा। –

+0

एक Google खोज से पता चलता है कि आप समस्या के साथ एकमात्र नहीं हैं। मैं सब्लिमे टेक्स्ट का उपयोग करता हूं और यह सीआई के लिए बिल्कुल सही है - तीसरे पक्ष द्वारा बनाए गए कुछ कोड समापन प्लगइन्स भी हैं। –

उत्तर

8

मैंने इसे this guide का पालन करके हल किया। यह PHPStorm के लिए था, लेकिन इंटेलिजे आईडीईए के लिए भी काम करता है (शायद वेबस्टॉर्म भी!)। वास्तव में, यह बहुत आसान था। एक बुनियादी पुनरावृत्ति:

  1. मेरे प्रोजेक्ट रूट में निम्न PHP कोड सहेजा गया।
 
    <?php die('This file is not really here!'); 

    /** 
    * ------------- DO NOT UPLOAD THIS FILE TO LIVE SERVER --------------------- 
    * 
    * Implements code completion for CodeIgniter in phpStorm 
    * phpStorm indexes all class constructs, so if this file is in the project it will be loaded. 
    * ------------------------------------------------------------------- 
    * Drop the following file into a CI project in phpStorm 
    * You can put it in the project root and phpStorm will load it. 
    * (If phpStorm doesn't load it, try closing the project and re-opening it) 
    * 
    * Under system/core/ 
    * Right click on Controller.php and set Mark as Plain Text 
    * Do the same for Model.php 
    * ------------------------------------------------------------------- 
    * This way there is no editing of CI core files for this simple layer of code completion. 
    * 
    * PHP version 5 
    * 
    * LICENSE: GPL http://www.gnu.org/copyleft/gpl.html 
    * 
    * Created 1/28/12, 11:06 PM 
    * 
    * @category 
    * @package CodeIgniter CI_phpStorm.php 
    * @author  Jeff Behnke 
    * @copyright 2009-11 Valid-Webs.com 
    * @license GPL http://www.gnu.org/copyleft/gpl.html 
    * @version 2012.01.28 
    */ 

    /** 
    * @property CI_DB_active_record $db    This is the platform-independent base Active Record implementation class. 
    * @property CI_DB_forge $dbforge     Database Utility Class 
    * @property CI_Benchmark $benchmark    This class enables you to mark points and calculate the time difference between them.
Memory consumption can also be displayed. * @property CI_Calendar $calendar This class enables the creation of calendars * @property CI_Cart $cart Shopping Cart Class * @property CI_Config $config This class contains functions that enable config files to be managed * @property CI_Controller $controller This class object is the super class that every library in.
CodeIgniter will be assigned to. * @property CI_Email $email Permits email to be sent using Mail, Sendmail, or SMTP. * @property CI_Encrypt $encrypt Provides two-way keyed encoding using XOR Hashing and Mcrypt * @property CI_Exceptions $exceptions Exceptions Class * @property CI_Form_validation $form_validation Form Validation Class * @property CI_Ftp $ftp FTP Class * @property CI_Hooks $hooks Provides a mechanism to extend the base system without hacking. * @property CI_Image_lib $image_lib Image Manipulation class * @property CI_Input $input Pre-processes global input data for security * @property CI_Lang $lang Language Class * @property CI_Loader $load Loads views and files * @property CI_Log $log Logging Class * @property CI_Model $model CodeIgniter Model Class * @property CI_Output $output Responsible for sending final output to browser * @property CI_Pagination $pagination Pagination Class * @property CI_Parser $parser Parses pseudo-variables contained in the specified template view,
replacing them with the data in the second param * @property CI_Profiler $profiler This class enables you to display benchmark, query, and other data
in order to help with debugging and optimization. * @property CI_Router $router Parses URIs and determines routing * @property CI_Session $session Session Class * @property CI_Sha1 $sha1 Provides 160 bit hashing using The Secure Hash Algorithm * @property CI_Table $table HTML table generation
Lets you create tables manually or from database result objects, or arrays. * @property CI_Trackback $trackback Trackback Sending/Receiving Class * @property CI_Typography $typography Typography Class * @property CI_Unit_test $unit_test Simple testing class * @property CI_Upload $upload File Uploading Class * @property CI_URI $uri Parses URIs and determines routing * @property CI_User_agent $user_agent Identifies the platform, browser, robot, or mobile devise of the browsing agent * @property CI_Validation $validation //dead * @property CI_Xmlrpc $xmlrpc XML-RPC request handler class * @property CI_Xmlrpcs $xmlrpcs XML-RPC server class * @property CI_Zip $zip Zip Compression Class * @property CI_Javascript $javascript Javascript Class * @property CI_Jquery $jquery Jquery Class * @property CI_Utf8 $utf8 Provides support for UTF-8 environments * @property CI_Security $security Security Class, xss, csrf, etc... */ class CI_Controller{} /** * @property CI_DB_active_record $db This is the platform-independent base Active Record implementation class. * @property CI_DB_forge $dbforge Database Utility Class * @property CI_Benchmark $benchmark This class enables you to mark points and calculate the time difference between them.
Memory consumption can also be displayed. * @property CI_Calendar $calendar This class enables the creation of calendars * @property CI_Cart $cart Shopping Cart Class * @property CI_Config $config This class contains functions that enable config files to be managed * @property CI_Controller $controller This class object is the super class that every library in.
CodeIgniter will be assigned to. * @property CI_Email $email Permits email to be sent using Mail, Sendmail, or SMTP. * @property CI_Encrypt $encrypt Provides two-way keyed encoding using XOR Hashing and Mcrypt * @property CI_Exceptions $exceptions Exceptions Class * @property CI_Form_validation $form_validation Form Validation Class * @property CI_Ftp $ftp FTP Class * @property CI_Hooks $hooks Provides a mechanism to extend the base system without hacking. * @property CI_Image_lib $image_lib Image Manipulation class * @property CI_Input $input Pre-processes global input data for security * @property CI_Lang $lang Language Class * @property CI_Loader $load Loads views and files * @property CI_Log $log Logging Class * @property CI_Model $model CodeIgniter Model Class * @property CI_Output $output Responsible for sending final output to browser * @property CI_Pagination $pagination Pagination Class * @property CI_Parser $parser Parses pseudo-variables contained in the specified template view,
replacing them with the data in the second param * @property CI_Profiler $profiler This class enables you to display benchmark, query, and other data
in order to help with debugging and optimization. * @property CI_Router $router Parses URIs and determines routing * @property CI_Session $session Session Class * @property CI_Sha1 $sha1 Provides 160 bit hashing using The Secure Hash Algorithm * @property CI_Table $table HTML table generation
Lets you create tables manually or from database result objects, or arrays. * @property CI_Trackback $trackback Trackback Sending/Receiving Class * @property CI_Typography $typography Typography Class * @property CI_Unit_test $unit_test Simple testing class * @property CI_Upload $upload File Uploading Class * @property CI_URI $uri Parses URIs and determines routing * @property CI_User_agent $user_agent Identifies the platform, browser, robot, or mobile devise of the browsing agent * @property CI_Validation $validation //dead * @property CI_Xmlrpc $xmlrpc XML-RPC request handler class * @property CI_Xmlrpcs $xmlrpcs XML-RPC server class * @property CI_Zip $zip Zip Compression Class * @property CI_Javascript $javascript Javascript Class * @property CI_Jquery $jquery Jquery Class * @property CI_Utf8 $utf8 Provides support for UTF-8 environments * @property CI_Security $security Security Class, xss, csrf, etc... */ class CI_Model{}

2. मिले /system/core/controller.php और /system/core/model.php IntelliJ विचार और सही clicked-> मार्क सादा पाठ के रूप में के अंदर: यह मूल रूप से सिर्फ एक phpdoc टिप्पणी है।

3. हो गया! यह बहुत अच्छा काम करता है, कोई और झूठी त्रुटियां नहीं, और कोड पूर्णता!

enter image description here

+0

शायद कुछ बेहतर खोज करना चाहिए था। इसे इस समस्या के साथ किसी और की मदद करने के लिए उत्तर के रूप में पोस्ट किया गया है (इसके लिए खोज बहुत सारे प्रश्नों और कोई जवाब नहीं दिखाती है)। –

+0

यह मेरे लिए काम नहीं करता है मुझे अपरिभाषित फ़ंक्शन form_open() आदि जैसे त्रुटियां मिल रही हैं –

0

यह समाधान है कि मेरे लिए काम किया है: https://github.com/Stunt/Codeigniter-autocomplete/

मैं phpStorm उपयोग कर रहा हूँ लेकिन मैं इसे विचार के साथ काम करेगा कल्पना।

फ़ाइलों को सादे पाठ के रूप में चिह्नित करने की आवश्यकता नहीं है। बस autocomplete.php फ़ाइल को एप्लिकेशन/कॉन्फ़िगर फ़ोल्डर में छोड़ दें और यह काम करता है। मुझे संदेह है कि जिथब पर लिंक खराब हो जाएगा, लेकिन अगर यहां फाइल की सामग्री है।

<?php 
// help IDE(s) support Codeigniter 2.0 
/** 
* @property CI_DB_active_record $db 
* @property CI_DB_forge $dbforge 
* @property CI_Benchmark $benchmark 
* @property CI_Calendar $calendar 
* @property CI_Cart $cart 
* @property CI_Config $config 
* @property CI_Controller $controller 
* @property CI_Email $email 
* @property CI_Encrypt $encrypt 
* @property CI_Exceptions $exceptions 
* @property CI_Form_validation $form_validation 
* @property CI_Ftp $ftp 
* @property CI_Hooks $hooks 
* @property CI_Image_lib $image_lib 
* @property CI_Input $input 
* @property CI_Language $language 
* @property CI_Loader $load 
* @property CI_Log $log 
* @property CI_Model $model 
* @property CI_Output $output 
* @property CI_Pagination $pagination 
* @property CI_Parser $parser 
* @property CI_Profiler $profiler 
* @property CI_Router $router 
* @property CI_Session $session 
* @property CI_Sha1 $sha1 
* @property CI_Table $table 
* @property CI_Trackback $trackback 
* @property CI_Typography $typography 
* @property CI_Unit_test $unit_test 
* @property CI_Upload $upload 
* @property CI_URI $uri 
* @property CI_User_agent $user_agent 
* @property CI_Validation $validation 
* @property CI_Xmlrpc $xmlrpc 
* @property CI_Xmlrpcs $xmlrpcs 
* @property CI_Zip $zip 
* 
* 
* 
* These are samples entries to make my own functions work. 
* Remove these and add you custom ones. 
* @property Tank_auth $tank_auth 
* @property Users_model $users_model 
* @property Firms_model $firms_model 
* @property Firms_model_master $firms_model_master 
* 
* 
*/ 
class CI_Controller {}; 
class MY_Controller extends CI_Controller {}; 
/** 
* @property CI_DB_active_record $db 
* @property CI_DB_forge $dbforge 
* @property CI_Config $config 
* @property CI_Loader $load 
* @property CI_Session $session 
*/ 
class CI_Model {}; 
/* End of file autocomplete.php */ 
/* Location: ./application/config/autocomplete.php */ 
?> 

सीआईवी 3 के लिए अद्यतन: यदि आप कोडइग्निटर वी 3.x का उपयोग कर रहे हैं, तो इसके बजाय इसका उपयोग करें।

<?php 
/** 
* @property CI_DB_query_builder|CI_DB_postgre_driver $db    This is the platform-independent base Active Record implementation class. 
* @property CI_DB_forge $dbforge     Database Utility Class 
* @property CI_Benchmark $benchmark    This class enables you to mark points and calculate the time difference between them.<br /> Memory consumption can also be displayed. 
* @property CI_Calendar $calendar    This class enables the creation of calendars 
* @property CI_Cart $cart      Shopping Cart Class 
* @property CI_Config $config     This class contains functions that enable config files to be managed 
* @property CI_Controller $controller   This class object is the super class that every library in.<br />CodeIgniter will be assigned to. 
* @property CI_Email $email      Permits email to be sent using Mail, Sendmail, or SMTP. 
* @property CI_Encrypt $encrypt     Provides two-way keyed encoding using XOR Hashing and Mcrypt 
* @property CI_Exceptions $exceptions   Exceptions Class 
* @property CI_Form_validation $form_validation Form Validation Class 
* @property CI_Ftp $ftp       FTP Class 
* @property CI_Hooks $hooks      Provides a mechanism to extend the base system without hacking. 
* @property CI_Image_lib $image_lib    Image Manipulation class 
* @property CI_Input $input      Pre-processes global input data for security 
* @property CI_Lang $lang      Language Class 
* @property CI_Loader $load      Loads views and files 
* @property CI_Log $log       Logging Class 
* @property CI_Model $model      CodeIgniter Model Class 
* @property CI_Output $output     Responsible for sending final output to browser 
* @property CI_Pagination $pagination   Pagination Class 
* @property CI_Parser $parser     Parses pseudo-variables contained in the specified template view,<br />replacing them with the data in the second param 
* @property CI_Profiler $profiler    This class enables you to display benchmark, query, and other data<br />in order to help with debugging and optimization. 
* @property CI_Router $router     Parses URIs and determines routing 
* @property CI_Session $session     Session Class 
* @property CI_Encryption $encryption   The Encryption Library provides two-way data encryption 
* @property CI_Table $table      HTML table generation<br />Lets you create tables manually or from database result objects, or arrays. 
* @property CI_Trackback $trackback    Trackback Sending/Receiving Class 
* @property CI_Typography $typography   Typography Class 
* @property CI_Unit_test $unit_test    Simple testing class 
* @property CI_Upload $upload     File Uploading Class 
* @property CI_URI $uri       Parses URIs and determines routing 
* @property CI_User_agent $user_agent   Identifies the platform, browser, robot, or mobile devise of the browsing agent 
* @property CI_Form_validation $validation 
* @property CI_Xmlrpc $xmlrpc     XML-RPC request handler class 
* @property CI_Xmlrpcs $xmlrpcs     XML-RPC server class 
* @property CI_Zip $zip       Zip Compression Class 
* @property CI_Javascript $javascript   Javascript Class 
* @property CI_Jquery $jquery     Jquery Class 
* @property CI_Utf8 $utf8      Provides support for UTF-8 environments 
* @property CI_Security $security    Security Class, xss, csrf, etc... 
* @property Tank_auth $tank_auth 
* 
*/ 
class CI_Controller{} 
class MY_Controller extends CI_Controller {}; 
/** 
* @property CI_DB_query_builder|CI_DB_postgre_driver $db    This is the platform-independent base Active Record implementation class. 
* @property CI_DB_forge $dbforge     Database Utility Class 
* @property CI_Benchmark $benchmark    This class enables you to mark points and calculate the time difference between them.<br /> Memory consumption can also be displayed. 
* @property CI_Calendar $calendar    This class enables the creation of calendars 
* @property CI_Cart $cart      Shopping Cart Class 
* @property CI_Config $config     This class contains functions that enable config files to be managed 
* @property CI_Controller $controller   This class object is the super class that every library in.<br />CodeIgniter will be assigned to. 
* @property CI_Email $email      Permits email to be sent using Mail, Sendmail, or SMTP. 
* @property CI_Encrypt $encrypt     Provides two-way keyed encoding using XOR Hashing and Mcrypt 
* @property CI_Exceptions $exceptions   Exceptions Class 
* @property CI_Form_validation $form_validation Form Validation Class 
* @property CI_Ftp $ftp       FTP Class 
* @property CI_Hooks $hooks      Provides a mechanism to extend the base system without hacking. 
* @property CI_Image_lib $image_lib    Image Manipulation class 
* @property CI_Input $input      Pre-processes global input data for security 
* @property CI_Lang $lang      Language Class 
* @property CI_Loader $load      Loads views and files 
* @property CI_Log $log       Logging Class 
* @property CI_Model $model      CodeIgniter Model Class 
* @property CI_Output $output     Responsible for sending final output to browser 
* @property CI_Pagination $pagination   Pagination Class 
* @property CI_Parser $parser     Parses pseudo-variables contained in the specified template view,<br />replacing them with the data in the second param 
* @property CI_Profiler $profiler    This class enables you to display benchmark, query, and other data<br />in order to help with debugging and optimization. 
* @property CI_Router $router     Parses URIs and determines routing 
* @property CI_Session $session     Session Class 
* @property CI_Encryption $encryption   The Encryption Library provides two-way data encryption 
* @property CI_Table $table      HTML table generation<br />Lets you create tables manually or from database result objects, or arrays. 
* @property CI_Trackback $trackback    Trackback Sending/Receiving Class 
* @property CI_Typography $typography   Typography Class 
* @property CI_Unit_test $unit_test    Simple testing class 
* @property CI_Upload $upload     File Uploading Class 
* @property CI_URI $uri       Parses URIs and determines routing 
* @property CI_User_agent $user_agent   Identifies the platform, browser, robot, or mobile devise of the browsing agent 
* @property CI_Form_validation $validation 
* @property CI_Xmlrpc $xmlrpc     XML-RPC request handler class 
* @property CI_Xmlrpcs $xmlrpcs     XML-RPC server class 
* @property CI_Zip $zip       Zip Compression Class 
* @property CI_Javascript $javascript   Javascript Class 
* @property CI_Jquery $jquery     Jquery Class 
* @property CI_Utf8 $utf8      Provides support for UTF-8 environments 
* @property CI_Security $security    Security Class, xss, csrf, etc... 
* @property Tank_auth $tank_auth 
*/ 
class CI_Model {}; 

मैं इन सबके लिए क्रेडिट नहीं ले सकता। मुझे इनमें से बहुत कुछ मिला लेकिन मुझे याद नहीं आया। हालांकि इसे पूरा करने के लिए मुझे कुछ जोड़ने की ज़रूरत थी।

+0

यह काम नहीं करता है मैं सीआई -3 को किसी भी फ्यूचर सुझाव या सहायता का उपयोग कर रहा हूं ... –

+0

मुझे अपरिभाषित फ़ंक्शन form_open जैसी त्रुटियां मिल रही हैं() आदि ... –

+0

क्या यह सीआई कार्यों में निर्मित के लिए काम करता है? यदि ऐसा है, तो यह सही ढंग से काम कर रहा है। इसे अपने कस्टम फ़ंक्शंस के साथ काम करने के लिए नीचे दी गई प्रविष्टियों को संशोधित करें: * ये मेरे स्वयं के फ़ंक्शंस को काम करने के लिए नमूने प्रविष्टियां हैं। * इन्हें हटाएं और आपको कस्टम जोड़ें। –

संबंधित मुद्दे