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

Commit

Permalink
v2.0.0-alpha.3
Browse files Browse the repository at this point in the history
  • Loading branch information
rijkvanzanten committed May 11, 2018
0 parents commit c2ac66c
Show file tree
Hide file tree
Showing 5,081 changed files with 471,904 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
10 changes: 10 additions & 0 deletions bin/build_directus.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
rm -rf .directus-build
git clone https://github.com/directus/directus.git .directus-build

pushd .directus-build
npm install
gulp build
gulp deploy
popd

rm -rf .directus-build
27 changes: 27 additions & 0 deletions bin/build_subtree.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
git subsplit init [email protected]:directus/directus.git

# Collection
git subsplit publish --heads="version/6.4" --no-tags --debug api/core/Directus/Collection:[email protected]:directus/directus-collection.git

# Config
git subsplit publish --heads="version/6.4" --no-tags --debug api/core/Directus/Config:[email protected]:directus/directus-config.git

# Permissions
git subsplit publish --heads="version/6.4" --no-tags --debug api/core/Directus/Permissions:[email protected]:directus/directus-permissions.git

# Database
git subsplit publish --heads="version/6.4" --no-tags --debug api/core/Directus/Database:[email protected]:directus/directus-database.git

# Filesystem
git subsplit publish --heads="version/6.4" --no-tags --debug api/core/Directus/Filesystem:[email protected]:directus/directus-filesystem.git

# Hash
git subsplit publish --heads="version/6.4" --no-tags --debug api/core/Directus/Hash:[email protected]:directus/directus-hash.git

# Hooks
git subsplit publish --heads="version/6.4" --no-tags --debug api/core/Directus/Hook:[email protected]:directus/directus-hook.git

# Utils
git subsplit publish --heads="version/6.4" --no-tags --debug api/core/Directus/Util:[email protected]:directus/directus-php-utils.git

rm -rf .subsplit
11 changes: 11 additions & 0 deletions bin/directus
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env php
<?php

$basePath = realpath(__DIR__ . '/../');
// Composer Autoloader
$loader = require $basePath . '/vendor/autoload.php';

$cli = new \Directus\Console\Cli($basePath);
$cli->run();

?>
25 changes: 25 additions & 0 deletions bin/runtests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh

#
# Command line runner for unit tests for composer projects
# (c) Del 2015 http://www.babel.com.au/
# No Rights Reserved
#

#
# Clean up after any previous test runs
#
mkdir -p documents
rm -rf documents/coverage-html-new
rm -f documents/coverage.xml

#
# Run phpunit
#
vendor/bin/phpunit --coverage-html documents/coverage-html-new --coverage-clover documents/coverage.xml

if [ -d documents/coverage-html-new ]; then
rm -rf documents/coverage-html
mv documents/coverage-html-new documents/coverage-html
fi

145 changes: 145 additions & 0 deletions config/api_sample.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
<?php

