| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
Comments:
<0> Then again, I've never had the need to do that <1> Nanobot: yea :) <1> luisgrin: Apache is not setup for php. Read php.net/install <2> ok <2> dangermouse thanks <3> Dangermouse, do you use PDO? <1> nope <3> how can I access a child cl*** from a parent cl*** <3> or <3> that actually defeats the entire purpose <4> i'm writing a newsletter script that sends email to about 5000 subscribers. i've got a queue system setup to batch send emails, but triggering the script is tough. can't be done via a browser, since if the browser closes, it screws up the queue, and cron wouldn't work, since i'd need a variable number of batches sent at variable times, atleast a month apart <4> any thoughts? <5> why the cron wouldn't work? <5> You can always create a deamon, that checks for the pending emails <6> how do i share a variable between two functions? <5> Melbell: $GLOBALS
<4> well it would have to query every minute to see if a queue exists, which is pointless since it would be wasting resources all but that one time a month <3> now who would want to crete a demon to check pending emails <6> Wolfpaws, is there any way to just share it between two functions and nothing else? and in which function do I use GLOBALS do declare it? <5> think "cron" <5> Melbell: php.net/global. There is a link. Read it ALL. <6> Wolfpaws, i have read it twice...i will read it again <5> tek: It has been done at my work. <4> well the problem with cron is that it would be running when it doesn't need to <5> em... <7> I'd like to have and automated web hosting sript that automatically creates a linux user and a mysql databace/user... Is it possable to create a linux user with PHP? <7> So FTP will be enabed :) <4> Thomaz: you can use exec() <5> yes... Google for php-pam ***otiation <8> we do exactly that - the php app inserts batches into a DB, and a cron job runs every 5 mins looking for batches to run. <5> theDan: *blink* <7> Awesome, i'll google it <4> Wolfpaws: I don't use cron too often, is there some obvious answer I'm missing? <5> theDan: yes. The ease of use... Your cron is probably running non-stop. WHY aren't you harnesting it's power? <7> Oh my god! Googles website is down (the australian one: google.com.au) seems server side <7> Back on <5> www.google.cvom <7> That was snappy. <5> bah. <7> Maybe they are using windows and it crashed :D <4> Yeah, well that's the problem, if I set it up, it would be running the script every minute of the day.. forever, which is a waste of power IMHO <1> It doesn't reboot that quickly <4> since it only need to be run 50 times a month on one variable day <7> "This program will need to close unexpectedly" <5> google? Windows? I don't think that terminology is compatible :) <1> lol <1> hey Jymmm <9> Hi Dangermouse <1> Hows you? <9> not bad <6> Wolfpaws, if i'm reading this correctly, global just gives the ability to manipulate the global vars declared outside a function, from within a function...I need to create a variable with one function, and use it in another. that's not global is it? <5> yes it is <9> !+globals <10> [GLOBALS] There is $GLOBALS --> http://php.net/manual/en/reserved.variables.php#reserved.variables.globals or you might have meant Register Globals --> http://php.net/manual/en/security.globals.php <8> thedan: I really wouldn't worry about it running too often <8> thedan: set it to run once a day in cron if you really care <11> I just downloaded phpShell, and I'm trying to use the phpHash that came with it, but when I load it in my browser, I just get a lot of stuff that makes no sense.. Code kinda stuff <4> Xyphoid: Yeah, but it needs to run the script 50 or so times--each time would send out one batch of emails. <5> !+g10 <10> Guideline #10) We don't support script(s). We help you *write* PHP, not recommend or download and install/hack/modify/adapt/use pre-written scripts <8> What I do is have the cron script just pick one batch to do <3> where is sha512? <12> I am using function __construct() in a cl*** to include a file like general.inc. Now, later on in the code within the same cl***, I have general::somefunct(); ... and, it calls somefunct() within the general cl***, but I have $this->somefuncingeneral() ... in the somefunct(). Instead of $this being within the $general, the error looks like $this is being replaced with the cl*** that has the __construct function. Does this make sense? Any ideas? <6> Wolfpaws, ok, well I must just be simple...because I'm not finding any help on the variable scope page...thanks anyway <8> then if you have 50 batches inserted at once they'll be started staggered over some time <7> Does exec() run command line? <5> uyes <3> how can i use a parent cl***es constructor when i initialize a child cl***? <5> um... 'exec' executes a command tpo be exact <3> cl*** child extends parent { ..i want to use parent constructor on instantiation } <7> eg: exec(locate "$search_item"); <7> or something of the such would work? <5> yes <7> Sounds dangerous :O <8> foo: by doing $cl***::fn() you're calling that method staticly. within a static method, $this makes no sense. <4> Xyphoid: this would be a lot easier if i could have cron trigger another cron :) <8> if you want to use the instance you're calling from, do $cl***::fn($this) and p*** that instance to the static method
<11> Is anyone able to help me with my problem? <5> Thomaz: Not if you know how to use it... <8> thedan: do they all need to start at the same time? <5> Jalain: I said this isn't 3rd party support channel... Go ask elsewhere. <7> exec() twice if I had two things to execute? <12> Xyphoid: hmm... I'm confused. Is there a page that talks about cl***es indepth? Specifically, how to call functions from a cl*** within a different cl***? <5> Thomaz: RTFM <7> Okay <8> um, $instance->function() or cl***name::staticfunction() <4> Xyphoid: Well, yeah. The way the system works is I have a queue table with `news_id` and `index`.. then the script does something like "limit $index,120" to grab subscribers. so this would need to run relatively close to eachother <8> when i said $cl***::fn($this) I was talking crap by the way <3> Xyphoid, if i'm instantiating a child cl***, can I p*** values to the parent constructor? <8> if you're running from cron you should be able to do the whole batch in one go surely? <3> like $child = new child($values_for_parent_constructor); <4> Xyphoid: wouldnt the script timeout? <8> not from cron <4> d'oh <6> so i have to do global $fulltext; outside all functions, and again inside each function in which I want to use that variabe? <4> i thought that the execution time limit applied to everything <8> the CLI version doesn't timeout by default - it's the main reason I use it <8> melbell: p*** the variable to the function. <13> anyone want to help me figure out why this login script isnt working, i took it from a tutorial but it when i try and login, it doesnt login me in, it says invalid username/p***word, heres the code http://www.thelucasnetwork.com/login2/ <6> Xyphoid, like function_name($variable) ? <4> Xyphoid: thank you for saving a ton of my time :) if that works my life will be easier <8> tek: you should be able to do parent::__construct($arg) within the child constructor <8> thedan: I've been down exactly the path you're doing, heh <3> okay <3> thanks <8> what I do is have a batch table with a creation timestamp and a started timestamp. the creation timestamp is set to the web script's time when the batch is finished setting up. <8> the cron script looks for a batch record with creation timestamp set and started timestamp of null. <8> it then does $timestamp = x; update batchrecord set started_timestamp = timestamp where id = X and started_timestamp is null <12> Xyphoid: Do you see what I am saying? <4> Xyphoid: Ah, mine is even simpler--I just delete the batch's row when it's finished running. The timestamp idea would have been better though <8> and then checks started_timestamp is x. if not, some other cron instance grabbed that row <3> $a = new authorized(parent::__constructor($_SESSION, $_GET, $_POST)); that work? <8> so you never end up running it twice <8> foo: nope, are you trying to /msg me? <12> Xyphoid: uh, no. Hm <12> Xyphoid: Alright, say I have cl*** a and cl*** b. Within cl*** b, how can I call a function from cl*** a? <8> do you have an instance of cl*** a? <3> Xyphoid, yes <14> hey, howcome if i put <font> and </font> before and after a table it wont effect the text in that table? <8> $instance->function($args); <14> and what do i need to do change the text in a table? <12> Xyphoid: Within the cl***? Hmm. How do I create that instance? $instance = new cl***(); ? <12> Xyphoid: where cl*** is the name of the cl***.. <8> yes. <12> Xyphoid: I can do that within cl*** b? So, cl*** b { $instance = new cl***a(); function somefunc() { $instance->funct(); } ... ? <8> cl*** b { private $instance = new cl***a(); quite possibly <12> Xyphoid: hmm, ok. <8> unfortunately http://nz.php.net/manual/en/language.oop5.basic.php is totally appallingly laid out <13> anyone want to help me figure out why i cant login with my program? http://www.thelucasnetwork.com/login2/login.html <13> username is username and p***word is p***word <13> the code is at http://www.thelucasnetwork.com/login2/ <15> SinnerG: No, but you can get a +e <16> heh <15> CLucas916_x64: You realize that we can't view the code of a .php file, right? <13> TML, go here http://www.thelucasnetwork.com/login2/ all the code is in there <5> TML: You could devoice him in the same p*** :) <15> CLucas916_x64: No, it's not. <15> CLucas916_x64: Go there in a browser and try to view the code. <15> Wolfpaws: He's voiced? <5> TML: Yes. <13> TML, ok sorry i ment the files are in there, just view in notepad <15> CLucas916_x64: We can't download the files! <15> Think about it for a second, please <5> TML: Maybe the server has the same bug as IIS4 :) <15> Wolfpaws: Who voiced him? <5> I did. <15> *smack* <15> +e <15> Not +v <5> ok... I'll know for the next time <15> =)
Return to
#php or Go to some related
logs:
alsa surround dapper suse can not open the file /proc/bus/usb yast Couldnt get a file descriptor referring to the console renice an app #linux CLOSE_WAIT embperl #suse install rtorrent on suse netcabo nmap slow bad number of buttons
|
|