• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP SS_Log类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: placeOrder

 public function placeOrder(SS_HTTPRequest $request)
 {
     $eventbrite_event_header = $request->getHeader('X-Eventbrite-Event');
     if (!$eventbrite_event_header) {
         return $this->httpError(403);
     }
     if ($eventbrite_event_header !== 'order.placed') {
         return $this->httpError(403);
     }
     if (!$this->isJson()) {
         return $this->httpError(403);
     }
     $json_request = $this->getJsonRequest();
     if (!isset($json_request['config']) || !isset($json_request['api_url'])) {
         return $this->httpError(403);
     }
     $config = $json_request['config'];
     if (!isset($config['action']) || $config['action'] !== 'order.placed') {
         return $this->httpError(403);
     }
     $current_local_url = Controller::join_links(Director::absoluteBaseURL(), $request->getURL());
     if (!isset($config['endpoint_url']) || $config['endpoint_url'] !== $current_local_url) {
         return $this->httpError(403);
     }
     try {
         $this->manager->registerEvent('ORDER_PLACED', $json_request['api_url']);
     } catch (Exception $ex) {
         SS_Log::log($ex->getMessage(), SS_Log::ERR);
         return $this->httpError(500);
     }
     return true;
 }
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:32,代码来源:EventbriteOrderPlacedEndpoint.php


示例2: InstaTagMedia

 public function InstaTagMedia($tag = false, $num = false, $shuffle = true)
 {
     $instagram = new Instagram(array('apiKey' => $this->InstagramApiKey, 'apiSecret' => $this->InstagramApiSecret, 'apiCallback' => $this->InstagramApiCallback));
     $media = false;
     $output = false;
     $out = array();
     if (!$tag) {
         $tag = $this->InstagramSearchTerm;
     }
     if (!$num) {
         $num = $this->InstagramItemsCount;
     }
     try {
         $media = $instagram->getTagMedia($tag, 50);
     } catch (Exception $e) {
         SS_Log::log(new Exception(print_r($e, true)), SS_Log::ERR);
     }
     if (is_object($media) && isset($media->data)) {
         foreach ($media->data as $data) {
             if (is_object($data)) {
                 $item = array('caption' => $data->caption ? $data->caption->text : "", 'thumb' => $data->images->thumbnail->url, 'image' => $data->images->standard_resolution->url, 'username' => $data->user->username);
                 array_push($out, $item);
             }
         }
         if ($shuffle) {
             shuffle($out);
         }
         $output = ArrayList::create($out);
         $output = $output->limit($num);
     }
     return $output;
 }
开发者ID:jelicanin,项目名称:silverstripe-instagram-page,代码行数:32,代码来源:InstagramPage.php


示例3: stageChildren

 public function stageChildren($showAll = false)
 {
     $children = new ArrayList();
     $repo = $this->source->getRemoteRepository();
     try {
         if ($repo->isConnected()) {
             $ssId = $this->getSS_ID();
             if (!$ssId) {
                 $ssId = '0';
             }
             $kids = $repo->getChildren(array('ClassName' => ClassInfo::baseDataClass($this->getType()), 'ParentID' => $this->getSS_ID()));
             if (!$kids) {
                 throw new Exception("No kids and null object returned for children of " . $this->getSS_ID());
             }
             // Even though it returns actual dataobjects, we need to wrap them for sanity and safety's sake
             foreach ($kids as $childItem) {
                 $item = $this->source->getObject($childItem);
                 $children->push($item);
             }
         }
     } catch (Exception $fre) {
         SS_Log::log($fre, SS_Log::WARN);
         return $children;
     }
     return $children;
 }
开发者ID:helpfulrobot,项目名称:silverstripe-australia-silverstripe-connector,代码行数:26,代码来源:SilverStripeContentItem.php


