Welcome Guest, Not a member yet? Register   Sign In
[Updated!] Cpanel library (Supports email & Cron)
#11

[eluser]Phil Sturgeon[/eluser]
Figured I would show you what I meant:

http://pastie.org/720149

It uses a private function to keep all of the request login in the same place, and uses arrays to build the request string which makes it much easier to build and neater too.
#12

[eluser]PromaneX[/eluser]
[quote author="Phil Sturgeon" date="1259605804"]Figured I would show you what I meant:

http://pastie.org/720149

It uses a private function to keep all of the request login in the same place, and uses arrays to build the request string which makes it much easier to build and neater too.[/quote]

I see what you mean, that is much cleaner Smile
#13

[eluser]Phil Sturgeon[/eluser]
Glad you like it. By wrapping all your requests in _fetch() you could at a later date switch to cURL or even support them both, just by updating one method instead of rewriting the whole damn thing.

I'll be keeping an eye on this one, cheers! :-)
#14

[eluser]PromaneX[/eluser]
Thanks to Phil the code has now been made cleaner and is able to use curl if it is available on the server. This is taken care of in the background by the class so it will use curl or file_get_contents depending on what is available, when using curl, it will make a secure connection over https.

new code is here: http://pastie.org/721605

Thanks Phil for your help with this - I added your function to the code and expanded it to include the curl functionality
#15

[eluser]Unknown[/eluser]
I'm kind of new bie for CI. Can you show me how to use this cpanel thing in the new version of CI?




Theme © iAndrew 2016 - Forum software by © MyBB