php-general Digest 28 Jan 2008 15:43:50 -0000 Issue 5261

Topics (messages 268183 through 268195):

i enconter a question when use Zend Framework's _foward function
        268183 by: little btx
        268184 by: Nathan Nobbe
        268185 by: Nathan Nobbe

Re: php installation problem
        268186 by: Umar

Getting part of string matched with regular expressions
        268187 by: Teck
        268188 by: Paul Scott
        268189 by: Jochem Maas
        268190 by: Max Antonov
        268194 by: Per Jessen

Getting nuequiz pro wo to work in php5
        268191 by: Don Don

Re: interface inheritance
        268192 by: Jochem Maas

[SOVLED - ISH] Re: [PHP] pack it in
        268193 by: Jochem Maas

Re: Posting Summary for Week Ending 25 January, 2008: [EMAIL PROTECTED]
        268195 by: Zoltán Németh

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
in the function init()  ,i want to use the function _foward but it doesn't
work. how to deal the problem

--- End Message ---
--- Begin Message ---
On Jan 27, 2008 9:53 PM, little btx <[EMAIL PROTECTED]> wrote:

> in the function init()  ,i want to use the function _foward but it doesn't
> work. how to deal the problem
>


i think youll have to be more specific, can you
supply some code that illustrates the problem ?

-nathan

--- End Message ---
--- Begin Message ---
On Jan 27, 2008 10:01 PM, little btx <[EMAIL PROTECTED]> wrote:

> public function init()
> try{
>             $this->subject = new subject($subject_id);
>         }catch (Zend_Exception $e)
>         {
>
> $this->_forward('index','error',null,array('error'=>$e->getMessage());
>         }
> }
> when it catch the Zend_Exception ,the function _forward doesn't work
>


please keep posts on list for the benefit of others.
what is the precise error you receive when _forward() is called?
also, what is the context of this code you have posted?  are you extending
a class from the zend framework?

-nathan

--- End Message ---
--- Begin Message ---
Hi Andres!

Thanks for your reply.. That is intresting there is no libiconv or icon
installed on my First Slackware machine where I have successfully installed
php.

But there is a libiconv installed on second Slackware machine.

Regards,

Umar Draz


