コード例 #1
0
ファイル: LaravelServiceProvider.php プロジェクト: jnjxp/meta
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     $this->app['aura/html:helper'] = $this->app->share(function ($app) {
         $app;
         $factory = new \Aura\Html\HelperLocatorFactory();
         return $factory->newInstance();
     });
     $this->app['aura/html:escaper'] = $this->app->share(function ($app) {
         $app;
         $factory = new \Aura\Html\EscaperFactory();
         return $factory->newInstance();
     });
     $this->app['jnjxp/meta:helper'] = $this->app->share(function ($app) {
         $factory = new MetaHelperFactory($app->make('aura/html:helper'), $app->make('aura/html:escaper'));
         return $factory->newInstance();
     });
     $this->app->booting(function () {
         $loader = \Illuminate\Foundation\AliasLoader::getInstance();
         $loader->alias('AuraHtml', 'Jnjxp\\Meta\\Facades\\AuraHtmlHelper');
         $loader->alias('Meta', 'Jnjxp\\Meta\\Facades\\MetaHelper');
     });
 }
コード例 #2
0
ファイル: odm-init.php プロジェクト: watsonad/opendocman
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/
require __DIR__ . '/vendor/autoload.php';
/**
 * Set up the various view objects needed
 * and add the templates/layouts
 */
$factory = new \Aura\Html\HelperLocatorFactory();
$helpers = $factory->newInstance();
$view_factory = new \Aura\View\ViewFactory();
$view = $view_factory->newInstance($helpers);
$view_registry = $view->getViewRegistry();
$view_registry->set('access_log', __DIR__ . '/templates/views/access_log.php');
$layout_registry = $view->getLayoutRegistry();
$layout_registry->set('default', __DIR__ . '/templates/layouts/default.php');
/*
 * Connect to Database
 */
$dsn = "mysql:host=" . DB_HOST . ";dbname=" . DB_NAME . ";charset=utf8";
try {
    $pdo = new PDO($dsn, DB_USER, DB_PASS);
} catch (PDOException $e) {
    print "Error!: " . $e->getMessage() . "<br/>";