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


PHP Configure::write方法代码示例

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


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

示例1: admin_index

 function admin_index()
 {
     $this->Ticket->recursive = 0;
     $filters = $this->AlaxosFilter->get_filter();
     $data_ticket = array();
     if (empty($this->params['named']['export_excel'])) {
         $this->set('tickets', $this->paginate($this->Ticket, $filters));
     } else {
         Configure::write('debug', 0);
         $options = array();
         $this->set('export_to_excel', 1);
         $i = 0;
         $tickets = $this->Ticket->find('all', array_merge_recursive($options, array('conditions' => $filters)));
         foreach ($tickets as $ticket) {
             foreach ($ticket as $indx => $module) {
                 foreach ($module as $k => $v) {
                     $arr_fields_in_xls = array();
                     if (!empty($arr_fields_in_xls) && in_array($k, $arr_fields_in_xls[$indx])) {
                         $data_ticket[$i][__($indx, true) . ' ' . __($k, true)] = $module[$k];
                     } else {
                         $data_ticket[$i][__($indx, true) . ' ' . __($k, true)] = $module[$k];
                     }
                 }
             }
             $i++;
         }
         $this->set('tickets', $data_ticket);
     }
 }
开发者ID:sanily2j,项目名称:abc,代码行数:29,代码来源:tickets_controller.php

示例2: login

 function login()
 {
     Configure::write('debug', 0);
     if ($this->Auth->isAuthorized()) {
         $this->redirect('/fams/index');
     }
 }
开发者ID:kind-technologies,项目名称:FAMS,代码行数:7,代码来源:users_controller.php

示例3: admin_index

 function admin_index()
 {
     $this->FrequencyType->recursive = 0;
     $filters = $this->AlaxosFilter->get_filter();
     $data_frequencyType = array();
     if (empty($this->params['named']['export_excel'])) {
         $this->set('frequencyTypes', $this->paginate($this->FrequencyType, $filters));
     } else {
         Configure::write('debug', 0);
         $options = array();
         $this->set('export_to_excel', 1);
         $i = 0;
         $frequencyTypes = $this->FrequencyType->find('all', array_merge_recursive($options, array('conditions' => $filters)));
         foreach ($frequencyTypes as $frequencyType) {
             foreach ($frequencyType as $indx => $module) {
                 foreach ($module as $k => $v) {
                     $arr_fields_in_xls = array();
                     if (!empty($arr_fields_in_xls) && in_array($k, $arr_fields_in_xls[$indx])) {
                         $data_frequencyType[$i][__($indx, true) . ' ' . __($k, true)] = $module[$k];
                     } else {
                         $data_frequencyType[$i][__($indx, true) . ' ' . __($k, true)] = $module[$k];
                     }
                 }
             }
             $i++;
         }
         $this->set('frequencyTypes', $data_frequencyType);
     }
     $frequencies = $this->FrequencyType->Frequency->find('list');
     $this->set(compact('frequencies'));
 }
开发者ID:shashin62,项目名称:abc_audit,代码行数:31,代码来源:frequency_types_controller.php

示例4: beforeFilter

 function beforeFilter()
 {
     // Set some generic Auth stuff, in case Auth is used in the model:
     if (isset($this->Auth)) {
         $this->Auth->userModel = 'Artist';
         $this->Auth->loginAction = array('controller' => 'artists', 'action' => 'login');
         // Set Login system to use email adress as username:
         $this->Auth->fields = array('username' => 'email', 'password' => 'password');
         $this->Auth->loginError = __('Login failed. Please try again.', true);
         $this->Auth->loginRedirect = '/';
         $this->Auth->autoRedirect = true;
         $this->Auth->allow('set_language');
         // enable access control via isAuthorized():
         $this->Auth->authorize = 'controller';
     }
     // Init language stuff:
     App::import('Core', 'L10n');
     $this->L10n = new L10n();
     // Read setting from session:
     $lang = $this->Session->read('lang');
     // Set language:
     if ($lang != '') {
         $this->L10n->get($lang);
         Configure::write('Config.language', $lang);
     } else {
         $this->L10n->get();
     }
 }
开发者ID:pixelistik,项目名称:sbmttr,代码行数:28,代码来源:app_controller.php

示例5: tearDown

/**
 * tearDown method
 *
 * @return void
 */
	public function tearDown() {
		parent::tearDown();
		Configure::write('Cache.disable', $this->_cacheDisable);
		Cache::drop('xcache');
		Cache::drop('xcache_groups');
		Cache::config('default');
	}
开发者ID:hungnt88,项目名称:5stars-1,代码行数:12,代码来源:XcacheEngineTest.php

