Esempio n. 1
0
$core = new \ICanBoogie\Core(\ICanBoogie\array_merge_recursive(\ICanBoogie\get_autoconfig(), ['config-path' => [__DIR__ . DIRECTORY_SEPARATOR . 'config'], 'module-path' => [realpath(__DIR__ . '/../')]]));
$core();
#
# Install modules
#
$errors = new \ICanBoogie\Errors();
foreach (array_keys($core->modules->enabled_modules_descriptors) as $module_id) {
    #
    # The index on the `constructor` column of the `nodes` module clashes with SQLite, we don't
    # care right now, so the exception is discarted.
    #
    try {
        $core->modules[$module_id]->install($errors);
    } catch (\Exception $e) {
        $errors[$module_id] = "Unable to install module: " . $e->getMessage();
    }
}
if ($errors->count()) {
    foreach ($errors as $error) {
        echo "{$module_id}: {$error}\n";
    }
    exit(1);
}
#
# Create a user
#
use Icybee\Modules\Users\User;
use Icybee\Modules\Sites\Site;
User::from(['username' => 'admin', 'email' => '*****@*****.**'])->save();
Site::from(['title' => 'example'])->save();
Esempio n. 2
0
 public function provide_test_fallback_properties()
 {
     return [['constructor', [], 'nodes'], ['constructor', ['constructor' => 'images'], 'images'], ['language', ['site' => null], null], ['language', ['site' => Site::from(['language' => 'fr'])], 'fr'], ['language', ['site' => Site::from(['language' => 'fr']), 'language' => 'en'], 'en'], ['slug', [], ''], ['slug', ['title' => 'The quick brown fox'], 'the-quick-brown-fox'], ['slug', ['title' => 'The quick brown fox', 'slug' => 'quick-fox'], 'quick-fox']];
 }