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


PHP getSession函数代码示例

本文整理汇总了PHP中getSession函数的典型用法代码示例。如果您正苦于以下问题:PHP getSession函数的具体用法?PHP getSession怎么用?PHP getSession使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: crud

 function crud($idproduct = null)
 {
     $dataSession = getSession();
     $dataMenu = array("user" => $dataSession);
     $dataMenu['selectMenu'] = "product";
     $dataMenu['title'] = "Productos";
     $data = array();
     $trademark = $this->trademark->findAll();
     $data['trademark'] = $trademark['rpta'] == true ? $trademark['array'] : array();
     $subcategory = $this->subcategory->findAll();
     $data['subcategory'] = $subcategory['rpta'] == true ? $subcategory['array'] : array();
     if (!is_null($idproduct)) {
         $product = $this->product->getbyId($idproduct);
         $data['product'] = $product['rpta'] == true ? $product['array'] : array();
         $arrSubcategory = $this->subcategory->findByProduct($idproduct);
         $aux = array(0);
         if ($arrSubcategory['rpta'] == true) {
             foreach ($arrSubcategory['array'] as $key => $value) {
                 array_push($aux, $value['subcategoryid']);
             }
         }
         $data['arrSubcategory'] = $aux;
     }
     $this->load->view("menu/menu_view", $dataMenu);
     $this->load->view("product/crud", $data);
 }
开发者ID:carloz192,项目名称:lifeleg,代码行数:26,代码来源:Product.php

示例2: hospitalTimeSlot_post

 function hospitalTimeSlot_post()
 {
     $this->bf_form_validation->set_rules('hospitalId', 'hospitalId', 'xss_clean|numeric|required|trim');
     if ($this->bf_form_validation->run($this) == FALSE) {
         $response = array('status' => FALSE, 'message' => $this->validation_post_warning());
         $this->response($response, 400);
     } else {
         $hospitalId = $this->input->post('hospitalId');
         $options = array('table' => 'qyura_hospitalTimeSlot', 'where' => array('qyura_hospitalTimeSlot.hospitalTimeSlot_deleted' => 0, 'qyura_hospitalTimeSlot.hospitalTimeSlot_hospitalId' => $hospitalId));
         $hospitalTimeSlot = $this->common_model->customGet($options);
         $response = array();
         if (isset($hospitalTimeSlot) && $hospitalTimeSlot != NULL) {
             foreach ($hospitalTimeSlot as $hospitalTime) {
                 $timeSlot = array();
                 $timeSlot[] = $hospitalTime->hospitalTimeSlot_id;
                 $timeSlot[] = $hospitalTime->hospitalTimeSlot_startTime;
                 $timeSlot[] = $hospitalTime->hospitalTimeSlot_endTime;
                 $timeSlot[] = getSession($hospitalTime->hospitalTimeSlot_sessionType);
                 $response[] = $timeSlot;
             }
         }
         $columns = array('h_timeSlotid', 'h_startTime', 'h_endTime', 'h_sessionType');
         if (!empty($response) && $response != NULL) {
             $response = array('status' => TRUE, 'message' => ' Time Slot!', 'data' => $response, 'columns' => $columns);
             $this->response($response, 200);
         } else {
             $response = array('status' => FALSE, 'message' => 'There is no time slot yet!');
             $this->response($response, 400);
         }
     }
 }
开发者ID:arindamDemoz,项目名称:qyura,代码行数:31,代码来源:HospitalApi.php

