Filed under: Development | Tags: all project backup, backup in lan, backup server, company data house, create reposity, svn
It’s really nighhtmare to maintain all projects backup manually in a single computer when a project is developed by different programmer(s). But it’s really easy if we assign the manual task to any sub versioning sofware like Tortois SVN.
Prerequiresites:
1. Local area network(LAN).
2. Install SVN in all computers including Backup Server ( installation require 5 minutes per computer). How to install?
3. Backup Server (don’t worry its a general configuration computer just consider as Backup Server). It’s wise to assign company name to backup server. For instance say company
When a project(first_project) starts, do the following task in Server:
1. Create Repository in Server computer. Which mean create a folder named first_project in server pc.

2. Open the folder and right click -> TortoisSVN -> Create Repository Here.

3. Many folders will create and show a popup confirmation as.

When a project(first_project) starts do the following task in Developer PC:
1. Create a folder in your root with the same name first_project. open the folder and Right click -> SVN Checkout

2. You will get a folder named .svn. Now paste initial folder and files of your project here. After that, right click -> SVN commit. Press ok.

Every hour or end of the day when developer plan to take off from office, simply right click -> SVN Commit

That’s it
All projects are now under version control. Which mean after 2 month, if you want to revert a module it’s possible. Who developed this module (need some editing) is easy to identify. Enjoy Yourself !!
Hey keep in mind, if your backup server hard drive crash due to power failure i am not responsible for that
If crashed, don’t worry every developer PC still contain latest version of the project. So lets get START
Subversion have a huge list of features what you can get from here. But i have not enough time to read the big list. So in short, subversion is a system which helps developer to backup and recovery(extreme feature) their code time to time. Tortoise SVN is a good subversioning system for windows. Easy to install and use.
Why we use SVN?
Best and attractive feature what i found is Checkout and Commit. Let me explain more. While i am working in a project i change a number of files in different folder. So when we need to synchronize with server we need to enter individual folder and upload files through FTP. Or whatever it’s local office development when multiple (or even single) developer engage in a single project. For all easy way to do this task is : just enter into project folder (eg. htdocs/my_project) now click SVN->Commit. a list of changed files displayed and you can easily check which files you wish to commit. Moreover, you can put a comment for your change. Someone in other end can easily receive these files by SVN->Checkout. He will notified what changes made by whom. It’s the cool feature and a lot more. So lets try to install and use it first.
First download it from here
How to setup ?
In Windows explorer, make a directory where you would like the SVN repository to be.
Right click on the directory you just created, then scroll to TortoiseSVN > Create Repository here…
You should get the following pop-up window:

Choose the file type you would like and click OK.
How do you know it worked?
You should get the following message:

Import the project into the SVN repository
Go to your work area in Windows Explorer. Right click on the directory you just created, then scroll to TortoiseSVN > Import…

Click on the button in the top right to browse for the location of the SVN repository that you just created. Once selected, add a “/trunk” to the end of the file location. Enter “initial import” in the Import Message field. Click OK
How do you know it worked?
You should get output as follows:

Start using the SVN files in your work directory
To use the SVN repository, we’ll actually want to checkout the files in an empty directory – SVN needs an empty directory to start.
Using Windows Explorer, rename your project directory from aminul_stull to aminul_stuff_backup . Create a new work directory named aminul_stull Right click on the directory you just created, then scroll to TortoiseSVN > SVN Checkout… In the pop-up window verify that the “URL of repository” has the location of the SVN directory that you created; if not, browse and select it. Make sure you have /trunk added to the raw location. Click OK and you should get the following window:

