Shared Resources for New PHP-Based Websites

From Littledamien Wiki
Jump to navigation Jump to search

Setup

  • Remote Desktop to server
  • IIS Manager > website > right click > Add Virtual Directory
    • Alias: Same name as shared resource directory
    • Physical Path: Location shared resource directory (d:/inetpub/develop/littledamien/common_lib)
    • Connect As: Specific user > Windows account

Resources

In order to be able to integrate these files using virtual directories on dev, it’s necessary that they reside in directories with unique names.

So PHP base classes for site content are in the shared directory [COMMON_LIB]/_classes/content/ and derived classes representing site content are placed in [APP_BASE_DIR]/_classes/site_content/.

PHP classes

Located in [COMMON_LIB]/_classes/

  • content
  • database
  • filters
  • images
  • keywords
  • login
  • navigation menu (?)
  • utilities

JavaScript

Located in [COMMON_LIB]/scripts/

  • Littled libraries
  • JQuery form data plugin (handles binary data)
  • JQuery scrolling plugin
  • Twitter Bootstrap tooltips (CDN):
    <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">
    <script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
  • TinyMCE libraries

AJAX scripts

Located in [COMMON_LIB]/_ajax/

PHP template files

Located in [COMMON_LIB]/_templates/

  • Album and gallery listings, details, and pagination
  • Image popup
  • Keywords cell content
  • Form elements for inline edits of discrete information (names, access, dates, keywords, etc.)
  • Progress wheel
  • Form elements for editing and deleting albums, galleries, and images
  • Navigation elements
    • Gallery page links
    • Generalized listings page links
    • CMS navigation
    • Neighboring record links
    • Page buttons (single_listings_page_link.php)

CMS pages

Located in [COMMON_LIB]/hostmgr/

  • Site content properties CMS
  • Requirements
    • site_sections and section_operations tables
    • “CMS Content Sections” record in site_content table with id 27.

image directories

  • Image destination specified through content properties.
site_section.image_dir
  • Size variation locations:
    • [IMAGE_ROOT_DIR]/med/
    • [IMAGE_ROOT_DIR]/mini/

images

  • /images/process-wheel.png
  • /images/buttons/edit-image.png
  • /images/buttons/delete.png

PHP Config Settings

  • APP_COMMON_DIR – Base directory for shared resources
    (This will be a different location on dev and production.)
  • COMMON_CLASS_DIR – Location of shared PHP classes: APP_COMMON_DIR + "_classes/"
  • COMMON_TEMPLATE_DIR – Location of shred PHP template files: APP_COMMON_DIR + "_templates"
  • JavaScript can be accessed through virtual directories as if shared resources existed within the local web directory.

Uploading to Production

For each of the resources listed above, upload files from //littledamienii/develop/littledamien/common_lib, integrating them into the website directories of on the production server.