├── bundles ├── .gitignore └── bootstrapper │ ├── .gitignore │ ├── public │ ├── css │ │ └── nav-fix.css │ └── img │ │ ├── glyphicons-halflings.png │ │ └── glyphicons-halflings-white.png │ ├── buttontoolbar.php │ ├── typeahead.php │ ├── icons.php │ ├── buttongroup.php │ ├── breadcrumbs.php │ ├── navbar.php │ ├── helpers.php │ └── readme.md ├── public ├── favicon.ico ├── css │ └── .gitignore ├── img │ ├── .gitignore │ └── user.jpg ├── js │ ├── .gitignore │ └── app.js ├── font │ ├── fontawesome-webfont.eot │ ├── fontawesome-webfont.ttf │ └── fontawesome-webfont.woff ├── bundles │ └── bootstrapper │ │ ├── css │ │ └── nav-fix.css │ │ └── img │ │ ├── glyphicons-halflings.png │ │ └── glyphicons-halflings-white.png ├── .htaccess └── index.php ├── .gitattributes ├── application ├── tasks │ └── .gitignore ├── libraries │ └── .gitignore ├── migrations │ ├── .gitignore │ ├── 2012_08_21_052130_create_followers_table.php │ ├── 2012_08_16_210504_create_critts_table.php │ ├── 2012_08_16_210224_create_users_table.php │ └── 2012_08_22_205443_create_session_table.php ├── models │ ├── .gitignore │ ├── critt.php │ ├── follower.php │ └── user.php ├── config │ ├── .gitignore │ ├── production │ │ └── database.php │ └── error.php ├── bundles.php ├── language │ ├── nl │ │ └── pagination.php │ ├── ru │ │ └── pagination.php │ └── en │ │ └── pagination.php ├── tests │ └── example.test.php ├── controllers │ ├── base.php │ └── others.php ├── views │ ├── home │ │ ├── critterfeed.blade.php │ │ ├── login.blade.php │ │ └── index.blade.php │ ├── user │ │ └── profile.blade.php │ └── others │ │ └── profile.blade.php └── routes.php ├── laravel ├── tests │ ├── bundles │ │ ├── .gitignore │ │ ├── dummy │ │ │ ├── start.php │ │ │ └── routes.php │ │ └── dashboard │ │ │ ├── config │ │ │ └── meta.php │ │ │ ├── routes.php │ │ │ ├── models │ │ │ └── repository.php │ │ │ └── controllers │ │ │ └── panel.php │ ├── storage │ │ ├── cache │ │ │ └── .gitignore │ │ ├── logs │ │ │ └── .gitignore │ │ ├── views │ │ │ └── .gitignore │ │ ├── sessions │ │ │ └── .gitignore │ │ ├── files │ │ │ └── desert.jpg │ │ └── database │ │ │ └── application.sqlite │ ├── application │ │ ├── models │ │ │ ├── .gitignore │ │ │ ├── user.php │ │ │ ├── autoloader.php │ │ │ └── repositories │ │ │ │ └── user.php │ │ ├── tasks │ │ │ └── .gitignore │ │ ├── libraries │ │ │ └── .gitignore │ │ ├── migrations │ │ │ └── .gitignore │ │ ├── views │ │ │ ├── tests │ │ │ │ ├── nested.php │ │ │ │ └── basic.php │ │ │ └── error │ │ │ │ ├── 500.php │ │ │ │ └── 404.php │ │ ├── config │ │ │ ├── local │ │ │ │ └── database.php │ │ │ └── error.php │ │ ├── language │ │ │ ├── sp │ │ │ │ └── validation.php │ │ │ └── en │ │ │ │ └── pagination.php │ │ ├── controllers │ │ │ ├── admin │ │ │ │ └── panel.php │ │ │ ├── template │ │ │ │ ├── basic.php │ │ │ │ ├── named.php │ │ │ │ └── override.php │ │ │ ├── restful.php │ │ │ ├── auth.php │ │ │ ├── home.php │ │ │ └── filter.php │ │ ├── dashboard │ │ │ └── repository.php │ │ └── bundles.php │ ├── cases │ │ ├── hash.test.php │ │ ├── query.test.php │ │ ├── event.test.php │ │ ├── fluent.test.php │ │ ├── ioc.test.php │ │ ├── uri.test.php │ │ ├── database.test.php │ │ ├── lang.test.php │ │ ├── blade.test.php │ │ └── config.test.php │ └── phpunit.php ├── cli │ ├── tasks │ │ ├── task.php │ │ ├── test │ │ │ ├── stub.xml │ │ │ └── phpunit.php │ │ ├── migrate │ │ │ ├── stub.php │ │ │ └── database.php │ │ ├── bundle │ │ │ ├── providers │ │ │ │ ├── github.php │ │ │ │ └── provider.php │ │ │ ├── repository.php │ │ │ └── publisher.php │ │ ├── help.php │ │ ├── session │ │ │ └── migration.php │ │ ├── key.php │ │ ├── route.php │ │ └── help.json │ └── artisan.php ├── database │ ├── query │ │ ├── grammars │ │ │ ├── mysql.php │ │ │ ├── postgres.php │ │ │ └── sqlite.php │ │ └── join.php │ ├── expression.php │ ├── connectors │ │ ├── sqlite.php │ │ ├── connector.php │ │ ├── sqlserver.php │ │ ├── mysql.php │ │ └── postgres.php │ ├── exception.php │ └── eloquent │ │ ├── pivot.php │ │ └── relationships │ │ ├── has_one.php │ │ └── has_one_or_many.php ├── session │ └── drivers │ │ ├── sweeper.php │ │ ├── memory.php │ │ ├── apc.php │ │ ├── cookie.php │ │ ├── redis.php │ │ ├── memcached.php │ │ ├── file.php │ │ └── driver.php ├── vendor │ └── Symfony │ │ └── Component │ │ ├── HttpFoundation │ │ ├── File │ │ │ ├── Exception │ │ │ │ ├── UploadException.php │ │ │ │ ├── FileException.php │ │ │ │ ├── UnexpectedTypeException.php │ │ │ │ ├── FileNotFoundException.php │ │ │ │ └── AccessDeniedException.php │ │ │ └── MimeType │ │ │ │ ├── ExtensionGuesserInterface.php │ │ │ │ ├── MimeTypeGuesserInterface.php │ │ │ │ └── FileinfoMimeTypeGuesser.php │ │ ├── Session │ │ │ ├── Storage │ │ │ │ ├── Handler │ │ │ │ │ ├── NativeSessionHandler.php │ │ │ │ │ ├── NativeFileSessionHandler.php │ │ │ │ │ ├── NullSessionHandler.php │ │ │ │ │ ├── NativeSqliteSessionHandler.php │ │ │ │ │ ├── NativeMemcacheSessionHandler.php │ │ │ │ │ └── NativeMemcachedSessionHandler.php │ │ │ │ └── Proxy │ │ │ │ │ ├── NativeProxy.php │ │ │ │ │ └── SessionHandlerProxy.php │ │ │ ├── SessionBagInterface.php │ │ │ ├── Attribute │ │ │ │ └── AttributeBagInterface.php │ │ │ └── Flash │ │ │ │ └── FlashBagInterface.php │ │ ├── LaravelResponse.php │ │ ├── RequestMatcherInterface.php │ │ ├── composer.json │ │ ├── LICENSE │ │ ├── LaravelRequest.php │ │ ├── ApacheRequest.php │ │ ├── JsonResponse.php │ │ ├── README.md │ │ └── ServerBag.php │ │ └── Console │ │ ├── composer.json │ │ ├── Output │ │ ├── NullOutput.php │ │ └── ConsoleOutputInterface.php │ │ ├── Helper │ │ ├── Helper.php │ │ └── HelperInterface.php │ │ ├── LICENSE │ │ ├── README.md │ │ └── Formatter │ │ ├── OutputFormatterStyleInterface.php │ │ └── OutputFormatterInterface.php ├── documentation │ ├── config.md │ ├── encryption.md │ ├── database │ │ └── raw.md │ ├── requests.md │ ├── auth │ │ └── config.md │ ├── logging.md │ ├── ioc.md │ ├── contrib │ │ └── github.md │ └── strings.md ├── hash.php ├── auth │ └── drivers │ │ ├── eloquent.php │ │ └── fluent.php ├── memcached.php ├── cache │ └── drivers │ │ ├── apc.php │ │ ├── redis.php │ │ └── file.php ├── fluent.php └── auth.php ├── storage ├── database │ └── .gitignore ├── cache │ └── .gitignore ├── logs │ └── .gitignore ├── views │ └── .gitignore ├── work │ └── .gitignore └── sessions │ └── .gitignore ├── .gitignore ├── artisan └── license.txt /bundles/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/css/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/img/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/js/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto -------------------------------------------------------------------------------- /application/tasks/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /application/libraries/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /application/migrations/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /application/models/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /laravel/tests/bundles/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /application/config/.gitignore: -------------------------------------------------------------------------------- 1 | local/* -------------------------------------------------------------------------------- /laravel/tests/storage/cache/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /laravel/tests/storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /laravel/tests/storage/views/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /storage/database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite -------------------------------------------------------------------------------- /bundles/bootstrapper/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store -------------------------------------------------------------------------------- /laravel/tests/application/models/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /laravel/tests/application/tasks/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /laravel/tests/storage/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /storage/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /storage/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /storage/work/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /laravel/tests/application/libraries/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /laravel/tests/application/migrations/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /storage/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /laravel/tests/application/views/tests/nested.php: -------------------------------------------------------------------------------- 1 | Taylor -------------------------------------------------------------------------------- /laravel/tests/application/models/user.php: -------------------------------------------------------------------------------- 1 | is -------------------------------------------------------------------------------- /public/img/user.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msurguy/critterapp/master/public/img/user.jpg -------------------------------------------------------------------------------- /application/bundles.php: -------------------------------------------------------------------------------- 1 | array('auto' => true) 5 | ); -------------------------------------------------------------------------------- /laravel/tests/application/models/repositories/user.php: -------------------------------------------------------------------------------- 1 | 'dashboard', 6 | 7 | ); -------------------------------------------------------------------------------- /laravel/tests/application/config/local/database.php: -------------------------------------------------------------------------------- 1 | 'sqlite', 6 | 7 | ); -------------------------------------------------------------------------------- /public/font/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msurguy/critterapp/master/public/font/fontawesome-webfont.eot -------------------------------------------------------------------------------- /public/font/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msurguy/critterapp/master/public/font/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /public/font/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msurguy/critterapp/master/public/font/fontawesome-webfont.woff -------------------------------------------------------------------------------- /laravel/tests/storage/files/desert.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msurguy/critterapp/master/laravel/tests/storage/files/desert.jpg -------------------------------------------------------------------------------- /laravel/tests/bundles/dummy/routes.php: -------------------------------------------------------------------------------- 1 | 'El campo de atributo es necesario.', 6 | 7 | ); -------------------------------------------------------------------------------- /laravel/tests/storage/database/application.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msurguy/critterapp/master/laravel/tests/storage/database/application.sqlite -------------------------------------------------------------------------------- /public/bundles/bootstrapper/css/nav-fix.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */ 3 | } -------------------------------------------------------------------------------- /application/language/nl/pagination.php: -------------------------------------------------------------------------------- 1 | '« Vorige', 6 | 'next' => 'Volgende »', 7 | 8 | ); -------------------------------------------------------------------------------- /bundles/bootstrapper/public/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msurguy/critterapp/master/bundles/bootstrapper/public/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /public/bundles/bootstrapper/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msurguy/critterapp/master/public/bundles/bootstrapper/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /public/js/app.js: -------------------------------------------------------------------------------- 1 | $("#new_critt").charCounter(320, { 2 | container: "
", 3 | classname: "pull-right", 4 | format: "%1 characters remaining", 5 | pulse: true 6 | }); -------------------------------------------------------------------------------- /bundles/bootstrapper/public/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msurguy/critterapp/master/bundles/bootstrapper/public/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /public/bundles/bootstrapper/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msurguy/critterapp/master/public/bundles/bootstrapper/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /laravel/tests/bundles/dashboard/routes.php: -------------------------------------------------------------------------------- 1 | 'dashboard', function() 4 | { 5 | // 6 | })); 7 | 8 | Route::controller('dashboard::panel'); -------------------------------------------------------------------------------- /application/models/critt.php: -------------------------------------------------------------------------------- 1 | belongs_to('User'); 8 | } 9 | } -------------------------------------------------------------------------------- /laravel/tests/application/controllers/admin/panel.php: -------------------------------------------------------------------------------- 1 | has_many_and_belongs_to('User'); 9 | } 10 | } -------------------------------------------------------------------------------- /laravel/database/query/grammars/mysql.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | {{directory}} 7 | 8 | 9 | -------------------------------------------------------------------------------- /application/tests/example.test.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /laravel/session/drivers/sweeper.php: -------------------------------------------------------------------------------- 1 | has_many('Critt'); 8 | } 9 | 10 | public function followers(){ 11 | return $this -> has_many_and_belongs_to('Follower'); 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /laravel/tests/application/controllers/auth.php: -------------------------------------------------------------------------------- 1 | false, 5 | 'default' => 'production', 6 | 'connections' => array( 7 | 'production' => array( 8 | 'driver' => 'mysql', 9 | 'host' => getenv('db_host'), 10 | 'database' => getenv('db_name'), 11 | 'username' => getenv('db_username'), 12 | 'password' => getenv('db_password'), 13 | 'charset' => 'utf8', 14 | 'prefix' => '', 15 | )) 16 | ); -------------------------------------------------------------------------------- /laravel/database/query/grammars/postgres.php: -------------------------------------------------------------------------------- 1 | insert($query, $values)." RETURNING $column"; 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /application/migrations/2012_08_21_052130_create_followers_table.php: -------------------------------------------------------------------------------- 1 | integer('user_id'); 9 | $table->integer('following_id'); 10 | // make user_id and following_id as a combined primary key 11 | $table->primary(array('user_id', 'following_id')); 12 | }); 13 | } 14 | 15 | // on migration rollback drop the followers table 16 | public function down() 17 | { 18 | Schema::drop('followers'); 19 | } 20 | 21 | } -------------------------------------------------------------------------------- /application/migrations/2012_08_16_210504_create_critts_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 9 | $table->integer('user_id'); 10 | $table->text('critt'); 11 | $table->timestamps(); 12 | //$table->foreign('user_id')->references('id')->on('users')->on_delete('cascade'); 13 | }); 14 | } 15 | 16 | // on migration rollback drop the critts table 17 | public function down() 18 | { 19 | Schema::drop('critts'); 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /application/language/ru/pagination.php: -------------------------------------------------------------------------------- 1 | '← Назад', 17 | 'next' => 'Вперёд →', 18 | 19 | ); -------------------------------------------------------------------------------- /laravel/database/query/grammars/sqlite.php: -------------------------------------------------------------------------------- 1 | orderings as $ordering) 17 | { 18 | $sql[] = $this->wrap($ordering['column']).' COLLATE NOCASE '.strtoupper($ordering['direction']); 19 | } 20 | 21 | return 'ORDER BY '.implode(', ', $sql); 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /application/language/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 'next' => 'Next »', 18 | 19 | ); -------------------------------------------------------------------------------- /laravel/tests/application/language/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 'next' => 'Next »', 18 | 19 | ); -------------------------------------------------------------------------------- /laravel/vendor/Symfony/Component/HttpFoundation/File/Exception/UploadException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation\File\Exception; 13 | 14 | /** 15 | * Thrown when an error occurred during file upload 16 | * 17 | * @author Bernhard Schussek 18 | */ 19 | class UploadException extends FileException 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /laravel/vendor/Symfony/Component/HttpFoundation/File/Exception/FileException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation\File\Exception; 13 | 14 | /** 15 | * Thrown when an error occurred in the component File 16 | * 17 | * @author Bernhard Schussek 18 | */ 19 | class FileException extends \RuntimeException 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /application/migrations/2012_08_16_210224_create_users_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 9 | $table->string('username')-> unique(); 10 | $table->string('password'); 11 | $table->string('name'); 12 | $table->timestamps(); 13 | }); 14 | // Add admin user 15 | DB::table('users')->insert(array( 16 | 'username' => 'admin', 17 | 'password' => Hash::make('password'), 18 | 'name' => 'Admin User' 19 | )); 20 | } 21 | 22 | // on migration rollback drop the users table 23 | public function down() 24 | { 25 | Schema::drop('users'); 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /laravel/vendor/Symfony/Component/HttpFoundation/File/Exception/UnexpectedTypeException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation\File\Exception; 13 | 14 | class UnexpectedTypeException extends FileException 15 | { 16 | public function __construct($value, $expectedType) 17 | { 18 | parent::__construct(sprintf('Expected argument of type %s, %s given', $expectedType, is_object($value) ? get_class($value) : gettype($value))); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /laravel/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeSessionHandler.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; 13 | 14 | /** 15 | * Adds SessionHandler functionality if available. 16 | * 17 | * @see http://php.net/sessionhandler 18 | */ 19 | 20 | if (version_compare(phpversion(), '5.4.0', '>=')) { 21 | class NativeSessionHandler extends \SessionHandler {} 22 | } else { 23 | class NativeSessionHandler {} 24 | } 25 | -------------------------------------------------------------------------------- /laravel/cli/tasks/help.php: -------------------------------------------------------------------------------- 1 | $commands) 23 | { 24 | if($i++ != 0) echo PHP_EOL; 25 | 26 | echo PHP_EOL . "# $category" . PHP_EOL; 27 | 28 | foreach($commands as $command => $details) 29 | { 30 | echo PHP_EOL . str_pad($command, 20) . str_pad($details->description, 30); 31 | } 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /laravel/cli/tasks/bundle/repository.php: -------------------------------------------------------------------------------- 1 | api.$bundle); 25 | 26 | return json_decode($bundle, true); 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /laravel/database/expression.php: -------------------------------------------------------------------------------- 1 | value = $value; 21 | } 22 | 23 | /** 24 | * Get the string value of the database expression. 25 | * 26 | * @return string 27 | */ 28 | public function get() 29 | { 30 | return $this->value; 31 | } 32 | 33 | /** 34 | * Get the string value of the database expression. 35 | * 36 | * @return string 37 | */ 38 | public function __toString() 39 | { 40 | return $this->get(); 41 | } 42 | 43 | } -------------------------------------------------------------------------------- /laravel/tests/cases/hash.test.php: -------------------------------------------------------------------------------- 1 | assertTrue(strlen(Hash::make('taylor')) == 60); 13 | } 14 | 15 | /** 16 | * Test the Hash::check method. 17 | * 18 | * @group laravel 19 | */ 20 | public function testHashCheckFailsWhenNotMatching() 21 | { 22 | $hash = Hash::make('taylor'); 23 | 24 | $this->assertFalse(Hash::check('foo', $hash)); 25 | } 26 | 27 | /** 28 | * Test the Hash::check method. 29 | * 30 | * @group laravel 31 | */ 32 | public function testHashCheckPassesWhenMatches() 33 | { 34 | $this->assertTrue(Hash::check('taylor', Hash::make('taylor'))); 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /laravel/vendor/Symfony/Component/HttpFoundation/File/MimeType/ExtensionGuesserInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation\File\MimeType; 13 | 14 | /** 15 | * Guesses the file extension corresponding to a given mime type 16 | */ 17 | interface ExtensionGuesserInterface 18 | { 19 | /** 20 | * Makes a best guess for a file extension, given a mime type 21 | * 22 | * @param string $mimeType The mime type 23 | * @return string The guessed extension or NULL, if none could be guessed 24 | */ 25 | function guess($mimeType); 26 | } 27 | -------------------------------------------------------------------------------- /laravel/vendor/Symfony/Component/Console/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "symfony/console", 3 | "type": "library", 4 | "description": "Symfony Console Component", 5 | "keywords": [], 6 | "homepage": "http://symfony.com", 7 | "license": "MIT", 8 | "authors": [ 9 | { 10 | "name": "Fabien Potencier", 11 | "email": "fabien@symfony.com" 12 | }, 13 | { 14 | "name": "Symfony Community", 15 | "homepage": "http://symfony.com/contributors" 16 | } 17 | ], 18 | "require": { 19 | "php": ">=5.3.2" 20 | }, 21 | "autoload": { 22 | "psr-0": { "Symfony\\Component\\Console": "" } 23 | }, 24 | "target-dir": "Symfony/Component/Console", 25 | "extra": { 26 | "branch-alias": { 27 | "dev-master": "2.1-dev" 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /laravel/database/connectors/sqlite.php: -------------------------------------------------------------------------------- 1 | options($config); 14 | 15 | // SQLite provides supported for "in-memory" databases, which exist only for 16 | // lifetime of the request. Any given in-memory database may only have one 17 | // PDO connection open to it at a time. These are mainly for tests. 18 | if ($config['database'] == ':memory:') 19 | { 20 | return new PDO('sqlite::memory:', null, null, $options); 21 | } 22 | 23 | $path = path('storage').'database'.DS.$config['database'].'.sqlite'; 24 | 25 | return new PDO('sqlite:'.$path, null, null, $options); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /bundles/bootstrapper/buttontoolbar.php: -------------------------------------------------------------------------------- 1 | '; 26 | } 27 | 28 | 29 | /** 30 | * Closes the ButtonToolbar section. 31 | * @return string 32 | */ 33 | public static function close() 34 | { 35 | return ''; 36 | } 37 | } -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | # Apache configuration file 2 | # http://httpd.apache.org/docs/2.2/mod/quickreference.html 3 | 4 | # Note: ".htaccess" files are an overhead for each request. This logic should 5 | # be placed in your Apache config whenever possible. 6 | # http://httpd.apache.org/docs/2.2/howto/htaccess.html 7 | 8 | # Turning on the rewrite engine is necessary for the following rules and 9 | # features. "+FollowSymLinks" must be enabled for this to work symbolically. 10 | 11 | 12 | Options +FollowSymLinks 13 | RewriteEngine On 14 | 15 | 16 | # For all files not found in the file system, reroute the request to the 17 | # "index.php" front controller, keeping the query string intact 18 | 19 | 20 | RewriteCond %{REQUEST_FILENAME} !-f 21 | RewriteCond %{REQUEST_FILENAME} !-d 22 | RewriteRule ^(.*)$ index.php/$1 [L] 23 | -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | 9 | * @link http://laravel.com 10 | */ 11 | 12 | // -------------------------------------------------------------- 13 | // Set the core Laravel path constants. 14 | // -------------------------------------------------------------- 15 | require 'paths.php'; 16 | 17 | // -------------------------------------------------------------- 18 | // Bootstrap the Laravel core. 19 | // -------------------------------------------------------------- 20 | require path('sys').'core.php'; 21 | 22 | // -------------------------------------------------------------- 23 | // Launch the Laravel "Artisan" CLI. 24 | // -------------------------------------------------------------- 25 | require path('sys').'cli/artisan'.EXT; -------------------------------------------------------------------------------- /laravel/vendor/Symfony/Component/HttpFoundation/File/Exception/FileNotFoundException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation\File\Exception; 13 | 14 | /** 15 | * Thrown when a file was not found 16 | * 17 | * @author Bernhard Schussek 18 | */ 19 | class FileNotFoundException extends FileException 20 | { 21 | /** 22 | * Constructor. 23 | * 24 | * @param string $path The path to the file that was not found 25 | */ 26 | public function __construct($path) 27 | { 28 | parent::__construct(sprintf('The file "%s" does not exist', $path)); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /laravel/vendor/Symfony/Component/HttpFoundation/LaravelResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @api 9 | */ 10 | class LaravelResponse extends Response 11 | { 12 | 13 | /** 14 | * Sends HTTP headers and content. 15 | * 16 | * @return Response 17 | * 18 | * @api 19 | */ 20 | public function send() 21 | { 22 | $this->sendHeaders(); 23 | $this->sendContent(); 24 | 25 | return $this; 26 | } 27 | 28 | /** 29 | * Finishes the request for PHP-FastCGI 30 | * 31 | * @return void 32 | */ 33 | public function finish() 34 | { 35 | if (function_exists('fastcgi_finish_request')) { 36 | fastcgi_finish_request(); 37 | } 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /laravel/vendor/Symfony/Component/Console/Output/NullOutput.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Console\Output; 13 | 14 | /** 15 | * NullOutput suppresses all output. 16 | * 17 | * $output = new NullOutput(); 18 | * 19 | * @author Fabien Potencier 20 | * 21 | * @api 22 | */ 23 | class NullOutput extends Output 24 | { 25 | /** 26 | * Writes a message to the output. 27 | * 28 | * @param string $message A message to write to the output 29 | * @param Boolean $newline Whether to add a newline or not 30 | */ 31 | public function doWrite($message, $newline) 32 | { 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /laravel/vendor/Symfony/Component/HttpFoundation/File/Exception/AccessDeniedException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation\File\Exception; 13 | 14 | /** 15 | * Thrown when the access on a file was denied. 16 | * 17 | * @author Bernhard Schussek 18 | */ 19 | class AccessDeniedException extends FileException 20 | { 21 | /** 22 | * Constructor. 23 | * 24 | * @param string $path The path to the accessed file 25 | */ 26 | public function __construct($path) 27 | { 28 | parent::__construct(sprintf('The file %s could not be accessed', $path)); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /laravel/cli/tasks/test/phpunit.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Console\Output; 13 | 14 | use Symfony\Component\Console\Output\OutputInterface; 15 | 16 | /** 17 | * ConsoleOutputInterface is the interface implemented by ConsoleOutput class. 18 | * This adds information about stderr output stream. 19 | * 20 | * @author Dariusz Górecki 21 | */ 22 | interface ConsoleOutputInterface extends OutputInterface 23 | { 24 | /** 25 | * @return OutputInterface 26 | */ 27 | public function getErrorOutput(); 28 | 29 | public function setErrorOutput(OutputInterface $error); 30 | } 31 | -------------------------------------------------------------------------------- /bundles/bootstrapper/typeahead.php: -------------------------------------------------------------------------------- 1 | '; 34 | } 35 | } -------------------------------------------------------------------------------- /laravel/cli/tasks/session/migration.php: -------------------------------------------------------------------------------- 1 | create(); 15 | 16 | // The session table consists simply of an ID, a UNIX timestamp to 17 | // indicate the expiration time, and a blob field which will hold 18 | // the serialized form of the session payload. 19 | $table->string('id')->length(40)->primary('session_primary'); 20 | 21 | $table->integer('last_activity'); 22 | 23 | $table->text('data'); 24 | }); 25 | } 26 | 27 | /** 28 | * Revert the changes to the database. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::table(Config::get('session.table'), function($table) 35 | { 36 | $table->drop(); 37 | }); 38 | } 39 | 40 | } -------------------------------------------------------------------------------- /application/migrations/2012_08_22_205443_create_session_table.php: -------------------------------------------------------------------------------- 1 | create(); 15 | 16 | // The session table consists simply of an ID, a UNIX timestamp to 17 | // indicate the expiration time, and a blob field which will hold 18 | // the serialized form of the session payload. 19 | $table->string('id')->length(40)->primary('session_primary'); 20 | 21 | $table->integer('last_activity'); 22 | 23 | $table->text('data'); 24 | }); 25 | } 26 | 27 | /** 28 | * Revert the changes to the database. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::table(Config::get('session.table'), function($table) 35 | { 36 | $table->drop(); 37 | }); 38 | } 39 | 40 | } -------------------------------------------------------------------------------- /laravel/database/exception.php: -------------------------------------------------------------------------------- 1 | inner = $inner; 23 | 24 | $this->setMessage($sql, $bindings); 25 | } 26 | 27 | /** 28 | * Set the exception message to include the SQL and bindings. 29 | * 30 | * @param string $sql 31 | * @param array $bindings 32 | * @return void 33 | */ 34 | protected function setMessage($sql, $bindings) 35 | { 36 | $this->message = $this->inner->getMessage(); 37 | 38 | $this->message .= "\n\nSQL: ".$sql."\n\nBindings: ".var_export($bindings, true); 39 | } 40 | 41 | } -------------------------------------------------------------------------------- /laravel/vendor/Symfony/Component/HttpFoundation/RequestMatcherInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation; 13 | 14 | /** 15 | * RequestMatcherInterface is an interface for strategies to match a Request. 16 | * 17 | * @author Fabien Potencier 18 | * 19 | * @api 20 | */ 21 | interface RequestMatcherInterface 22 | { 23 | /** 24 | * Decides whether the rule(s) implemented by the strategy matches the supplied request. 25 | * 26 | * @param Request $request The request to check for a match 27 | * 28 | * @return Boolean true if the request matches, false otherwise 29 | * 30 | * @api 31 | */ 32 | function matches(Request $request); 33 | } 34 | -------------------------------------------------------------------------------- /laravel/documentation/config.md: -------------------------------------------------------------------------------- 1 | # Runtime Configuration 2 | 3 | ## Contents 4 | 5 | - [The Basics](#the-basics) 6 | - [Retrieving Options](#retrieving-options) 7 | - [Setting Options](#setting-options) 8 | 9 | 10 | ## The Basics 11 | 12 | Sometimes you may need to get and set configuration options at runtime. For this you'll use the **Config** class, which utilizes Laravel's "dot" syntax for accessing configuration files and items. 13 | 14 | 15 | ## Retrieving Options 16 | 17 | #### Retrieve a configuration option: 18 | 19 | $value = Config::get('application.url'); 20 | 21 | #### Return a default value if the option doesn't exist: 22 | 23 | $value = Config::get('application.timezone', 'UTC'); 24 | 25 | #### Retrieve an entire configuration array: 26 | 27 | $options = Config::get('database'); 28 | 29 | 30 | ## Setting Options 31 | 32 | #### Set a configuration option: 33 | 34 | Config::set('cache.driver', 'apc'); -------------------------------------------------------------------------------- /laravel/documentation/encryption.md: -------------------------------------------------------------------------------- 1 | # Encryption 2 | 3 | ## Contents 4 | 5 | - [The Basics](#the-basics) 6 | - [Encrypting A String](#encrypt) 7 | - [Decrypting A String](#decrypt) 8 | 9 | 10 | ## The Basics 11 | 12 | Laravel's **Crypter** class provides a simple interface for handling secure, two-way encryption. By default, the Crypter class provides strong AES-256 encryption and decryption out of the box via the Mcrypt PHP extension. 13 | 14 | > **Note:** Don't forget to install the Mcrypt PHP extension on your server. 15 | 16 | 17 | ## Encrypting A String 18 | 19 | #### Encrypting a given string: 20 | 21 | $encrypted = Crypter::encrypt($value); 22 | 23 | 24 | ## Decrypting A String 25 | 26 | #### Decrypting a string: 27 | 28 | $decrypted = Crypter::decrypt($encrypted); 29 | 30 | > **Note:** It's incredibly important to point out that the decrypt method will only decrypt strings that were encrypted using **your** application key. -------------------------------------------------------------------------------- /laravel/session/drivers/memory.php: -------------------------------------------------------------------------------- 1 | session; 23 | } 24 | 25 | /** 26 | * Save a given session to storage. 27 | * 28 | * @param array $session 29 | * @param array $config 30 | * @param bool $exists 31 | * @return void 32 | */ 33 | public function save($session, $config, $exists) 34 | { 35 | // 36 | } 37 | 38 | /** 39 | * Delete a session from storage by a given ID. 40 | * 41 | * @param string $id 42 | * @return void 43 | */ 44 | public function delete($id) 45 | { 46 | // 47 | } 48 | 49 | } -------------------------------------------------------------------------------- /laravel/tests/cases/query.test.php: -------------------------------------------------------------------------------- 1 | assertEquals('taylor@example.com', $this->query()->find(1)->email); 13 | } 14 | 15 | /** 16 | * Test the select method. 17 | * 18 | * @group laravel 19 | */ 20 | public function testSelectMethodLimitsColumns() 21 | { 22 | $result = $this->query()->select(array('email'))->first(); 23 | 24 | $this->assertTrue(isset($result->email)); 25 | $this->assertFalse(isset($result->name)); 26 | } 27 | 28 | /** 29 | * Test the raw_where method. 30 | * 31 | * @group laravel 32 | */ 33 | public function testRawWhereCanBeUsed() 34 | { 35 | 36 | } 37 | 38 | /** 39 | * Get the query instance for the test case. 40 | * 41 | * @return Query 42 | */ 43 | protected function query() 44 | { 45 | return DB::table('query_test'); 46 | } 47 | 48 | } -------------------------------------------------------------------------------- /laravel/vendor/Symfony/Component/HttpFoundation/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "symfony/http-foundation", 3 | "type": "library", 4 | "description": "Symfony HttpFoundation Component", 5 | "keywords": [], 6 | "homepage": "http://symfony.com", 7 | "license": "MIT", 8 | "authors": [ 9 | { 10 | "name": "Fabien Potencier", 11 | "email": "fabien@symfony.com" 12 | }, 13 | { 14 | "name": "Symfony Community", 15 | "homepage": "http://symfony.com/contributors" 16 | } 17 | ], 18 | "require": { 19 | "php": ">=5.3.2" 20 | }, 21 | "autoload": { 22 | "psr-0": { 23 | "Symfony\\Component\\HttpFoundation": "", 24 | "SessionHandlerInterface": "Symfony/Component/HttpFoundation/Resources/stubs" 25 | } 26 | }, 27 | "target-dir": "Symfony/Component/HttpFoundation", 28 | "extra": { 29 | "branch-alias": { 30 | "dev-master": "2.1-dev" 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /laravel/vendor/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesserInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation\File\MimeType; 13 | 14 | /** 15 | * Guesses the mime type of a file 16 | * 17 | * @author Bernhard Schussek 18 | */ 19 | interface MimeTypeGuesserInterface 20 | { 21 | /** 22 | * Guesses the mime type of the file with the given path. 23 | * 24 | * @param string $path The path to the file 25 | * 26 | * @return string The mime type or NULL, if none could be guessed 27 | * 28 | * @throws FileNotFoundException If the file does not exist 29 | * @throws AccessDeniedException If the file could not be read 30 | */ 31 | function guess($path); 32 | } 33 | -------------------------------------------------------------------------------- /laravel/tests/cases/event.test.php: -------------------------------------------------------------------------------- 1 | assertEquals(1, $responses[0]); 26 | $this->assertEquals(2, $responses[1]); 27 | } 28 | 29 | /** 30 | * Test parameters can be passed to event listeners. 31 | * 32 | * @group laravel 33 | */ 34 | public function testParametersCanBePassedToEvents() 35 | { 36 | Event::listen('test.event', function($var) { return $var; }); 37 | 38 | $responses = Event::fire('test.event', array('Taylor')); 39 | 40 | $this->assertEquals('Taylor', $responses[0]); 41 | } 42 | 43 | } -------------------------------------------------------------------------------- /application/views/home/critterfeed.blade.php: -------------------------------------------------------------------------------- 1 | @layout('templates.template') 2 | 3 | @section('content') 4 |
5 |

Users have critterred {{$count;}} critts:

6 | @foreach ($critts -> results as $critt) 7 |
8 |
9 |
10 |
11 |
12 |

{{$critt->user->username}}

13 |

{{ $critt->critt; }}

14 | At {{$critt->updated_at;}} 15 | {{Critt::where('user_id','=',$critt->user->id)->count();}} critts 16 | {{Follower::where('following_id','=',$critt->user->id)->count();}} followers 17 |
18 |
19 | @endforeach 20 |
21 | {{ $critts -> pager(true); }} 22 |
23 | @endsection -------------------------------------------------------------------------------- /laravel/database/connectors/connector.php: -------------------------------------------------------------------------------- 1 | PDO::CASE_LOWER, 12 | PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, 13 | PDO::ATTR_ORACLE_NULLS => PDO::NULL_NATURAL, 14 | PDO::ATTR_STRINGIFY_FETCHES => false, 15 | PDO::ATTR_EMULATE_PREPARES => false, 16 | ); 17 | 18 | /** 19 | * Establish a PDO database connection. 20 | * 21 | * @param array $config 22 | * @return PDO 23 | */ 24 | abstract public function connect($config); 25 | 26 | /** 27 | * Get the PDO connection options for the configuration. 28 | * 29 | * Developer specified options will override the default connection options. 30 | * 31 | * @param array $config 32 | * @return array 33 | */ 34 | protected function options($config) 35 | { 36 | $options = (isset($config['options'])) ? $config['options'] : array(); 37 | 38 | return $this->options + $options; 39 | } 40 | 41 | } -------------------------------------------------------------------------------- /laravel/database/connectors/sqlserver.php: -------------------------------------------------------------------------------- 1 | PDO::CASE_LOWER, 12 | PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, 13 | PDO::ATTR_ORACLE_NULLS => PDO::NULL_NATURAL, 14 | PDO::ATTR_STRINGIFY_FETCHES => false, 15 | ); 16 | 17 | /** 18 | * Establish a PDO database connection. 19 | * 20 | * @param array $config 21 | * @return PDO 22 | */ 23 | public function connect($config) 24 | { 25 | extract($config); 26 | 27 | // Format the SQL Server connection string. This connection string format can 28 | // also be used to connect to Azure SQL Server databases. The port is defined 29 | // directly after the server name, so we'll create that first. 30 | $port = (isset($port)) ? ','.$port : ''; 31 | 32 | $dsn = "sqlsrv:Server={$host}{$port};Database={$database}"; 33 | 34 | return new PDO($dsn, $username, $password, $this->options($config)); 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /laravel/database/eloquent/pivot.php: -------------------------------------------------------------------------------- 1 | pivot_table = $table; 29 | $this->connection = $connection; 30 | 31 | parent::__construct(array(), true); 32 | } 33 | 34 | /** 35 | * Get the name of the pivot table. 36 | * 37 | * @return string 38 | */ 39 | public function table() 40 | { 41 | return $this->pivot_table; 42 | } 43 | 44 | /** 45 | * Get the connection used by the pivot table. 46 | * 47 | * @return string 48 | */ 49 | public function connection() 50 | { 51 | return $this->connection; 52 | } 53 | 54 | } -------------------------------------------------------------------------------- /laravel/vendor/Symfony/Component/HttpFoundation/Session/SessionBagInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation\Session; 13 | 14 | /** 15 | * Session Bag store. 16 | * 17 | * @author Drak 18 | */ 19 | interface SessionBagInterface 20 | { 21 | /** 22 | * Gets this bag's name 23 | * 24 | * @return string 25 | */ 26 | function getName(); 27 | 28 | /** 29 | * Initializes the Bag 30 | * 31 | * @param array $array 32 | */ 33 | function initialize(array &$array); 34 | 35 | /** 36 | * Gets the storage key for this bag. 37 | * 38 | * @return string 39 | */ 40 | function getStorageKey(); 41 | 42 | /** 43 | * Clears out data from bag. 44 | * 45 | * @return mixed Whatever data was contained. 46 | */ 47 | function clear(); 48 | } 49 | -------------------------------------------------------------------------------- /bundles/bootstrapper/icons.php: -------------------------------------------------------------------------------- 1 | '; 39 | } 40 | } -------------------------------------------------------------------------------- /laravel/vendor/Symfony/Component/Console/Helper/Helper.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Console\Helper; 13 | 14 | /** 15 | * Helper is the base class for all helper classes. 16 | * 17 | * @author Fabien Potencier 18 | */ 19 | abstract class Helper implements HelperInterface 20 | { 21 | protected $helperSet = null; 22 | 23 | /** 24 | * Sets the helper set associated with this helper. 25 | * 26 | * @param HelperSet $helperSet A HelperSet instance 27 | */ 28 | public function setHelperSet(HelperSet $helperSet = null) 29 | { 30 | $this->helperSet = $helperSet; 31 | } 32 | 33 | /** 34 | * Gets the helper set associated with this helper. 35 | * 36 | * @return HelperSet A HelperSet instance 37 | */ 38 | public function getHelperSet() 39 | { 40 | return $this->helperSet; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /laravel/vendor/Symfony/Component/Console/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2004-2012 Fabien Potencier 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /laravel/vendor/Symfony/Component/HttpFoundation/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2004-2012 Fabien Potencier 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /laravel/vendor/Symfony/Component/HttpFoundation/Session/Storage/Proxy/NativeProxy.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation\Session\Storage\Proxy; 13 | 14 | /** 15 | * NativeProxy. 16 | * 17 | * This proxy is built-in session handlers in PHP 5.3.x 18 | * 19 | * @author Drak 20 | */ 21 | class NativeProxy extends AbstractProxy 22 | { 23 | /** 24 | * Constructor. 25 | */ 26 | public function __construct() 27 | { 28 | // this makes an educated guess as to what the handler is since it should already be set. 29 | $this->saveHandlerName = ini_get('session.save_handler'); 30 | } 31 | 32 | /** 33 | * Returns true if this handler wraps an internal PHP session save handler using \SessionHandler. 34 | * 35 | * @return bool False. 36 | */ 37 | public function isWrapper() 38 | { 39 | return false; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /application/views/home/login.blade.php: -------------------------------------------------------------------------------- 1 | @layout('templates.template') 2 | @section('content') 3 |
4 |
5 |
6 |

Sign in to Critter

7 | {{ Form::open('home/login', 'POST',array('class'=>'well')); }} 8 | {{ Form::token() }} 9 | @if (Session::has('login_errors')) 10 | {{ Alert::error("Username or password incorrect.") }} 11 | @endif 12 | 13 | @if (Session::has('success_message')) 14 | {{ Alert::success("Account created Successfully, please log in now") }} 15 | @endif 16 | 17 | @if (Session::has('logout_message')) 18 | {{ Alert::success("You have been logged out!") }} 19 | @endif 20 | {{ Form::text('username', Input::old('username'), array('class' => 'span3', 'placeholder' => 'Username'));}} 21 | {{ Form::password('password', array('class' => 'span3', 'placeholder' => 'Password'));}} 22 | {{ Form::labelled_checkbox('remember', 'Remember Me');}} 23 | {{ Form::submit('Login', array('class'=>'btn-info'));}} 24 | {{ Form::close() }} 25 |
26 |
27 |
28 | @endsection -------------------------------------------------------------------------------- /laravel/vendor/Symfony/Component/HttpFoundation/LaravelRequest.php: -------------------------------------------------------------------------------- 1 | server->get('CONTENT_TYPE'), 'application/x-www-form-urlencoded') 17 | && in_array(strtoupper($request->server->get('REQUEST_METHOD', 'GET')), array('PUT', 'DELETE', 'PATCH')) 18 | ) { 19 | parse_str($request->getContent(), $data); 20 | if (magic_quotes()) $data = array_strip_slashes($data); 21 | $request->request = new ParameterBag($data); 22 | } 23 | 24 | return $request; 25 | } 26 | 27 | /** 28 | * Get the root URL of the application. 29 | * 30 | * @return string 31 | */ 32 | public function getRootUrl() 33 | { 34 | return $this->getScheme().'://'.$this->getHttpHost().$this->getBasePath(); 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /laravel/vendor/Symfony/Component/Console/Helper/HelperInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Console\Helper; 13 | 14 | /** 15 | * HelperInterface is the interface all helpers must implement. 16 | * 17 | * @author Fabien Potencier 18 | * 19 | * @api 20 | */ 21 | interface HelperInterface 22 | { 23 | /** 24 | * Sets the helper set associated with this helper. 25 | * 26 | * @param HelperSet $helperSet A HelperSet instance 27 | * 28 | * @api 29 | */ 30 | function setHelperSet(HelperSet $helperSet = null); 31 | 32 | /** 33 | * Gets the helper set associated with this helper. 34 | * 35 | * @return HelperSet A HelperSet instance 36 | * 37 | * @api 38 | */ 39 | function getHelperSet(); 40 | 41 | /** 42 | * Returns the canonical name of this helper. 43 | * 44 | * @return string The canonical name 45 | * 46 | * @api 47 | */ 48 | function getName(); 49 | } 50 | -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | 8 | * @link http://laravel.com 9 | */ 10 | 11 | // -------------------------------------------------------------- 12 | // Tick... Tock... Tick... Tock... 13 | // -------------------------------------------------------------- 14 | define('LARAVEL_START', microtime(true)); 15 | 16 | // -------------------------------------------------------------- 17 | // Indicate that the request is from the web. 18 | // -------------------------------------------------------------- 19 | $web = true; 20 | 21 | // -------------------------------------------------------------- 22 | // Set the core Laravel path constants. 23 | // -------------------------------------------------------------- 24 | require '../paths.php'; 25 | 26 | // -------------------------------------------------------------- 27 | // Unset the temporary web variable. 28 | // -------------------------------------------------------------- 29 | unset($web); 30 | 31 | // -------------------------------------------------------------- 32 | // Launch Laravel. 33 | // -------------------------------------------------------------- 34 | require path('sys').'laravel.php'; -------------------------------------------------------------------------------- /laravel/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeFileSessionHandler.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; 13 | 14 | /** 15 | * NativeFileSessionHandler. 16 | * 17 | * Native session handler using PHP's built in file storage. 18 | * 19 | * @author Drak 20 | */ 21 | class NativeFileSessionHandler extends NativeSessionHandler 22 | { 23 | /** 24 | * Constructor. 25 | * 26 | * @param string $savePath Path of directory to save session files. Default null will leave setting as defined by PHP. 27 | */ 28 | public function __construct($savePath = null) 29 | { 30 | if (null === $savePath) { 31 | $savePath = ini_get('session.save_path'); 32 | } 33 | 34 | if ($savePath && !is_dir($savePath)) { 35 | mkdir($savePath, 0777, true); 36 | } 37 | 38 | ini_set('session.save_handler', 'files'); 39 | ini_set('session.save_path', $savePath); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /laravel/tests/phpunit.php: -------------------------------------------------------------------------------- 1 | relationships[$relationship] = null; 27 | } 28 | } 29 | 30 | /** 31 | * Match eagerly loaded child models to their parent models. 32 | * 33 | * @param array $parents 34 | * @param array $children 35 | * @return void 36 | */ 37 | public function match($relationship, &$parents, $children) 38 | { 39 | $foreign = $this->foreign_key(); 40 | 41 | foreach ($parents as &$parent) 42 | { 43 | $matching = array_first($children, function($k, $v) use (&$parent, $foreign) 44 | { 45 | return $v->$foreign == $parent->get_key(); 46 | }); 47 | 48 | $parent->relationships[$relationship] = $matching; 49 | } 50 | } 51 | 52 | } -------------------------------------------------------------------------------- /laravel/tests/cases/fluent.test.php: -------------------------------------------------------------------------------- 1 | 'Taylor', 'age' => 25); 15 | 16 | $fluent = new Fluent($array); 17 | 18 | $this->assertEquals($array, $fluent->attributes); 19 | } 20 | 21 | /** 22 | * Test the Fluent::get method. 23 | * 24 | * @group laravel 25 | */ 26 | public function testGetMethodReturnsAttribute() 27 | { 28 | $fluent = new Fluent(array('name' => 'Taylor')); 29 | 30 | $this->assertEquals('Taylor', $fluent->get('name')); 31 | $this->assertEquals('Default', $fluent->get('foo', 'Default')); 32 | $this->assertEquals('Taylor', $fluent->name); 33 | $this->assertNull($fluent->foo); 34 | } 35 | 36 | public function testMagicMethodsCanBeUsedToSetAttributes() 37 | { 38 | $fluent = new Fluent; 39 | 40 | $fluent->name = 'Taylor'; 41 | $fluent->developer(); 42 | $fluent->age(25); 43 | 44 | $this->assertEquals('Taylor', $fluent->name); 45 | $this->assertTrue($fluent->developer); 46 | $this->assertEquals(25, $fluent->age); 47 | $this->assertInstanceOf('Laravel\\Fluent', $fluent->programmer()); 48 | } 49 | 50 | } -------------------------------------------------------------------------------- /laravel/session/drivers/apc.php: -------------------------------------------------------------------------------- 1 | apc = $apc; 21 | } 22 | 23 | /** 24 | * Load a session from storage by a given ID. 25 | * 26 | * If no session is found for the ID, null will be returned. 27 | * 28 | * @param string $id 29 | * @return array 30 | */ 31 | public function load($id) 32 | { 33 | return $this->apc->get($id); 34 | } 35 | 36 | /** 37 | * Save a given session to storage. 38 | * 39 | * @param array $session 40 | * @param array $config 41 | * @param bool $exists 42 | * @return void 43 | */ 44 | public function save($session, $config, $exists) 45 | { 46 | $this->apc->put($session['id'], $session, $config['lifetime']); 47 | } 48 | 49 | /** 50 | * Delete a session from storage by a given ID. 51 | * 52 | * @param string $id 53 | * @return void 54 | */ 55 | public function delete($id) 56 | { 57 | $this->apc->forget($id); 58 | } 59 | 60 | } -------------------------------------------------------------------------------- /laravel/session/drivers/cookie.php: -------------------------------------------------------------------------------- 1 | redis = $redis; 21 | } 22 | 23 | /** 24 | * Load a session from storage by a given ID. 25 | * 26 | * If no session is found for the ID, null will be returned. 27 | * 28 | * @param string $id 29 | * @return array 30 | */ 31 | public function load($id) 32 | { 33 | return $this->redis->get($id); 34 | } 35 | 36 | /** 37 | * Save a given session to storage. 38 | * 39 | * @param array $session 40 | * @param array $config 41 | * @param bool $exists 42 | * @return void 43 | */ 44 | public function save($session, $config, $exists) 45 | { 46 | $this->redis->put($session['id'], $session, $config['lifetime']); 47 | } 48 | 49 | /** 50 | * Delete a session from storage by a given ID. 51 | * 52 | * @param string $id 53 | * @return void 54 | */ 55 | public function delete($id) 56 | { 57 | $this->redis->forget($id); 58 | } 59 | 60 | } -------------------------------------------------------------------------------- /laravel/cli/tasks/key.php: -------------------------------------------------------------------------------- 1 | path = path('app').'config/application'.EXT; 23 | } 24 | 25 | /** 26 | * Generate a random key for the application. 27 | * 28 | * @param array $arguments 29 | * @return void 30 | */ 31 | public function generate($arguments = array()) 32 | { 33 | // By default the Crypter class uses AES-256 encryption which uses 34 | // a 32 byte input vector, so that is the length of string we will 35 | // generate for the application token unless another length is 36 | // specified through the CLI. 37 | $key = Str::random(array_get($arguments, 0, 32)); 38 | 39 | $config = File::get($this->path); 40 | 41 | $config = str_replace("'key' => '',", "'key' => '{$key}',", $config, $count); 42 | 43 | File::put($this->path, $config); 44 | 45 | if ($count > 0) 46 | { 47 | echo "Configuration updated with secure key!"; 48 | } 49 | else 50 | { 51 | echo "An application key already exists!"; 52 | } 53 | 54 | echo PHP_EOL; 55 | } 56 | 57 | } -------------------------------------------------------------------------------- /application/routes.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation; 13 | 14 | /** 15 | * Request represents an HTTP request from an Apache server. 16 | * 17 | * @author Fabien Potencier 18 | */ 19 | class ApacheRequest extends Request 20 | { 21 | /** 22 | * {@inheritdoc} 23 | */ 24 | protected function prepareRequestUri() 25 | { 26 | return $this->server->get('REQUEST_URI'); 27 | } 28 | 29 | /** 30 | * {@inheritdoc} 31 | */ 32 | protected function prepareBaseUrl() 33 | { 34 | $baseUrl = $this->server->get('SCRIPT_NAME'); 35 | 36 | if (false === strpos($this->server->get('REQUEST_URI'), $baseUrl)) { 37 | // assume mod_rewrite 38 | return rtrim(dirname($baseUrl), '/\\'); 39 | } 40 | 41 | return $baseUrl; 42 | } 43 | 44 | /** 45 | * {@inheritdoc} 46 | */ 47 | protected function preparePathInfo() 48 | { 49 | return $this->server->get('PATH_INFO') ?: substr($this->prepareRequestUri(), strlen($this->prepareBaseUrl())) ?: '/'; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /laravel/hash.php: -------------------------------------------------------------------------------- 1 | 9 | * // Create a Bcrypt hash of a value 10 | * $hash = Hash::make('secret'); 11 | * 12 | * // Use a specified number of iterations when creating the hash 13 | * $hash = Hash::make('secret', 12); 14 | * 15 | * 16 | * @param string $value 17 | * @param int $rounds 18 | * @return string 19 | */ 20 | public static function make($value, $rounds = 8) 21 | { 22 | $work = str_pad($rounds, 2, '0', STR_PAD_LEFT); 23 | 24 | // Bcrypt expects the salt to be 22 base64 encoded characters including 25 | // dots and slashes. We will get rid of the plus signs included in the 26 | // base64 data and replace them with dots. 27 | if (function_exists('openssl_random_pseudo_bytes')) 28 | { 29 | $salt = openssl_random_pseudo_bytes(16); 30 | } 31 | else 32 | { 33 | $salt = Str::random(40); 34 | } 35 | 36 | $salt = substr(strtr(base64_encode($salt), '+', '.'), 0 , 22); 37 | 38 | return crypt($value, '$2a$'.$work.'$'.$salt); 39 | } 40 | 41 | /** 42 | * Determine if an unhashed value matches a Bcrypt hash. 43 | * 44 | * @param string $value 45 | * @param string $hash 46 | * @return bool 47 | */ 48 | public static function check($value, $hash) 49 | { 50 | return crypt($value, $hash) === $hash; 51 | } 52 | 53 | } -------------------------------------------------------------------------------- /laravel/session/drivers/memcached.php: -------------------------------------------------------------------------------- 1 | memcached = $memcached; 21 | } 22 | 23 | /** 24 | * Load a session from storage by a given ID. 25 | * 26 | * If no session is found for the ID, null will be returned. 27 | * 28 | * @param string $id 29 | * @return array 30 | */ 31 | public function load($id) 32 | { 33 | return $this->memcached->get($id); 34 | } 35 | 36 | /** 37 | * Save a given session to storage. 38 | * 39 | * @param array $session 40 | * @param array $config 41 | * @param bool $exists 42 | * @return void 43 | */ 44 | public function save($session, $config, $exists) 45 | { 46 | $this->memcached->put($session['id'], $session, $config['lifetime']); 47 | } 48 | 49 | /** 50 | * Delete a session from storage by a given ID. 51 | * 52 | * @param string $id 53 | * @return void 54 | */ 55 | public function delete($id) 56 | { 57 | $this->memcached->forget($id); 58 | } 59 | 60 | } -------------------------------------------------------------------------------- /laravel/cli/tasks/route.php: -------------------------------------------------------------------------------- 1 | route(); 30 | 31 | echo PHP_EOL; 32 | } 33 | 34 | /** 35 | * Dump the results of the currently established route. 36 | * 37 | * @return void 38 | */ 39 | protected function route() 40 | { 41 | // We'll call the router using the method and URI specified by 42 | // the developer on the CLI. If a route is found, we will not 43 | // run the filters, but simply dump the result. 44 | $route = Router::route(Request::method(), URI::current()); 45 | 46 | if ( ! is_null($route)) 47 | { 48 | var_dump($route->response()); 49 | } 50 | else 51 | { 52 | echo '404: Not Found'; 53 | } 54 | } 55 | 56 | } -------------------------------------------------------------------------------- /bundles/bootstrapper/buttongroup.php: -------------------------------------------------------------------------------- 1 | '; 46 | } 47 | 48 | /** 49 | * Closes the ButtonGroup section. 50 | * @return string 51 | */ 52 | public static function close() 53 | { 54 | return ''; 55 | } 56 | } -------------------------------------------------------------------------------- /laravel/database/query/join.php: -------------------------------------------------------------------------------- 1 | type = $type; 36 | $this->table = $table; 37 | } 38 | 39 | /** 40 | * Add an ON clause to the join. 41 | * 42 | * @param string $column1 43 | * @param string $operator 44 | * @param string $column2 45 | * @param string $connector 46 | * @return Join 47 | */ 48 | public function on($column1, $operator, $column2, $connector = 'AND') 49 | { 50 | $this->clauses[] = compact('column1', 'operator', 'column2', 'connector'); 51 | 52 | return $this; 53 | } 54 | 55 | /** 56 | * Add an OR ON clause to the join. 57 | * 58 | * @param string $column1 59 | * @param string $operator 60 | * @param string $column2 61 | * @return Join 62 | */ 63 | public function or_on($column1, $operator, $column2) 64 | { 65 | return $this->on($column1, $operator, $column2, 'OR'); 66 | } 67 | 68 | } -------------------------------------------------------------------------------- /laravel/cli/tasks/bundle/publisher.php: -------------------------------------------------------------------------------- 1 | move($path.'public', path('public').'bundles'.DS.$bundle); 27 | 28 | echo "Assets published for bundle [$bundle].".PHP_EOL; 29 | } 30 | 31 | /** 32 | * Copy the contents of a bundle's assets to the public folder. 33 | * 34 | * @param string $source 35 | * @param string $destination 36 | * @return void 37 | */ 38 | protected function move($source, $destination) 39 | { 40 | File::cpdir($source, $destination); 41 | } 42 | 43 | /** 44 | * Get the "to" location of the bundle's assets. 45 | * 46 | * @param string $bundle 47 | * @return string 48 | */ 49 | protected function to($bundle) 50 | { 51 | return path('public').'bundles'.DS.$bundle.DS; 52 | } 53 | 54 | /** 55 | * Get the "from" location of the bundle's assets. 56 | * 57 | * @param string $bundle 58 | * @return string 59 | */ 60 | protected function from($bundle) 61 | { 62 | return Bundle::path($bundle).'public'; 63 | } 64 | 65 | } -------------------------------------------------------------------------------- /laravel/tests/application/bundles.php: -------------------------------------------------------------------------------- 1 | array( 22 | | 'location' => 'admin', 23 | | 'handles' => 'admin', 24 | | ), 25 | | 26 | | Note that the "location" is relative to the "bundles" directory. 27 | | Now the bundle will be recognized by Laravel and will be able 28 | | to respond to requests beginning with "admin"! 29 | | 30 | | Have a bundle that lives in the root of the bundle directory 31 | | and doesn't respond to any requests? Just add the bundle 32 | | name to the array and we'll take care of the rest. 33 | | 34 | */ 35 | 36 | return array('dashboard' => array('handles' => 'dashboard'), 'dummy'); -------------------------------------------------------------------------------- /laravel/vendor/Symfony/Component/HttpFoundation/JsonResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation; 13 | 14 | /** 15 | * Response represents an HTTP response in JSON format. 16 | * 17 | * @author Igor Wiedler 18 | */ 19 | class JsonResponse extends Response 20 | { 21 | /** 22 | * Constructor. 23 | * 24 | * @param mixed $data The response data 25 | * @param integer $status The response status code 26 | * @param array $headers An array of response headers 27 | */ 28 | public function __construct($data = array(), $status = 200, $headers = array()) 29 | { 30 | // root should be JSON object, not array 31 | if (is_array($data) && 0 === count($data)) { 32 | $data = new \ArrayObject(); 33 | } 34 | 35 | parent::__construct( 36 | json_encode($data), 37 | $status, 38 | array_merge(array('Content-Type' => 'application/json'), $headers) 39 | ); 40 | } 41 | 42 | /** 43 | * {@inheritDoc} 44 | */ 45 | static public function create($data = array(), $status = 200, $headers = array()) 46 | { 47 | return new static($data, $status, $headers); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /laravel/database/connectors/mysql.php: -------------------------------------------------------------------------------- 1 | options($config)); 34 | 35 | // If a character set has been specified, we'll execute a query against 36 | // the database to set the correct character set. By default, this is 37 | // set to UTF-8 which should be fine for most scenarios. 38 | if (isset($config['charset'])) 39 | { 40 | $connection->prepare("SET NAMES '{$config['charset']}'")->execute(); 41 | } 42 | 43 | return $connection; 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /laravel/database/eloquent/relationships/has_one_or_many.php: -------------------------------------------------------------------------------- 1 | attributes : $attributes; 16 | 17 | $attributes[$this->foreign_key()] = $this->base->get_key(); 18 | 19 | return $this->model->create($attributes); 20 | } 21 | 22 | /** 23 | * Update a record for the association. 24 | * 25 | * @param array $attributes 26 | * @return bool 27 | */ 28 | public function update(array $attributes) 29 | { 30 | if ($this->model->timestamps()) 31 | { 32 | $attributes['updated_at'] = new \DateTime; 33 | } 34 | 35 | return $this->table->update($attributes); 36 | } 37 | 38 | /** 39 | * Set the proper constraints on the relationship table. 40 | * 41 | * @return void 42 | */ 43 | protected function constrain() 44 | { 45 | $this->table->where($this->foreign_key(), '=', $this->base->get_key()); 46 | } 47 | 48 | /** 49 | * Set the proper constraints on the relationship table for an eager load. 50 | * 51 | * @param array $results 52 | * @return void 53 | */ 54 | public function eagerly_constrain($results) 55 | { 56 | $this->table->where_in($this->foreign_key(), $this->keys($results)); 57 | } 58 | 59 | } -------------------------------------------------------------------------------- /laravel/vendor/Symfony/Component/HttpFoundation/README.md: -------------------------------------------------------------------------------- 1 | HttpFoundation Component 2 | ======================== 3 | 4 | HttpFoundation defines an object-oriented layer for the HTTP specification. 5 | 6 | It provides an abstraction for requests, responses, uploaded files, cookies, 7 | sessions, ... 8 | 9 | In this example, we get a Request object from the current PHP global 10 | variables: 11 | 12 | use Symfony\Component\HttpFoundation\Request; 13 | use Symfony\Component\HttpFoundation\Response; 14 | 15 | $request = Request::createFromGlobals(); 16 | echo $request->getPathInfo(); 17 | 18 | You can also create a Request directly -- that's interesting for unit testing: 19 | 20 | $request = Request::create('/?foo=bar', 'GET'); 21 | echo $request->getPathInfo(); 22 | 23 | And here is how to create and send a Response: 24 | 25 | $response = new Response('Not Found', 404, array('Content-Type' => 'text/plain')); 26 | $response->send(); 27 | 28 | The Request and the Response classes have many other methods that implement 29 | the HTTP specification. 30 | 31 | Loading 32 | ------- 33 | 34 | If you are using PHP 5.3.x you must add the following to your autoloader: 35 | 36 | // SessionHandlerInterface 37 | if (!interface_exists('SessionHandlerInterface')) { 38 | $loader->registerPrefixFallback(__DIR__.'/../vendor/symfony/src/Symfony/Component/HttpFoundation/Resources/stubs'); 39 | } 40 | 41 | 42 | Resources 43 | --------- 44 | 45 | Unit tests: 46 | 47 | https://github.com/symfony/symfony/tree/master/tests/Symfony/Tests/Component/HttpFoundation 48 | -------------------------------------------------------------------------------- /laravel/cli/artisan.php: -------------------------------------------------------------------------------- 1 | getMessage(); 47 | } 48 | 49 | echo PHP_EOL; -------------------------------------------------------------------------------- /laravel/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/NullSessionHandler.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; 13 | 14 | /** 15 | * NullSessionHandler. 16 | * 17 | * Can be used in unit testing or in a sitation where persisted sessions are not desired. 18 | * 19 | * @author Drak 20 | * 21 | * @api 22 | */ 23 | class NullSessionHandler implements \SessionHandlerInterface 24 | { 25 | /** 26 | * {@inheritdoc} 27 | */ 28 | public function open($savePath, $sessionName) 29 | { 30 | return true; 31 | } 32 | 33 | /** 34 | * {@inheritdoc} 35 | */ 36 | public function close() 37 | { 38 | return true; 39 | } 40 | 41 | /** 42 | * {@inheritdoc} 43 | */ 44 | public function read($sessionId) 45 | { 46 | return ''; 47 | } 48 | 49 | /** 50 | * {@inheritdoc} 51 | */ 52 | public function write($sessionId, $data) 53 | { 54 | return true; 55 | } 56 | 57 | /** 58 | * {@inheritdoc} 59 | */ 60 | public function destroy($sessionId) 61 | { 62 | return true; 63 | } 64 | 65 | /** 66 | * {@inheritdoc} 67 | */ 68 | public function gc($lifetime) 69 | { 70 | return true; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /laravel/vendor/Symfony/Component/HttpFoundation/ServerBag.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation; 13 | 14 | /** 15 | * ServerBag is a container for HTTP headers from the $_SERVER variable. 16 | * 17 | * @author Fabien Potencier 18 | * @author Bulat Shakirzyanov 19 | */ 20 | class ServerBag extends ParameterBag 21 | { 22 | /** 23 | * Gets the HTTP headers. 24 | * 25 | * @return string 26 | */ 27 | public function getHeaders() 28 | { 29 | $headers = array(); 30 | foreach ($this->parameters as $key => $value) { 31 | if (0 === strpos($key, 'HTTP_')) { 32 | $headers[substr($key, 5)] = $value; 33 | } 34 | // CONTENT_* are not prefixed with HTTP_ 35 | elseif (in_array($key, array('CONTENT_LENGTH', 'CONTENT_MD5', 'CONTENT_TYPE'))) { 36 | $headers[$key] = $this->parameters[$key]; 37 | } 38 | } 39 | 40 | // PHP_AUTH_USER/PHP_AUTH_PW 41 | if (isset($this->parameters['PHP_AUTH_USER'])) { 42 | $pass = isset($this->parameters['PHP_AUTH_PW']) ? $this->parameters['PHP_AUTH_PW'] : ''; 43 | $headers['AUTHORIZATION'] = 'Basic '.base64_encode($this->parameters['PHP_AUTH_USER'].':'.$pass); 44 | } 45 | 46 | return $headers; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /laravel/tests/cases/ioc.test.php: -------------------------------------------------------------------------------- 1 | assertEquals('Taylor', IoC::resolve('foo')); 18 | } 19 | 20 | /** 21 | * Test that singletons are created once. 22 | * 23 | * @group laravel 24 | */ 25 | public function testSingletonsAreCreatedOnce() 26 | { 27 | IoC::singleton('foo', function() 28 | { 29 | return new StdClass; 30 | }); 31 | 32 | $object = IoC::resolve('foo'); 33 | 34 | $this->assertTrue($object === IoC::resolve('foo')); 35 | } 36 | 37 | /** 38 | * Test the IoC::instance method. 39 | * 40 | * @group laravel 41 | */ 42 | public function testInstancesAreReturnedBySingleton() 43 | { 44 | $object = new StdClass; 45 | 46 | IoC::instance('bar', $object); 47 | 48 | $this->assertTrue($object === IoC::resolve('bar')); 49 | } 50 | 51 | /** 52 | * Test the IoC::registered method. 53 | */ 54 | public function testRegisteredMethodIndicatesIfRegistered() 55 | { 56 | IoC::register('foo', function() {}); 57 | 58 | $this->assertTrue(IoC::registered('foo')); 59 | $this->assertFalse(IoC::registered('baz')); 60 | } 61 | 62 | /** 63 | * Test the IoC::controller method. 64 | * 65 | * @group laravel 66 | */ 67 | public function testControllerMethodRegistersAController() 68 | { 69 | IoC::register('controller: ioc.test', function() {}); 70 | 71 | $this->assertTrue(IoC::registered('controller: ioc.test')); 72 | } 73 | 74 | } -------------------------------------------------------------------------------- /laravel/database/connectors/postgres.php: -------------------------------------------------------------------------------- 1 | PDO::CASE_LOWER, 12 | PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, 13 | PDO::ATTR_ORACLE_NULLS => PDO::NULL_NATURAL, 14 | PDO::ATTR_STRINGIFY_FETCHES => false, 15 | ); 16 | 17 | /** 18 | * Establish a PDO database connection. 19 | * 20 | * @param array $config 21 | * @return PDO 22 | */ 23 | public function connect($config) 24 | { 25 | extract($config); 26 | 27 | $dsn = "pgsql:host={$host};dbname={$database}"; 28 | 29 | // The developer has the freedom of specifying a port for the PostgresSQL 30 | // database or the default port (5432) will be used by PDO to create the 31 | // connection to the database for the developer. 32 | if (isset($config['port'])) 33 | { 34 | $dsn .= ";port={$config['port']}"; 35 | } 36 | 37 | $connection = new PDO($dsn, $username, $password, $this->options($config)); 38 | 39 | // If a character set has been specified, we'll execute a query against 40 | // the database to set the correct character set. By default, this is 41 | // set to UTF-8 which should be fine for most scenarios. 42 | if (isset($config['charset'])) 43 | { 44 | $connection->prepare("SET NAMES '{$config['charset']}'")->execute(); 45 | } 46 | 47 | // If a schema has been specified, we'll execute a query against 48 | // the database to set the search path. 49 | if (isset($config['schema'])) 50 | { 51 | $connection->prepare("SET search_path TO '{$config['schema']}'")->execute(); 52 | } 53 | 54 | return $connection; 55 | } 56 | 57 | } -------------------------------------------------------------------------------- /laravel/vendor/Symfony/Component/Console/README.md: -------------------------------------------------------------------------------- 1 | Console Component 2 | ================= 3 | 4 | Console eases the creation of beautiful and testable command line interfaces. 5 | 6 | The Application object manages the CLI application: 7 | 8 | use Symfony\Component\Console\Application; 9 | 10 | $console = new Application(); 11 | $console->run(); 12 | 13 | The ``run()`` method parses the arguments and options passed on the command 14 | line and executes the right command. 15 | 16 | Registering a new command can easily be done via the ``register()`` method, 17 | which returns a ``Command`` instance: 18 | 19 | use Symfony\Component\Console\Input\InputInterface; 20 | use Symfony\Component\Console\Input\InputArgument; 21 | use Symfony\Component\Console\Input\InputOption; 22 | use Symfony\Component\Console\Output\OutputInterface; 23 | 24 | $console 25 | ->register('ls') 26 | ->setDefinition(array( 27 | new InputArgument('dir', InputArgument::REQUIRED, 'Directory name'), 28 | )) 29 | ->setDescription('Displays the files in the given directory') 30 | ->setCode(function (InputInterface $input, OutputInterface $output) { 31 | $dir = $input->getArgument('dir'); 32 | 33 | $output->writeln(sprintf('Dir listing for %s', $dir)); 34 | }) 35 | ; 36 | 37 | You can also register new commands via classes. 38 | 39 | The component provides a lot of features like output coloring, input and 40 | output abstractions (so that you can easily unit-test your commands), 41 | validation, automatic help messages, ... 42 | 43 | Resources 44 | --------- 45 | 46 | Unit tests: 47 | 48 | https://github.com/symfony/symfony/tree/master/tests/Symfony/Tests/Component/Console 49 | -------------------------------------------------------------------------------- /laravel/vendor/Symfony/Component/HttpFoundation/File/MimeType/FileinfoMimeTypeGuesser.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation\File\MimeType; 13 | 14 | use Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException; 15 | use Symfony\Component\HttpFoundation\File\Exception\AccessDeniedException; 16 | 17 | /** 18 | * Guesses the mime type using the PECL extension FileInfo 19 | * 20 | * @author Bernhard Schussek 21 | */ 22 | class FileinfoMimeTypeGuesser implements MimeTypeGuesserInterface 23 | { 24 | /** 25 | * Returns whether this guesser is supported on the current OS/PHP setup 26 | * 27 | * @return Boolean 28 | */ 29 | static public function isSupported() 30 | { 31 | return function_exists('finfo_open'); 32 | } 33 | 34 | /** 35 | * Guesses the mime type of the file with the given path 36 | * 37 | * @see MimeTypeGuesserInterface::guess() 38 | */ 39 | public function guess($path) 40 | { 41 | if (!is_file($path)) { 42 | throw new FileNotFoundException($path); 43 | } 44 | 45 | if (!is_readable($path)) { 46 | throw new AccessDeniedException($path); 47 | } 48 | 49 | if (!self::isSupported()) { 50 | return null; 51 | } 52 | 53 | if (!$finfo = new \finfo(FILEINFO_MIME_TYPE)) { 54 | return null; 55 | } 56 | 57 | return $finfo->file($path); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /laravel/vendor/Symfony/Component/Console/Formatter/OutputFormatterStyleInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Console\Formatter; 13 | 14 | /** 15 | * Formatter style interface for defining styles. 16 | * 17 | * @author Konstantin Kudryashov 18 | * 19 | * @api 20 | */ 21 | interface OutputFormatterStyleInterface 22 | { 23 | /** 24 | * Sets style foreground color. 25 | * 26 | * @param string $color color name 27 | * 28 | * @api 29 | */ 30 | function setForeground($color = null); 31 | 32 | /** 33 | * Sets style background color. 34 | * 35 | * @param string $color color name 36 | * 37 | * @api 38 | */ 39 | function setBackground($color = null); 40 | 41 | /** 42 | * Sets some specific style option. 43 | * 44 | * @param string $option option name 45 | * 46 | * @api 47 | */ 48 | function setOption($option); 49 | 50 | /** 51 | * Unsets some specific style option. 52 | * 53 | * @param string $option option name 54 | */ 55 | function unsetOption($option); 56 | 57 | /** 58 | * Sets multiple style options at once. 59 | * 60 | * @param array $options 61 | */ 62 | function setOptions(array $options); 63 | 64 | /** 65 | * Applies the style to a given text. 66 | * 67 | * @param string $text The text to style 68 | * 69 | * @return string 70 | */ 71 | function apply($text); 72 | } 73 | -------------------------------------------------------------------------------- /bundles/bootstrapper/breadcrumbs.php: -------------------------------------------------------------------------------- 1 | $url) 37 | { 38 | if (is_string($label) || is_array($url)) 39 | { 40 | $l[] = static::renderItem(''.$label.''); 41 | } 42 | else 43 | $l[] = static::renderItem($url, true); 44 | } 45 | 46 | $attributes = Helpers::add_class($attributes, 'breadcrumb'); 47 | 48 | $html = ''; 49 | $html .= implode('', $l); 50 | $html .= ''; 51 | return $html; 52 | } 53 | 54 | 55 | /** 56 | * Renders a breadcrumb item. 57 | * @param string $content 58 | * @param boolean $active 59 | * @return string 60 | */ 61 | protected static function renderItem($content, $active = false) 62 | { 63 | $separator = !$active ? ''.static::$separator.'' : ''; 64 | 65 | $class = $active ? ' class="active"' : ''; 66 | 67 | $html = ''; 68 | $html .= $content.$separator; 69 | $html .= ''; 70 | return $html; 71 | } 72 | } -------------------------------------------------------------------------------- /laravel/auth/drivers/eloquent.php: -------------------------------------------------------------------------------- 1 | model()->find($id); 18 | } 19 | } 20 | 21 | /** 22 | * Attempt to log a user into the application. 23 | * 24 | * @param array $arguments 25 | * @return void 26 | */ 27 | public function attempt($arguments = array()) 28 | { 29 | $user = $this->model()->where(function($query) use($arguments) 30 | { 31 | $username = Config::get('auth.username'); 32 | 33 | $query->where($username, '=', $arguments['username']); 34 | 35 | foreach(array_except($arguments, array('username', 'password', 'remember')) as $column => $val) 36 | { 37 | $query->where($column, '=', $val); 38 | } 39 | })->first(); 40 | 41 | // If the credentials match what is in the database we will just 42 | // log the user into the application and remember them if asked. 43 | $password = $arguments['password']; 44 | 45 | $password_field = Config::get('auth.password', 'password'); 46 | 47 | if ( ! is_null($user) and Hash::check($password, $user->get_attribute($password_field))) 48 | { 49 | return $this->login($user->id, array_get($arguments, 'remember')); 50 | } 51 | 52 | return false; 53 | } 54 | 55 | /** 56 | * Get a fresh model instance. 57 | * 58 | * @return Eloquent 59 | */ 60 | protected function model() 61 | { 62 | $model = Config::get('auth.model'); 63 | 64 | return new $model; 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /laravel/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeSqliteSessionHandler.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; 13 | 14 | /** 15 | * NativeSqliteSessionHandler. 16 | * 17 | * Driver for the sqlite session save hadlers provided by the SQLite PHP extension. 18 | * 19 | * @author Drak 20 | */ 21 | class NativeSqliteSessionHandler extends NativeSessionHandler 22 | { 23 | /** 24 | * Constructor. 25 | * 26 | * @param string $savePath Path to SQLite database file itself. 27 | * @param array $options Session configuration options. 28 | */ 29 | public function __construct($savePath, array $options = array()) 30 | { 31 | if (!extension_loaded('sqlite')) { 32 | throw new \RuntimeException('PHP does not have "sqlite" session module registered'); 33 | } 34 | 35 | if (null === $savePath) { 36 | $savePath = ini_get('session.save_path'); 37 | } 38 | 39 | ini_set('session.save_handler', 'sqlite'); 40 | ini_set('session.save_path', $savePath); 41 | 42 | $this->setOptions($options); 43 | } 44 | 45 | /** 46 | * Set any sqlite ini values. 47 | * 48 | * @see http://php.net/sqlite.configuration 49 | */ 50 | protected function setOptions(array $options) 51 | { 52 | foreach ($options as $key => $value) { 53 | if (in_array($key, array('sqlite.assoc_case'))) { 54 | ini_set($key, $value); 55 | } 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /laravel/tests/cases/uri.test.php: -------------------------------------------------------------------------------- 1 | setRequestUri($uri); 41 | 42 | $this->assertEquals($expectation, URI::current()); 43 | } 44 | 45 | /** 46 | * Test the URI::segment method. 47 | * 48 | * @group laravel 49 | */ 50 | public function testSegmentMethodReturnsAURISegment() 51 | { 52 | $this->setRequestUri('/user/profile'); 53 | 54 | $this->assertEquals('user', URI::segment(1)); 55 | $this->assertEquals('profile', URI::segment(2)); 56 | } 57 | 58 | /** 59 | * Data provider for the URI::current test. 60 | */ 61 | public function requestUriProvider() 62 | { 63 | return array( 64 | array('/user', 'user'), 65 | array('/user/', 'user'), 66 | array('', '/'), 67 | array('/', '/'), 68 | array('//', '/'), 69 | array('/user', 'user'), 70 | array('/user/', 'user'), 71 | array('/user/profile', 'user/profile'), 72 | ); 73 | } 74 | 75 | } -------------------------------------------------------------------------------- /laravel/vendor/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBagInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation\Session\Attribute; 13 | 14 | use Symfony\Component\HttpFoundation\Session\SessionBagInterface; 15 | 16 | /** 17 | * Attributes store. 18 | * 19 | * @author Drak 20 | */ 21 | interface AttributeBagInterface extends SessionBagInterface 22 | { 23 | /** 24 | * Checks if an attribute is defined. 25 | * 26 | * @param string $name The attribute name 27 | * 28 | * @return Boolean true if the attribute is defined, false otherwise 29 | */ 30 | function has($name); 31 | 32 | /** 33 | * Returns an attribute. 34 | * 35 | * @param string $name The attribute name 36 | * @param mixed $default The default value if not found. 37 | * 38 | * @return mixed 39 | */ 40 | function get($name, $default = null); 41 | 42 | /** 43 | * Sets an attribute. 44 | * 45 | * @param string $name 46 | * @param mixed $value 47 | */ 48 | function set($name, $value); 49 | 50 | /** 51 | * Returns attributes. 52 | * 53 | * @return array Attributes 54 | */ 55 | function all(); 56 | 57 | /** 58 | * Sets attributes. 59 | * 60 | * @param array $attributes Attributes 61 | */ 62 | function replace(array $attributes); 63 | 64 | /** 65 | * Removes an attribute. 66 | * 67 | * @param string $name 68 | * 69 | * @return mixed The removed value 70 | */ 71 | function remove($name); 72 | } 73 | -------------------------------------------------------------------------------- /laravel/documentation/database/raw.md: -------------------------------------------------------------------------------- 1 | # Raw Queries 2 | 3 | ## Contents 4 | 5 | - [The Basics](#the-basics) 6 | - [Other Query Methods](#other-query-methods) 7 | - [PDO Connections](#pdo-connections) 8 | 9 | 10 | ## The Basics 11 | 12 | The **query** method is used to execute arbitrary, raw SQL against your database connection. 13 | 14 | #### Selecting records from the database: 15 | 16 | $users = DB::query('select * from users'); 17 | 18 | #### Selecting records from the database using bindings: 19 | 20 | $users = DB::query('select * from users where name = ?', array('test')); 21 | 22 | #### Inserting a record into the database 23 | 24 | $success = DB::query('insert into users values (?, ?)', $bindings); 25 | 26 | #### Updating table records and getting the number of affected rows: 27 | 28 | $affected = DB::query('update users set name = ?', $bindings); 29 | 30 | #### Deleting from a table and getting the number of affected rows: 31 | 32 | $affected = DB::query('delete from users where id = ?', array(1)); 33 | 34 | 35 | ## Other Query Methods 36 | 37 | Laravel provides a few other methods to make querying your database simple. Here's an overview: 38 | 39 | #### Running a SELECT query and returning the first result: 40 | 41 | $user = DB::first('select * from users where id = 1'); 42 | 43 | #### Running a SELECT query and getting the value of a single column: 44 | 45 | $email = DB::only('select email from users where id = 1'); 46 | 47 | 48 | ## PDO Connections 49 | 50 | Sometimes you may wish to access the raw PDO connection behind the Laravel Connection object. 51 | 52 | #### Get the raw PDO connection for a database: 53 | 54 | $pdo = DB::connection('sqlite')->pdo; 55 | 56 | > **Note:** If no connection name is specified, the **default** connection will be returned. -------------------------------------------------------------------------------- /application/views/user/profile.blade.php: -------------------------------------------------------------------------------- 1 | @layout('templates.template') 2 | 3 | @section('content') 4 |
5 |

What's happening, {{ Auth::User()->name }} ?

6 |
7 |
8 | {{ Form::open('user/index', 'POST'); }} 9 | {{ Form::token() }} 10 | {{ $errors->first('critt', Alert::error(":message")) }} 11 | 12 | 13 | {{ Form::close() }} 14 |
15 |
16 | 17 |
18 |
19 |
20 |
21 |
22 |

{{Auth::User()->username}}

23 |

First Last Name

24 | {{ Badges::warning($count.' critts');}} {{ Badges::info($followers.' followers');}} 25 |
26 |
27 |
28 |
29 | 30 |
31 |
32 |

Previously Critted:

33 | @foreach ($critts -> results as $critt) 34 |
35 |
36 |

{{ $critt->critt }}

37 | At {{$critt->updated_at}} 38 |

 

39 |
40 | @endforeach 41 |
42 | {{ $critts -> pager(true); }} 43 |
44 |
45 |
46 | @endsection 47 | @section('scripts') 48 | {{ HTML::script('js/charcounter.js');}} 49 | {{ HTML::script('js/app.js');}} 50 | @endsection -------------------------------------------------------------------------------- /laravel/tests/cases/database.test.php: -------------------------------------------------------------------------------- 1 | assertTrue(isset(DB::$connections[Config::get('database.default')])); 30 | 31 | $connection = DatabaseConnectStub::connection('mysql'); 32 | $this->assertTrue(isset(DB::$connections['mysql'])); 33 | $this->assertEquals(DB::$connections['mysql']->pdo->laravel_config, Config::get('database.connections.mysql')); 34 | } 35 | 36 | /** 37 | * Test the DB::profile method. 38 | * 39 | * @group laravel 40 | */ 41 | public function testProfileMethodReturnsQueries() 42 | { 43 | Laravel\Database\Connection::$queries = array('Taylor'); 44 | $this->assertEquals(array('Taylor'), DB::profile()); 45 | Laravel\Database\Connection::$queries = array(); 46 | } 47 | 48 | /** 49 | * Test the __callStatic method. 50 | * 51 | * @group laravel 52 | */ 53 | public function testConnectionMethodsCanBeCalledStaticly() 54 | { 55 | $this->assertEquals('sqlite', DB::driver()); 56 | } 57 | 58 | } 59 | 60 | class DatabaseConnectStub extends Laravel\Database { 61 | 62 | protected static function connect($config) { return new PDOStub($config); } 63 | 64 | } 65 | 66 | class PDOStub extends PDO { 67 | 68 | public $laravel_config; 69 | 70 | public function __construct($config) { $this->laravel_config = $config; } 71 | 72 | public function foo() { return 'foo'; } 73 | 74 | } -------------------------------------------------------------------------------- /laravel/memcached.php: -------------------------------------------------------------------------------- 1 | 16 | * // Get the Memcache connection and get an item from the cache 17 | * $name = Memcached::connection()->get('name'); 18 | * 19 | * // Get the Memcache connection and place an item in the cache 20 | * Memcached::connection()->set('name', 'Taylor'); 21 | * 22 | * 23 | * @return Memcached 24 | */ 25 | public static function connection() 26 | { 27 | if (is_null(static::$connection)) 28 | { 29 | static::$connection = static::connect(Config::get('cache.memcached')); 30 | } 31 | 32 | return static::$connection; 33 | } 34 | 35 | /** 36 | * Create a new Memcached connection instance. 37 | * 38 | * @param array $servers 39 | * @return Memcached 40 | */ 41 | protected static function connect($servers) 42 | { 43 | $memcache = new \Memcached; 44 | 45 | foreach ($servers as $server) 46 | { 47 | $memcache->addServer($server['host'], $server['port'], $server['weight']); 48 | } 49 | 50 | if ($memcache->getVersion() === false) 51 | { 52 | throw new \Exception('Could not establish memcached connection.'); 53 | } 54 | 55 | return $memcache; 56 | } 57 | 58 | /** 59 | * Dynamically pass all other method calls to the Memcache instance. 60 | * 61 | * 62 | * // Get an item from the Memcache instance 63 | * $name = Memcached::get('name'); 64 | * 65 | * // Store data on the Memcache server 66 | * Memcached::set('name', 'Taylor'); 67 | * 68 | */ 69 | public static function __callStatic($method, $parameters) 70 | { 71 | return call_user_func_array(array(static::connection(), $method), $parameters); 72 | } 73 | 74 | } -------------------------------------------------------------------------------- /application/views/others/profile.blade.php: -------------------------------------------------------------------------------- 1 | @layout('templates.template') 2 | 3 | @section('content') 4 |
5 |

