zendframework / zend-permissions-acl

BSD 3-Clause "New" or "Revised" License
60 stars 23 forks source link

getallheaders on nginx backed by php7-fpm compatibility issues #17

Closed g-alfieri closed 8 years ago

g-alfieri commented 8 years ago

Ubuntu 16.04 Xenial with php7-fpm and nginx presents compatibility issues with ACL roles management. In particular I'm running magento 1.9 and roles are not being recognized I think because of my custom implementation of getallheaders.

g-alfieri commented 8 years ago
if (!function_exists('getallheaders'))
{
    function getallheaders()
    {
           $headers = '';
       foreach ($_SERVER as $name => $value)
       {
           if (substr($name, 0, 5) == 'HTTP_')
           {
               $headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value;
           }
       }
       return $headers;
    }
}

if (!function_exists('apache_request_headers')) {
        function apache_request_headers() {
            foreach($_SERVER as $key=>$value) {
                if (substr($key,0,5)=="HTTP_") {
                    $key=str_replace(" ","-",ucwords(strtolower(str_replace("_"," ",substr($key,5)))));
                    $out[$key]=$value;
                }else{
                    $out[$key]=$value;
        }
            }
            return $out;
        }
} 
Ocramius commented 8 years ago

Unrelated with zendframework/zend-permissions-acl - you probably meant to report this as a PHP bug?

Closing here.