-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcreate_core_addons.php
77 lines (70 loc) · 2.67 KB
/
create_core_addons.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
namespace Habari;
$habari_addon = Posts::get( array( 'content_type' => 'addon', 'slug' => 'habari' ) );
if ( count( $habari_addon ) == 0 ) {
$habari = Post::create( array(
'content_type' => Post::type( 'addon' ),
'title' => 'Habari',
'content' => file_get_contents( dirname( __FILE__ ) . '/addon.habari.txt' ),
'status' => Post::status('published'),
'tags' => array( 'habari' ),
'pubdate' => DateTime::date_create(),
'user_id' => User::identify()->id,
'slug' => 'habari',
) );
$habari->info->guid = '7a0313be-d8e3-11db-8314-0800200c9a66';
$habari->info->url = 'http://habariproject.org';
$habari->info->description = 'Habari is next-generation blogging.';
$habari->info->authors = array( array( 'name' => 'The Habari Community', 'url' => 'http://habariproject.org' ) );
$habari->info->licenses = array( array( 'name' => 'Apache License, Version 2.0', 'url' => 'http://www.apache.org/licenses/LICENSE-2.0' ) );
$habari->info->type = 'core';
$habari->info->commit();
$versions = array(
'0.9' => array(
'version' => '0.9',
'description' => 'Habari release 0.9',
'info_url' => 'http://wiki.habariproject.org/en/Release_0.9',
'url' => 'http://habariproject.org/dist/habari-0.9.zip',
'habari_version' => '0.9',
'severity' => 'feature',
'requires' => '',
'provides' => '',
'recommends' => '',
'release' => DateTime::date_create( '2012-11-20' )->sql,
),
);
$this->save_versions( $habari, $versions );
$wazi = Post::create( array(
'content_type' => Post::type( 'addon' ),
'title' => 'Wazi',
'content' => file_get_contents( Site::$config_path . '/system/themes/wazi/README' ),
'status' => Post::status('published'),
'tags' => array( 'habari', 'theme' ),
'pubdate' => DateTime::date_create(),
'user_id' => User::identify()->id,
'slug' => 'wazi',
) );
$wazi->info->guid = '';
$wazi->info->url = 'http://habariproject.org';
$wazi->info->description = 'Responsive theme included with Habari.';
$wazi->info->authors = array( array( 'name' => 'The Habari Community', 'url' => 'http://habariproject.org' ) );
$wazi->info->licenses = array( array( 'name' => 'Apache License, Version 2.0', 'url' => 'http://www.apache.org/licenses/LICENSE-2.0' ) );
$wazi->info->type = 'theme';
$wazi->info->commit();
$versions = array(
'0.9' => array(
'version' => '0.9',
'description' => 'Wazi',
'info_url' => 'http://wiki.habariproject.org/en/Release_0.9',
'url' => 'http://habariproject.org/dist/habari-0.9.zip',
'habari_version' => '0.9',
'severity' => 'feature',
'requires' => '',
'provides' => '',
'recommends' => '',
'release' => DateTime::date_create( '2012-11-20' )->sql,
),
);
$this->save_versions( $wazi, $versions );
}
?>