patchphpGroupWare - Patches: patch #5733, Ugly patch for lang.php to prevent...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #5733: Ugly patch for lang.php to prevent it crashing when shmop features are not enabled in php

Submitter:  Pascal Vilarem <maat>
Submitted:  Fri 09 Feb 2007 09:33:12 PM UTC
   
 
Category:  API - Setup Priority:  5 - Normal
Item Group:  SVN trunk (dev code) Status:  Done
Privacy:  Public Assigned to:  sigurdne
Open/Closed:  Closed

Sun 04 Mar 2007 03:55:59 PM UTC, comment #1: 

committed

Sigurd Nes <sigurdne>
Group Member
Fri 09 Feb 2007 09:33:12 PM UTC, original submission:  

In fact i think a good way to prevent this would be to make these checks in shm class constructor shm() and then use something like : if ( $GLOBALS['phpgw']->shm->enabled ) { blah blah...

But this would be rather heavy to do... so i submit this tiny patch allowing setup to go on even if shmop is not available.

Notice : If shmop is not available the code crashes silently in class.shm.inc.php because of the @ before shmod_open line 217 : if(!$id = @shmop_open($key, "a", 0644, 100))

here is the patch :

Index: lang.php
===================================================================
RCS file: /sources/phpgroupware/setup/lang.php,v
retrieving revision 1.56
diff -u -r1.56 lang.php
--- lang.php 2 Nov 2006 09:56:58 -0000 1.56
+++ lang.php 9 Feb 2007 21:17:18 -0000
@@ -89,7 +89,7 @@
  foreach($lang_selected as $lang)
  {
  echo '<br />Working on: ' . $lang;
- if(function_exists('sem_get'))
+ if(function_exists('sem_get') && function_exists('shmop_open') )
  {
  $GLOBALS['phpgw']->shm->delete_key('lang_' . $lang);
  }

Pascal Vilarem <maat>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by sigurdne (Posted a comment)
  • -email is unavailable- added by Caeies (Updated the item)
  • -email is unavailable- added by maat (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-03-04 sigurdne StatusNone Done
        Open/ClosedOpen Closed
    2007-03-04 Caeies Assigned toNone sigurdne
    2007-02-09 maat Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code