示例4: send

 /** Send the email out to the Recipient */
 public function send($newsletter = null, $recipient = null)
 {
     // fetch from database again to make sure the sent flag is not set yet
     if (!$this->ID || self::get()->byID($this->ID)->Status != 'Sent') {
         if (empty($newsletter)) {
             $newsletter = $this->Newsletter();
         }
         if (empty($recipient)) {
             $recipient = $this->Recipient();
         }
         //check recipient not blacklisted and verified
         if ($recipient && empty($recipient->Blacklisted) && !empty($recipient->Verified)) {
             $email = new NewsLetterEmail($newsletter, $recipient);
             if (!empty($newsletter->ReplyTo)) {
                 $email->addCustomHeader('Reply-To', $newsletter->ReplyTo);
             }
             $success = $email->send();
             if ($success) {
                 $this->Status = 'Sent';
                 $recipient->ReceivedCount = $recipient->ReceivedCount + 1;
             } else {
                 $this->Status = 'Failed';
                 $recipient->BouncedCount = $recipient->BouncedCount + 1;
             }
             $recipient->write();
         } else {
             $this->Status = 'BlackListed';
         }
         $this->write();
     } else {
         SS_Log::log(new Exception("prevented sending of SendRecipientQueue #{$this->ID} because it has already been sent"), SS_Log::ERR);
     }
 }
开发者ID:Zauberfisch,项目名称:silverstripe-newsletter,代码行数:34,代码来源:SendRecipientQueue.php


示例5: process

 public function process()
 {
     $post = $this->getObject();
     if ($post) {
         $author = $post->Owner();
         $balance = $author->Balance;
         if (self::$api_key && $post->Content != self::SPAM_CONTENT) {
             require_once Director::baseFolder() . '/microblog/thirdparty/defensio/Defensio.php';
             $defensio = new Defensio(self::$api_key);
             $document = array('type' => 'comment', 'content' => $post->Content, 'platform' => 'silverstripe_microblog', 'client' => 'MicroBlog Defensio-PHP | 0.1 | Marcus Nyeholt | [email protected]', 'async' => 'false');
             try {
                 $result = $defensio->postDocument($document);
                 if ($result && isset($result[1])) {
                     if ($result[1]->allow == 'false') {
                         $post->Content = self::SPAM_CONTENT;
                         $post->Down += self::SPAM_DOWN;
                         $post->write();
                         $author->Down += self::SPAM_DOWN;
                         $author->write();
                     }
                 }
             } catch (Exception $e) {
                 SS_Log::log($e, SS_Log::WARN);
             }
         }
         if ($post->Content != self::SPAM_CONTENT) {
             $post->analyseContent();
             $post->write();
         }
     }
     $this->isComplete = true;
 }
开发者ID:helpfulrobot,项目名称:silverstripe-microblog,代码行数:32,代码来源:ProcessPostJob.php


示例6: getLocationsByDay

 public function getLocationsByDay(SS_HTTPRequest $request)
 {
     try {
         $query_string = $request->getVars();
         $summit_id = intval($request->param('SUMMIT_ID'));
         $day = strtolower(Convert::raw2sql($query_string['day']));
         $summit = $this->summit_repository->getById($summit_id);
         if (is_null($summit)) {
             throw new NotFoundEntityException('Summit', sprintf(' id %s', $summit_id));
         }
         if (!$summit->isDayBelongs($day)) {
             throw new EntityValidationException(sprintf('day %s does not belongs to summit id %s', $day, $summit_id));
         }
         $response = array('day' => $day, 'summit_id' => intval($summit_id), 'locations' => array());
         foreach ($summit->getTopVenues() as $venue) {
             $class_name = $venue->ClassName;
             if ($class_name != 'SummitVenue' && $class_name != 'SummitExternalLocation' && $class_name != 'SummitHotel') {
                 continue;
             }
             $count = $summit->getPublishedEventsCountByDateLocation($day, $venue);
             array_push($response['locations'], array('id' => intval($venue->ID), 'events_count' => intval($count)));
             if ($class_name == 'SummitVenue') {
                 foreach ($venue->Rooms() as $room) {
                     $count = $summit->getPublishedEventsCountByDateLocation($day, $room);
                     array_push($response['locations'], array('id' => intval($room->ID), 'events_count' => intval($count)));
                 }
             }
         }
         return $this->ok($response);
     } catch (Exception $ex) {
         SS_Log::log($ex->getMessage(), SS_Log::ERR);
         return $this->serverError();
     }
 }
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:34,代码来源:SummitAppLocationsApi.php


