Development

Changeset 2471

You must first sign up to be able to contribute.

Changeset 2471

Show
Ignore:
Timestamp:
10/21/06 06:48:41 (7 years ago)
Author:
forkmantis
Message:

Added more to the README file.
Set schema to default to no user management (changed from sfGuard user management).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfPropelFileStoragePlugin/README

    r2441 r2471  
    1 Frontend routing: 
    2 download_by_file_name: 
    3   url:  /download/:name 
    4   param: { module: sfPropelFileStorage, action: download } 
     1= sfPropelFileStorage plugin = 
    52 
    6 download_image_by_file_name: 
    7   url:  /images/:name 
    8   param: { module: sfPropelFileStorage, action: download } 
     3The `sfPropelFileStoragePlugin` provides functionality for storing files in a database using Symfony.  The plugin also caches files as they are retrieved from the database if they are not already cached. 
    94 
     5== Installation == 
    106 
    11 Remember to uncomment the first block of 3 rules in web/.htaccess 
     7  * Copy the files into the plugin directory 
     8   
     9  * Rebuild your model 
     10 
     11  {{{ 
     12    symfony propel-build-all 
     13  }}} 
     14 
     15  * Activate one or more modules in your `settings.yml` (optional) 
     16    * For your backend application: sfPropelFileStorageAdmin 
     17    * For your frontend application: sfPropelFileStorage 
     18 
     19  {{{ 
     20    all: 
     21      .settings: 
     22        activated_modules: [default, sfPropelFileStorageAdmin, sfPropelFileStorage] 
     23  }}} 
     24 
     25  * Clear your cache 
     26   
     27  {{{ 
     28    symfony cc 
     29  }}} 
     30 
     31  * Update your routing configuration 
     32 
     33  {{{ 
     34    # sfPropelFileStorage frontend routing 
     35    download_by_file_name: 
     36      url:  /download/:name 
     37      param: { module: sfPropelFileStorage, action: download } 
     38 
     39    download_image_by_file_name: 
     40      url:  /images/:name 
     41      param: { module: sfPropelFileStorage, action: download } 
     42  }}} 
     43 
     44  * Update your .htaccess file, commenting out or eliminating the first three lines and adding a new rule to check if the URL points to a real file or not. 
     45 
     46  {{{ 
     47    # we skip all files with .something 
     48    # RewriteCond %{REQUEST_URI} \..+$ 
     49    # RewriteCond %{REQUEST_URI} !\.html$ 
     50    # RewriteRule .* - [L] 
     51    Cond %{REQUEST_FILENAME} !-f 
     52  }}} 
     53 
     54  * Choose optional user manager system to use with sfPropelFileStorage plugin (defaults to none) 
     55    
     56    * Execute the pake task file-storage-set-user-manager [sfGuard, none] 
     57   
     58    {{{ 
     59      symfony file-storage-set-user-manager <manager_option> 
     60    }}} 
     61     
     62    * Rebuild your models 
     63    
     64    {{{ 
     65      symfony propel-build-model 
     66    }}} 
     67     
     68    * Clear cache 
  • plugins/sfPropelFileStoragePlugin/config/schema.xml

    r2441 r2471  
    66    <column name="size" type="varchar" size="100" /> 
    77    <column name="mime_type" type="varchar" size="100" /> 
    8      
    9     <column name="sf_guard_user_id" phpName='user_id' type="integer" /> 
    10      
    11     <foreign-key foreignTable="sf_guard_user"> 
    12       <reference local="sf_guard_user_id" foreign="id" /> 
    13     </foreign-key> 
    148     
    159    <column name="is_cached" type="boolean" />     
     
    2115    <column name="file_info_id" type="integer" /> 
    2216    
    23     <foreign-key foreignTable="file_info" onDelete="cascade"
     17    <foreign-key foreignTable="file_info"
    2418      <reference local="file_info_id" foreign="id" /> 
    2519    </foreign-key>