@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27



Comments:

<0> and i want to make an "index.tpl" who will include between <body> and </body> another template
<1> jessy_: the ancient kick*** PHPLib :)
<2> jessy_: get http://smarty.php.net/
<2> never heard of PHPLib though :/
<3> jessy_: Who is index.tpl? James? :)
<0> smarty is like another langage, i don't want to learn it
<1> jessy: don't know if it was possible, but well, you could parse a template and fill a variable with the text
<1> PHPLib dates from PHP3, not sure if they made it for PHP/FI, well, we all made one :)
<1> funny, the guy is now a colleague of mine
<0> hmm a variable can contain 19984864 caracters ?
<1> anyway
<1> jessy_: depends how big your memory is, but it's a bad idea indeed
<0> yeah..
<1> jessy_: can't you load multiple templates in phplib? (it's really to long ago..)
<1> erm.. if /etc/php/php.ini isn't read by Apache2.. is there some configuration I have to care about?
<0> Kemurii, yeah



<1> jessy_: I think what we did was combining multiple temlates (header, body, footer) with PHPLib, output as one
<0> yes
<1> i think I found what it is..
<1> .. stops thinking, wasn't that
<4> hello
<5> while( $linha = mysql_fetch_array($query)){
<5> is error on php 5 ?
<5> while( $linha = mysql_fetch_array($query)){} is error ?
<6> guy's where do the pear libs located normally
<5> Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\wamp\www\obaq\index.php on line 16
<6> I am getting this error * PEAR Search Path (PHP's include_path): /usr/local/www/horde/lib:.:
<6> * PEAR: No
<6> Check your PHP include_path setting to make sure it has the PEAR library directory.
<1> contraventor: did you actually check the manual for mysql_fetch_array()?
<1> contraventor: it expects a result set, not a string/query!
<1> porkpie: and?
<5> Kemurii hmmm, an example your ?
<1> php.net/mysql_query, I think there is an example..
<1> contraventor ^^^ and check out tutorials of PHP then
<7> contraventor, go to http://php.net/mysql_fetch_array but better yet, go to http://www.zend.com/php/beginners/ and readup
<5> tanks
<5> ;P
<8> hello, say i got 2 cl***es, User and Order and now both cl***es can have Discounts ***ociated with them, i.e User has Discounts which are not uesd yet, and Order has discounts which are used. so i made a DiscountList cl*** to hold Discount cl***es, but i don't know how to instanciate the DiscountList cl*** now... can somebody help me?
<1> why would it be different that other objects?
<8> Kemurii sorry?
<1> jax: why making an extra cl*** for it, why not just an array of Discounts in Order?
<8> because perhaps i want a Discountist->getTotalDiscountSum or something
<8> or am i missing something?
<8> something in the model is wrong
<1> jax: that would be a reason yeah
<1> jax: so, 'how to instanciate', what do you mean?
<8> the problem is, i can't differentiate between orderID and userID in the constructor
<8> so if i do $myList = new DiscountList( orderID )
<8> how can i differentiate between $myList = new DiscountList( userID )
<7> Jax, 1) you can make two extra cl***es - OrderDiscountList and UserDiscountList (both extend DiscountList) and instantiate each where needed...
<1> in both Order and User, set the member discList = new DiscountList(); then in the construct of Order/User you load the DiscountList->addDiscount($disc)
<1> or something alike
<1> or like poncha said
<8> poncha yeah i've been thinking of that.
<8> but somehow seemed so dirty! :D
<8> guess i'll have to use polymorphism then
<1> jax: erm, that's OO
<8> ok, i'll make a sketch, thanks ;)
<7> that actually (imho) is the most clean way of doing that
<1> grumble, anyone idea why Apache2 would NOT read /etc/php/php.ini?
<7> Kemurii, see phpinfo() and see where is it looking for php.ini
<1> it's going for /etc/php
<1> CLI is loading it just fine
<7> cli and apache module may be looking for separate locations
<1> since when?
<7> what do you mean? since compile time :)
<1> they are both fresh etc, both the same
<1> but somehow not
<7> because cli is a different binary and has different build settings... for example, on debian i have cli read /etc/php4/cli/php.ini and apache module /etc/php4/apache/php.ini
<1> no, it is not :)
<7> ??
<7> its not what? you think cli is same thing that apache uses ? you're wrong then
<1> php.ini is used by both, has been like that since the start of ages
<1> there is php-cli.ini and php-apache.ini, but those are not present
<7> well, here you're wrong again.. you may be right for your specific distro, but that is not necessarily true for others (as i shown you by example. i did not ASK if that is so on debian systems)
<1> the default /usr/local/lib/php.ini is not present, so I compiled it with --with-config-file-path=/etc/php, CLI is aware that it needs to read /etc/php/php.ini, but Apache just shows in phpinfo() /etc/php



