Модераторы: skyboy, MoLeX, Aliance, ksnk
  

Поиск:

Ответ в темуСоздание новой темы Создание опроса
> помогите разобраться с сайтом, есть непонятные моменты в работе 
:(
    Опции темы
СЭНСЭЙ
Дата 9.9.2011, 13:36 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Опытный
**


Профиль
Группа: Участник
Сообщений: 432
Регистрация: 20.3.2006

Репутация: нет
Всего: нет



Добрый день!
Есть сайт.
Но некоторые моменты в коде непонятны.
Прилагаю урезаный сайт.
Если чего будет не хватать - говорите я буду выкладывать.

Итак сразу скажу что не понятно:
В файле index.php вызывается файл
require_once BASEPATH.'codeigniter/CodeIgniter'.EXT - ci_system/codeigniter/CodeIgniter.php
в этом файле создается экземпляр класса:
$OUT =& load_class('Output');
и далее  вызывается функция $OUT->_display();
 (или метод - я не знаю точно), которая описана в файле класса ci_system/libraries/output.php

вот она:

Код

/**
     * Display Output
     *
     * All "view" data is automatically put into this variable by the controller class:
     *
     * $this->final_output
     *
     * This function sends the finalized output data to the browser along
     * with any server headers and profile data.  It also stops the
     * benchmark timer so the page rendering speed and memory usage can be shown.
     *
     * @access    public
     * @return    mixed
     */        
    function _display($output = '')
    {    
        // Note:  We use globals because we can't use $CI =& get_instance()
        // since this function is sometimes called by the caching mechanism,
        // which happens before the CI super object is available.
        global $BM, $CFG;
        
        // --------------------------------------------------------------------
        
        // Set the output data
        if ($output == '')
        {

            $output =& $this->final_output;
        }
                
        // --------------------------------------------------------------------
        
        // Do we need to write a cache file?
        if ($this->cache_expiration > 0)
        {
            $this->_write_cache($output);
        }
        
        // --------------------------------------------------------------------

        // Parse out the elapsed time and memory usage,
        // then swap the pseudo-variables with the data

        $elapsed = $BM->elapsed_time('total_execution_time_start', 'total_execution_time_end');
        
        $output = str_replace('{elapsed_time}', $elapsed, $output);
        
        $memory     = ( ! function_exists('memory_get_usage')) ? '0' : round(memory_get_usage()/1024/1024, 2).'MB';
        $output = str_replace('{memory_usage}', $memory, $output);        

        // --------------------------------------------------------------------
        
        // Is compression requested?
        if ($CFG->item('compress_output') === TRUE)
        {
            if (extension_loaded('zlib'))
            {
                if (isset($_SERVER['HTTP_ACCEPT_ENCODING']) AND strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== FALSE)
                {
                    ob_start('ob_gzhandler');
                }
            }
        }

        // --------------------------------------------------------------------
        
        // Are there any server headers to send?
        if (count($this->headers) > 0)
        {
            foreach ($this->headers as $header)
            {
                @header($header[0], $header[1]);
            }
        }        

        // --------------------------------------------------------------------
        
        // Does the get_instance() function exist?
        // If not we know we are dealing with a cache file so we'll
        // simply echo out the data and exit.
        if ( ! function_exists('get_instance'))
        {
            echo $output;
                        
            log_message('debug', "Final output sent to browser");
            log_message('debug', "Total execution time: ".$elapsed);
            return TRUE;
        }

    
        // --------------------------------------------------------------------

        // Grab the super object.  We'll need it in a moment...
        $CI =& get_instance();
        
        // Do we need to generate profile data?
        // If so, load the Profile class and run it.
                
        if ($this->enable_profiler == TRUE)
        {
            $CI->load->library('profiler');                
                                        
            // If the output data contains closing </body> and </html> tags
            // we will remove them and add them back after we insert the profile data
            if (preg_match("|</body>.*?</html>|is", $output))
            {
                $output  = preg_replace("|</body>.*?</html>|is", '', $output);

                $output .= $CI->profiler->run();
                
                $output .= '</body></html>';
                

            }
            else
            {
                $output .= $CI->profiler->run();

            }
        }

        
        // --------------------------------------------------------------------

        // Does the controller contain a function named _output()?
        // If so send the output there.  Otherwise, echo it.
        if (method_exists($CI, '_output'))
        {
            $CI->_output($output);

        }
        else
        {
            
            echo $output;  // Send it to the browser!

        }
        
        log_message('debug', "Final output sent to browser");
        log_message('debug', "Total execution time: ".$elapsed);

        
    }
    
    // --------------------------------------------------------------------
    


вот в этой строке:
$output =& $this->final_output;

значение final_output уже содержит код страницы.

У меня на локалхосте показывает только верхние кнопки и  вместо остального контента - надпись
Ошибка 404 - Страница, которую вы запросили не существует

Где генирируется код этого сообщения никак не найду - ПОМОГИТЕ плиз!



Присоединённый файл ( Кол-во скачиваний: 1 )
Присоединённый файл  1111.rar 958,26 Kb
PM MAIL   Вверх
MoLeX
Дата 9.9.2011, 14:09 (ссылка) |    (голосов:1) Загрузка ... Загрузка ... Быстрая цитата Цитата


Местный пингвин
****


Профиль
Группа: Модератор
Сообщений: 4076
Регистрация: 17.5.2007

Репутация: 46
Всего: 140



может стоит сначала фреймворк изучить? ссылку на русское сообщество я уже давал


--------------------
Amazing  smile 
PM MAIL WWW ICQ   Вверх
  
Ответ в темуСоздание новой темы Создание опроса
Правила форума "PHP"
Aliance
IZ@TOP
skyboy
SamDark
MoLeX

Новичкам:

  • PHP редакторы собираются и обсуждаются здесь
  • Электронные книги по PHP, документацию можно найти здесь
  • Интерпретатор PHP, полную документацию можно скачать на PHP.NET

Важно:

  • Не брезгуйте пользоваться тегами [code=php]КОД[/code] для повышения читабельности текста/кода.
  • Перед созданием новой темы воспользуйтесь поиском и загляните в FAQ
  • Действия модераторов можно обсудить здесь

Внимание:

  • Темы "ищу скрипт", "подскажите скрипт" и т.п. будут переноситься в форум "Web-технологии"
  • Темы с именами: "Срочно", "помогите", "не знаю как делать" будут УДАЛЯТЬСЯ

Если Вам понравилась атмосфера форума, заходите к нам чаще! С уважением, IZ@TOP, skyboy, SamDark, MoLeX, awers.

 
0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей)
0 Пользователей:
« Предыдущая тема | PHP: Общие вопросы | Следующая тема »


 




[ Время генерации скрипта: 0.0444 ]   [ Использовано запросов: 22 ]   [ GZIP включён ]


Реклама на сайте     Информационное спонсорство

 
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности     Powered by Invision Power Board(R) 1.3 © 2003  IPS, Inc.