Changeset 7387


Ignore:
Timestamp:
Oct 25, 2010, 11:36:08 AM (10 years ago)
Author:
grum
Message:

Fix bugs

Location:
extensions/GrumPluginClasses
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/GrumPluginClasses/classes/GPCCore.class.inc.php

    r7310 r7387  
    2929|         |            |
    3030|         |            | * implement the getPiwigoSystemPath function
     31|         |            |
     32|         |            | * implement the rmDir function
    3133|         |            |
    3234|         |            |
     
    4850    - static function getPiwigoSystemPath
    4951    - static function formatOctet
     52    - static function rmDir
    5053   ---------------------------------------------------------------------- */
    5154
     
    7679        Array('name' => "CommonPlugin", 'version' => "2.2.0"),
    7780        Array('name' => "GPCAjax", 'version' => "3.0.0"),
    78         Array('name' => "GPCCore", 'version' => "1.2.0"),
     81        Array('name' => "GPCCore", 'version' => "1.3.1"),
    7982        Array('name' => "GPCCss", 'version' => "3.0.0"),
    8083        Array('name' => "GPCPagesNavigations", 'version' => "2.0.0"),
     
    8285        Array('name' => "GPCRequestBuilder", 'version' => "1.1.0"),
    8386        Array('name' => "GPCTables", 'version' => "1.5.0"),
    84         Array('name' => "GPCTabSheet", 'version' => "1.1.0"),
     87        Array('name' => "GPCTabSheet", 'version' => "1.1.1"),
    8588        Array('name' => "GPCTranslate", 'version' => "2.1.0"),
    8689        Array('name' => "GPCUsersGroups", 'version' => "2.0.0"),
     
    393396  }
    394397
     398
     399  /**
     400   * remove a path recursively
     401   *
     402   * @param String $directory : directory to remove
     403   * @param Bool $removePath : if set to true, remove the path himself, if set
     404   *                           to false, remove only file & sub-directories
     405   * @return Bool : true if directory was succesfully removed, otherwise false
     406   */
     407  static public function rmDir($directory, $removePath=true)
     408  {
     409    $directory=rtrim($directory, '\/').'/';
     410    $returned=true;
     411    if(file_exists($directory) and is_dir($directory) and $directory!='./' and $directory!='../')
     412    {
     413      $dhandle=scandir($directory);
     414      foreach($dhandle as $file)
     415      {
     416        if($file!='.' and $file!='..' )
     417        {
     418          if(is_dir($directory.$file))
     419          {
     420            $returned=self::rmDir($directory.$file, true) & $returned;
     421          }
     422          else
     423          {
     424            $returned=unlink($directory.$file) & $returned;
     425          }
     426        }
     427      }
     428      if($returned and $removePath) $returned=rmdir($directory);
     429    }
     430    return($returned);
     431  }
     432
     433
    395434  /**
    396435   * returns the piwigo system path
  • extensions/GrumPluginClasses/classes/GPCRequestBuilder.class.inc.php

    r7370 r7387  
    8181
    8282  --------------------------------------------------------------------------- */
     83
     84if(!defined('GPC_DIR')) define('GPC_DIR' , basename(basename(dirname(__FILE__))));
     85if(!defined('GPC_PATH')) define('GPC_PATH' , PHPWG_PLUGINS_PATH . GPC_DIR . '/');
    8386
    8487include_once('GPCTables.class.inc.php');
  • extensions/GrumPluginClasses/maintain.inc.php

    r6975 r7387  
    22
    33if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); }
     4
     5if(!defined('GPC_DIR')) define('GPC_DIR' , basename(dirname(__FILE__)));
     6if(!defined('GPC_PATH')) define('GPC_PATH' , PHPWG_PLUGINS_PATH . GPC_DIR . '/');
     7
    48
    59// ini_set('error_reporting', E_ALL);
Note: See TracChangeset for help on using the changeset viewer.