Pix is an image hosting service.
Switch branches/tags
Clone or download
blat v3 first draft:
- fix copy button
- fix image auto orientation
- responsive design
- use https
- replace google analytics tracker by piwik
- migrate from limonade to fastroute + plates
- migrate from redbean to eloquent
- migrate from image workshop to intervention image
- migrate from awesomeCloud to d3 cloud
- migrate from zero clipboard to clipboard js
Latest commit 82baddc Dec 20, 2017
Permalink
Failed to load latest commit information.
app v3 first draft: Dec 20, 2017
public v3 first draft: Dec 20, 2017
templates v3 first draft: Dec 20, 2017
.gitignore v3 first draft: Dec 20, 2017
README.markdown v3 first draft: Dec 20, 2017
composer.json v3 first draft: Dec 20, 2017
config.ini-dist v3 first draft: Dec 20, 2017

README.markdown

Pix

Pix is an image hosting service.

This tools was originaly build for Toile-Libre with the help of:

Demo

Setup

  • Run composer to fetch dependencies:

      composer install
    
  • Create a MySQL database and import schema:

      CREATE TABLE `images` (
          `id` INT(11) AUTO_INCREMENT,
          `type` VARCHAR(255),
          `slug` INT(11),
          `date` DATETIME,
          `private` TINYINT(3) DEFAULT 0,
          `size` INT(11),
          `user_id` INT(11),
          `popularity` INT(11) DEFAULT 0,
          PRIMARY KEY (`id`),
          UNIQUE KEY (`slug`),
          KEY (`user_id`)
      );
    
      CREATE TABLE `image_tag` (
          `id` INT(11) AUTO_INCREMENT,
          `tag_id` INT(11),
          `image_id` INT(11),
          PRIMARY KEY (`id`),
          UNIQUE KEY (`image_id`,`tag_id`),
          KEY (`tag_id`)
      );
    
      CREATE TABLE `tags` (
          `id` INT(11) AUTO_INCREMENT,
          `label` VARCHAR(255),
          PRIMARY KEY (`id`),
          UNIQUE KEY (`label`)
      );
    
      CREATE TABLE `users` (
          `id` INT(11) AUTO_INCREMENT,
          `username` VARCHAR(255),
          `password` VARCHAR(255),
          PRIMARY KEY (`id`),
          UNIQUE KEY (`username`)
      );
    
  • Rename config.ini-dist in config.ini, then edit it (in particular, informations related to MySQL connection):

     driver = mysql
     host = localhost
     database = pix
     username = root
     password = 
    
  • Change permissions for data directory (HTTPd needs a write access):

      mkdir data/
      chown -R you:httpd data/
      chmod -R 775 data/
    
  • Here is a workig Nginx config:

      server {
              listen                  80;
              server_name             pix.mydomain.tld;
              root                    /path/to/pix/public;
              index                   index.php;
              try_files               $uri $uri/ /index.php?$query_string;
      }
    

Upgrade

If you want to upgrade from v2.x of Pix:

  • Update PHP dependencies using composer:

      composer install
    
  • Update MySQL schema:

      RENAME TABLE `image` TO `images`;
      RENAME TABLE `tag` TO `tags`;
      RENAME TABLE `user` TO `users`;