return [
'app' => [
'path' => '/',
'env' => 'production',
'debug' => false,
'default_language' => 'en',
'timezone' => 'America/New_York',
],

'settings' => [
'debug' => false,
'displayErrorDetails' => false,
'logger' => [
'name' => 'directus-api',
'level' => Monolog\Logger::DEBUG,
'path' => __DIR__ . '/logs/app.log',
],
],

'database' => [
'type' => 'mysql',
'host' => 'localhost',
'port' => 3306,
'name' => 'directus',
'username' => 'root',
'password' => 'pass',
'prefix' => '', // not used
'engine' => 'InnoDB',
'charset' => 'utf8mb4'
],

'cache' => [
'enabled' => false,
'response_ttl' => 3600, // seconds
'adapter' => 'filesystem',
'path' => '/storage/cache',
// 'pool' => [
// 'adapter' => 'apc'
// ],
// 'pool' => [
// 'adapter' => 'apcu'
// ],
// 'pool' => [
// 'adapter' => 'filesystem',
// 'path' => '../cache/', // relative to the api directory
// ],
// 'pool' => [
// 'adapter' => 'memcached',
// 'host' => 'localhost',
// 'port' => 11211
// ],
// 'pool' => [
// 'adapter' => 'redis',
// 'host' => 'localhost',
// 'port' => 6379
// ],
],

'filesystem' => [
'adapter' => 'local',
// By default media directory are located at the same level of directus root
// To make them a level up outsite the root directory
// use this instead
// Ex: 'root' => realpath(ROOT_PATH.'/../storage/uploads'),
// Note: ROOT_PATH constant doesn't end with trailing slash
'root' => 'storage/uploads',
// This is the url where all the media will be pointing to
// here all assets will be (yourdomain)/storage/uploads
// same with thumbnails (yourdomain)/storage/uploads/thumbs
'root_url' => '/storage/uploads',
'root_thumb_url' => '/storage/uploads/thumbs',
// 'key' => 's3-key',
// 'secret' => 's3-key',
// 'region' => 's3-region',
// 'version' => 's3-version',
// 'bucket' => 's3-bucket'
],

// HTTP Settings
'http' => [
'emulate_enabled' => false,
// can be null, or an array list of method to be emulated
// Ex: ['PATH', 'DELETE', 'PUT']
// 'emulate_methods' => null,
'force_https' => false
],

'mail' => [
'transport' => 'mail',
'from' => '[email protected]'
],

'cors' => [
'enabled' => false,
'origin' => ['*'],
'headers' => [
['Access-Control-Allow-Headers', 'Authorization, Content-Type, Access-Control-Allow-Origin'],
['Access-Control-Allow-Methods', 'GET,POST,PUT,PATCH,DELETE'],
['Access-Control-Allow-Credentials', 'false']
]
],

'hooks' => [],

'filters' => [],

'feedback' => [
'token' => 'a-kind-of-unique-token',
'login' => true
],

// These tables will not be loaded in the directus schema
'tableBlacklist' => [],

'auth' => [
'secret_key' => '<secret-authentication-key>',
'social_providers' => [
// 'okta' => [
// 'client_id' => '',
// 'client_secret' => '',
// 'base_url' => 'https://dev-000000.oktapreview.com/oauth2/default'
// ],
// 'github' => [
// 'client_id' => '',
// 'client_secret' => ''
// ],
// 'facebook' => [
// 'client_id' => '',
// 'client_secret' => '',
// 'graph_api_version' => 'v2.8',
// ],
// 'google' => [
// 'client_id' => '',
// 'client_secret' => '',
// 'hosted_domain' => '*',
// ],
// 'twitter' => [
// 'identifier' => '',
// 'secret' => ''
// ]
]
],
];
15 changes: 15 additions & 0 deletions config/migrations.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

return [
'paths' => [
'migrations' => '%%PHINX_CONFIG_DIR%%/../migrations/db/schemas',
'seeds' => '%%PHINX_CONFIG_DIR%%/../migrations/db/seeds'
],

'version_order' => 'creation',

'environments' => [
'default_migration_table' => 'directus_migrations',
'default_database' => 'development'
]
];
Empty file added logs/.gitkeep
Empty file.
2 changes: 2 additions & 0 deletions logs/debug.2018-05.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[2018-05-11 18:09:02] app.ERROR: auth provider "okta" does not exist. [] []
[2018-05-11 18:09:07] app.ERROR: Only Admin can see this information [] []
76 changes: 76 additions & 0 deletions migrations/db/schemas/20180220023138_create_activity_table.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?php

use Phinx\Migration\AbstractMigration;

class CreateActivityTable extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('directus_activity', ['signed' => false]);

$table->addColumn('type', 'string', [
'limit' => 45,
'null' => false
]);

$table->addColumn('action', 'string', [
'limit' => 45,
'null' => false
]);

$table->addColumn('user', 'integer', [
'signed' => false,
'null' => false,
'default' => 0
]);

$table->addColumn('datetime', 'datetime', [
'default' => null
]);

$table->addColumn('ip', 'string', [
'limit' => 50,
'default' => null
]);

$table->addColumn('user_agent', 'string', [
'limit' => 255
]);

$table->addColumn('collection', 'string', [
'limit' => 64,
'null' => false
]);

$table->addColumn('item', 'string',[
'limit' => 255
]);

$table->addColumn('message', 'text', [
'null' => true
]);

$table->create();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?php

use Phinx\Migration\AbstractMigration;

class CreateActivityReadTable extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('directus_activity_read', ['signed' => false]);

$table->addColumn('activity', 'integer', [
'null' => false,
'signed' => false
]);

$table->addColumn('user', 'integer', [
'signed' => false,
'null' => false,
'default' => 0
]);

// TODO: Add the time when this was read?
// $table->addColumn('datetime', 'datetime', [
// 'default' => null
// ]);

$table->addColumn('read', 'boolean', [
'signed' => false,
'default' => false
]);

$table->addColumn('archived', 'boolean', [
'signed' => false,
'default' => false
]);

$table->create();
}
}

0 comments on commit c2ac66c

Please sign in to comment.