本文整理汇总了PHP中Configuration::load方法的典型用法代码示例。如果您正苦于以下问题:PHP Configuration::load方法的具体用法?PHP Configuration::load怎么用?PHP Configuration::load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Configuration
的用法示例。
在下文中一共展示了Configuration::load方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bootstrap
public function bootstrap()
{
// Enable project classes autoloading.
spl_autoload_register([$this, 'loadClass']);
// Load configuration files.
$this->configuration->load('database');
$this->configuration->load('library');
// Convert all PHP errors to exceptions.
error_reporting(E_ALL);
set_error_handler(function ($code, $message, $filename, $lineNumber) {
throw new ErrorException($message, $code, 1, $filename, $lineNumber);
});
return $this;
}
示例2: __construct
public function __construct($ps_widget_path, $pa_settings)
{
$this->title = _t('Records by status');
$this->description = _t('Displays objects or authority items by cataloguing status');
parent::__construct($ps_widget_path, $pa_settings);
$this->opo_config = Configuration::load($ps_widget_path . '/conf/recordsByStatus.conf');
$this->opo_datamodel = Datamodel::load();
# -- get status values
$t_lists = new ca_lists();
$va_statuses = caExtractValuesByUserLocale($t_lists->getItemsForList("workflow_statuses"));
$va_status_info = array();
$va_status_values = array();
foreach ($va_statuses as $i => $va_info) {
$va_status_info[$va_info["item_value"]] = $va_info["name_singular"];
$va_status_values[] = $va_info["item_value"];
}
$this->opa_status_display_names = $va_status_info;
$this->opa_status_values = $va_status_values;
$this->opa_table_display_names = array('ca_objects' => _t('Objects'), 'ca_entities' => _t('Entities'), 'ca_places' => _t('Places'), 'ca_occurrences' => _t('Occurrences'), 'ca_sets' => _t('Sets'), 'ca_collections' => _t('Collections'), 'ca_object_representations' => _t('Object representations'), 'ca_object_lots' => _t('Object lots'));
foreach ($this->opa_table_display_names as $vs_table => $vs_display) {
if (!$this->getRequest() || !$this->getRequest()->user->canDoAction("can_use_records_by_status_widget_{$vs_table}")) {
foreach (BaseWidget::$s_widget_settings['recordsByStatusWidget']["display_type"]["options"] as $vs_setting_display => $vs_setting_table) {
if ($vs_setting_table == $vs_table) {
unset(BaseWidget::$s_widget_settings['recordsByStatusWidget']["display_type"]["options"][$vs_setting_display]);
}
}
}
}
}
示例3: __construct
public function __construct()
{
$this->opo_search_base = new SearchBase();
$this->opo_app_config = Configuration::load();
$this->opo_search_config = Configuration::load($this->opo_app_config->get("search_config"));
$this->opo_search_indexing_config = Configuration::load($this->opo_search_config->get("search_indexing_config"));
$this->ops_webserver_user = posix_getpwuid(posix_getuid());
$this->ops_webserver_user = $this->ops_webserver_user['name'];
$this->opa_setting_descriptions = array();
$this->opa_setting_names = array();
$this->opa_setting_hints = array();
$this->_initMessages();
// allow overriding settings from search.conf via constant (usually defined in bootstrap file)
// this is useful for multi-instance setups which have the same set of config files for multiple instances
if (defined('__CA_SOLR_URL__') && strlen(__CA_SOLR_URL__) > 0) {
$this->ops_search_solr_url = __CA_SOLR_URL__;
} else {
$this->ops_search_solr_url = $this->opo_search_config->get('search_solr_url');
}
if (defined('__CA_SOLR_HOME_DIR__') && strlen(__CA_SOLR_HOME_DIR__) > 0) {
$this->ops_search_solr_home_dir = __CA_SOLR_HOME_DIR__;
} else {
$this->ops_search_solr_home_dir = $this->opo_search_config->get('search_solr_home_dir');
}
parent::__construct();
}
示例4: __construct
public function __construct($ps_widget_path, $pa_settings)
{
$this->title = _t('lol Katz');
$this->description = _t('I Can Has Cheezburger?');
parent::__construct($ps_widget_path, $pa_settings);
$this->opo_config = Configuration::load($ps_widget_path . '/conf/lolCatWidget.conf');
}
示例5: __construct
public function __construct()
{
$o_config = Configuration::load();
if ($this->ops_change_log_database = $o_config->get("change_log_database")) {
$this->ops_change_log_database .= ".";
}
}
示例6: __construct
function __construct()
{
$o_config = Configuration::load();
# get plugin directory from configuration
$plugin_dir = $o_config->get("file_plugins");
# read contents of plugin directory
if ($dir = dir($plugin_dir)) {
while ($plugin = $dir->read()) {
$m = array();
# all plugins must start with a alphabetical character or underscore and
# end with the '.php' extension
if (preg_match("/^([A-Za-z_]+).php\$/", $plugin, $m)) {
$plugin_name = $m[1];
if ($this->DEBUG) {
print "LOADING {$plugin_name}\n";
}
# load the plugin
require_once "{$plugin_dir}/{$plugin}";
eval("\$p = new WLPlugFile" . $plugin_name . "();");
# register the plugin's capabilities
if ($vo_instance =& $p->register()) {
$this->plugins[$plugin_name] = $vo_instance;
}
}
}
return true;
}
return null;
}
示例7: __construct
public function __construct($ps_plugin_path)
{
$this->description = _t('Publishes newly published records to twitter.');
parent::__construct();
$this->opo_config = Configuration::load($ps_plugin_path . '/conf/twitter.conf');
require_once $ps_plugin_path . '/bitly.php';
}
示例8: __construct
public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
{
$this->ops_theme = __CA_THEME__;
// get current theme
if (!is_dir(__CA_APP_DIR__ . '/plugins/NovaMuse/themes/' . $this->ops_theme . '/views')) {
// if theme is not defined for this plugin, try to use "default" theme
$this->ops_theme = 'default';
}
parent::__construct($po_request, $po_response, array(__CA_APP_DIR__ . '/plugins/NovaMuse/themes/' . $this->ops_theme . '/views'));
$this->opo_plugin_config = Configuration::load($this->request->getAppConfig()->get('application_plugins') . '/NovaMuse/conf/NovaMuse.conf');
if (!(bool) $this->opo_plugin_config->get('enabled')) {
die(_t('NovaMuse plugin is not enabled'));
}
MetaTagManager::addLink('stylesheet', $po_request->getBaseUrlPath() . "/app/plugins/NovaMuse/themes/" . $this->ops_theme . "/css/dashboard.css", 'text/css');
$this->opo_result_context = new ResultContext($po_request, 'ca_objects', 'dashboard');
$t_list = new ca_lists();
$this->opn_member_institution_id = $t_list->getItemIDFromList('entity_types', 'member_institution');
$this->opn_individual_id = $t_list->getItemIDFromList('entity_types', 'ind');
$this->opn_family_id = $t_list->getItemIDFromList('entity_types', 'fam');
$this->opn_organization_id = $t_list->getItemIDFromList('entity_types', 'org');
$t_object = new ca_objects();
$this->opn_objectTableNum = $t_object->tableNum();
$va_access_values = caGetUserAccessValues($this->request);
$this->opa_access_values = $va_access_values;
$this->view->setVar('access_values', $va_access_values);
}
示例9: loadSettings
public function loadSettings($m_table, $ps_field_name)
{
if (!is_object($m_table)) {
// if it's not a table instance, try using $m_table as a table name
if (!($t_table = $this->opo_datamodel->getInstanceByTableName($m_table, true))) {
return false;
}
} else {
$t_table =& $m_table;
}
if (!($va_field_info = $t_table->getFieldInfo($ps_field_name))) {
return false;
}
$this->opa_table_settings = $this->opo_config_settings = null;
if (!isset($va_field_info['MEDIA_ACCEPT']) || !is_array($va_field_info['MEDIA_ACCEPT'])) {
if (!($vs_config_path = $this->opo_config->get('media_processing_settings'))) {
return false;
}
if (!($vs_media_processing_setting = $va_field_info['MEDIA_PROCESSING_SETTING'])) {
return false;
}
$this->opo_config_settings = Configuration::load($vs_config_path);
if (!($this->opa_config_settings_as_array = $this->opo_config_settings->getAssoc($vs_media_processing_setting))) {
return false;
}
} else {
$this->opa_table_settings =& $va_field_info;
}
return true;
}
示例10: __construct
public function __construct($ps_plugin_path)
{
$this->ops_plugin_path = $ps_plugin_path;
$this->description = _t('Imports bibliographic information from WorldCat');
parent::__construct();
$this->opo_config = Configuration::load($ps_plugin_path . '/conf/worldcat.conf');
}
示例11: getDisplayValue
/**
* Options:
* rawDate - if true, returns date as an array of start and end historic timestames
* sortable - if true a language-independent sortable representation is returned.
* getDirectDate - get underlying historic timestamp (floatval)
*/
public function getDisplayValue($pa_options = null)
{
if (!is_array($pa_options)) {
$pa_options = array();
}
if (isset($pa_options['rawDate']) && $pa_options['rawDate']) {
return array(0 => $this->opn_start_date, 1 => $this->opn_end_date, 'start' => $this->opn_start_date, 'end' => $this->opn_end_date);
}
if (isset($pa_options['GET_DIRECT_DATE']) && $pa_options['GET_DIRECT_DATE'] || isset($pa_options['getDirectDate']) && $pa_options['getDirectDate']) {
return $this->opn_start_date;
}
if (isset($pa_options['sortable']) && $pa_options['sortable']) {
if (!$this->opn_start_date || !$this->opn_end_date) {
return null;
}
return $this->opn_start_date . '/' . $this->opn_end_date;
}
$o_config = Configuration::load();
$o_date_config = Configuration::load($o_config->get('datetime_config'));
if ($o_date_config->get('dateFormat') == 'original') {
return $this->ops_text_value;
} else {
$t_element = new ca_metadata_elements($this->getElementID());
$va_settings = $this->getSettingValuesFromElementArray($t_element->getFieldValuesArray(), array('isLifespan'));
$o_tep = new TimeExpressionParser();
$o_tep->setHistoricTimestamps($this->opn_start_date, $this->opn_end_date);
return $o_tep->getText(array_merge(array('isLifespan' => $va_settings['isLifespan']), $pa_options));
//$this->ops_text_value;
}
}
示例12: __construct
public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
{
$this->ops_theme = __CA_THEME__;
// get current theme
if (!is_dir(__CA_APP_DIR__ . '/plugins/MetabolicChronology/themes/' . $this->ops_theme . '/views')) {
// if theme is not defined for this plugin, try to use "default" theme
$this->ops_theme = 'default';
}
parent::__construct($po_request, $po_response, array(__CA_APP_DIR__ . '/plugins/MetabolicChronology/themes/' . $this->ops_theme . '/views'));
$this->opo_plugin_config = Configuration::load($this->request->getAppConfig()->get('application_plugins') . '/MetabolicChronology/conf/Chronology.conf');
if (!(bool) $this->opo_plugin_config->get('enabled')) {
die(_t('Metabolic Chronology plugin is not enabled'));
}
$this->_initView($pa_options);
$this->opo_result_context = new ResultContext($po_request, 'ca_objects', 'MetabolicChronology');
MetaTagManager::addLink('stylesheet', $po_request->getBaseUrlPath() . "/app/plugins/MetabolicChronology/themes/" . $this->ops_theme . "/css/chronology.css", 'text/css');
JavascriptLoadManager::register('jcarousel');
JavascriptLoadManager::register('maps');
$t_list = new ca_lists();
$this->opn_silo_type_id = $t_list->getItemIDFromList('collection_types', 'silo');
$this->opn_action_type_id = $t_list->getItemIDFromList('occurrence_types', 'action');
$this->opn_context_type_id = $t_list->getItemIDFromList('occurrence_types', 'context');
$this->opn_yes_list_id = $t_list->getItemIDFromList('yes_no', 'yes');
$t_relationship_types = new ca_relationship_types();
$this->opn_rel_type_action_display_image = $t_relationship_types->getRelationshipTypeID("ca_objects_x_occurrences", "display");
$this->opn_rel_type_action_secondary_images = $t_relationship_types->getRelationshipTypeID("ca_objects_x_occurrences", "secondary");
$va_access_values = caGetUserAccessValues($this->request);
$this->opa_access_values = $va_access_values;
$this->view->setVar('access_values', $va_access_values);
}
示例13: __construct
public function __construct(&$po_request, &$po_response, $pa_view_paths)
{
$vo_conf = Configuration::load();
$this->opo_services_conf = Configuration::load($vo_conf->get("services_config"));
$this->opb_disable = !$this->opo_services_conf->get("enable_access_control");
parent::__construct($po_request, $po_response, $pa_view_paths);
}
示例14: caGetContributeFormConfig
/**
* Get theme-specific contribute form configuration
*
* @return Configuration
*/
function caGetContributeFormConfig()
{
if (file_exists(__CA_THEME_DIR__ . '/conf/contribute.conf')) {
return Configuration::load(__CA_THEME_DIR__ . '/conf/contribute.conf');
}
return Configuration::load(__CA_THEMES_DIR__ . '/default/conf/contribute.conf');
}
示例15: __construct
public function __construct()
{
parent::__construct();
$this->opo_app_config = Configuration::load();
$vs_external_app_config_path = $this->opo_app_config->get('external_applications');
$this->opo_external_app_config = Configuration::load($vs_external_app_config_path);
}