eZ Publish  [4.0]
ezinstallscriptpackageinstaller.php
Go to the documentation of this file.
00001 <?php
00002 //
00003 // Definition of eZInstallScriptPackageInstaller class
00004 //
00005 // Created on: <16-Feb-2006 12:39:59 ks>
00006 //
00007 // ## BEGIN COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
00008 // SOFTWARE NAME: eZ Publish
00009 // SOFTWARE RELEASE: 4.0.x
00010 // COPYRIGHT NOTICE: Copyright (C) 1999-2008 eZ Systems AS
00011 // SOFTWARE LICENSE: GNU General Public License v2.0
00012 // NOTICE: >
00013 //   This program is free software; you can redistribute it and/or
00014 //   modify it under the terms of version 2.0  of the GNU General
00015 //   Public License as published by the Free Software Foundation.
00016 //
00017 //   This program is distributed in the hope that it will be useful,
00018 //   but WITHOUT ANY WARRANTY; without even the implied warranty of
00019 //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020 //   GNU General Public License for more details.
00021 //
00022 //   You should have received a copy of version 2.0 of the GNU General
00023 //   Public License along with this program; if not, write to the Free
00024 //   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
00025 //   MA 02110-1301, USA.
00026 //
00027 //
00028 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
00029 //
00030 
00031 /*! \file ezinstallscriptpackageinstaller.php
00032 */
00033 
00034 /*!
00035   \ingroup package
00036   \class eZInstallScriptPackageInstaller ezcontentclasspackageinstaller.php
00037 */
00038 
00039 //include_once( 'kernel/classes/ezpackageinstallationhandler.php' );
00040 
00041 class eZInstallScriptPackageInstaller extends eZPackageInstallationHandler
00042 {
00043      /*
00044       Constructor should be implemented in the child class
00045         and call the constructor of eZPackageInstallationHandler.
00046      */
00047     function eZInstallScriptPackageInstaller( $package, $type, $installItem )
00048     {
00049     }
00050     /*!
00051      \reimp
00052      Returns \c 'stable', content class packages are always stable.
00053     */
00054     function packageInitialState( $package, &$persistentData )
00055     {
00056         return 'stable';
00057     }
00058 
00059     function customInstallHandlerInfo( $package, $installItem )
00060     {
00061         $return = array();
00062 
00063         $itemPath = $package->path() . '/' . $installItem['sub-directory'];
00064         $xmlPath = $itemPath . '/' . $installItem['filename'] . '.xml';
00065 
00066         $dom = $package->fetchDOMFromFile( $xmlPath );
00067         if ( $dom )
00068         {
00069             $mainNode = $dom->documentElement;
00070             $return['file-path'] = $itemPath . '/' . $mainNode->getAttribute( 'filename' );
00071             $return['classname'] = $mainNode->getAttribute( 'classname' );
00072         }
00073 
00074         return $return;
00075     }
00076 
00077     function stepTemplate( $package, $installItem, $step )
00078     {
00079         $itemPath = $package->path() . '/' . $installItem['sub-directory'];
00080         $stepTemplatePath = $itemPath . '/templates';
00081 
00082         return array( 'name' => $step['template'],
00083                       'path' => $stepTemplatePath );
00084     }
00085 }
00086 ?>