PHP kod parçası ile bu sorunu yaşıyorum:
class Core {
public function start()
{
require("funk/funks/libraries/uri.php");
$this->uri = new uri();
require("funk/core/loader.php");
$this->load = new loader();
if($this->uri->get_segment(1) != "" and file_exists("funk/pages/".$uri->get_segment(1).".php")){
Kod sadece bir pasajı
Ölümcül hata: Bunu açıklamak için en iyi yolu, bu başka bir sınıfın (uri.php) üzerine bir sınıf arama ve i hata alıyorum olduğunu / home olmayan bir nesne üzerinde () üye işlevi get_segment Çağrı / { hat 11 üzerinde [(0)]} / public_html / özel / funkyphp / funk / çekirdek / core.php (if ($ this-> uri-> get_segment (1) bölüm)
Ben bu sorunu çok yaşıyorum ve bu beni gerçekten adamcağız.
kütüphane kodu:
<?php
class uri
{
private $server_path_info = '';
private $segment = array();
private $segments = 0;
public function __construct()
{
$segment_temp = array();
$this->server_path_info = preg_replace("/\?/", "", $_SERVER["PATH_INFO"]);
$segment_temp = explode("/", $this->server_path_info);
foreach ($segment_temp as $key => $seg)
{
if (!preg_match("/([a-zA-Z0-9\.\_\-]+)/", $seg) || empty($seg)) unset($segment_temp[$key]);
}
foreach ($segment_temp as $k => $value)
{
$this->segment[] = $value;
}
unset($segment_temp);
$this->segments = count($this->segment);
}
public function segment_exists($id = 0)
{
$id = (int)$id;
if (isset($this->segment[$id])) return true;
else return false;
}
public function get_segment($id = 0)
{
$id--;
$id = (int)$id;
if ($this->segment_exists($id) === true) return $this->segment[$id];
else return false;
}
}
?>