本文整理匯總了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();