Skip to content
This repository was archived by the owner on Jan 6, 2023. It is now read-only.

Commit 838f4eb

Browse files
committed
v2.0.0-alpha.6
0 parents  commit 838f4eb

File tree

5,519 files changed

+530692
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

5,519 files changed

+530692
-0
lines changed

.DS_Store

6 KB
Binary file not shown.

bin/build_directus.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
rm -rf .directus-build
2+
git clone https://github.com/directus/directus.git .directus-build
3+
4+
pushd .directus-build
5+
npm install
6+
gulp build
7+
gulp deploy
8+
popd
9+
10+
rm -rf .directus-build

bin/build_subtree.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
git subsplit init git@github.com:directus/directus.git
2+
3+
# Collection
4+
git subsplit publish --heads="version/6.4" --no-tags --debug api/core/Directus/Collection:git@github.com:directus/directus-collection.git
5+
6+
# Config
7+
git subsplit publish --heads="version/6.4" --no-tags --debug api/core/Directus/Config:git@github.com:directus/directus-config.git
8+
9+
# Permissions
10+
git subsplit publish --heads="version/6.4" --no-tags --debug api/core/Directus/Permissions:git@github.com:directus/directus-permissions.git
11+
12+
# Database
13+
git subsplit publish --heads="version/6.4" --no-tags --debug api/core/Directus/Database:git@github.com:directus/directus-database.git
14+
15+
# Filesystem
16+
git subsplit publish --heads="version/6.4" --no-tags --debug api/core/Directus/Filesystem:git@github.com:directus/directus-filesystem.git
17+
18+
# Hash
19+
git subsplit publish --heads="version/6.4" --no-tags --debug api/core/Directus/Hash:git@github.com:directus/directus-hash.git
20+
21+
# Hooks
22+
git subsplit publish --heads="version/6.4" --no-tags --debug api/core/Directus/Hook:git@github.com:directus/directus-hook.git
23+
24+
# Utils
25+
git subsplit publish --heads="version/6.4" --no-tags --debug api/core/Directus/Util:git@github.com:directus/directus-php-utils.git
26+
27+
rm -rf .subsplit

bin/directus

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env php
2+
<?php
3+
4+
$basePath = realpath(__DIR__ . '/../');
5+
// Composer Autoloader
6+
$loader = require $basePath . '/vendor/autoload.php';
7+
8+
$cli = new \Directus\Console\Cli($basePath);
9+
$cli->run();
10+
11+
?>

bin/runtests.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/sh
2+
3+
#
4+
# Command line runner for unit tests for composer projects
5+
# (c) Del 2015 http://www.babel.com.au/
6+
# No Rights Reserved
7+
#
8+
9+
#
10+
# Clean up after any previous test runs
11+
#
12+
mkdir -p documents
13+
rm -rf documents/coverage-html-new
14+
rm -f documents/coverage.xml
15+
16+
#
17+
# Run phpunit
18+
#
19+
vendor/bin/phpunit --coverage-html documents/coverage-html-new --coverage-clover documents/coverage.xml
20+
21+
if [ -d documents/coverage-html-new ]; then
22+
rm -rf documents/coverage-html
23+
mv documents/coverage-html-new documents/coverage-html
24+
fi
25+

