Skip to content
This repository was archived by the owner on Aug 16, 2021. It is now read-only.

Dev #2

Merged
merged 5 commits into from
Apr 7, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ This is still in an early development phase. Features and API can change overnig
## External libraries
Some built in modules requires some libraries to be installed via composer:

- The RedBeanPHP module requires the [RedBeanPHP library](https://github.com/gabordemooij/redbean).
- The VeloxFacebook module requires the [Facebook PHP SDK](https://github.com/facebook/facebook-php-sdk).
- The Message::debug() method will output the code using [Krumo](https://github.com/oodle/krumo) if it's installed.
- The Sass module requires the [scssphp library](https://github.com/leafo/scssphp/).
7 changes: 7 additions & 0 deletions composer.example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"require": {
"leafo/scssphp": "dev-master",
"facebook/php-sdk": "@stable",
"oodle/krumo": "dev-master"
}
}
1 change: 0 additions & 1 deletion framework/classes/Module.inc
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@ class Module {

if (is_dir(VELOX_ROOT . '/' . $module_path)) {
self::$modules[$module] = $module_path;
self::$weights[$module] = 0;

// Stop after the first match in a directory
continue 2;
Expand Down
2 changes: 1 addition & 1 deletion framework/modules/ImageStyle/classes/ImageStyle.inc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class ImageStyle {
}

// Include effects class.
Module::loadInclude('ImageStyle', 'ImageStyleEffects.inc');
Module::loadInclude('ImageStyle', 'classes/ImageStyleEffects.inc');

$create_function = 'imagecreatefrom' . $type;
$save_function = 'image' . $type;
Expand Down
44 changes: 18 additions & 26 deletions framework/modules/RedBeanPHP/RedBeanPHP.inc
Original file line number Diff line number Diff line change
@@ -1,32 +1,24 @@
<?php
if (!class_exists('RedBean_Facade')) {
Message::set(
'Missing RedBeanPHP library. Install it using Composer.',
Message::ERROR
);
}
else {
class R extends RedBean_Facade {}

/**
* Configure RedBeanPHP.
*
* Configures all databases to RedBeanPHP.
*/
foreach (Settings::get('database', array()) as $dbkey => $dbinfo) {
$method = 'addDatabase';
Module::loadInclude('RedBeanPHP', 'lib/RedBeanPHP4_0_0/rb.phar');

// Setup RedBeanPHP with the default db
if ($dbkey == 'default') {
$method = 'setup';
}
/**
* Configure RedBeanPHP.
*
* Configures all databases to RedBeanPHP.
*/
foreach (Settings::get('database', array()) as $dbkey => $dbinfo) {
$method = 'addDatabase';

$args = Database::getConnectionArgs($dbinfo);
call_user_func_array(array('R', $method), $args);
// Setup RedBeanPHP with the default db
if ($dbkey == 'default') {
$method = 'setup';
}

// dont change the database after deployment
if (!Settings::get('development', false)) {
R::freeze(true);
}
$args = Database::getConnectionArgs($dbinfo);
call_user_func_array(array('R', $method), $args);
}

// dont change the database after deployment
if (!Settings::get('development', false)) {
R::freeze(true);
}
Loading