[PHP] Rest

2012-10-27 Thread Adam Tong
Hi,

I need to develop a rest API.I want your feedback on how you develop
rest apis. I don't want to use a heavy framework just for that, and I
find url rewriting time consuming.

Any suggestions?

Thank you

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] fopen and load balancing

2013-02-10 Thread Adam Tong
Hi,

We had an issue with the code of a junior php developer that used
fopen to load images using the url of the companies website that is
load balanced.

We could not the detect the problem in dev and test because the dev
and test servers are not load balanced.

I know that he could load the images using just the filesystem, but I
am curious to know why it failed and if the load balancer is really
the source of the problem or it is a limitation on the function
itself.

Thank you

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] fopen and load balancing

2013-02-11 Thread Adam Tong
I think this is what happened. As the application was trying to open
our url domain the request was sent to the load balancer, and as it
does not accept internal requests, the connection was timed out.

The only way we could avoid that is to not use fopen our url, is that right?


On Mon, Feb 11, 2013 at 4:26 AM, ma...@behnke.biz  wrote:
>
>
> Adam Tong  hat am 10. Februar 2013 um 23:41 geschrieben:
>> Hi,
>>
>> We had an issue with the code of a junior php developer that used
>> fopen to load images using the url of the companies website that is
>> load balanced.
>>
>> We could not the detect the problem in dev and test because the dev
>> and test servers are not load balanced.
>>
>> I know that he could load the images using just the filesystem, but I
>> am curious to know why it failed and if the load balancer is really
>> the source of the problem or it is a limitation on the function
>> itself.
>
> Do you have any error messages for us?
> If the load balancer accessable from the internal servers? Normally it is not.
>
>
>>
>> Thank you
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
> --
> Marco Behnke
> Dipl. Informatiker (FH), SAE Audio Engineer Diploma
> Zend Certified Engineer PHP 5.3
>
> Tel.: 0174 / 9722336
> e-Mail: ma...@behnke.biz
>
> Softwaretechnik Behnke
> Heinrich-Heine-Str. 7D
> 21218 Seevetal
>
> http://www.behnke.biz
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Best authentication system

2011-06-04 Thread Adam Tong
Hi,

I'm running a site for which I need an authentication system. I have
already my own (that is too simplistic and not very secure).
I want some advice here. I checked PEAR, but as there are several
options there, I was not sure which one to choose. Here are my needs:

- Some sections of the site cannot be accessed if the user does not
have an account (at least login and password)
- There are 2 type of users at this moment, depending on that type,
the user can access some sections and not the others (the ones allowed
for the other type). Maybe in the future there will be more types of
users.

Thank you

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Help needed with php.ini

2011-06-05 Thread Adam Tong
Hi,

I can't set correctly the error display and reporting properties. I
don't know what i'm doing wrong.

Here is the section that i modified in php.ini:
-
 display_errors = On
;   Default Value: On
;   Development Value: On
;   Production Value: Off

 display_startup_errors = On
;   Default Value: Off
;   Development Value: On
;   Production Value: Off

 error_reporting = E_ALL | E_STRICT
;   Default Value: E_ALL & ~E_NOTICE
;   Development Value: E_ALL | E_STRICT
;   Production Value: E_ALL & ~E_DEPRECATED


And here is the output of phpinfo():
-
display_errors  Off Off
display_startup_errors  Off Off
doc_rootno valueno value
docref_ext  no valueno value
docref_root no valueno value
enable_dl   Off Off
error_append_string no valueno value
error_log   no valueno value
error_prepend_stringno valueno value
error_reporting 22527   22527
-

I'm using a default installation (using yum) of php on Fedora14. This
is my development environment, and want to see all the errors on
standard output.

Thank you

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Can't use class "'DOMDocument"

2011-06-06 Thread Adam Tong
Hi,

When I try using DOMDocument I get the following error:
Fatal error: Class 'DOMDocument' not found in ...

I guess something has to be fixed in my php.ini?

Here is my php version:
# php -version
PHP 5.3.6 (cli) (built: Mar 17 2011 20:58:15)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies

I also noticed when I click reply in gmail it does not reply to the
list. Sorry for that inconvenience for poeple who tried to help me
while the previous issue was already resolved.

Thank you

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Can't use class "'DOMDocument"

2011-06-08 Thread Adam Tong
Hi,

You're right. I just installed the package php-xml, and everything is
working properly now.

Is there anyway to know for each class or function which is the package needed?

thank you

On Tue, Jun 7, 2011 at 3:48 AM,   wrote:
> Did you install the php-xml ?
>
> Richard L. Buskirk
>
> -Original Message-----
> From: Adam Tong [mailto:adam.to...@gmail.com]
> Sent: Monday, June 06, 2011 9:49 PM
> To: php-general@lists.php.net
> Subject: [PHP] Can't use class "'DOMDocument"
>
> Hi,
>
> When I try using DOMDocument I get the following error:
> Fatal error: Class 'DOMDocument' not found in ...
>
> I guess something has to be fixed in my php.ini?
>
> Here is my php version:
> # php -version
> PHP 5.3.6 (cli) (built: Mar 17 2011 20:58:15)
> Copyright (c) 1997-2011 The PHP Group
> Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
>
> I also noticed when I click reply in gmail it does not reply to the
> list. Sorry for that inconvenience for poeple who tried to help me
> while the previous issue was already resolved.
>
> Thank you
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Php filter validate url

2011-06-26 Thread Adam Tong
Hi,

I wanted tu use php filters for validation to avoid regular expresions.
Is it possible that FILTER_VALIDATE_URL only checks if the string has
http:// and do not check for the format domain.something?

$url = 'http://wwwtestcom';
$url = filter_var($url,FILTER_VALIDATE_URL);
echo $url;
-

Or I am doing something wrong

Thank you

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] php://input

2012-01-14 Thread Adam Tong
Hi,

I am trying to read variables from input method.
I am using this tuorial:
http://www.lornajane.net/posts/2008/Accessing-Incoming-PUT-Data-from-PHP.
Here is my code:


I am using the firefox extension  "poster" to run this example. GET
works fine but when using PUT, file_get_contents("php://input")
returns an empty string.

I found a bug related to this: https://bugs.php.net/bug.php?id=51592

I am using xampp on win7 (
+ Apache 2.2.17
  + MySQL 5.5.8 (Community Server)
  + PHP 5.3.5 (VC6 X86 32bit) + PEAR)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php