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


PHP D::warn方法代码示例

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


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

示例1: checkCookie

	function checkCookie() {
		if($this->_valid === true) {
			return true;
		}
		
		$cookieName = $this->libs->Config->get('Session', 'cookieName');
		if(isset($_COOKIE[$cookieName])) {
			//D::log($_COOKIE[$cookieName], 'Cookie Set');
			$cookie = explode('_', $_COOKIE[$cookieName]);
			$row = f_first($this->libs->Query->select('*')->from($this->libs->Config->get('Session', 'tableName'))->where(array('id' => f_first($cookie)))->results());
			if(!empty($row) && $this->encryptCheckString($row->uid) === f_last($cookie)) {
				if($this->encryptCheckString($this->getCheckString($row->uid)) === $row->checkString) {
					$this->_valid = true;
					$this->_id = $row->id;
					$this->loadData($this->libs->Query->select('*')->from($this->libs->Config->get('Session', 'dataTableName'))->where(array('session' => $this->_id))->results());
					D::log($this->_data, 'cookie is good. heres some data:');
					return true;
				}
			}
		}
		$uid = $this->getUid();
		if(!$this->saveCookie($this->generateCookie($this->getCheckString($uid), $uid)) ) {
			D::warn('Cookie Failed');
			return false;
		} else {
			return true;
		}
	}
开发者ID:noblejay,项目名称:Sweet-Framework,代码行数:28,代码来源:Session.php

示例2: newDb

	public function newDb($name) {
		
		$database = $this->libs->Config->get('databases', $name);
		//Sweetframework::getClass('lib', 'databases/drivers/' . $database['driver'],  );
		//App::includeLibrary('Databases/Drivers/' . $database['driver'] . '.php');
		
		
		
		$this->setCurrentDb($name);
		
		$this->databases[$name] = Sweetframework::loadClass('lib', 'databases/drivers/' . $database['driver'],  $database);     //new $database['driver']($database);
		if(!$this->databases[$name]->connect()) {
			D::warn('failed to connect to the db');
		}
	}
开发者ID:ajcates,项目名称:Sweet-Framework-old,代码行数:15,代码来源:Databases.php

示例3: connect

	function connect($settings=null) {
		//print_r($settings);
		if(isset($settings)) {
			$this->settings = $settings;
		}
	//	D::show($this->settings, 'newDB');
		//connects using our settings
		
/* 	@todo make the @ be able to be turned on and off by debug mode	 */
		$this->connection = @mysql_connect($this->settings['host'], $this->settings['username'], $this->settings['password']);
		if (!$this->connection)	{
			D::warn("Couldn't to the db dude, check the settings man.\nHost: " . $this->settings['host'] . "\nUser: " . $this->settings['username'] . "\nDatabase: " . $this->settings['host']);
			return false;
		} else {
			if(!mysql_select_db($this->settings['databaseName'])) {
				D::warn('Could not select the database: ' . $this->settings['databaseName']);
				return false;
			}
			D::log('DB Connected');
			$this->connected = true;
			return true;
		}
	}
开发者ID:ajcates,项目名称:Sweet-Framework-old,代码行数:23,代码来源:My_SQL.php

示例4: __set

	function __set($var, $value) {
		$this->__update[$var] = $value;
		if(is_scalar($value)) {
			$this->__data = array_map(
				function($row) use($var, $value) {
					$row[$var] = $value;
					return $row;
				},
				$this->__data
			);
			return $value;
		} else {
			D::warn('SweetRows do not currently support non scalar values… yet.');
		}
	}
开发者ID:noblejay,项目名称:Sweet-Framework,代码行数:15,代码来源:SweetModel.php

示例5: go

	public function go($query=null) {
		if(!isset($query)) {
			self::$last = $this->_build();
		} else {
			self::$last = $query;
		}
		$this->reset();
		if(!self::$_driver->query(self::$last)) {
			D::warn('Query Failed: ' . self::$last);
			return false;
		}
		return $this;
	}
开发者ID:noblejay,项目名称:Sweet-Framework,代码行数:13,代码来源:Query.php

示例6: loadFileType

	public static function loadFileType($type, $name) {
		/*  @todo
			- need to use a FileName function here
		*/
		//$loc = self::fileLoc($name);
		foreach(self::$paths[$type] as $path) {
			if(self::loadFile($path, $name. '.php')) {
				return true;
			}
		}
		D::warn('Could not load file with type ' . $type . ' and name ' . $name);
		return false;
	}
开发者ID:ajcates,项目名称:Sweet-Framework-old,代码行数:13,代码来源:SweetFramework.php


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