<7> ok
<9> uhm, can I use a string like an array? like $str = "Hello", if ($str[3] == 'l')? =P
<1> I compile PHP/Apache :)
<7> if YOU gave both same --with-config-path -- THAt aint start of times :)
<7> anyway...:)
<1> poncho: both? it's just compiling all (module and cli) and installs :) don't want difference between them
<7> why are you sure php.ini is not read?
<1> poncha: mysql socket is /tmp/mysql.sock
<7> and? ;)
<1> what and? it should go to the one I said it to, both mysql/mysqli are configure to go /var/run/mysql/mysql.sock
<10> join #web
<1> I'm sure it's something stupid I'm missing here :(
<7> ok. two questions: 1) (and that happens alot :) ) did you reload apache since changing php.ini ? and (2) are you sure that apache/php is now the updated build and not old before compiling? (ran make install , stopped old , made sure port is freed and started new?)
<1> 1) yes.. 2) yes I'm sure
<1> I'm reordering ./configure options to make sure.. tricks
<7> care to show phpinfo (on web) and php.ini ?
<1> sure
<1> poncha: here: http://kemuri.net/4b9b00852a3b603217105c8c65e9ba36.php
<1> poncha: here the cli: http://kemuri.net/phpcli.txt
<11> Kemurii: a dog hacked your phpinfo page
<1> yes
<7> Kemurii, maybe you need to set mysql[i].default_socket and not simply socket ?
<7> see the mysql/mysqli blocks... .default_socket is undefined in both
<7> that config var might have changed in php5 since php4 ... i'm not sure
<1> is wearing me out, one sec
<1> how CLI doesn't get my php.ini .. one sec..
<7> ; Default socket name for local MySQL connects. If empty, uses the built-in
<7> ; MySQL defaults.
<7> mysql.default_socket =
<1> yes, it is by default empty
<1> which is good
<7> thats from php.ini-dist http://cvs.php.net/viewcvs.cgi/php-src/php.ini-dist?view=markup&rev=1.248
<1> I never did a make clean though :P let me try that.. ffs
<1> gonna feature request the remove of apxs' option -a
<1> how picky is Apache/php about permissions on php.ini files?
<7> no idea
<1> php -i as root is different thatn as user
<7> btw
<7> do you have any errors/warnings in apache error.log ?
<1> nope
<7> and... apache isnt running in jail is it ?
<11> Kemurii: if php may not access the php.ini, it simply can't read it
<8> poncha so how was that again, i define all methods in DeductionList cl***, then i can just make an OrderDeductionList cl*** and override the methods I want, and extend DeductionList, correct ?
<1> no, Apache is pretty running norml
<7> correct
<1> et: well, user can read it, just like root
<7> Jax, correct
<11> Kemurii: are they using the same php.ini?
<7> yeah, same
<7> according to phpinfo
<1> et: when php -i is ran as root , /etc/php/php.ini is shown in the info output, as user '/etc/php' is shown
<1> this gonna be a so silly problem that I'm gonna smash my head on a wall
<12> do you all use apache web servers, anyone tryed here boa? i'd like to use boa since it's VEEEERY simple and fast, but i'm afraid php doesn't support non-apache servers right?
<8> poncha does it even make sense to define the method that gets the stuff from DB in the DeductionList cl*** ?
<8> since that cl*** will never be instanciated directly
<1> azi_: it does support other webservers, might look at lighttpd too
<7> Jax, you can make other methods there... like getOrderDiscountList() etc and call them from the child cl***es
<1> ok, it boils down to the fact that php-cli/module run as non root user can't see the php.ini file
<7> Jax, that way the base cl*** has all the functionality and you can (if you will need it some day) instantiate it and check whatever you need ith it :)
<1> going the 777 now
<8> hm ok but then i need a default behaviour for getDiscounts in the DiscountList cl***
<7> Kemurii, check not only file itself... all the path has to be readable
<7> Jax, not necessarily... but you could... aslong as you dont make that method final :)
<1> --with-config-file-path=/etc/php <<- must be path right?
<8> .. ;)
<7> Kemurii, yep
<1> double checking, only double checking
<8> Kemurii check apache logs, doesn't it complain about not finding php.ini and using default values @ startup ?
<1> no, it doesn't
<1> php cli doesn't find php.ini aswell, ran as non-root
<10> Is there a way to set a variable to a random file inside a said folder?
<1> k, asking some php core guy now :P
<8> Kemurii is your prefix ?
<8> (for ./configure)


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #php
or
Go to some related logs:

gentoo unmask gaim
#sdl
CONFIG_AEABI OABI_COMPAT
#perl
xolphin.net
linux-source ubuntu ln -s
ubuntu removable drive permissions
suse broadcom bcm4303
fluxbox maxover
#web



Home  |  disclaimer  |  contact  |  submit quotes