Skip to content

Commit 4bce5e3

Browse files
introducing lock file
1 parent 6a38664 commit 4bce5e3

File tree

3 files changed

+65
-0
lines changed

3 files changed

+65
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.idea/
22
build/
33
vendor/
4+
tests/fixtures/*.lock
45
composer.lock
56
*.log

src/MysqlImport.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,8 @@ public function import()
262262
}
263263
}
264264

265+
$this->writeLockFile();
266+
265267
return $this->message("database named '{$this->database}' successfully imported.");
266268
}
267269

@@ -322,6 +324,18 @@ protected function messageUnknownOption()
322324
);
323325
}
324326

327+
/**
328+
*
329+
*/
330+
protected function writeLockFile()
331+
{
332+
$json = [
333+
'database' => $this->database
334+
];
335+
336+
file_put_contents($this->lockFile, json_encode($json, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
337+
}
338+
325339
/**
326340
* Get exit code after run.
327341
*
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
-- phpMyAdmin SQL Dump
2+
-- version 3.3.9
3+
-- http://www.phpmyadmin.net
4+
--
5+
-- Host: localhost
6+
-- Generation Time: Feb 08, 2014 at 06:53 AM
7+
-- Server version: 5.1.36
8+
-- PHP Version: 5.3.0
9+
10+
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
11+
12+
--
13+
-- Database: `database`
14+
--
15+
16+
-- --------------------------------------------------------
17+
18+
--
19+
-- Table structure for table `agents`
20+
--
21+
22+
CREATE TABLE IF NOT EXISTS `small_agents` (
23+
`AGENT_ID` INT(11) NOT NULL AUTO_INCREMENT,
24+
`AGENT_NAME` varchar(40) DEFAULT NULL,
25+
`WORKING_AREA` varchar(35) DEFAULT NULL,
26+
`COMMISSION` decimal(10,2) DEFAULT NULL,
27+
`PHONE_NO` varchar(15) DEFAULT NULL,
28+
`COUNTRY` varchar(25) DEFAULT NULL,
29+
PRIMARY KEY (`AGENT_ID`)
30+
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
31+
32+
--
33+
-- Dumping data for table `agents`
34+
--
35+
36+
INSERT INTO `small_agents` (`AGENT_NAME`, `WORKING_AREA`, `COMMISSION`, `PHONE_NO`, `COUNTRY`) VALUES
37+
('Ramasundar', 'Bangalore', '0.15', '077-25814763', ''),
38+
('Alex', 'London', '0.13', '075-12458969', ''),
39+
('Alford', 'New York', '0.12', '044-25874365', ''),
40+
('Ravi Kumar', 'Bangalore', '0.15', '077-45625874', ''),
41+
('Santakumar', 'Chennai', '0.14', '007-22388644', ''),
42+
('Lucida', 'San Jose', '0.12', '044-52981425', ''),
43+
('Anderson', 'Brisban', '0.13', '045-21447739', ''),
44+
('Subbarao', 'Bangalore', '0.14', '077-12346674', ''),
45+
('Mukesh', 'Mumbai', '0.11', '029-12358964', ''),
46+
('McDen', 'London', '0.15', '078-22255588', ''),
47+
('Ivan', 'Torento', '0.15', '008-22544166', ''),
48+
('Benjamin', 'Hampshair', '0.11', '008-22536178', '')
49+
50+
-- --------------------------------------------------------

0 commit comments

Comments
 (0)