示例3: testServices

 public function testServices()
 {
     $ins = getAuth();
     $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\Auth\IAuth::class, $ins);
     $ins = getView();
     $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\View\IView::class, $ins);
     $ins = getLog();
     $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\Log\ILog::class, $ins);
     //        $ins = getDB();
     //        $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\Database\MedooDB::class, $ins);
     //        $ins = getRedis();
     //        $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\Database\PRedis::class, $ins);
     //        $ins = getDataPool();
     //        $this->assertInstanceOf(\Wwtg99\DataPool\Common\IDataPool::class, $ins);
     $ins = getCache();
     $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\Storage\Cache::class, $ins);
     $ins = getSession();
     $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\Storage\SessionUtil::class, $ins);
     $ins = getCookie();
     $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\Storage\CookieUtil::class, $ins);
     $ins = getOValue();
     $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\Storage\OldValue::class, $ins);
     $ins = getAssets();
     $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\View\AssetsManager::class, $ins);
     $ins = getMailer();
     $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\Utils\Mail::class, $ins);
     $ins = Flight::Express();
     $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\Utils\Express::class, $ins);
     $ins = getPlugin('php');
     $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\Plugin\IPlugin::class, $ins);
 }
开发者ID:wwtg99,项目名称:flight2wwu,代码行数:31,代码来源:ComponentTester.php

示例4: actionIndex

 public function actionIndex()
 {
     if (!getSession('username')) {
         return $this->redirect('index.php?r=login');
     }
     return $this->render('index');
 }
开发者ID:keltstr,项目名称:forum-1,代码行数:7,代码来源:IndexController.php

示例5: MyMethod

 public static function MyMethod()
 {
     $counter = (int) getSession()->get('counter');
     $counter++;
     getSession()->set('counter', $counter);
     echo '<h1>You have clicked ' . getSession()->get('counter') . ' times <a href="">Reload</a></h1>';
 }
开发者ID:Jpsstack,项目名称:epiphany,代码行数:7,代码来源:index.php

示例6: diagnosticTimeSlot_post

 function diagnosticTimeSlot_post()
 {
     $this->bf_form_validation->set_rules('diagnosticId', 'diagnosticId', 'xss_clean|numeric|required|trim');
     if ($this->bf_form_validation->run($this) == FALSE) {
         $response = array('status' => FALSE, 'message' => $this->validation_post_warning());
         $this->response($response, 400);
     } else {
         $centerTimeSlot = $this->input->post('diagnosticId');
         $options = array('table' => 'qyura_diagnosticCenterTimeSlot', 'where' => array('qyura_diagnosticCenterTimeSlot.diagnosticCenterTimeSlot_deleted' => 0, 'qyura_diagnosticCenterTimeSlot.diagnosticCenterTimeSlot_diagnosticId' => $centerTimeSlot));
         $centerTimeSlotArray = $this->common_model->customGet($options);
         $response = array();
         if (isset($centerTimeSlotArray) && $centerTimeSlotArray != NULL) {
             foreach ($centerTimeSlotArray as $diagnosticTime) {
                 $timeSlot = array();
                 $timeSlot[] = $diagnosticTime->diagnosticCenterTimeSlot_id;
                 $timeSlot[] = $diagnosticTime->diagnosticCenterTimeSlot_startTime;
                 $timeSlot[] = $diagnosticTime->diagnosticCenterTimeSlot_endTime;
                 $timeSlot[] = getSession($diagnosticTime->diagnosticCenterTimeSlot_sessionType);
                 $response[] = $timeSlot;
             }
         }
         $columns = array('d_timeSlotid', 'd_startTime', 'd_endTime', 'd_sessionType');
         if (!empty($response) && $response != NULL) {
             $response = array('status' => TRUE, 'message' => 'success', 'data' => $response, 'columns' => $columns);
             $this->response($response, 200);
         } else {
             $response = array('status' => FALSE, 'message' => 'There is no time slot yet!');
             $this->response($response, 400);
         }
     }
 }
开发者ID:arindamDemoz,项目名称:qyura,代码行数:31,代码来源:DiagonsticCenterApi.php

示例7: changeConnectUser

 public function changeConnectUser($connect)
 {
     $return = array("rpta" => false);
     $dataSession = getSession();
     $return['rpta'] = $this->chat->changeConnectUser($dataSession['userid'], $connect);
     echo json_encode($return);
 }
