array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'tr', ), 'this' => array ( 0 => 'function.set-include-path.php', 1 => 'set_include_path', ), 'up' => array ( 0 => 'ref.info.php', 1 => 'PHP Seçenek/Bilgi İşlevleri', ), 'prev' => array ( 0 => 'function.restore-include-path.php', 1 => 'restore_include_path', ), 'next' => array ( 0 => 'function.set-time-limit.php', 1 => 'set_time_limit', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'tr', 'path' => 'reference/info/functions/set-include-path.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8)
set_include_path — include_path yönergesinin çalışma anı değerini belirler
include_path yönergesinin, betiğin çalışma süresince geçerli olacak değerini belirler.
Başarısızlık durumunda false
, aksi takdirde
include_path yönergesinin eski
değeriyle döner.
Ö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);
?>