config/api_sample.php

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
<?php
2+
3+
return [
4+
'app' => [
5+
'path' => '/',
6+
'env' => 'development',
7+
'debug' => true,
8+
'default_language' => 'en',
9+
'timezone' => 'America/New_York',
10+
],
11+
12+
'settings' => [
13+
'debug' => true,
14+
'displayErrorDetails' => true,
15+
'logger' => [
16+
'name' => 'directus-api',
17+
'level' => Monolog\Logger::DEBUG,
18+
'path' => __DIR__ . '/logs/app.log',
19+
],
20+
],
21+
22+
'database' => [
23+
'type' => 'mysql',
24+
'host' => 'localhost',
25+
'port' => 3306,
26+
'name' => 'directus',
27+
'username' => 'root',
28+
'password' => 'pass',
29+
'prefix' => '', // not used
30+
'engine' => 'InnoDB',
31+
'charset' => 'utf8mb4'
32+
],
33+
34+
'cache' => [
35+
'enabled' => false,
36+
'response_ttl' => 3600, // seconds
37+
'adapter' => 'filesystem',
38+
'path' => '/storage/cache',
39+
// 'pool' => [
40+
// 'adapter' => 'apc'
41+
// ],
42+
// 'pool' => [
43+
// 'adapter' => 'apcu'
44+
// ],
45+
// 'pool' => [
46+
// 'adapter' => 'filesystem',
47+
// 'path' => '../cache/', // relative to the api directory
48+
// ],
49+
// 'pool' => [
50+
// 'adapter' => 'memcached',
51+
// 'host' => 'localhost',
52+
// 'port' => 11211
53+
// ],
54+
// 'pool' => [
55+
// 'adapter' => 'redis',
56+
// 'host' => 'localhost',
57+
// 'port' => 6379
58+
// ],
59+
],
60+
61+
'filesystem' => [
62+
'adapter' => 'local',
63+
// By default media directory are located at the same level of directus root
64+
// To make them a level up outsite the root directory
65+
// use this instead
66+
// Ex: 'root' => realpath(ROOT_PATH.'/../storage/uploads'),
67+
// Note: ROOT_PATH constant doesn't end with trailing slash
68+
'root' => 'storage/uploads',
69+
// This is the url where all the media will be pointing to
70+
// here all assets will be (yourdomain)/storage/uploads
71+
// same with thumbnails (yourdomain)/storage/uploads/thumbs
72+
'root_url' => '/storage/uploads',
73+
'root_thumb_url' => '/storage/uploads/thumbs',
74+
// 'key' => 's3-key',
75+
// 'secret' => 's3-key',
76+
// 'region' => 's3-region',
77+
// 'version' => 's3-version',
78+
// 'bucket' => 's3-bucket'
79+
],
80+
81+
// HTTP Settings
82+
'http' => [
83+
'emulate_enabled' => false,
84+
// can be null, or an array list of method to be emulated
85+
// Ex: ['PATH', 'DELETE', 'PUT']
86+
// 'emulate_methods' => null,
87+
'force_https' => false
88+
],
89+
90+
'mail' => [
91+
'transport' => 'mail',
92+
'from' => 'admin@admin.com'
93+
],
94+
95+
'cors' => [
96+
'enabled' => false,
97+
'origin' => ['*'],
98+
'headers' => [
99+
['Access-Control-Allow-Headers', 'Authorization, Content-Type, Access-Control-Allow-Origin'],
100+
['Access-Control-Allow-Methods', 'GET,POST,PUT,PATCH,DELETE'],
101+
['Access-Control-Allow-Credentials', 'false']
102+
]
103+
],
104+
105+
'hooks' => [],
106+
107+
'filters' => [],
108+
109+
'feedback' => [
110+
'token' => 'a-kind-of-unique-token',
111+
'login' => true
112+
],
113+
114+
// These tables will not be loaded in the directus schema
115+
'tableBlacklist' => [],
116+
117+
'auth' => [
118+
'secret_key' => '<secret-authentication-key>',
119+
'social_providers' => [
120+
// 'okta' => [
121+
// 'client_id' => '',
122+
// 'client_secret' => '',
123+
// 'base_url' => 'https://dev-000000.oktapreview.com/oauth2/default'
124+
// ],
125+
// 'github' => [
126+
// 'client_id' => '',
127+
// 'client_secret' => ''
128+
// ],
129+
// 'facebook' => [
130+
// 'client_id' => '',
131+
// 'client_secret' => '',
132+
// 'graph_api_version' => 'v2.8',
133+
// ],
134+
// 'google' => [
135+
// 'client_id' => '',
136+
// 'client_secret' => '',
137+
// 'hosted_domain' => '*',
138+
// ],
139+
// 'twitter' => [
140+
// 'identifier' => '',
141+
// 'secret' => ''
142+
// ]
143+
]
144+
],
145+
];

