نحوه پشتیبانی phpstrome در کدایگنایتر
همانگونه که می دانیم phpstrom قوی ترین محیط برنامه نویسی php می باشد و کدایگنایتر یکی از قوی ترین و محبوب ترین فریم ورکهای php می باشد که به صورت پیش فرض قسمت تکمیل کد آن در phpstrom پشتیبانی نمی شود .در واقع قسمتی که هنگام نوشتن کدها در phpstrom باعث می شود که ادامه کدها به ما پیشنهاد شود .
با مراحل زیر به راحتی می توانیم این قابلیت را به phpstrom خود بیفزارییم.
- فایلی به نام phpstorm.php در شاخه اصلی برنامه بسازید و محتوای زیر را در آن بگزارید.(در کنار index.php)
- به پوشه system/core/ رفته و بروی Controller.php و Model.php کلیک راست کرده و گزینه set Mark as Plain Text را بزنید.
اکنون تنظیمات شما به اتمام رسیده است و همانگونه که در تصویر زیر می بینید متدها به راحتی به شما پیشنهاد داده می شود.
تصویر دمو :
فایل phpstorm.php :
<?php die('This file is used for development purposes only.'); /** * PhpStorm Code Completion to CodeIgniter + HMVC * * @package CodeIgniter * @subpackage PhpStorm * @category Code Completion * @version 3.1.4 * @author Natan Felles * @link http://github.com/natanfelles/codeigniter-phpstorm */ /* * To enable code completion to your own libraries add a line above each class as follows: * * @property Library_name $library_name Library description * */ /** * @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_Cache $cache Caching Class * @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_DB_forge $dbforge Database Forge Class * @property CI_DB_mysql_driver|CI_DB_query_builder $db This is the platform-independent base Query Builder implementation class * @property CI_DB_utility $dbutil Database Utility Class * @property CI_Driver_Library $driver Driver Library Class * @property CI_Email $email Permits email to be sent using Mail, Sendmail, or SMTP * @property CI_Encrypt $encrypt Provides two-way keyed encoding using Mcrypt * @property CI_Encryption $encryption Provides two-way keyed encryption via PHP's MCrypt and/or OpenSSL extensions * @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_Javascript $javascript Javascript Class * @property CI_Jquery $jquery Jquery Class * @property CI_Lang $lang Language Class * @property CI_Loader $load Loads framework components * @property CI_Log $log Logging Class * @property CI_Migration $migration All migrations should implement this, forces up() and down() and gives access to the CI super-global * @property CI_Model $model CodeIgniter Model Class * @property CI_Output $output Responsible for sending final output to the browser * @property CI_Pagination $pagination Pagination Class * @property CI_Parser $parser Parser Class * @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_Security $security Security Class * @property CI_Session $session Session Class * @property CI_Table $table 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 Simple testing class * @property CI_Upload $upload File Uploading Class * @property CI_URI $uri Parses URIs and determines routing * @property CI_User_agent $agent Identifies the platform, browser, robot, or mobile device of the browsing agent * @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_Utf8 $utf8 Provides support for UTF-8 environments * @property Ispconfig $ispconfig This class enables you to use the ISPConfig 3 Remote API * @property Boleto $boleto Boleto Class */ class CI_Controller { public function __construct() { } } /** * @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_Cache $cache Caching Class * @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_DB_forge $dbforge Database Forge Class * @property CI_DB_mysql_driver|CI_DB_query_builder $db This is the platform-independent base Query Builder implementation class * @property CI_DB_utility $dbutil Database Utility Class * @property CI_Driver_Library $driver Driver Library Class * @property CI_Email $email Permits email to be sent using Mail, Sendmail, or SMTP * @property CI_Encrypt $encrypt Provides two-way keyed encoding using Mcrypt * @property CI_Encryption $encryption Provides two-way keyed encryption via PHP's MCrypt and/or OpenSSL extensions * @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_Javascript $javascript Javascript Class * @property CI_Jquery $jquery Jquery Class * @property CI_Lang $lang Language Class * @property CI_Loader $load Loads framework components * @property CI_Log $log Logging Class * @property CI_Migration $migration All migrations should implement this, forces up() and down() and gives access to the CI super-global * @property CI_Model $model CodeIgniter Model Class * @property CI_Output $output Responsible for sending final output to the browser * @property CI_Pagination $pagination Pagination Class * @property CI_Parser $parser Parser Class * @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_Security $security Security Class * @property CI_Session $session Session Class * @property CI_Table $table 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 Simple testing class * @property CI_Upload $upload File Uploading Class * @property CI_URI $uri Parses URIs and determines routing * @property CI_User_agent $agent Identifies the platform, browser, robot, or mobile device of the browsing agent * @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_Utf8 $utf8 Provides support for UTF-8 environments */ class CI_Model { public function __construct() { } } /** * @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_Cache $cache Caching Class * @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_DB_forge $dbforge Database Forge Class * @property CI_DB_mysql_driver|CI_DB_query_builder $db This is the platform-independent base Query Builder implementation class * @property CI_DB_utility $dbutil Database Utility Class * @property CI_Driver_Library $driver Driver Library Class * @property CI_Email $email Permits email to be sent using Mail, Sendmail, or SMTP * @property CI_Encrypt $encrypt Provides two-way keyed encoding using Mcrypt * @property CI_Encryption $encryption Provides two-way keyed encryption via PHP's MCrypt and/or OpenSSL extensions * @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_Javascript $javascript Javascript Class * @property CI_Jquery $jquery Jquery Class * @property CI_Lang $lang Language Class * @property CI_Loader $load Loads framework components * @property CI_Log $log Logging Class * @property CI_Migration $migration All migrations should implement this, forces up() and down() and gives access to the CI super-global * @property CI_Model $model CodeIgniter Model Class * @property CI_Output $output Responsible for sending final output to the browser * @property CI_Pagination $pagination Pagination Class * @property CI_Parser $parser Parser Class * @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_Security $security Security Class * @property CI_Session $session Session Class * @property CI_Table $table 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 Simple testing class * @property CI_Upload $upload File Uploading Class * @property CI_URI $uri Parses URIs and determines routing * @property CI_User_agent $agent Identifies the platform, browser, robot, or mobile device of the browsing agent * @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_Utf8 $utf8 Provides support for UTF-8 environments */ class MX_Controller { public function __construct() { } }
منبع :
https://github.com/natanfelles/codeigniter-phpstorm