コード例 #1
0
 /**
  * @see FWS_Module::run()
  */
 public function run()
 {
     $tpl = FWS_Props::get()->tpl();
     $input = FWS_Props::get()->input();
     $cookies = FWS_Props::get()->cookies();
     $file = $input->get_var('file', -1, FWS_Input::STRING);
     $class = $input->get_var('class', -1, FWS_Input::STRING);
     $url = PC_URL::get_submod_url();
     $url->set('file', $file);
     $url->set('class', $class);
     $surl = clone $url;
     $pagination = new PC_Pagination(PC_ENTRIES_PER_PAGE, PC_DAO::get_classes()->get_count_for($class, $file));
     $pagination->populate_tpl($url);
     $start = $pagination->get_start();
     $classes = array();
     foreach (PC_DAO::get_classes()->get_list($start, PC_ENTRIES_PER_PAGE, $class, $file) as $c) {
         $sig = $c->get_signature(true);
         $sig = preg_replace_callback('/#(.+?)#/', function ($match) {
             return "<a href=\"" . PC_URL::get_mod_url('class')->set('name', $match[1])->to_url() . "\">" . $match[1] . "</a>";
         }, $sig);
         $classes[] = array('name' => $sig, 'file' => $c->get_file(), 'line' => $c->get_line(), 'since' => implode(', ', $c->get_version()->get_min()), 'till' => implode(', ', $c->get_version()->get_max()));
     }
     $this->request_formular();
     $tpl->add_variables(array('classes' => $classes, 'file' => $file, 'class' => $class, 'search_target' => $surl->to_url(), 'display_search' => $cookies->get_cookie('classes_search') ? 'block' : 'none', 'cookie_name' => $cookies->get_prefix() . 'classes_search'));
 }
コード例 #2
0
 /**
  * @see FWS_Module::run()
  */
 public function run()
 {
     $tpl = FWS_Props::get()->tpl();
     $input = FWS_Props::get()->input();
     $cookies = FWS_Props::get()->cookies();
     $file = $input->get_var('file', -1, FWS_Input::STRING);
     $name = $input->get_var('name', -1, FWS_Input::STRING);
     $url = PC_URL::get_submod_url();
     $url->set('file', $file);
     $url->set('name', $name);
     $surl = clone $url;
     $pagination = new PC_Pagination(PC_ENTRIES_PER_PAGE, PC_DAO::get_constants()->get_count_for(0, $file, $name));
     $pagination->populate_tpl($url);
     $start = $pagination->get_start();
     $consts = array();
     $constants = PC_DAO::get_constants()->get_list(array(0), $file, $name, PC_Project::CURRENT_ID, $start, PC_ENTRIES_PER_PAGE);
     foreach ($constants as $const) {
         $url = PC_URL::get_mod_url('file');
         $url->set('path', $const->get_file());
         $url->set('line', $const->get_line());
         $url->set_anchor('l' . $const->get_line());
         $consts[] = array('id' => $const->get_id(), 'name' => $const->get_name(), 'type' => (string) $const->get_type(), 'file' => $const->get_file(), 'line' => $const->get_line(), 'url' => $url->to_url());
     }
     $callurl = PC_URL::get_mod_url('filepart');
     $callurl->set('id', '__ID__');
     $callurl->set('type', 'const');
     $this->request_formular();
     $tpl->add_variables(array('consts' => $consts, 'get_code_url' => $callurl->to_url(), 'file' => $file, 'name' => $name, 'search_target' => $surl->to_url(), 'display_search' => $cookies->get_cookie('consts_search') ? 'block' : 'none', 'cookie_name' => $cookies->get_prefix() . 'consts_search'));
 }
コード例 #3
0
 public function perform_action()
 {
     $input = FWS_Props::get()->input();
     $user = FWS_Props::get()->user();
     $folderstr = $input->get_var('folders', 'post', FWS_Input::STRING);
     $exclstr = $input->get_var('exclude', 'post', FWS_Input::STRING);
     $files = array();
     $folders = FWS_Array_Utils::advanced_explode("\n", $folderstr);
     $excl = FWS_Array_Utils::advanced_explode("\n", $exclstr);
     FWS_Array_Utils::trim($excl);
     // determine files to scan
     foreach ($folders as $folder) {
         $folder = trim($folder);
         if (is_file($folder)) {
             $files[] = $folder;
         } else {
             foreach (FWS_FileUtils::get_list($folder, true, true) as $item) {
                 if (!$this->is_excluded($item, $excl)) {
                     $files[] = $item;
                 }
             }
         }
     }
     // clear position, just to be sure
     $storage = new FWS_Progress_Storage_Session('ptypescan_');
     $storage->clear();
     // store in session
     $user->set_session_data('typescan_files', $files);
     // store in project
     $project = FWS_Props::get()->project();
     $project->set_type_folders($folderstr);
     $project->set_type_exclude($exclstr);
     PC_DAO::get_projects()->update($project);
     // clear previous data in the db
     PC_DAO::get_classes()->delete_by_project($project->get_id());
     PC_DAO::get_functions()->delete_by_project($project->get_id());
     PC_DAO::get_constants()->delete_by_project($project->get_id());
     PC_DAO::get_classfields()->delete_by_project($project->get_id());
     PC_DAO::get_errors()->delete_by_type(PC_Obj_Error::get_types_of(PC_Obj_Error::R_TYPESCANNER), $project->get_id());
     $this->set_redirect(true, PC_URL::get_submod_url(0, 'cliscan'));
     $this->set_show_status_page(false);
     $this->set_action_performed(true);
     return '';
 }
コード例 #4
0
 public function perform_action()
 {
     $user = FWS_Props::get()->user();
     $files = array();
     foreach (FWS_FileUtils::get_list('phpman', false, false) as $file) {
         if (preg_match('/\\.html$/', $file)) {
             $files[] = 'phpman/' . $file;
         }
     }
     // store in session
     $user->set_session_data('phpref_files', $files);
     $user->set_session_data('phpref_aliases', array());
     $user->set_session_data('phpref_versions', array());
     // clear position, just to be sure
     $storage = new FWS_Progress_Storage_Session('pphprefscan_');
     $storage->clear();
     // clear previous data in the db
     PC_DAO::get_functions()->delete_by_project(PC_Project::PHPREF_ID);
     PC_DAO::get_classes()->delete_by_project(PC_Project::PHPREF_ID);
     $this->set_redirect(true, PC_URL::get_submod_url(0, 'cliscan'));
     $this->set_show_status_page(false);
     $this->set_action_performed(true);
     return '';
 }