23 Temmuz 2009 Perşembe

FreeBSD

FreeBSD kardeşimizin konsolunda Türkçe karakter kullanmak için :

http://ipucu.enderunix.org/view.php?lang=tr&id=1324

ipfw ile varsayılan olarak aktif olmayan dummynet gibi arkadaşları eklemek amacıyla derlediğim çekirdek için yararlandığım kaynak:
http://alex.kruijff.org/FreeBSD/Firewall_Setup.html
bu belgeyi takip ederek bende her şey sorunsuz ilerledi.

Ek olarak güzel bir döküman olduğunu düşündüğüm:

http://elibrary.fultus.com/technical/index.jsp?topic=/com.fultus.freebsd/index.html

ports kullanarak php5 desteği için :
http://www.freebsdmadeeasy.com/tutorials/web-server/install-php-5-for-web-hosting.php

FreeBSD

FreeBSD arkadaşımızın elektriği kesilirse yeniden başlattığımızda diskleri kontrol etmesi için aşağıdaki komutu giriyoruz ve sistemi yeniden başlatıyoruz.
bu konu ile ilgili aldığımız hata: enter full path name of shell
yazacağımız komut: fsck -f -y

3 Nisan 2009 Cuma

some methods implemented in php for PorstgreSQL support

function _connect()
{
if ($this->isVerbose()) {
$this->_errorlog("\n*** Inside database->_connect ***");
}

// Connect to PostreSQL server
$this->_db = pg_connect($this->_host,$this->_user,$this->_pass) or die('Cannot connect to DB server');

if ($this->_postgresql_version == 0) {
preg_match ('/^([0-9]+).([0-9]+).([0-9]+)/', $v, $match);
$v = (intval ($match[1]) * 10000) + (intval ($match[2]) * 100)
+ intval ($match[3]);
}

// Set the database
@pg_select_db($this->_name) or die('error selecting database');

if (!($this->_db)) {
if ($this->isVerbose()) {
$this->_errorlog("\n*** Error in database->_connect ***");
}

// damn, got an error.
$this->dbError();
}

if ($this->_postgresql_version >= 40100) {
if ($this->_charset == 'utf-8') {
@pg_query ("SET NAMES 'utf8'", $this->_db);
}
}

if ($this->isVerbose()) {
$this->_errorlog("\n***leaving database->_connect***");
}
}





Örnek Kod 2

function dbQuery($sql,$ignore_errors=0)
{
if ($this->isVerbose()) {
$this->_errorlog("\n***inside database->dbQuery***");
$this->_errorlog("\n*** sql to execute is $sql ***");
}

// Run query
if ($ignore_errors == 1) {
$result = @pg_query($sql,$this->_db);
} else {
$result = @ pg _query($sql,$this->_db) or die($this->dbError($sql));
}

// If OK, return otherwise echo error
if (empty($result)) {
if ($this->isVerbose()) {
$this->_errorlog("\n***sql ran just fine***");
$this->_errorlog("\n*** Leaving database->dbQuery ***");
}
return $result;

} else {
// callee may want to supress printing of errors
if ($ignore_errors == 1) return false;

if ($this->isVerbose()) {
$this->_errorlog("\n***sql caused an error***");
$this->_errorlog("\n*** Leaving database->dbQuery ***");
}
}
}