示例6: download

 /**
  * index method
  *
  * @return void
  */
 public function download()
 {
     $this->set('employees', $this->Employee->find('all', array('fields' => array('id', 'first_name', 'last_name', 'address', 'city', 'home_phone', 'hire_date', 'gender', 'date_of_birth', 'status', 'employment_type', 'designation'))));
     $this->layout = null;
     $this->autoLayout = false;
     Configure::write('debug', '0');
 }
开发者ID:abhinav67,项目名称:prodigy2,代码行数:12,代码来源:EmployeesControllerBackup.php

示例7: tearDown

 public function tearDown()
 {
     parent::tearDown();
     $this->Data->cleanUp();
     ClassRegistry::flush();
     Configure::write('Media', $this->oldConfig);
 }
开发者ID:miznokruge,项目名称:base-cake,代码行数:7,代码来源:BehaviorTestBase.php

示例8: orderCreate

 public function orderCreate($country_id, $presenterId, $userId, $hostmarket_id, $partyId)
 {
     Configure::write("market_id", (int) $country_id);
     if ($country_id == 1) {
         $postal_code = "20350-1000";
     } else {
         if ($country_id == 2) {
             $postal_code = "K1A 0B1";
         } else {
             if ($country_id == 3) {
                 $postal_code = "0872";
             } else {
                 if ($country_id == 4) {
                     $postal_code = "6000";
                 } else {
                     if ($country_id == 5) {
                         $postal_code = "NN8 4TH";
                     } else {
                         if ($country_id == 6) {
                             $postal_code = "15030";
                         } else {
                             echo "I am from else block";
                             exit;
                         }
                     }
                 }
             }
         }
     }
     // debug($postal_code);
     $address = array("first_name" => "testing", "last_name" => "last", "address1" => "Some address 1", "address2" => "Some address 2", "address3" => "Some address 3", "city" => "Awesome city", "state_id" => 20, "postal_code" => $postal_code, "email_address" => "dev@youniqueproducts.com", "country_id" => $country_id);
     $promoterId = 2;
     //$presenterId = 141683; // from presenter , we get market_id for orders
     $items = array(array("sku" => "US-42031-01", "qty" => 1, "options" => array("US-21000-00" => array("skus" => array("US-11001-01" => 1, "US-11001-08" => 1)), "US-22100-00" => array("skus" => array("US-12101-03" => 1, "US-12101-04" => 1)), "US-21400-00" => array("skus" => array("US-11401-07" => 1)), "US-22401-00" => array("skus" => array("US-12401-03" => 1)), "US-22301-00" => array("skus" => array("US-12301-07" => 1)))), array("sku" => "US-1017-00", "qty" => 1, "coupons" => array("1" => array("discount_percentage" => 50, "discount_flat" => Money::fromFloat(0), "name" => "Half Priced Item"))), array("sku" => "US-53021-01", "qty" => 1, "coupons" => array("1" => array("discount_percentage" => 50, "discount_flat" => Money::fromFloat(0), "name" => "Half Priced Item"))));
     $coupons = array();
     $productCredits = Money::fromFloat(675.0);
     //20.00//29.00//29.00//45.00//29.00//90.00//75.00//175.00//58.00
     //$prices = $this->Order->getOrderCosts($address['postal_code'], $items,null, $coupons);
     $prices = $this->Order->getOrderCosts($address['postal_code'], $items, $productCredits, $coupons);
     //$prices = $this->getOrderCosts($address['country_id'], $items,null, $coupons);
     //echo "<pre>";
     //print_r($prices);exit;
     $insert_order = TRUE;
     //    $result = $this->createOrder($promoterId, $presenterId, $userId, $partyId, $items, $address,Order::TYPE_PRODUCT,null, $coupons,FALSE,$insert_order);
     $result = $this->Order->createOrder($promoterId, $presenterId, $userId, $partyId, $items, $address, Order::TYPE_PRODUCT, $productCredits, $coupons, FALSE, TRUE);
     //   debug($result);
     //    $result = $this->Order->createOrder($promoterId, $presenterId, $userId, $partyId, $items, $address,Order::TYPE_PRODUCT,$productCredits, $coupons,FALSE);//$insert_order
     $orderId = $this->Order->id;
     //    $orderId = $this->Order->query("SELECT MAX(id) FROM orders");
     //       debug($this->Order->id);
     //       debug($orderId);
     //  debug($result);
     //   exit;
     $orderPaymentResult = array("success" => false, "payments" => array(array('type' => 'creditcard', 'amount' => $prices['total']['total'], "transaction_id" => "Wohootest", "identifier" => "3123", 'cardholder' => 'Test wohoo', 'billingzip' => '84003', 'cardnum' => '123123123', 'carexp' => '12/2015', 'cardcode' => '962', 'status' => 'failed')));
     $result = $this->Order->finalize($orderPaymentResult);
     //     debug($prices['total']['total']);
     $orderPaymentResult = array("success" => true, "payments" => array(array('type' => 'creditcard', 'transaction_id' => 'Wohootest', 'amount' => $prices['total']['total'], 'cardholder' => 'Test wohoo', 'billingzip' => '84003', 'cardnum' => '123123123', 'carexp' => '12/2015', 'cardcode' => '962', 'status' => 'success', "identifier" => "3123")));
     $result = $this->Order->finalize($orderPaymentResult);
     return $orderId;
 }
