• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Zend_Config_Writer_Ini类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: indexAction

 public function indexAction()
 {
     $config = Zend_Registry::get('config');
     /* @var $config Zend_Config */
     if ($config->gandi->api->key) {
         return $this->_helper->redirector('index', 'index');
     }
     $configFile = APPLICATION_PATH . '/configs/application.ini';
     $config = new Zend_Config_Ini($configFile, null, array('skipExtends' => true, 'allowModifications' => true));
     $request = $this->getRequest();
     $form = new Application_Form_Install();
     if ($this->getRequest()->isPost()) {
         if ($form->isValid($request->getPost())) {
             $formValues = $form->getValues();
             // DEBUG
             //Zend_Debug::dump($formValues); die();
             $apiKey = $formValues['apikey'];
             try {
                 if (!$apiKey) {
                     throw new Exception('Gandi API key can\'t be empty!');
                 }
                 if (!is_writable($configFile)) {
                     throw new Exception(sprintf('Config file is not writeable! Please check write right to %s file!', $configFile));
                 }
                 $config->development->gandi = array('api' => array('key' => $apiKey), 'account' => array('showdetails' => '0'), 'vm' => array('showdetails' => '0'));
                 $writer = new Zend_Config_Writer_Ini(array('config' => $config, 'filename' => $configFile));
                 $writer->write();
                 return $this->_helper->redirector('index', 'index');
             } catch (Exception $e) {
                 echo $e->getMessage();
             }
         }
     }
     $this->view->form = $form;
 }
开发者ID:Narno-archives,项目名称:phpGandiHostingMonitor,代码行数:35,代码来源:InstallController.php


示例2: configure

 private function configure()
 {
     $zend_console = new Zend_Console_Getopt(array('create|c' => 'Create database configureation', 'adapter|a=w' => 'Database adapter (mysql)', 'host|h=w' => 'Default to localhost', 'username|u=w' => 'Username to connect to database', 'password|p=w' => 'Password to connect to database', 'database|d=w' => 'Database Name', 'port|o-i' => '(optional) Port for connecting to database', 'socket|s-w' => '(optional) Location for database socket'), $this->argv);
     try {
         echo $a = $zend_console->getOption('a');
         echo $h = $zend_console->getOption('h');
         // Load all sections from an existing config file, while skipping the extends.
         $config = new Zend_Config_Ini(SMCONFIG_DIRECTORY . DIRECTORY_SEPARATOR . 'database.ini', null, array('skipExtends' => true, 'allowModifications' => true));
         // Modify values
         $config->database->doctrine_adapter = $zend_console->getOption('a');
         $config->database->params->host = $zend_console->getOption('h');
         $config->database->params->username = $zend_console->getOption('u');
         $config->database->params->password = $zend_console->getOption('p');
         $config->database->params->dbname = $zend_console->getOption('d');
         $config->database->params->port = $zend_console->getOption('h');
         $config->database->params->socket = $zend_console->getOption('h');
         // Write the config file
         $writer = new Zend_Config_Writer_Ini(array('config' => $config, 'filename' => 'config.ini'));
         $writer->write();
         //*/
     } catch (Zend_Console_Getopt_Exception $e) {
         fwrite(STDOUT, "Connection Failed\n");
         echo $e->getUsageMessage();
         exit;
     }
 }
开发者ID:jeremymoorecom,项目名称:Smallunch,代码行数:26,代码来源:database.class.php


