当前位置: 首页>>代码示例>>PHP>>正文


PHP AppController::getInstance方法代码示例

本文整理汇总了PHP中AppController::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP AppController::getInstance方法的具体用法?PHP AppController::getInstance怎么用?PHP AppController::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AppController的用法示例。


在下文中一共展示了AppController::getInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: dispatchLoopShutdown

 public function dispatchLoopShutdown()
 {
     //
     // Force output to be sent - we need the client to have the page before
     // we start flushing progress bar updates
     //
     $app = AppController::getInstance();
     $req = $app->getRequest();
     $resp = $app->getResponse();
     $resp->sendResponse();
     $resp->clearContent();
     //
     // Do batch processing
     //
     if ($req->isLoggedIn()) {
         set_time_limit(3600 * 24);
         // if it takes more than 24 hours we're in trouble
         if (isset($this->opa_options['isBatchDelete']) && $this->opa_options['isBatchDelete']) {
             $va_errors = BatchProcessor::deleteBatchForSet($this->request, $this->ot_set, $this->ot_subject, array_merge($this->opa_options, array('progressCallback' => 'caIncrementBatchEditorProgress', 'reportCallback' => 'caCreateBatchEditorResultsReport')));
         } elseif (isset($this->opa_options['isBatchTypeChange']) && $this->opa_options['isBatchTypeChange']) {
             $va_errors = BatchProcessor::changeTypeBatchForSet($this->request, $this->opa_options['type_id'], $this->ot_set, $this->ot_subject, array_merge($this->opa_options, array('progressCallback' => 'caIncrementBatchEditorProgress', 'reportCallback' => 'caCreateBatchEditorResultsReport')));
         } else {
             $va_errors = BatchProcessor::saveBatchEditorFormForSet($this->request, $this->ot_set, $this->ot_subject, array_merge($this->opa_options, array('progressCallback' => 'caIncrementBatchEditorProgress', 'reportCallback' => 'caCreateBatchEditorResultsReport')));
         }
     }
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:26,代码来源:BatchEditorProgress.php

示例2: dispatchLoopShutdown

 public function dispatchLoopShutdown()
 {
     //
     // Force output to be sent - we need the client to have the page before
     // we start flushing progress bar updates
     //
     $app = AppController::getInstance();
     $req = $app->getRequest();
     $resp = $app->getResponse();
     $resp->sendResponse();
     $resp->clearContent();
     //
     // Do reindexing
     //
     if ($req->isLoggedIn() && $req->user->canDoAction('can_do_search_reindex')) {
         set_time_limit(3600 * 8);
         $o_db = new Db();
         $t_timer = new Timer();
         $o_dm = Datamodel::load();
         $va_table_names = $o_dm->getTableNames();
         $vn_tc = 0;
         foreach ($va_table_names as $vs_table) {
             if ($o_instance = $o_dm->getInstanceByTableName($vs_table)) {
                 if ($o_instance->isHierarchical()) {
                     if (!$o_instance->rebuildAllHierarchicalIndexes()) {
                         $o_instance->rebuildHierarchicalIndex();
                     }
                 }
                 caIncrementHierachicalReindexProgress(_t('Rebuilding hierarchical index for %1', $o_instance->getProperty('NAME_PLURAL')), $t_timer->getTime(2), memory_get_usage(true), $va_table_names, $o_instance->tableNum(), $o_instance->getProperty('NAME_PLURAL'), $vn_tc + 1);
             }
             $vn_tc++;
         }
         caIncrementHierachicalReindexProgress(_t('Index rebuild complete!'), $t_timer->getTime(2), memory_get_usage(true), $va_table_names, null, null, sizeof($va_table_names));
     }
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:35,代码来源:HierarchicalReindexingProgress.php

示例3: dispatchLoopShutdown

 public function dispatchLoopShutdown()
 {
     //
     // Force output to be sent - we need the client to have the page before
     // we start flushing progress bar updates
     //
     $app = AppController::getInstance();
     $req = $app->getRequest();
     $resp = $app->getResponse();
     $resp->sendResponse();
     $resp->clearContent();
     //
     // Do batch processing
     //
     if ($req->isLoggedIn()) {
         set_time_limit(3600 * 24);
         // if it takes more than 24 hours we're in trouble
         if (isset($_FILES['sourceFile']['tmp_name']) && $_FILES['sourceFile']['tmp_name']) {
             $vs_input = $_FILES['sourceFile']['tmp_name'];
         } elseif (!($vs_input = $req->getParameter('sourceUrl', pString))) {
             $vs_input = $req->getParameter('sourceText', pString);
         }
         $vs_file_input = caGetOption('fileInput', $this->opa_options, null);
         $vs_base_import_dir = $req->config->get('batch_media_import_root_directory');
         $vs_file_import_directory = caGetOption('fileImportPath', $this->opa_options, null);
         if ($vs_file_input === 'import' && is_dir($vs_base_import_dir . '/' . $vs_file_import_directory)) {
             // grab files from import directory
             $vs_input = $vs_base_import_dir . '/' . $vs_file_import_directory;
         }
         $va_errors = BatchProcessor::importMetadata($req, $vs_input, $req->getParameter('importer_id', pInteger), $req->getParameter('inputFormat', pString), array_merge($this->opa_options, array('progressCallback' => 'caIncrementBatchMetadataImportProgress', 'reportCallback' => 'caUpdateBatchMetadataImportResultsReport')));
     }
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:32,代码来源:BatchMetadataImportProgress.php

示例4: dispatchLoopShutdown

 public function dispatchLoopShutdown()
 {
     //
     // Force output to be sent - we need the client to have the page before
     // we start flushing progress bar updates
     //
     $app = AppController::getInstance();
     $req = $app->getRequest();
     $resp = $app->getResponse();
     $resp->sendResponse();
     $resp->clearContent();
     //
     // Do export
     //
     if ($req->isLoggedIn()) {
         set_time_limit(3600 * 24);
         // if it takes more than 24 hours we're in trouble
         $vn_id = $req->getParameter('exporter_id', pInteger);
         $vs_search = $req->getParameter('search', pString);
         $t_exporter = new ca_data_exporters($vn_id);
         $vs_file = tempnam(caGetTempDirPath(), 'export');
         ca_data_exporters::exportRecordsFromSearchExpression($t_exporter->get('exporter_code'), $vs_search, $vs_file, array('request' => $req, 'progressCallback' => 'caIncrementBatchMetadataExportProgress'));
     }
     // export done, move file to application tmp dir and create download link (separate action in the export controller)
     if (filesize($vs_file)) {
         $vs_new_filename = $vn_id . "_" . md5($vs_file);
         rename($vs_file, __CA_APP_DIR__ . '/tmp/' . $vs_new_filename);
         caExportAddDownloadLink($req, $vs_new_filename);
     }
 }
开发者ID:guaykuru,项目名称:pawtucket,代码行数:30,代码来源:BatchMetadataExportProgress.php

示例5: getRequest

 /**
  * Get request object for current request. Returns null if no request is available 
  * (if, for example, the plugin is being run in a batch script - scripts don't use the request/response model)
  *
  * @return Request object or null if no request object is available
  */
 public function getRequest()
 {
     if (($o_app = AppController::getInstance()) && ($o_req = $o_app->getRequest())) {
         return $o_req;
     }
     return null;
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:13,代码来源:BaseApplicationPlugin.php

示例6: __construct

 public function __construct($ps_widget_path, $pa_settings)
 {
     $this->ops_widget_path = $ps_widget_path;
     if (is_array($pa_settings)) {
         $this->opa_settings = $pa_settings;
     }
     if (AppController::instanceExists() && ($o_app = AppController::getInstance()) && ($o_req = $o_app->getRequest())) {
         $this->request = $o_req;
     }
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:10,代码来源:BaseWidget.php

示例7: __construct

 public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
 {
     parent::__construct($po_request, $po_response, $pa_view_paths);
     // we don't want headers or footers output for feeds
     $app = AppController::getInstance();
     $app->removeAllPlugins();
     // kills the pageFormat plugin added in /index.php
     // set http content-type header to XML
     $this->response->addHeader('Content-type', 'text/xml', true);
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:10,代码来源:BaseFeedController.php

示例8: dispatchLoopShutdown

 public function dispatchLoopShutdown()
 {
     //
     // Force output to be sent - we need the client to have the page before
     // we start flushing progress bar updates
     //
     $app = AppController::getInstance();
     $req = $app->getRequest();
     $resp = $app->getResponse();
     $resp->sendResponse();
     $resp->clearContent();
     //
     // Do export
     //
     if (!$req->isLoggedIn()) {
         return;
     }
     set_time_limit(3600 * 24);
     // if it takes more than 24 hours we're in trouble
     $vn_id = $req->getParameter('exporter_id', pInteger);
     $t_exporter = new ca_data_exporters($vn_id);
     $vs_file = tempnam(__CA_APP_DIR__ . DIRECTORY_SEPARATOR . 'tmp', 'dataExport');
     // we have 3 different sources for batch exports: search/browse result, sets and search expressions (deprecated)
     // they all operate on different parameters and on different static functions in ca_data_exporters
     if ($req->getParameter('caIsExportFromSearchOrBrowseResult', pInteger)) {
         // batch export from search or browse result
         $vs_find_type = $req->getParameter('find_type', pString);
         $vo_result_context = new ResultContext($req, $t_exporter->getTargetTableName(), $vs_find_type);
         $t_instance = $t_exporter->getTargetTableInstance();
         $o_result = $t_instance->makeSearchResult($t_instance->tableName(), $vo_result_context->getResultList());
         ca_data_exporters::exportRecordsFromSearchResult($t_exporter->get('exporter_code'), $o_result, $vs_file, array('request' => $req, 'progressCallback' => 'caIncrementBatchMetadataExportProgress'));
     } else {
         if ($vn_set_id = $req->getParameter('set_id', pInteger)) {
             // batch export from set
             ca_data_exporters::exportRecordsFromSet($t_exporter->get('exporter_code'), $vn_set_id, $vs_file, array('request' => $req, 'progressCallback' => 'caIncrementBatchMetadataExportProgress'));
         } else {
             // batch export from search expression (deprecated)
             $vs_search = $req->getParameter('search', pString);
             ca_data_exporters::exportRecordsFromSearchExpression($t_exporter->get('exporter_code'), $vs_search, $vs_file, array('request' => $req, 'progressCallback' => 'caIncrementBatchMetadataExportProgress'));
         }
     }
     // export done, record it in session for later usage in download/destination action
     if (filesize($vs_file)) {
         $o_session = $req->getSession();
         $o_session->setVar('export_file', $vs_file);
         $o_session->setVar('export_content_type', $t_exporter->getContentType());
         $o_session->setVar('exporter_id', $t_exporter->getPrimaryKey());
         caExportAddDownloadLink($req);
     }
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:50,代码来源:BatchMetadataExportProgress.php

示例9: dispatchLoopShutdown

 public function dispatchLoopShutdown()
 {
     //
     // Force output to be sent - we need the client to have the page before
     // we start flushing progress bar updates
     //
     $app = AppController::getInstance();
     $req = $app->getRequest();
     $resp = $app->getResponse();
     $resp->sendResponse();
     $resp->clearContent();
     //
     // Do batch processing
     //
     if ($req->isLoggedIn()) {
         set_time_limit(3600 * 24);
         // if it takes more than 24 hours we're in trouble
         $va_errors = BatchProcessor::importMetadata($req, isset($_FILES['sourceFile']['tmp_name']) && $_FILES['sourceFile']['tmp_name'] ? $_FILES['sourceFile']['tmp_name'] : $req->getParameter('sourceUrl', pString), $req->getParameter('importer_id', pInteger), $req->getParameter('inputFormat', pString), array_merge($this->opa_options, array('progressCallback' => 'caIncrementBatchMetadataImportProgress', 'reportCallback' => 'caUpdateBatchMetadataImportResultsReport')));
     }
 }
开发者ID:guaykuru,项目名称:pawtucket,代码行数:20,代码来源:BatchMetadataImportProgress.php

示例10: dispatchLoopShutdown

 public function dispatchLoopShutdown()
 {
     //
     // Force output to be sent - we need the client to have the page before
     // we start flushing progress bar updates
     //
     $app = AppController::getInstance();
     $req = $app->getRequest();
     $resp = $app->getResponse();
     $resp->sendResponse();
     $resp->clearContent();
     //
     // Do batch processing
     //
     if ($req->isLoggedIn()) {
         set_time_limit(3600 * 24);
         // if it takes more than 24 hours we're in trouble
         $va_errors = BatchProcessor::importMediaFromDirectory($this->request, array_merge($this->opa_options, array('progressCallback' => 'caIncrementBatchMediaImportProgress', 'reportCallback' => 'caCreateBatchMediaImportResultsReport')));
     }
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:20,代码来源:BatchMediaImportProgress.php

示例11: dispatchLoopShutdown

 public function dispatchLoopShutdown()
 {
     //
     // Force output to be sent - we need the client to have the page before
     // we start flushing progress bar updates
     //
     $app = AppController::getInstance();
     $req = $app->getRequest();
     $resp = $app->getResponse();
     $resp->sendResponse();
     $resp->clearContent();
     //
     // Do reindexing
     //
     if ($req->isLoggedIn() && $req->user->canDoAction('can_do_search_reindex')) {
         set_time_limit(3600 * 8);
         $o_si = new SearchIndexer();
         $o_si->reindex(null, array('showProgress' => false, 'interactiveProgressDisplay' => false, 'callback' => "caIncrementSearchReindexProgress"));
     }
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:20,代码来源:SearchReindexingProgress.php

示例12: caDisplayFatalError

/**
 *
 */
function caDisplayFatalError($pn_errno, $ps_errstr, $ps_errfile, $pn_errline, $pa_symboltable)
{
    $pa_errcontext = debug_backtrace();
    array_shift($pa_errcontext);
    // remove entry for error handler
    $pa_errcontext_args = caExtractStackTraceArguments($pa_errcontext);
    $pa_request_params = caExtractRequestParams();
    switch ($pn_errno) {
        case E_WARNING:
        case E_NOTICE:
        case E_STRICT:
        case E_DEPRECATED:
            //print "ARGH: $ps_errstr<br>";
            break;
        default:
            if (class_exists('AppController')) {
                AppController::getInstance()->removeAllPlugins();
            }
            require_once (defined("__CA_THEME_DIR__") ? __CA_THEME_DIR__ : __DIR__ . "/../../themes/default") . "/views/system/fatal_error_html.php";
            exit;
    }
}
开发者ID:samrahman,项目名称:providence,代码行数:25,代码来源:errorHelpers.php

示例13: preDispatch

 public function preDispatch()
 {
     if (!$this->getRequest()->config->get('do_content_caching')) {
         return null;
     }
     // does this need to be cached?
     if ($vs_key = $this->getKeyForRequest()) {
         // is this cached?
         if ($this->opo_content_cache->isInCache($vs_key)) {
             // yep... so prevent dispatch and output cache in postDispatch
             $this->opb_output_from_cache = true;
             $app = AppController::getInstance();
             $app->removeAllPlugins();
             $o_dispatcher = $app->getDispatcher();
             $o_dispatcher->setPlugins(array($this));
             return array('dont_dispatch' => true);
         } else {
             // not cached so dispatch and cache in postDispatch
             $this->opb_needs_to_be_cached = true;
         }
     }
     return null;
 }
开发者ID:guaykuru,项目名称:pawtucket,代码行数:23,代码来源:ContentCaching.php

示例14: Db

$o_db = new Db(null, null, false);
if (!$o_db->connected()) {
    $opa_error_messages = array("Could not connect to database. Check your database configuration in <em>setup.php</em>.");
    require_once __CA_BASE_DIR__ . "/themes/default/views/system/configuration_error_html.php";
    exit;
}
//
// do a sanity check on application and server configuration before servicing a request
//
require_once __CA_APP_DIR__ . '/lib/pawtucket/ConfigurationCheck.php';
ConfigurationCheck::performQuick();
if (ConfigurationCheck::foundErrors()) {
    ConfigurationCheck::renderErrorsAsHTMLOutput();
    exit;
}
$app = AppController::getInstance();
$g_request = $app->getRequest();
$resp = $app->getResponse();
// TODO: move this into a library so $_, $g_ui_locale_id and $g_ui_locale gets set up automatically
require_once __CA_APP_DIR__ . "/helpers/initializeLocale.php";
$va_ui_locales = $g_request->config->getList('ui_locales');
if ($vs_lang = $g_request->getParameter('lang', pString)) {
    if (in_array($vs_lang, $va_ui_locales)) {
        $g_request->session->setVar('lang', $vs_lang);
    }
}
if (!($g_ui_locale = $g_request->session->getVar('lang'))) {
    $g_ui_locale = $va_ui_locales[0];
}
if (!in_array($g_ui_locale, $va_ui_locales)) {
    $g_ui_locale = $va_ui_locales[0];
开发者ID:ffarago,项目名称:pawtucket2,代码行数:31,代码来源:index.php

示例15:

 *
 * This program is free software; you may redistribute it and/or modify it under
 * the terms of the provided license as published by Whirl-i-Gig
 *
 * CollectiveAccess is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTIES whatsoever, including any implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 * This source code is free and modifiable under the terms of
 * GNU General Public License. (http://www.gnu.org/copyleft/gpl.html). See
 * the "license.txt" file for details, or visit the CollectiveAccess web site at
 * http://www.CollectiveAccess.org
 *
 * ----------------------------------------------------------------------
 */
AppController::getInstance()->removeAllPlugins();
?>
<html>
	<head>
		<title><?php 
print $this->request->config->get("app_display_name");
?>
</title>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		
		<link href="<?php 
print $this->request->getThemeUrlPath();
?>
/css/login.css" rel="stylesheet" type="text/css" />
<?php 
print AssetLoadManager::getLoadHTML($this->request);
开发者ID:idiscussforum,项目名称:providence,代码行数:31,代码来源:logged_out_html.php


注:本文中的AppController::getInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。