开发者ID:kameshwariv,项目名称:testexample,代码行数:60,代码来源:PartyOrderCollectionWith675YcashMexicoTest.php

示例9: kcaptchaReset

 function kcaptchaReset()
 {
     Configure::write('debug', 0);
     $this->autoRender = false;
     $this->kcaptcha->render();
     exit;
 }
开发者ID:kondrat,项目名称:chat,代码行数:7,代码来源:users_controller.php

示例10: selTheme

 function selTheme()
 {
     //ajax preparation
     Configure::write('debug', 0);
     $this->autoLayout = false;
     $this->autoRender = false;
     if ($this->RequestHandler->isAjax()) {
         //our host only
         if (strpos(env('HTTP_REFERER'), trim(env('HTTP_HOST'), '/')) === false) {
             $this->Security->blackHoleCallback = 'gotov';
         }
         $auth = $this->Auth->user('id');
         if ($auth && $this->data['Theme']['id'] != null) {
             $this->data['Theme']['current_theme'] = time();
             if ($this->Theme->save($this->data)) {
                 $contents['stat'] = 1;
                 $allThemeCards = $this->Theme->Card->find('all', array('conditions' => array('Card.theme_id' => $this->data['Theme']['id'], 'Card.user_id' => $auth), 'fields' => array('Card.id', 'Card.word'), 'order' => array('Card.id DESC'), 'contain' => false));
                 $contents['cards'] = $allThemeCards;
             } else {
                 $contents['stat'] = 0;
             }
         } else {
             $contents['stat'] = 0;
         }
         $contents = json_encode($contents);
         $this->header('Content-Type: application/json');
         return $contents;
     } else {
         $this->Security->blackHoleCallback = 'gotov';
     }
 }
开发者ID:kondrat,项目名称:ez.go,代码行数:31,代码来源:themes_controller.php

示例11: testExceptions

 /**
  * Tests the exception handling.
  *
  */
 public function testExceptions()
 {
     Configure::write('debug', 2);
     // Create some requests.
     $rawPostData = json_encode(array(array('action' => 'ThisControllerDoesNotExist', 'method' => 'index', 'tid' => 1, 'type' => 'rpc', 'data' => array()), array('action' => 'ArticlesException', 'method' => 'throwNotFoundExceptionMethod', 'tid' => 2, 'type' => 'rpc', 'data' => array()), array('action' => 'ArticlesException', 'method' => 'throwExceptionMethod', 'tid' => 3, 'type' => 'rpc', 'data' => array())));
     // Create dispatcher and dispatch requests.
     $dispatcher = new BanchaDispatcher();
     $responses = json_decode($dispatcher->dispatch(new BanchaRequestCollection($rawPostData), array('return' => true)));
     // set debug level back to normal
     Configure::write('debug', $this->standardDebugLevel);
     $this->assertEquals(3, count($responses), 'Three requests result in three responses.');
     // controller class not found
     $this->assertEquals('exception', $responses[0]->type);
     $this->assertEquals('MissingControllerException', $responses[0]->exceptionType);
     $this->assertEquals('Controller class ThisControllerDoesNotExistsController could not be found.', $responses[0]->message);
     $this->assertTrue(!empty($responses[0]->where), 'message');
     // application controller method exception catched
     $this->assertEquals('exception', $responses[1]->type);
     $this->assertEquals('NotFoundException', $responses[1]->exceptionType);
     $this->assertEquals('Invalid article', $responses[1]->message);
     // another application level error
     $this->assertEquals('exception', $responses[2]->type);
     $this->assertEquals('Exception', $responses[2]->exceptionType);
     $this->assertEquals('Method specific error message, see bottom of this test', $responses[2]->message);
     $this->assertEquals('In file "' . __FILE__ . '" on line ' . $GLOBALS['EXCEPTION_LINE'] . '.', $responses[2]->where, 'message');
 }
开发者ID:rolandschuetz,项目名称:Bancha,代码行数:30,代码来源:BanchaExceptionsTest.php