示例3: postUpgrade

 /** Post database upgrade. */
 public function postUpgrade()
 {
     /** @var SettingModel $settingModel */
     $settingModel = MidasLoader::loadModel('Setting');
     $configPath = LOCAL_CONFIGS_PATH . DIRECTORY_SEPARATOR . $this->moduleName . '.local.ini';
     if (file_exists($configPath)) {
         $config = new Zend_Config_Ini($configPath, 'global');
         $settingModel->setConfig(DICOMEXTRACTOR_DCM2XML_COMMAND_KEY, $config->get('dcm2xml', DICOMEXTRACTOR_DCM2XML_COMMAND_DEFAULT_VALUE), $this->moduleName);
         $settingModel->setConfig(DICOMEXTRACTOR_DCMJ2PNM_COMMAND_KEY, $config->get('dcmj2pnm', DICOMEXTRACTOR_DCMJ2PNM_COMMAND_DEFAULT_VALUE), $this->moduleName);
         $settingModel->setConfig(DICOMEXTRACTOR_DCMFTEST_COMMAND_KEY, $config->get('dcmftest', DICOMEXTRACTOR_DCMFTEST_COMMAND_DEFAULT_VALUE), $this->moduleName);
         $settingModel->setConfig(DICOMEXTRACTOR_DCMDICTPATH_KEY, $config->get('dcmdictpath', DICOMEXTRACTOR_DCMDICTPATH_DEFAULT_VALUE), $this->moduleName);
         $config = new Zend_Config_Ini($configPath, null, true);
         unset($config->global->dcm2xml);
         unset($config->global->dcmj2pnm);
         unset($config->global->dcmftest);
         unset($config->global->dcmdictpath);
         $writer = new Zend_Config_Writer_Ini();
         $writer->setConfig($config);
         $writer->setFilename($configPath);
         $writer->write();
     } else {
         $settingModel->setConfig(DICOMEXTRACTOR_DCM2XML_COMMAND_KEY, DICOMEXTRACTOR_DCM2XML_COMMAND_DEFAULT_VALUE, $this->moduleName);
         $settingModel->setConfig(DICOMEXTRACTOR_DCMJ2PNM_COMMAND_KEY, DICOMEXTRACTOR_DCMJ2PNM_COMMAND_DEFAULT_VALUE, $this->moduleName);
         $settingModel->setConfig(DICOMEXTRACTOR_DCMFTEST_COMMAND_KEY, DICOMEXTRACTOR_DCMFTEST_COMMAND_DEFAULT_VALUE, $this->moduleName);
         $settingModel->setConfig(DICOMEXTRACTOR_DCMDICTPATH_KEY, DICOMEXTRACTOR_DCMDICTPATH_DEFAULT_VALUE, $this->moduleName);
     }
 }
开发者ID:josephsnyder,项目名称:Midas,代码行数:28,代码来源:1.1.0.php


示例4: postUpgrade

 /** Post database upgrade. */
 public function postUpgrade()
 {
     /** @var RandomComponent $randomComponent */
     $randomComponent = MidasLoader::loadComponent('Random');
     $securityKey = $randomComponent->generateString(32);
     /** @var SettingModel $settingModel */
     $settingModel = MidasLoader::loadModel('Setting');
     $configPath = LOCAL_CONFIGS_PATH . DIRECTORY_SEPARATOR . $this->moduleName . '.local.ini';
     if (file_exists($configPath)) {
         $config = new Zend_Config_Ini($configPath, 'global');
         $settingModel->setConfig(MIDAS_REMOTEPROCESSING_SECURITY_KEY_KEY, $config->get('securitykey', $securityKey), $this->moduleName);
         $showButton = $config->get('showbutton');
         if ($showButton === 'true') {
             $showButton = 1;
         } elseif ($showButton === 'false') {
             $showButton = 0;
         } else {
             $showButton = MIDAS_REMOTEPROCESSING_SHOW_BUTTON_DEFAULT_VALUE;
         }
         $settingModel->setConfig(MIDAS_REMOTEPROCESSING_SHOW_BUTTON_KEY, $showButton, $this->moduleName);
         $config = new Zend_Config_Ini($configPath, null, true);
         unset($config->securitykey->securitykey);
         unset($config->showbutton->showbutton);
         $writer = new Zend_Config_Writer_Ini();
         $writer->setConfig($config);
         $writer->setFilename($configPath);
         $writer->write();
     } else {
         $settingModel->setConfig(MIDAS_REMOTEPROCESSING_SECURITY_KEY_KEY, $securityKey, $this->moduleName);
         $settingModel->setConfig(MIDAS_REMOTEPROCESSING_SHOW_BUTTON_KEY, MIDAS_REMOTEPROCESSING_SHOW_BUTTON_DEFAULT_VALUE, $this->moduleName);
     }
 }
开发者ID:josephsnyder,项目名称:Midas,代码行数:33,代码来源:1.1.0.php


示例5: indexAction

 public function indexAction()
 {
     $registry = Zend_Registry::getInstance();
     $translate = $registry->get("Zend_Translate");
     $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/manager.ini', null, true);
     $validationErrors = array();
     if ($this->getRequest()->isPost()) {
         $c = $this->_getParam('config');
         if (empty($c['manager_host'])) {
             $validationErrors['manager_host'] = $translate->translate("Manager host is required");
         }
         if (empty($c['gateway_host'])) {
             $validationErrors['gateway_host'] = $translate->translate("Gateway host is required");
         }
         if (empty($validationErrors)) {
             $config->manager_host = $c['manager_host'];
             $config->gateway_host = $c['gateway_host'];
             $writer = new Zend_Config_Writer_Ini(array('config' => $config, 'filename' => APPLICATION_PATH . '/configs/manager.ini'));
             $writer->write();
             $this->view->flashMessage = $translate->translate("Preferences Updated");
         }
     }
     $this->view->config = $config;
     $this->view->validationErrors = $validationErrors;
 }
