Пример #1
1
function factory($type, $native = null)
{
    loader('dyn');
    $what = ucfirst(Inflector::camelize($type . '_factory'));
    $class = 'Thin\\' . $what;
    if (!class_exists($class)) {
        $code = 'namespace Thin; class ' . $what . ' extends DynLib {}';
        eval($code);
    }
    return new $class($native);
}
Пример #2
0
function loader($path)
{
    foreach (scandir($path) as $filename) {
        if ($filename === '.' || $filename === '..') {
            continue;
        }
        $fullPath = $path . '/' . $filename;
        if (is_file($fullPath)) {
            require_once $fullPath;
        } elseif (is_dir($fullPath)) {
            loader($fullPath);
        }
    }
}
Пример #3
0
function add($filename, $patterns)
{
    if (!is_string($filename)) {
        throw new \Exception('$filename argument must be string');
    }
    if (is_string($patterns)) {
        $patterns = array($patterns);
    } else {
        if (!is_array($patterns)) {
            throw new \Exception('$patterns argument must be string or array');
        }
    }
    $fullPath = implode('/', fromStack());
    $fullFilename = empty($fullPath) ? $fullPath . '/' . $filename : $filename;
    $module = new Module($filename, realpath($fullFilename), $patterns);
    loader()->addModule($module);
    return $module;
}
Пример #4
0
<?php

/**
 * Thin is a swift Framework for PHP 5.4+
 *
 * @package    Thin
 * @version    1.0
 * @author     Gerald Plusquellec
 * @license    BSD License
 * @copyright  1996 - 2015 Gerald Plusquellec
 * @link       http://github.com/schpill/thin
 */
namespace Thin;

loader('session');
class SessionCore extends SessionLib
{
}
Пример #5
0
?>
"></div>
        <?/*end comments*/?>
    </div>
    <?/*form*/?>
        <?include($_SERVER['DOCUMENT_ROOT'].'/includes/product/reviews/form.php');?>
    <?/*end form*/?>

</div>
<div class="tab-content-item" id="<?php 
echo $arParams['ROUTE_STORE'];
?>
">
    <div class="container">
        <?php 
echo loader($arParams['ROUTE_STORE']);
?>
        <?/*store*/?>
        <div id="route-<?php 
echo $arParams['ROUTE_STORE'];
?>
"></div>
        <?/*end store*/?>
    </div>
</div>
</div>
</div>
<?/*end more info and tabs*/?>
</div>

Пример #6
0
 function log_message($level = "error", $message = "")
 {
     static $_log;
     $_log =& loader("Log");
     $_log->write_function($level, $message);
 }
Пример #7
0
<?php

/**
 * Thin is a swift Framework for PHP 5.4+
 *
 * @package    Thin
 * @version    1.0
 * @author     Gerald Plusquellec
 * @license    BSD License
 * @copyright  1996 - 2016 Gerald Plusquellec
 * @link       http://github.com/schpill/thin
 */
namespace Thin;

loader('pipeline');
class QueueCore extends PipelineLib
{
}
Пример #8
0
<?php

/**
 * Thin is a swift Framework for PHP 5.4+
 *
 * @package    Thin
 * @version    1.0
 * @author     Gerald Plusquellec
 * @license    BSD License
 * @copyright  1996 - 2015 Gerald Plusquellec
 * @link       http://github.com/schpill/thin
 */
namespace Thin;

loader('misc');
class FluentCore extends MiscLib
{
}
Пример #9
0
<?php

/**
 * Thin is a swift Framework for PHP 5.4+
 *
 * @package    Thin
 * @version    1.0
 * @author     Gerald Plusquellec
 * @license    BSD License
 * @copyright  1996 - 2015 Gerald Plusquellec
 * @link       http://github.com/schpill/thin
 */
namespace Thin;

loader('ephemere');
class CacheCore extends EphemereLib
{
}
Пример #10
0
/**
 * scripts
 *
 * @since 1.2.1
 * @deprecated 2.0.0
 *
 * @package Redaxscript
 * @category Loader
 * @author Henry Ruhs
 *
 * @param string $mode
 */