When you go back to windows explorer, you should now see a green check mark next to the directory.
[SVN er Dorwaja Kholna MAMU]
[NOTE: i have STOLEN maximum content of this article over the net;) Don't worry no one blame you if you use it and get benefited
]
How simple to create an excel file from database using CI (don’t care about table(s) or data)
function export_excel()
{
$query = $this->db
->select(‘*’)
->from(‘customer’)
->get();
to_excel($query , ‘export_master’); // outputs export_master.xls
}
system/helper/common_helper.php
or
application/helper/common_helper.php
field_data();
if ($query->num_rows() == 0) {
echo ‘
The table appears to have no data.
‘;
return FALSE;
} else {
foreach ($fields as $field) {
$headers .= $field->name . “\t”;
}
foreach ($query->result() as $row) {
$line = ”;
foreach($row as $value) {
if ((!isset($value)) OR ($value == “”)) {
$value = “\t”;
} else {
$value = str_replace(‘”‘, ‘”"‘, $value);
$value = ‘”‘ . $value . ‘”‘ . “\t”;
}
$line .= $value;
}
$data .= trim($line).”\n”;
}
$data = str_replace(“\r”,”",$data);
header(“Content-type: application/x-msdownload”);
header(“Content-Disposition: attachment; filename=$filename.xls”);
echo “$headers\n$data”;
return TRUE;
}
}
?>
[NOTE/DISCLAIMER: 100% copy and paste from http://codeigniter.com/wiki/Excel_Plugin/ ]
[NOTE: copy and paste from : http://www.symfony-project.org/jobeet/1_2/Propel/en/03 ]
According to the official YAML website, YAML is “is a human friendly data serialization standard for all programming languages”
Put another way, YAML is a simple language to describe data (strings, integers, dates, arrays, and hashes).
In YAML, structure is shown through indentation, sequence items are denoted by a dash, and key/value pairs within a map are separated by a colon. YAML also has a shorthand syntax to describe the same structure with fewer lines, where arrays are explicitly shown with [] and hashes with {}.
By Example, here is a YAML database schema
schema.yml
# config/schema.yml
propel:
jobeet_category:
id: ~
name: { type: varchar(255), required: true }
jobeet_job:
id: ~
category_id: { type: integer, foreignTable: jobeet_category, foreignReference: id, required: true }
type: { type: varchar(255) }
company: { type: varchar(255), required: true }
logo: { type: varchar(255) }
url: { type: varchar(255) }
position: { type: varchar(255), required: true }
location: { type: varchar(255), required: true }
description: { type: longvarchar, required: true }
how_to_apply: { type: longvarchar, required: true }
token: { type: varchar(255), required: true, index: unique }
is_public: { type: boolean, required: true, default: 1 }
is_activated: { type: boolean, required: true, default: 0 }
email: { type: varchar(255), required: true }
expires_at: { type: timestamp, required: true }
created_at: ~
updated_at: ~
jobeet_affiliate:
id: ~
url: { type: varchar(255), required: true }
email: { type: varchar(255), required: true, index: unique }
token: { type: varchar(255), required: true }
is_active: { type: boolean, required: true, default: 0 }
created_at: ~
jobeet_category_affiliate:
category_id: { type: integer, foreignTable: jobeet_category, foreignReference: id, required: true, primaryKey: true, onDelete: cascade }
affiliate_id: { type: integer, foreignTable: jobeet_affiliate, foreignReference: id, required: true, primaryKey: true, onDelete: cascade }
The schema.yml file contains the description of all tables and their columns. Each column is described with the following information:
type: The column type (boolean, tinyint, smallint, integer, bigint, double, float, real, decimal, char, varchar(size), longvarchar, date, time, timestamp, blob, and clob)
required: Set it to true if you want the column to be required
index: Set it to true if you want to create an index for the column or to unique if you want a unique index to be created on the column.
Filed under: Symfony
Symfony is an excellent framework which make programmer’s life more easier. fully structured, easy to build, debug and extend application.
First donwload symfony and extract into your web root.
Database: Some tools allow you to build a database graphically (for instance Fabforce’s Dbdesigner) and generate directly a schema.xml (with DB Designer 4 TO Propel Schema Converter).