Страница 1 из 1

деректива global

Добавлено: 2009-08-27 7:46:02
spy
Проблема с global после смены хостинга...
global трет все переменные...
до это й строчки все переменные есть

Код: Выделить всё

global $cutepath, $config_notify_postponed, $config_notify_status, $config_notify_email;

а после все обнуляются переменные вообще не попадают в функцию, как будто global их трет просто
Что то в настройках хостеров?

Код: Выделить всё

function ResynchronizePostponed(){
         global $cutepath, $config_notify_postponed, $config_notify_status, $config_notify_email;
         $all_postponed_db = file("$cutepath/data/postponed_news.txt");
         if(!empty($all_postponed_db)){
             $new_postponed_db = fopen("$cutepath/data/postponed_news.txt", w);
             @flock ($new_postponed_db,2);
             $now_date = time();

             foreach ($all_postponed_db as $p_line){
                 $p_item_db = explode("|",$p_line);
                 if($p_item_db[0] <= $now_date){
                 // Item is old and must be Activated, add it to news.txt


                         $all_active_db = file("$cutepath/data/news.txt");
                         $active_news_file = fopen("$cutepath/data/news.txt", "w");
                         @flock ($active_news_file,2);

                         fwrite($active_news_file,"$p_line");
                         foreach ($all_active_db as $active_line){ fwrite($active_news_file, "$active_line");}
                         @flock ($active_news_file,3);
                         fclose($active_news_file);



            if($config_notify_postponed == "yes" and $config_notify_status == "active"){
               send_mail("$config_notify_email", "CuteNews - Postponed article was Activated", "CuteNews has activated the article '$p_item_db[2]'");
            }

                 }else{
                 // Item is still postponed
                    fwrite($new_postponed_db,"$p_line");
                 }



            }
            @flock ($new_postponed_db,3);
            fclose($new_postponed_db);
         }

}

Re: деректива global

Добавлено: 2009-09-20 20:44:46
Alex Keda
так не бывает...
phpinfo хоть покажите...

Re: деректива global

Добавлено: 2009-09-20 20:54:31
terminus
у него perl ;-)

может полечится, если в начале скрипта написать

Код: Выделить всё

no strict;

Re: деректива global

Добавлено: 2009-09-20 20:59:20
Alex Keda
=)
в заголовок темы надо выносить язык..