GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
DBIx::Class::InflateColumn::FS(3) User Contributed Perl Documentation DBIx::Class::InflateColumn::FS(3)

DBIx::Class::InflateColumn::FS - Inflate/deflate columns to Path::Class::File objects

  __PACKAGE__->load_components(qw/InflateColumn::FS Core/);
  __PACKAGE__->add_columns(
      id => {
          data_type         => 'INT',
          is_auto_increment => 1,
      },
      file => {
          data_type => 'TEXT',
          is_fs_column => 1,
          fs_column_path => '/var/lib/myapp/myfiles',
      },
      file_2 => {
          data_type => 'TEXT',
          is_fs_column => 1,
          fs_column_path => '/var/lib/myapp/myfiles',
          fs_new_on_update => 1
      },
  );
  __PACKAGE__->set_primary_key('id');

  # in application code
  $rs->create({ file => $file_handle });

  $row = $rs->find({ id => $id });
  my $fh = $row->file->open('r');

Provides inflation to a Path::Class::File object allowing file system storage of BLOBS.

The storage path is specified with "fs_column_path". Each file receives a unique name, so the storage for all FS columns can share the same path.

Within the path specified by "fs_column_path", files are stored in sub-directories based on the first 2 characters of the unique file names. Up to 256 sub-directories will be created, as needed. Override "_fs_column_dirs" in a derived class to change this behavior.

"fs_new_on_update" will create a new file name if the file has been updated.

Provides the file naming algorithm. Override this method to change it.

This method is called with two parameters: The name of the column and the "column_info" object.

Returns the sub-directory components for a given file name. Override it to provide a deeper directory tree or change the algorithm.

Copies a row object, duplicating the files backing fs columns.

Deletes the associated file system storage when a row is deleted.

Deletes file storage when an fs_column is set to undef.

Re-inflates after setting an fs_column.

Inflates a file column to a Path::Class::File object.

Deflates a file column to its storage path name, relative to "fs_column_path". In the database, a file column is just a place holder for inflation/deflation. The actual file lives in the file system.

Overridden to provide a hook for specifying the resultset_class. If you provide your own resultset_class, inherit from InflateColumn::FS::ResultSet.

Community support can be found via:

  Mailing list: http://lists.scsys.co.uk/mailman/listinfo/dbix-class/

  IRC: irc.perl.org#dbix-class

The author is "semifor" on IRC and a member of the mailing list.

semifor: Marc Mims <marc@questright.com>

mst: Matt S. Trout <mst@shadowcatsystems.co.uk>

mo: Moritz Onken <onken@netcubed.de>

norbi: Norbert Buchmuller <norbi@nix.hu>

You may distribute this code under the same terms as Perl itself.
2010-06-22 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.