PHP 8.3.4 Released!

set_include_path

(PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8)

set_include_pathinclude_path yönergesinin çalışma anı değerini belirler

Açıklama

set_include_path(string $yeni_değer): string|false

include_path yönergesinin, betiğin çalışma süresince geçerli olacak değerini belirler.

Bağımsız Değişkenler

yeni_değer

include_path yönergesinin yeni değeri.

Dönen Değerler

Başarısızlık durumunda false, aksi takdirde include_path yönergesinin eski değeriyle döner.

Örnekler

Örnek 1 - set_include_path() örneği

<?php
set_include_path
('/inc');

// veya ini_set() kullanarak
ini_set('include_path', '/usr/lib/pear');
?>

Örnek 2 - İçerilecek dosyaların aranacağı yollara bir yenisini eklemek

PATH_SEPARATOR sabitini kullanarak bu yolları işletim sisteminden bağımsız olarak çoğaltmak mümkündür.

Bu örnekte, include_path yönergesinde belirtilen dosya yollarına /usr/lib/pear dizinini ekleyeceğiz.

<?php
$path
= '/usr/lib/pear';
set_include_path(get_include_path() . PATH_SEPARATOR . $path);
?>

Ayrıca Bakınız

add a note

User Contributed Notes 1 note

up
21
parks at vecinc dot com
14 years ago
If you find that this function is failing for you, and you're not sure why, you may have set your php include path in your sites's conf file in Apache (this may be true of .htaccess as well)

So to get it to work, comment out any "php_value include_path" type lines in your Apache conf file, and you should be able to set it now in your php code.
To Top