Enables CI to automatically prompt CI-related classes and methods in NetBeans 8.0

Source: Internet
Author: User
Tags netbeans

Put these two files under the Nbproject folder in the root directory of the project file, run index.php such as: http://localhost/your CI directory/nbproject/index.php, and then restart NetBeans. Try writing $this-> to see what's going on back there! Ha ha haha

index.php

===============================================
<?php
$filearr = File (' ci_autocomplete_2.0.php ');
$startpos = Array ();
$conpos = 0;
$modpos = 0;
GetPos ($startpos, $conpos, $modpos, $filearr);
$model = ";
$lib = ";
$resultnames = Array ();
Getdirfilesname ('.. /application/models ');
$filesmodel = Listfiles ('.. /application/models ');
$fileslib = Listfiles ('.. /application/libraries ');
$tets =filenamechange ($filesmodel);
$resultnames = Array_merge (Array (Filenamechange ($filesmodel)), Array (Filenamechange ($fileslib)));// Filter to index and get string
$insertarr =array ();
Var_dump ($resultnames);
Array_splice ($filearr, $startpos [0] + 1, $conpos-$startpos [0]-3, $resultnames);
GetPos ($startpos, $conpos, $modpos, $filearr);
$porarr =array_slice ($filearr, 3, $conpos-5);
Array_splice ($filearr, $conpos +3, $modpos-$conpos -5, $porarr);
$resultstr = "";
for ($i = 0; $i < count ($filearr); $i + +) {
$temstr = $filearr [$i];
Var_dump ($filearr [$i]);
$resultstr. = $temstr;
}
$resultstr =implode ("", $filearr);
Var_dump ($RESULTSTR);
Write file
File_put_contents (string filename, string data [, int flags [, resource context]])
if (file_exists (' ci_autocomplete_2.0.php ')) {
Unlink (' ci_autocomplete_2.0.php ');
}
File_put_contents (' ci_autocomplete_2.0.php ', $resultstr);
Echo ' Echo ' <meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/><title></title>";
Echo ' Echo ' <p align= ' center ' > Conversion complete!</p></body>Var_dump ($files);
scandir//();
Var_dump ($startpos. ' '. $endpos);
$start =array_search (' * @property ci_zip $zip \ n ', $filearr);
Array_splice (Array,offset,length,array);
Var_dump ($start);
Var_dump ($filearr);
Var_dump ($filearr);
function Getdirfilesname ($dir) {
$namearr = Scandir ($dir);
$namearr = Array_diff ($namearr, Array ('. ', '. '));
Var_dump ($namearr);
}
function Listfiles ($dir) {
if ($dh = Opendir ($dir)) {
$files = Array ();
$inner _files = Array ();
while ($file = Readdir ($DH)) {
if ($file! = "." && $file! = ":" && $file [0]! = '. ') {
if (Is_dir ($dir. "/" . $file)) {
$inner _files = Listfiles ($dir. "/" . $file);
if (Is_array ($inner _files))
$files = Array_merge ($files, $inner _files);
} else {
Array_push ($files, $dir. "/" . $file);
Array_push ($files, $file);
}
}
}
Closedir ($DH);
return $files;
}
}
function Filenamechange ($filesname, $ucfirst =0) {
$count =count ($filesname);
for ($i = 0; $i < $count; $i + +) {
$startpos =strrpos ($filearr [$i], $startstr) ===false?continue:
if (Strrpos ($filesname [$i], ' ndex.html '))
Unset ($filesname [$i]);
if (Isset ($filesname [$i])) {
$filesname [$i] = Str_ireplace ('. php ', ', $filesname [$i]);
$resultnames [$i] [' Name ']=ucfirst ($filesname [$i]);
$resultnames [$i] [' Value ']= ' $ '. $filesname [$i];
if ($ucfirst) {
$resultnames [] = "* @property". Ucfirst ($filesname [$i]). " $" . Ucfirst ($filesname [$i]). "\ r \ n";
}else
$resultnames [] = "* @property". Ucfirst ($filesname [$i]). " $" . Strtolower ($filesname [$i]). "\ r \ n"; * @property Kslevel $kslevel

$filesname [$i]=strtr ($filesname [$i], ' php ', ');
}
}
return $resultnames;
}
Function GetPos (& $startpos,& $conpos,& $modpos, $filearr) {
$startstr = ' * @property ci_zip $zip ';
$constr = ' class Ci_controller {}; ';
$modstr = ' class Ci_model {}; ';
for ($i = 0; $i < count ($filearr); $i + +) {//Find location
$startpos =strrpos ($filearr [$i], $startstr) ===false?continue:
if (Strrpos ($filearr [$i], $startstr)!== FALSE)
$startpos [] = $i;
if (Strrpos ($filearr [$i], $constr)!== FALSE)
$conpos = $i;
if (Strrpos ($filearr [$i], $modstr)!== FALSE)
$modpos = $i;
}
Echo ' OK ';
}
?>

ci_autocomplete_2.0.php

=====================================

<?php
/**
* @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 $sha 1
* @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
* @property msgexpection $msgexpection
*/
Class Ci_controller {};
/**
* @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 $sha 1
* @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
* @property msgexpection $msgexpection
*/
Class Ci_model {};
?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.