示例7: regenerateToken

 /**
  *	Attempt to regenerate the current security token.
  */
 public function regenerateToken()
 {
     // Restrict this functionality to administrators.
     $user = Member::currentUserID();
     if (Permission::checkMember($user, 'ADMIN')) {
         // Attempt to create a random hash.
         $regeneration = $this->service->generateHash();
         if ($regeneration) {
             // Instantiate the new security token.
             $token = APIwesomeToken::create();
             $token->Hash = $regeneration['hash'];
             $token->AdministratorID = $user;
             $token->write();
             // Temporarily use the session to display the new security token key.
             Session::set('APIwesomeToken', "{$regeneration['key']}:{$regeneration['salt']}");
         } else {
             // Log the failed security token regeneration.
             SS_Log::log('APIwesome security token regeneration failed.', SS_Log::ERR);
             Session::set('APIwesomeToken', -1);
         }
         // Determine where the request came from.
         $from = $this->getRequest()->getVar('from');
         $redirect = $from ? $from : 'admin/json-xml/';
         return $this->redirect($redirect);
     } else {
         return $this->httpError(404);
     }
 }
开发者ID:helpfulrobot,项目名称:nglasl-silverstripe-apiwesome,代码行数:31,代码来源:APIwesome.php


示例8: sendToUser

 /**
  * Send a notification directly to a single user
  *
  * @param SystemNotification $notification
  * @param string $email
  * @param array $data
  */
 public function sendToUser($notification, $context, $user, $data)
 {
     $subject = $notification->format($notification->Title, $context, $user, $data);
     if (Config::inst()->get('SystemNotification', 'html_notifications')) {
         $message = $notification->format($notification->NotificationContent(), $context, $user, $data);
     } else {
         $message = $notification->format(nl2br($notification->NotificationContent()), $context, $user, $data);
     }
     if ($template = $notification->getTemplate()) {
         $templateData = $notification->getTemplateData($context, $user, $data);
         $templateData->setField('Body', $message);
         try {
             $body = $templateData->renderWith($template);
         } catch (Exception $e) {
             $body = $message;
         }
     } else {
         $body = $message;
     }
     $from = $this->config()->get('send_notifications_from');
     $to = $user->Email;
     if (!$to && method_exists($user, 'getEmailAddress')) {
         $to = $user->getEmailAddress();
     }
     // log
     $message = "Sending {$subject} to {$to}";
     SS_Log::log($message, SS_Log::NOTICE);
     // send
     $email = new Email($from, $to, $subject);
     $email->setBody($body);
     $this->extend('onBeforeSendToUser', $email);
     $email->send();
 }
开发者ID:helpfulrobot,项目名称:sheadawson-silverstripe-notifications,代码行数:40,代码来源:EmailNotificationSender.php