开发者ID:kyroskoh,项目名称:apigrove,代码行数:25,代码来源:ConfigController.php


示例6: postUpgrade

 /** Post database upgrade. */
 public function postUpgrade()
 {
     /** @var SettingModel $settingModel */
     $settingModel = MidasLoader::loadModel('Setting');
     $configPath = LOCAL_CONFIGS_PATH . DIRECTORY_SEPARATOR . $this->moduleName . '.local.ini';
     if (file_exists($configPath)) {
         $config = new Zend_Config_Ini($configPath, 'global');
         $piwikUrl = isset($config->piwik->url) ? $config->piwik->url : STATISTICS_PIWIK_URL_DEFAULT_VALUE;
         $settingModel->setConfig(STATISTICS_PIWIK_URL_KEY, $piwikUrl, $this->moduleName);
         $piwikId = isset($config->piwik->id) ? $config->piwik->id : STATISTICS_PIWIK_SITE_ID_DEFAULT_VALUE;
         $settingModel->setConfig(STATISTICS_PIWIK_SITE_ID_KEY, $piwikId, $this->moduleName);
         $piwikApiKey = isset($config->piwik->apikey) ? $config->piwik->apikey : STATISTICS_PIWIK_API_KEY_DEFAULT_VALUE;
         $settingModel->setConfig(STATISTICS_PIWIK_API_KEY_KEY, $piwikApiKey, $this->moduleName);
         $ipInfoDbApiKey = isset($config->ipinfodb->apikey) ? $config->ipinfodb->apikey : STATISTICS_IP_INFO_DB_API_KEY_DEFAULT_VALUE;
         $settingModel->setConfig(STATISTICS_IP_INFO_DB_API_KEY_KEY, $ipInfoDbApiKey, $this->moduleName);
         $settingModel->setConfig(STATISTICS_SEND_DAILY_REPORTS_KEY, $config->get('report', STATISTICS_SEND_DAILY_REPORTS_DEFAULT_VALUE), $this->moduleName);
         $config = new Zend_Config_Ini($configPath, null, true);
         unset($config->global->piwik->url);
         unset($config->global->piwik->id);
         unset($config->global->piwik->pikey);
         unset($config->global->ipinfodb->apikey);
         unset($config->global->report);
         $writer = new Zend_Config_Writer_Ini();
         $writer->setConfig($config);
         $writer->setFilename($configPath);
         $writer->write();
     } else {
         $settingModel->setConfig(STATISTICS_PIWIK_URL_KEY, STATISTICS_PIWIK_URL_DEFAULT_VALUE, $this->moduleName);
         $settingModel->setConfig(STATISTICS_PIWIK_SITE_ID_KEY, STATISTICS_PIWIK_SITE_ID_DEFAULT_VALUE, $this->moduleName);
         $settingModel->setConfig(STATISTICS_PIWIK_API_KEY_KEY, STATISTICS_PIWIK_API_KEY_DEFAULT_VALUE, $this->moduleName);
         $settingModel->setConfig(STATISTICS_IP_INFO_DB_API_KEY_KEY, STATISTICS_IP_INFO_DB_API_KEY_DEFAULT_VALUE, $this->moduleName);
         $settingModel->setConfig(STATISTICS_SEND_DAILY_REPORTS_KEY, STATISTICS_SEND_DAILY_REPORTS_DEFAULT_VALUE, $this->moduleName);
     }
 }
开发者ID:josephsnyder,项目名称:Midas,代码行数:35,代码来源:1.1.0.php


