Skip to content
Snippets Groups Projects
Select Git revision
  • d251f04b98c3be9ecb6435af15628f0ccf09cfe3
  • master default protected
2 results

filecache.php

Blame
  • filesystem.php 10.79 KiB
    <?php
    
    /**
    * ownCloud
    *
    * @author Frank Karlitschek 
    * @copyright 2010 Frank Karlitschek karlitschek@kde.org 
    * 
    * This library is free software; you can redistribute it and/or
    * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
    * License as published by the Free Software Foundation; either 
    * version 3 of the License, or any later version.
    * 
    * This library is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
    *  
    * You should have received a copy of the GNU Affero General Public 
    * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
    * 
    */
    
    
    /**
     * Class for abstraction of filesystem functions
     * This class won't call any filesystem functions for itself but but will pass them to the correct OC_Filestorage object
     * this class should also handle all the file premission related stuff
     *
     * Hooks provided:
     *   read(path)
     *   write(path, &run)
     *   post_write(path)
     *   create(path, &run) (when a file is created, both create and write will be emited in that order)
     *   post_create(path)
     *   delete(path, &run)
     *   post_delete(path)
     *   rename(oldpath,newpath, &run)
     *   post_rename(oldpath,newpath)
     *   copy(oldpath,newpath, &run) (if the newpath doesn't exists yes, copy, create and write will be emited in that order)
     *   post_rename(oldpath,newpath)
     *
     *   the &run parameter can be set to false to prevent the operation from occuring
     */
    
    class OC_Filesystem{
    	static private $storages=array();
    	static private $mounts=array();
    	static private $storageTypes=array();
    	public static $loaded=false;
    	private $fakeRoot='';
    	static private $defaultInstance;
    
    
      /**
       * classname which used for hooks handling
       * used as signalclass in OC_Hooks::emit()
       */
      const CLASSNAME = 'OC_Filesystem';
    
      /**
       * signalname emited before file renaming
       * @param oldpath
       * @param newpath
       */
      const signal_rename = 'rename';
    
      /**
       * signal emited after file renaming
       * @param oldpath