config/migrations.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
return [
4+
'paths' => [
5+
'migrations' => '%%PHINX_CONFIG_DIR%%/../migrations/db/schemas',
6+
'seeds' => '%%PHINX_CONFIG_DIR%%/../migrations/db/seeds'
7+
],
8+
9+
'version_order' => 'creation',
10+
11+
'environments' => [
12+
'default_migration_table' => 'directus_migrations',
13+
'default_database' => 'development'
14+
]
15+
];

logs/.gitkeep

Whitespace-only changes.
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<?php
2+
3+
use Phinx\Migration\AbstractMigration;
4+
5+
class CreateActivityTable extends AbstractMigration
6+
{
7+
/**
8+
* Change Method.
9+
*
10+
* Write your reversible migrations using this method.
11+
*
12+
* More information on writing migrations is available here:
13+
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
14+
*
15+
* The following commands can be used in this method and Phinx will
16+
* automatically reverse them when rolling back:
17+
*
18+
* createTable
19+
* renameTable
20+
* addColumn
21+
* renameColumn
22+
* addIndex
23+
* addForeignKey
24+
*
25+
* Remember to call "create()" or "update()" and NOT "save()" when working
26+
* with the Table class.
27+
*/
28+
public function change()
29+
{
30+
$table = $this->table('directus_activity', ['signed' => false]);
31+
32+
$table->addColumn('type', 'string', [
33+
'limit' => 45,
34+
'null' => false
35+
]);
36+
37+
$table->addColumn('action', 'string', [
38+
'limit' => 45,
39+
'null' => false
40+
]);
41+
42+
$table->addColumn('user', 'integer', [
43+
'signed' => false,
44+
'null' => false,
45+
'default' => 0
46+
]);
47+
48+
$table->addColumn('datetime', 'datetime', [
49+
'default' => null
50+
]);
51+
52+
$table->addColumn('ip', 'string', [
53+
'limit' => 50,
54+
'default' => null
55+
]);
56+
57+
$table->addColumn('user_agent', 'string', [
58+
'limit' => 255
59+
]);
60+
61+
$table->addColumn('collection', 'string', [
62+
'limit' => 64,
63+
'null' => false
64+
]);
65+
66+
$table->addColumn('item', 'string',[
67+
'limit' => 255
68+
]);
69+
70+
$table->addColumn('datetime_edited', 'datetime', [
71+
'default' => null
72+
]);
73+
74+
$table->addColumn('comment', 'text', [
75+
'null' => true
76+
]);
77+
78+
$table->addColumn('deleted_comment', 'boolean', [
79+
'signed' => false,
80+
'null' => true,
81+
'default' => false
82+
]);
83+
84+
$table->create();
85+
}
86+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?php
2+
3+
use Phinx\Migration\AbstractMigration;
4+
5+
class CreateActivityReadTable extends AbstractMigration
6+
{
7+
/**
8+
* Change Method.
9+
*
10+
* Write your reversible migrations using this method.
11+
*
12+
* More information on writing migrations is available here:
13+
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
14+
*
15+
* The following commands can be used in this method and Phinx will
16+
* automatically reverse them when rolling back:
17+
*
18+
* createTable
19+
* renameTable
20+
* addColumn
21+
* renameColumn
22+
* addIndex
23+
* addForeignKey
24+
*
25+
* Remember to call "create()" or "update()" and NOT "save()" when working
26+
* with the Table class.
27+
*/
28+
public function change()
29+
{
30+
$table = $this->table('directus_activity_read', ['signed' => false]);
31+
32+
$table->addColumn('activity', 'integer', [
33+
'null' => false,
34+
'signed' => false
35+
]);
36+
37+
$table->addColumn('user', 'integer', [
38+
'signed' => false,
39+
'null' => false,
40+
'default' => 0
41+
]);
42+
43+
// TODO: Add the time when this was read?
44+
// $table->addColumn('datetime', 'datetime', [
45+
// 'default' => null
46+
// ]);
47+
48+
$table->addColumn('read', 'boolean', [
49+
'signed' => false,
50+
'default' => false
51+
]);
52+
53+
$table->addColumn('archived', 'boolean', [
54+
'signed' => false,
55+
'default' => false
56+
]);
57+
58+
$table->create();
59+
}
60+
}

0 commit comments

Comments
 (0)