Search Results

Search found 5 results on 1 pages for 'hosh'.

Page 1/1 | 1 

  • Apache VirtualHosts define php.ini but extend main php.ini

    - by Hosh Sadiq
    I have a main php.ini file and am wondering if it is possible to specify a custom php.ini for a virtualhost, but this php.ini would extend the main php.ini file, so that only the specified settings are overridden and everything else is taken the main php.ini. For example: I have my main php.ini file in /etc/php5/php.ini, containing all the defaults. Let's say this has everything as default so e.g. allow_url_fopen = On allow_url_include = Off Then I have my virtualhost located at /home/user/php.ini and this contains the following: allow_url_fopen = Off This php would run with first the php.ini in /etc/php5/php.ini then the settings that are in /home/user/php.ini resulting in a configuration where both allow_url_fopen and allow_url_include are set to Off. Edit: Also, if /home/user/php.ini does not exist, it would default back to /etc/php5/php.ini

    Read the article

  • Closest Ruby representation of a 'private static final' and 'public static final' class variable in

    - by Hosh
    Given the Java code below, what's the closest you could represent these two static final variables in a Ruby class? And, is it possible in Ruby to distinguish between private static and public static variables as there is in Java? public class DeviceController { ... private static final Device myPrivateDevice = Device.getDevice("mydevice"); public static final Device myPublicDevice = Device.getDevice("mydevice"); ... public static void main(String args[]) { ... } }

    Read the article

  • What does a Java static method look like in Ruby?

    - by Hosh
    In Java, a 'static method' would look like this: class MyUtils { . . . public static double mean(int[] p) { int sum = 0; // sum of all the elements for (int i=0; i<p.length; i++) { sum += p[i]; } return ((double)sum) / p.length; } . . . } // Called from outside the MyUtils class. double meanAttendance = MyUtils.mean(attendance); What's the equivalent 'Ruby way' of writing a 'static method'?

    Read the article

1