WEB version control FTFW!

Discussion in 'OT Technology' started by biawokauns, Jan 31, 2009.

  1. biawokauns

    biawokauns New Member

    Joined:
    Sep 18, 2001
    Messages:
    19,893
    Likes Received:
    0
    Location:
    Republic of Kalifornia
    so the network of sites I run has grown substnatially...the problem is, every site had a different codebase, each being some mutation of the previous. essentially I have like 7 different sets of code.

    going in to make small changes would be a PITA and take WAY too long. I spent the past few days rewriting all of the code for speed and maintainability :o

    i put everything into a svn repository, and pulled out all of my variables. now I can make changes from one configuration file, AND if I find a bug, I can update it across all of the sites with one command :bowdown:

    the shared css is version controlled, as are any shared images. site specific images/css/js are ignored thorugh svn. i plan on runing jsmin on the css/js shortly.

    sample config:
    Code:
    <?
    
    // *********************************************************
    // 					initial configuration
    //		 make sure to change the fake dir for VOTING!
    // *********************************************************
    
    	$production = true;
    	$use_titles = false;
    	$use_captcha = false;
    	
    // db settings
    $rating_dbhost	= 'localhost';
    $rating_dbuser	= '';
    $rating_dbpass	= '';
    $rating_dbname	= '';
    
    $rating_tableName	= '';
    $comment_tableName	= '';
    
    $rating_path_db		= ''; // the path to your db.php file
    $rating_path_rpc	= ''; // the path to your rpc.php file 
    
    
    // if you changed your graphic to be 50 pixels wide, you should change the value below
    $rating_unitwidth	= 30; // the width (in pixels) of each rating unit (star, etc.)
    
    // recaptcha
    $publickey = "6LdQsgMAAAAAAO3SWpd3qCIvoaJJ4eghCzcWhPc1"; 
    $privatekey = "6LdQsgMAAA2344xfRk0bVSnjDQyz_gkYf_48odd";
    
    // WHAT ARE WE PREFIXING UPLOADED FILENAMES WITH? 
    // this is overridden if $use_titles is enabled
    $uploaded_filename_prefix = "TEST";
    
    // DONT FORGET THIS
    $analytics_id	= 'UA-2787617-27';
    
    
    // ********************************************************
    // 					announcements
    // ********************************************************
    
    $announcement_top = true;
    $announcement_middle = true;
    $announcement_bottom = true;
    
    
    
    // ********************************************************
    // 					ad configuration
    // ********************************************************
    
    $ad_homepage_top = true;
    $ad_homepage_bottom = true;
    
    $ad_popular_top = true;
    $ad_popular_bottom = true;
    
    $ad_recent_top = true;
    $ad_recent_bottom = true;
    
    $ad_single_top = true;
    $ad_single_middle = true;
    $ad_single_bottom = true;
    
    
    
    // ********************************************************
    // 					text configuration
    // ********************************************************
    $site_name	= "Explain This Image";
    $page_title_homepage = "Pictures That Make No Sense - Explain This Image";
    $page_title_popular = "Popular Pictures That Make No Sense - Explain This Image";
    $page_title_new = "New Photos That Make No Sense - Explain This Image";
    $page_title_single = "Explain This Image - Image That Makes No Sense";
    
    // meta tags
    $meta_keywords = "makes no sense, explain this image, explain this, no sense, images, pictures, photos, pics, image, picture, photo, pic, unexplainable photos, unexplainable picture, unexplainable pic, unexplainable image";
    
    $meta_desc_homepage = "Try to explain images that make no sense with your own explanation and read others take on these pictures are unexplainable."; 
    $meta_desc_popular = "See what everybody is talking about. Join the discussion with these popular Unexplainable Images";
    $meta_desc_recent = "Newly uploaded unexplainable images, be the first to chime in!";
    
    // note: if titles are enabled, title will appear first
    // ex: "WOMAN IN WOODS" on SITE NAME. $meta_desc_single
    $meta_desc_single = "This image doesn't make any sense. Can You Explain This Image?";
    
    
    // header bar copy
    $header_homepage_copy = "Random Pictures That Make No Sense";
    $header_popular_copy = "Popular Images That Make No Sense";
    $header_recent_copy = "New Images That Need Explanation!";
    
    $header_single_copy = "Can YOU Explain This Image?";
    $header_comments_copy = "Other's Explanations";
    $header_submit_comment_copy = "What is YOUR Explanation?";
    
    // keyword
    
    // the following is wrapped between a <h3> tag, for every image thumbnail
    // renders as -> "prefix: suffix"
    $h3_image_thumbnail_prefix	= "Explain This Image"; 
    $h3_image_thumbnail_suffix	= "Unexplainable Photo"; 
    $img_alt_copy = "Explain This Unexplainable Photo";
    
    
    
    // *********************************************************
    // 						links
    // *********************************************************
    
    $view_single_symlink	=	"unexplainable-photo";
    $file_rename	= "unxplained-photo";
    $file_thumbnail_path	= "explain-this-image-thumb";
    $file_image_path	= "explain-this-image-full";
    
    $prev_image_link_text = "Previous Image";
    $next_image_link_text = "Next Image";
    
    $newest_kw	=	"newest";
    $hottest_kw	=	"hottest";
    
    
    // this gets appened at the end of every thumbnail 
    $seo_primary_kw	=	"makes-no-sense";
    
    // nav text for "Previous XXX" and "Next XXX"
    $single_nav_copy	=	"Image Makes No Sense";
    
    
    
    // *********************************************************
    // 						system variables
    // *********************************************************
    
    // set absolute site path (used for uploader)
    $site_path = dirname(dirname(__FILE__));;
    
    // this is the number of results displayed per page
    $page_rows = 16;
    
    $openx_rand = time(); 
    
    $conn= mysql_connect("localhost","$rating_dbuser", "$rating_dbpass") or die (mysql_error());
    mysql_select_db($rating_dbname) or die("DBH Error");
    
    
    ?>
    
    
    updaing :bowdown:
    Code:
    public_html >> sh /update-all-hhh-sites.sh 
    preparing to update ALL HHH sites...
    Skipped '/home/candidate-equals/public_html'
    Skipped '/home/chairman-lol/public_html'
    At revision 116.
    Skipped '/home/horsehead/public_html'
    Skipped '/home/passedoutphotos/public_html'
    U    /home/porn-sfw/public_html/single.php
    Updated to revision 116.
    U    /home/shit-brix/public_html/single.php
    Updated to revision 116.
    U    /home/spoiled-photos/public_html/single.php
    Updated to revision 116.
    DONE
    public_html >> 
    
     
  2. maxxpower

    maxxpower OG Lauren Crew - Observer OT Supporter

    Joined:
    May 27, 2007
    Messages:
    26,348
    Likes Received:
    0
    nice, housework always pays off.
    i lost a version of code last month and we transferred everything to dotproject system since then. Has been 100x easier tracking shit now.
    Good job on the consolidation.
     
  3. biawokauns

    biawokauns New Member

    Joined:
    Sep 18, 2001
    Messages:
    19,893
    Likes Received:
    0
    Location:
    Republic of Kalifornia
    thanks mang. what's dotproject?
     
  4. maxxpower

    maxxpower OG Lauren Crew - Observer OT Supporter

    Joined:
    May 27, 2007
    Messages:
    26,348
    Likes Received:
    0
    open source project management system.
    We are using it for source code tracking, checking out and general project management.
    Its a pretty solid system, there are other better source code systems out there but this one works well for us.
    Not so much meant for webwork, but great for our applications.
     
  5. biawokauns

    biawokauns New Member

    Joined:
    Sep 18, 2001
    Messages:
    19,893
    Likes Received:
    0
    Location:
    Republic of Kalifornia
    might check it out. svn ftw, capistrano wuld be even better, one command from my comptuer and it'll run remote commands ftw. used it once for rails apps, but thats bout it.
     
  6. Ricky

    Ricky █▄ █▄█ █▄ ▀█▄

    Joined:
    Jun 17, 2005
    Messages:
    38,767
    Likes Received:
    6
    damn thats :cool:
     
  7. biawokauns

    biawokauns New Member

    Joined:
    Sep 18, 2001
    Messages:
    19,893
    Likes Received:
    0
    Location:
    Republic of Kalifornia
    what do you mean?
     

Share This Page