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


PHP Data::writeDB方法代码示例

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


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

示例1: execute

 /**
  * Creates the form.
  *
  * @return void
  *
  * @global array The configuration of the plugins.
  */
 public function execute()
 {
     global $plugin_cf;
     $pcf = $plugin_cf['advancedform'];
     $forms = Data::readDB();
     $forms[$this->id] = array('name' => '', 'title' => '', 'to_name' => $pcf['mail_to_name'], 'to' => $pcf['mail_to'], 'cc' => $pcf['mail_cc'], 'bcc' => $pcf['mail_bcc'], 'captcha' => (bool) $pcf['mail_captcha'], 'store' => false, 'thanks_page' => $pcf['mail_thanks_page'], 'fields' => array(array('field' => '', 'label' => '', 'type' => 'text', 'props' => "¦¦¦", 'required' => '0')));
     Data::writeDB($forms);
 }
开发者ID:bbfriend,项目名称:advancedform_xh,代码行数:15,代码来源:CreateFormTransaction.php

示例2: execute

 /**
  * Deletes the form.
  *
  * @return void
  *
  * @throws \InvalidArgumentException
  */
 public function execute()
 {
     $forms = Data::readDB();
     if (!isset($forms[$this->id])) {
         throw new \InvalidArgumentException();
     }
     unset($forms[$this->id]);
     Data::writeDB($forms);
 }
开发者ID:bbfriend,项目名称:advancedform_xh,代码行数:16,代码来源:DeleteFormTransaction.php

示例3: execute

 /**
  * Copies the form.
  *
  * @return void
  *
  * @throws \InvalidArgumentException
  */
 public function execute()
 {
     $forms = Data::readDB();
     if (isset($forms[$this->from])) {
         $form = $forms[$this->from];
         $form['name'] = '';
         $forms[$this->to] = $form;
         Data::writeDB($forms);
     } else {
         throw new \InvalidArgumentException();
     }
 }
开发者ID:bbfriend,项目名称:advancedform_xh,代码行数:19,代码来源:CopyFormTransaction.php

示例4: importForm

 /**
  * Imports the form definition from a *.frm file. Returns the mail form
  * administration.
  *
  * @param string $id A form ID.
  *
  * @return string (X)HTML.
  *
  * @global array  The localization of the plugins.
  * @global string The (X)HTML fragment containing error messages.
  * @global object The CSRF protector.
  */
 protected static function importForm($id)
 {
     global $plugin_tx, $e, $_XH_csrfProtection;
     if ($_SERVER['REQUEST_METHOD'] != 'POST') {
         return Editor::renderFormsAdministration();
     }
     $_XH_csrfProtection->check();
     $ptx = $plugin_tx['advancedform'];
     $forms = Data::readDB();
     if (!isset($forms[$id])) {
         $fn = Data::folder() . $id . '.frm';
         if (($cnt = file_get_contents($fn)) !== false && ($form = unserialize($cnt)) !== false && isset($form['%VERSION%']) && count($form) == 2) {
             if ($form['%VERSION%'] < Data::DB_VERSION) {
                 $form = Data::updatedDb($form);
             }
             unset($form['%VERSION%']);
             foreach ($form as $f) {
                 $f['name'] = $id;
                 $forms[$id] = $f;
             }
             Data::writeDB($forms);
         } else {
             e('cntopen', 'file', $fn);
         }
     } else {
         $e .= '<li><b>' . $ptx['error_form_exists'] . '</b></li>';
     }
     return Editor::renderFormsAdministration();
 }
开发者ID:bbfriend,项目名称:advancedform_xh,代码行数:41,代码来源:Controller.php


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