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


PHP zotop::config方法代码示例

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


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

示例1: __construct

 public function __construct($config = array())
 {
     if (!$this->test()) {
         zotop::error(zotop::t('The memcache extension is not available'));
     }
     $host = $config['host'];
     $host = empty($host) ? zotop::config('system.cache.memcache.host') : $host;
     $host = empty($host) ? '127.0.0.1' : $host;
     $post = $config['post'];
     $port = empty($port) ? zotop::config('system.cache.memcache.port') : $port;
     $port = empty($port) ? '11211' : $port;
     $timeout = isset($config['timeout']) ? (bool) $config['timeout'] : false;
     $persistent = isset($config['persistent']) ? (bool) $config['persistent'] : false;
     unset($config);
     //是否持久链接
     $connect = $persistent ? 'pconnect' : 'connect';
     $this->memcache =& new Memcache();
     if ($timeout === false) {
         $this->connected = @$this->memcache->{$connect}($host, $port);
     } else {
         $this->connected = @$this->memcache->{$connect}($host, $port, $timeout);
     }
     if (!$this->connected) {
         zotop::error(zotop::t('无法连接memcache服务器 “{$host}:{$port}”,请检查参数配置是否正确', array('host' => $host, 'port' => $port)));
     }
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:26,代码来源:memcache.php

示例2: show

 public static function show(array $msg)
 {
     $page = new page();
     $page->set('msg', $msg);
     $message = $page->render('msg');
     if ($message !== false) {
         echo $message;
     } else {
         $page->title = $msg['type'];
         $page->body = array('class' => 'msg');
         $page->header();
         $page->add('');
         $page->add('<div id="icon"><div class="zotop-icon zotop-icon-' . $msg['type'] . '"></div></div>');
         $page->add('<div id="msg" class="' . $msg['type'] . ' clearfix">');
         $page->add('	<div id="msg-type">' . $msg['type'] . '</div>');
         $page->add('	<div id="msg-life">' . (int) $msg['life'] . '</div>');
         $page->add('	<div id="msg-title">' . $msg['title'] . '</div>');
         $page->add('	<div id="msg-content">' . $msg['content'] . '</div>');
         $page->add('	<div id="msg-detail">' . $msg['detail'] . '</div>');
         $page->add('	<div id="msg-action">' . $msg['action'] . '</div>');
         $page->add('	<div id="msg-file">' . $msg['file'] . '</div>');
         $page->add('	<div id="msg-line">' . $msg['line'] . '</div>');
         if (!empty($msg['url'])) {
             $page->add('	<div>');
             $page->add('		<div><b>如果页面没有自动跳转,请点击以下链接</b></div>');
             $page->add('		<a href="' . $msg['url'] . '" id="msg-url">' . $msg['url'] . '</a>');
             $page->add('	</div>');
         }
         $page->add('</div>');
         $page->add('<div id="powered">' . zotop::config('zotop.name') . ' ' . zotop::config('zotop.version') . '</div>');
         $page->footer();
     }
     exit;
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:34,代码来源:msg.php

示例3: onDefault

 public function onDefault()
 {
     if (form::isPostBack()) {
         msg::error('开发中', '数据保存开发中,请稍后……');
     }
     $header['title'] = '系统设置';
     page::header($header);
     page::top();
     page::navbar($this->navbar(), 'main');
     form::header();
     block::header('网站基本信息');
     form::field(array('type' => 'text', 'label' => zotop::t('网站名称'), 'name' => 'zotop.site.title', 'value' => zotop::config('zotop.site.title'), 'description' => zotop::t('网站名称,将显示在标题和导航中')));
     form::field(array('type' => 'text', 'label' => zotop::t('网站域名'), 'name' => 'zotop.site.domain', 'value' => zotop::config('zotop.site.domain'), 'description' => zotop::t('网站域名地址,不包含http://,如:www.zotop.com')));
     form::field(array('type' => 'text', 'label' => zotop::t('备案信息'), 'name' => 'zotop.site.icp', 'value' => zotop::config('zotop.site.icp'), 'description' => zotop::t('页面底部可以显示 ICP 备案信息,如果网站已备案,在此输入您的授权码,它将显示在页面底部,如果没有请留空')));
     form::field(array('type' => 'select', 'options' => array('0' => '不显示', '1' => '显示'), 'label' => zotop::t('授权信息'), 'name' => 'zotop.site.license', 'value' => zotop::config('zotop.site.license'), 'description' => zotop::t('页脚部位显示程序官方网站链接')));
     form::field(array('type' => 'textarea', 'label' => zotop::t('网站简介'), 'name' => 'zotop.site.about', 'value' => zotop::config('zotop.site.about')));
     block::footer();
     block::header('联系信息设置');
     form::field(array('type' => 'text', 'label' => zotop::t('公司名称'), 'name' => 'zotop.site.title', 'value' => '', 'description' => zotop::t('网站隶属的公司或者组织名称')));
     form::field(array('type' => 'textarea', 'label' => zotop::t('网站简介'), 'name' => 'zotop.site.about', 'value' => ''));
     block::footer();
     form::buttons(array('type' => 'submit'), array('type' => 'back'));
     form::footer();
     page::bottom();
     page::footer();
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:26,代码来源:setting.php

示例4: theme

 public static function theme()
 {
     //系统默认返回的主题为system
     $theme = zotop::config('system.theme');
     $theme = empty($theme) ? 'system' : $theme;
     return $theme;
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:7,代码来源:application.php

示例5: hash

 public static function hash()
 {
     $hash = zotop::config('system.safety.authkey');
     $hash = empty($hash) ? 'zotop form hash!' : $hash;
     $hash = substr(time(), 0, -7) . $hash;
     $hash = strtoupper(md5($hash));
     return $hash;
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:8,代码来源:form.php

示例6: config

 public static function config()
 {
     //打包全部配置
     zotop::config(include ZPATH_DATA . DS . 'config.php');
     zotop::config('zotop.database', include ZPATH_DATA . DS . 'database.php');
     zotop::config('zotop.application', include ZPATH_DATA . DS . 'application.php');
     zotop::config('zotop.module', include ZPATH_DATA . DS . 'module.php');
     zotop::config('zotop.router', include ZPATH_DATA . DS . 'router.php');
     zotop::data(ZPATH_RUNTIME . DS . 'config.php', zotop::config());
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:10,代码来源:runtime.php

示例7: bottom

 public function bottom($str = '')
 {
     $html[] = '';
     $html[] = '</div>';
     $html[] = '<div id="footer">';
     if (!empty($str)) {
         $html[] = '<div id="bottom" class="clearfix">' . $str . '</div>';
     }
     $html[] = '</div>';
     $html[] = '<div id="powered">powered by <b>' . zotop::config('zotop.name') . '</b> runtime:<b>{#runtime}</b>,memory:<b>{#memory}</b>,includefiles:<b>{#include}</b>,queries:<b>{#queries}</b>,caches:<b>{#caches}</b></div>';
     echo implode("\n", $html);
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:12,代码来源:page.php

示例8: bottom

 public static function bottom($str = '')
 {
     $html[] = '';
     $html[] = '</div>';
     $html[] = '<div id="footer">';
     if (!empty($str)) {
         $html[] = $str;
     }
     $html[] = '</div>';
     $html[] = '<div id="powered">powered by <b>' . zotop::config('zotop.name') . '</b> runtime:<b>{$runtime}</b>,memory:<b>{$memory}</b>,includefiles:<b>{$include}</b></div>';
     $html[] = '</div>';
     echo implode("\n", $html);
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:13,代码来源:page.php

示例9: bottom

 public function bottom()
 {
     $bottom = $this->render('bottom');
     if (!$bottom) {
         $html[] = '';
         $html[] = '</div>';
         $html[] = '<div id="footer">';
         $html[] = '	<div id="powered">powered by <b>' . zotop::config('zotop.name') . '</b> runtime:<b>{#runtime}</b>,memory:<b>{#memory}</b>,includefiles:<b>{#include}</b>,queries:<b>{#queries}</b></div>';
         $html[] = '</div>';
         $bottom = implode("\n", $html);
     }
     echo $bottom;
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:13,代码来源:page.php

示例10: runtime

 public static function runtime()
 {
     if (!is_file(ZOTOP_RUNTIME . DS . '~runtime.php')) {
         $registers = zotop::register();
         $content = array();
         $content[] = '<?php';
         foreach ($registers as $file) {
             $content[] = file::compile($file);
         }
         $content[] = '?>';
         file::write(ZOTOP_RUNTIME . DS . '~runtime.php', implode("\n", $content));
     }
     //缓存配置文件
     zotop::data(ZOTOP_RUNTIME . DS . '~config.php', zotop::config());
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:15,代码来源:application.php

示例11: __construct

 public function __construct()
 {
     //调用父类的初始化函数
     parent::__construct();
     //初始化上传对象
     $this->upload = new upload();
     $this->upload->files = array();
     $this->upload->savepath = trim(zotop::config('system.upload.dir'), '/') . '/' . trim(zotop::config('system.upload.filepath'), '/');
     $this->upload->allowexts = 'jpg|jpeg|gif|bmp|png|doc|docx|xls|ppt|pdf|txt|rar|zip';
     $this->upload->maxsize = (int) zotop::config('system.upload.maxsize');
     $this->upload->overwrite = true;
     $this->upload->filename = 'md5';
     $this->upload->field = 'file';
     $this->upload->error = 0;
     $this->upload->msg = '';
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:16,代码来源:file.php

示例12: __construct

 public function __construct()
 {
     //调用父类的初始化函数
     parent::__construct();
     //初始化上传对象
     $this->upload = new upload();
     $this->upload->files = array();
     $this->upload->savepath = trim(zotop::config('upload.dir'), '/') . '/' . trim(zotop::config('upload.filepath'), '/');
     $this->upload->alowexts = 'jpg|jpeg|gif|bmp|png';
     $this->upload->maxsize = 0;
     $this->upload->overwrite = true;
     $this->upload->filename = 'md5';
     $this->upload->field = 'file';
     $this->upload->error = 0;
     $this->upload->msg = '';
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:16,代码来源:image.php

示例13: onDefault

 public function onDefault()
 {
     $header['title'] = '关于我们';
     dialog::header($header);
     dialog::top();
     echo '<div style="padding:4px 15px;">';
     echo '<table class="list">';
     echo '<tr><td class="list-side">程序版本:</td><td>' . zotop::config('zotop.version') . '</td></tr>';
     echo '<tr><td class="list-side">程序设计:</td><td>' . zotop::config('zotop.author') . '</td></tr>';
     echo '<tr><td class="list-side">程序开发:</td><td>' . zotop::config('zotop.authors') . '</td></tr>';
     echo '<tr><td class="list-side">官方网站:</td><td><a href="' . zotop::config('zotop.homepage') . '" target="_blank">' . zotop::config('zotop.homepage') . '</a></td></tr>';
     echo '<tr><td class="list-side">安装时间:</td><td>' . zotop::config('zotop.install') . '</td></tr>';
     echo '</table>';
     echo '</div>';
     dialog::bottom();
     dialog::footer();
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:17,代码来源:about.php

示例14: init

 /**
  * 应用程序初始化
  *
  * @return null
  */
 public static function init()
 {
     //错误及异常处理
     error_reporting(E_ERROR | E_WARNING | E_PARSE);
     set_error_handler(array('application', 'error'));
     set_exception_handler(array('application', 'exception'));
     //时区设置
     if (function_exists('date_default_timezone_set')) {
         $timezone = zotop::config('zotop.locale.timezone');
         $timezone = empty($timezone) ? date_default_timezone_get() : $timezone;
         if ($timezone) {
             date_default_timezone_set($timezone);
         }
     }
     //输出头
     header("Content-Type: text/html;charset=utf-8");
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:22,代码来源:application.php

示例15: run

 /**
  * 运行时执行,并加载相关文件
  */
 public static function run()
 {
     //打包配置文件
     zotop::data(ZOTOP_PATH_RUNTIME . DS . 'config.php', zotop::config());
     //打包全部hook文件
     $hooks = runtime::compile(runtime::$hooks);
     if (!empty($hooks)) {
         file::write(ZOTOP_PATH_RUNTIME . DS . ZOTOP_APP_NAME . '_hooks.php', $hooks, true);
     }
     //加载hooks以便核心文件使用
     zotop::load(ZOTOP_PATH_RUNTIME . DS . ZOTOP_APP_NAME . '_hooks.php');
     //打包核心文件
     $libraries = zotop::register();
     $libraries = runtime::compile($libraries);
     if (!empty($libraries)) {
         file::write(ZOTOP_PATH_RUNTIME . DS . ZOTOP_APP_NAME . '.php', $libraries, true);
     }
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:21,代码来源:runtime.php


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