Browse files

added composer support

  • Loading branch information...
1 parent aa71b23 commit 171ca1cfbc885ef19b483ff76ca200bc556d7522 @dg dg committed Sep 7, 2012
View
5 CD-collection/app/bootstrap.php
@@ -4,9 +4,8 @@
Nette\Application\Routers\SimpleRouter;
-// Load Nette Framework
-require __DIR__ . '/../../../Nette/loader.php';
-
+// Load Nette Framework or autoloader generated by Composer
+require LIBS_DIR . '/autoload.php';
// Configure application
$configurator = new Nette\Config\Configurator;
View
23 CD-collection/composer.json
@@ -0,0 +1,23 @@
+{
+ "name": "nette-examples/cd-collection",
+ "type": "nette-example",
+ "description": "Classic Zend Framework Tutorial from Akrabat rewritten for Nette Framework.",
+ "license": "BSD-3-Clause",
+ "authors": [
+ {
+ "name": "David Grudl",
+ "homepage": "http://davidgrudl.com"
+ },
+ {
+ "name": "Nette Community",
+ "homepage": "http://nette.org/contributors"
+ }
+ ],
+ "require": {
+ "php": ">=5.3.0",
+ "nette/nette": "dev-master"
+ },
+ "config": {
+ "vendor-dir": "libs"
+ }
+}
View
2 CD-collection/libs/.htaccess
@@ -0,0 +1,2 @@
+Order Allow,Deny
+Deny from all
View
9 CD-collection/libs/autoload.php
@@ -0,0 +1,9 @@
+<?php
+
+// This is default autoload.php. It can be overwritten by Composer.
+
+if (!is_file(__DIR__ . '/../../../Nette/loader.php')) {
+ die("Nette Framework is expected in directory '" . __DIR__ . "/Nette' but not found. Edit file '" . __FILE__ . "' or execute `composer update`.");
+}
+
+require __DIR__ . '/../../../Nette/loader.php';
View
3 CD-collection/www/index.php
@@ -6,5 +6,8 @@
// absolute filesystem path to the application root
define('APP_DIR', WWW_DIR . '/../app');
+// absolute filesystem path to the libraries
+define('LIBS_DIR', WWW_DIR . '/../libs');
+
// load bootstrap file
require APP_DIR . '/bootstrap.php';
View
5 Fifteen/app/bootstrap.php
@@ -3,9 +3,8 @@
use Nette\Application\Routers\SimpleRouter;
-// Load Nette Framework
-require __DIR__ . '/../../../Nette/loader.php';
-
+// Load Nette Framework or autoloader generated by Composer
+require LIBS_DIR . '/autoload.php';
// Configure application
$configurator = new Nette\Config\Configurator;
View
23 Fifteen/composer.json
@@ -0,0 +1,23 @@
+{
+ "name": "nette-examples/cd-collection",
+ "type": "nette-example",
+ "description": "A simple example showing components as the reusable stand-alone units.",
+ "license": "BSD-3-Clause",
+ "authors": [
+ {
+ "name": "David Grudl",
+ "homepage": "http://davidgrudl.com"
+ },
+ {
+ "name": "Nette Community",
+ "homepage": "http://nette.org/contributors"
+ }
+ ],
+ "require": {
+ "php": ">=5.3.0",
+ "nette/nette": "dev-master"
+ },
+ "config": {
+ "vendor-dir": "libs"
+ }
+}
View
2 Fifteen/libs/.htaccess
@@ -0,0 +1,2 @@
+Order Allow,Deny
+Deny from all
View
9 Fifteen/libs/autoload.php
@@ -0,0 +1,9 @@
+<?php
+
+// This is default autoload.php. It can be overwritten by Composer.
+
+if (!is_file(__DIR__ . '/../../../Nette/loader.php')) {
+ die("Nette Framework is expected in directory '" . __DIR__ . "/Nette' but not found. Edit file '" . __FILE__ . "' or execute `composer update`.");
+}
+
+require __DIR__ . '/../../../Nette/loader.php';
View
3 Fifteen/www/index.php
@@ -6,5 +6,8 @@
// absolute filesystem path to the application root
define('APP_DIR', WWW_DIR . '/../app');
+// absolute filesystem path to the libraries
+define('LIBS_DIR', WWW_DIR . '/../libs');
+
// load bootstrap file
require APP_DIR . '/bootstrap.php';
View
23 Micro-blog/composer.json
@@ -0,0 +1,23 @@
+{
+ "name": "nette-examples/micro-blog",
+ "type": "nette-example",
+ "description": "A simple example showing how to use Nette Framework as a micro-framework.",
+ "license": "BSD-3-Clause",
+ "authors": [
+ {
+ "name": "David Grudl",
+ "homepage": "http://davidgrudl.com"
+ },
+ {
+ "name": "Nette Community",
+ "homepage": "http://nette.org/contributors"
+ }
+ ],
+ "require": {
+ "php": ">=5.3.0",
+ "nette/nette": "dev-master"
+ },
+ "config": {
+ "vendor-dir": "www/data/libs"
+ }
+}
View
2 Micro-blog/www/data/libs/.htaccess
@@ -0,0 +1,2 @@
+Order Allow,Deny
+Deny from all
View
9 Micro-blog/www/data/libs/autoload.php
@@ -0,0 +1,9 @@
+<?php
+
+// This is default autoload.php. It can be overwritten by Composer.
+
+if (!is_file(__DIR__ . '/../../../../../Nette/loader.php')) {
+ die("Nette Framework is expected in directory '" . __DIR__ . "/Nette' but not found. Edit file '" . __FILE__ . "' or execute `composer update`.");
+}
+
+require __DIR__ . '/../../../../../Nette/loader.php';
View
5 Micro-blog/www/index.php
@@ -3,11 +3,10 @@
// Nette Framework Microblog example
-// Load Nette Framework
-require __DIR__ . '/../../../Nette/loader.php';
+// Load Nette Framework or autoloader generated by Composer
+require __DIR__ . '/data/libs/autoload.php';
require __DIR__ . '/data/TemplateRouter.php';
-
// Configure application
$configurator = new Nette\Config\Configurator;
View
23 Micro-tweet/composer.json
@@ -0,0 +1,23 @@
+{
+ "name": "nette-examples/tweetreader",
+ "type": "nette-example",
+ "description": "A simple example showing how to use Nette Framework as a micro-framework.",
+ "license": "BSD-3-Clause",
+ "authors": [
+ {
+ "name": "David Grudl",
+ "homepage": "http://davidgrudl.com"
+ },
+ {
+ "name": "Nette Community",
+ "homepage": "http://nette.org/contributors"
+ }
+ ],
+ "require": {
+ "php": ">=5.3.0",
+ "nette/nette": "dev-master"
+ },
+ "config": {
+ "vendor-dir": "www/data/libs"
+ }
+}
View
2 Micro-tweet/www/data/libs/.htaccess
@@ -0,0 +1,2 @@
+Order Allow,Deny
+Deny from all
View
9 Micro-tweet/www/data/libs/autoload.php
@@ -0,0 +1,9 @@
+<?php
+
+// This is default autoload.php. It can be overwritten by Composer.
+
+if (!is_file(__DIR__ . '/../../../../../Nette/loader.php')) {
+ die("Nette Framework is expected in directory '" . __DIR__ . "/Nette' but not found. Edit file '" . __FILE__ . "' or execute `composer update`.");
+}
+
+require __DIR__ . '/../../../../../Nette/loader.php';
View
5 Micro-tweet/www/index.php
@@ -6,9 +6,8 @@
Nette\Utils\Json;
-// Load Nette Framework
-require __DIR__ . '/../../../Nette/loader.php';
-
+// Load Nette Framework or autoloader generated by Composer
+require __DIR__ . '/data/libs/autoload.php';
// Configure application
$configurator = new Nette\Config\Configurator;
View
5 Modules-Usage/app/bootstrap.php
@@ -5,9 +5,8 @@
Nette\Application\Routers\SimpleRouter;
-// Load Nette Framework
-require __DIR__ . '/../../../Nette/loader.php';
-
+// Load Nette Framework or autoloader generated by Composer
+require LIBS_DIR . '/autoload.php';
// Configure application
$configurator = new Nette\Config\Configurator;
View
23 Modules-Usage/composer.json
@@ -0,0 +1,23 @@
+{
+ "name": "nette-examples/modules-usage",
+ "type": "nette-example",
+ "description": "The example demonstrates the usage of modules and submodules.",
+ "license": "BSD-3-Clause",
+ "authors": [
+ {
+ "name": "David Grudl",
+ "homepage": "http://davidgrudl.com"
+ },
+ {
+ "name": "Nette Community",
+ "homepage": "http://nette.org/contributors"
+ }
+ ],
+ "require": {
+ "php": ">=5.3.0",
+ "nette/nette": "dev-master"
+ },
+ "config": {
+ "vendor-dir": "libs"
+ }
+}
View
2 Modules-Usage/libs/.htaccess
@@ -0,0 +1,2 @@
+Order Allow,Deny
+Deny from all
View
9 Modules-Usage/libs/autoload.php
@@ -0,0 +1,9 @@
+<?php
+
+// This is default autoload.php. It can be overwritten by Composer.
+
+if (!is_file(__DIR__ . '/../../../Nette/loader.php')) {
+ die("Nette Framework is expected in directory '" . __DIR__ . "/Nette' but not found. Edit file '" . __FILE__ . "' or execute `composer update`.");
+}
+
+require __DIR__ . '/../../../Nette/loader.php';
View
3 Modules-Usage/www/index.php
@@ -6,5 +6,8 @@
// absolute filesystem path to the application root
define('APP_DIR', WWW_DIR . '/../app');
+// absolute filesystem path to the libraries
+define('LIBS_DIR', WWW_DIR . '/../libs');
+
// load bootstrap file
require APP_DIR . '/bootstrap.php';

0 comments on commit 171ca1c

Please sign in to comment.