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


PHP CakeLog::write方法代码示例

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


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

示例1: onProductBought

 public function onProductBought($event)
 {
     $this->Product->id = $event->data['product']['id'];
     $this->Product->recursive = 2;
     $product = $this->Product->read();
     if ($product[$this->Product->WebhostingProduct->alias]['id'] === null) {
         return;
     }
     $this->Product->WebhostingProduct->HostGroup->id = $product['HostGroup']['id'];
     $this->Product->WebhostingProduct->HostGroup->recursive = 2;
     $hostGroup = $this->Product->WebhostingProduct->HostGroup->read();
     $WebhostingProvider = BasicWebhostingProvider::get($hostGroup['Host'][0]['Provider']['class']);
     $webhostingPackage = $this->WebhostingPackage->createFromWebhostingProduct($product['WebhostingProduct'], $event->data['customer']['id'], $hostGroup['Host'][0]['id']);
     $webhostingDetails = $WebhostingProvider->createPackage($webhostingPackage['WebhostingPackage']['id']);
     if ($webhostingDetails === false) {
         CakeLog::write(LOG_ERROR, __d('pltfrm', 'Webhosting provider %1$s could not create webhosting package with id %2$d owned by %3$s', $hostGroup['Host'][0]['Provider']['class'], $webhostingPackage['WebhostingPackage']['id'], $webhostingPackage['Customer']['name']), array('webhosting', 'pltfrm'));
         return false;
     }
     $eventData = array();
     $eventData['webhosting']['id'] = $webhostingPackage['WebhostingPackage']['id'];
     $eventData['details'] = $webhostingDetails;
     $eventData['metadata'] = array();
     $webhostingCreatedEvent = new CakeEvent('Webhosting.created', $this, $eventData);
     CakeEventManager::instance()->dispatch($webhostingCreatedEvent);
     CakeLog::write(LOG_INFO, __d('pltfrm', 'Webhosting provider %1$s created webhosting package with id %2$d', $hostGroup['Host'][0]['Provider']['class'], $webhostingPackage['WebhostingPackage']['id']), array('webhosting', 'pltfrm'));
     if (isset($event->data['order'])) {
         $this->OrderProduct->changeStatus('delivered', $event->data['order']['product_id']);
     }
     return true;
 }
开发者ID:cvo-technologies,项目名称:pltfrm,代码行数:30,代码来源:WebhostingHandler.php

示例2: after_add

 /**
  * after_countup
  *
  * @param mixed $event
  */
 public function after_add($event)
 {
     CakeLog::write('info', sprintf("Slide added. id=%s key=%s", $event->data['id'], $event->data['key']));
     $this->SimpleQueue = ClassRegistry::init('SQS.SimpleQueue');
     $this->SimpleQueue->send('extract', array('id' => $event->data['id'], 'key' => $event->data['key']));
     return true;
 }
开发者ID:nicefirework,项目名称:open-slideshare,代码行数:12,代码来源:SlideListener.php

示例3: send

 /**
  * Sends out email via Mandrill
  *
  * @return array Return the Mandrill
  */
 public function send(CakeEmail $email)
 {
     $this->_Email = $email;
     $this->_config = $this->_Email->config() + (array) Configure::read('Mandrill');
     if (empty($this->_config['apiKey'])) {
         throw new InternalErrorException('No API key');
     }
     if (empty($this->_config['uri'])) {
         $this->_config['uri'] = static::API_URL;
     }
     $include = ['from', 'to', 'cc', 'bcc', 'replyTo', 'subject'];
     $this->_headers = $this->_Email->getHeaders($include);
     $message = $this->_buildMessage();
     $request = ['header' => ['Accept' => 'application/json', 'Content-Type' => 'application/json']];
     $template = $this->_Email->template();
     if ($template['template'] && !empty($this->_config['useTemplate'])) {
         $messageUri = $this->_config['uri'] . "messages/send-template.json";
     } else {
         $messageUri = $this->_config['uri'] . "messages/send.json";
     }
     // Perform the http connection
     $returnMandrill = $this->_post($messageUri, $message, $request);
     // Parse mandrill results
     $result = json_decode($returnMandrill, true);
     if (!empty($this->_config['log'])) {
         CakeLog::write('mandrill', print_r($result, true));
     }
     $headers = $this->_headersToString($this->_headers);
     return array_merge(['Mandrill' => $result], ['headers' => $headers, 'message' => $message]);
 }