示例7: postUpgrade

 /** Post database upgrade. */
 public function postUpgrade()
 {
     /** @var SettingModel $settingModel */
     $settingModel = MidasLoader::loadModel('Setting');
     $configPath = LOCAL_CONFIGS_PATH . DIRECTORY_SEPARATOR . $this->moduleName . '.local.ini';
     if (file_exists($configPath)) {
         $config = new Zend_Config_Ini($configPath, 'global');
         $settingModel->setConfig(MIDAS_THUMBNAILCREATOR_PROVIDER_KEY, MIDAS_THUMBNAILCREATOR_PROVIDER_PHMAGICK, $this->moduleName);
         $settingModel->setConfig(MIDAS_THUMBNAILCREATOR_FORMAT_KEY, MIDAS_THUMBNAILCREATOR_FORMAT_JPG, $this->moduleName);
         $settingModel->setConfig(MIDAS_THUMBNAILCREATOR_IMAGE_MAGICK_KEY, $config->get('imagemagick', MIDAS_THUMBNAILCREATOR_IMAGE_MAGICK_DEFAULT_VALUE), $this->moduleName);
         $settingModel->setConfig(MIDAS_THUMBNAILCREATOR_USE_THUMBNAILER_KEY, $config->get('useThumbnailer', MIDAS_THUMBNAILCREATOR_USE_THUMBNAILER_DEFAULT_VALUE), $this->moduleName);
         $settingModel->setConfig(MIDAS_THUMBNAILCREATOR_THUMBNAILER_KEY, $config->get('thumbnailer', MIDAS_THUMBNAILCREATOR_THUMBNAILER_DEFAULT_VALUE), $this->moduleName);
         $config = new Zend_Config_Ini($configPath, null, true);
         unset($config->global->imageFormats);
         unset($config->global->imagemagick);
         unset($config->global->thumbnailer);
         unset($config->global->useThumbnailer);
         $writer = new Zend_Config_Writer_Ini();
         $writer->setConfig($config);
         $writer->setFilename($configPath);
         $writer->write();
     } else {
         $settingModel->setConfig(MIDAS_THUMBNAILCREATOR_PROVIDER_KEY, MIDAS_THUMBNAILCREATOR_PROVIDER_DEFAULT_VALUE, $this->moduleName);
         $settingModel->setConfig(MIDAS_THUMBNAILCREATOR_FORMAT_KEY, MIDAS_THUMBNAILCREATOR_FORMAT_DEFAULT_VALUE, $this->moduleName);
         $settingModel->setConfig(MIDAS_THUMBNAILCREATOR_IMAGE_MAGICK_KEY, MIDAS_THUMBNAILCREATOR_IMAGE_MAGICK_DEFAULT_VALUE, $this->moduleName);
         $settingModel->setConfig(MIDAS_THUMBNAILCREATOR_USE_THUMBNAILER_KEY, MIDAS_THUMBNAILCREATOR_USE_THUMBNAILER_DEFAULT_VALUE, $this->moduleName);
         $settingModel->setConfig(MIDAS_THUMBNAILCREATOR_THUMBNAILER_KEY, MIDAS_THUMBNAILCREATOR_THUMBNAILER_DEFAULT_VALUE, $this->moduleName);
     }
 }
开发者ID:josephsnyder,项目名称:Midas,代码行数:30,代码来源:1.1.0.php


示例8: create

    /**
     * @param string $type
     */
    public function create()
    {
        /* @var $userConfig Zend_Tool_Framework_Client_Config */
        $userConfig = $this->_registry->getConfig();

        $resp = $this->_registry->getResponse();
        if ($userConfig->exists()) {
            require_once "Zend/Tool/Framework/Exception.php";
            throw new Zend_Tool_Framework_Exception(
                "A configuration already exists, cannot create a new one.");
        }

        $homeDirectory = $this->_detectHomeDirectory();

        $writer = new Zend_Config_Writer_Ini();
        $writer->setRenderWithoutSections();
        $filename = $homeDirectory."/.zf.ini";

        $config = array(
            'php' => array(
                'include_path' => get_include_path(),
            ),
        );
        $writer->write($filename, new Zend_Config($config));

        $resp = $this->_registry->getResponse();
        $resp->appendContent("Successfully written Zend Tool config.");
        $resp->appendContent("It is located at: ".$filename);
    }
开发者ID:nhp,项目名称:shopware-4,代码行数:32,代码来源:Config.php


示例9: _doInsert

 protected function _doInsert(\Application\Entity\Entity $model)
 {
     $data = array("tax_free_allowance" => $model->taxFreeAllowance, "tax_percent" => $model->taxPercent, "incaso_parts" => $model->incasoParts, "storno_interval" => $model->stornoInterval, "storno_first_part_percent" => $model->stornoFirstPartPercent, "storno_second_part_percent" => $model->stornoSecondPartPercent);
     $filename = APPLICATION_PATH . "/configs/configuration.ini";
     $configWriter = new \Zend_Config_Writer_Ini();
     $configWriter->write($filename, new \Zend_Config($data));
 }
开发者ID:sp1ke77,项目名称:MLM-1,代码行数:7,代码来源:Configuration.php


