[dev] Web accessible git folder on OS X

Michael J Rubinsky mrubinsk at horde.org
Wed Aug 8 15:57:24 UTC 2012


Quoting Luis Felipe Marzagao <lfbm.andamentos at gmail.com>:

> Em 07/08/2012 22:09, Michael J Rubinsky escreveu:
>>
>> Quoting Luis Felipe Marzagao <lfbm.andamentos at gmail.com>:
>>
>>> Em 05/08/2012, às 14:41, Michael J Rubinsky escreveu:
>>>
>>>>
>>>> Quoting Luis Felipe Marzagao <lfbm.andamentos at gmail.com>:
>>>>
>>>>> Em 31/07/2012, às 16:08, Vilius ?umskas <vilius at lnk.lt> escreveu:
>>>>>
>>>>>> Luis Felipe Marzagao <lfbm.andamentos at gmail.com> ra??:
>>>>>>
>>>>>>> Hello:
>>>>>>>
>>>>>>> Probably a non-horde question, but I would like to hear from  
>>>>>>> others if possible.
>>>>>>>
>>>>>>> Is it just me or is it extremely difficult to run a horde web  
>>>>>>> accessible git tree in Mac OS X?
>>>>>>>
>>>>>>> After several tries with MAMP and having a lot of trouble with  
>>>>>>> pear, I decided to use native php+pear that comes with OS X  
>>>>>>> (snow leopard).
>>>>>>>
>>>>>>> After hours configuring it all and being able to successfully  
>>>>>>> run web apps such as phpMyAdmin, I followed instructions from  
>>>>>>> here  
>>>>>>> (http://www.horde.org/development/git#making-development-repos-web-accessible) and horde test.php page gave an error msg about not finding textdomain() function in  
>>>>>>> Registry.php.
>>>>>>>
>>>>>>> God! In Ubuntu, CentOS and alikes its so easy to get it working.
>>>>>>>
>>>>>>> What am I missing? Why is it so hard in OS X? Any tips or advices?
>>>>>>
>>>>>> And one more thing: textdomain() is a gettext function, so it  
>>>>>> would be a good idea to check if native PHP on Mac OS X has  
>>>>>> gettext support.
>>>>>>
>>>>>
>>>>> Okay, after installing macports things were much easier.  
>>>>> Enabling gettext support was easy as 'sudo por install  
>>>>> php5-gettext', and now horde test page loads.
>>>>>
>>>>> But I'm still facing an issue I couldn't solve.
>>>>>
>>>>> Horde test.php page says I have PEAR and the php's include_path  
>>>>> shows the correct pear path in the list:
>>>>>
>>>>> PEAR Search Path (PHP's include_path):  
>>>>> /Users/duli/git/horde/horde/lib:/Users/duli/Sites/horde/libs:/Users/duli/git/horde/horde/lib:.:/opt/local/lib/php
>>>>> PEAR: Yes
>>>>> The pear packages are inside /opt/local/lib/php:
>>>>>
>>>>> MacBook:~ duli$ pear config-show | grep php_dir
>>>>> PEAR directory                 php_dir /opt/local/lib/php
>>>>>
>>>>> But for some reason horde still says I don't have pear packages,  
>>>>> although they are installed:
>>>>>
>>>>> Crypt_Blowfish: No
>>>>> Crypt_Blowfish is required to store authentication credentials  
>>>>> securely within the session data. THIS IS A REQUIRED MODULE!
>>>>>
>>>>> MacBook:~ duli$ pear list
>>>>> Installed packages, channel pear.php.net:
>>>>> =========================================
>>>>> Package          Version State
>>>>> Archive_Tar      1.3.7   stable
>>>>> Auth_SASL        1.0.6   stable
>>>>> Cache            1.5.6   stable
>>>>> Console_Color    1.0.3   stable
>>>>> Console_Getopt   1.3.0   stable
>>>>> Console_Table    1.1.4   stable
>>>>> Crypt_Blowfish   1.0.1   stable
>>>>> DB               1.7.14  stable
>>>>> File_Find        1.3.1   stable
>>>>> HTTP_Request     1.4.4   stable
>>>>> MDB2             2.4.1   stable
>>>>> Net_DNS2         1.2.1   stable
>>>>> Net_IMAP         1.1.1   stable
>>>>> Net_SMTP         1.6.1   stable
>>>>> Net_Socket       1.0.10  stable
>>>>> Net_URL          1.0.15  stable
>>>>> PEAR             1.9.4   stable
>>>>> Services_Weather 1.4.6   stable
>>>>> Structures_Graph 1.0.4   stable
>>>>> Text_Figlet      1.0.2   stable
>>>>> XML_SVG          1.1.0   stable
>>>>> XML_Util         1.2.1   stable
>>>>>
>>>>> The strange thing is if I install horde by the normal pear  
>>>>> method, the resulting test page recognizes pear packages just  
>>>>> fine. It's just the git web accessible method that fails.
>>>>>
>>>>> How can I debug this? Any pointers are really appreciated.
>>>>>
>>>>
>>>> Check to make sure that there isn't a local .pearrc file being  
>>>> loaded that you are not expecting to be loaded.
>>>
>>> Hello, Mike. Thanks for answering.
>>>
>>> I have discovered the issue. Include path and Autoload  
>>> functionalities are all working just fine, just as pear config  
>>> files.
>>>
>>> The problem lies in Autoloader_Cache.  When you have no other  
>>> cache system enabled (apc, xcache etc.), horde creates a temp file  
>>> in /private/var/tmp with all the class names and paths found in  
>>> include_path variable. This file just stays there in filesystem  
>>> for future reference.
>>>
>>> So, if you run horde test page *before* you install necessary pear  
>>> modules, the cache for class names will be stored with no paths as  
>>> values (they will be null, since pear modules do not exist yet).  
>>> Since this temp file is not recreated, then even *after* you  
>>> install pear modules, horde will still think there are no pear  
>>> modules installed, because it will check the cache temp file, and,  
>>> thus, it will report and act as you were missing those pear  
>>> modules, making the whole system fail.
>>>
>>> But If you install pear modules *before* running horde test page  
>>> for the first time (and, therefore, before the temp cache file is  
>>> created), then correct paths for necessary classes will be created  
>>> just fine and everything will work.
>>>
>>> This is why things work when you install horde via pear. The  
>>> dependencies are installed automatically while you install horde  
>>> and when you run the horde test page for the first time, pear  
>>> modules will already be there and will be cached just fine.
>>>
>>> But if you want to work with git tree, you could run into the  
>>> situation where you run horde test page *before* you install pear  
>>> modules and then the issue happens.
>>>
>>> To make things harder, in OS X the cache temp file is not erased,  
>>> even after a computer restart. So you keep wondering what in hell  
>>> is wrong with your system, because no matter what you do with pear  
>>> modules, horde will keep telling you they are not present, until  
>>> you manually delete the cache temp file. In Linux, the file goes  
>>> away when you restart the computer, which is why I was thinking  
>>> the problem was within OS X.
>>>
>>> It appears to me horde should have a mechanism to delete the cache  
>>> temp file when it's needed or, at least, advise the admin the temp  
>>> file should be erased if pear modules are not being correctly  
>>> detected.
>>>
>>> Do you think it's the case of opening a bug report?
>>
>> There are already instructions about pruning the cache in docs/PERFORMANCE
>>
> Oh, I whish I had seen that earlier. Very clear there.
>
> If I may suggest, since it´s such a vital proceeding affecting early  
> stage of horde install (test script), and not just a performance  
> matter, I think it´s worth making a reference to docs/PERFORMANCE ->  
> Horde tuning -> Autoloading around line 291 of docs/INSTALL  
> (Required PEAR modules).

No, because INSTALL is directed towards people installing from PEAR,  
and the PEAR install does not include the Autoloader Cache by default  
- it has to be explicitly installed.

  If things are going wrong in the very beginning (test
> script), it´s more likely the admin will look for an answer in  
> install doc. And for those who are not familiar with horde  
> internals, it´s not obvious how to solve it.

The assumption is that people using git *are* familiar with Horde  
internals. However, a note on http://www.horde.org/development/git is  
probably in order.


-- 
mike

The Horde Project (www.horde.org)
mrubinsk at horde.org



More information about the dev mailing list