/**
  * Get size of the bookmarks table
  *
  * @return the formatted table size
  */
 public static function getTableSize()
 {
     $res = Doctrine::execute("SHOW TABLE STATUS Where Name like '%_bookmarks'");
     $tableInfo = $res->fetch();
     $size = $tableInfo['Data_length'];
     return Folder::formatSize($size);
 }
Exemple #2
0
 /**
  * Checks wether this site accept backups, and if there is enough rooms left
  *
  * Handled via HTTP Response code
  *
  * @return void
  */
 private function _checkBackup()
 {
     if ($this->options['acceptBackups'] == 0) {
         Network::reply(403, HERISSON_EXIT);
         exit;
     }
     $dirsize = Folder::getFolderSize(HERISSON_BACKUP_DIR);
     if ($dirsize > $this->options['backupFolderSize']) {
         Network::reply(406, HERISSON_EXIT);
         exit;
     }
 }
Exemple #3
0
    echo __('Action', HERISSON_TD);
    ?>
</th>
            </tr>
                <?php 
    foreach ($localbackups as $localbackup) {
        ?>
            <tr>
                <td>
                    <?php 
        echo $friends[$localbackup->friend_id]->name;
        ?>
                </td>
                <td>
                    <?php 
        echo \Herisson\Folder::formatSize($localbackup->size);
        ?>
                </td>
                <td>
                    <?php 
        echo $localbackup->filename;
        ?>
                </td>
                <td>
                    <?php 
        echo $localbackup->creation;
        ?>
                </td>
            </tr>
            <?php 
    }
Exemple #4
0
?>
<br/>
                    </p>
                </td>
            </tr>
            <tr valign="top">
                <th scope="row"><label for="backupFolderSize"><?php 
echo __("Backup folder size", HERISSON_TD);
?>
</label>:</th>
                <td>
                <input type="text" name="backupFolderSize" id="backupFolderSize" style="width:6em; text-align: right" value="<?php 
echo intval($options['backupFolderSize']);
?>
" /> MB (or <?php 
echo \Herisson\Folder::formatSize(intval($options['backupFolderSize']) * 1000 * 1000);
?>
)
                    <p>
                        <?php 
echo __("Limits the total size of the backup folder. Once the size is reach, friends backups are no longer accepted.", HERISSON_TD);
?>
                    </p>
                </td>
            </tr>
        </table>

        <input type="hidden" name="action" value="index" />

        <p class="submit">
            <input type="submit" class="button" value="<?php 
Exemple #5
0
?>
        
                <?php 
if ($id) {
    ?>
                <!-- Archive size -->
                <tr class="form-field">
                    <th valign="top" scope="row">
                        <label for="size-0"><?php 
    echo __("Archive size", HERISSON_TD);
    ?>
:</label>
                    </th>
                    <td>
                        <?php 
    echo \Herisson\Folder::formatSize($existing->dirsize);
    ?>
                    </td>
                </tr>
                <?php 
}
?>
        
                <!-- Visibility -->
                <tr class="form-field">
                    <th valign="top" scope="row">
                        <label for="visibility-0"><?php 
echo __("Visibility", HERISSON_TD);
?>
:</label>
                    </th>