示例10: postUpgrade

 /** Post database upgrade. */
 public function postUpgrade()
 {
     /** @var SettingModel $settingModel */
     $settingModel = MidasLoader::loadModel('Setting');
     $config = new Zend_Config_Ini(APPLICATION_CONFIG, 'global');
     $settingModel->setConfig('address_verification', $config->get('verifyemail', 0), 'mail');
     if ($config->get('smtpfromaddress')) {
         $fromAddress = $config->get('smtpfromaddress');
     } elseif (ini_get('sendmail_from')) {
         $fromAddress = ini_get('sendmail_from');
     } else {
         $fromAddress = '[email protected]';
         // RFC2606
     }
     $settingModel->setConfig('from_address', $fromAddress, 'mail');
     if ($config->get('smtpserver')) {
         $components = parse_url($config->get('smtpserver'));
         if (isset($components['host'])) {
             $settingModel->setConfig('smtp_host', $components['host'], 'mail');
         }
         if (isset($components['port'])) {
             $settingModel->setConfig('smtp_port', $components['port'], 'mail');
             if ($components['port'] === 587) {
                 $settingModel->setConfig('smtp_use_ssl', 1, 'mail');
             }
         }
         if (isset($components['user'])) {
             $settingModel->setConfig('smtp_username', $components['user'], 'mail');
         }
         if (isset($components['pass'])) {
             $settingModel->setConfig('smtp_password', $components['pass'], 'mail');
         }
     }
     if ($config->get('smtpuser')) {
         $settingModel->setConfig('smtp_username', $config->get('smtpuser'), 'mail');
     }
     if ($config->get('smtppassword')) {
         $settingModel->setConfig('smtp_password', $config->get('smtppassword'), 'mail');
     }
     if ($settingModel->getValueByName('smtp_host', 'mail')) {
         $provider = 'smtp';
     } else {
         $provider = 'mail';
     }
     $settingModel->setConfig('provider', $provider, 'mail');
     /** @var UtilityComponent $utilityComponent */
     $utilityComponent = MidasLoader::loadComponent('Utility');
     $utilityComponent->installModule('mail');
     $config = new Zend_Config_Ini(APPLICATION_CONFIG, null, true);
     unset($config->global->smtpfromaddress);
     unset($config->global->smtpserver);
     unset($config->global->smtpuser);
     unset($config->global->smtppassword);
     unset($config->global->verifyemail);
     $writer = new Zend_Config_Writer_Ini();
     $writer->setConfig($config);
     $writer->setFilename(APPLICATION_CONFIG);
     $writer->write();
 }
开发者ID:josephsnyder,项目名称:Midas,代码行数:60,代码来源:3.2.17.php


示例11: setIsInstalled

 public static function setIsInstalled()
 {
     try {
         $writer = new Zend_Config_Writer_Ini();
         $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/app.ini', null, array('skipExtends' => true, 'allowModifications' => true));
         $config->production->isInstalled = "1";
         $writer->setConfig($config)->setFilename(APPLICATION_PATH . '/configs/app.ini')->write();
         return true;
     } catch (Exception $e) {
         return false;
     }
 }
开发者ID:bklein01,项目名称:SiberianCMS,代码行数:12,代码来源:Installer.php


示例12: saveConfig

 public function saveConfig()
 {
     if (!is_dir(PIMCORE_PLUGINS_PATH . "/Zendformbuilder/data/form/")) {
         mkdir(PIMCORE_PLUGINS_PATH . "/Zendformbuilder/data/form/");
     }
     if (file_exists(PIMCORE_PLUGINS_PATH . "/Zendformbuilder/data/form/form_" . $this->id . ".ini")) {
         unlink(PIMCORE_PLUGINS_PATH . "/Zendformbuilder/data/form/form_" . $this->id . ".ini");
     }
     $config = new Zend_Config($this->config, true);
     $writer = new Zend_Config_Writer_Ini(array("config" => $config, "filename" => PIMCORE_PLUGINS_PATH . "/Zendformbuilder/data/form/form_" . $this->id . ".ini"));
     $writer->write();
 }
开发者ID:DivanteLtd,项目名称:Zendformbuilder,代码行数:12,代码来源:Builder.php


示例13: myIndexAction

 function myIndexAction()
 {
     if ($_SERVER['REQUEST_METHOD']) {
         $form = new VF_Import_Settings();
         $form->populate($_POST);
         $config = $form->getConfig();
         $config->importer->allowMissingFields = $form->getValue('allowMissingFields');
         $config->importer->Y2KMode = $form->getValue('Y2KMode');
         $config->importer->Y2KThreshold = $form->getValue('Y2KThreshold');
         $writer = new Zend_Config_Writer_Ini(array('config' => $config, 'filename' => ELITE_CONFIG));
         echo $writer->write();
     }
 }
开发者ID:ngagestudios,项目名称:magento.vehiclefits.com,代码行数:13,代码来源:VafimportexportsettingsController.php


