-
-
Save sroehrl/b2574aa295803fbb823fbbbce4902192 to your computer and use it in GitHub Desktop.
LENKRAD scripts when starting from scratch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
use Neoan\Cli\Application; | |
use Neoan\Helper\Setup; | |
use Neoan\NeoanApp; | |
require_once __DIR__ . '/vendor/autoload.php'; | |
$setup = new Setup(); | |
$setup->setPublicPath(__DIR__ . '/public') | |
->setDatabaseAdapter(new \Neoan\Database\SqLiteAdapter(['location' => __DIR__ . '/db.db'])) | |
->setLibraryPath(__DIR__ . '/src'); | |
$console = new Application(new NeoanApp($setup, __DIR__)); | |
$console->run(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"autoload": { | |
"psr-4": { | |
"App\\": "src/" | |
} | |
}, | |
"require": { | |
"neoan.io/core": "^0.4" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
shell_exec('php -S localhost:8080 public/index.php'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* | |
* This file is in [root-directory]/public | |
* | |
*/ | |
use Neoan\Database\SqLiteAdapter; | |
use Neoan\Helper\Setup; | |
use Neoan\NeoanApp; | |
use Neoan\Routing\AttributeRouting; | |
$projectPath = dirname(__DIR__); | |
require_once $projectPath . '/vendor/autoload.php'; | |
$setup = new Setup(); | |
$setup->setLibraryPath($projectPath . '/src') | |
->setDatabaseAdapter(new SqLiteAdapter(['location' => $projectPath . '/db.db'])) | |
->setPublicPath(__DIR__); | |
$app = new NeoanApp($setup, dirname(__DIR__)); | |
$app->invoke(new AttributeRouting('App')); | |
$app->run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment