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


PHP Config::getData方法代码示例

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


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

示例1: testRemoveBaseUrlOverride

 /**
  * Test Core::removeBaseUrl method using the base_url[...]
  * override config settings.
  * @param $contextPath string
  * @param $baseUrl string
  * @param $url string
  * @param $expectUrl string
  * @covers removeBaseUrl
  * @dataProvider testRemoveBaseUrlOverrideDataProvider
  */
 public function testRemoveBaseUrlOverride($contextPath, $baseUrl, $url, $expectUrl)
 {
     $configData =& Config::getData();
     $configData['general']['base_url[' . $contextPath . ']'] = $baseUrl;
     $configData['general']['base_url[test2]'] = $baseUrl . '/test';
     $actualUrl = Core::removeBaseUrl($url);
     $this->assertEquals($expectUrl, $actualUrl);
 }
开发者ID:PublishingWithoutWalls,项目名称:pkp-lib,代码行数:18,代码来源:CoreTest.inc.php

示例2: testReloadDataAndGetData

 /**
  * @depends testSetConfigFileName
  * @covers Config::reloadData
  */
 public function testReloadDataAndGetData()
 {
     Config::setConfigFileName('lib/pkp/tests/config/config.mysql.inc.php');
     $result = Config::reloadData();
     $expectedResult = array('installed' => true, 'base_url' => 'http://pkp.sfu.ca/ojs', 'registry_dir' => 'lib/pkp/tests/registry', 'session_cookie_name' => 'OJSSID', 'session_lifetime' => 30, 'scheduled_tasks' => false, 'date_format_trunc' => '%m-%d', 'date_format_short' => '%Y-%m-%d', 'date_format_long' => '%B %e, %Y', 'datetime_format_short' => '%Y-%m-%d %I:%M %p', 'datetime_format_long' => '%B %e, %Y - %I:%M %p', 'disable_path_info' => false);
     // We'll only check part of the configuration data to
     // keep the test less verbose.
     self::assertEquals($expectedResult, $result['general']);
     $result =& Config::getData();
     self::assertEquals($expectedResult, $result['general']);
 }
开发者ID:ramonsodoma,项目名称:pkp-lib,代码行数:15,代码来源:ConfigTest.inc.php

示例3: sendMobile

 public function sendMobile()
 {
     $data = Config::getData();
     $params = ['data' => $data];
     // HTTP Params
     $this->sender->setData($params);
     // Send Data To Server
     $response = $this->sender->send();
     $this->feedback = new Feedback();
     $this->feedback->setFeedback($response);
     $this->feedback->parseFeedback();
     // Render Feedback
     $rendered = $this->feedback->build();
     return $rendered;
 }
开发者ID:astar3086,项目名称:studio_logistic,代码行数:15,代码来源:Director.php

示例4: saveSystemConfig

 /**
  * Save modified system configuration settings.
  */
 function saveSystemConfig()
 {
     $this->validate();
     $this->setupTemplate(true);
     $configData =& Config::getData();
     // Update configuration based on user-supplied data
     foreach ($configData as $sectionName => $sectionData) {
         $newData = Request::getUserVar($sectionName);
         foreach ($sectionData as $settingName => $settingValue) {
             if (isset($newData[$settingName])) {
                 $newValue = $newData[$settingName];
                 if (strtolower($newValue) == "true" || strtolower($newValue) == "on") {
                     $newValue = "On";
                 } else {
                     if (strtolower($newValue) == "false" || strtolower($newValue) == "off") {
                         $newValue = "Off";
                     }
                 }
                 $configData[$sectionName][$settingName] = $newValue;
             }
         }
     }
     $templateMgr =& TemplateManager::getManager();
     // Update contents of configuration file
     $configParser = new ConfigParser();
     if (!$configParser->updateConfig(Config::getConfigFileName(), $configData)) {
         // Error reading config file (this should never happen)
         $templateMgr->assign('errorMsg', 'admin.systemConfigFileReadError');
         $templateMgr->assign('backLink', Request::url(null, null, null, null, 'systemInfo'));
         $templateMgr->assign('backLinkLabel', 'admin.systemInformation');
         $templateMgr->display('common/error.tpl');
     } else {
         $writeConfigFailed = false;
         $displayConfigContents = Request::getUserVar('display') == null ? false : true;
         $configFileContents = $configParser->getFileContents();
         if (!$displayConfigContents) {
             if (!$configParser->writeConfig(Config::getConfigFileName())) {
                 $writeConfigFailed = true;
             }
         }
         // Display confirmation
         $templateMgr->assign('writeConfigFailed', $writeConfigFailed);
         $templateMgr->assign('displayConfigContents', $displayConfigContents);
         $templateMgr->assign('configFileContents', $configFileContents);
         $templateMgr->assign('helpTopicId', 'site.administrativeFunctions');
         $templateMgr->display('admin/systemConfigUpdated.tpl');
     }
 }
开发者ID:jmacgreg,项目名称:ocs,代码行数:51,代码来源:AdminFunctionsHandler.inc.php

示例5: __construct

 function __construct()
 {
     // Testing Data
     $this->data = Config::getData();
     $this->template = new Templater();
     // TODO Set API paths
     $design = Settings::$server . 'mobile-api/design/view/assets';
     $this->template->setTemplateAPI('design', $design);
     // Template path
     if (Config::$controller) {
         $this->view = Config::$controller . DS . Config::$action . '.php';
     } else {
         // Default Design
         $this->view = false;
     }
 }
开发者ID:astar3086,项目名称:studio_logistic,代码行数:16,代码来源:Builder.php

示例6: initialize

 /**
  * @copydoc PKPHandler::initialize()
  */
 function initialize($request)
 {
     parent::initialize($request);
     // Load user-related translations.
     AppLocale::requireComponents(LOCALE_COMPONENT_PKP_USER, LOCALE_COMPONENT_APP_ADMIN, LOCALE_COMPONENT_PKP_ADMIN, LOCALE_COMPONENT_APP_MANAGER, LOCALE_COMPONENT_APP_COMMON);
     // Basic grid configuration.
     $this->setTitle('admin.systemConfiguration');
     //
     // Grid columns.
     //
     import('lib.pkp.controllers.grid.admin.systemInfo.InfoGridCellProvider');
     $infoGridCellProvider = new InfoGridCellProvider();
     // setting name.
     $this->addColumn(new GridColumn('name', 'admin.systemInfo.settingName', null, null, $infoGridCellProvider, array('width' => 20)));
     // setting value.
     $this->addColumn(new GridColumn('value', 'admin.systemInfo.settingValue', null, null, $infoGridCellProvider));
     $this->_configData = Config::getData();
 }
开发者ID:jprk,项目名称:pkp-lib,代码行数:21,代码来源:SystemInfoGridHandler.inc.php

示例7: systemInfo

 /**
  * Show system information summary.
  */
 function systemInfo($args, &$request)
 {
     $this->validate();
     $this->setupTemplate($request, true);
     $configData =& Config::getData();
     $dbconn =& DBConnection::getConn();
     $dbServerInfo = $dbconn->ServerInfo();
     $versionDao = DAORegistry::getDAO('VersionDAO');
     $currentVersion =& $versionDao->getCurrentVersion();
     $versionHistory =& $versionDao->getVersionHistory();
     $serverInfo = array('admin.server.platform' => Core::serverPHPOS(), 'admin.server.phpVersion' => Core::serverPHPVersion(), 'admin.server.apacheVersion' => function_exists('apache_get_version') ? apache_get_version() : __('common.notAvailable'), 'admin.server.dbDriver' => Config::getVar('database', 'driver'), 'admin.server.dbVersion' => empty($dbServerInfo['description']) ? $dbServerInfo['version'] : $dbServerInfo['description']);
     $templateMgr =& TemplateManager::getManager($request);
     $templateMgr->assign_by_ref('currentVersion', $currentVersion);
     $templateMgr->assign_by_ref('versionHistory', $versionHistory);
     $templateMgr->assign_by_ref('configData', $configData);
     $templateMgr->assign_by_ref('serverInfo', $serverInfo);
     if ($request->getUserVar('versionCheck')) {
         $latestVersionInfo =& VersionCheck::getLatestVersion();
         $latestVersionInfo['patch'] = VersionCheck::getPatch($latestVersionInfo);
         $templateMgr->assign_by_ref('latestVersionInfo', $latestVersionInfo);
     }
     $templateMgr->display('admin/systemInfo.tpl');
 }
开发者ID:Rygbee,项目名称:harvester,代码行数:26,代码来源:AdminFunctionsHandler.inc.php

示例8: getVar

 /**
  * Retrieve a specified configuration variable.
  * @param $section string
  * @param $key string
  * @return string
  */
 function getVar($section, $key)
 {
     $configData =& Config::getData();
     return isset($configData[$section][$key]) ? $configData[$section][$key] : null;
 }
开发者ID:master3395,项目名称:CBPPlatform,代码行数:11,代码来源:Config.inc.php

示例9: RESTresourceDetail

function RESTresourceDetail()
{
    $type = validatetype(processRESTarg(1, ARG_STRING));
    $deleted = processInputVar('deleted', ARG_NUMERIC, 0);
    if ($deleted != 0 && $deleted != 1) {
        $deleted = 0;
    }
    $name = processInputVar('name', ARG_STRING, '*');
    $tmp = processInputVar('prettyname', ARG_STRING, '*');
    if ($name == '*' && $tmp != '*') {
        $name = $tmp;
    }
    if (is_null($type)) {
        RESTresponse(404, "invalid resource type");
        return;
    }
    $subid = processRESTarg(2, ARG_NUMERIC, 0);
    if ($type == 'image') {
        $resources = getUserResources(array("imageAdmin", "imageCheckOut"), array('available'), 0, $deleted);
    } elseif ($type == 'computer') {
        $resources = getUserResources(array("computerAdmin"), array("administer"), 0, $deleted);
    } elseif ($type == 'config') {
        $resources = getUserResources(array("configAdmin"), array('available'), 0, $deleted);
    }
    # TODO
    #elseif ...
    if ($subid && !array_key_exists($subid, $resources[$type])) {
        RESTresponse(404, "specified resource does not exist");
        printArray($resources[$type]);
        return;
    }
    if ($_SERVER['REQUEST_METHOD'] == 'DELETE') {
        if (RESTdeleteResource($type, $subid)) {
            RESTresponse(204);
        } else {
            RESTresponse(404, "specified resource does not exist 2");
        }
        return;
    }
    if ($type == 'image') {
        $items = getImages($deleted, $subid);
        $data = array();
        foreach (array_keys($resources[$type]) as $id) {
            if ($name != '*' && !preg_match("/^{$name}\$/i", $items[$id]['prettyname'])) {
                continue;
            }
            if (array_key_exists($id, $items)) {
                $data[$id] = $items[$id];
            }
        }
    } elseif ($type == 'computer') {
        $data = getComputers(1, 0, $subid);
    } elseif ($type == 'config') {
        $cluster = processInputVar('cluster', ARG_NUMERIC, -1);
        $cfg = new Config();
        $items = $cfg->getData($cfg->defaultGetDataArgs);
        $data = array();
        foreach (array_keys($resources[$type]) as $id) {
            if ($name != '*' && !preg_match("/^{$name}\$/i", $items[$id]['name'])) {
                continue;
            }
            if (array_key_exists($id, $items)) {
                if ($cluster == -1 || $cluster == 0 && $items[$id]['configtype'] != 'Cluster' || $cluster == 1 && $items[$id]['configtype'] == 'Cluster') {
                    $data[$id] = $items[$id];
                }
            }
        }
    }
    #elseif ...
    if ($subid == 0) {
        sendREST(dataToJSON($data));
        return;
    }
    sendREST(dataToJSON($data[$subid], 1));
}
开发者ID:bq-xiao,项目名称:apache-vcl,代码行数:75,代码来源:storebackend.php