{{$username;}} Wrote

6 |
7 |
8 |
9 |
10 |
11 |

@{{$username;}}

12 | @if ( Auth::user() && ($following == false)) 13 | {{ Form::open('user/follow', 'POST');}} 14 | {{ Form::token(); }} 15 | 16 | {{ Form::submit('Follow');}} 17 | {{ Form::close();}} 18 | @endif 19 | @if ( Auth::user() && ($following == true)) 20 | {{ Form::open('user/unfollow', 'POST');}} 21 | {{ Form::token(); }} 22 | 23 | {{ Form::submit('Unfollow');}} 24 | {{ Form::close();}} 25 | @endif 26 |

First Last Name

27 | {{ Badges::warning($count.' critts');}} {{ Badges::info($followers.' followers');}} 28 |
29 |
30 |
31 |
32 | 33 |
34 |
35 |

Previously Critted:

36 | 37 | @foreach ($critts -> results as $critt) 38 |
39 |
40 |

{{ $critt->critt }}

41 | At {{$critt->updated_at}} 42 |

 

43 |
44 | @endforeach 45 |
46 | {{ $critts -> pager(true); }} 47 |
48 |
49 |
50 | @endsection 51 | 52 | @section('scripts') 53 | {{ HTML::script('js/charcounter.js');}} 54 | {{ HTML::script('js/app.js');}} 55 | @endsection -------------------------------------------------------------------------------- /laravel/cache/drivers/apc.php: -------------------------------------------------------------------------------- 1 | key = $key; 21 | } 22 | 23 | /** 24 | * Determine if an item exists in the cache. 25 | * 26 | * @param string $key 27 | * @return bool 28 | */ 29 | public function has($key) 30 | { 31 | return ( ! is_null($this->get($key))); 32 | } 33 | 34 | /** 35 | * Retrieve an item from the cache driver. 36 | * 37 | * @param string $key 38 | * @return mixed 39 | */ 40 | protected function retrieve($key) 41 | { 42 | if (($cache = apc_fetch($this->key.$key)) !== false) 43 | { 44 | return $cache; 45 | } 46 | } 47 | 48 | /** 49 | * Write an item to the cache for a given number of minutes. 50 | * 51 | * 52 | * // Put an item in the cache for 15 minutes 53 | * Cache::put('name', 'Taylor', 15); 54 | * 55 | * 56 | * @param string $key 57 | * @param mixed $value 58 | * @param int $minutes 59 | * @return void 60 | */ 61 | public function put($key, $value, $minutes) 62 | { 63 | apc_store($this->key.$key, $value, $minutes * 60); 64 | } 65 | 66 | /** 67 | * Write an item to the cache that lasts forever. 68 | * 69 | * @param string $key 70 | * @param mixed $value 71 | * @return void 72 | */ 73 | public function forever($key, $value) 74 | { 75 | return $this->put($key, $value, 0); 76 | } 77 | 78 | /** 79 | * Delete an item from the cache. 80 | * 81 | * @param string $key 82 | * @return void 83 | */ 84 | public function forget($key) 85 | { 86 | apc_delete($this->key.$key); 87 | } 88 | 89 | } -------------------------------------------------------------------------------- /laravel/documentation/requests.md: -------------------------------------------------------------------------------- 1 | # Examining Requests 2 | 3 | ## Contents 4 | 5 | - [Working With The URI](#working-with-the-uri) 6 | - [Other Request Helpers](#other-request-helpers) 7 | 8 | 9 | ## Working With The URI 10 | 11 | #### Getting the current URI for the request: 12 | 13 | echo URI::current(); 14 | 15 | #### Getting a specific segment from the URI: 16 | 17 | echo URI::segment(1); 18 | 19 | #### Returning a default value if the segment doesn't exist: 20 | 21 | echo URI::segment(10, 'Foo'); 22 | 23 | #### Getting the full request URI, including query string: 24 | 25 | echo URI::full(); 26 | 27 | Sometimes you may need to determine if the current URI is a given string, or begins with a given string. Here's an example of how you can use the is() method to accomplish this: 28 | 29 | #### Determine if the URI is "home": 30 | 31 | if (URI::is('home')) 32 | { 33 | // The current URI is "home"! 34 | } 35 | 36 | #### Determine if the current URI begins with "docs/": 37 | 38 | if URI::is('docs/*')) 39 | { 40 | // The current URI begins with "docs/"! 41 | } 42 | 43 | 44 | ## Other Request Helpers 45 | 46 | #### Getting the current request method: 47 | 48 | echo Request::method(); 49 | 50 | #### Accessing the $_SERVER global array: 51 | 52 | echo Request::server('http_referer'); 53 | 54 | #### Retrieving the requester's IP address: 55 | 56 | echo Request::ip(); 57 | 58 | #### Determining if the current request is using HTTPS: 59 | 60 | if (Request::secure()) 61 | { 62 | // This request is over HTTPS! 63 | } 64 | 65 | #### Determining if the current request is an AJAX request: 66 | 67 | if (Request::ajax()) 68 | { 69 | // This request is using AJAX! 70 | } 71 | 72 | #### Determining if the current requst is via the Artisan CLI: 73 | 74 | if (Request::cli()) 75 | { 76 | // This request came from the CLI! 77 | } -------------------------------------------------------------------------------- /laravel/auth/drivers/fluent.php: -------------------------------------------------------------------------------- 1 | find($id); 22 | } 23 | } 24 | 25 | /** 26 | * Attempt to log a user into the application. 27 | * 28 | * @param array $arguments 29 | * @return void 30 | */ 31 | public function attempt($arguments = array()) 32 | { 33 | $user = $this->get_user($arguments); 34 | 35 | // If the credentials match what is in the database we will just 36 | // log the user into the application and remember them if asked. 37 | $password = $arguments['password']; 38 | 39 | $password_field = Config::get('auth.password', 'password'); 40 | 41 | if ( ! is_null($user) and Hash::check($password, $user->{$password_field})) 42 | { 43 | return $this->login($user->id, array_get($arguments, 'remember')); 44 | } 45 | 46 | return false; 47 | } 48 | 49 | /** 50 | * Get the user from the database table. 51 | * 52 | * @param array $arguments 53 | * @return mixed 54 | */ 55 | protected function get_user($arguments) 56 | { 57 | $table = Config::get('auth.table'); 58 | 59 | return DB::table($table)->where(function($query) use($arguments) 60 | { 61 | $username = Config::get('auth.username'); 62 | 63 | $query->where($username, '=', $arguments['username']); 64 | 65 | foreach(array_except($arguments, array('username', 'password', 'remember')) as $column => $val) 66 | { 67 | $query->where($column, '=', $val); 68 | } 69 | })->first(); 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /laravel/documentation/auth/config.md: -------------------------------------------------------------------------------- 1 | # Auth Configuration 2 | 3 | ## Contents 4 | 5 | - [The Basics](#the-basics) 6 | - [The Authentication Driver](#driver) 7 | - [The Default "Username"](#username) 8 | - [Authentication Model](#model) 9 | - [Authentication Table](#table) 10 | 11 | 12 | ## The Basics 13 | 14 | Most interactive applications have the ability for users to login and logout. Laravel provides a simple class to help you validate user credentials and retrieve information about the current user of your application. 15 | 16 | To get started, let's look over the **application/config/auth.php** file. The authentication configuration contains some basic options to help you get started with authentication. 17 | 18 | 19 | ## The Authentication Driver 20 | 21 | Laravel's authentication is driver based, meaning the responsibility for retrieving users during authentication is delegated to various "drivers". Two are included out of the box: Eloquent and Fluent, but you are free to write your own drivers if needed! 22 | 23 | The **Eloquent** driver uses the Eloquent ORM to load the users of your application, and is the default authentication driver. The **Fluent** driver uses the fluent query builder to load your users. 24 | 25 | 26 | ## The Default "Username" 27 | 28 | The second option in the configuration file determines the default "username" of your users. This will typically correspond to a database column in your "users" table, and will usually be "email" or "username". 29 | 30 | 31 | ## Authentication Model 32 | 33 | When using the **Eloquent** authentication driver, this option determines the Eloquent model that should be used when loading users. 34 | 35 | 36 | ## Authentication Table 37 | 38 | When using the **Fluent** authentication drivers, this option determines the database table containing the users of your application. -------------------------------------------------------------------------------- /laravel/session/drivers/file.php: -------------------------------------------------------------------------------- 1 | path = $path; 21 | } 22 | 23 | /** 24 | * Load a session from storage by a given ID. 25 | * 26 | * If no session is found for the ID, null will be returned. 27 | * 28 | * @param string $id 29 | * @return array 30 | */ 31 | public function load($id) 32 | { 33 | if (file_exists($path = $this->path.$id)) 34 | { 35 | return unserialize(file_get_contents($path)); 36 | } 37 | } 38 | 39 | /** 40 | * Save a given session to storage. 41 | * 42 | * @param array $session 43 | * @param array $config 44 | * @param bool $exists 45 | * @return void 46 | */ 47 | public function save($session, $config, $exists) 48 | { 49 | file_put_contents($this->path.$session['id'], serialize($session), LOCK_EX); 50 | } 51 | 52 | /** 53 | * Delete a session from storage by a given ID. 54 | * 55 | * @param string $id 56 | * @return void 57 | */ 58 | public function delete($id) 59 | { 60 | if (file_exists($this->path.$id)) 61 | { 62 | @unlink($this->path.$id); 63 | } 64 | } 65 | 66 | /** 67 | * Delete all expired sessions from persistent storage. 68 | * 69 | * @param int $expiration 70 | * @return void 71 | */ 72 | public function sweep($expiration) 73 | { 74 | $files = glob($this->path.'*'); 75 | 76 | if ($files === false) return; 77 | 78 | foreach ($files as $file) 79 | { 80 | if (filetype($file) == 'file' and filemtime($file) < $expiration) 81 | { 82 | @unlink($file); 83 | } 84 | } 85 | } 86 | 87 | } -------------------------------------------------------------------------------- /laravel/tests/cases/lang.test.php: -------------------------------------------------------------------------------- 1 | assertEquals($validation['required'], Lang::line('validation.required')->get()); 15 | $this->assertEquals('Taylor', Lang::line('validation.foo')->get(null, 'Taylor')); 16 | } 17 | 18 | /** 19 | * Test the Lang::line method. 20 | * 21 | * @group laravel 22 | */ 23 | public function testGetMethodCanGetLinesForAGivenLanguage() 24 | { 25 | $validation = require path('app').'language/sp/validation.php'; 26 | 27 | $this->assertEquals($validation['required'], Lang::line('validation.required')->get('sp')); 28 | } 29 | 30 | /** 31 | * Test the __toString method. 32 | * 33 | * @group laravel 34 | */ 35 | public function testLineCanBeCastAsString() 36 | { 37 | $validation = require path('app').'language/en/validation.php'; 38 | 39 | $this->assertEquals($validation['required'], (string) Lang::line('validation.required')); 40 | } 41 | 42 | /** 43 | * Test that string replacements are made on lines. 44 | * 45 | * @group laravel 46 | */ 47 | public function testReplacementsAreMadeOnLines() 48 | { 49 | $validation = require path('app').'language/en/validation.php'; 50 | 51 | $line = str_replace(':attribute', 'e-mail', $validation['required']); 52 | 53 | $this->assertEquals($line, Lang::line('validation.required', array('attribute' => 'e-mail'))->get()); 54 | } 55 | 56 | /** 57 | * Test the Lang::has method. 58 | * 59 | * @group laravel 60 | */ 61 | public function testHasMethodIndicatesIfLangaugeLineExists() 62 | { 63 | $this->assertTrue(Lang::has('validation')); 64 | $this->assertTrue(Lang::has('validation.required')); 65 | $this->assertFalse(Lang::has('validation.foo')); 66 | } 67 | 68 | } -------------------------------------------------------------------------------- /laravel/cache/drivers/redis.php: -------------------------------------------------------------------------------- 1 | redis = $redis; 21 | } 22 | 23 | /** 24 | * Determine if an item exists in the cache. 25 | * 26 | * @param string $key 27 | * @return bool 28 | */ 29 | public function has($key) 30 | { 31 | return ( ! is_null($this->redis->get($key))); 32 | } 33 | 34 | /** 35 | * Retrieve an item from the cache driver. 36 | * 37 | * @param string $key 38 | * @return mixed 39 | */ 40 | protected function retrieve($key) 41 | { 42 | if ( ! is_null($cache = $this->redis->get($key))) 43 | { 44 | return unserialize($cache); 45 | } 46 | } 47 | 48 | /** 49 | * Write an item to the cache for a given number of minutes. 50 | * 51 | * 52 | * // Put an item in the cache for 15 minutes 53 | * Cache::put('name', 'Taylor', 15); 54 | * 55 | * 56 | * @param string $key 57 | * @param mixed $value 58 | * @param int $minutes 59 | * @return void 60 | */ 61 | public function put($key, $value, $minutes) 62 | { 63 | $this->forever($key, $value); 64 | 65 | $this->redis->expire($key, $minutes * 60); 66 | } 67 | 68 | /** 69 | * Write an item to the cache that lasts forever. 70 | * 71 | * @param string $key 72 | * @param mixed $value 73 | * @return void 74 | */ 75 | public function forever($key, $value) 76 | { 77 | $this->redis->set($key, serialize($value)); 78 | } 79 | 80 | /** 81 | * Delete an item from the cache. 82 | * 83 | * @param string $key 84 | * @return void 85 | */ 86 | public function forget($key) 87 | { 88 | $this->redis->del($key); 89 | } 90 | 91 | } -------------------------------------------------------------------------------- /application/views/home/index.blade.php: -------------------------------------------------------------------------------- 1 | @layout('templates.template') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |

Sign in

15 | {{ Form::open('home/login', 'POST',array('class'=>'well')); }} 16 | {{ Form::token() }} 17 | @if (Session::has('login_errors')) 18 | {{ Alert::error("Username or password incorrect.") }} 19 | @endif 20 | {{ Form::text('username', Input::old('username'), array('class' => 'span3', 'placeholder' => 'Username'));}} 21 | {{ Form::password('password', array('class' => 'span3', 'placeholder' => 'Password'));}} 22 | {{ Form::labelled_checkbox('remember', 'Remember Me');}} 23 | {{ Form::submit('Login to Critter', array('class'=>'btn-info'));}} 24 | {{ Form::close() }} 25 |
26 |
27 |

New to Critter? Sign up!

28 | {{ Form::open('/', 'POST',array('class'=>'well')); }} 29 | {{ Form::token(); }} 30 | {{ $errors->first('name', Alert::error(":message")) }} 31 | {{ Form::text('name', Input::old('name'), array('class' => 'span3', 'placeholder' => 'Full Name'));}} 32 | {{ $errors->first('username', Alert::error(":message")) }} 33 | {{ Form::text('new_username', Input::old('new_username'), array('class' => 'span3', 'placeholder' => 'Username'));}} 34 | {{ $errors->first('password', Alert::error(":message")) }} 35 | {{ Form::password('new_password', array('class' => 'span3', 'placeholder' => 'New Password'));}} 36 | {{ Form::submit('Sign up for Critter', array('class'=>'btn-warning'));}} 37 | {{ Form::close() }} 38 |
39 |
40 |
41 | @endsection -------------------------------------------------------------------------------- /laravel/documentation/logging.md: -------------------------------------------------------------------------------- 1 | # Errors & Logging 2 | 3 | ## Contents 4 | 5 | - [Basic Configuration](#basic-configuration) 6 | - [Logging](#logging) 7 | - [The Logger Class](#the-logger-class) 8 | 9 | 10 | ## Basic Configuration 11 | 12 | All of the configuration options regarding errors and logging live in the **application/config/errors.php** file. Let's jump right in. 13 | 14 | ### Ignored Errors 15 | 16 | The **ignore** option contains an array of error levels that should be ignored by Laravel. By "ignored", we mean that we won't stop execution of the script on these errors. However, they will be logged when logging is enabled. 17 | 18 | ### Error Detail 19 | 20 | The **detail** option indicates if the framework should display the error message and stack trace when an error occurs. For development, you will want this to be **true**. However, in a production environment, set this to **false**. When disabled, the view located in **application/views/error/500.php** will be displayed, which contains a generic error message. 21 | 22 | 23 | ## Logging 24 | 25 | To enable logging, set the **log** option in the error configuration to "true". When enabled, the Closure defined by the **logger** configuration item will be executed when an error occurs. This gives you total flexibility in how the error should be logged. You can even e-mail the errors to your development team! 26 | 27 | By default, logs are stored in the **storage/logs** directory, and a new log file is created for each day. This keeps your log files from getting crowded with too many messages. 28 | 29 | 30 | ## The Logger Class 31 | 32 | Sometimes you may wish to use Laravel's **Log** class for debugging, or just to log informational messages. Here's how to use it: 33 | 34 | #### Writing a message to the logs: 35 | 36 | Log::write('info', 'This is just an informational message!'); 37 | 38 | #### Using magic methods to specify the log message type: 39 | 40 | Log::info('This is just an informational message!'); -------------------------------------------------------------------------------- /laravel/session/drivers/driver.php: -------------------------------------------------------------------------------- 1 | $this->id(), 'data' => array( 44 | ':new:' => array(), 45 | ':old:' => array(), 46 | )); 47 | } 48 | 49 | /** 50 | * Get a new session ID that isn't assigned to any current session. 51 | * 52 | * @return string 53 | */ 54 | public function id() 55 | { 56 | $session = array(); 57 | 58 | // If the driver is an instance of the Cookie driver, we are able to 59 | // just return any string since the Cookie driver has no real idea 60 | // of a server side persisted session with an ID. 61 | if ($this instanceof Cookie) 62 | { 63 | return Str::random(40); 64 | } 65 | 66 | // We'll continue generating random IDs until we find an ID that is 67 | // not currently assigned to a session. This is almost definitely 68 | // going to happen on the first iteration. 69 | do { 70 | 71 | $session = $this->load($id = Str::random(40)); 72 | 73 | } while ( ! is_null($session)); 74 | 75 | return $id; 76 | } 77 | 78 | } -------------------------------------------------------------------------------- /laravel/documentation/ioc.md: -------------------------------------------------------------------------------- 1 | # IoC Container 2 | 3 | - [Definition](/docs/ioc#definition) 4 | - [Registering Objects](/docs/ioc#register) 5 | - [Resolving Objects](/docs/ioc#resolve) 6 | 7 | 8 | ## Definition 9 | 10 | An IoC container is simply a way of managing the creation of objects. You can use it to define the creation of complex objects, allowing you to resolve them throughout your application using a single line of code. You may also use it to "inject" dependencies into your classes and controllers. 11 | 12 | IoC containers help make your application more flexible and testable. Since you may register alternate implementations of an interface with the container, you may isolate the code you are testing from external dependencies using [stubs and mocks](http://martinfowler.com/articles/mocksArentStubs.html). 13 | 14 | 15 | ## Registering Objects 16 | 17 | #### Registering a resolver in the IoC container: 18 | 19 | IoC::register('mailer', function() 20 | { 21 | $transport = Swift_MailTransport::newInstance(); 22 | 23 | return Swift_Mailer::newInstance($transport); 24 | }); 25 | 26 | 27 | Great! Now we have registered a resolver for SwiftMailer in our container. But, what if we don't want the container to create a new mailer instance every time we need one? Maybe we just want the container to return the same instance after the initial instance is created. Just tell the container the object should be a singleton: 28 | 29 | #### Registering a singleton in the container: 30 | 31 | IoC::singleton('mailer', function() 32 | { 33 | // 34 | }); 35 | 36 | You may also register an existing object instance as a singleton in the container. 37 | 38 | #### Registering an existing instance in the container: 39 | 40 | IoC::instance('mailer', $instance); 41 | 42 | 43 | ## Resolving Objects 44 | 45 | Now that we have SwiftMailer registered in the container, we can resolve it using the **resolve** method on the **IoC** class: 46 | 47 | $mailer = IoC::resolve('mailer'); 48 | 49 | > **Note:** You may also [register controllers in the container](/docs/controllers#dependency-injection). -------------------------------------------------------------------------------- /laravel/vendor/Symfony/Component/HttpFoundation/Session/Flash/FlashBagInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation\Session\Flash; 13 | 14 | use Symfony\Component\HttpFoundation\Session\SessionBagInterface; 15 | 16 | /** 17 | * FlashBagInterface. 18 | * 19 | * @author Drak 20 | */ 21 | interface FlashBagInterface extends SessionBagInterface 22 | { 23 | /** 24 | * Registers a message for a given type. 25 | * 26 | * @param string $type 27 | * @param string $message 28 | */ 29 | function set($type, $message); 30 | 31 | /** 32 | * Gets flash message for a given type. 33 | * 34 | * @param string $type Message category type. 35 | * @param string $default Default value if $type doee not exist. 36 | * 37 | * @return string 38 | */ 39 | function peek($type, $default = null); 40 | 41 | /** 42 | * Gets all flash messages. 43 | * 44 | * @return array 45 | */ 46 | function peekAll(); 47 | 48 | /** 49 | * Gets and clears flash from the stack. 50 | * 51 | * @param string $type 52 | * @param string $default Default value if $type doee not exist. 53 | * 54 | * @return string 55 | */ 56 | function get($type, $default = null); 57 | 58 | /** 59 | * Gets and clears flashes from the stack. 60 | * 61 | * @return array 62 | */ 63 | function all(); 64 | 65 | /** 66 | * Sets all flash messages. 67 | */ 68 | function setAll(array $messages); 69 | 70 | /** 71 | * Has flash messages for a given type? 72 | * 73 | * @param string $type 74 | * 75 | * @return boolean 76 | */ 77 | function has($type); 78 | 79 | /** 80 | * Returns a list of all defined types. 81 | * 82 | * @return array 83 | */ 84 | function keys(); 85 | } 86 | -------------------------------------------------------------------------------- /laravel/vendor/Symfony/Component/Console/Formatter/OutputFormatterInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Console\Formatter; 13 | 14 | /** 15 | * Formatter interface for console output. 16 | * 17 | * @author Konstantin Kudryashov 18 | * 19 | * @api 20 | */ 21 | interface OutputFormatterInterface 22 | { 23 | /** 24 | * Sets the decorated flag. 25 | * 26 | * @param Boolean $decorated Whether to decorate the messages or not 27 | * 28 | * @api 29 | */ 30 | function setDecorated($decorated); 31 | 32 | /** 33 | * Gets the decorated flag. 34 | * 35 | * @return Boolean true if the output will decorate messages, false otherwise 36 | * 37 | * @api 38 | */ 39 | function isDecorated(); 40 | 41 | /** 42 | * Sets a new style. 43 | * 44 | * @param string $name The style name 45 | * @param OutputFormatterStyleInterface $style The style instance 46 | * 47 | * @api 48 | */ 49 | function setStyle($name, OutputFormatterStyleInterface $style); 50 | 51 | /** 52 | * Checks if output formatter has style with specified name. 53 | * 54 | * @param string $name 55 | * 56 | * @return Boolean 57 | * 58 | * @api 59 | */ 60 | function hasStyle($name); 61 | 62 | /** 63 | * Gets style options from style with specified name. 64 | * 65 | * @param string $name 66 | * 67 | * @return OutputFormatterStyleInterface 68 | * 69 | * @api 70 | */ 71 | function getStyle($name); 72 | 73 | /** 74 | * Formats a message according to the given styles. 75 | * 76 | * @param string $message The message to style 77 | * 78 | * @return string The styled message 79 | * 80 | * @api 81 | */ 82 | function format($message); 83 | } 84 | -------------------------------------------------------------------------------- /laravel/tests/cases/blade.test.php: -------------------------------------------------------------------------------- 1 | assertEquals('', Blade::compile_string($blade1)); 18 | $this->assertEquals('', Blade::compile_string($blade2)); 19 | } 20 | 21 | /** 22 | * Test the compilation of control structures. 23 | * 24 | * @group laravel 25 | */ 26 | public function testControlStructuresAreCreatedCorrectly() 27 | { 28 | $blade1 = "@if (true)\nfoo\n@endif"; 29 | $blade2 = "@if (count(".'$something'.") > 0)\nfoo\n@endif"; 30 | $blade3 = "@if (true)\nfoo\n@elseif (false)\nbar\n@endif"; 31 | $blade4 = "@if (true)\nfoo\n@else\nbar\n@endif"; 32 | 33 | $this->assertEquals("\nfoo\n", Blade::compile_string($blade1)); 34 | $this->assertEquals(" 0): ?>\nfoo\n", Blade::compile_string($blade2)); 35 | $this->assertEquals("\nfoo\n\nbar\n", Blade::compile_string($blade3)); 36 | $this->assertEquals("\nfoo\n\nbar\n", Blade::compile_string($blade4)); 37 | } 38 | 39 | /** 40 | * Test the compilation of yield statements. 41 | * 42 | * @group laravel 43 | */ 44 | public function testYieldsAreCompiledCorrectly() 45 | { 46 | $blade = "@yield_content('something')"; 47 | 48 | $this->assertEquals("", Blade::compile_string($blade)); 49 | } 50 | 51 | /** 52 | * Test the compilation of section statements. 53 | * 54 | * @group laravel 55 | */ 56 | public function testSectionsAreCompiledCorrectly() 57 | { 58 | $blade = "@section('something')\nfoo\n@endsection"; 59 | 60 | $this->assertEquals("\nfoo\n", Blade::compile_string($blade)); 61 | } 62 | 63 | } -------------------------------------------------------------------------------- /laravel/tests/cases/config.test.php: -------------------------------------------------------------------------------- 1 | assertEquals('UTF-8', Config::get('application.encoding')); 22 | $this->assertEquals('mysql', Config::get('database.connections.mysql.driver')); 23 | $this->assertEquals('dashboard', Config::get('dashboard::meta.bundle')); 24 | } 25 | 26 | /** 27 | * Test the Config::has method. 28 | * 29 | * @group laravel 30 | */ 31 | public function testHasMethodIndicatesIfConfigItemExists() 32 | { 33 | $this->assertFalse(Config::has('application.foo')); 34 | $this->assertTrue(Config::has('application.encoding')); 35 | } 36 | 37 | /** 38 | * Test the Config::set method. 39 | * 40 | * @group laravel 41 | */ 42 | public function testConfigItemsCanBeSet() 43 | { 44 | Config::set('application.encoding', 'foo'); 45 | Config::set('dashboard::meta.bundle', 'bar'); 46 | 47 | $this->assertEquals('foo', Config::get('application.encoding')); 48 | $this->assertEquals('bar', Config::get('dashboard::meta.bundle')); 49 | } 50 | 51 | /** 52 | * Test that environment configurations are loaded correctly. 53 | * 54 | * @group laravel 55 | */ 56 | public function testEnvironmentConfigsOverrideNormalConfigurations() 57 | { 58 | $_SERVER['LARAVEL_ENV'] = 'local'; 59 | 60 | $this->assertEquals('sqlite', Config::get('database.default')); 61 | 62 | unset($_SERVER['LARAVEL_ENV']); 63 | } 64 | 65 | /** 66 | * Test that items can be set after the entire file has already been loaded. 67 | * 68 | * @group laravel 69 | */ 70 | public function testItemsCanBeSetAfterEntireFileIsLoaded() 71 | { 72 | Config::get('application'); 73 | Config::set('application.key', 'taylor'); 74 | $application = Config::get('application'); 75 | 76 | $this->assertEquals('taylor', $application['key']); 77 | } 78 | 79 | } -------------------------------------------------------------------------------- /laravel/cli/tasks/migrate/database.php: -------------------------------------------------------------------------------- 1 | table()->insert(compact('bundle', 'name', 'batch')); 19 | } 20 | 21 | /** 22 | * Delete a row from the migration table. 23 | * 24 | * @param string $bundle 25 | * @param string $name 26 | * @return void 27 | */ 28 | public function delete($bundle, $name) 29 | { 30 | $this->table()->where_bundle_and_name($bundle, $name)->delete(); 31 | } 32 | 33 | /** 34 | * Return an array of the last batch of migrations. 35 | * 36 | * @return array 37 | */ 38 | public function last() 39 | { 40 | $table = $this->table(); 41 | 42 | // First we need to grab the last batch ID from the migration table, 43 | // as this will allow us to grab the latest batch of migrations 44 | // that need to be run for a rollback command. 45 | $id = $this->batch(); 46 | 47 | // Once we have the batch ID, we will pull all of the rows for that 48 | // batch. Then we can feed the results into the resolve method to 49 | // get the migration instances for the command. 50 | return $table->where_batch($id)->order_by('name', 'desc')->get(); 51 | } 52 | 53 | /** 54 | * Get all of the migrations that have run for a bundle. 55 | * 56 | * @param string $bundle 57 | * @return array 58 | */ 59 | public function ran($bundle) 60 | { 61 | return $this->table()->where_bundle($bundle)->lists('name'); 62 | } 63 | 64 | /** 65 | * Get the maximum batch ID from the migration table. 66 | * 67 | * @return int 68 | */ 69 | public function batch() 70 | { 71 | return $this->table()->max('batch'); 72 | } 73 | 74 | /** 75 | * Get a database query instance for the migration table. 76 | * 77 | * @return Laravel\Database\Query 78 | */ 79 | protected function table() 80 | { 81 | return DB::connection(Request::server('cli.db'))->table('laravel_migrations'); 82 | } 83 | 84 | } -------------------------------------------------------------------------------- /laravel/fluent.php: -------------------------------------------------------------------------------- 1 | 16 | * Create a new fluent container with attributes 17 | * $fluent = new Fluent(array('name' => 'Taylor')); 18 | * 19 | * 20 | * @param array $attributes 21 | * @return void 22 | */ 23 | public function __construct($attributes = array()) 24 | { 25 | foreach ($attributes as $key => $value) 26 | { 27 | $this->$key = $value; 28 | } 29 | } 30 | 31 | /** 32 | * Get an attribute from the fluent container. 33 | * 34 | * @param string $attribute 35 | * @param mixed $default 36 | * @return mixed 37 | */ 38 | public function get($attribute, $default = null) 39 | { 40 | return array_get($this->attributes, $attribute, $default); 41 | } 42 | 43 | /** 44 | * Handle dynamic calls to the container to set attributes. 45 | * 46 | * 47 | * // Fluently set the value of a few attributes 48 | * $fluent->name('Taylor')->age(25); 49 | * 50 | * // Set the value of an attribute to true (boolean) 51 | * $fluent->nullable()->name('Taylor'); 52 | * 53 | */ 54 | public function __call($method, $parameters) 55 | { 56 | $this->$method = (count($parameters) > 0) ? $parameters[0] : true; 57 | 58 | return $this; 59 | } 60 | 61 | /** 62 | * Dynamically retrieve the value of an attribute. 63 | */ 64 | public function __get($key) 65 | { 66 | if (array_key_exists($key, $this->attributes)) 67 | { 68 | return $this->attributes[$key]; 69 | } 70 | } 71 | 72 | /** 73 | * Dynamically set the value of an attribute. 74 | */ 75 | public function __set($key, $value) 76 | { 77 | $this->attributes[$key] = $value; 78 | } 79 | 80 | /** 81 | * Dynamically check if an attribute is set. 82 | */ 83 | public function __isset($key) 84 | { 85 | return isset($this->attributes[$key]); 86 | } 87 | 88 | /** 89 | * Dynamically unset an attribute. 90 | */ 91 | public function __unset($key) 92 | { 93 | unset($this->attributes[$key]); 94 | } 95 | 96 | } -------------------------------------------------------------------------------- /bundles/bootstrapper/navbar.php: -------------------------------------------------------------------------------- 1 | '; 41 | $html .= ''; 74 | return $html; 75 | } 76 | } -------------------------------------------------------------------------------- /laravel/auth.php: -------------------------------------------------------------------------------- 1 | 81 | * // Call the "user" method on the default auth driver 82 | * $user = Auth::user(); 83 | * 84 | * // Call the "check" method on the default auth driver 85 | * Auth::check(); 86 | * 87 | */ 88 | public static function __callStatic($method, $parameters) 89 | { 90 | return call_user_func_array(array(static::driver(), $method), $parameters); 91 | } 92 | 93 | } -------------------------------------------------------------------------------- /laravel/documentation/contrib/github.md: -------------------------------------------------------------------------------- 1 | # Laravel on GitHub 2 | 3 | ## Contents 4 | 5 | - [The Basics](#the-basics) 6 | - [Repositories](#repositoriess) 7 | - [Branches](#branches) 8 | 9 | 10 | ## The Basics 11 | 12 | Because Laravel's development and source control is done through GitHub, anyone is able to make contributions to it. Anyone can fix bugs, add features or improve the documentation. 13 | 14 | After submitting proposed changes to the project, the Laravel team will review the changes and make the decision to commit them to Laravel's core. 15 | 16 | 17 | ## Repositories 18 | 19 | Laravel's home on GitHub is at [github.com/laravel](https://github.com/laravel). Laravel has several repositories. For basic contributions, the only repository you need to pay attention to is the **laravel** repository, located at [github.com/laravel/laravel](https://github.com/laravel/laravel). 20 | 21 | 22 | ## Branches 23 | 24 | The **laravel** repository has multiple branches, each serving a specific purpose: 25 | 26 | - **master** - This is the Laravel release branch. Active development does not happen on this branch. This branch is only for the most recent, stable Laravel core code. When you download Laravel from [laravel.com](http://laravel.com/), you are downloading directly from this master branch. *Do not make pull requests to this branch.* 27 | - **staging** - I'm not sure what this is for... Last minute testing before pushing develop to master? 28 | - **develop** - This is the working development branch. All proposed code changes and contributions by the community are pulled into this branch. *When you make a pull request to the Laravel project, this is the branch you want to pull-request into.* 29 | 30 | Once certain milestones have been reached and/or Taylor Otwell and the Laravel team is happy with the stability and additional features of the current development branch, the changes in the **develop** branch are pulled into the **master** branch, thus creating and releasing the newest stable version of Laravel for the world to use. 31 | 32 | *Further Reading* 33 | 34 | - [Contributing to Laravel via Command-Line](docs/contrib/command-line) 35 | - [Contributing to Laravel using TortoiseGit](docs/contrib/tortoisegit) 36 | -------------------------------------------------------------------------------- /laravel/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeMemcacheSessionHandler.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; 13 | 14 | /** 15 | * NativeMemcacheSessionHandler. 16 | * 17 | * Driver for the memcache session save hadlers provided by the memcache PHP extension. 18 | * 19 | * @see http://php.net/memcache 20 | * 21 | * @author Drak 22 | */ 23 | class NativeMemcacheSessionHandler extends NativeSessionHandler 24 | { 25 | /** 26 | * Constructor. 27 | * 28 | * @param string $savePath Path of memcache server. 29 | * @param array $options Session configuration options. 30 | */ 31 | public function __construct($savePath = 'tcp://127.0.0.1:11211?persistent=0', array $options = array()) 32 | { 33 | if (!extension_loaded('memcache')) { 34 | throw new \RuntimeException('PHP does not have "memcache" session module registered'); 35 | } 36 | 37 | if (null === $savePath) { 38 | $savePath = ini_get('session.save_path'); 39 | } 40 | 41 | ini_set('session.save_handler', 'memcache'); 42 | ini_set('session.save_path', $savePath); 43 | 44 | $this->setOptions($options); 45 | } 46 | 47 | /** 48 | * Set any memcached ini values. 49 | * 50 | * @see http://php.net/memcache.ini 51 | */ 52 | protected function setOptions(array $options) 53 | { 54 | foreach ($options as $key => $value) { 55 | if (in_array($key, array( 56 | 'memcache.allow_failover', 'memcache.max_failover_attempts', 57 | 'memcache.chunk_size', 'memcache.default_port', 'memcache.hash_strategy', 58 | 'memcache.hash_function', 'memcache.protocol', 'memcache.redundancy', 59 | 'memcache.session_redundancy', 'memcache.compress_threshold', 60 | 'memcache.lock_timeout'))) { 61 | ini_set($key, $value); 62 | } 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /bundles/bootstrapper/helpers.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; 13 | 14 | /** 15 | * NativeMemcachedSessionHandler. 16 | * 17 | * Driver for the memcached session save hadlers provided by the memcached PHP extension. 18 | * 19 | * @see http://php.net/memcached.sessions 20 | * 21 | * @author Drak 22 | */ 23 | class NativeMemcachedSessionHandler extends NativeSessionHandler 24 | { 25 | /** 26 | * Constructor. 27 | * 28 | * @param string $savePath Comma separated list of servers: e.g. memcache1.example.com:11211,memcache2.example.com:11211 29 | * @param array $options Session configuration options. 30 | */ 31 | public function __construct($savePath = '127.0.0.1:11211', array $options = array()) 32 | { 33 | if (!extension_loaded('memcached')) { 34 | throw new \RuntimeException('PHP does not have "memcached" session module registered'); 35 | } 36 | 37 | if (null === $savePath) { 38 | $savePath = ini_get('session.save_path'); 39 | } 40 | 41 | ini_set('session.save_handler', 'memcached'); 42 | ini_set('session.save_path', $savePath); 43 | 44 | $this->setOptions($options); 45 | } 46 | 47 | /** 48 | * Set any memcached ini values. 49 | * 50 | * @see https://github.com/php-memcached-dev/php-memcached/blob/master/memcached.ini 51 | */ 52 | protected function setOptions(array $options) 53 | { 54 | foreach ($options as $key => $value) { 55 | if (in_array($key, array( 56 | 'memcached.sess_locking', 'memcached.sess_lock_wait', 57 | 'memcached.sess_prefix', 'memcached.compression_type', 58 | 'memcached.compression_factor', 'memcached.compression_threshold', 59 | 'memcached.serializer'))) { 60 | ini_set($key, $value); 61 | } 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /laravel/cli/tasks/bundle/providers/provider.php: -------------------------------------------------------------------------------- 1 | download($url)); 34 | 35 | $zip = new \ZipArchive; 36 | 37 | $zip->open($target); 38 | 39 | // Once we have the Zip archive, we can open it and extract it 40 | // into the working directory. By convention, we expect the 41 | // archive to contain one root directory with the bundle. 42 | mkdir($work.'zip'); 43 | 44 | $zip->extractTo($work.'zip'); 45 | 46 | $latest = File::latest($work.'zip')->getRealPath(); 47 | 48 | @chmod($latest, 0777); 49 | 50 | // Once we have the latest modified directory, we should be 51 | // able to move its contents over into the bundles folder 52 | // so the bundle will be usable by the developer. 53 | File::mvdir($latest, $path); 54 | 55 | File::rmdir($work.'zip'); 56 | 57 | $zip->close(); 58 | @unlink($target); 59 | } 60 | 61 | /** 62 | * Download a remote zip archive from a URL. 63 | * 64 | * @param string $url 65 | * @return string 66 | */ 67 | protected function download($url) 68 | { 69 | $remote = file_get_contents($url); 70 | 71 | // If we were unable to download the zip archive correctly 72 | // we'll bomb out since we don't want to extract the last 73 | // zip that was put in the storage directory. 74 | if ($remote === false) 75 | { 76 | throw new \Exception("Error downloading bundle [{$bundle}]."); 77 | } 78 | 79 | return $remote; 80 | } 81 | 82 | } -------------------------------------------------------------------------------- /application/controllers/others.php: -------------------------------------------------------------------------------- 1 | only('id'); 23 | 24 | // declare some default values for variables 25 | $following = null; 26 | $followers = 0; 27 | 28 | // if the username is not found, display an error 29 | if ($user_id == null) { 30 | echo "This username does not exist."; 31 | } else { 32 | if (Auth::user()){ 33 | // if the user tries to go to his/her own profile, redirect to user's profile action. 34 | if ($user_id == Auth::user()->id){ 35 | return Redirect::to_action('user@index'); 36 | } 37 | // check if the current user is already following $username 38 | $following = (Follower::where('user_id', '=', Auth::user()->id)->where('following_id','=',$user_id)->get()) ? true : false ; 39 | } 40 | 41 | // eager load the critts with user data 42 | $allcritts = Critt::with('user') -> where('user_id', '=', $user_id); 43 | // order the critts and split them in chunks of 10 per page 44 | $critts = $allcritts -> order_by('created_at','desc') -> paginate(10); 45 | // count the critts 46 | $critts_count = $allcritts -> count(); 47 | // count the followers 48 | $followers = Follower::where('following_id','=',$user_id)->count(); 49 | 50 | // bind data to the view 51 | return View::make('others.profile') 52 | -> with('username', $username) 53 | -> with('user_id', $user_id) 54 | -> with('following', $following) 55 | -> with('followers', $followers) 56 | -> with('count', $critts_count) 57 | -> with('critts', $critts); 58 | } 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /laravel/tests/application/controllers/filter.php: -------------------------------------------------------------------------------- 1 | filter('before', 'test-all-before'); 19 | $this->filter('after', 'test-all-after'); 20 | $this->filter('before', 'test-profile-before')->only(array('profile')); 21 | $this->filter('before', 'test-except')->except(array('index', 'profile')); 22 | $this->filter('before', 'test-on-post')->on(array('post')); 23 | $this->filter('before', 'test-on-get-put')->on(array('get', 'put')); 24 | $this->filter('before', 'test-before-filter')->only('login'); 25 | $this->filter('after', 'test-before-filter')->only('logout'); 26 | $this->filter('before', 'test-param:1,2')->only('edit'); 27 | $this->filter('before', 'test-multi-1|test-multi-2')->only('save'); 28 | } 29 | 30 | public function action_index() 31 | { 32 | return __FUNCTION__; 33 | } 34 | 35 | public function action_profile() 36 | { 37 | return __FUNCTION__; 38 | } 39 | 40 | public function action_show() 41 | { 42 | return __FUNCTION__; 43 | } 44 | 45 | public function action_edit() 46 | { 47 | return __FUNCTION__; 48 | } 49 | 50 | public function action_save() 51 | { 52 | return __FUNCTION__; 53 | } 54 | 55 | public function action_login() 56 | { 57 | return __FUNCTION__; 58 | } 59 | 60 | public function action_logout() 61 | { 62 | return __FUNCTION__; 63 | } 64 | 65 | } -------------------------------------------------------------------------------- /laravel/cli/tasks/help.json: -------------------------------------------------------------------------------- 1 | { 2 | "Application Configuration": { 3 | "key:generate": { 4 | "description": "Generate a secure application key.", 5 | "command": "php artisan key:generate" 6 | } 7 | }, 8 | "Database Tables": { 9 | "session:table": { 10 | "description": "Generate a migration for the sessions database table.", 11 | "command": "php artisan session:table" 12 | } 13 | }, 14 | "Migrations": { 15 | "migrate:install": { 16 | "description": "Create the Laravel migration table.", 17 | "command": "php artisan migrate:install" 18 | }, 19 | "migrate:make": { 20 | "description": "Create a migration.", 21 | "command": "php artisan migrate:make create_users_table" 22 | }, 23 | "migrate": { 24 | "description": "Run outstanding migrations.", 25 | "command": "php artisan migrate" 26 | }, 27 | "migrate:rollback": { 28 | "description": "Roll back the most recent migration.", 29 | "command": "php artisan migrate:rollback" 30 | }, 31 | "migrate:reset": { 32 | "description": "Roll back all migrations.", 33 | "command": "php artisan migrate:reset" 34 | } 35 | }, 36 | "Bundles": { 37 | "bundle:install": { 38 | "description": "Install a bundle.", 39 | "command": "php artisan bundle:install swiftmailer" 40 | }, 41 | "bundle:upgrade": { 42 | "description": "Upgrade a bundle.", 43 | "command": "php artisan bundle:upgrade swiftmailer" 44 | }, 45 | "bundle:publish": { 46 | "description": "Publish all bundles' assets.", 47 | "command": "php artisan bundle:publish" 48 | } 49 | }, 50 | "Unit Testing": { 51 | "test": { 52 | "description": "Run the application's tests.", 53 | "command": "php artisan test" 54 | } 55 | }, 56 | "Routing": { 57 | "route:call": { 58 | "description": "Call a route.", 59 | "command": "php artisan route:call get api/user/1" 60 | } 61 | }, 62 | "Application Keys": { 63 | "key:generate": { 64 | "description": "Generate an application key.", 65 | "command": "php artisan key:generade" 66 | } 67 | }, 68 | "CLI Options": { 69 | "--env=": { 70 | "description": "Set the Laravel environment.", 71 | "command": "php artisan task --env=local" 72 | }, 73 | "--database=": { 74 | "description": "Set the default database connection.", 75 | "command": "php artisan task --database=mysql" 76 | } 77 | } 78 | } -------------------------------------------------------------------------------- /laravel/documentation/strings.md: -------------------------------------------------------------------------------- 1 | # Working With Strings 2 | 3 | ## Contents 4 | 5 | - [Capitalization, Etc.](#capitalization) 6 | - [Word & Character Limiting](#limits) 7 | - [Generating Random Strings](#random) 8 | - [Singular & Plural](#singular-and-plural) 9 | - [Slugs](#slugs) 10 | 11 | 12 | ## Capitalization, Etc. 13 | 14 | The **Str** class also provides three convenient methods for manipulating string capitalization: **upper**, **lower**, and **title**. These are more intelligent versions of the PHP [strtoupper](http://php.net/manual/en/function.strtoupper.php), [strtolower](http://php.net/manual/en/function.strtolower.php), and [ucwords](http://php.net/manual/en/function.ucwords.php) methods. More intelligent because they can handle UTF-8 input if the [multi-byte string](http://php.net/manual/en/book.mbstring.php) PHP extension is installed on your web server. To use them, just pass a string to the method: 15 | 16 | echo Str::lower('I am a string.'); 17 | 18 | echo Str::upper('I am a string.'); 19 | 20 | echo Str::title('I am a string.'); 21 | 22 | 23 | ## Word & Character Limiting 24 | 25 | #### Limiting the number of characters in a string: 26 | 27 | echo Str::limit($string, 10); 28 | 29 | #### Limiting the number of words in a string: 30 | 31 | echo Str::words($string, 10); 32 | 33 | 34 | ## Generating Random Strings 35 | 36 | #### Generating a random string of alpha-numeric characters: 37 | 38 | echo Str::random(32); 39 | 40 | #### Generating a random string of alphabetic characters: 41 | 42 | echo Str::random(32, 'alpha'); 43 | 44 | 45 | ## Singular & Plural 46 | 47 | The String class is capable of transforming your strings from singular to plural, and vice versa. 48 | 49 | #### Getting the plural form of a word: 50 | 51 | echo Str::plural('user'); 52 | 53 | #### Getting the singular form of a word: 54 | 55 | echo Str::singular('users'); 56 | 57 | #### Getting the plural form if given value is greater than one: 58 | 59 | echo Str::plural('comment', count($comments)); 60 | 61 | 62 | ## Slugs 63 | 64 | #### Generating a URL friendly slug: 65 | 66 | return Str::slug('My First Blog Post!'); 67 | 68 | #### Generating a URL friendly slug using a given separator: 69 | 70 | return Str::slug('My First Blog Post!', '_'); 71 | 72 | -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) <2012> 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | Developer’s Certificate of Origin 1.1 23 | 24 | By making a contribution to this project, I certify that: 25 | 26 | (a) The contribution was created in whole or in part by me and I 27 | have the right to submit it under the open source license 28 | indicated in the file; or 29 | 30 | (b) The contribution is based upon previous work that, to the best 31 | of my knowledge, is covered under an appropriate open source 32 | license and I have the right under that license to submit that 33 | work with modifications, whether created in whole or in part 34 | by me, under the same open source license (unless I am 35 | permitted to submit under a different license), as indicated 36 | in the file; or 37 | 38 | (c) The contribution was provided directly to me by some other 39 | person who certified (a), (b) or (c) and I have not modified 40 | it. 41 | 42 | (d) I understand and agree that this project and the contribution 43 | are public and that a record of the contribution (including all 44 | personal information I submit with it, including my sign-off) is 45 | maintained indefinitely and may be redistributed consistent with 46 | this project or the open source license(s) involved. -------------------------------------------------------------------------------- /laravel/vendor/Symfony/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxy.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\HttpFoundation\Session\Storage\Proxy; 13 | 14 | /** 15 | * SessionHandler proxy. 16 | * 17 | * @author Drak 18 | */ 19 | class SessionHandlerProxy extends AbstractProxy implements \SessionHandlerInterface 20 | { 21 | /** 22 | * @var \SessionHandlerInterface 23 | */ 24 | protected $handler; 25 | 26 | /** 27 | * Constructor. 28 | * 29 | * @param \SessionHandlerInterface $handler 30 | */ 31 | public function __construct(\SessionHandlerInterface $handler) 32 | { 33 | $this->handler = $handler; 34 | $this->wrapper = ($handler instanceof \SessionHandler); 35 | $this->saveHandlerName = $this->wrapper ? ini_get('session.save_handler') : 'user'; 36 | } 37 | 38 | // \SessionHandlerInterface 39 | 40 | /** 41 | * {@inheritdoc} 42 | */ 43 | public function open($savePath, $sessionName) 44 | { 45 | $return = (bool)$this->handler->open($savePath, $sessionName); 46 | 47 | if (true === $return) { 48 | $this->active = true; 49 | } 50 | 51 | return $return; 52 | } 53 | 54 | /** 55 | * {@inheritdoc} 56 | */ 57 | public function close() 58 | { 59 | $this->active = false; 60 | 61 | return (bool) $this->handler->close(); 62 | } 63 | 64 | /** 65 | * {@inheritdoc} 66 | */ 67 | public function read($id) 68 | { 69 | return (string) $this->handler->read($id); 70 | } 71 | 72 | /** 73 | * {@inheritdoc} 74 | */ 75 | public function write($id, $data) 76 | { 77 | return (bool) $this->handler->write($id, $data); 78 | } 79 | 80 | /** 81 | * {@inheritdoc} 82 | */ 83 | public function destroy($id) 84 | { 85 | return (bool) $this->handler->destroy($id); 86 | } 87 | 88 | /** 89 | * {@inheritdoc} 90 | */ 91 | public function gc($maxlifetime) 92 | { 93 | return (bool) $this->handler->gc($maxlifetime); 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /bundles/bootstrapper/readme.md: -------------------------------------------------------------------------------- 1 | ## Bootstrapper Bundle, by Patrick Talmadge 2 | 3 | Bootstrapper is a set of classes that allow you to quickly create Twitter Bootstrap style markup. 4 | 5 | ##View bundle site for full install instructions. 6 | http://laravelbootstrapper.phpfogapp.com 7 | 8 | 9 | Install using Artisan CLI: 10 | 11 | php artisan bundle:install bootstrapper 12 | 13 | Add the following line to application/bundles.php 14 | 15 | return array( 16 | 'bootstrapper' => array('auto' => true), 17 | ); 18 | 19 | Change Form and Paginator in the application.php config file to: 20 | 21 | 'Form' => 'Bootstrapper\\Form', 22 | 'Paginator' => 'Bootstrapper\\Paginator', 23 | 24 | Add the following to the application.php config file: 25 | 26 | 'Alert' => 'Bootstrapper\\Alert', 27 | 'Badges' => 'Bootstrapper\\Badges', 28 | 'Breadcrumbs' => 'Bootstrapper\\Breadcrumbs', 29 | 'Buttons' => 'Bootstrapper\\Buttons', 30 | 'ButtonGroup' => 'Bootstrapper\\ButtonGroup', 31 | 'ButtonToolbar' => 'Bootstrapper\\ButtonToolbar', 32 | 'Carousel' => 'Bootstrapper\\Carousel', 33 | 'DropdownButton' => 'Bootstrapper\\DropdownButton', 34 | 'Helpers' => 'Bootstrapper\\Helpers', 35 | 'Icons' => 'Bootstrapper\\Icons', 36 | 'Labels' => 'Bootstrapper\\Labels', 37 | 'Navbar' => 'Bootstrapper\\Navbar', 38 | 'Navigation' => 'Bootstrapper\\Navigation', 39 | 'Progress' => 'Bootstrapper\\Progress', 40 | 'SplitDropdownButton' => 'Bootstrapper\\SplitDropdownButton', 41 | 'Tabbable' => 'Bootstrapper\\Tabbable', 42 | 'Typeahead' => 'Bootstrapper\\Typeahead', 43 | 44 | 45 | Update laravel\database\query.php to use the Bootstrapper Paginator and not the core class by changing the use statement. 46 | 47 | //Change 48 | use Laravel\Paginator; 49 | 50 | //To 51 | use Paginator; 52 | 53 | 54 | Publish the bundle assets to your public folder. 55 | 56 | php artisan bundle:publish 57 | 58 | 59 | Add the following to your template view file to include the Twitter Bootstrap CSS and Javascript. 60 | 61 | Asset::container('bootstrapper')->styles(); 62 | Asset::container('bootstrapper')->scripts(); 63 | 64 | 65 | 66 | ##Current Twitter Bootstrap version is 2.0.4. 67 | 68 | - Homepage: http://twitter.github.com/bootstrap/ 69 | - GitHub: https://github.com/twitter/bootstrap/ -------------------------------------------------------------------------------- /application/config/error.php: -------------------------------------------------------------------------------- 1 | array(), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Error Detail 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Detailed error messages contain information about the file in which an 24 | | error occurs, as well as a PHP stack trace containing the call stack. 25 | | You'll want them when you're trying to debug your application. 26 | | 27 | | If your application is in production, you'll want to turn off the error 28 | | details for enhanced security and user experience since the exception 29 | | stack trace could contain sensitive information. 30 | | 31 | */ 32 | 33 | 'detail' => true, 34 | 35 | /* 36 | |-------------------------------------------------------------------------- 37 | | Error Logging 38 | |-------------------------------------------------------------------------- 39 | | 40 | | When error logging is enabled, the "logger" Closure defined below will 41 | | be called for every error in your application. You are free to log the 42 | | errors however you want. Enjoy the flexibility. 43 | | 44 | */ 45 | 46 | 'log' => false, 47 | 48 | /* 49 | |-------------------------------------------------------------------------- 50 | | Error Logger 51 | |-------------------------------------------------------------------------- 52 | | 53 | | Because of the various ways of managing error logging, you get complete 54 | | flexibility to manage error logging as you see fit. This function will 55 | | be called anytime an error occurs within your application and error 56 | | logging is enabled. 57 | | 58 | | You may log the error message however you like; however, a simple log 59 | | solution has been setup for you which will log all error messages to 60 | | text files within the application storage directory. 61 | | 62 | */ 63 | 64 | 'logger' => function($exception) 65 | { 66 | Log::exception($exception); 67 | }, 68 | 69 | ); -------------------------------------------------------------------------------- /laravel/tests/application/views/error/500.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Error 500 - Internal Server Error 7 | 8 | 81 | 82 | 83 |
84 | 85 | 86 |

