phpPoA2
[ class tree: phpPoA2 ] [ index: phpPoA2 ] [ all elements ]

Source for file invite_convert.php

Documentation is available at invite_convert.php

  1. <?php
  2. /**
  3.  * @copyright Copyright 2005-2010 RedIRIS, http://www.rediris.es/
  4.  *
  5.  *  This file is part of phpPoA2.
  6.  *
  7.  *  phpPoA2 is free software: you can redistribute it and/or modify
  8.  *  it under the terms of the GNU General Public License as published by
  9.  *  the Free Software Foundation, either version 3 of the License, or
  10.  *  (at your option) any later version.
  11.  *
  12.  *  phpPoA2 is distributed in the hope that it will be useful,
  13.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.  *  GNU General Public License for more details.
  16.  *
  17.  *  You should have received a copy of the GNU General Public License
  18.  *  along with phpPoA2. If not, see <http://www.gnu.org/licenses/>.
  19.  *
  20.  * @license http://www.gnu.org/licenses/gpl.html GNU General Public License
  21.  * @version 2.0
  22.  * @author Jaime Perez <jaime.perez@rediris.es>
  23.  * @filesource
  24.  */
  25.  
  26. /**
  27.  * Invites DB converter tool from phpPoA1 to phpPoA2.
  28.  */
  29.  
  30. define('ROOT''PATH_TO_YOUR_DB_DIR');
  31.  
  32. header("Content-type: text/plain");
  33. header("Cache-Control: no-cache, must-revalidate");
  34.  
  35. $input $_GET['i'];
  36. $output $_GET['o'];
  37.  
  38. $db_i dba_open(ROOT.$input"r""db4");
  39. $db_o dba_open(ROOT.$output"c""db4");
  40.  
  41. $key dba_firstkey($db_i);
  42.  
  43. while ($key{
  44.     $data explode("##"dba_fetch($key$db_i));
  45.     var_dump($key);
  46.  
  47.     $new['email'$data[0];
  48.     $new['since'time();
  49.     $new['expires'0;
  50.  
  51.     var_dump($new);
  52.  
  53.     dba_replace($keyserialize($new)$db_o);
  54.  
  55.     $key dba_nextkey($db_i);
  56. }
  57.  
  58. dba_close($db_i);
  59. dba_close($db_o);
  60.  
  61. ?>

Documentation generated on Tue, 25 Jan 2011 11:24:32 +0100 by phpDocumentor 1.4.3