示例10: generateSalt

 public static function generateSalt($section)
 {
     $length = Config::getData($section, "salt_length");
     return openssl_random_pseudo_bytes($length);
 }
开发者ID:Carlgo11,项目名称:Encryption,代码行数:5,代码来源:Encryption.php

示例11: array

 /**
  * Get context base urls from config file.
  * @return array Empty array if none is set.
  */
 function &getContextBaseUrls()
 {
     $contextBaseUrls =& Registry::get('contextBaseUrls');
     // Reference required.
     if (is_null($contextBaseUrls)) {
         $contextBaseUrls = array();
         $configData = Config::getData();
         // Filter the settings.
         $matches = null;
         foreach ($configData['general'] as $settingName => $settingValue) {
             if (preg_match('/base_url\\[(.*)\\]/', $settingName, $matches)) {
                 $workingContextPath = $matches[1];
                 $contextBaseUrls[$workingContextPath] = $settingValue;
             }
         }
     }
     return $contextBaseUrls;
 }
开发者ID:PublishingWithoutWalls,项目名称:pkp-lib,代码行数:22,代码来源:Config.inc.php

示例12: _setReportErrorOnly

 /**
  * Set the scheduled_task_report_error_only setting value.
  * @param $state string 'On' or 'Off'
  */
 private function _setReportErrorOnly($state)
 {
     $configData =& Config::getData();
     $configData['general']['scheduled_tasks_report_error_only'] = $state;
 }
开发者ID:mczirfusz,项目名称:pkp-lib,代码行数:9,代码来源:ScheduledTaskHelperTest.php

示例13: merge

 /**
  * @param Config $config
  * @param string $prefix prefix
  * @return $this
  */
 public function merge(Config $config, $prefix = null)
 {
     $this->addResources($config->getResources());
     $this->addData($config->getData(), $prefix);
     return $this;
 }
开发者ID:pmaxs,项目名称:config,代码行数:11,代码来源:Config.php

示例14: getVar

 /**
  * Retrieve a specified configuration variable.
  * @param $section string
  * @param $key string
  * @param $default string optional
  * @return string
  */
 function getVar($section, $key, $default = null)
 {
     $configData =& Config::getData();
     return isset($configData[$section][$key]) ? $configData[$section][$key] : $default;
 }
开发者ID:sedici,项目名称:ocs,代码行数:12,代码来源:Config.inc.php

示例15: load

 /**
  * Load
  *
  * @param string $type
  *
  * @return boolean
  */
 private function load($type)
 {
     $data = Config::getData($type);
     foreach ($data as $values) {
         foreach ($values as $key => $value) {
             if ($value == 1) {
                 if ($type == 'plugin') {
                     $key = $key . '/' . $key;
                 }
                 $file = constant(strtoupper($type) . '_DIR') . $key . '.php';
                 if (!file_exists($file)) {
                     $file = APP_DIR . $type . '/' . $key . '.php';
                     if (strpos($key, '/') !== false && !file_exists($file)) {
                         $file = PLUGIN_DIR . str_replace('/', '/' . $type . '/', $key) . '.php';
                     }
                 }
                 if (file_exists($file)) {
                     include_once $file;
                     if ($type == 'module') {
                         $this->loadedModules[] = $key;
                     }
                     if ($type == 'library') {
                         $this->loadedLibraries[] = $key;
                     }
                 } else {
                     Clockwork::throwError('Could not load ' . $type . ' (' . $key . ')');
                 }
             }
         }
     }
 }
开发者ID:JCquence,项目名称:Clockwork,代码行数:38,代码来源:Clockwork.php


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