示例12: handleException

 /**
  * override core one with the following enhancements/fixes:
  * - 404s log to a different domain
  * - IP, Referer and Browser-Infos are added for better error debugging/tracing
  * 2011-12-21 ms
  */
 public static function handleException(Exception $exception)
 {
     $config = Configure::read('Exception');
     if (!empty($config['log'])) {
         $log = LOG_ERR;
         $message = sprintf("[%s] %s\n%s\n%s", get_class($exception), $exception->getMessage(), $exception->getTraceAsString(), self::traceDetails());
         if (in_array(get_class($exception), array('MissingControllerException', 'MissingActionException', 'PrivateActionException', 'NotFoundException'))) {
             $log = '404';
         }
         CakeLog::write($log, $message);
     }
     $renderer = $config['renderer'];
     if ($renderer !== 'ExceptionRenderer') {
         list($plugin, $renderer) = pluginSplit($renderer, true);
         App::uses($renderer, $plugin . 'Error');
     }
     try {
         $error = new $renderer($exception);
         $error->render();
     } catch (Exception $e) {
         set_error_handler(Configure::read('Error.handler'));
         // Should be using configured ErrorHandler
         Configure::write('Error.trace', false);
         // trace is useless here since it's internal
         $message = sprintf("[%s] %s\n%s\n%s", get_class($e), $e->getMessage(), $e->getTraceAsString(), self::traceDetails());
         trigger_error($message, E_USER_ERROR);
     }
 }
开发者ID:robksawyer,项目名称:grabitdown,代码行数:34,代码来源:MyErrorHandler.php

示例13: listingsadmin

 /**
  * Listings Administration
  */
 function listingsadmin()
 {
     Configure::write('debug', '3');
     $this->set('listings', $this->Listing->findAll());
     $this->render();
     exit;
 }
开发者ID:carriercomm,项目名称:pastebin-5,代码行数:10,代码来源:listings_controller.php

示例14: testProcessVersion

 /**
  * testProcessVersion
  *
  * @return void
  */
 public function testProcessVersion()
 {
     $this->Image->create();
     $result = $this->Image->save(array('foreign_key' => 'test-1', 'model' => 'Test', 'file' => array('name' => 'titus.jpg', 'size' => 332643, 'tmp_name' => CakePlugin::path('FileStorage') . DS . 'Test' . DS . 'Fixture' . DS . 'File' . DS . 'titus.jpg', 'error' => 0)));
     $result = $this->Image->find('first', array('conditions' => array('id' => $this->Image->getLastInsertId())));
     $this->assertTrue(!empty($result) && is_array($result));
     $this->assertTrue(file_exists($this->testPath . $result['ImageStorage']['path']));
     $path = $this->testPath . $result['ImageStorage']['path'];
     $Folder = new Folder($path);
     $folderResult = $Folder->read();
     $this->assertEqual(count($folderResult[1]), 3);
     Configure::write('Media.imageSizes.Test', array('t200' => array('thumbnail' => array('mode' => 'outbound', 'width' => 200, 'height' => 200))));
     ClassRegistry::init('FileStorage.ImageStorage')->generateHashes();
     $Event = new CakeEvent('ImageVersion.createVersion', $this->Image, array('record' => $result, 'storage' => StorageManager::adapter('Local'), 'operations' => array('t200' => array('thumbnail' => array('mode' => 'outbound', 'width' => 200, 'height' => 200)))));
     CakeEventManager::instance()->dispatch($Event);
     $path = $this->testPath . $result['ImageStorage']['path'];
     $Folder = new Folder($path);
     $folderResult = $Folder->read();
     $this->assertEqual(count($folderResult[1]), 4);
     $Event = new CakeEvent('ImageVersion.removeVersion', $this->Image, array('record' => $result, 'storage' => StorageManager::adapter('Local'), 'operations' => array('t200' => array('thumbnail' => array('mode' => 'outbound', 'width' => 200, 'height' => 200)))));
     CakeEventManager::instance()->dispatch($Event);
     $path = $this->testPath . $result['ImageStorage']['path'];
     $Folder = new Folder($path);
     $folderResult = $Folder->read();
     $this->assertEqual(count($folderResult[1]), 3);
 }
开发者ID:arourke,项目名称:cakephp-file-storage,代码行数:31,代码来源:ImageStorageTest.php

示例15: tearDown

/**
 * tearDown method
 *
 * @return void
 */
	public function tearDown() {
		parent::tearDown();
		Configure::write('log', true);
		if ($this->_restoreError) {
			restore_error_handler();
		}
	}
开发者ID:hungnt88,项目名称:5stars-1,代码行数:12,代码来源:DebuggerTest.php


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