示例14: myIndexAction

 function myIndexAction()
 {
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         $form = new Elite_Vaf_Model_Settings_Category();
         $form->populate($_POST);
         $config = $form->getConfig();
         $config->category->disable = $form->getValue('disable');
         $config->category->mode = $form->getValue('mode');
         $config->category->whitelist = $form->getValue('whitelist');
         $config->category->blacklist = $form->getValue('blacklist');
         $config->category->requireVehicle = $form->getValue('requireVehicle');
         $writer = new Zend_Config_Writer_Ini(array('config' => $config, 'filename' => ELITE_CONFIG));
         echo $writer->write();
     }
 }
开发者ID:ngagestudios,项目名称:magento.vehiclefits.com,代码行数:15,代码来源:VafsettingscategoryController.php


示例15: postUpgrade

 /** Post database upgrade. */
 public function postUpgrade()
 {
     /** @var SettingModel $settingModel */
     $settingModel = MidasLoader::loadModel('Setting');
     $configPath = LOCAL_CONFIGS_PATH . DIRECTORY_SEPARATOR . $this->moduleName . '.local.ini';
     if (file_exists($configPath)) {
         $config = new Zend_Config_Ini($configPath, 'global');
         $settingModel->setConfig(MIDAS_DICOMSERVER_DCM2XML_COMMAND_KEY, $config->get('dcm2xml', MIDAS_DICOMSERVER_DCM2XML_COMMAND_DEFAULT_VALUE), $this->moduleName);
         $settingModel->setConfig(MIDAS_DICOMSERVER_STORESCP_COMMAND_KEY, $config->get('storescp', MIDAS_DICOMSERVER_STORESCP_COMMAND_DEFAULT_VALUE), $this->moduleName);
         $settingModel->setConfig(MIDAS_DICOMSERVER_STORESCP_PORT_KEY, $config->get('storescp_port', MIDAS_DICOMSERVER_STORESCP_PORT_DEFAULT_VALUE), $this->moduleName);
         $settingModel->setConfig(MIDAS_DICOMSERVER_STORESCP_STUDY_TIMEOUT_KEY, $config->get('storescp_study_timeout', MIDAS_DICOMSERVER_STORESCP_STUDY_TIMEOUT_DEFAULT_VALUE), $this->moduleName);
         $settingModel->setConfig(MIDAS_DICOMSERVER_RECEPTION_DIRECTORY_KEY, $config->get('receptiondir', MIDAS_DICOMSERVER_RECEPTION_DIRECTORY_DEFAULT_VALUE), $this->moduleName);
         $settingModel->setConfig(MIDAS_DICOMSERVER_DESTINATION_FOLDER_KEY, $config->get('pydas_dest_folder', MIDAS_DICOMSERVER_DESTINATION_FOLDER_DEFAULT_VALUE), $this->moduleName);
         $settingModel->setConfig(MIDAS_DICOMSERVER_DCMQRSCP_COMMAND_KEY, $config->get('dcmqrscp', MIDAS_DICOMSERVER_DCMQRSCP_COMMAND_DEFAULT_VALUE), $this->moduleName);
         $settingModel->setConfig(MIDAS_DICOMSERVER_DCMQRSCP_PORT_KEY, $config->get('dcmqrscp_port', MIDAS_DICOMSERVER_DCMQRSCP_PORT_DEFAULT_VALUE), $this->moduleName);
         $settingModel->setConfig(MIDAS_DICOMSERVER_DCMQRIDX_COMMAND_KEY, $config->get('dcmqridx', MIDAS_DICOMSERVER_DCMQRIDX_COMMAND_DEFAULT_VALUE), $this->moduleName);
         $settingModel->setConfig(MIDAS_DICOMSERVER_SERVER_AE_TITLE_KEY, $config->get('server_ae_title', MIDAS_DICOMSERVER_SERVER_AE_TITLE_DEFAULT_VALUE), $this->moduleName);
         $settingModel->setConfig(MIDAS_DICOMSERVER_PEER_AES_KEY, $config->get('peer_aes', MIDAS_DICOMSERVER_PEER_AES_DEFAULT_VALUE), $this->moduleName);
         $config = new Zend_Config_Ini($configPath, null, true);
         unset($config->global->dcm2xml);
         unset($config->global->storescp);
         unset($config->global->storescp_port);
         unset($config->global->storescp_study_timeout);
         unset($config->global->receptiondir);
         unset($config->global->pydas_dest_folder);
         unset($config->global->dcmqrscp);
         unset($config->global->dcmqrscp_port);
         unset($config->global->dcmqridx);
         unset($config->global->server_ae_title);
         unset($config->global->peer_aes);
         $writer = new Zend_Config_Writer_Ini();
         $writer->setConfig($config);
         $writer->setFilename($configPath);
         $writer->write();
     } else {
         $settingModel->setConfig(MIDAS_DICOMSERVER_DCM2XML_COMMAND_KEY, MIDAS_DICOMSERVER_DCM2XML_COMMAND_DEFAULT_VALUE, $this->moduleName);
         $settingModel->setConfig(MIDAS_DICOMSERVER_STORESCP_COMMAND_KEY, MIDAS_DICOMSERVER_STORESCP_COMMAND_DEFAULT_VALUE, $this->moduleName);
         $settingModel->setConfig(MIDAS_DICOMSERVER_STORESCP_PORT_KEY, MIDAS_DICOMSERVER_STORESCP_PORT_DEFAULT_VALUE, $this->moduleName);
         $settingModel->setConfig(MIDAS_DICOMSERVER_STORESCP_STUDY_TIMEOUT_KEY, MIDAS_DICOMSERVER_STORESCP_STUDY_TIMEOUT_DEFAULT_VALUE, $this->moduleName);
         $settingModel->setConfig(MIDAS_DICOMSERVER_RECEPTION_DIRECTORY_KEY, MIDAS_DICOMSERVER_RECEPTION_DIRECTORY_DEFAULT_VALUE, $this->moduleName);
         $settingModel->setConfig(MIDAS_DICOMSERVER_DESTINATION_FOLDER_KEY, MIDAS_DICOMSERVER_DESTINATION_FOLDER_DEFAULT_VALUE, $this->moduleName);
         $settingModel->setConfig(MIDAS_DICOMSERVER_DCMQRSCP_COMMAND_KEY, MIDAS_DICOMSERVER_DCMQRSCP_COMMAND_DEFAULT_VALUE, $this->moduleName);
         $settingModel->setConfig(MIDAS_DICOMSERVER_DCMQRSCP_PORT_KEY, MIDAS_DICOMSERVER_DCMQRSCP_PORT_DEFAULT_VALUE, $this->moduleName);
         $settingModel->setConfig(MIDAS_DICOMSERVER_DCMQRIDX_COMMAND_KEY, MIDAS_DICOMSERVER_DCMQRIDX_COMMAND_DEFAULT_VALUE, $this->moduleName);
         $settingModel->setConfig(MIDAS_DICOMSERVER_SERVER_AE_TITLE_KEY, MIDAS_DICOMSERVER_SERVER_AE_TITLE_DEFAULT_VALUE, $this->moduleName);
         $settingModel->setConfig(MIDAS_DICOMSERVER_PEER_AES_KEY, MIDAS_DICOMSERVER_PEER_AES_DEFAULT_VALUE, $this->moduleName);
     }
 }
