Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezfilemanager/admin/cron.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: cron.php 8109 2001-10-31 08:02:17Z jhe $
5 //
6 // Created on: <01-Aug-2001 09:34:19 jhe>
7 //
8 // This source file is part of Exponential Basic, publishing software.
9 // Copyright (C) 1999-2001 eZ systems as
10 //
11 // This program is free software; you can redistribute it and/or
12 // modify it under the terms of the GNU General Public License
13 // as published by the Free Software Foundation; either version 2
14 // of the License, or (at your option) any later version.
15 //
16 // This program is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program; if not, write to the Free Software
23 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
24 //
25
26 // include_once( "classes/INIFile.php" );
27 // include_once( "classes/ezfile.php" );
28 // include_once( "ezfilemanager/classes/ezvirtualfile.php" );
29 // include_once( "ezfilemanager/classes/ezvirtualfolder.php" );
30
31 $ini =& eZINI::instance( 'site.ini' );
32
33 function getFiles( $dir )
34 {
35 while ( $file = $dir->read() )
36 {
37 if ( $file != "." && $file != ".." )
38 {
39 if ( is_dir( $dir->path . "/" . $file ) )
40 getFiles( dir( $dir->path . "/" . $file ) );
41 else
42 addFile( $dir->path, $file );
43 }
44 }
45 }
46
47 function addFile( $dir, $file )
48 {
49 global $ini;
50 $readGroup = $ini->variable( "eZFileManagerMain", "SyncronizeReadGroup" );
51 $writeGroup = $ini->variable( "eZFileManagerMain", "SyncronizeWriteGroup" );
52 $syncUser = $ini->variable( "eZFileManagerMain", "SyncronizedFilesOwner" );
53 if ( !eZVirtualFile::fileExists( $dir, $file ) )
54 {
55 $folder = new eZVirtualFolder( eZVirtualFolder::getByName( $dir, 0, true, $readGroup, $writeGroup ) );
56 $virtualFile = new eZVirtualFile();
57 $localFile = new eZFile();
58 $localFile->getFile( $dir . "/" . $file );
59 $virtualFile->setFile( $localFile );
60 $virtualFile->setOriginalFileName( $file );
61 $virtualFile->setUser( $syncUser );
62 $virtualFile->store();
63 $folder->addFile( $virtualFile );
64 }
65 }
66
67 $autoSync = $ini->variable( "eZFileManagerMain", "AutoSyncronize" );
68
69 if ( $autoSync || $autoSync == "true" )
70 {
71 $localDir = $ini->variable( "eZFileManagerMain", "LocalSyncronizeDir" );
72 getFiles( eZPBFile::dir( $localDir, false ) );
73 }
74
75 ?>
eZFile
Tool class which has convencience functions for files and directories.
Definition: ezfile.php:19
eZPBFile\dir
static dir( $dir, $add_sitedir=true)
Definition: ezpbfile.php:384
eZVirtualFile
Definition: ezvirtualfile.php:42
eZVirtualFile\fileExists
fileExists( $dir, $file)
Definition: ezvirtualfile.php:574
eZVirtualFolder
Definition: ezvirtualfolder.php:43
eZVirtualFolder\getByName
getByName( $dir, $parent=0, $create=false, $readgroup=-1, $writegroup=-1)
Definition: ezvirtualfolder.php:107
$folder
if(!isset( $FolderID)) $folder
Definition: ezfilemanager/admin/browse.php:74
$autoSync
$autoSync
Definition: ezfilemanager/admin/cron.php:67
$ini
$ini
Definition: ezfilemanager/admin/cron.php:31
addFile
addFile( $dir, $file)
Definition: ezfilemanager/admin/cron.php:47
getFiles
getFiles( $dir)
Definition: ezfilemanager/admin/cron.php:33
$file
$file
Definition: ezfilemanager/user/filedownload.php:35
$dir
$dir
Definition: ezsitemanager/admin/filelist.php:87
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.