示例9: StartSurvey

 function StartSurvey($data, $form)
 {
     try {
         $data = SQLDataCleaner::clean($data);
         $data['MembershipType'] = 'community';
         Session::set("FormInfo.{$form->FormName()}.data", $data);
         $profile_page = EditProfilePage::get()->first();
         $member = $this->member_manager->registerMobile($data, new MemberRegistrationSenderService());
         //Get profile page
         if (!is_null($profile_page)) {
             //Redirect to profile page with success message
             Session::clear("FormInfo.{$form->FormName()}.data");
             $request = Controller::curr()->getRequest();
             $back_url = $request->postVar('BackURL');
             $link = $profile_page->Link('?success=1');
             if (!empty($back_url)) {
                 $link .= "&BackURL=" . $back_url;
             }
             return OpenStackIdCommon::loginMember($member, $link);
         }
     } catch (EntityValidationException $ex1) {
         Form::messageForForm($form->FormName(), $ex1->getMessage(), 'bad');
         //Return back to form
         SS_Log::log($ex1->getMessage(), SS_Log::WARN);
         return Controller::curr()->redirectBack();
     } catch (Exception $ex) {
         Form::messageForForm($form->FormName(), "There was an error with your request, please contact your admin.", 'bad');
         //Return back to form
         SS_Log::log($ex->getMessage(), SS_Log::ERR);
         return Controller::curr()->redirectBack();
     }
 }
开发者ID:hogepodge,项目名称:openstack-org,代码行数:32,代码来源:SurveyRegistrationForm.php


示例10: addressFromIP

 protected function addressFromIP($ip)
 {
     $geocoder = AddressGeocoding::get_geocoder();
     $geodata = array();
     try {
         if ($ip) {
             $geodata = $geocoder->geocode($ip)->toArray();
         }
     } catch (Exception $e) {
         SS_Log::log($e, SS_Log::ERR);
     }
     $geodata = array_filter($geodata);
     $datamap = array('Country' => 'countryCode', 'County' => 'county', 'State' => 'region', 'PostalCode' => 'zipcode', 'Latitude' => 'latitude', 'Longitude' => 'longitude');
     $mappeddata = array();
     foreach ($datamap as $addressfield => $geofield) {
         if (is_array($geofield)) {
             if ($data = implode(" ", array_intersect_key($geodata, array_combine($geofield, $geofield)))) {
                 $mappeddata[$addressfield] = $data;
             }
         } elseif (isset($geodata[$geofield])) {
             $mappeddata[$addressfield] = $geodata[$geofield];
         }
     }
     return $mappeddata;
 }
开发者ID:burnbright,项目名称:silverstripe-shop-geocoding,代码行数:25,代码来源:GeocodedUserInfo.php


示例11: storeThemeFile

 /**
  * Store the contents of a folder on a CDN. 
  * 
  * If processReferences is set, relative URL references are attempted to be 
  * detected and stored remotely as well, with the file to be stored rewritten 
  * to refer to the CDN value. This really is only useful for CSS 
  *
  * @param string $folder
  * @param boolean $processReferences 
  */
 public function storeThemeFile($toCdn, $file, $forceUpdate = false, $processReferences = false)
 {
     $mtime = @filemtime($file);
     $relativeName = self::CDN_THEME_PREFIX . '/' . $mtime . '/' . trim(str_replace(Director::baseFolder(), '', $file), '/');
     if (!$forceUpdate) {
         // see if the file already exists, if not we do NOT do an update
         $reader = $this->contentService->findReaderFor($toCdn, $relativeName);
         if ($reader && $reader->exists()) {
             return $reader->getURL();
         }
     }
     $clear = false;
     if ($processReferences) {
         $clear = true;
         $file = $this->processFileReferences($toCdn, $file, $forceUpdate);
     }
     // otherwise, lets get a content writer
     $writer = $this->contentService->getWriter($toCdn);
     try {
         $writer->write($file, $relativeName);
     } catch (Exception $e) {
         SS_Log::log($e, SS_Log::WARN);
     }
     if ($clear && strpos($file, '.cdn') > 0) {
         @unlink($file);
     }
     $id = $writer->getContentId();
     return $writer->getReader()->getURL();
 }
开发者ID:stephenmcm,项目名称:silverstripe-cdncontent,代码行数:39,代码来源:ContentDeliveryService.php


