本文整理汇总了PHP中zotop::data方法的典型用法代码示例。如果您正苦于以下问题:PHP zotop::data方法的具体用法?PHP zotop::data怎么用?PHP zotop::data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类zotop
的用法示例。
在下文中一共展示了zotop::data方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cache
public function cache()
{
$data = array();
$rows = $this->getAll();
foreach ($rows as $row) {
$data[$row['id']] = $row;
}
zotop::data('usergroup', $data);
return $data;
}
示例2: cache
public function cache()
{
$data = array();
$rows = $this->getAll(array('where' => array('status', '>=', '0')));
foreach ($rows as $row) {
$data[$row['id']] = $row;
}
zotop::data('module', $data);
zotop::reboot();
return $data;
}
示例3: reload
public function reload()
{
$data = $this->getAll(array('select' => '*', 'where' => array('status', '>', 0), 'orderby' => 'order desc,updatetime desc'));
if (is_array($data)) {
foreach ($data as $module) {
$modules[$module['id']] = $module;
}
zotop::data('zotop.config.module', $modules);
}
return true;
}
示例4: cache
public function cache($reload = false)
{
$name = $this->table();
$data = zotop::data($name);
//设置缓存数据
if ($reload || $data === null) {
$data = $this->getAll($sql);
$data = arr::hashmap($data, $this->key());
if (is_array($data)) {
zotop::data($name, $data);
}
}
return $data;
}
示例5: 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());
}
示例6: hook
public static function hook()
{
//打包全部hook
$hooks = array();
$modules = zotop::data('module');
foreach ($modules as $module) {
$path = $module['path'] . DS . 'hook';
$path = path::decode($path);
$hook = (array) dir::files($path, '', true, true);
$hooks = array_merge($hooks, $hook);
}
$content = runtime::compile($hooks);
if (!empty($content)) {
file::write(ZPATH_RUNTIME . DS . 'hook.php', $content, true);
}
}
示例7: 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);
}
}
示例8: build
/**
* 运行时执行,并加载相关文件
*/
public static function build()
{
runtime::config();
runtime::library();
runtime::hooks();
//打包配置文件
zotop::data(ZOTOP_PATH_RUNTIME . DS . ZOTOP_APPLICATION_GROUP . '.config.php', zotop::config());
//打包全部hook文件
$hooks = runtime::compile(runtime::$hooks);
if (!empty($hooks)) {
file::write(ZOTOP_PATH_RUNTIME . DS . ZOTOP_APPLICATION_GROUP . '.hooks.php', $hooks, true);
}
//加载hooks以便核心文件使用
zotop::load(ZOTOP_PATH_RUNTIME . DS . ZOTOP_APPLICATION_GROUP . '.hooks.php');
//打包核心文件
$libraries = zotop::register();
$libraries = runtime::compile($libraries);
if (!empty($libraries)) {
file::write(ZOTOP_PATH_RUNTIME . DS . ZOTOP_APPLICATION_GROUP . '.core.php', $libraries, true);
}
}
示例9: cache
public function cache($flush = false)
{
$name = $this->table();
$data = zotop::data($name);
if ($flush || $data === null) {
$data = $this->getAll();
if (is_array($data)) {
zotop::data($name, $data);
}
//重启系统
zotop::reboot();
}
return $data;
}
示例10: cache
public function cache($name = '', $sql = '')
{
$name = empty($name) ? $this->getModelName() : $name;
$data = array();
$data = $this->getAll($sql);
zotop::data($name, $data);
return $data;
}
示例11:
//加载核心文件
if (is_file(ZOTOP_APP . DS . '~runtime.php')) {
require ZOTOP_APP . DS . '~runtime.php';
} else {
//加载系统核心
require ZOTOP_LIB . DS . 'zotop' . DS . 'core' . DS . 'zotop.php';
//注册别名,自动加载系统库文件
zotop::register(include ZOTOP_LIB . DS . 'alias.php');
zotop::register(include ZOTOP_APP . DS . 'alias.php');
}
//配置的初始化
if (is_file(ZOTOP_RUNTIME . DS . '~config.php')) {
zotop::config(include ZOTOP_RUNTIME . DS . '~config.php');
} else {
zotop::config(include ZOTOP_SYSTEM . DS . 'config.php');
zotop::config(include ZOTOP_CONFIG . DS . 'config.php');
zotop::config('zotop.database', include ZOTOP_CONFIG . DS . 'database.php');
zotop::config('zotop.application', include ZOTOP_CONFIG . DS . 'application.php');
zotop::config('zotop.module', include ZOTOP_CONFIG . DS . 'module.php');
zotop::config('zotop.router', include ZOTOP_CONFIG . DS . 'router.php');
//缓存配置文件
zotop::data(ZOTOP_RUNTIME . DS . '~config.php', zotop::config());
}
//启动底层系统
zotop::boot();
//hook的初始化
if (is_file(ZOTOP_RUNTIME . DS . '~hook.php')) {
zotop::load(ZOTOP_RUNTIME . DS . '~hook.php');
} else {
//生成全局hook文件
}
示例12: delete
/**
* 删除缓存
*
* @param string $key 缓存变量名
* @return mixed
*/
public function delete($key)
{
$filename = $this->filepath($key);
return zotop::data($filename, null, -1000);
}
示例13: cache
public function cache($reload = false)
{
$data = $this->db()->select('id', 'value')->getAll();
$data = arr::hashmap($data, 'id', 'value');
zotop::data('config', $data);
zotop::reboot();
return $data;
}
示例14: zotop_logsave
function zotop_logsave()
{
zotop::data('mylog', zotop::$logs);
}
示例15: flush
/**
* 刷新数据表的meta数据
*
* @access public
* @return string
*/
public function flush()
{
//获取字段信息
$tables = $this->db()->tables(true);
if (is_array($tables)) {
$table = $tables[$tableName];
if (is_array($table)) {
$fields = $this->db()->table($tableName)->fields();
$primaryKey = $this->db()->table($tableName)->primaryKey();
$table['primarykey'] = $primaryKey;
$table['fields'] = (array) $fields;
//写入table数据
zotop::data($dataName, $table);
//返回table数据
return $table;
}
}
return false;
}