[ Index ]
 

Code source de eZ Publish 3.9.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/update/common/scripts/ -> updateiscontainer.php (source)

   1  #!/usr/bin/env php
   2  <?php
   3  //
   4  // Definition of updateiscontainer
   5  //
   6  // Created on: <1-Oct-2004 14:42:43 fh>
   7  //
   8  // SOFTWARE NAME: eZ publish
   9  // SOFTWARE RELEASE: 3.9.0
  10  // BUILD VERSION: 17785
  11  // COPYRIGHT NOTICE: Copyright (C) 1999-2006 eZ systems AS
  12  // SOFTWARE LICENSE: GNU General Public License v2.0
  13  // NOTICE: >
  14  //   This program is free software; you can redistribute it and/or
  15  //   modify it under the terms of version 2.0  of the GNU General
  16  //   Public License as published by the Free Software Foundation.
  17  //
  18  //   This program is distributed in the hope that it will be useful,
  19  //   but WITHOUT ANY WARRANTY; without even the implied warranty of
  20  //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  21  //   GNU General Public License for more details.
  22  //
  23  //   You should have received a copy of version 2.0 of the GNU General
  24  //   Public License along with this program; if not, write to the Free
  25  //   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  26  //   MA 02110-1301, USA.
  27  //
  28  //
  29  
  30  /*! \file updateiscontainer.php
  31  */
  32  
  33  include_once ( 'lib/ezutils/classes/ezcli.php' );
  34  include_once ( 'kernel/classes/ezscript.php' );
  35  
  36  
  37  $cli =& eZCLI::instance();
  38  $script =& eZScript::instance( array( 'description' => ( "eZ publish is_container update script\n\n" .
  39                                                           "This script will set the is_container attribute on known eZ publish classes\n" .
  40                                                           "\n" .
  41                                                           "Note: The script must be run for each siteaccess" .
  42                                                           "\n" .
  43                                                           "updateiscontainer.php -sSITEACCESS" ),
  44                                        'use-session' => false,
  45                                        'use-modules' => false,
  46                                        'use-extensions' => true,
  47                                        'min_version'  => '3.4.2',
  48                                        'max_version' => '3.5.0' ) );
  49  
  50  $script->startup();
  51  
  52  $options = $script->getOptions( "", "",
  53                                  array() );
  54  
  55  $script->initialize();
  56  
  57  if ( !$script->validateVersion() )
  58  {
  59      $cli->output( "Unsuitable eZ publish version: " );
  60      $cli->output( eZPublishSDK::version() );
  61      $script->shutdown( 1 );
  62  }
  63  
  64  $db =& eZDB::instance();
  65  
  66  $classList = array( 'folder', 'article', 'user_group', 'forum', 'forum_topic', 'gallery', 'weblog' );
  67  $idText = "'" . implode( "', '", $classList ) . "'";
  68  
  69  $sql = "UPDATE ezcontentclass SET is_container='1' WHERE identifier IN ( $idText )";
  70  if ( !$db->query( $sql ) )
  71  {
  72      $cli->error( "Failed to run update query" );
  73      $cli->error( $db->errorMessage() );
  74      $script->shutdown( 1 );
  75  }
  76  
  77  $cli->output( "Updated classes: $idText" );
  78  
  79  $script->shutdown();
  80  
  81  ?>


Généré le : Sat Feb 24 10:30:04 2007 par Balluche grâce à PHPXref 0.7