Andrés Robinet wrote:
> 
>> -----Original Message-----
>> From: Andrés Robinet [mailto:[EMAIL PROTECTED]
>> Sent: Sunday, January 27, 2008 11:03 AM
>> To: [EMAIL PROTECTED]
>> Subject: RE: [PHP] php installation problem
>> 
>> > -----Original Message-----
>> > From: Umar [mailto:[EMAIL PROTECTED]
>> > Sent: Sunday, January 27, 2008 3:55 AM
>> > To: [EMAIL PROTECTED]
>> > Subject: [PHP] php installation problem
>> >
>> >
>> > Dear Members!
>> >
>> > I have installed php-5.2.5 on slackware 12.0 with these option
>> > successfully
>> >
>> > ./configure --prefix=/usr/local/php --with-
>> > apxs=/usr/local/apache/bin/apxs
>> > --with-config-file-path=/usr/local/apache/conf --with-pcre-regex
>> > --with-layout=GNU --enable-sysvshm --enable-shmop --enable-sysvmsg
>> > --enable-sysvsem --enable-exif --enable-ftp --enable-safe-mode
>> > --enable-bcmath --disable-debug --enable-sockets --enable-force-cgi-
>> > redirect
>> > --with-gettext --with-zlib --with-gd --enable-gd-native-ttf --
>> disable-
>> > rpath
>> > --enable-mbregex --with-bz2 --with-mime-magic --enable-calendar
>> > --enable-inline-optimization --enable-magic-quotes --enable-
>> wddx=shared
>> > --with-ncurses=shared --with-xmlrpc --with-regex=system --with-pear
>> > --with-curl --with-gmp --with-png-dir=/usr/local --enable-mbstring
>> > --with-jpeg-dir=/usr/local --with-pic --with-mm=/usr/local
>> > --with-libexpat-dir=/usr/local --with-xsl=/usr/local --with-mcrypt
>> > --with-mhash --with-ldap=/usr/local/ldap
>> >
>> > Now I am trying to install php-5.2.5 on another slackware 12.0 with
>> > same
>> > options but i got error on make
>> >
>> > ext/gd/libgd/.libs/gdkanji.o: In function `do_convert':
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> > 5.2.5/ext/gd/libgd/gdkanji.c:350:
>> > und
>> > efined reference to `libiconv_open'
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> > 5.2.5/ext/gd/libgd/gdkanji.c:365:
>> > und
>> > efined reference to `libiconv'
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> > 5.2.5/ext/gd/libgd/gdkanji.c:381:
>> > und
>> > efined reference to `libiconv_close'
>> > ext/iconv/.libs/iconv.o: In function `_php_iconv_strlen':
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> 5.2.5/ext/iconv/iconv.c:603:
>> > undefine
>> > d reference to `libiconv_open'
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> 5.2.5/ext/iconv/iconv.c:626:
>> > undefine
>> > d reference to `libiconv'
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> 5.2.5/ext/iconv/iconv.c:660:
>> > undefine
>> > d reference to `libiconv_close'
>> > ext/iconv/.libs/iconv.o: In function `php_iconv_string':
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> 5.2.5/ext/iconv/iconv.c:441:
>> > undefine
>> > d reference to `libiconv_open'
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> 5.2.5/ext/iconv/iconv.c:453:
>> > undefine
>> > d reference to `libiconv'
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> 5.2.5/ext/iconv/iconv.c:467:
>> > undefine
>> > d reference to `libiconv'
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> 5.2.5/ext/iconv/iconv.c:478:
>> > undefine
>> > d reference to `libiconv_close'
>> > ext/iconv/.libs/iconv.o: In function `_php_iconv_strpos':
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> 5.2.5/ext/iconv/iconv.c:851:
>> > undefine
>> > d reference to `libiconv_open'
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> 5.2.5/ext/iconv/iconv.c:879:
>> > undefine
>> > d reference to `libiconv'
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> 5.2.5/ext/iconv/iconv.c:993:
>> > undefine
>> > d reference to `libiconv_close'
>> > ext/iconv/.libs/iconv.o: In function `_php_iconv_appendl':
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> 5.2.5/ext/iconv/iconv.c:348:
>> > undefine
>> > d reference to `libiconv'
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> 5.2.5/ext/iconv/iconv.c:385:
>> > undefine
>> > d reference to `libiconv'
>> > ext/iconv/.libs/iconv.o: In function `_php_iconv_substr':
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> 5.2.5/ext/iconv/iconv.c:723:
>> > undefine
>> > d reference to `libiconv_open'
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> 5.2.5/ext/iconv/iconv.c:747:
>> > undefine
>> > d reference to `libiconv'
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> 5.2.5/ext/iconv/iconv.c:802:
>> > undefine
>> > d reference to `libiconv_close'
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> 5.2.5/ext/iconv/iconv.c:806:
>> > undefine
>> > d reference to `libiconv_close'
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> 5.2.5/ext/iconv/iconv.c:755:
>> > undefine
>> > d reference to `libiconv_open'
>> > ext/iconv/.libs/iconv.o: In function `_php_iconv_mime_decode':
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> > 5.2.5/ext/iconv/iconv.c:1354:
>> > undefin
>> > ed reference to `libiconv_open'
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> > 5.2.5/ext/iconv/iconv.c:1465:
>> > undefin
>> > ed reference to `libiconv_close'
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> > 5.2.5/ext/iconv/iconv.c:1468:
>> > undefin
>> > ed reference to `libiconv_open'
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> > 5.2.5/ext/iconv/iconv.c:1823:
>> > undefin
>> > ed reference to `libiconv_close'
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> > 5.2.5/ext/iconv/iconv.c:1826:
>> > undefin
>> > ed reference to `libiconv_close'
>> > ext/iconv/.libs/iconv.o: In function `php_iconv_stream_filter_dtor':
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> > 5.2.5/ext/iconv/iconv.c:2465:
>> > undefin
>> > ed reference to `libiconv_close'
>> > ext/iconv/.libs/iconv.o: In function `_php_iconv_mime_encode':
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> > 5.2.5/ext/iconv/iconv.c:1043:
>> > undefin
>> > ed reference to `libiconv_open'
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> > 5.2.5/ext/iconv/iconv.c:1057:
>> > undefin
>> > ed reference to `libiconv_open'
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> > 5.2.5/ext/iconv/iconv.c:1316:
>> > undefin
>> > ed reference to `libiconv_close'
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> > 5.2.5/ext/iconv/iconv.c:1319:
>> > undefin
>> > ed reference to `libiconv_close'
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> > 5.2.5/ext/iconv/iconv.c:1176:
>> > undefin
>> > ed reference to `libiconv'
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> > 5.2.5/ext/iconv/iconv.c:1128:
>> > undefin
>> > ed reference to `libiconv'
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> > 5.2.5/ext/iconv/iconv.c:1160:
>> > undefin
>> > ed reference to `libiconv'
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> > 5.2.5/ext/iconv/iconv.c:1319:
>> > undefin
>> > ed reference to `libiconv_close'
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> > 5.2.5/ext/iconv/iconv.c:1228:
>> > undefin
>> > ed reference to `libiconv'
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> > 5.2.5/ext/iconv/iconv.c:1259:
>> > undefin
>> > ed reference to `libiconv'
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> > 5.2.5/ext/iconv/iconv.c:1303:
>> > undefin
>> > ed reference to `libiconv'
>> > ext/iconv/.libs/iconv.o: In function
>> > `php_iconv_stream_filter_append_bucket':
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> > 5.2.5/ext/iconv/iconv.c:2615:
>> > undefin
>> > ed reference to `libiconv'
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> > 5.2.5/ext/iconv/iconv.c:2537:
>> > undefin
>> > ed reference to `libiconv'
>> > ext/iconv/.libs/iconv.o: In function `php_iconv_stream_filter_ctor':
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> > 5.2.5/ext/iconv/iconv.c:2491:
>> > undefin
>> > ed reference to `libiconv_open'
>> > ext/xmlrpc/libxmlrpc/.libs/encodings.o: In function `convert':
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> > 5.2.5/ext/xmlrpc/libxmlrpc/encodings.
>> > c:73: undefined reference to `libiconv_open'
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> > 5.2.5/ext/xmlrpc/libxmlrpc/encodings.
>> > c:81: undefined reference to `libiconv'
>> > /home/data/pkgs_docs/unix-pkgs/web/php/php-
>> > 5.2.5/ext/xmlrpc/libxmlrpc/encodings.
>> > c:101: undefined reference to `libiconv_close'
>> > collect2: ld returned 1 exit status
>> > make: *** [sapi/cli/php] Error 1
>> >
>> >
>> > Now please help what should i do? systems are both slackware 12.0 php
>> > version same php installation paraments same then why this error
>> > message
>> > appears.
>> >
>> > Kind Regards,
>> >
>> > Umar Draz
>> > --
>> > View this message in context: http://www.nabble.com/php-installation-
>> > problem-tp15117164p15117164.html
>> > Sent from the PHP - General mailing list archive at Nabble.com.
>> >
>> 
>> Sounds like you need the iconv libraries??
>> 
>> http://www.gnu.org/software/libiconv/#downloading
>> http://ar.php.net/iconv
>> 
>> Rob
>> 
>> Andrés Robinet | Lead Developer | BESTPLACE CORPORATION
>> 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL
>> 33308
>> | TEL 954-607-4207 | FAX 954-337-2695 |
>> Email: [EMAIL PROTECTED]  | MSN Chat: [EMAIL PROTECTED]  |  SKYPE:
>> bestplace |  Web: bestplace.biz  | Web: seo-diy.com
>> 
> 
> Sorry for double posting, but I forgot to mention that you may already
> have
> the iconv libraries, but you need the with-iconv=/path/to/lib switch
> 
> Rob
> 
> No virus found in this outgoing message.
> Checked by AVG Free Edition. 
> Version: 7.5.516 / Virus Database: 269.19.11/1244 - Release Date:
> 1/25/2008
> 7:44 PM
>  
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/php-installation-problem-tp15117164p15128070.html
Sent from the PHP - General mailing list archive at Nabble.com.

--- End Message ---
--- Begin Message ---
Hi,


I'm trying to find a way to get part of a string where the part is matched with regular expressions.

So, for example, if I have a string:

a2b3cd5ef6ghi7232jklmn

I need to grab "12b3cd5" using regular expressions and store the part in a variable.

$var = do_something("","","a2b3cd5ef6ghi7232jklmn");

I was using preg_replace for this, and try to delete (i.e., replace the non-matched part with an empty string) the second part, but I can't make it work.
--- End Message ---
--- Begin Message ---
On Mon, 2008-01-28 at 14:28 +0900, Teck wrote:
> I was using preg_replace for this, and try to delete (i.e., replace  
> the non-matched part with an empty string) the second part, but I  
> can't make it work.

Rather use preg_match_all() as that will produce an array of values,
with the first value being the original that you can then compare with.

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

--- End Message ---
--- Begin Message ---
Teck schreef:
Hi,


I'm trying to find a way to get part of a string where the part is matched with regular expressions.

So, for example, if I have a string:

a2b3cd5ef6ghi7232jklmn

I need to grab "12b3cd5" using regular expressions and store the part in a variable.

what are the rules for determining "12b3cd5" is what you want?
do you want to match the exact string? do you want to match the
length? the combination of letters and numbers?

$match = array();
$res = preg_match("#^(\d{2}[a-z]\d[a-z]{2}\d).*#", "12b3cd5ef6ghi7232jklmn", 
$match);

if ($res)
        var_dump($match);
else
        echo "no match.";


the above code matches the beginning of a string that starts with 2 digits,
followed by a lower case letter followed by a digit followed by 2 lower case 
letters
followed by a digit followed by anything.


$var = do_something("","","a2b3cd5ef6ghi7232jklmn");

I was using preg_replace for this, and try to delete (i.e., replace the non-matched part with an empty string) the second part, but I can't make it work.


--- End Message ---
--- Begin Message ---
Teck wrote:
Hi,


I'm trying to find a way to get part of a string where the part is matched with regular expressions.

So, for example, if I have a string:

a2b3cd5ef6ghi7232jklmn

I need to grab "12b3cd5" using regular expressions and store the part in a variable.

$var = do_something("","","a2b3cd5ef6ghi7232jklmn");

I was using preg_replace for this, and try to delete (i.e., replace the non-matched part with an empty string) the second part, but I can't make it work.

You can use backreferences in regular expressions.
$var= preg_replace('/([a-z]+)/is','$1','azxcvjf937^88');
if($var==='azxcvjf') echo "MATCH";

http://php.net/manual/en/function.preg-replace.php
look at Example1.

--- End Message ---
--- Begin Message ---
Teck wrote:

> I'm trying to find a way to get part of a string where the part is
> matched with regular expressions.
> 
> So, for example, if I have a string:
> 
> a2b3cd5ef6ghi7232jklmn
> 
> I need to grab "12b3cd5" using regular expressions and store the part
> in a variable.

Assuming you meant to grab '2b3cd5': 

$matches=preg_match( '/2b3cd5/',$text,$match );
$var=$match[0];



/Per Jessen, Zürich

--- End Message ---
--- Begin Message ---
http://nuedream.com/nuequizpro/  

I cant get the above product to work in php5.  The product works in php4 but 
has problems with a $this variable in the database class with php5.  Has anyone 
used the above product in php5 and found a way arround it ?


Cheers

Don
       
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.

--- End Message ---
--- Begin Message ---
Nathan Nobbe schreef:
all,

previously, on this list and elsewhere, i have raised the topic of
interface inheritance, lamenting that php is void of the feature.
to my utter amazement i discovered that php does in fact support
interface inheritance, reading through some of Marcus Boergers'
code in SPL..  i noticed RecursiveIterator extends Iterator, which
is an internal interface (part of the zend engine), so i thought to
myself, perhaps only internal interfaces can be extended, but
then a quick test proved my suspicions wrong.  in fact, interfaces
can even extend multiple parent interfaces, just like java (*ducks*).
here is the sample code so you can see for yourself:

<?php
interface Somethingable {
        public function doSomething();
}

interface Crazyfiable {
        public function getCrazy();
}

interface Extendable extends Somethingable, Crazyfiable {
        public function extend();
}

class SuperClass implements Extendable {
        public function doSomething() {
                echo 'i did something ..' . PHP_EOL;
        }

        public function extend() {
                echo 'i extended something..' . PHP_EOL;
        }

        public function getCrazy() {
                echo 'im a crazy bastard now!' . PHP_EOL;
        }
}

/*
 * TEST HERE
 */
 $sc = new SuperClass();
 $sc->doSomething();
 $sc->extend();
 $sc->getCrazy();
?>

and the output:
[EMAIL PROTECTED] /usr/share/php5/splExperiment/tests $ php
testInterfaceInheritence.php
i did something ..
i extended something..
im a crazy bastard now!

i for one am quite excited.  heres to happy adventures in oop-land w/ php!

nice bit of info!

as an aside, I often use php -r to test snippets like this e.g.:

$> php -r 'echo "foo!";'

very handy and saves having to create a file everytime you test something,
it does mean your forced to use double quotes only in the code (otherwise
the shell misinterprets). I recommend using double quotes in snippets you
post in order to make it easier for people to quickly test your gems for
themselves :-)


-nathan


--- End Message ---
--- Begin Message ---
thanks to everyone for there info/feedback/help/etc - I have
a somewhat better understanding of this pack/unpack/binary stuff now :-)

Jochem Maas schreef:
someone asked about checksum values in another thread, I believe
he got his answer no thanks to me. but whilst I was trying to help
I got stuck playing with pack/unpack.

so now I have the broadbrush question of what would one use
pack/unpack for? can anyone point at some realworld examples/code that
might help me broaden my horizons?

rds,
jochem

[

--- End Message ---
--- Begin Message ---
hey Dan,

where is the stats for last week? the experiment is over or what? ;)

greets
Zoltán Németh

--- End Message ---

Reply via email to