├── .gitattributes
├── .gitignore
├── .travis.yml
├── Boxfile
├── CONTRIBUTING.md
├── application
├── bundles.php
├── config
│ ├── .gitignore
│ ├── application.php
│ ├── auth.php
│ ├── cache.php
│ ├── database.php
│ ├── error.php
│ ├── mimes.php
│ ├── session.php
│ └── strings.php
├── controllers
│ ├── base.php
│ └── home.php
├── language
│ ├── ar
│ │ ├── pagination.php
│ │ └── validation.php
│ ├── bg
│ │ ├── pagination.php
│ │ └── validation.php
│ ├── da
│ │ ├── pagination.php
│ │ └── validation.php
│ ├── de
│ │ ├── pagination.php
│ │ └── validation.php
│ ├── el
│ │ ├── pagination.php
│ │ └── validation.php
│ ├── en
│ │ ├── pagination.php
│ │ └── validation.php
│ ├── fr
│ │ ├── pagination.php
│ │ └── validation.php
│ ├── gr
│ │ ├── pagination.php
│ │ └── validation.php
│ ├── he
│ │ ├── pagination.php
│ │ └── validation.php
│ ├── hu
│ │ ├── pagination.php
│ │ └── validation.php
│ ├── id
│ │ ├── pagination.php
│ │ └── validation.php
│ ├── ja
│ │ ├── pagination.php
│ │ └── validation.php
│ ├── nl
│ │ ├── pagination.php
│ │ └── validation.php
│ ├── pl
│ │ ├── pagination.php
│ │ └── validation.php
│ ├── pt
│ │ ├── pagination.php
│ │ └── validation.php
│ ├── ru
│ │ ├── pagination.php
│ │ └── validation.php
│ └── tr
│ │ ├── pagination.php
│ │ └── validation.php
├── libraries
│ └── .gitignore
├── migrations
│ └── .gitignore
├── models
│ └── .gitignore
├── routes.php
├── start.php
├── tasks
│ └── .gitignore
├── tests
│ └── example.test.php
└── views
│ ├── error
│ ├── 404.php
│ └── 500.php
│ └── home
│ └── index.blade.php
├── artisan
├── bundles
├── .gitignore
├── bootstrapper
│ ├── .gitignore
│ ├── alert.php
│ ├── badges.php
│ ├── breadcrumbs.php
│ ├── buttongroup.php
│ ├── buttons.php
│ ├── buttontoolbar.php
│ ├── carousel.php
│ ├── dropdownbutton.php
│ ├── form.php
│ ├── helpers.php
│ ├── icons.php
│ ├── labels.php
│ ├── navbar.php
│ ├── navigation.php
│ ├── paginator.php
│ ├── progress.php
│ ├── public
│ │ ├── css
│ │ │ ├── bootstrap-responsive.css
│ │ │ ├── bootstrap-responsive.min.css
│ │ │ ├── bootstrap.css
│ │ │ ├── bootstrap.min.css
│ │ │ └── nav-fix.css
│ │ ├── img
│ │ │ ├── glyphicons-halflings-white.png
│ │ │ └── glyphicons-halflings.png
│ │ └── js
│ │ │ ├── bootstrap.js
│ │ │ ├── bootstrap.min.js
│ │ │ ├── jquery-1.8.1.js
│ │ │ └── jquery-1.8.1.min.js
│ ├── readme.md
│ ├── splitdropdownbutton.php
│ ├── start.php
│ ├── tabbable.php
│ ├── tables.php
│ └── typeahead.php
└── docs
│ ├── libraries
│ └── markdown.php
│ ├── routes.php
│ └── views
│ ├── page.blade.php
│ └── template.blade.php
├── laravel
├── asset.php
├── auth.php
├── auth
│ └── drivers
│ │ ├── driver.php
│ │ ├── eloquent.php
│ │ └── fluent.php
├── autoloader.php
├── blade.php
├── bundle.php
├── cache.php
├── cache
│ └── drivers
│ │ ├── apc.php
│ │ ├── database.php
│ │ ├── driver.php
│ │ ├── file.php
│ │ ├── memcached.php
│ │ ├── memory.php
│ │ ├── redis.php
│ │ └── sectionable.php
├── cli
│ ├── artisan.php
│ ├── command.php
│ ├── dependencies.php
│ └── tasks
│ │ ├── bundle
│ │ ├── bundler.php
│ │ ├── providers
│ │ │ ├── github.php
│ │ │ └── provider.php
│ │ ├── publisher.php
│ │ └── repository.php
│ │ ├── help.json
│ │ ├── help.php
│ │ ├── key.php
│ │ ├── migrate
│ │ ├── database.php
│ │ ├── migrator.php
│ │ ├── resolver.php
│ │ └── stub.php
│ │ ├── route.php
│ │ ├── session
│ │ ├── manager.php
│ │ └── migration.php
│ │ ├── task.php
│ │ └── test
│ │ ├── phpunit.php
│ │ ├── runner.php
│ │ └── stub.xml
├── config.php
├── cookie.php
├── core.php
├── crypter.php
├── database.php
├── database
│ ├── connection.php
│ ├── connectors
│ │ ├── connector.php
│ │ ├── mysql.php
│ │ ├── postgres.php
│ │ ├── sqlite.php
│ │ └── sqlserver.php
│ ├── eloquent
│ │ ├── model.php
│ │ ├── pivot.php
│ │ ├── query.php
│ │ └── relationships
│ │ │ ├── belongs_to.php
│ │ │ ├── has_many.php
│ │ │ ├── has_many_and_belongs_to.php
│ │ │ ├── has_one.php
│ │ │ ├── has_one_or_many.php
│ │ │ └── relationship.php
│ ├── exception.php
│ ├── expression.php
│ ├── grammar.php
│ ├── query.php
│ ├── query
│ │ ├── grammars
│ │ │ ├── grammar.php
│ │ │ ├── mysql.php
│ │ │ ├── postgres.php
│ │ │ ├── sqlite.php
│ │ │ └── sqlserver.php
│ │ └── join.php
│ ├── schema.php
│ └── schema
│ │ ├── grammars
│ │ ├── grammar.php
│ │ ├── mysql.php
│ │ ├── postgres.php
│ │ ├── sqlite.php
│ │ └── sqlserver.php
│ │ └── table.php
├── documentation
│ ├── artisan
│ │ ├── commands.md
│ │ └── tasks.md
│ ├── auth
│ │ ├── config.md
│ │ └── usage.md
│ ├── bundles.md
│ ├── cache
│ │ ├── config.md
│ │ └── usage.md
│ ├── changes.md
│ ├── config.md
│ ├── contents.md
│ ├── contrib
│ │ ├── command-line.md
│ │ ├── github.md
│ │ └── tortoisegit.md
│ ├── controllers.md
│ ├── database
│ │ ├── config.md
│ │ ├── eloquent.md
│ │ ├── fluent.md
│ │ ├── migrations.md
│ │ ├── raw.md
│ │ ├── redis.md
│ │ └── schema.md
│ ├── encryption.md
│ ├── events.md
│ ├── files.md
│ ├── home.md
│ ├── input.md
│ ├── install.md
│ ├── ioc.md
│ ├── loading.md
│ ├── localization.md
│ ├── logging.md
│ ├── models.md
│ ├── requests.md
│ ├── routing.md
│ ├── session
│ │ ├── config.md
│ │ └── usage.md
│ ├── strings.md
│ ├── testing.md
│ ├── urls.md
│ ├── validation.md
│ └── views
│ │ ├── assets.md
│ │ ├── forms.md
│ │ ├── home.md
│ │ ├── html.md
│ │ ├── pagination.md
│ │ └── templating.md
├── error.php
├── event.php
├── file.php
├── fluent.php
├── form.php
├── hash.php
├── helpers.php
├── html.php
├── input.php
├── ioc.php
├── lang.php
├── laravel.php
├── log.php
├── memcached.php
├── messages.php
├── paginator.php
├── pluralizer.php
├── profiling
│ ├── profiler.css
│ ├── profiler.js
│ ├── profiler.php
│ └── template.blade.php
├── redirect.php
├── redis.php
├── request.php
├── response.php
├── routing
│ ├── controller.php
│ ├── filter.php
│ ├── route.php
│ └── router.php
├── section.php
├── session.php
├── session
│ ├── drivers
│ │ ├── apc.php
│ │ ├── cookie.php
│ │ ├── database.php
│ │ ├── driver.php
│ │ ├── file.php
│ │ ├── memcached.php
│ │ ├── memory.php
│ │ ├── redis.php
│ │ └── sweeper.php
│ └── payload.php
├── str.php
├── tests
│ ├── application
│ │ ├── bundles.php
│ │ ├── config
│ │ │ ├── application.php
│ │ │ ├── auth.php
│ │ │ ├── cache.php
│ │ │ ├── database.php
│ │ │ ├── error.php
│ │ │ ├── local
│ │ │ │ └── database.php
│ │ │ ├── mimes.php
│ │ │ ├── session.php
│ │ │ └── strings.php
│ │ ├── controllers
│ │ │ ├── admin
│ │ │ │ └── panel.php
│ │ │ ├── auth.php
│ │ │ ├── filter.php
│ │ │ ├── home.php
│ │ │ ├── restful.php
│ │ │ └── template
│ │ │ │ ├── basic.php
│ │ │ │ ├── named.php
│ │ │ │ └── override.php
│ │ ├── dashboard
│ │ │ └── repository.php
│ │ ├── language
│ │ │ ├── en
│ │ │ │ ├── pagination.php
│ │ │ │ └── validation.php
│ │ │ └── sp
│ │ │ │ └── validation.php
│ │ ├── libraries
│ │ │ └── .gitignore
│ │ ├── migrations
│ │ │ └── .gitignore
│ │ ├── models
│ │ │ ├── .gitignore
│ │ │ ├── autoloader.php
│ │ │ ├── model.php
│ │ │ ├── repositories
│ │ │ │ └── user.php
│ │ │ └── user.php
│ │ ├── routes.php
│ │ ├── start.php
│ │ ├── tasks
│ │ │ └── .gitignore
│ │ └── views
│ │ │ ├── error
│ │ │ ├── 404.php
│ │ │ └── 500.php
│ │ │ ├── home
│ │ │ └── index.php
│ │ │ └── tests
│ │ │ ├── basic.php
│ │ │ └── nested.php
│ ├── bundles
│ │ ├── .gitignore
│ │ ├── dashboard
│ │ │ ├── config
│ │ │ │ └── meta.php
│ │ │ ├── controllers
│ │ │ │ └── panel.php
│ │ │ ├── models
│ │ │ │ └── repository.php
│ │ │ └── routes.php
│ │ └── dummy
│ │ │ ├── routes.php
│ │ │ └── start.php
│ ├── cases
│ │ ├── asset.test.php
│ │ ├── auth.test.php
│ │ ├── autoloader.test.php
│ │ ├── blade.test.php
│ │ ├── bundle.test.php
│ │ ├── config.test.php
│ │ ├── controller.test.php
│ │ ├── cookie.test.php
│ │ ├── database.test.php
│ │ ├── eloquent.test.php
│ │ ├── event.test.php
│ │ ├── fluent.test.php
│ │ ├── hash.test.php
│ │ ├── input.test.php
│ │ ├── ioc.test.php
│ │ ├── lang.test.php
│ │ ├── messages.test.php
│ │ ├── query.test.php
│ │ ├── redirect.test.php
│ │ ├── request.test.php
│ │ ├── response.test.php
│ │ ├── route.test.php
│ │ ├── routing.test.php
│ │ ├── session.test.php
│ │ ├── str.test.php
│ │ ├── uri.test.php
│ │ ├── url.test.php
│ │ ├── validator.test.php
│ │ └── view.test.php
│ ├── phpunit.php
│ └── storage
│ │ ├── cache
│ │ └── .gitignore
│ │ ├── database
│ │ └── application.sqlite
│ │ ├── files
│ │ └── desert.jpg
│ │ ├── logs
│ │ └── .gitignore
│ │ ├── sessions
│ │ └── .gitignore
│ │ └── views
│ │ └── .gitignore
├── uri.php
├── url.php
├── validator.php
├── vendor
│ └── Symfony
│ │ └── Component
│ │ ├── Console
│ │ ├── Application.php
│ │ ├── Command
│ │ │ ├── Command.php
│ │ │ ├── HelpCommand.php
│ │ │ └── ListCommand.php
│ │ ├── Formatter
│ │ │ ├── OutputFormatter.php
│ │ │ ├── OutputFormatterInterface.php
│ │ │ ├── OutputFormatterStyle.php
│ │ │ └── OutputFormatterStyleInterface.php
│ │ ├── Helper
│ │ │ ├── DialogHelper.php
│ │ │ ├── FormatterHelper.php
│ │ │ ├── Helper.php
│ │ │ ├── HelperInterface.php
│ │ │ └── HelperSet.php
│ │ ├── Input
│ │ │ ├── ArgvInput.php
│ │ │ ├── ArrayInput.php
│ │ │ ├── Input.php
│ │ │ ├── InputArgument.php
│ │ │ ├── InputDefinition.php
│ │ │ ├── InputInterface.php
│ │ │ ├── InputOption.php
│ │ │ └── StringInput.php
│ │ ├── LICENSE
│ │ ├── Output
│ │ │ ├── ConsoleOutput.php
│ │ │ ├── ConsoleOutputInterface.php
│ │ │ ├── NullOutput.php
│ │ │ ├── Output.php
│ │ │ ├── OutputInterface.php
│ │ │ └── StreamOutput.php
│ │ ├── README.md
│ │ ├── Shell.php
│ │ ├── Tester
│ │ │ ├── ApplicationTester.php
│ │ │ └── CommandTester.php
│ │ └── composer.json
│ │ └── HttpFoundation
│ │ ├── ApacheRequest.php
│ │ ├── Cookie.php
│ │ ├── File
│ │ ├── Exception
│ │ │ ├── AccessDeniedException.php
│ │ │ ├── FileException.php
│ │ │ ├── FileNotFoundException.php
│ │ │ ├── UnexpectedTypeException.php
│ │ │ └── UploadException.php
│ │ ├── File.php
│ │ ├── MimeType
│ │ │ ├── ExtensionGuesser.php
│ │ │ ├── ExtensionGuesserInterface.php
│ │ │ ├── FileBinaryMimeTypeGuesser.php
│ │ │ ├── FileinfoMimeTypeGuesser.php
│ │ │ ├── MimeTypeExtensionGuesser.php
│ │ │ ├── MimeTypeGuesser.php
│ │ │ └── MimeTypeGuesserInterface.php
│ │ └── UploadedFile.php
│ │ ├── FileBag.php
│ │ ├── HeaderBag.php
│ │ ├── JsonResponse.php
│ │ ├── LICENSE
│ │ ├── LaravelRequest.php
│ │ ├── LaravelResponse.php
│ │ ├── ParameterBag.php
│ │ ├── README.md
│ │ ├── RedirectResponse.php
│ │ ├── Request.php
│ │ ├── RequestMatcher.php
│ │ ├── RequestMatcherInterface.php
│ │ ├── Resources
│ │ └── stubs
│ │ │ └── SessionHandlerInterface.php
│ │ ├── Response.php
│ │ ├── ResponseHeaderBag.php
│ │ ├── ServerBag.php
│ │ ├── Session
│ │ ├── Attribute
│ │ │ ├── AttributeBag.php
│ │ │ ├── AttributeBagInterface.php
│ │ │ └── NamespacedAttributeBag.php
│ │ ├── Flash
│ │ │ ├── AutoExpireFlashBag.php
│ │ │ ├── FlashBag.php
│ │ │ └── FlashBagInterface.php
│ │ ├── Session.php
│ │ ├── SessionBagInterface.php
│ │ ├── SessionInterface.php
│ │ └── Storage
│ │ │ ├── Handler
│ │ │ ├── MemcacheSessionHandler.php
│ │ │ ├── MemcachedSessionHandler.php
│ │ │ ├── NativeFileSessionHandler.php
│ │ │ ├── NativeMemcacheSessionHandler.php
│ │ │ ├── NativeMemcachedSessionHandler.php
│ │ │ ├── NativeSessionHandler.php
│ │ │ ├── NativeSqliteSessionHandler.php
│ │ │ ├── NullSessionHandler.php
│ │ │ └── PdoSessionHandler.php
│ │ │ ├── MockArraySessionStorage.php
│ │ │ ├── MockFileSessionStorage.php
│ │ │ ├── NativeSessionStorage.php
│ │ │ ├── Proxy
│ │ │ ├── AbstractProxy.php
│ │ │ ├── NativeProxy.php
│ │ │ └── SessionHandlerProxy.php
│ │ │ └── SessionStorageInterface.php
│ │ ├── StreamedResponse.php
│ │ └── composer.json
└── view.php
├── license.txt
├── paths.php
├── public
├── .htaccess
├── bundles
│ ├── .gitignore
│ └── bootstrapper
│ │ ├── css
│ │ ├── bootstrap-responsive.css
│ │ ├── bootstrap-responsive.min.css
│ │ ├── bootstrap.css
│ │ ├── bootstrap.min.css
│ │ └── nav-fix.css
│ │ ├── img
│ │ ├── glyphicons-halflings-white.png
│ │ └── glyphicons-halflings.png
│ │ └── js
│ │ ├── bootstrap.js
│ │ ├── bootstrap.min.js
│ │ ├── jquery-1.8.1.js
│ │ └── jquery-1.8.1.min.js
├── css
│ └── .gitignore
├── favicon.ico
├── img
│ ├── .gitignore
│ ├── maks.jpg
│ └── maks2.jpg
├── index.php
├── js
│ ├── .gitignore
│ └── bootstrap-ajax.js
└── laravel
│ ├── css
│ └── style.css
│ ├── img
│ └── logoback.png
│ └── js
│ ├── modernizr-2.5.3.min.js
│ ├── prettify.js
│ └── scroll.js
├── readme.md
└── storage
├── cache
└── .gitignore
├── database
└── .gitignore
├── logs
└── .gitignore
├── sessions
└── .gitignore
├── views
└── .gitignore
└── work
└── .gitignore
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Numerous always-ignore extensions
2 | *.diff
3 | *.err
4 | *.orig
5 | *.log
6 | *.rej
7 | *.swo
8 | *.swp
9 | *.vi
10 | *~
11 | *.sass-cache
12 |
13 | # OS or Editor folders
14 | .DS_Store
15 | Thumbs.db
16 | .cache
17 | .project
18 | .settings
19 | .tmproj
20 | *.esproj
21 | nbproject
22 |
23 | # Dreamweaver added files
24 | _notes
25 | dwsync.xml
26 |
27 | # Komodo
28 | *.komodoproject
29 | .komodotools
30 |
31 | # Folders to ignore
32 | .hg
33 | .svn
34 | .CVS
35 | intermediate
36 | publish
37 | .idea
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: php
2 |
3 | php:
4 | - 5.3
5 |
6 | script: "php artisan test:core"
--------------------------------------------------------------------------------
/Boxfile:
--------------------------------------------------------------------------------
1 | global:
2 | env:
3 | - LARAVEL_ENV: production
4 | web1:
5 | name: laravelajaxexample
6 | shared_writable_dirs:
7 | - /storage/cache
8 | - /storage/database
9 | - /storage/logs
10 | - /storage/sessions
11 | - /storage/views
12 | - /storage/work
13 | - /public/uploads
14 | document_root: /public
15 | php_version: 5.3.8
16 | php_extensions:
17 | - pdo_mysql
18 | - mcrypt
19 | - gd
20 | - eaccelerator
21 | - memcached
22 | after_deploy:
23 | - "rm -f storage/cache/*"
24 | - "rm -f storage/views/*"
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Pull request guidelines
2 |
3 | [GitHub pull requests](https://help.github.com/articles/using-pull-requests) are a great way for everyone in the community to contribute to the Laravel codebase. Found a bug? Just fix it in your fork and submit a pull request. This will then be reviewed, and, if found as good, merged into the main repository.
4 |
5 | In order to keep the codebase clean, stable and at high quality, even with so many people contributing, some guidelines are necessary for high-quality pull requests:
6 |
7 | - **Branch:** Unless they are immediate documentation fixes relevant for old versions, pull requests should be sent to the `develop` branch only. Make sure to select that branch as target when creating the pull request (GitHub will not automatically select it.)
8 | - **Documentation:** If you are adding a new feature or changing the API in any relevant way, this should be documented. The documentation files can be found directly in the core repository.
9 | - **Unit tests:** To keep old bugs from re-appearing and generally hold quality at a high level, the Laravel core is thoroughly unit-tested. Thus, when you create a pull request, it is expected that you unit test any new code you add. For any bug you fix, you should also add regression tests to make sure the bug will never appear again. If you are unsure about how to write tests, the core team or other contributors will gladly help.
--------------------------------------------------------------------------------
/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(
37 | 'bootstrapper' => array('auto' => true),
38 | 'docs' => array('handles' => 'docs'),
39 | );
--------------------------------------------------------------------------------
/application/config/.gitignore:
--------------------------------------------------------------------------------
1 | local/*
--------------------------------------------------------------------------------
/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 set up 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 | );
--------------------------------------------------------------------------------
/application/controllers/base.php:
--------------------------------------------------------------------------------
1 | '→ السابق',
17 | 'next' => 'التالي ←',
18 |
19 | );
--------------------------------------------------------------------------------
/application/language/bg/pagination.php:
--------------------------------------------------------------------------------
1 | '« Назад',
17 | 'next' => 'Напред »',
18 |
19 | );
--------------------------------------------------------------------------------
/application/language/da/pagination.php:
--------------------------------------------------------------------------------
1 | '« Forrige',
17 | 'next' => 'Næste »',
18 |
19 | );
--------------------------------------------------------------------------------
/application/language/de/pagination.php:
--------------------------------------------------------------------------------
1 | '« Zurück',
17 | 'next' => 'Weiter »',
18 |
19 | );
--------------------------------------------------------------------------------
/application/language/el/pagination.php:
--------------------------------------------------------------------------------
1 | '« Προηγούμενο',
17 | 'next' => 'Επόμενο »',
18 |
19 | );
--------------------------------------------------------------------------------
/application/language/en/pagination.php:
--------------------------------------------------------------------------------
1 | '« Previous',
17 | 'next' => 'Next »',
18 |
19 | );
--------------------------------------------------------------------------------
/application/language/fr/pagination.php:
--------------------------------------------------------------------------------
1 | '« Précédent',
17 | 'next' => 'Suivant »',
18 |
19 | );
20 |
--------------------------------------------------------------------------------
/application/language/gr/pagination.php:
--------------------------------------------------------------------------------
1 | '« Προηγούμενο',
17 | 'next' => 'Επόμενο »',
18 |
19 | );
--------------------------------------------------------------------------------
/application/language/he/pagination.php:
--------------------------------------------------------------------------------
1 | '→ אחורה',
17 | 'next' => 'קדימה ←',
18 |
19 | );
--------------------------------------------------------------------------------
/application/language/hu/pagination.php:
--------------------------------------------------------------------------------
1 | '« Előző',
17 | 'next' => 'Következő »',
18 |
19 | );
--------------------------------------------------------------------------------
/application/language/id/pagination.php:
--------------------------------------------------------------------------------
1 | '« Sebelumnya',
17 | 'next' => 'Selanjutnya »',
18 |
19 | );
--------------------------------------------------------------------------------
/application/language/ja/pagination.php:
--------------------------------------------------------------------------------
1 | '« 前',
29 | 'next' => '次 »',
30 |
31 | );
32 |
--------------------------------------------------------------------------------
/application/language/nl/pagination.php:
--------------------------------------------------------------------------------
1 | '« Vorige',
17 | 'next' => 'Volgende »',
18 |
19 | );
20 |
--------------------------------------------------------------------------------
/application/language/pl/pagination.php:
--------------------------------------------------------------------------------
1 | '« Poprzednia',
17 | 'next' => 'Następna »',
18 |
19 | );
--------------------------------------------------------------------------------
/application/language/pt/pagination.php:
--------------------------------------------------------------------------------
1 | '« Anterior',
17 | 'next' => 'Próxima »',
18 |
19 | );
--------------------------------------------------------------------------------
/application/language/ru/pagination.php:
--------------------------------------------------------------------------------
1 | '← Назад',
17 | 'next' => 'Вперёд →',
18 |
19 | );
--------------------------------------------------------------------------------
/application/language/tr/pagination.php:
--------------------------------------------------------------------------------
1 |
9 | * @link http://sinaneldem.com.tr
10 | */
11 |
12 | return array(
13 |
14 | /*
15 | |--------------------------------------------------------------------------
16 | | Pagination Language Lines
17 | |--------------------------------------------------------------------------
18 | |
19 | | The following language lines are used by the paginator library to build
20 | | the pagination links. You're free to change them to anything you want.
21 | | If you come up with something more exciting, let us know.
22 | |
23 | */
24 |
25 | 'previous' => '« Önceki',
26 | 'next' => 'Sonraki »',
27 |
28 | );
--------------------------------------------------------------------------------
/application/libraries/.gitignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msurguy/laravel-ajax-example/b9445560e557bf7af2812fa15ee921cc68275d17/application/libraries/.gitignore
--------------------------------------------------------------------------------
/application/migrations/.gitignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msurguy/laravel-ajax-example/b9445560e557bf7af2812fa15ee921cc68275d17/application/migrations/.gitignore
--------------------------------------------------------------------------------
/application/models/.gitignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msurguy/laravel-ajax-example/b9445560e557bf7af2812fa15ee921cc68275d17/application/models/.gitignore
--------------------------------------------------------------------------------
/application/tasks/.gitignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msurguy/laravel-ajax-example/b9445560e557bf7af2812fa15ee921cc68275d17/application/tasks/.gitignore
--------------------------------------------------------------------------------
/application/tests/example.test.php:
--------------------------------------------------------------------------------
1 | assertTrue(true);
13 | }
14 |
15 | }
--------------------------------------------------------------------------------
/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;
--------------------------------------------------------------------------------
/bundles/.gitignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msurguy/laravel-ajax-example/b9445560e557bf7af2812fa15ee921cc68275d17/bundles/.gitignore
--------------------------------------------------------------------------------
/bundles/bootstrapper/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------
/bundles/bootstrapper/helpers.php:
--------------------------------------------------------------------------------
1 | ';
41 | $html .= '';
42 |
43 | if($collapsible)
44 | {
45 | $html .= '
46 |
47 | ';
48 | }
49 |
50 | $html .= '
'.$brand.'';
51 |
52 | if($collapsible)
53 | $html .= '
';
54 |
55 | foreach ($menus as $menu)
56 | {
57 | // If is string add to html
58 | if (is_string($menu))
59 | {
60 | $html .= $menu;
61 | }
62 | else
63 | {
64 | $attr = isset($menu['attributes']) ? $menu['attributes'] : array();
65 | $html .= Navigation::unstyled($menu['items'], false, $attr, $autoroute);
66 | }
67 | }
68 |
69 | if($collapsible)
70 | $html .= '
';
71 |
72 | //close navbar containers
73 | $html .= '
';
74 | return $html;
75 | }
76 | }
--------------------------------------------------------------------------------
/bundles/bootstrapper/public/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 | }
--------------------------------------------------------------------------------
/bundles/bootstrapper/public/img/glyphicons-halflings-white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msurguy/laravel-ajax-example/b9445560e557bf7af2812fa15ee921cc68275d17/bundles/bootstrapper/public/img/glyphicons-halflings-white.png
--------------------------------------------------------------------------------
/bundles/bootstrapper/public/img/glyphicons-halflings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msurguy/laravel-ajax-example/b9445560e557bf7af2812fa15ee921cc68275d17/bundles/bootstrapper/public/img/glyphicons-halflings.png
--------------------------------------------------------------------------------
/bundles/bootstrapper/readme.md:
--------------------------------------------------------------------------------
1 | ## Bootstrapper Bundle V. 3.6.8 build 1, 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 | Add the following to the application.php config file:
20 |
21 | 'Alert' => 'Bootstrapper\\Alert',
22 | 'Badges' => 'Bootstrapper\\Badges',
23 | 'Breadcrumbs' => 'Bootstrapper\\Breadcrumbs',
24 | 'Buttons' => 'Bootstrapper\\Buttons',
25 | 'ButtonGroup' => 'Bootstrapper\\ButtonGroup',
26 | 'ButtonToolbar' => 'Bootstrapper\\ButtonToolbar',
27 | 'Carousel' => 'Bootstrapper\\Carousel',
28 | 'DropdownButton' => 'Bootstrapper\\DropdownButton',
29 | 'Form' => 'Bootstrapper\\Form',
30 | 'Helpers' => 'Bootstrapper\\Helpers',
31 | 'Icons' => 'Bootstrapper\\Icons',
32 | 'Labels' => 'Bootstrapper\\Labels',
33 | 'Navbar' => 'Bootstrapper\\Navbar',
34 | 'Navigation' => 'Bootstrapper\\Navigation',
35 | 'Paginator' => 'Bootstrapper\\Paginator',
36 | 'Progress' => 'Bootstrapper\\Progress',
37 | 'SplitDropdownButton' => 'Bootstrapper\\SplitDropdownButton',
38 | 'Tabbable' => 'Bootstrapper\\Tabbable',
39 | 'Tables' => 'Bootstrapper\\Tables',
40 | 'Typeahead' => 'Bootstrapper\\Typeahead',
41 |
42 |
43 | Update laravel\database\query.php to use the Bootstrapper Paginator and not the core class by changing the use statement.
44 |
45 | //Change
46 | use Laravel\Paginator;
47 |
48 | //To
49 | use Paginator;
50 |
51 |
52 | Publish the bundle assets to your public folder.
53 |
54 | php artisan bundle:publish
55 |
56 |
57 | Add the following to your template view file to include the Twitter Bootstrap CSS and Javascript.
58 |
59 | Asset::container('bootstrapper')->styles();
60 | Asset::container('bootstrapper')->scripts();
61 |
62 |
63 |
64 | ##Current Twitter Bootstrap version is 2.1.1.
65 |
66 | - Homepage: http://twitter.github.com/bootstrap/
67 | - GitHub: https://github.com/twitter/bootstrap/
--------------------------------------------------------------------------------
/bundles/bootstrapper/tables.php:
--------------------------------------------------------------------------------
1 | ';
27 | }
28 |
29 | /**
30 | * Creates a table tag
31 | *
32 | * @param array $headers An array of thead rows
33 | * @return string A tag prefilled with rows
34 | */
35 | public static function headers($headers = array())
36 | {
37 | $thead = ''.PHP_EOL;
38 |
39 | // Add each header with its attributes
40 | foreach($headers as $header => $attributes) {
41 |
42 | // Allows to not specify an attributes array for leaner syntax
43 | if(is_string($attributes) and is_numeric($header)) {
44 | $header = $attributes;
45 | $attributes = array();
46 | }
47 |
48 | $thead .= '' .$header. ' | '.PHP_EOL;
49 | }
50 |
51 | $thead .= ''.PHP_EOL;
52 |
53 | return $thead;
54 | }
55 |
56 | /**
57 | * Checks call to see if we can create a table from a magic call (for you wizards).
58 | * hover_striped, bordered_condensed, etc.
59 | *
60 | * @param string $method
61 | * @param array $parameters
62 | * @return mixed
63 | */
64 | public static function __callStatic($method, $parameters)
65 | {
66 | $method_array = explode('_', strtolower($method));
67 |
68 | $function = 'table';
69 |
70 | $parameters = Helpers::set_multi_class_attributes($function, $method_array, $parameters, 1, 'table-');
71 |
72 | return call_user_func_array('static::'.$function, $parameters);
73 | }
74 | }
--------------------------------------------------------------------------------
/bundles/bootstrapper/typeahead.php:
--------------------------------------------------------------------------------
1 | ';
34 | }
35 | }
--------------------------------------------------------------------------------
/bundles/docs/routes.php:
--------------------------------------------------------------------------------
1 | with('sidebar', document('contents'));
46 | });
47 |
48 | /**
49 | * Handle the documentation homepage.
50 | *
51 | * This page contains the "introduction" to Laravel.
52 | */
53 | Route::get('(:bundle)', function()
54 | {
55 | return View::make('docs::page')->with('content', document('home'));
56 | });
57 |
58 | /**
59 | * Handle documentation routes for sections and pages.
60 | *
61 | * @param string $section
62 | * @param string $page
63 | * @return mixed
64 | */
65 | Route::get('(:bundle)/(:any)/(:any?)', function($section, $page = null)
66 | {
67 | $file = rtrim(implode('/', func_get_args()), '/');
68 |
69 | // If no page was specified, but a "home" page exists for the section,
70 | // we'll set the file to the home page so that the proper page is
71 | // displayed back out to the client for the requested doc page.
72 | if (is_null($page) and document_exists($file.'/home'))
73 | {
74 | $file .= '/home';
75 | }
76 |
77 | if (document_exists($file))
78 | {
79 | return View::make('docs::page')->with('content', document($file));
80 | }
81 | else
82 | {
83 | return Response::error('404');
84 | }
85 | });
--------------------------------------------------------------------------------
/bundles/docs/views/page.blade.php:
--------------------------------------------------------------------------------
1 | @layout('docs::template')
2 |
3 | @section('content')
4 | {{ $content }}
5 | @endsection
--------------------------------------------------------------------------------
/bundles/docs/views/template.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Laravel: A Framework For Web Artisans
7 |
8 |
9 | {{ HTML::style(URL::$base.'/laravel/css/style.css') }}
10 | {{ HTML::script(URL::$base.'/laravel/js/modernizr-2.5.3.min.js') }}
11 |
12 |
13 |
14 |
15 | Laravel
16 | A Framework For Web Artisans
17 |
18 |
19 |
20 |
21 |
22 |
25 |
26 | @yield('content')
27 |
28 |
29 |
30 | {{ HTML::script('http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js') }}
31 | {{ HTML::script(URL::$base.'/laravel/js/prettify.js') }}
32 | {{ HTML::script(URL::$base.'/laravel/js/scroll.js') }}
33 |
34 |
35 |
--------------------------------------------------------------------------------
/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/auth/drivers/eloquent.php:
--------------------------------------------------------------------------------
1 | model()->find($token);
20 | }
21 | else if (get_class($token) == Config::get('auth.model'))
22 | {
23 | return $token;
24 | }
25 | }
26 |
27 | /**
28 | * Attempt to log a user into the application.
29 | *
30 | * @param array $arguments
31 | * @return void
32 | */
33 | public function attempt($arguments = array())
34 | {
35 | $user = $this->model()->where(function($query) use($arguments)
36 | {
37 | $username = Config::get('auth.username');
38 |
39 | $query->where($username, '=', $arguments['username']);
40 |
41 | foreach(array_except($arguments, array('username', 'password', 'remember')) as $column => $val)
42 | {
43 | $query->where($column, '=', $val);
44 | }
45 | })->first();
46 |
47 | // If the credentials match what is in the database we will just
48 | // log the user into the application and remember them if asked.
49 | $password = $arguments['password'];
50 |
51 | $password_field = Config::get('auth.password', 'password');
52 |
53 | if ( ! is_null($user) and Hash::check($password, $user->{$password_field}))
54 | {
55 | return $this->login($user->id, array_get($arguments, 'remember'));
56 | }
57 |
58 | return false;
59 | }
60 |
61 | /**
62 | * Get a fresh model instance.
63 | *
64 | * @return Eloquent
65 | */
66 | protected function model()
67 | {
68 | $model = Config::get('auth.model');
69 |
70 | return new $model;
71 | }
72 |
73 | }
74 |
--------------------------------------------------------------------------------
/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/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/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 | }
--------------------------------------------------------------------------------
/laravel/cli/artisan.php:
--------------------------------------------------------------------------------
1 | getMessage();
47 | }
48 |
49 | echo PHP_EOL;
--------------------------------------------------------------------------------
/laravel/cli/tasks/bundle/providers/github.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 the requested bundle.");
77 | }
78 |
79 | return $remote;
80 | }
81 |
82 | }
--------------------------------------------------------------------------------
/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/cli/tasks/bundle/repository.php:
--------------------------------------------------------------------------------
1 | api.$bundle);
25 |
26 | return json_decode($bundle, true);
27 | }
28 |
29 | }
--------------------------------------------------------------------------------
/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/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/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 | }
--------------------------------------------------------------------------------
/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/cli/tasks/migrate/stub.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(), $_SERVER['REQUEST_URI']);
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 | }
57 |
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------
/laravel/cli/tasks/task.php:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 | {{directory}}
7 |
8 |
9 |
--------------------------------------------------------------------------------
/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/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/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/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 |
--------------------------------------------------------------------------------
/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 | //check for dblib for mac users connecting to mssql (utilizes freetds)
33 | if (!empty($dsn_type) and $dsn_type == 'dblib')
34 | {
35 | $dsn = "dblib:host={$host}{$port};dbname={$database}";
36 | }
37 | else
38 | {
39 | $dsn = "sqlsrv:Server={$host}{$port};Database={$database}";
40 | }
41 |
42 | return new PDO($dsn, $username, $password, $this->options($config));
43 | }
44 |
45 | }
--------------------------------------------------------------------------------
/laravel/database/eloquent/pivot.php:
--------------------------------------------------------------------------------
1 | pivot_table = $table;
29 | static::$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 | }
--------------------------------------------------------------------------------
/laravel/database/eloquent/relationships/has_one.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/database/eloquent/relationships/has_one_or_many.php:
--------------------------------------------------------------------------------
1 | set_attribute($this->foreign_key(), $this->base->get_key());
20 |
21 | return $attributes->save() ? $attributes : false;
22 | }
23 | else
24 | {
25 | $attributes[$this->foreign_key()] = $this->base->get_key();
26 |
27 | return $this->model->create($attributes);
28 | }
29 | }
30 |
31 | /**
32 | * Update a record for the association.
33 | *
34 | * @param array $attributes
35 | * @return bool
36 | */
37 | public function update(array $attributes)
38 | {
39 | if ($this->model->timestamps())
40 | {
41 | $attributes['updated_at'] = new \DateTime;
42 | }
43 |
44 | return $this->table->update($attributes);
45 | }
46 |
47 | /**
48 | * Set the proper constraints on the relationship table.
49 | *
50 | * @return void
51 | */
52 | protected function constrain()
53 | {
54 | $this->table->where($this->foreign_key(), '=', $this->base->get_key());
55 | }
56 |
57 | /**
58 | * Set the proper constraints on the relationship table for an eager load.
59 | *
60 | * @param array $results
61 | * @return void
62 | */
63 | public function eagerly_constrain($results)
64 | {
65 | $this->table->where_in($this->foreign_key(), $this->keys($results));
66 | }
67 |
68 | }
--------------------------------------------------------------------------------
/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/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/database/query/grammars/mysql.php:
--------------------------------------------------------------------------------
1 | insert($query, $values)." RETURNING $column";
18 | }
19 |
20 | }
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------
/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/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/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/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.
--------------------------------------------------------------------------------
/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/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/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/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/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 | echo Str::limit_exact($string, 10);
29 |
30 | #### Limiting the number of words in a string:
31 |
32 | echo Str::words($string, 10);
33 |
34 |
35 | ## Generating Random Strings
36 |
37 | #### Generating a random string of alpha-numeric characters:
38 |
39 | echo Str::random(32);
40 |
41 | #### Generating a random string of alphabetic characters:
42 |
43 | echo Str::random(32, 'alpha');
44 |
45 |
46 | ## Singular & Plural
47 |
48 | The String class is capable of transforming your strings from singular to plural, and vice versa.
49 |
50 | #### Getting the plural form of a word:
51 |
52 | echo Str::plural('user');
53 |
54 | #### Getting the singular form of a word:
55 |
56 | echo Str::singular('users');
57 |
58 | #### Getting the plural form if given value is greater than one:
59 |
60 | echo Str::plural('comment', count($comments));
61 |
62 |
63 | ## Slugs
64 |
65 | #### Generating a URL friendly slug:
66 |
67 | return Str::slug('My First Blog Post!');
68 |
69 | #### Generating a URL friendly slug using a given separator:
70 |
71 | return Str::slug('My First Blog Post!', '_');
72 |
73 |
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------
/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/log.php:
--------------------------------------------------------------------------------
1 | getMessage().' in '.$e->getFile().' on line '.$e->getLine();
25 | }
26 |
27 | /**
28 | * Write a message to the log file.
29 | *
30 | *
31 | * // Write an "error" message to the log file
32 | * Log::write('error', 'Something went horribly wrong!');
33 | *
34 | * // Write an "error" message using the class' magic method
35 | * Log::error('Something went horribly wrong!');
36 | *
37 | *
38 | * @param string $type
39 | * @param string $message
40 | * @return void
41 | */
42 | public static function write($type, $message)
43 | {
44 | // If there is a listener for the log event, we'll delegate the logging
45 | // to the event and not write to the log files. This allows for quick
46 | // swapping of log implementations for debugging.
47 | if (Event::listeners('laravel.log'))
48 | {
49 | Event::fire('laravel.log', array($type, $message));
50 | }
51 |
52 | $message = static::format($type, $message);
53 |
54 | File::append(path('storage').'logs/'.date('Y-m-d').'.log', $message);
55 | }
56 |
57 | /**
58 | * Format a log message for logging.
59 | *
60 | * @param string $type
61 | * @param string $message
62 | * @return string
63 | */
64 | protected static function format($type, $message)
65 | {
66 | return date('Y-m-d H:i:s').' '.Str::upper($type)." - {$message}".PHP_EOL;
67 | }
68 |
69 | /**
70 | * Dynamically write a log message.
71 | *
72 | *
73 | * // Write an "error" message to the log file
74 | * Log::error('This is an error!');
75 | *
76 | * // Write a "warning" message to the log file
77 | * Log::warning('This is a warning!');
78 | *
79 | */
80 | public static function __callStatic($method, $parameters)
81 | {
82 | static::write($method, $parameters[0]);
83 | }
84 |
85 | }
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------
/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 | $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/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/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/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/session/drivers/redis.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/session/drivers/sweeper.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/tests/application/config/local/database.php:
--------------------------------------------------------------------------------
1 | 'sqlite',
6 |
7 | );
--------------------------------------------------------------------------------
/laravel/tests/application/controllers/admin/panel.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/tests/application/controllers/home.php:
--------------------------------------------------------------------------------
1 | '« Previous',
17 | 'next' => 'Next »',
18 |
19 | );
--------------------------------------------------------------------------------
/laravel/tests/application/language/sp/validation.php:
--------------------------------------------------------------------------------
1 | 'El campo de atributo es necesario.',
6 |
7 | );
--------------------------------------------------------------------------------
/laravel/tests/application/libraries/.gitignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msurguy/laravel-ajax-example/b9445560e557bf7af2812fa15ee921cc68275d17/laravel/tests/application/libraries/.gitignore
--------------------------------------------------------------------------------
/laravel/tests/application/migrations/.gitignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msurguy/laravel-ajax-example/b9445560e557bf7af2812fa15ee921cc68275d17/laravel/tests/application/migrations/.gitignore
--------------------------------------------------------------------------------
/laravel/tests/application/models/.gitignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msurguy/laravel-ajax-example/b9445560e557bf7af2812fa15ee921cc68275d17/laravel/tests/application/models/.gitignore
--------------------------------------------------------------------------------
/laravel/tests/application/models/autoloader.php:
--------------------------------------------------------------------------------
1 | set_attribute('setter', 'setter: '.$setter);
8 | }
9 |
10 | public function get_getter()
11 | {
12 | return 'getter: '.$this->get_attribute('getter');
13 | }
14 |
15 | }
--------------------------------------------------------------------------------
/laravel/tests/application/models/repositories/user.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/tests/application/views/tests/basic.php:
--------------------------------------------------------------------------------
1 | is
--------------------------------------------------------------------------------
/laravel/tests/application/views/tests/nested.php:
--------------------------------------------------------------------------------
1 | Taylor
--------------------------------------------------------------------------------
/laravel/tests/bundles/.gitignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msurguy/laravel-ajax-example/b9445560e557bf7af2812fa15ee921cc68275d17/laravel/tests/bundles/.gitignore
--------------------------------------------------------------------------------
/laravel/tests/bundles/dashboard/config/meta.php:
--------------------------------------------------------------------------------
1 | 'dashboard',
6 |
7 | );
--------------------------------------------------------------------------------
/laravel/tests/bundles/dashboard/controllers/panel.php:
--------------------------------------------------------------------------------
1 | 'dashboard', function()
4 | {
5 | //
6 | }));
7 |
8 | Route::controller('dashboard::panel');
--------------------------------------------------------------------------------
/laravel/tests/bundles/dummy/routes.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('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/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/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 | }
--------------------------------------------------------------------------------
/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/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/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/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/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/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/tests/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\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/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 |
--------------------------------------------------------------------------------
/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/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 |
--------------------------------------------------------------------------------
/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/Console/Output/ConsoleOutputInterface.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 |
--------------------------------------------------------------------------------
/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/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/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/vendor/Symfony/Component/HttpFoundation/ApacheRequest.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/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/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 |
--------------------------------------------------------------------------------
/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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 |
--------------------------------------------------------------------------------
/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/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 |
--------------------------------------------------------------------------------
/laravel/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeMemcachedSessionHandler.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/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/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/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/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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.
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/public/bundles/.gitignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msurguy/laravel-ajax-example/b9445560e557bf7af2812fa15ee921cc68275d17/public/bundles/.gitignore
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------
/public/bundles/bootstrapper/img/glyphicons-halflings-white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msurguy/laravel-ajax-example/b9445560e557bf7af2812fa15ee921cc68275d17/public/bundles/bootstrapper/img/glyphicons-halflings-white.png
--------------------------------------------------------------------------------
/public/bundles/bootstrapper/img/glyphicons-halflings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msurguy/laravel-ajax-example/b9445560e557bf7af2812fa15ee921cc68275d17/public/bundles/bootstrapper/img/glyphicons-halflings.png
--------------------------------------------------------------------------------
/public/css/.gitignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msurguy/laravel-ajax-example/b9445560e557bf7af2812fa15ee921cc68275d17/public/css/.gitignore
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msurguy/laravel-ajax-example/b9445560e557bf7af2812fa15ee921cc68275d17/public/favicon.ico
--------------------------------------------------------------------------------
/public/img/.gitignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msurguy/laravel-ajax-example/b9445560e557bf7af2812fa15ee921cc68275d17/public/img/.gitignore
--------------------------------------------------------------------------------
/public/img/maks.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msurguy/laravel-ajax-example/b9445560e557bf7af2812fa15ee921cc68275d17/public/img/maks.jpg
--------------------------------------------------------------------------------
/public/img/maks2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msurguy/laravel-ajax-example/b9445560e557bf7af2812fa15ee921cc68275d17/public/img/maks2.jpg
--------------------------------------------------------------------------------
/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';
--------------------------------------------------------------------------------
/public/js/.gitignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msurguy/laravel-ajax-example/b9445560e557bf7af2812fa15ee921cc68275d17/public/js/.gitignore
--------------------------------------------------------------------------------
/public/laravel/img/logoback.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msurguy/laravel-ajax-example/b9445560e557bf7af2812fa15ee921cc68275d17/public/laravel/img/logoback.png
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | # AJAX examples using [Laravel](http://laravel.com) and [Bootstrap AJAX](https://github.com/eldarion/bootstrap-ajax)
2 |
3 | ## See live demo at [Pagodabox deployed code](http://laravelajaxexample.gopagoda.com/)
4 | This is a demo of simplifying AJAX calls withing Laravel application using Bootstrapper Bundle and Bootstrap-ajax extension
5 |
6 | The source code features are :
7 | + replace content via AJAX calls
8 | + append content via AJAX calls
9 | + Form submittal and displaying result via AJAX calls
10 | + Loading data after successfull AJAX call
11 |
12 | To get this working on your local machine just copy this folder into your htdocs MAMP directory or www WAMP directory and navigate to /public folder of this application.
13 |
14 | There is no Database setup here but you could do that in a few minutes with Laravel.
15 |
16 | ## Contributing to This code
17 |
18 | Contributions are encouraged and welcome. Submit pull requests or ask questions if something's not clear
19 |
20 | ## License
21 |
22 | This source is under MIT license.
23 |
--------------------------------------------------------------------------------
/storage/cache/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
--------------------------------------------------------------------------------
/storage/database/.gitignore:
--------------------------------------------------------------------------------
1 | *.sqlite
--------------------------------------------------------------------------------
/storage/logs/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
--------------------------------------------------------------------------------
/storage/sessions/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
--------------------------------------------------------------------------------
/storage/views/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
--------------------------------------------------------------------------------
/storage/work/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
--------------------------------------------------------------------------------