本文整理汇总了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;
}
}
示例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');
}
}
示例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;
}
}
示例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.');
}
}
示例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;
}
示例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;
}