eZ Publish  [4.0]
makestaticcache.php
Go to the documentation of this file.
00001 #!/usr/bin/env php
00002 <?php
00003 //
00004 // Created on: <14-Jan-2005 09:27:13 dr>
00005 //
00006 // ## BEGIN COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
00007 // SOFTWARE NAME: eZ Publish
00008 // SOFTWARE RELEASE: 4.0.x
00009 // COPYRIGHT NOTICE: Copyright (C) 1999-2008 eZ Systems AS
00010 // SOFTWARE LICENSE: GNU General Public License v2.0
00011 // NOTICE: >
00012 //   This program is free software; you can redistribute it and/or
00013 //   modify it under the terms of version 2.0  of the GNU General
00014 //   Public License as published by the Free Software Foundation.
00015 //
00016 //   This program is distributed in the hope that it will be useful,
00017 //   but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019 //   GNU General Public License for more details.
00020 //
00021 //   You should have received a copy of version 2.0 of the GNU General
00022 //   Public License along with this program; if not, write to the Free
00023 //   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
00024 //   MA 02110-1301, USA.
00025 //
00026 //
00027 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
00028 //
00029 
00030 //include_once( 'lib/ezutils/classes/ezcli.php' );
00031 //include_once( 'kernel/classes/ezscript.php' );
00032 
00033 require 'autoload.php';
00034 
00035 $cli = eZCLI::instance();
00036 $script = eZScript::instance( array( 'description' => ( "eZ Publish static cache generator\n" .
00037                                                         "\n" .
00038                                                         "./bin/makestaticcache.php --siteaccess user" ),
00039                                      'use-session' => false,
00040                                      'use-modules' => true,
00041                                      'use-extensions' => true ) );
00042 
00043 $script->startup();
00044 
00045 $options = $script->getOptions( "[f|force]",
00046                                 "",
00047                                 array( 'force' => "Force generation of cache files even if they already exist." ) );
00048 
00049 $force = $options['force'];
00050 
00051 $script->initialize();
00052 
00053 require_once( 'lib/ezutils/classes/ezdebug.php' );
00054 //include_once( 'lib/ezfile/classes/ezdir.php' );
00055 //include_once( 'lib/ezutils/classes/ezini.php' );
00056 //include_once( 'kernel/classes/ezstaticcache.php' );
00057 
00058 $staticCache = new eZStaticCache();
00059 $staticCache->generateCache( $force, false, $cli, false );
00060 
00061 if ( !$force )
00062 {
00063     $staticCache->generateAlwaysUpdatedCache( false, $cli, false );
00064 }
00065 
00066 eZStaticCache::executeActions();
00067 
00068 $script->shutdown();
00069 
00070 ?>