开发者ID:josephsnyder,项目名称:Midas,代码行数:49,代码来源:1.1.0.php


示例16: myIndexAction

 function myIndexAction()
 {
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         $form = new Elite_Vaf_Model_Settings_Garage();
         $form->populate($_POST);
         $config = $form->getConfig();
         foreach ($form->getElements() as $name => $element) {
             if ($name == 'save') {
                 continue;
             }
             $config->mygarage->{$name} = $element->getValue();
         }
         $writer = new Zend_Config_Writer_Ini(array('config' => $config, 'filename' => ELITE_CONFIG));
         echo $writer->write();
     }
 }
开发者ID:ngagestudios,项目名称:magento.vehiclefits.com,代码行数:16,代码来源:VafsettingsgarageController.php


示例17: postUpgrade

 /** Post database upgrade. */
 public function postUpgrade()
 {
     /** @var SettingModel $settingModel */
     $settingModel = MidasLoader::loadModel('Setting');
     $configPath = LOCAL_CONFIGS_PATH . DIRECTORY_SEPARATOR . $this->moduleName . '.local.ini';
     if (file_exists($configPath)) {
         $config = new Zend_Config_Ini($configPath, 'global');
         $settingModel->setConfig(CLEANUP_DAYS_TO_KEEP_PARTIAL_FILES_KEY, $config->get('days', CLEANUP_DAYS_TO_KEEP_PARTIAL_FILES_DEFAULT_VALUE), $this->moduleName);
         $config = new Zend_Config_Ini($configPath, null, true);
         unset($config->global->days);
         $writer = new Zend_Config_Writer_Ini();
         $writer->setConfig($config);
         $writer->setFilename($configPath);
         $writer->write();
     } else {
         $settingModel->setConfig(CLEANUP_DAYS_TO_KEEP_PARTIAL_FILES_KEY, CLEANUP_DAYS_TO_KEEP_PARTIAL_FILES_DEFAULT_VALUE, $this->moduleName);
     }
 }
开发者ID:josephsnyder,项目名称:Midas,代码行数:19,代码来源:1.1.0.php


