Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP 5] - błędy i konflikty
Forum PHP.pl > Inne > Hydepark
DeyV
W końcu znalazłem chwilę czasu, by poważnie "poogladać" mozłiwości nowego php'a.
Przepuściłem na nim większość soich skryptów, z pozytywnym efektem.
Czasy wykonywania nie róznią się praktycznie od php 4.3.1, wiec nie można narzekać, szczególnie uwzgledniając to, że żaden z nich nie wykorzystuje wielu 'dobrodziejstw' i innowacji 5.

Jednak pojawiły się błędy.
Do poważniejszych (przynajmniej jak dla mnie) jest błąd w Smarty. I problem w tym, ze nie wiem co z tym zrobić.
komunikat:
Cytat
Parse error: parse error, unexpected T_OBJECT_OPERATOR in f:apachehtdocsmstudiotoyota - stronaSmartySmarty.class.php on line 1310

kod:
[php:1:4babd7c074]<?php
1307 if($_compile_config) {
8 if(!is_object($this->_conf_obj)) {
9 require_once SMARTY_DIR . $this->config_class . '.class.php';
10 $this->_conf_obj = new $this->config_class($_config_dir);
11 $this->_conf_obj->overwrite = $this->config_overwrite;
12 $this->_conf_obj->booleanize = $this->config_booleanize;
13 $this->_conf_obj->read_hidden = $this->config_read_hidden;
14 $this->_conf_obj->fix_newlines = $this->config_fix_newlines;
15 $this->_conf_obj->set_path = $_config_dir;
}
?>[/php:1:4babd7c074]
Jednak mimo kilku prub - nie udało mi sie wymyslić, jak poprawić tą: $this->_conf_obj = new $this->config_class($_config_dir); , 1310 linię

Również ze skryptami PEAR jest problem sad.gif
Zdarzajacy się najczęsicej, to:
Cytat
Fatal error: Using $this when not in object context in

Ale w tym przypadku pozostaje nam chyba tylko czekać na nowe wersje pakietów.
Jabol
ja chyba wiem, co tam jest źle. Jeżeli dobrze rozumiem on pobiera tą funckją nazwę klasy, więc spróbuj przypisać wartość tej funckji do $temp, i zrobić new $temp;.
Ps. Mówiłeś ostatnio gdzieś, że nie masz katalogu tests u siebie. Może to dlatego, że ściągałeś złą wersję, ja mam tar.bz na linuxa z dzisiaj 7:30
DeyV
Rzeczywiście - rada Jabola okazała się w 100% poprawna. Th'x.
Ale pytanie: czemu tak się dzieje?
Czemu można wykorzystać konstrukcję [php:1:6cac08b02d]<?php
$_tmp = $this->compiler_class;
$smarty_compiler = new $_tmp ;
?>[/php:1:6cac08b02d] a juz tak nie można:[php:1:6cac08b02d]<?php $smarty_compiler = new $this->compiler_class; ?>[/php:1:6cac08b02d] Czy jest to celowe działanie, jeśli tak, w jakim celu, czy też jeden z jeszcze nie poprawionych błędów?

daje się też zauważyć, ze stoimy przed nami wiele nauki. Pojawiło się wiele rozwiazań, kóre znacznie bedą mogły ułatwić pracę i przyśpieszyć skrypty, ale najpierw trzeba je poznać...
Choćby coś takiego: Changed array_search() to accept also objects as a needle. Wiecie, o ile może to przyspieszyć pracę ze skryptami działąjącymi na teblicach obiektów?
Seth
DeyV: W tym opisie znajduja sie jescze inne cenne rady z kompatybilnoscia: http://zend.com/engine2/ZendEngine-2.0.pdf
DeyV
Ok, to prawda, ale tam nie pojawiają się wszystkie informacje. Np. nie znalazłem tam informacje na temat tego problemu ze Smarty. Nie było również chyba nic na temat zakazania wykorzystania nazwy zmiennej $this w kodzie poza klasami


####################
Dzięki za link dokumentu, który sam zarzuciłem na forum z jakiś msc temu winksmiley.jpg smile.gif
Jabol
ten artykól jest niezły, ale nie opisuje kilku ciekawych funckji, które są dostępne np. w zródłach (testach) do php5. Polecam te artykuły, które na dodatek są napisane w języku który wszyscy (no może nie wszyscy) lepiej znamy!

PS tutaj mały dodatek:
Cytat
php                                                                        NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
? ? questionmark.gif? 200?, Version 5.0.0
- Moved extensions to PECL (http://pear.php.net/): (James, Tal)
 . ext/fribidi
- Fixed dirname() and strip_tags() to be binary-safe. (Moriyoshi)
- Fixed bug #22386 (Using browscap causes segfault). (Jay)
- Fixed bug #22895 (php cli outputs errors in text AND html). (Marcus)
- Fixed bug #22059 (ftp_chdir causes segfault). (Sara)
- Fixed bug #21985 and #22064 (various mb_send_mail() issues). (Moriyoshi)
- Fixed bug #21600 (Assign by reference function call changes variable contents).
 (Zeev)
- Fixed bug #21007 (html_errors off text-only output in phpinfo). (Marcus)
- Fixed bug #20442 (upgraded bundled expat to 1.95.5). (Ilia)
- Fixed bug #20155 (xmlrpc compile problem with ZE2). (Derick, Jan Schneider)
- Changed the length parameter in fgetss() to be optional. (Moriyoshi)
- Changed ini parser to allow for handling of quoted multi-line values. (Ilia)
- Changed get_extension_funcs() to return list of the built-in Zend Engine  
 functions if "zend" is specified as the module name. (Ilia)
- Changed is_executable() to be available also on Windows. (Shane)
- Changed array_search() to accept also objects as a needle. (Moriyoshi)
- Changed ext/mcrypt to require libmcrypt version 2.5.6 or greater. (Derick)
- Changed uniqid() parameters to be optional and allow any prefix length. (Marcus)
- Added unlink() method to wrapper operations, routed userland unlink through
 wrappers, and implemented plainfiles and ftp unlink methods. (Sara)
- Added encoding detection feature for expat XML parser. (Adam Dickmeiss, Moriyoshi)
- Added missing multibyte(unicode) support and numeric entity support to
 html_entity_decode(). (Moriyoshi)
- Added opendir() and stat() related support to ftp:// wrapper. (Sara)
- Added IPv6 support to ext/sockets. (Sara)
- Added context options to http_fopen_wrapper 'method', 'header', 'content'. (Sara)
- Added domdocument->create_document_fragment() and documentfragment->open_mem()  
 methods to domxml. (Rob Richards, Chregu)
- Added domelement->set_attribute_node() method (bug #17638). (Rob Richards)
- Added optional parameter to get_browser() to make it return an array. (Jay)
- Added optional parameter to openssl_sign() to specify the hashing algorithm.
 (scott@planetscott.ca, Derick)
- Added file_put_contents() function. (Sterling)
- Added "mail_force_extra_paramaters" php.ini option which forces the addition  
 of the specified parameters to be passed as extra parameters to the sendmail  
 binary. These parameters will always replace the value of the 5th parameter
 to mail(), even in safe mode. (Derick)
- Added new "transport" layer for sockets and associated functions. (Wez)
 . stream_socket_client() - similar to fsockopen(), but more powerful.
 . stream_socket_server() - Creates a server socket.
 . stream_socket_accept() - Accept a client connection.
 . stream_socket_get_name() - Get local or remote name of socket.
 . generic crypto interface for streams (supports dynamic loading of OpenSSL)
- Added stream_copy_to_stream() function. (Wez)
- Added memory mapping support under win32 to improve performance of
 readfile(), fpassthru() and some internal streams operations. (Wez)
- Added DBA handler 'inifile' to support ini files. (Marcus)
- Added input filter support. See README.input_filter. (Rasmus)
- Added "session.hash_function" and "session.hash_bits_per_character". (Sascha)
- Added lightweight streaming input abstraction to the Zend Engine scanners
 that provides uniform support for include()'ing data from php streams across
 all platforms (Wez, Zend Engine).
- Added optional parameter to sha1(), sha1_file(), md5() and md5_file() which
 makes them return the digest as binary data. (Michael Bretterklieber, Derick)
- Added proc_nice() function. Changes priority of the current process. (Ilia)
- Added pcntl_getpriority() and pcntl_setpriority() functions. (Ilia)
- Added idate(), date_sunrise() and date_sunset() functions. (Moshe Doron)
- Added long options into CLI & CGI (e.g. --version). (Marcus)
- Added strpbrk() function. Searches a string for a list of characters. (Ilia)
- Added stream_get_line() function. Reads either the specified number of bytes
 or until the ending string is found. (Ilia)
- Added optional parameter to mkdir() to make directory creation recursive. (Ilia)
- Added optional parameter to file() which makes the result array not contain
 the line endings and to skip empty lines. (Ilia)
- Added get_headers() function. Returns headers sent by the server of  
 the specified URL. (Ilia)
- Added str_split() function. Breaks down a string into an array of elements  
 based on length. (Ilia)
- Added array_walk_recursive() function. (Ilia)
- Added new command line parameters -B, -F, -R and -E which allow to process stdin
 line by line (See 'php -h' or 'man php' for more). (Marcus)
- Added string.base64 stream filter. (Moriyoshi)
- Added domxml_node_get_path(). (Lukas Schröder)
- Added iconv related functions. (Moriyoshi)
 . iconv_strlen()
 . iconv_substr()
 . iconv_strpos()
 . iconv_strrpos()
 . iconv_mime_decode()
 . iconv_mime_encode()
- Added new range() functionality. (Ilia)
 . Support for float modifier.
 . Detection of numeric values inside strings passed as high & low.
 . Proper handle the situations where high == low.
- Added imagefilter() function. Allows application of various filters.
 Only available with bundled GD. (Pierre-Alain Joye, Ilia)
- Added antialiased drawing support to bundled GD. (Pierre-Alain Joye, Ilia)
  . imageantialias($im, $flag) to (de)active antialias
  . imageline antialias support
  . imagepolygon antialias support
Mam nadzieje, że nie przesadziłem, ale z jakigoś powodu ten plik nie chciał mi się dodać do tego, do którego wyżej umieściłem powyżej link...
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.