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


PHP App::getConfig方法代码示例

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


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

示例1: index

 public function index()
 {
     $Config = App::getConfig();
     $configData = array('config_data' => array('admin_panel_link' => __ADMINPANE__, 'ssl' => (string) (isset($Config['ssl']) && $Config['ssl'] == 1) ? 1 : 0), 'gallerysettings_data' => App::getModel('globalsettings')->getGallerySettings());
     $settingsData = App::getModel('globalsettings')->getSettings();
     $colour = $settingsData['gallerysettings_data']['colour'];
     unset($settingsData['gallerysettings_data']);
     $settingsData['gallerysettings_data']['colour'] = array('type' => 1, 'start' => $colour);
     $this->formModel->setPopulateData(array_merge_recursive($configData, $settingsData));
     $form = $this->formModel->initForm();
     if ($form->Validate(FormEngine\FE::SubmittedData())) {
         try {
             $Data = $form->getSubmitValues(FormEngine\Elements\Form::FORMAT_FLAT);
             $Settings = $form->getSubmitValues();
             Event::notify($this, 'admin.globalsettings.model.save', array('id' => 1, 'data' => $Data));
             App::getModel('globalsettings')->updateGallerySettings($Data);
             App::getModel('globalsettings')->updateGlobalSettings($Settings['interface'], 'interface');
             App::getModel('globalsettings')->updateGlobalSettings(array('colour' => $Settings['gallerysettings_data']['colour']['start']), 'gallerysettings_data');
             Session::setActiveGlobalSettings(NULL);
             App::getModel('globalsettings')->configWriter($Data);
             if (__ADMINPANE__ != $Data['admin_panel_link']) {
                 Session::flush();
                 App::redirect('');
             } else {
                 App::redirect(__ADMINPANE__ . '/globalsettings');
             }
         } catch (Exception $e) {
             $this->registry->template->assign('error', $e->getMessage());
         }
     }
     $this->renderLayout(array('form' => $form->Render()));
 }
开发者ID:krisldz,项目名称:Gekosale2,代码行数:32,代码来源:globalsettings.php

示例2: index

    public function index()
    {
        if (App::getConfig('devmode') == 0) {
            App::redirect(__ADMINPANE__ . '/mainside');
        }
        if ((int) $this->getParam() == 0) {
            $form = new FormEngine\Elements\Form(array('name' => 'exchange', 'action' => '', 'method' => 'post'));
            $requiredData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'type_pane', 'label' => _('TXT_EXCHANGE_TYPE_MIGRATION_SETTINGS'))));
            $requiredData->AddChild(new FormEngine\Elements\Tip(array('tip' => '<p>Podaj adres URL wtyczki integracyjnej.</p>', 'direction' => FormEngine\Elements\Tip::DOWN)));
            $requiredData->AddChild(new FormEngine\Elements\TextField(array('name' => 'apiurl', 'label' => _('TXT_MIGRATION_API_URL'))));
            $requiredData->AddChild(new FormEngine\Elements\Tip(array('tip' => '<p>Podaj klucz jaki został ustawiony w pliku integracyjnym ($key)</p>', 'direction' => FormEngine\Elements\Tip::DOWN)));
            $requiredData->AddChild(new FormEngine\Elements\TextField(array('name' => 'apikey', 'label' => _('TXT_MIGRATION_API_KEY'))));
            $requiredData->AddChild(new FormEngine\Elements\Tip(array('tip' => '<p>Wybierz rodzaj importowanych danych.Sugerujemy import w następującej kolejności:
							<ul>
							<li>Zdjęcia</li>
							<li>Producenci</li>
							<li>Kategorie</li>
							<li>Wartości cech</li>
							<li>Produkty</li>
							</ul></p>', 'direction' => FormEngine\Elements\Tip::DOWN)));
            $requiredData->AddChild(new FormEngine\Elements\Select(array('name' => 'entity', 'label' => _('TXT_EXCHANGE_ENTITY'), 'options' => array(new FormEngine\Option(1, _('TXT_PRODUCTS')), new FormEngine\Option(2, _('TXT_CATEGORIES')), new FormEngine\Option(3, _('TXT_PRODUCERS')), new FormEngine\Option(4, _('TXT_PHOTOS')), new FormEngine\Option(5, _('TXT_ATTRIBUTES')), new FormEngine\Option(6, _('TXT_ORDERS')), new FormEngine\Option(7, _('TXT_SIMILARPRODUCT'))), 'default' => 1)));
            $form->AddFilter(new FormEngine\Filters\Trim());
            $form->AddFilter(new FormEngine\Filters\Secure());
            if ($form->Validate(FormEngine\FE::SubmittedData())) {
                $Data = $form->getSubmitValues(FormEngine\Elements\Form::FORMAT_FLAT);
                Session::setActiveMigrationData(json_encode($Data));
                App::redirect(__ADMINPANE__ . '/migration/index/' . $Data['entity']);
            }
            $this->registry->template->assign('form', $form->Render());
            $this->registry->xajax->processRequest();
            $this->registry->template->assign('xajax', $this->registry->xajax->getJavascript());
            $this->registry->template->display($this->loadTemplate('index.tpl'));
        } else {
            if (Session::getActiveMigrationData() == NULL) {
                App::redirect(__ADMINPANE__ . '/migration/');
            }
            $form = new FormEngine\Elements\Form(array('name' => 'add_migration', 'action' => '', 'method' => 'post'));
            $progress = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'progres_data', 'label' => 'Aktualizacja')));
            $progress->AddChild(new FormEngine\Elements\ProgressIndicator(array('name' => 'progress', 'label' => 'Postęp migracji', 'chunks' => 1, 'load' => array(App::getModel('migration'), 'doLoadQueque'), 'process' => array(App::getModel('migration'), 'doProcessQueque'), 'success' => array(App::getModel('migration'), 'doSuccessQueque'), 'preventSubmit' => true)));
            $form->AddFilter(new FormEngine\Filters\Trim());
            $form->AddFilter(new FormEngine\Filters\Secure());
            $this->registry->template->assign('form', $form->Render());
            $this->registry->xajax->processRequest();
            $this->registry->template->assign('xajax', $this->registry->xajax->getJavascript());
            $this->registry->template->display($this->loadTemplate('index.tpl'));
        }
    }