开发者ID:carloz192,项目名称:lifeleg,代码行数:7,代码来源:Chat.php

示例8: create

 /**
  * Create a new action by calling the model.
  *
  * @param string $targetId The ID of the target on which the action will be applied.
  * @param string $targetType The type of object this action is being added to - typically a photo.
  * @return string Standard JSON envelope
  */
 public function create($targetId, $targetType)
 {
     getAuthentication()->requireAuthentication(false);
     getAuthentication()->requireCrumb();
     $params = $_POST;
     $params['targetId'] = $targetId;
     $params['targetType'] = $targetType;
     $params['email'] = getSession()->get('email');
     if (isset($_POST['crumb'])) {
         unset($params['crumb']);
     }
     $id = $this->action->create($params);
     if ($id) {
         $action = $this->action->view($id);
         // get the target element for the action
         $apiResp = $this->api->invoke("/{$this->apiVersion}/{$targetType}/{$targetId}/view.json", EpiRoute::httpGet, array('_GET' => array('returnSizes' => '100x100xCR')));
         $target = $apiResp['result'];
         $this->plugin->setData('action', $action);
         $this->plugin->setData('type', $targetType);
         $this->plugin->setData('target', $target);
         $this->plugin->invoke('onAction');
         $activityParams = array('elementId' => $targetId, 'type' => 'action-create', 'data' => array('targetType' => $targetType, 'target' => $target, 'action' => $action), 'permission' => $target['permission']);
         $this->api->invoke("/{$this->apiVersion}/activity/create.json", EpiRoute::httpPost, array('_POST' => $activityParams));
         return $this->created("Action {$id} created on {$targetType} {$targetId}", $action);
     }
     return $this->error("Error creating action {$id} on {$targetType} {$targetId}", false);
 }
开发者ID:gg1977,项目名称:frontend,代码行数:34,代码来源:ApiActionController.php

示例9: downloadBackupsFromSalesforce

function downloadBackupsFromSalesforce($USERNAME, $PASSWORD)
{
    //get a session ID via the php toolkit API
    $sessionId = getSession($USERNAME, $PASSWORD);
    //build the cookie info out of session ID and org ID
    $sc = 'Cookie=';
    $sc .= 'oid=' . $ORGID . '; ';
    $sc .= 'sid=' . $sessionId . '; ';
    //request the data export page in the frontend UI
    $response = getExportPageRaw($sc);
    //print($response);
    $doc = new DOMDocument();
    $doc->loadHTML($response);
    $tags = $doc->getElementsByTagName('a');
    //get all the href's on the page
    $arrFilenames = array();
    foreach ($tags as $tag) {
        //filter to just the href's for the file downloads
        if (strpos($tag->getAttribute('href'), 'servlet.OrgExport?fileName=') !== false) {
            array_push($arrFilenames, 'https://ssl.salesforce.com' . $tag->getAttribute('href'));
        }
    }
    //print_r($arrFilenames);
    if (count($arrFilenames) > 0) {
        multiRequestBatched($arrFilenames, $sc, 5);
    }
    //locally, we only want to keep 2 weeks worth of files.  So delete anything other than the most recent 2 weeks.
    deleteOldLocalFiles();
}
开发者ID:robertjustjones,项目名称:salesforceDataBackup,代码行数:29,代码来源:getData.php

示例10: og_meta_get

function og_meta_get()
{
    if ($og_meta = getSession()->get('og_meta')) {
        getSession()->set('og_meta', null);
        return $og_meta;
    }
}
开发者ID:restiaka,项目名称:Guinn-App-Gen,代码行数:7,代码来源:app_helper.php

