Skip to content
Newer
Older
100644 72 lines (63 sloc) 1.87 KB
4dd3790 @havvg added StorageInterface and PdoStorage
havvg authored
1 <?php
2
3 /*
4 * This file is part of the Sismo utility.
5 *
6 * (c) Fabien Potencier <fabien@symfony.com>
7 *
8 * This source file is subject to the MIT license that is bundled
9 * with this source code in the file LICENSE.
10 */
11
f1548d2 @fabpot restructured class namespaces
fabpot authored
12 namespace Sismo\Storage;
13
14 use Sismo\Project;
15 use Sismo\Commit;
4dd3790 @havvg added StorageInterface and PdoStorage
havvg authored
16
17 /**
18 * Stores projects and builds information.
19 *
20 * @author Toni Uebernickel <tuebernickel@gmail.com>
21 */
22 interface StorageInterface
23 {
24 /**
25 * Retrieves a commit out of a project.
26 *
27 * @throws \RuntimeException
28 *
29 * @param Project $project The project this commit is part of.
30 * @param string $sha The hash of the commit to retrieve.
31 *
32 * @return Commit
33 */
34 public function getCommit(Project $project, $sha);
35
36 /**
37 * Initiate, create and save a new commit.
38 *
39 * @param Project $project The project of the new commit.
40 * @param string $sha The hash of the commit.
41 * @param string $author The name of the author of the new commit.
42 * @param \DateTime $date The date the new commit was created originally (e.g. by external resources).
43 * @param string $message The commit message.
44 *
45 * @return Commit The newly created commit.
46 */
47 public function initCommit(Project $project, $sha, $author, \DateTime $date, $message);
48
49 /**
50 * Create or update the information of a project.
51 *
52 * If the project is already available, the information of the existing project will be updated.
53 *
54 * @param Project $project The project to create or update.
55 */
56 public function updateProject(Project $project);
57
58 /**
59 * Update the commits information.
60 *
61 * The commit is identified by its sha hash.
62 *
63 * @param Commit $commit
64 */
65 public function updateCommit(Commit $commit);
66
67 /**
68 * Shutdown the storage and all of its external resources.
69 */
70 public function close();
71 }
Something went wrong with that request. Please try again.