开发者ID:drmonkeyninja,项目名称:cakephp-mailchimp,代码行数:35,代码来源:MandrillTransport.php

示例4: changeStatus

 public function changeStatus(Model $Model, $status, $id = null, $force = false)
 {
     if ($id === null) {
         $id = $Model->getID();
     }
     if ($id === false) {
         return false;
     }
     $force = true;
     $Model->id = $id;
     if (!$Model->exists()) {
         throw new NotFoundException();
     }
     if ($force !== true) {
         $modelData = $Model->read();
         if ($modelData[$Model->alias]['status'] === $status) {
             CakeLog::write(LOG_WARNING, __d('webshop', 'The status of %1$s with id %2$d is already set to %3$s. Not making a change', strtolower(Inflector::humanize(Inflector::underscore($Model->name))), $id, $status), array('webshop'));
             return false;
         }
     } else {
         CakeLog::write(LOG_WARNING, __d('webshop', 'Status change of %1$s with id %2$d is being forced to %3$s', strtolower(Inflector::humanize(Inflector::underscore($Model->name))), $id, $status), array('webshop'));
     }
     $Model->saveField('status', $status);
     CakeLog::write(LOG_INFO, __d('webshop', 'Changed status of %1$s with id %2$d to %3$s', strtolower(Inflector::humanize(Inflector::underscore($Model->name))), $id, $status), array('webshop'));
     $eventData = array();
     $eventData[Inflector::underscore($Model->name)]['id'] = $id;
     $eventData[Inflector::underscore($Model->name)]['status'] = $status;
     $overallEvent = new CakeEvent($Model->name . '.statusChanged', $this, $eventData);
     $specificEvent = new CakeEvent($Model->name . '.statusChangedTo' . Inflector::camelize($status), $this, $eventData);
     CakeEventManager::instance()->dispatch($overallEvent);
     CakeEventManager::instance()->dispatch($specificEvent);
     return true;
 }
开发者ID:cvo-technologies,项目名称:croogo-webshop-plugin,代码行数:33,代码来源:StatusBehavior.php

示例5: convertToMo

 public static function convertToMo($source, $destination)
 {
     Converter::admin_clear_cache();
     $shellCmd = 'msgfmt -cv -o ' . $destination . ' ' . $source . ' 2>&1';
     $result = shell_exec($shellCmd);
     CakeLog::write('debug', 'Translation : ' . $result . 'Path : ' . $destination);
 }
开发者ID:ivanbautsita,项目名称:gestion-escolar-campus-virtuales,代码行数:7,代码来源:Converter.php

示例6: forgotPassword

 public function forgotPassword()
 {
     $this->layout = '';
     CakeLog::write('info', 'In PasswordController,forgotPassword()');
     $email = trim($this->request->data['email']);
     $password = '';
     if (!empty($email)) {
         $this->loadModel('User');
         $userInfo = $this->User->find('first', array('conditions' => array('txt_email' => $email)));
         if ($userInfo) {
             $password = base64_decode($userInfo['User']['txt_pswd']);
         } else {
             $this->Session->write('forgot_pswd_msg', 'Invalid Email Id');
             $this->redirect('/Password/forgot_password');
         }
         $this->Email->smtpOptions = array('port' => '587', 'timeout' => '30', 'host' => 'ideaclicks.in', 'username' => 'innovation@ideaclicks.in', 'password' => 'C204LaValle#', 'client' => 'ideaclicks.in', 'tls' => true);
         $message = "Welcome to IdeaClicks !\n\r" . "Your Password is :" . $password . "\n\rYou can login using this URL : " . "www.ideaclicks.in" . "\n\rHappy innovation !" . "\n\rTeam IdeaClicks.";
         $this->Email->delivery = 'smtp';
         $this->Email->from = 'innovation@ideaclicks.in';
         $this->Email->to = $email;
         $this->Email->subject = 'IdeaClicks : Your Password';
         $this->Email->send($message);
         $this->Session->write('forgot_pswd_msg', 'Email has been Send');
         CakeLog::write('info', 'In PasswordController,Email has been Send');
     }
 }