示例12: run

 /**
  * @return void
  */
 public function run()
 {
     try {
         $init_time = time();
         $processed_events = 0;
         $events = array();
         $current_summit = Summit::get_active();
         if ($current_summit) {
             $events = $current_summit->getSchedule();
         }
         foreach ($events as $event) {
             $processed_events++;
             $rate_sum = 0;
             $rate_count = 0;
             foreach ($event->Feedback as $feedback) {
                 $rate_count++;
                 $rate_sum = $rate_sum + $feedback->Rate;
             }
             $rate_avg = $rate_count > 0 ? $rate_sum / $rate_count : 0;
             try {
                 $event->setAvgRate(round($rate_avg, 2));
                 $event->write(true);
             } catch (Exception $ex) {
                 SS_Log::log($ex, SS_Log::ERR);
                 echo $ex->getMessage();
             }
         }
         $finish_time = time() - $init_time;
         echo 'processed events ' . $processed_events . ' - time elapsed : ' . $finish_time . ' seconds.';
     } catch (Exception $ex) {
         SS_Log::log($ex->getMessage(), SS_Log::ERR);
     }
 }
开发者ID:Thingee,项目名称:openstack-org,代码行数:36,代码来源:SummitEventSetAvgRate.php


示例13: run

 function run()
 {
     try {
         $election_input_path = Director::baseFolder() . '/' . ELECTION_VOTERS_INGEST_PATH;
         $files = scandir($election_input_path);
         $manager = new ElectionManager(new SapphireElectionRepository(), new SapphireFoundationMemberRepository(), new SapphireVoteRepository(), new SapphireVoterFileRepository(), new VoteFactory(), new VoterFileFactory(), new ElectionFactory(), SapphireTransactionManager::getInstance());
         foreach ($files as $file_name) {
             if ($this->isCSV($file_name) && (list($election_id, $open_date, $close_date) = $this->isValidElectionFileName($file_name))) {
                 try {
                     echo printf('processing file %s' . PHP_EOL, $file_name);
                     list($count, $not_processed) = $manager->ingestVotersForElection($election_input_path . '/' . $file_name, $election_id, $open_date, $close_date);
                     echo printf('file %s - processed %d rows - not processed %d rows' . PHP_EOL, $file_name, $count, count($not_processed));
                     if (count($not_processed) > 0) {
                         echo 'not processed details ... ' . PHP_EOL;
                         echo var_dump($not_processed) . PHP_EOL;
                     }
                     echo printf('deleting file %s ...' . PHP_EOL, $file_name);
                     unlink($election_input_path . '/' . $file_name);
                 } catch (Exception $ex) {
                     SS_Log::log($ex, SS_Log::ERR);
                     echo $ex->getMessage();
                 }
             }
         }
         return 'OK';
     } catch (Exception $ex) {
         SS_Log::log($ex, SS_Log::ERR);
         echo $ex->getMessage();
     }
 }
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:30,代码来源:VotersDataIngestionTask.php


示例14: run

 /**
  * Implement this method in the task subclass to
  * execute via the TaskRunner
  */
 public function run($request)
 {
     if (!($adminEmail = $this->config()->get('administrator_email'))) {
         $contenders = $this->extend('feedMeAdminEmail') ?: [];
         $adminEmail = reset($contenders);
     }
     if ($adminEmail) {
         SS_Log::add_writer(new SS_LogEmailWriter($adminEmail, SS_Log::INFO));
     }
     // anything like a warning or above
     SS_Log::add_writer(new SS_LogEmailWriter(Security::findAnAdministrator()->Email), SS_Log::WARN);
     $excludedFeedClasses = $this->config()->get('excluded_feed_class_names');
     // for each implementor of the FeedMeFeedInterface check if it's not excluded then for each
     // instance of that model call feedMeImport on it.
     $implementors = ClassInfo::implementorsOf('FeedMeFeedModelInterface');
     foreach ($implementors as $className) {
         // chance to disable a feed by setting config.excluded_feed_class_names
         if (!in_array($className, $excludedFeedClasses)) {
             /** @var FeedMeFeedModelExtension $feedModel */
             foreach ($className::get() as $feedModel) {
                 $feedModel->feedMeImport();
             }
         }
     }
 }