示例11: prepareElementsToExport

		public function prepareElementsToExport() {

			$objectId = getRequest('param0');

			$complete = false;
			$objects = umiObjectsCollection::getInstance();
			$object = $objects->getObject($objectId);
			$formatId = $object->format;
			$format = $objects->getObject($formatId);
			$suffix = $format->sid;
			if($suffix != 'YML') {
				$data = array(
					"attribute:complete" => (int) $complete,
					"attribute:preparation" => (int) !$complete,
				);

				baseModuleAdmin::setData($data);
				return baseModuleAdmin::doData();
			}

			$offset = (int) getSession("export_offset_" . $objectId);
			$blockSize = mainConfiguration::getInstance()->get("modules", "exchange.splitter.limit") ? mainConfiguration::getInstance()->get("modules", "exchange.splitter.limit") : 25;

			if(!file_exists(CURRENT_WORKING_DIR . "/sys-temp/yml/" . $objectId . 'el')) {
				throw new publicException('<a href="' . getLabel("label-errors-no-information") . '" target="blank">' . getLabel("label-errors-no-information") .'</a>');
			}

			$elementsToExport = unserialize(file_get_contents(CURRENT_WORKING_DIR . "/sys-temp/yml/" . $objectId . 'el'));
			$elements = umiHierarchy::getInstance();

			$errors = array();
			for ($i = $offset; $i <= $offset + $blockSize -1; $i++) {
				if(!array_key_exists($i, $elementsToExport)) {
					$complete = true;
					break;
				}
				$element = $elements->getElement($elementsToExport[$i]);
				if($element instanceof umiHierarchyElement) {
					try {
						$element->updateYML();
					} catch (Exception $e) {
						$errors[] = $e->getMessage() . " #{$elementsToExport[$i]}";
					}
				}
			}

			$_SESSION["export_offset_" . $objectId] = $offset + $blockSize;
			if ($complete) {
				unset($_SESSION["export_offset_" . $objectId]);
			}

			$data = array(
				"attribute:complete" => (int) $complete,
				"nodes:log" => $errors
			);

			baseModuleAdmin::setData($data);
			return baseModuleAdmin::doData();
		}
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:59,代码来源:__export.php

示例12: processLogin

 public static function processLogin()
 {
     // Confirm the password is correct
     // * Assume it's all good for the time being * //
     // Redirect to the logged in home page
     getSession()->set(Constants::LOGGED_IN, true);
     getRoute()->redirect('/dashboard');
 }
开发者ID:Jpsstack,项目名称:epiphany,代码行数:8,代码来源:login.class.php

示例13: generateEmptyToken

 public function generateEmptyToken()
 {
     $token = unserialize(getSession('_security_secured_area'));
     if (!$token) {
         return $this->generateNewToken();
     }
     return $token;
 }
开发者ID:dmeikle,项目名称:gossamerCMS-application,代码行数:8,代码来源:AuthenticationManager.php

示例14: groups

 public function groups()
 {
     $groupsResp = $this->api->invoke('/groups/list.json');
     $groups = $groupsResp['result'];
     $navigation = $this->getNavigation('groups');
     $bodyTemplate = sprintf('%s/manage-groups.php', $this->config->paths->templates);
     $body = $this->template->get($bodyTemplate, array('groups' => $groups, 'navigation' => $navigation, 'crumb' => getSession()->get('crumb')));
     $this->theme->display('template.php', array('body' => $body, 'page' => 'manage-groups'));
 }
开发者ID:nicolargo,项目名称:frontend,代码行数:9,代码来源:ManageController.php

示例15: login

 /**
  * Log a user in via BrowserID
  *
  * @return string Standard JSON envelope
  */
 public function login($provider = null)
 {
     $wasUserLoggedIn = $this->user->login($provider, $_POST);
     if ($wasUserLoggedIn) {
         return $this->success('User was logged in successfully', array('email' => getSession()->get('email')));
     } else {
         return $this->forbidden('User was not able to be logged in', false);
     }
 }
开发者ID:gg1977,项目名称:frontend,代码行数:14,代码来源:ApiUserController.php


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