开发者ID:amolshirude,项目名称:IdeaClicks_PHP,代码行数:26,代码来源:PasswordController.php

示例7: upload

 /**
  * Uploads data specified by the uploadify DOM element.
  *
  * @param array $options Associative array of options.
  */
 function upload($options = array())
 {
     if (!empty($_FILES)) {
         $file_data = isset($_REQUEST["fileDataName"]) ? $_REQUEST["fileDataName"] : "Filedata";
         $temp_file = $_FILES[$file_data]['tmp_name'];
         $target_path = $this->get_target_folder($options);
         if (!file_exists($target_path)) {
             CakeLog::write("debug", "Creating directory: {$target_path}");
             $old = umask(0);
             mkdir($target_path, 0777, true);
             umask($old);
         }
         $filename_prefix = isset($options["filename_prefix"]) ? $options["filename_prefix"] : "";
         $target_file = str_replace('//', '/', $target_path) . "/{$filename_prefix}" . $_FILES[$file_data]['name'];
         // $fileTypes  = str_replace('*.','',$_REQUEST['fileext']);
         // $fileTypes  = str_replace(';','|',$fileTypes);
         // $typesArray = split('\|',$fileTypes);
         // $fileParts  = pathinfo($_FILES[$file_data]['name']);
         // if (in_array($fileParts['extension'],$typesArray)) {
         // Uncomment the following line if you want to make the directory if it doesn't exist
         // mkdir(str_replace('//','/',$target_path), 0755, true);
         $success = move_uploaded_file($temp_file, $target_file);
         return $success ? $target_file : $success;
         //echo str_replace($_SERVER['DOCUMENT_ROOT'],'',$target_file);
         // } else {
         //  echo 'Invalid file type.';
         // }
     }
 }
开发者ID:rtgibbons,项目名称:cuploadify,代码行数:34,代码来源:cuploadify.php

示例8: setup

 public function setup($environment = null)
 {
     if (Configure::read('Environment.setup')) {
         return;
     }
     $current = $environment === null ? 'development' : $environment;
     if (empty($environment)) {
         foreach ($this->environments as $name => $config) {
             if ($this->_cliMatch($name) || $this->_match($config['params'])) {
                 $current = $name;
                 break;
             }
         }
     }
     $config = array_merge($this->environments[$current]['config'], array('Environment.name' => $current));
     foreach ($config as $param => $value) {
         if (isset($this->_configMap[$param])) {
             $param = $this->_configMap[$param];
         }
         Configure::write($param, $value);
     }
     if (is_callable($this->environments[$current]['callable'])) {
         $this->environments[$current]['callable']();
     }
     if (Configure::read('debug') > 0) {
         App::uses('CakeLog', 'Log');
         if (class_exists('CakeLog')) {
             CakeLog::write(LOG_INFO, $current);
             Configure::write('Environment.setup', true);
         }
     }
 }
开发者ID:superstarrajini,项目名称:cakepackages,代码行数:32,代码来源:Environment.php

示例9: log

 /**
  * Overwrite log to write log files in Cake tmp/logs/.
  *
  * @param string $msg
  * @return void
  */
 public function log($msg)
 {
     if (!$this->debug) {
         return;
     }
     CakeLog::write('mandrill', $msg);
 }
开发者ID:drmonkeyninja,项目名称:cakephp-mailchimp,代码行数:13,代码来源:MandrillLib.php

