예제 #1
0
/**
 * Initializes the minify module.
 * 
 * Note that this module can be used best from SysAdmin!
 * @return void
 */
function minify_init()
{
    global $CONFIG;
    classpath_add(__DIR__ . "/minify/");
    admin_register_handler('Minify', 'MinifyAdmin', 'Start');
    cfg_check('minify', 'target_path', 'Minify module needs a target_path');
    cfg_check('minify', 'base_name', 'Minify module needs a base_name');
    cfg_check('minify', 'url', 'Minify module needs an url');
    register_hook_function(HOOK_PRE_RENDER, 'minify_pre_render_handler');
}
예제 #2
0
/**
 * Add a path to the classpath for autoloading classes
 * 
 * You can add complete trees with this when letting $recursive be true.
 * @param string $path folder name
 * @param bool $recursive add subfolders too?
 * @param string $part INTERNAL, let default to false
 * @return void
 */
function classpath_add($path, $recursive = true, $part = false)
{
    global $CONFIG;
    system_ensure_path_ending($path, true);
    if (!$part) {
        $part = $CONFIG['system']['application_name'];
    }
    $CONFIG['class_path'][$part][] = $path;
    if (!in_array($part, $CONFIG['class_path']['order'])) {
        $CONFIG['class_path']['order'][] = $part;
    }
    if ($recursive && is_dir($path)) {
        foreach (system_glob($path . '*', GLOB_MARK | GLOB_ONLYDIR | GLOB_NOSORT) as $sub) {
            classpath_add($sub, true, $part);
        }
    }
}
예제 #3
0
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library. If not, see <http://www.gnu.org/licenses/>
 *
 * @author Scavix Software Ltd. & Co. KG http://www.scavix.com <*****@*****.**>
 * @copyright since 2012 Scavix Software Ltd. & Co. KG
 * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
 */
// Pages are PHP classes extending HtmlPage
$CONFIG['system']['default_page'] = "Blog";
// Events are mapped to PHP class methods
$CONFIG['system']['default_event'] = "Index";
// Application specific classpath
classpath_add(__DIR__ . '/controller');
classpath_add(__DIR__ . '/templates');
// Database connection, a DSN passed to the PDO constructor
$CONFIG['model']['system']['connection_string'] = "sqlite:../blog.db";
// Logger Config
ini_set("error_log", __DIR__ . '/../logs/blog_php_error.log');
$CONFIG['system']['logging'] = array('human_readable' => array('path' => __DIR__ . '/../logs/', 'filename_pattern' => 'blog_wdf.log', 'log_severity' => true, 'max_filesize' => 10 * 1024 * 1024, 'keep_for_days' => 5, 'max_trace_depth' => 16), 'full_trace' => array('class' => 'TraceLogger', 'path' => __DIR__ . '/../logs/', 'filename_pattern' => 'blog_wdf.trace', 'log_severity' => true, 'max_trace_depth' => 10, 'max_filesize' => 10 * 1024 * 1024, 'keep_for_days' => 4));
// Resources config
$CONFIG['resources'][] = array('ext' => 'js|css|png|jpg|jpeg|gif|htc|ico', 'path' => realpath(__DIR__ . '/res/'), 'url' => 'res/', 'append_nc' => true);
// If you put WDF into a separate folder next to the app (like here), that folder must be externaly accessible.
// So maybe you'll have to set up a subdomain for it and set that to 'resources_system_url_root'.
// For now we just rely on the built in router that will output the resource contents via readfile().
$CONFIG['resources_system_url_root'] = false;
//$CONFIG['resources_system_url_root'] = 'http://wdf.domain.com/'; // <- sample
// some essentials
$CONFIG['system']['modules'] = array();
date_default_timezone_set("Europe/Berlin");
예제 #4
0
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library. If not, see <http://www.gnu.org/licenses/>
 *
 * @author Scavix Software Ltd. & Co. KG http://www.scavix.com <*****@*****.**>
 * @copyright since 2012 Scavix Software Ltd. & Co. KG
 * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
 */
// Pages are PHP classes extending HtmlPage
$CONFIG['system']['default_page'] = "Products";
// Events are mapped to PHP class methods
$CONFIG['system']['default_event'] = "Index";
// Application specific classpath
classpath_add(__DIR__ . '/controller');
classpath_add(__DIR__ . '/templates');
classpath_add(__DIR__ . '/model');
// Database connection, a DSN passed to the PDO constructor
$CONFIG['model']['system']['connection_string'] = "sqlite:../shop.db";
// Logger Config
ini_set("error_log", __DIR__ . '/../logs/shop_php_error.log');
$CONFIG['system']['logging'] = array('human_readable' => array('path' => __DIR__ . '/../logs/', 'filename_pattern' => 'shop_wdf.log', 'log_severity' => true, 'max_filesize' => 10 * 1024 * 1024, 'keep_for_days' => 5, 'max_trace_depth' => 16), 'full_trace' => array('class' => 'TraceLogger', 'path' => __DIR__ . '/../logs/', 'filename_pattern' => 'shop_wdf.trace', 'log_severity' => true, 'max_trace_depth' => 10, 'max_filesize' => 10 * 1024 * 1024, 'keep_for_days' => 4));
// Resources config
$CONFIG['resources'][] = array('ext' => 'js|css|png|jpg|jpeg|gif|htc|ico', 'path' => realpath(__DIR__ . '/res/'), 'url' => 'res/', 'append_nc' => true);
// this is products image folder.
// setting it up as resource folder allows us to simply use resFile() to reference a products image.
$CONFIG['resources'][] = array('ext' => 'png|jpg|jpeg|gif', 'path' => realpath(__DIR__ . '/images/'), 'url' => 'images/', 'append_nc' => true);
// some essentials
$CONFIG['system']['modules'] = array('payment');
date_default_timezone_set("Europe/Berlin");
// configure payment module with your IShopOrder class
$CONFIG["payment"]["order_model"] = 'SampleShopOrder';