本文整理汇总了PHP中Solar::dump方法的典型用法代码示例。如果您正苦于以下问题:PHP Solar::dump方法的具体用法?PHP Solar::dump怎么用?PHP Solar::dump使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Solar
的用法示例。
在下文中一共展示了Solar::dump方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
/**
*
* Sets cache entry data.
*
* @param string $key The entry ID.
*
* @param mixed $data The data to write into the entry.
*
* @param int $life A custom lifespan, in seconds, for the entry; if null,
* uses the default lifespan for the adapter instance.
*
* @return bool True on success, false on failure.
*
*/
public function save($key, $data, $life = null)
{
if (!$this->_active) {
return;
}
// modify the key to add the prefix
$key = $this->entry($key);
// life value
if ($life === null) {
$life = $this->_life;
}
Solar::dump($life, 'life');
// save to apc
return apc_store($key, $data, $life);
}
示例2: foreach
<?php
require_once 'Solar.php';
Solar::start();
$select = Solar::object('Solar_Sql_Select');
$select->from('sc_bookmarks', '*');
$select->order('id');
$result = $select->fetch('all');
$bookmarks = Solar::object('Solar_Cell_Bookmarks');
foreach ($result as $row) {
$data = array('created' => $row['ts_new'], 'updated' => $row['ts_mod'], 'owner_handle' => $row['user_id'], 'editor_handle' => $row['user_id'], 'uri' => $row['uri'], 'subj' => $row['title'], 'summ' => $row['descr'], 'tags' => $row['tags'], 'rank' => $row['rank']);
$result = $bookmarks->insert($data);
Solar::dump($result);
}
Solar::stop();