示例18: postUpgrade

 /** Post database upgrade. */
 public function postUpgrade()
 {
     /** @var SettingModel $settingModel */
     $settingModel = MidasLoader::loadModel('Setting');
     $configPath = LOCAL_CONFIGS_PATH . DIRECTORY_SEPARATOR . $this->moduleName . '.local.ini';
     if (file_exists($configPath)) {
         $config = new Zend_Config_Ini($configPath, 'global');
         $settingModel->setConfig(API_METHOD_PREFIX_KEY, $config->get('methodprefix', API_METHOD_PREFIX_DEFAULT_VALUE), $this->moduleName);
         $config = new Zend_Config_Ini($configPath, null, true);
         unset($config->global->methodprefix);
         $writer = new Zend_Config_Writer_Ini();
         $writer->setConfig($config);
         $writer->setFilename($configPath);
         $writer->write();
     } else {
         $settingModel->setConfig(API_METHOD_PREFIX_KEY, API_METHOD_PREFIX_DEFAULT_VALUE, $this->moduleName);
     }
 }
开发者ID:josephsnyder,项目名称:Midas,代码行数:19,代码来源:1.1.0.php


示例19: postUpgrade

 /** Post database upgrade. */
 public function postUpgrade()
 {
     /** @var SettingModel $settingModel */
     $settingModel = MidasLoader::loadModel('Setting');
     $configPath = LOCAL_CONFIGS_PATH . DIRECTORY_SEPARATOR . $this->moduleName . '.local.ini';
     if (file_exists($configPath)) {
         $config = new Zend_Config_Ini($configPath, 'global');
         $settingModel->setConfig(METADATAEXTRACTOR_HACHOIR_METADATA_COMMAND_KEY, $config->get('hachoir', METADATAEXTRACTOR_HACHOIR_METADATA_COMMAND_DEFAULT_VALUE), $this->moduleName);
         $config = new Zend_Config_Ini($configPath, null, true);
         unset($config->global->hachoir);
         $writer = new Zend_Config_Writer_Ini();
         $writer->setConfig($config);
         $writer->setFilename($configPath);
         $writer->write();
     } else {
         $settingModel->setConfig(METADATAEXTRACTOR_HACHOIR_METADATA_COMMAND_KEY, METADATAEXTRACTOR_HACHOIR_METADATA_COMMAND_DEFAULT_VALUE, $this->moduleName);
     }
 }
开发者ID:josephsnyder,项目名称:Midas,代码行数:19,代码来源:1.1.0.php


示例20: doIndexAction

 function doIndexAction()
 {
     $config = $this->getConfig();
     $this->block->setTemplate('vf/vaf/vfdata.phtml');
     $form = $this->form();
     $this->block->form = $form;
     if ($this->getRequest()->getParam('download')) {
         $download_url = 'http://data.vehiclefits.com/api/download?token=' . $config->vfdata->api_token;
         $local_file = sys_get_temp_dir() . '/' . uniqid();
         $local_stream = fopen($local_file, 'w');
         $download_stream = fopen($download_url, 'r');
         while (!feof($download_stream)) {
             $buffer = fread($download_stream, 512);
             // use a buffer of 512 bytes
             fwrite($local_stream, $buffer);
         }
         fclose($download_stream);
         fclose($local_stream);
         $importer = new VF_Import_VehiclesList_CSV_Import($local_file);
         $importer->import();
         $this->block->downloaded = true;
         return;
     }
     if ($this->getRequest()->getParam('upload')) {
         $upload_url = 'http://data.vehiclefits.com/api/upload?token=' . $config->vfdata->api_token;
         $local_file = sys_get_temp_dir() . '/' . uniqid();
         $local_stream = fopen($local_file, 'w');
         $exporter = new VF_Import_VehiclesList_CSV_Export();
         $exporter->export($local_stream);
         $ch = curl_init($upload_url);
         curl_setopt($ch, CURLOPT_POST, 1);
         curl_setopt($ch, CURLOPT_POSTFIELDS, file_get_contents($local_file));
         curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
         curl_setopt($ch, CURLOPT_HEADER, 0);
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
         $response = curl_exec($ch);
         $this->block->uploaded = $response;
     }
     if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getParams())) {
         $config->vfdata->api_token = $form->getValue('api_token');
         $writer = new Zend_Config_Writer_Ini(array('config' => $config, 'filename' => ELITE_CONFIG));
         echo $writer->write();
     }
 }
开发者ID:hashir-dhattiwala,项目名称:vfmagento,代码行数:44,代码来源:VfdataController.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Zend_Config_Writer_Xml类代码示例发布时间:2022-05-23
下一篇:
PHP Zend_Config_Ini类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap