本文整理汇总了PHP中DataManager类的典型用法代码示例。如果您正苦于以下问题:PHP DataManager类的具体用法?PHP DataManager怎么用?PHP DataManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DataManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
function render($name)
{
$dataManager = new \DataManager();
$doc = $dataManager->getDocument($name);
if ($doc === null) {
$resp = new \Symfony\Component\HttpFoundation\Response("", 404);
return $resp;
}
$url1 = $doc->member_one->photo_url;
$data1 = $dataManager->getPhotoDataBase64($url1);
$url2 = $doc->member_two->photo_url;
$data2 = $dataManager->getPhotoDataBase64($url2);
$url3 = $doc->vehicle->photo_url;
$data3 = $dataManager->getPhotoDataBase64($url3);
$imageData = base64_encode($imageContent);
$template = new \PHPTemplate();
$template->assign("document", $doc);
$template->assign("member_one", $doc->member_one);
$template->assign("member_one_photo_data_base64", $data1);
$template->assign("member_two", $doc->member_two);
$template->assign("member_two_photo_data_base64", $data2);
$template->assign("home_base", $doc->home_base);
$template->assign("completed_journeys", $doc->completed_journeys);
$template->assign("planned_journeys", $doc->planned_journeys);
$template->assign("wish_list_journeys", $doc->wish_list_journeys);
$template->assign("vehicle", $doc->vehicle);
$template->assign("vehicle_photo_data_base64", $data3);
$h = $template->fetch('html');
file_put_contents($name . "_html_." . "html", $h);
return $h;
}
示例2: list_all
function list_all()
{
$page = (int) $this->uri->segment(3, 1);
//echo $page;
$page = $page ? $page : 1;
$items_per_page = 7;
$dm = new DataManager($this->dm_profile, $this->dm_sqlsrv);
$dm->setItemsPerPage($items_per_page);
$dm->setPage($page);
$dm->setMode('list');
$dm->setOrderingField('id', 0);
if ($dm->loadData() === false) {
var_dump($dm->getErrors());
exit;
}
$data['pages_count'] = $dm->getPagesCount();
$message = $this->uri->segment(4);
switch ($message) {
case 'deleted':
$data['message'] = 'Item deleted.';
break;
case 'saved':
$data['message'] = 'Item saved.';
break;
default:
$data['message'] = '';
}
$data['titles'] = $dm->getTitles();
$data['fields'] = $dm->getFields();
$data['controller'] = $this->controller;
$data['page'] = $this->controller . '/list';
$this->ag_auth->view('reseller/list', $data);
}
示例3: test_create_db
public function test_create_db()
{
$dm = new \DataManager();
system("rm -Rvf " . $dm->dataRoot . "/*");
$obj1 = $dm->getDefaultDocument();
$obj1->unique_identifier = "robert_blackwell";
$dm->putFile("robert_blackwell", $obj1);
$obj1->unique_identifier = "blackwells";
$dm->putFile("blackwells", $obj1);
}
示例4: edit
function edit($document_id, $section)
{
// return __METHOD__." $document_id $section ";
$dataManager = new \DataManager();
$doc = $dataManager->getDocument($document_id);
$template = new \PHPTemplate();
$template->assign("document", $doc);
$template_name = "form_" . $section;
return $template->fetch($template_name);
}
示例5: show
function show($name)
{
$dataManager = new \DataManager();
$doc = $dataManager->getDocument($name);
if ($doc === null) {
$resp = new \Symfony\Component\HttpFoundation\Response("", 404);
return $resp;
}
$template = new \PHPTemplate();
$template->assign("document", $doc);
return $template->fetch('show');
}
示例6: GetInstance
public static function GetInstance()
{
if (self::$instance == null) {
self::$instance = new DataManager();
}
return self::$instance;
}
示例7: processRequest
public function processRequest(MMapRequest $request, MMapResponse $response)
{
ob_start('mb_output_handler');
MMapManager::startSession();
//check if the session has expired
MMapManager::checkSessionExpiration();
$return = null;
$dataManager = DataManager::getInstance();
$POST = $request->getPOST();
$params = array();
if (isset($POST['params'])) {
$params = $dataManager->doInput($POST['params']);
} else {
if ($request->issetGET('params')) {
$params = $request->getGET('params');
}
}
$return = array();
foreach ($params as $call) {
$call[2] = json_encode($call[2]);
$_POST['params'] = $call[2];
$request->setPost('params', $call[2]);
$_GET['message'] = $call[1];
$request->setGET('message', $call[1]);
$_GET['checknum'] = $call[0];
$request->setGET('checknum', $call[0]);
MMapMsg::getInstance()->processRequest($request, $response);
MMapManager::getInstance()->doResponse($response);
$response->clear();
$content = ob_get_contents();
ob_clean();
$return[] = $content;
}
$response->setBodyRenderer(new DataManagerBodyRenderer($return));
}
示例8: __construct
/**
* @return GroundManager
* @param SiteSettings $o_settings
* @param MySqlConnection $o_db
* @desc Read and write Grounds
*/
function __construct(SiteSettings $o_settings, MySqlConnection $o_db)
{
parent::DataManager($o_settings, $o_db);
$this->s_item_class = 'Ground';
# Exclude once-only teams by default
$this->filter_team_types = array(Team::CLOSED_GROUP, Team::OCCASIONAL, Team::REGULAR, Team::REPRESENTATIVE);
}
示例9: lookup
public static function lookup($hostname)
{
self::init();
Profiler::StartTimer("DNSResolver::lookup()", 2);
$data = DataManager::singleton();
$records = $apc = NULL;
$cachekey = "dnsresolver.lookup.{$hostname}";
if (self::$cache && !empty($data->caches["apc"]) && $data->caches["apc"]["default"]->enabled) {
$apc = $data->caches["apc"]["default"];
$cached = $apc->get($cachekey);
if ($cached !== false) {
$records = unserialize($cached);
Logger::Info("DNSResolver: found '{$hostname}' in APC cache");
}
}
if ($records === NULL) {
Logger::Info("DNSResolver: Looking up '{$hostname}'");
foreach (self::$search as $suffix) {
$fqdn = $hostname . (!empty($suffix) ? "." . $suffix : "");
$records = dns_get_record($fqdn, DNS_A);
if (!empty($records)) {
break;
}
}
if (self::$cache && !empty($records) && $apc !== NULL && $apc->enabled) {
$ttl = any(self::$ttl, $records[0]["ttl"]);
$apc->set($cachekey, serialize($records), array("lifetime" => $ttl));
}
}
Profiler::StopTimer("DNSResolver::lookup()");
return $records;
}
示例10: __construct
/**
* @return MatchManager
* @param SiteSettings $o_settings
* @desc Read and write matches
*/
public function __construct($o_settings, $o_db)
{
parent::DataManager($o_settings, $o_db);
$this->s_item_class = 'Match';
$this->filter_by_match_types = array();
$this->filter_by_player_types = array();
$this->filter_by_teams = array();
}
示例11: TeamManager
/**
* @return TeamManager
* @param SiteSettings $o_settings
* @param MySqlConnection $o_db
* @desc Read and write Teams
*/
public function TeamManager(SiteSettings $o_settings, MySqlConnection $o_db)
{
parent::DataManager($o_settings, $o_db);
$this->s_item_class = 'Team';
$this->b_inactive_last = true;
# Exclude once-only teams and schools by default
$this->filter_team_types = array(Team::CLOSED_GROUP, Team::OCCASIONAL, Team::REGULAR, Team::REPRESENTATIVE);
}
示例12: controller_category
public function controller_category($args)
{
$vars["category"] = $args["category"];
if (is_string($vars["category"])) {
$categories = DataManager::fetch("db.demos.{$vars['category']}", "demo_categories", array("category" => $vars["category"]));
$vars["category"] = $categories[0];
}
return $this->GetComponentResponse("./category.tpl", $vars);
}
示例13: init
public static function init()
{
$cookieinfo = explode(",", $_COOKIE['fl-uid']);
$fluid = $cookieinfo[0];
$device = DataManager::fetch("db.session.{$deviceid}:nocache", "usersession.usersession", array("fl_uid" => $fluid));
if (count($device) == 1) {
self::set(preg_match("/^a:\\d+:{/", $device[0]["data"]) ? unserialize($device[0]["data"]) : json_decode($device[0]["data"]));
}
}
示例14: __construct
/**
* Instantiates a ShortUrlManager
*
* @param SiteSettings $o_settings
* @param MySqlConnection $o_db
*/
public function __construct(SiteSettings $o_settings, MySqlConnection $o_db)
{
parent::DataManager($o_settings, $o_db);
$this->SetItemClass('ShortUrl');
$a_formats = $this->GetSettings()->GetShortUrlFormats();
foreach ($a_formats as $o_format) {
$this->AddUrlFormat($o_format);
}
}
示例15: processRequest
public function processRequest(MMapRequest $request, MMapResponse $response)
{
ob_start('mb_output_handler');
MMapManager::startSession();
//check if the session has expired
MMapManager::checkSessionExpiration();
$return = null;
$dataManager = DataManager::getInstance();
// restore current process using checknum
$myProcManager = ProcManager::getInstance();
$myProcess = $myProcManager->getProcessByChecknum($request->getGET('checknum'));
$myProcManager->setCurrentProcess($myProcess);
$appDesc = new EyeMobileApplicationDescriptor($myProcess->getName());
$POST = $request->getPOST();
$params = array();
if (isset($POST['params'])) {
$params = $dataManager->doInput($POST['params']);
} else {
if ($request->issetGET('params')) {
$params = $request->getGET('params');
}
}
$methodName = $request->getGET('message');
// calling an ExecModule
if (strpos($methodName, '__') === 0) {
$moduleName = explode('_', substr($methodName, 2));
$methodName = $moduleName[1];
//ex: "FileChooser"
$moduleName = $moduleName[0];
//ex: "browsePath"
$return = call_user_func_array(array($appDesc->getApplicationClassName(), '__callModule'), array($moduleName, $methodName, $params));
} else {
if ($appDesc->isJavascriptOnlyApplication()) {
$return = call_user_func(array('EyeosJavascriptApplicationExecutable', $methodName), $params);
} else {
if (method_exists($appDesc->getApplicationClassName(), $methodName)) {
$return = call_user_func(array($appDesc->getApplicationClassName(), $methodName), $params);
} else {
//If no function is present, call the NOT mobile function
MMapMsg::getInstance()->processRequest($request, $response);
return;
}
// try {
// $return = call_user_func(array($appDesc->getApplicationClassName(), $methodName), $params);
// } catch (Exception $e) {
// //If no function is present, call the NOT mobile function
// MMapMsg::getInstance()->processRequest($request, $response);
// return;
// }
}
}
if ($response->getBodyRenderer() === null && $response->getBody() == '') {
$response->setBodyRenderer(new DataManagerBodyRenderer($return));
}
}