function scripts($mode = '')
{
    if ($mode == '') {
        $output = Redaxscript\Hook::trigger('script_start');
    }
    /* parse loader ini */
    $loader_ini = parse_ini_file('templates/' . Redaxscript\Registry::get('template') . '/scripts/.loader', 1);
    /* inherit from other templates */
    $loader_inherit = $loader_ini['inherit'];
    if ($loader_inherit) {
        foreach ($loader_inherit as $key => $template) {
            $loader_inherit_ini = parse_ini_file('templates/' . $template . '/scripts/.loader', 1);
            $loader_ini = array_merge_recursive($loader_inherit_ini, $loader_ini);
        }
    }
    $loader_minify = $loader_ini['settings']['minify'];
    /* init mode */
    if ($mode == 'init') {
        $output .= '<script> /* <![cdata[ */ ' . loader('scripts', 'init') . ' /* ]]> */ </script>' . PHP_EOL;
    } else {
        $loader_single = $loader_ini['single'];
        /* logged in */
        if (LOGGED_IN == TOKEN) {
            $loader_admin_single = $loader_ini['admin_single'];
        }
        $loader_deploy = $loader_ini['settings']['deploy'];
        /* merge loader include as needed */
        $loader_include = array();
        if ($loader_single) {
            $loader_include = array_merge($loader_include, $loader_single);
        }
        if ($loader_admin_single) {
            $loader_include = array_merge($loader_include, $loader_admin_single);
        }
        /* collect output */
        if ($loader_include) {
            foreach ($loader_include as $value) {
                $output .= '<script src="' . $value . '"></script>' . PHP_EOL;
            }
        }
        /* type of deployment */
        $output .= '<script> /* <![cdata[ */ ' . scripts_transport($loader_minify);
        if ($loader_deploy == 'inline') {
            $output .= loader('scripts', 'inline') . ' /* ]]> */ </script>' . PHP_EOL;
        } else {
            $output .= ' /* ]]> */ </script>' . PHP_EOL;
            $output .= '<script src="' . REWRITE_ROUTE . 'loader/scripts"></script>' . PHP_EOL;
        }
    }
    if ($mode == '') {
        $output .= Redaxscript\Hook::trigger('script_end');
    }
    echo $output;
}
Пример #11
0
<?php

/**
 * Thin is a swift Framework for PHP 5.4+
 *
 * @package    Thin
 * @version    1.0
 * @author     Gerald Plusquellec
 * @license    BSD License
 * @copyright  1996 - 2015 Gerald Plusquellec
 * @link       http://github.com/schpill/thin
 */
namespace Thin;

loader('redys');
class RedisCore extends RedysLib
{
}
Пример #12
0
<?php

/**
 * Thin is a swift Framework for PHP 5.4+
 *
 * @package    Thin
 * @version    1.0
 * @author     Gerald Plusquellec
 * @license    BSD License
 * @copyright  1996 - 2013 Gerald Plusquellec
 * @link       http://github.com/schpill/thin
 */
namespace Thin;

