Carabiner 1.4: Asset Management Library |
[eluser]tonydewan[/eluser]
@K.Brown Awesome! I'm glad you like it and that it's working for you. Quick question: was it a server configuration issue, or something else?
[eluser]K.Brown[/eluser]
I really have no idea. It must have been a config prob--I'm a noob... Is it common for servers to disable URL file-access?
[eluser]K.Brown[/eluser]
Shoot, I lied. It's loading jquery...but any of my custom scripts won't load. I've tried using the display operator and the js operator in both my controller and HTML <head>... I'm terribly frustrated.
[eluser]tonydewan[/eluser]
What is your log level set at? If you set it high (3 or 4), you should get a fairly good idea of what the problem might be. Feel free to paste the logs from a request, and I can take a look. You can message me directly, if you'd like.
[eluser]Devon Lambert[/eluser]
Hey Tony, I actually have a question that ties to Carabiner that you may or may not be able to answer. I currently make use of Coda for an IDE. If you're familiar with Coda it allows for easy publishing of new files to a live/production site. I was wondering if you know of some way via Codeigniter or otherwise that I can set a switch which is automatically flipped when the Carabiner file hits the live site? That way we would not have to change the BOOLEAN flag within Carabiner's setup file that states whether we are in a DEV environment or a Prod environment. More like a nice to have rather than a requirement.... Ohhh yeah and again, Carabiner is the shizzle! :-)
[eluser]tonydewan[/eluser]
@dnyce Off the top of my head, I'm thinking you could do something like this: Code: $dev = ($_SERVER['SERVER_NAME'] == 'localhost') ? TRUE : FALSE; In my case (local MAMP install on OSX), the $_SERVER['SERVER_NAME'] var returns 'localhost'. From what I can tell, that should be pretty standard value if your developing locally, but I can't say for sure. If that particular server var isn't set, I would check some of the others. If that syntax looks weird, check out the php.net page on the ternary operator. But, all I'm doing is setting a variable to true or false based on the value of $_SERVER['SERVER_NAME']. You'd obviously still need to pass that value into the config method for Carabiner. I hope that helps.
[eluser]Devon Lambert[/eluser]
Great! I'll try that out. I have the exact same setup so I believe it should work like a charm.
[eluser]polyvoid[/eluser]
Hi Tony, I'm trying out your library as well, and I'm experiencing the same issues as k.brown: "URL file-access is disabled in the server configuration" -> this is because my host disabled the allow_url_fopen parameter for security reasons. Each time you use the 'file_get_contents' function for files on other domains (eg. jQuery from the google repository) Apperently there's a workaround for this using "curl" but I'm unable to get it working. When I change $config['dev'] to FALSE, it's working, but when it's set to TRUE it's not. I think this is because the files aren't combined and minified then... Could you please look into this? THANKS!
[eluser]ainstushar[/eluser]
Hi there, I am not Tony, but I can probably help. http://tutorials.securesignup.net/index....p-settings You can use .htaccess file to change the php settings. so it would be Code: php_value allow_url_fopen On or you can set those values inside the PHP file Code: ini_set('allow_url_fopen', 1); Code: ini_set('allow_url_fopen', 'On'); ^ Not sure which one works. Hope that helps, ainstushar.
[eluser]polyvoid[/eluser]
Hi ainstushar, I've tried your 3 suggestions but I had no luck... I've looking a bit further into this and so far I changed this: line 822: $file_data .= file_get_contents( $r ) ."\n"; is now this: $ch = curl_init(); $timeout = 5; curl_setopt ($ch, CURLOPT_URL, $r); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $file_data = curl_exec($ch); curl_close($ch); log_message('debug', 'TEST line 822: '.$r); and line 851: $contents = file_get_contents( $ref ); is now this: $ch = curl_init(); $timeout = 5; curl_setopt ($ch, CURLOPT_URL, $ref); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $contents = curl_exec($ch); curl_close($ch); log_message('debug', 'TEST line 851: '.$ref); This now works with files coming from another domain, but it no longer works with local files. Is someone more familiar with the curl function, and sees what I'm doing wrong? Thanks in advance for your help! -- edit -- After thinking more over this, I think the better solution is to build in an IF-statement, and use the curl function only when the requested file is an URL. If it isn't, it should come from the file system (unnecessary http-request is avoided as well) with the file_get_contents function. I'll look into this a bit further tomorrow if I find some time. OR if you find it sooner, or have another solution, don't hold back ;-) |
Welcome Guest, Not a member yet? Register Sign In |