Development

Changeset 22238 for plugins

You must first sign up to be able to contribute.

Changeset 22238 for plugins

Show
Ignore:
Timestamp:
09/22/09 11:25:33 (4 years ago)
Author:
jiappo
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfImagesOnDatabasePlugin/trunk/README

    r22228 r22238  
    3131        $ symfony doctrine:build-filter 
    3232 
    33   * Enable sfImages module on your app. 
     33  * Enable sfImages module on your app 
    3434 
    3535        #app/.../config/settings.yml 
     
    4343It contains mainly 2 classes : 
    4444 
    45   * `sfImage`
     45  * _sfImage_
    4646  It consists of image stored on database (jpg, png, bmp, other...). 
    47   * `sfImageTable`
     47  * _sfImageTable_
    4848  It gives the opportunity to save an image contained in a file in database with an associated name (a reference). 
    4949 
     
    5151 
    5252The following code store an image retreived by request with uploaded file. 
    53 This is located in a actions.class.php. 
     53It is located in a actions.class.php. 
    5454 
    5555          #app/frontend/modules/.../actions.class.php 
     
    6767          } 
    6868 
    69 Then you can retrieve the image by the url returned by $image->getUrl() method. 
     69Then you can retrieve the image by the url getted from $image->getUrl(). This is like ``{hostname}/images/{name}.{extension}`` as a normal file! 
    7070 
    71 ### Done 
    72  
    73 That's it ! 
     71Done, That's it ! 
    7472 
    7573Feedback 
  • plugins/sfImagesOnDatabasePlugin/trunk/config/doctrine/schema.yml

    r22228 r22238  
    33    reference: 
    44      type: string(255) 
    5       unique: true 
    6       notnull: true 
     5      primary: true 
    76    extension: 
    87      type: string(4) 
    9       notnull: true 
     8      primary: true 
    109    mime_type: 
    1110      type: string(25) 
  • plugins/sfImagesOnDatabasePlugin/trunk/config/routing.yml

    r22228 r22238  
    1 images: 
     1sf_images: 
    22  url:      /images/:reference.:extension 
    33  class:    sfDoctrineRoute 
  • plugins/sfImagesOnDatabasePlugin/trunk/lib/form/doctrine/PluginsfImageForm.class.php

    r22228 r22238  
    2525    unset($this->validatorSchema['last_modified']); 
    2626 
    27     $this->widgetSchema['reference']->setLabel('Name'); 
     27    $this->widgetSchema['reference'] = new sfWidgetFormInput(array( 
     28      'label' => 'Name', 
     29    )); 
     30    $this->validatorSchema['reference'] = new sfValidatorString(array('max_length' => 255)); 
    2831 
    2932    $this->widgetSchema['file'] = new sfWidgetFormInputFile(array( 
    3033      'label' => 'Image', 
    3134    )); 
    32  
    3335    $this->validatorSchema['file'] = new sfValidatorFile(array( 
    3436      'required' => true, 
  • plugins/sfImagesOnDatabasePlugin/trunk/lib/model/doctrine/PluginsfImage.class.php

    r22228 r22238  
    4646  public function getUrl() { 
    4747    sfLoader::loadHelpers('Url'); 
    48     return url_for('sfImages/show?reference='.$this->_get('reference').'&extension='.$this->_get('extension')); 
     48    $url = url_for('sf_images', $this, false); 
     49 
     50    // HOW CAN I REMOVE index.php/ ON PRODUCTION MODE? 
     51    return preg_replace('/index.php\//', '', $url); 
    4952  } 
    5053} 
  • plugins/sfImagesOnDatabasePlugin/trunk/lib/model/doctrine/PluginsfImageTable.class.php

    r22228 r22238  
    88    $image = new sfImage(); 
    99    $image->setReference($name); 
    10  
    1110 
    1211    if(!($fileDescr instanceof sfValidatedFile)) { 
  • plugins/sfImagesOnDatabasePlugin/trunk/modules/sfImages/actions/actions.class.php

    r22228 r22238  
    2525    return sfView::NONE; 
    2626  } 
    27  
    2827} 
  • plugins/sfImagesOnDatabasePlugin/trunk/package.xml

    r22228 r22238  
    33 <name>sfImagesOnDatabasePlugin</name> 
    44 <channel>pear.symfony-project.com</channel> 
    5  <summary>Model plugin.</summary> 
     5 <summary>Model plugin</summary> 
    66 
    7  <description>The sfImagesOnDatabasePlugin intends to bring a solution for storing images on database using the symfony framework. These images can be subsequently retrieved as normal files stored on file system.</description> 
     7 <description>The sfImagesOnDatabasePlugin store images on database. These images can be subsequently retrieved by normal request like {hostname}/images/{name}.{extension}</description> 
    88 
    99 <lead> 
     
    1414 </lead> 
    1515 
    16  <date>2009-09-21</date> 
     16 <date>2009-09-22</date> 
    1717 
    1818 <version> 
    19    <release>0.1.1</release> 
    20    <api>0.1.1</api> 
     19   <release>0.1.2</release> 
     20   <api>0.1.2</api> 
    2121 </version> 
    2222 
     
    9191  <release> 
    9292   <version> 
     93    <release>0.1.2</release> 
     94    <api>0.1.2</api> 
     95   </version> 
     96   <stability> 
     97    <release>beta</release> 
     98    <api>beta</api> 
     99   </stability> 
     100   <license uri="http://www.symfony-project.com/license">MIT license</license> 
     101   <license>MIT</license> 
     102   <date>2009-09-21</date> 
     103   <notes> 
     104    * jiappo: 'resolved' little bug in the sfImage.getUrl (it included index.php on url) 
     105    * jiappo: changed primary key for image's entity 
     106   </notes> 
     107  </release> 
     108  <release> 
     109   <version> 
    93110    <release>0.1.1</release> 
    94111    <api>0.1.1</api>