Optimization of set_time_limit() call #36

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@ziege

When the "set_time_limit()" function is disabled, the call of this function creates an error like this: "set_time_limit() has been disabled for security reasons"

This function is often disabled by hosters who offer shared hosting, also some current PAAS hosters, like PHPFog/AppFog (see http://docs.phpfog.com/faqs/#sharedvdedicated).

I added a check of the 'disable_functions' configuration setting before the call.

@ziege ziege Optimization of set_time_limit() call
When the "set_time_limit()" function is disabled, the call of this function creates an error like this: "set_time_limit() has been disabled for security reasons"

This function is often disabled by hosters who offer shared hosting, also some current PAAS hosters, like PHPFog/AppFog (see http://docs.phpfog.com/faqs/#sharedvdedicated).

I added a check of the 'disable_functions' configuration setting before the call.
800f6e2
@jeremeamia

Thanks for letting us know about this. That seems like a reasonable fix. I'll see what we can do to integrate this soon. Are you aware of any other functions that are in the disable_functions list for PHP/AppFog?

Note to self: double-check for other occurrences of set_time_limit() in the SDK.

@ziege

Here are two lists of the disabled functions of PAAS providers:

PHPFog (http://docs.phpfog.com/faqs/#sharedvdedicated):

  • escapeshellarg, escapeshellcmd
  • exec, passthru, pcntl_exec, shell_exec, system
  • proc_close, proc_get_status, proc_open, proc_nice, proc_terminate
  • popen, pclose
  • file_get_contents (for remote URLS)
  • fopen (for remote URLS)
  • dl
  • disk_free_space, diskfreespace, disk_total_space
  • set_time_limit, ini_restore
  • tmpfile
  • openlog
  • show_source, highlight_file
  • link, symlink
  • php_uname
  • apache_child_terminate, apache_get_modules, apache_get_version, apache_getenv, apache_note, apache_setenv
  • posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid, posix_getpwuid, posix_uname

CloudControl (http://phpinfo.cloudcontrolled.com/):

  • escapeshellarg, escapeshellcmd
  • system, exec, passthru, shell_exec
  • proc_open, proc_nice
  • file_open_base
  • pcntl_fork, pcntl_exec,
  • popen, proc_open
  • disk_free_space, diskfreespace, disk_total_space
  • syslog
  • posix_getpwnam
  • pfsockopen, stream_socket_server
@jeremeamia

Awesome, thanks for looking into that!

@jeremeamia

This has been fixed in our development copy and will be included in the next update to the SDK. Thanks again! Since we don't accept pull requests directly, I will close this pull request and add you to our CONTRIBUTORS docs.

@jeremeamia jeremeamia closed this Sep 24, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment