public $__table = 'file_thumbnail'; // table name
public $file_id; // int(4) primary_key not_null
public $url; // text
- public $filename; // varchar(191) not 255 because utf8mb4 takes more space
+ public $filename; // text
public $width; // int(4) primary_key
public $height; // int(4) primary_key
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
'fields' => array(
'file_id' => array('type' => 'int', 'not null' => true, 'description' => 'thumbnail for what URL/file'),
'url' => array('type' => 'text', 'not null' => false, 'description' => 'URL of thumbnail'),
- 'filename' => array('type' => 'varchar', 'length' => 191, 'description' => 'if stored locally, filename is put here'),
+ 'filename' => array('type' => 'text', 'description' => 'if stored locally, filename is put here'),
'width' => array('type' => 'int', 'description' => 'width of thumbnail'),
'height' => array('type' => 'int', 'description' => 'height of thumbnail'),
'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'),
* @param int $file_id
*/
public static function saveNew($data, $file_id) {
+ // @TODO Must be an object (see below code)
+ assert(is_object($data));
+
if (!empty($data->thumbnail_url)) {
// Non-photo types such as video will usually
// show us a thumbnail, though it's not required.
'delete' => false,
'move' => true),
'image' =>
- array('jpegquality' => 85),
+ array('jpegquality' => 95),
'avatar' =>
array('server' => null,
'dir' => INSTALLDIR . '/avatar/',
array('dropoff' => 864000.0, # controls weighting based on age
'cutoff' => 86400 * 90), # only look at notices favorited in last 90 days
'daemon' =>
- array('piddir' => '/var/run',
+ array('piddir' => sys_get_temp_dir(),
'user' => false,
'group' => false),
'emailpost' =>
array('server' => null,
'dir' => INSTALLDIR . '/file/',
'path' => $_path . '/file/',
+ 'chmod' => 0644, // Access rights (chmod) for any attachments
'sslserver' => null,
'sslpath' => null,
'ssl' => null,