开发者ID:krisldz,项目名称:Gekosale2,代码行数:47,代码来源:migration.php

示例3: __construct

 public function __construct(array $settings)
 {
     $this->host = $settings['host'];
     $this->port = (int) $settings['port'];
     if (isset($settings['zlib_compression']) && $settings['zlib_compression'] == 1) {
         if (extension_loaded('zlib')) {
             $this->compression = MEMCACHE_COMPRESSED;
         } else {
             trigger_error('zlib module not loaded. Compression not set (memcache).', E_USER_WARNING);
         }
     }
     if (!@$this->pconnect($this->host, $this->port)) {
         throw new Exception('Can\'t connect to Memcached server. Sorry.');
     }
     $prefix = \Gekosale\App::getConfig('database');
     $this->prefix = !empty($settings['prefix']) ? $settings['prefix'] : $prefix['dbname'];
 }
开发者ID:krisldz,项目名称:Gekosale2,代码行数:17,代码来源:Memcache.php

示例4: __construct

 public function __construct($registry)
 {
     $this->registry = $registry;
     $config = App::getConfig();
     $this->isMemcache = isset($config['memcache']['active']) ? (bool) $config['memcache']['active'] : false;
     $this->__SESSION_HANDLER = ini_get('session.save_handler');
     $this->__SESSION_LIFETIME = isset($config['session_gc_maxlifetime']) ? $config['session_gc_maxlifetime'] : ini_get('session.gc_maxlifetime');
     if (!isset($_SESSION)) {
         if (isset($_POST[session_name()])) {
             session_id($_POST[session_name()]);
         }
         ini_set('session.save_handler', 'user');
         session_set_save_handler(array(&$this, 'session_open'), array(&$this, 'session_close'), array(&$this, 'session_read'), array(&$this, 'session_write'), array(&$this, 'session_destroy'), array(&$this, 'session_gc'));
         register_shutdown_function("session_write_close");
         @session_start();
         $this->__SESSION_ID = session_id();
     }
 }
开发者ID:krisldz,项目名称:Gekosale2,代码行数:18,代码来源:Session.php

示例5: configWriter

    public function configWriter($Data)
    {
        $Config = App::getConfig();
        $ssl = isset($Data['ssl']) && $Data['ssl'] == 1 ? 1 : 0;
        $db = $Config['database'];
        $Config['admin_panel_link'] = addslashes($Data['admin_panel_link']);
        $Config['ssl'] = $ssl;
        $filename = ROOTPATH . 'config' . DS . 'settings.php';
        $out = @fopen($filename, "w");
        @fwrite($out, "<?php \r\n");
        @fwrite($out, '/**
 * Gekosale, Open Source E-Commerce Solution
 * http://www.gekosale.pl
 *
 * Copyright (c) 2008-2012 Gekosale. Zabronione jest usuwanie informacji o licencji i autorach.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 */' . "\r\n");
        fwrite($out, '
		$Settings = Array(' . "\n\t\t\t'database'=> Array(\n\t\t\t\t'driver'=> '{$db['driver']}',\n\t\t\t\t'host'=> '{$db['host']}',\n\t\t\t\t'user'=> '{$db['user']}',\n\t\t\t\t'password'=> '{$db['password']}',\n\t\t\t\t'dbname'=> '{$db['dbname']}',\n\t\t\t),\n\t\t\t'admin_panel_link'=> '{$Config['admin_panel_link']}',\n\t\t\t'client_data_encription_string'=> '{$Config['client_data_encription_string']}',\n\t\t\t'ssl'=> {$Config['ssl']},\n\t\t);");
        @fclose($out);
    }
开发者ID:krisldz,项目名称:Gekosale2,代码行数:26,代码来源:globalsettings.php

示例6: setConfig

 public function setConfig()
 {
     $Array = App::getConfig('phpmailer');
     try {
         $this->debugConfig($Array);
     } catch (Exception $e) {
         throw new Exception($e->getMessage());
     }
     switch ($Array['Mailer']) {
         case 'mail':
             $this->IsMail();
             $this->From = $Array['FromEmail'];
             break;
         case 'sendmail':
             $this->IsSendmail();
             $this->From = $Array['FromEmail'];
             break;
         case 'smtp':
             $this->IsSMTP();
             $this->Host = $Array['server'];
             $this->Port = $Array['port'];
             $this->SMTPSecure = $Array['SMTPSecure'];
             $this->SMTPAuth = $Array['SMTPAuth'];
             $this->From = $Array['FromEmail'];
             $this->Username = $Array['SMTPUsername'];
             $this->Password = $Array['SMTPPassword'];
             break;
         default:
             throw new Exception('Wrong e-mail sending method');
     }
     $this->CharSet = $Array['CharSet'];
     $this->FromName = $Array['FromName'];
     $this->IsHTML(true);
 }
开发者ID:krisldz,项目名称:Gekosale2,代码行数:34,代码来源:mailer.php


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