示例10: processSubscription

 public function processSubscription()
 {
     if (!$this->request->is('post') || !isset($this->request->data['bt_signature']) || !isset($this->request->data['bt_payload'])) {
         $this->response->statusCode(404);
         return $this->response;
     }
     $webhookNotification = Braintree_WebhookNotification::parse($this->request->data['bt_signature'], $this->request->data['bt_payload']);
     if (!isset($webhookNotification->subscription)) {
         $this->response->statusCode(404);
         return $this->response;
     }
     CakeLog::write('debug', __d('billing', '%s Braintree webhook for subscription %s: %s', $webhookNotification->timestamp, $webhookNotification->subscription->id, $webhookNotification->kind));
     $braintreeSubscription = $webhookNotification->subscription;
     CakeLog::write('debug', json_encode($webhookNotification->subscription));
     $subscription = $this->BillingSubscription->findByRemoteSubscriptionId($braintreeSubscription->id);
     if (empty($subscription)) {
         $this->response->statusCode(404);
         return $this->response;
     }
     switch ($braintreeSubscription->status) {
         case 'Canceled':
             $result = $this->BillingSubscription->cancel($subscription['BillingSubscription']['id']);
             break;
         default:
             $result = true;
     }
     if ($result) {
         $this->response->statusCode(200);
     } else {
         $this->response->statusCode(500);
     }
     return $this->response;
 }
开发者ID:nilBora,项目名称:konstruktor,代码行数:33,代码来源:BillingCallbackController.php

示例11: throwError

 protected function throwError($mustacheError = '')
 {
     if (Configure::write('debug') > 0) {
         return debug(compact('mustacheError'));
     }
     return CakeLog::write('error', compact('mustacheError'));
 }
开发者ID:JacopKane,项目名称:Cake-Mustache,代码行数:7,代码来源:MustacheHelper.php

示例12: _setLanguage

 private function _setLanguage()
 {
     if ($this->Cookie->read('lang')) {
         CakeLog::write('Language', 'Cookie');
         Configure::write('Config.language', $this->Cookie->read('lang'));
         $this->Session->write('Config.language', $this->Cookie->read('lang'));
     } else {
         if ($this->Session->check('Config.Language')) {
             CakeLog::write('Language', 'Session');
             Configure::write('Config.language', $this->Session->read('Config.Language'));
             $this->Cookie->write('lang', $this->params['language'], false, '20 days');
         } else {
             CakeLog::write('Language', 'Else');
             $this->Session->write('Config.language', Configure::read('Config.Language'));
             $this->Cookie->write('lang', Configure::read('Config.Language'), false, '20 days');
         }
     }
     if (isset($this->params['language'])) {
         CakeLog::write('Language', 'Params set');
         //then update the value in Session and the one in Cookie
         $this->Session->write('Config.language', $this->params['language']);
         $this->Cookie->write('lang', $this->params['language'], false, '20 days');
         Configure::write('Config.language', $this->Cookie->read('lang'));
     } else {
         CakeLog::write('Language', 'Params not set');
     }
 }
开发者ID:mirocosic,项目名称:smartsport-inspinia,代码行数:27,代码来源:AppController.php

示例13: updateSubscribersCount

 public function updateSubscribersCount($data = null)
 {
     $this->set($data);
     $conditions = es('Subscription.feed_id = %s', $this->id);
     $n = $this->Subscription->findCount($conditions);
     CakeLog::write(LOG_INFO, "subscribers: {$n}");
     return $this->saveField('subscribers_count', $n);
 }
开发者ID:kaz0636,项目名称:openflp,代码行数:8,代码来源:feed.php

示例14: before

 public function before($method)
 {
     Configure::write('Database.logSQL', 0);
     $msg = sprintf('(%s::%s)', get_class($this), $method);
     CakeLog::write(LOG_INFO, $msg);
     parent::before($method);
     Configure::write('Database.logSQL', 2);
 }
开发者ID:kaz0636,项目名称:openflp,代码行数:8,代码来源:cake_test_case_ext.php

示例15: testBeforeRender

 /**
  * testBeforeRender
  *
  * @return void
  */
 public function testBeforeRender()
 {
     $controller = new Controller();
     CakeLog::write('error', 'Test');
     $result = $this->panel->beforeRender($controller);
     $this->assertInstanceOf('DebugKitLogListener', $result);
     $this->assertTrue(isset($result->logs));
     $this->assertCount(1, $result->logs['error']);
 }
开发者ID:huanjian,项目名称:mythesis,代码行数:14,代码来源:LogPanelTest.php


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