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

PHP ipDb函数代码示例

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

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



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

示例1: searchQuery

 public function searchQuery($searchVariables)
 {
     if (isset($searchVariables[$this->field]) && $searchVariables[$this->field] !== '') {
         return ' `' . $this->field . '` = ' . ipDb()->getConnection()->quote($searchVariables[$this->field] * 100) . '';
     }
     return null;
 }
开发者ID:x33n,项目名称:ImpressPages,代码行数:7,代码来源:Currency.php


示例2: getError

 /**
  * Get error
  *
  * @param array $values
  * @param int $valueKey
  * @param $environment
  * @return string|bool
  */
 public function getError($values, $valueKey, $environment)
 {
     if (!array_key_exists($valueKey, $values)) {
         return false;
     }
     if ($values[$valueKey] == '' && empty($this->data['allowEmpty'])) {
         return false;
     }
     $table = $this->data['table'];
     $idField = empty($this->data['idField']) ? 'id' : $this->data['idField'];
     $row = ipDb()->selectRow($table, '*', array($valueKey => $values[$valueKey]));
     if (!$row) {
         return false;
     }
     if (isset($values[$idField]) && $values[$idField] == $row[$idField]) {
         return false;
     }
     if ($this->errorMessage !== null) {
         return $this->errorMessage;
     }
     if ($environment == \Ip\Form::ENVIRONMENT_ADMIN) {
         $errorText = __('The value should be unique', 'Ip-admin');
     } else {
         $errorText = __('The value should be unique', 'Ip');
     }
     return $errorText;
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:35,代码来源:Unique.php


示例3: getList

 /**
  * @param string $languageCode
  * @param int $parentId
  * @return array
  */
 protected static function getList($languageCode, $parentId)
 {
     $pages = ipDb()->selectAll('page', '*', array('parentId' => $parentId, 'isDeleted' => 0), 'ORDER BY `pageOrder`');
     $answer = array();
     //generate jsTree response array
     foreach ($pages as $page) {
         $pageData = array();
         $pageData['state'] = 'closed';
         $jsTreeId = 'page_' . $page['id'];
         if (!empty($_SESSION['Pages.nodeOpen'][$jsTreeId])) {
             $pageData['state'] = 'open';
         }
         $children = self::getList($languageCode, $page['id']);
         if (count($children) === 0) {
             $pageData['children'] = false;
             $pageData['state'] = 'leaf';
         }
         $pageData['children'] = $children;
         if ($page['isVisible']) {
             $icon = '';
         } else {
             $icon = ipFileUrl('Ip/Internal/Pages/assets/img/file_hidden.png');
         }
         $pageData['li_attr'] = array('id' => $jsTreeId, 'rel' => 'page', 'languageId' => $languageCode, 'pageId' => $page['id']);
         $pageData['data'] = array('title' => $page['title'] . '', 'icon' => $icon);
         //transform null into empty string. Null break JStree into infinite loop
         $pageData['text'] = htmlspecialchars($page['title']);
         $answer[] = $pageData;
     }
     return $answer;
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:36,代码来源:JsTreeHelper.php


示例4: generatePasswordResetSecret

 private static function generatePasswordResetSecret($userId)
 {
     $secret = md5(ipConfig()->get('sessionName') . uniqid());
     $data = array('resetSecret' => $secret, 'resetTime' => time());
     ipDb()->update('administrator', $data, array('id' => $userId));
     return $secret;
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:7,代码来源:Model.php


示例5: searchQuery

 public function searchQuery($searchVariables)
 {
     if (isset($searchVariables[$this->field]) && $searchVariables[$this->field] !== '') {
         return ' `' . $this->field . '` like ' . ipDb()->getConnection()->quote('%' . json_encode($searchVariables[$this->field]) . '%') . '';
     }
     return null;
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:7,代码来源:Checkboxes.php


示例6: checkIfChildren

 public static function checkIfChildren($parentIds, $id)
 {
     $parentIds = implode(',', $parentIds);
     if (empty($parentIds)) {
         return false;
     }
     $table = ipTable('page');
     $sql = "SELECT `id` FROM {$table} WHERE `parentId` IN ({$parentIds}) AND `isVisible` = 1 AND `isDeleted` = 0 ";
     $results = ipDb()->fetchAll($sql);
     $ids = array();
     $found = false;
     foreach ($results as $result) {
         $ids[] = $result['id'];
         if ($result['id'] == $id) {
             $found = true;
             break;
         }
     }
     if ($found) {
         return true;
     } elseif (!empty($ids)) {
         return self::checkIfChildren($ids, $id);
     } else {
         return false;
     }
 }
开发者ID:sspaeti,项目名称:ImpressPages,代码行数:26,代码来源:Model.php


示例7: removePermission

 public static function removePermission($permission, $administratorId = null)
 {
     if ($administratorId === null) {
         $administratorId = ipAdminId();
     }
     $condition = array('permission' => $permission, 'administratorId' => $administratorId);
     ipDb()->delete('permission', $condition);
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:8,代码来源:AdminPermissionsModel.php


示例8: getByCode

 public static function getByCode($languageCode)
 {
     $row = ipDb()->selectRow('language', '*', array('code' => $languageCode));
     if (!$row) {
         return null;
     }
     return new self($row['id'], $row['code'], $row['url'], $row['title'], $row['abbreviation'], $row['isVisible'], $row['textDirection']);
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:8,代码来源:Language.php


示例9: veryEmail_10

 public static function veryEmail_10($vcode)
 {
     $fcode = substr($vcode, 0, strpos($vcode, '-!'));
     $mail = substr($vcode, strpos($vcode, '-!') + 2, 250);
     ipDb()->update('comments', array('approved' => '1'), array('verification_code' => $fcode, 'email' => $mail));
     $data = array('message' => __('Your email address has been verified. Thank you.', 'Comments'));
     return ipView('view/mailVerified.php', $data)->render();
 }
开发者ID:sspaeti,项目名称:ImpressPages,代码行数:8,代码来源:Slot.php


示例10: findFiles

 /**
  * Find all files bind to particular module
  */
 public function findFiles($plugin, $instanceId = null)
 {
     $where = array('plugin' => $plugin);
     if ($instanceId !== null) {
         $where['instanceId'] = $instanceId;
     }
     return ipDb()->selectAll('repository_file', '*', $where);
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:11,代码来源:Model.php


示例11: ipWidgetDuplicated

 public static function ipWidgetDuplicated($data)
 {
     $oldId = $data['oldWidgetId'];
     $newId = $data['newWidgetId'];
     $newRevisionId = ipDb()->selectValue('widget', 'revisionId', array('id' => $newId));
     $widgetTable = ipTable('widget');
     $sql = "\n            UPDATE\n                {$widgetTable}\n            SET\n                `blockName` = REPLACE(`blockName`, 'block_" . (int) $oldId . "', 'block_" . (int) $newId . "')\n            WHERE\n                `revisionId` = :newRevisionId\n            ";
     ipDb()->execute($sql, array('newRevisionId' => $newRevisionId));
 }
开发者ID:sspaeti,项目名称:ImpressPages,代码行数:9,代码来源:Event.php


示例12: getAll

 /**
  * Get all storage values
  *
  * @return array Key=>value array of all storage values
  */
 public function getAll()
 {
     $values = ipDb()->selectAll($this->tableName, array($this->keyColumn, $this->valueColumn), array($this->namespaceColumn => $this->namespace));
     $result = array();
     foreach ($values as $value) {
         $result[$value[$this->keyColumn]] = json_decode($value[$this->valueColumn], true);
     }
     return $result;
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:14,代码来源:ValueStorage.php


示例13: dropDataTableRepository

 /**
  * Drops the datatable repository db table
  */
 private function dropDataTableRepository()
 {
     $ipTable = ipTable(TableRepository::DATA_TABLE_REPOSITORY);
     $sql = "\n            DROP TABLE {$ipTable}\n        ";
     try {
         ipDb()->execute($sql);
     } catch (\Ip\Exception\Db $e) {
         ipLog()->error("Could not drop repository table. Statement: {$sql}, Message: " . $e->getMessage());
     }
 }
开发者ID:hmuralt,项目名称:DataTableWidget,代码行数:13,代码来源:Worker.php


示例14: getPageByAlias

 /**
  * @param string $alias
  * @param string|null $languageCode
  * @return \Ip\Page
  */
 public function getPageByAlias($alias, $languageCode = null)
 {
     if ($languageCode === null) {
         $languageCode = ipContent()->getCurrentLanguage()->getCode();
     }
     $row = ipDb()->selectRow('page', '*', array('alias' => $alias, 'languageCode' => $languageCode, 'isDeleted' => 0));
     if (!$row) {
         return null;
     }
     return new \Ip\Page($row);
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:16,代码来源:Content.php


示例15: emptyPageForm

 public static function emptyPageForm()
 {
     $form = new \Ip\Form();
     $form->setEnvironment(\Ip\Form::ENVIRONMENT_ADMIN);
     $pages = ipDb()->selectAll('page', 'id, title', array('isDeleted' => 1));
     foreach ($pages as $page) {
         $field = new \Ip\Form\Field\Checkbox(array('name' => 'page[]', 'label' => $page['title'], 'value' => true, 'postValue' => $page['id']));
         $form->addField($field);
     }
     return $form;
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:11,代码来源:Helper.php


示例16: newUrl

 public static function newUrl($preferredUrl)
 {
     $suffix = '';
     $url = ipDb()->selectAll('language', 'id', array('url' => $preferredUrl . $suffix));
     if (empty($url)) {
         return $preferredUrl;
     }
     while (!empty($url)) {
         $suffix++;
         $url = ipDb()->selectAll('language', 'id', array('url' => $preferredUrl . $suffix));
     }
     return $preferredUrl . $suffix;
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:13,代码来源:Db.php


示例17: importData

 public static function importData($tablePrefix)
 {
     $errors = array();
     $sqlFile = self::ipFile('Plugin/Install/sql/data.sql');
     $fh = fopen($sqlFile, 'r');
     $sql = fread($fh, utf8_decode(filesize($sqlFile)));
     fclose($fh);
     $sql = str_replace("INSERT INTO `ip_", "INSERT INTO `" . $tablePrefix, $sql);
     $sql = str_replace("[[[[version]]]]", ipApplication()->getVersion(), $sql);
     $sql = str_replace("[[[[dbversion]]]]", \Ip\Internal\Update\Model::getDbVersion(), $sql);
     $sql = str_replace("[[[[time]]]]", date('Y-m-d H:i:s'), $sql);
     $sql = str_replace("[[[[timestamp]]]]", time(), $sql);
     ipDb()->execute($sql);
     return $errors;
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:15,代码来源:Model.php


示例18: log

 /**
  * Logs with an arbitrary level.
  *
  * @param mixed $level
  * @param string $message
  * @param array $context
  * @return null
  */
 public function log($level, $message, array $context = array())
 {
     if (!ipDb()->isConnected()) {
         // do not log things if we have no database connection
         return;
     }
     if (!is_string($message)) {
         // Probably programmer made a mistake, used Logger::log($message, $context)
         $row = array('level' => \Psr\Log\LogLevel::ERROR, 'message' => 'Code uses ipLog()->log() without giving $level info.', 'context' => json_encode(array('args' => func_get_args())));
         ipDb()->insert('log', $row);
         return;
     }
     $row = array('level' => $level, 'message' => $message, 'context' => json_encode($context));
     ipDb()->insert('log', $row);
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:23,代码来源:Logger.php


示例19: download

 public static function download()
 {
     $requestFile = ipFile('') . ipRequest()->getRelativePath();
     $fileDir = ipFile('file/');
     if (mb_strpos($requestFile, $fileDir) !== 0) {
         return null;
     }
     $file = mb_substr($requestFile, mb_strlen($fileDir));
     $file = urldecode($file);
     if (empty($file)) {
         throw new \Ip\Exception('Required parameter is missing');
     }
     $absoluteSource = realpath(ipFile('file/' . $file));
     if (!$absoluteSource || !is_file($absoluteSource)) {
         throw new \Ip\Exception\Repository\Transform("File doesn't exist", array('filename' => $absoluteSource));
     }
     if (strpos($absoluteSource, realpath(ipFile('file/'))) !== 0 || strpos($absoluteSource, realpath(ipFile('file/secure'))) === 0) {
         throw new \Exception("Requested file (" . $file . ") is outside of public dir");
     }
     $mime = \Ip\Internal\File\Functions::getMimeType($absoluteSource);
     $fsize = filesize($absoluteSource);
     // set headers
     header("Pragma: public");
     header("Expires: 0");
     header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
     header("Cache-Control: public");
     header('Content-type: ' . $mime);
     header("Content-Transfer-Encoding: binary");
     header("Content-Length: " . $fsize);
     // download
     // @readfile($file_path);
     $file = @fopen($absoluteSource, "rb");
     if ($file) {
         while (!feof($file)) {
             print fread($file, 1024 * 8);
             flush();
             if (connection_status() != 0) {
                 @fclose($file);
                 die;
             }
         }
         @fclose($file);
     }
     //TODO provide method to stop any output by ImpressPages
     ipDb()->disconnect();
     exit;
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:47,代码来源:PublicController.php


示例20: getMenus

 public static function getMenus()
 {
     $menuAliases = self::getMenuAliases();
     $currLangCode = ipContent()->getCurrentLanguage()->getCode();
     if (!empty($menuAliases)) {
         $menuPages = array();
         foreach ($menuAliases as $menuAlias) {
             $menuRec = ipDb()->selectAll('page', 'id, title, alias', array('isDeleted' => 0, 'alias' => $menuAlias, 'parentId' => 0, 'isDisabled' => 0, 'isSecured' => 0, 'languageCode' => $currLangCode), 'ORDER BY `pageOrder`');
             if (!empty($menuRec)) {
                 $menuPages = array_merge($menuPages, $menuRec);
             }
         }
     } else {
         $menuPages = ipDb()->selectAll('page', 'id, title, alias', array('isDeleted' => 0, 'alias' => $menuAlias, 'parentId' => 0, 'isDisabled' => 0, 'isSecured' => 0, 'languageCode' => $currLangCode), 'ORDER BY `pageOrder`');
     }
     return $menuPages;
 }
开发者ID:sspaeti,项目名称:ImpressPages,代码行数:17,代码来源:Model.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP ipFile函数代码示例发布时间:2022-05-15
下一篇:
PHP ipContent函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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