loader('loop');
class PromiseLib
{
    /**
     * The asynchronous operation is pending.
     */
    const PENDING = 0;
    /**
     * The asynchronous operation has completed, and has a result.
     */
    const FULFILLED = 1;
    /**
     * The asynchronous operation has completed with an error.
     */
    const REJECTED = 2;
    /**
     * The current state of this promise.
Пример #13
0
<?php

/**
 * Thin is a swift Framework for PHP 5.4+
 *
 * @package    Thin
 * @version    1.0
 * @author     Gerald Plusquellec
 * @license    BSD License
 * @copyright  1996 - 2016 Gerald Plusquellec
 * @link       http://github.com/schpill/thin
 */
namespace Thin;

loader('app');
class ContainerCore extends AppLib
{
}
Пример #14
0
<?php

/**
 * Thin is a swift Framework for PHP 5.4+
 *
 * @package    Thin
 * @version    1.0
 * @author     Gerald Plusquellec
 * @license    BSD License
 * @copyright  1996 - 2015 Gerald Plusquellec
 * @link       http://github.com/schpill/thin
 */
namespace Thin;

loader('mailer');
class MailCore extends MailerLib
{
}
Пример #15
0
<?php

/**
 * Thin is a swift Framework for PHP 5.4+
 *
 * @package    Thin
 * @version    1.0
 * @author     Gerald Plusquellec
 * @license    BSD License
 * @copyright  1996 - 2015 Gerald Plusquellec
 * @link       http://github.com/schpill/thin
 */
namespace Thin;

loader('log');
class LogCore extends LogLib
{
}
Пример #16
0
function load($loader)
{
    $loader =& loader();
    $loader->add_loader($loader);
}
Пример #17
0
<?php

/**
 * Thin is a swift Framework for PHP 5.4+
 *
 * @package    Thin
 * @version    1.0
 * @author     Gerald Plusquellec
 * @license    BSD License
 * @copyright  1996 - 2016 Gerald Plusquellec
 * @link       http://github.com/schpill/thin
 */
namespace Thin;

loader('routing');
class RouterCore extends RoutingLib
{
}
Пример #18
0
<?php

/**
 * Thin is a swift Framework for PHP 5.4+
 *
 * @package    Thin
 * @version    1.0
 * @author     Gerald Plusquellec
 * @license    BSD License
 * @copyright  1996 - 2015 Gerald Plusquellec
 * @link       http://github.com/schpill/thin
 */
namespace Thin;

loader('flat');
class LiteCore extends FlatLib
{
}
Пример #19
0
<?php

loader()->registerNamespace("Kylewm\\Brevity", __DIR__ . '/external/brevity-php/src');
Пример #20
0
<?php

namespace Thin;

loader("model");
class BlazzSystemDbModel extends ModelLib
{
    /* Make hooks of model */
    public function _hooks()
    {
        $obj = $this;
        // $this->_hooks['beforeCreate'] = function () use ($obj) {};
        // $this->_hooks['beforeRead'] = ;
        // $this->_hooks['beforeUpdate'] = ;
        // $this->_hooks['beforeDelete'] = ;
        // $this->_hooks['afterCreate'] = ;
        // $this->_hooks['afterRead'] = ;
        // $this->_hooks['afterUpdate'] = ;
        // $this->_hooks['afterDelete'] = ;
        // $this->_hooks['validate'] = function () use ($data) {
        //     return true;
        // };
    }
}
Пример #21
0
<?php

/**
 * Thin is a swift Framework for PHP 5.4+
 *
 * @package    Thin
 * @version    1.0
 * @author     Gerald Plusquellec
 * @license    BSD License
 * @copyright  1996 - 2015 Gerald Plusquellec
 * @link       http://github.com/schpill/thin
 */
namespace Thin;

loader('now');
class RegistryCore extends NowLib
{
}
Пример #22
0
<?php

// require __DIR__ . '/vendor/autoload.php';
if (!function_exists('\\BarnabyWalters\\Mf2\\hasNumericKeys')) {
    require_once __DIR__ . '/external/barnabywalters/mf-cleaner/src/BarnabyWalters/Mf2/Functions.php';
}
require_once __DIR__ . '/external/indieweb/link-rel-parser/src/IndieWeb/link_rel_parser.php';
loader()->registerNamespace('IndieAuth', dirname(__FILE__) . '/external/indieauth/client/src');
Пример #23
0
<?php

/**
 * Thin is a swift Framework for PHP 5.4+
 *
 * @package    Thin
 * @version    1.0
 * @author     Gerald Plusquellec
 * @license    BSD License
 * @copyright  1996 - 2015 Gerald Plusquellec
 * @link       http://github.com/schpill/thin
 */
namespace Thin;

loader('collection');
class CollectionCore extends CollectionLib
{
}
Пример #24
0
<?php

/**
 * Thin is a swift Framework for PHP 5.4+
 *
 * @package    Thin
 * @version    1.0
 * @author     Gerald Plusquellec
 * @license    BSD License
 * @copyright  1996 - 2015 Gerald Plusquellec
 * @link       http://github.com/schpill/thin
 */
namespace Thin;

loader('array');
class ArrayCore extends ArrayLib
{
}
define("DATABASE_SETTINGS", TRUE);
// Database "connection_settings.php" Settings File
define("TEMPLATE_FILE", TRUE);
// Current "template.php" File In Use
define("TEMPLATE_FUNCTIONS_LOADER", TRUE);
// Current Website Template Design Functions Includer/Loader "template_functions.php"
define("TEMPLATE_CONFIG", TRUE);
// Template Config File "template_config.php"
define("PAGES_FOLDER_GENERATORS", TRUE);
// Content Generator Files (controller.php / compiler.php)
define("CONFIG_FILE", TRUE);
// Normal Config File "config.php"
# Main Core File
require_once "include/core.php";
# Website Template And Design Loader
loader();
require_once "database/connection.php";
main_database_connection();
//another_database_connection ( "dbconn_one", "localhost", "root", "Daniel1", "mysql", "utf8" );
# Website Template Configuration File
require_once "include/config.php";
# Including Custom Page CSS
$stdcss = array('css' => array());
# Including Custom Page JS
$stdjs = array('js' => array());
# Language Loader
$lang = array_merge(language('global'));
# Page Title
$pagetitle = "New_Page_File";
$HTMLOUT = "";
// Starting Variable
Пример #26
0
<?php

/* sOB - Simple Open builing Bot
 *
 * Copyright 2009 - Claudio Mignanti <*****@*****.**>
 *
 *  This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
*/
session_start();
$page = $_GET['page'];
if (!isset($page)) {
    $page = 'default';
}
require "./inc/{$page}.php";
require "./inc/status.php";
#load template, if it doesn't exist load default one
if (file_exists('tpl.htm')) {
    $tpl = file('tpl.htm');
} else {
    $tpl = file('tpl.htm.default');
}
$tpl = str_replace("%body", loader(), $tpl);
$tpl = str_replace("%status", status(), $tpl);
foreach ($tpl as $a) {
    echo $a;
}
Пример #27
0
<?php

/**
 * Thin is a swift Framework for PHP 5.4+
 *
 * @package    Thin
 * @version    1.0
 * @author     Gerald Plusquellec
 * @license    BSD License
 * @copyright  1996 - 2015 Gerald Plusquellec
 * @link       http://github.com/schpill/thin
 */
namespace Thin;

loader('model');
class ModelCore extends ModelLib
{
}
Пример #28
0
<?php

/**
 * Thin is a swift Framework for PHP 5.4+
 *
 * @package    Thin
 * @version    1.0
 * @author     Gerald Plusquellec
 * @license    BSD License
 * @copyright  1996 - 2015 Gerald Plusquellec
 * @link       http://github.com/schpill/thin
 */
namespace Thin;

loader('blazz');
class MemoryCore extends BlazzLib
{
}
Пример #29
0
    include_once 'includes/bootstrap.php';
    /* install */
    install();
} else {
    /* install post */
    install_post();
    /* bootstrap */
    include_once 'includes/bootstrap.php';
    /* define meta */
    define('TITLE', l('installation'));
    define('ROBOTS', 'none');
    /* module init */
    Redaxscript\Hook::trigger('init');
    /* call loader else render template */
    if (FIRST_PARAMETER == 'loader' && (SECOND_PARAMETER == 'styles' || SECOND_PARAMETER == 'scripts')) {
        echo loader(SECOND_PARAMETER, 'outline');
    } else {
        include_once 'templates/install/install.phtml';
    }
}
/**
 * install
 *
 * @since 1.2.1
 * @deprecated 2.0.0
 *
 * @package Redaxscript
 * @category Install
 * @author Henry Ruhs
 */
function install()
Пример #30
0
 function __autoload($class)
 {
     loader($class);
 }