87 | 88 |

Server Error: 500 (Internal Server Error)

89 | 90 |

What does this mean?

91 | 92 |

93 | Something went wrong on our servers while we were processing your request. 94 | We're really sorry about this, and will work hard to get this resolved as 95 | soon as possible. 96 |

97 | 98 |

99 | Perhaps you would like to go to our ? 100 |

101 |
102 | 103 | -------------------------------------------------------------------------------- /laravel/cache/drivers/file.php: -------------------------------------------------------------------------------- 1 | path = $path; 21 | } 22 | 23 | /** 24 | * Determine if an item exists in the cache. 25 | * 26 | * @param string $key 27 | * @return bool 28 | */ 29 | public function has($key) 30 | { 31 | return ( ! is_null($this->get($key))); 32 | } 33 | 34 | /** 35 | * Retrieve an item from the cache driver. 36 | * 37 | * @param string $key 38 | * @return mixed 39 | */ 40 | protected function retrieve($key) 41 | { 42 | if ( ! file_exists($this->path.$key)) return null; 43 | 44 | // File based caches store have the expiration timestamp stored in 45 | // UNIX format prepended to their contents. We'll compare the 46 | // timestamp to the current time when we read the file. 47 | if (time() >= substr($cache = file_get_contents($this->path.$key), 0, 10)) 48 | { 49 | return $this->forget($key); 50 | } 51 | 52 | return unserialize(substr($cache, 10)); 53 | } 54 | 55 | /** 56 | * Write an item to the cache for a given number of minutes. 57 | * 58 | * 59 | * // Put an item in the cache for 15 minutes 60 | * Cache::put('name', 'Taylor', 15); 61 | * 62 | * 63 | * @param string $key 64 | * @param mixed $value 65 | * @param int $minutes 66 | * @return void 67 | */ 68 | public function put($key, $value, $minutes) 69 | { 70 | if ($minutes <= 0) return; 71 | 72 | $value = $this->expiration($minutes).serialize($value); 73 | 74 | file_put_contents($this->path.$key, $value, LOCK_EX); 75 | } 76 | 77 | /** 78 | * Write an item to the cache for five years. 79 | * 80 | * @param string $key 81 | * @param mixed $value 82 | * @return void 83 | */ 84 | public function forever($key, $value) 85 | { 86 | return $this->put($key, $value, 2628000); 87 | } 88 | 89 | /** 90 | * Delete an item from the cache. 91 | * 92 | * @param string $key 93 | * @return void 94 | */ 95 | public function forget($key) 96 | { 97 | if (file_exists($this->path.$key)) @unlink($this->path.$key); 98 | } 99 | 100 | } -------------------------------------------------------------------------------- /laravel/tests/application/views/error/404.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Error 404 - Not Found 7 | 8 | 81 | 82 | 83 |
84 | 85 | 86 |

87 | 88 |

Server Error: 404 (Not Found)

89 | 90 |

What does this mean?

91 | 92 |

93 | We couldn't find the page you requested on our servers. We're really sorry 94 | about that. It's our fault, not yours. We'll work hard to get this page 95 | back online as soon as possible. 96 |

97 | 98 |

99 | Perhaps you would like to go to our ? 100 |

101 |
102 | 103 | -------------------------------------------------------------------------------- /laravel/tests/application/config/error.php: -------------------------------------------------------------------------------- 1 | array(E_NOTICE, E_USER_NOTICE, E_DEPRECATED, E_USER_DEPRECATED), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Error Detail 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Detailed error messages contain information about the file in which an 24 | | error occurs, as well as a PHP stack trace containing the call stack. 25 | | You'll want them when you're trying to debug your application. 26 | | 27 | | If your application is in production, you'll want to turn off the error 28 | | details for enhanced security and user experience since the exception 29 | | stack trace could contain sensitive information. 30 | | 31 | */ 32 | 33 | 'detail' => true, 34 | 35 | /* 36 | |-------------------------------------------------------------------------- 37 | | Error Logging 38 | |-------------------------------------------------------------------------- 39 | | 40 | | When error logging is enabled, the "logger" Closure defined below will 41 | | be called for every error in your application. You are free to log the 42 | | errors however you want. Enjoy the flexibility. 43 | | 44 | */ 45 | 46 | 'log' => false, 47 | 48 | /* 49 | |-------------------------------------------------------------------------- 50 | | Error Logger 51 | |-------------------------------------------------------------------------- 52 | | 53 | | Because of the various ways of managing error logging, you get complete 54 | | flexibility to manage error logging as you see fit. This function will 55 | | be called anytime an error occurs within your application and error 56 | | logging is enabled. 57 | | 58 | | You may log the error message however you like; however, a simple log 59 | | solution has been setup for you which will log all error messages to 60 | | text files within the application storage directory. 61 | | 62 | */ 63 | 64 | 'logger' => function($exception) 65 | { 66 | Log::exception($exception); 67 | }, 68 | 69 | ); --------------------------------------------------------------------------------