开发者ID:CrackerjackDigital,项目名称:silverstripe-feedme,代码行数:29,代码来源:FeedSyncTask.php


示例15: run

 /**
  * @return void
  */
 public function run()
 {
     try {
         $batch_size = 100;
         $init_time = time();
         $summit = null;
         if (isset($_GET['batch_size'])) {
             $batch_size = intval(trim(Convert::raw2sql($_GET['batch_size'])));
             echo sprintf('batch_size set to %s', $batch_size) . PHP_EOL;
         }
         if (isset($_GET['summit_id'])) {
             $summit = Summit::get()->byID(intval($_GET['summit_id']));
         }
         if (is_null($summit)) {
             throw new Exception('summit_id is not valid!');
         }
         $manager = Injector::inst()->get('SpeakerSecondBreakoutAnnouncementSenderManager');
         if (!$manager instanceof ISpeakerSecondBreakoutAnnouncementSenderManager) {
             return;
         }
         $processed = $manager->send($summit, $batch_size);
         $finish_time = time() - $init_time;
         echo 'processed records ' . $processed . ' - time elapsed : ' . $finish_time . ' seconds.';
     } catch (Exception $ex) {
         SS_Log::log($ex->getMessage(), SS_Log::ERR);
     }
 }
开发者ID:hogepodge,项目名称:openstack-org,代码行数:30,代码来源:SpeakerSecondBreakoutEmailSenderTask.php


示例16: sendToSocialMedia

 /**
  *
  * @param array $data
  * @param array $services
  */
 public function sendToSocialMedia(array $data, array $services = array('facebook', 'twitter'))
 {
     // init output
     $ids = array('facebook' => null, 'twitter' => null);
     // Facebook
     if (in_array('facebook', $services) && $this->confirmFacebookAccess()) {
         $facebook = new Facebook(array('appId' => static::$conf->FacebookAppId, 'secret' => static::$conf->FacebookAppSecret));
         $facebook->setAccessToken(static::$conf->FacebookPageAccessToken);
         try {
             $post_id = $facebook->api("/" . static::$conf->FacebookPageId . "/feed", "post", $data);
             $ids['facebook'] = $post_id['id'];
         } catch (FacebookApiException $e) {
             SS_Log::log('Error ' . $e->getCode() . ' : ' . $e->getFile() . ' Line ' . $e->getLine() . ' : ' . $e->getMessage() . "\n" . 'BackTrace: ' . "\n" . $e->getTraceAsString(), SS_Log::ERR);
         }
     }
     // Twitter
     if (in_array('twitter', $services) && $this->confirmTwitterAccess()) {
         $connection = new tmhOAuth(array('consumer_key' => static::$conf->TwitterConsumerKey, 'consumer_secret' => static::$conf->TwitterConsumerSecret, 'user_token' => static::$conf->TwitterOAuthToken, 'user_secret' => static::$conf->TwitterOAuthSecret));
         $tweet = $data['name'] . ": " . $data['link'];
         $code = $connection->request('POST', $connection->url('1.1/statuses/update'), array('status' => $tweet));
         if ($code == 200) {
             $data = json_decode($connection->response['response']);
             $ids['twitter'] = $data->id_str;
         }
     }
     return $ids;
 }
开发者ID:helpfulrobot,项目名称:azt3k-abc-silverstripe-social,代码行数:32,代码来源:PostToSocialMedia.php


示例17: transform

 public function transform($item, $parentObject, $duplicateStrategy)
 {
     $newFile = $this->getTypeForFile($item->Name);
     $folderPath = $parentObject->getRelativePath();
     $parentId = $parentObject ? $parentObject->ID : 0;
     $filter = 'ParentID = \'' . Convert::raw2sql($parentId) . '\' and Title = \'' . Convert::raw2sql($item->Name) . '\'';
     $existing = DataObject::get_one('File', $filter);
     if ($existing && $duplicateStrategy == ExternalContentTransformer::DS_SKIP) {
         // just return the existing children
         return new TransformResult($existing, null);
     } else {
         if ($existing && $duplicateStrategy == ExternalContentTransformer::DS_OVERWRITE) {
             $newFile = $existing;
         }
     }
     //
     $newFile->Name = $item->Name;
     $newFile->Title = $item->Name;
     $newFile->MenuTitle = $item->Name;
     //
     $size = filesize($item->FilePath);
     $details = array('size' => $size, 'name' => $item->Name, 'tmp_name' => $item->FilePath);
     $upload = new FileLoader();
     $folderPath = trim(substr($folderPath, strpos($folderPath, '/')), '/');
     try {
         $upload->loadIntoFile($details, $newFile, $folderPath);
     } catch (ValidationException $ve) {
         // ignore for now, there should really be a proper error reporting mechanism though...
         SS_Log::log("File import failed: " . $ve->getMessage(), SS_Log::WARN);
     }
     return new TransformResult($newFile, null);
 }
开发者ID:nyeholt,项目名称:silverstripe-filesystem-connector,代码行数:32,代码来源:FileSystemFileImporter.php


示例18: confirm

 public function confirm()
 {
     parent::init();
     try {
         $token = Session::get('SummitConfirmSpeakerPage.Token');
         if (isset($_REQUEST['t'])) {
             $token = base64_decode($_REQUEST['t']);
             Session::set('SummitConfirmSpeakerPage.Token', $token);
             return $this->redirect($this->Link('confirm'));
         }
         if (empty($token)) {
             throw new InvalidArgumentException('missing token!');
         }
         $request = PresentationSpeakerSummitAssistanceConfirmationRequest::get()->filter('ConfirmationHash', PresentationSpeakerSummitAssistanceConfirmationRequest::HashConfirmationToken($token))->first();
         if (is_null($request)) {
             throw new NotFoundEntityException('PresentationSpeakerSummitAssistanceConfirmationRequest', '');
         }
         if (!$request->alreadyConfirmed()) {
             $request->confirm($token);
             $request->write();
         }
         $data['Speaker'] = $request->Speaker();
         $data['Summit'] = $request->Summit();
         Session::set('Current.PresentationSpeakerSummitAssistanceConfirmationRequest', $request);
         return $this->customise($data)->renderWith(array('SummitConfirmSpeakerPage', 'SummitPage'), $this->parent);
     } catch (Exception $ex) {
         SS_Log::log($ex->getMessage(), SS_Log::WARN);
         return $this->httpError(404, 'Sorry, this speaker confirmation token does not seem to be correct.');
     }
 }
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:30,代码来源:SummitConfirmSpeakerPage.php


示例19: init

 public function init()
 {
     parent::init();
     global $databaseConfig;
     SS_Log::log(new Exception(print_r($databaseConfig, true)), SS_Log::NOTICE);
     $this->dbType = $databaseConfig['type'];
     $_REQUEST['showqueries'] = 1;
 }
开发者ID:Cumquat,项目名称:silverstripe-orientdb-poc,代码行数:8,代码来源:PerformanceController.php


示例20: testLogsError

 public function testLogsError()
 {
     $logger = new TestWorkableLogger();
     SS_Log::add_writer($logger);
     $result = Workable::create()->getJobs(['state' => 'fail']);
     $this->assertNotNull($logger->event);
     SS_Log::remove_writer($logger);
 }
开发者ID:silverstripe-labs,项目名称:workable,代码行数:8,代码来源:WorkableTest.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP ST类代码示例发布时间:2022-05-23
下一篇:
PHP SS_List类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap