-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update: rename laravel from 4.2.11 to 4.2.16 and force add vendor in …
…sample app
- Loading branch information
Showing
3,359 changed files
with
456,491 additions
and
2 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
/bootstrap/compiled.php | ||
/vendor | ||
composer.phar | ||
composer.lock | ||
.env.*.php | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
// autoload.php @generated by Composer | ||
|
||
require_once __DIR__ . '/composer' . '/autoload_real.php'; | ||
|
||
return ComposerAutoloaderInitbb53de87abeeaa797594c4719a32bc43::getLoader(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
|
||
/* vim: set shiftwidth=2 expandtab softtabstop=2: */ | ||
|
||
require_once __DIR__.'/../lib/autoload.php'; | ||
|
||
$boris = new \Boris\Boris(); | ||
|
||
$config = new \Boris\Config(); | ||
$config->apply($boris); | ||
|
||
$options = new \Boris\CLIOptionsHandler(); | ||
$options->handle($boris); | ||
|
||
$boris->start(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#! /usr/bin/env php | ||
<?php | ||
|
||
if (file_exists($autoloadPath = __DIR__ . '/../../autoload.php')) { | ||
require_once $autoloadPath; | ||
} else { | ||
require_once __DIR__ . '/vendor/autoload.php'; | ||
} | ||
$application = new ClassPreloader\Application(); | ||
$application->run(); |
2 changes: 2 additions & 0 deletions
2
uwamp/www/laravel/vendor/classpreloader/classpreloader/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
composer.lock | ||
vendor |
19 changes: 19 additions & 0 deletions
19
uwamp/www/laravel/vendor/classpreloader/classpreloader/LICENSE.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Copyright (c) 2013 Michael Dowling <[email protected]> and contributors | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
108 changes: 108 additions & 0 deletions
108
uwamp/www/laravel/vendor/classpreloader/classpreloader/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
Class Preloader for PHP | ||
======================= | ||
|
||
This tool is used to generate a single PHP script containing all of the classes | ||
required for a specific use case. Using a single compiled PHP script instead of relying on autoloading can help to improve the performance of specific use cases. For example, if your application executes the same bootstrap code on every request, then you could generate a preloader (the compiled output of this tool) to reduce the cost of autoloading the required classes over and over. | ||
|
||
What it actually does | ||
--------------------- | ||
|
||
This tool listens for each file that is autoloaded, creates a list of files, traverses the parsed PHP file using [PHPParser](https://github.com/nikic/PHP-Parser) and any visitors of a Config object, wraps the code of each file in a namespace block if necessary, and writes the contents of every autoloaded file (in order) to a single PHP file. | ||
|
||
Notice | ||
------ | ||
|
||
This tool should only be used for specific use cases. There is a tradeoff between preloading classes and autoloading classes. The point at which it is no longer beneficial to generate a preloader is application specific. You'll need to perform your own benchmarks to determine if this tool will speed up your application. | ||
|
||
Installation | ||
------------ | ||
|
||
Add the ClassPreloader as a dependency to your composer.json file: | ||
|
||
```javascript | ||
{ | ||
"require": { | ||
"classpreloader/classpreloader": "1.0.*" | ||
}, | ||
"config": { | ||
"bin-dir": "bin" | ||
} | ||
} | ||
``` | ||
|
||
Using the tool | ||
-------------- | ||
|
||
You use the bin/classpreloader.php compile command with a few command line flags to generate a preloader. | ||
|
||
`--config`: A CSV containing a list of files to combine into a classmap, or the full path to a PHP script that returns an array of classes or a `\ClassPreloader\Config` object. | ||
|
||
`--output`: The path to the file to store the compiled PHP code. If the directory does not exist, the tool will attempt to create it. | ||
|
||
`--fix_dir`: (defaults to 1) Set to 0 to not replace "__DIR__" constants with the actual directory of the original file. | ||
|
||
`--fix_file`: (defaults to 1) Set to 0 to not replace "__FILE__" constants with the actual location of the original file. | ||
|
||
Writing a config file | ||
--------------------- | ||
|
||
Creating a PHP based configuration file is fairly simple. Just include the vendor/classpreloader/classpreloader/src/ClassPreloader/ClassLoader.php file and call the `ClassLoader::getIncludes()` method, passing a function as the only argument. This function should accept a `ClassLoader` object and register the passed in object's autoloader using `$loader->register()`. It is important to register the `ClassLoader` autoloader after all other autoloaders are registered. | ||
|
||
An array or `\ClassPreloader\Config` must be returned from the config file. You can attach custom node visitors if you need to perform any sort of translation on each matching file before writing it to the output. | ||
|
||
```php | ||
<?php | ||
// Here's an example of creating a preloader for using Amazon DynamoDB and the | ||
// AWS SDK for PHP 2. | ||
|
||
require __DIR__ . '/src/ClassPreloader/ClassLoader.php'; | ||
|
||
use ClassPreloader\ClassLoader; | ||
|
||
$config = ClassLoader::getIncludes(function(ClassLoader $loader) { | ||
require __DIR__ . '/vendor/autoload.php'; | ||
$loader->register(); | ||
$aws = Aws\Common\Aws::factory(array( | ||
'key' => '***', | ||
'secret' => '***', | ||
'region' => 'us-east-1' | ||
)); | ||
$client = $aws->get('dynamodb'); | ||
$client->listTables()->getAll(); | ||
}); | ||
|
||
// Add a regex filter that requires all classes to match the regex | ||
// $config->addInclusiveFilter('/Foo/'); | ||
|
||
// Add a regex filter that requires that a class does not match the filter | ||
// $config->addExclusiveFilter('/Foo/'); | ||
|
||
return $config; | ||
``` | ||
|
||
You would then run the classpreloader.php script and pass in the full path to the above PHP script. | ||
|
||
`php bin/classpreloader.php compile --config="/path/to/the_example.php" --output="/tmp/preloader.php"` | ||
|
||
The above command will create a file in /tmp/preloader.php that contains every file that was autoloaded while running the snippet of code in the anonymous function. You would generate this file and include it in your production script. | ||
|
||
Automating the process with Composer | ||
------------------------------------ | ||
|
||
You can automate the process of creating preloaders using Composer's script functionality. For example, if you wanted to automatically create a preloader each time the AWS SDK for PHP is installed, you could define a script like the following in your composer.json file: | ||
|
||
```javascript | ||
{ | ||
"require": { | ||
"classpreloader/classpreloader": "1.0.*" | ||
}, | ||
"scripts": { | ||
"post-autoload-dump": "php bin/classpreloader.php compile --config=/path/to/the_example.php --output=/path/to/preload.php" | ||
}, | ||
"config": { | ||
"bin-dir": "bin" | ||
} | ||
} | ||
``` | ||
|
||
Using the above composer.json file, each time the project's autoloader is recreated using the install or update command, the classpreloader.php file will be executed. This script would generate a preload.php containing the classes required to run the previously demonstrated "the_example.php" configuration file. |
10 changes: 10 additions & 0 deletions
10
uwamp/www/laravel/vendor/classpreloader/classpreloader/classpreloader.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#! /usr/bin/env php | ||
<?php | ||
|
||
if (file_exists($autoloadPath = __DIR__ . '/../../autoload.php')) { | ||
require_once $autoloadPath; | ||
} else { | ||
require_once __DIR__ . '/vendor/autoload.php'; | ||
} | ||
$application = new ClassPreloader\Application(); | ||
$application->run(); |
28 changes: 28 additions & 0 deletions
28
uwamp/www/laravel/vendor/classpreloader/classpreloader/composer.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"name": "classpreloader/classpreloader", | ||
"description":"Helps class loading performance by generating a single PHP file containing all of the autoloaded files for a specific use case", | ||
"keywords":["autoload","class","preload"], | ||
"license":"MIT", | ||
|
||
"require":{ | ||
"php": ">=5.3.3", | ||
"symfony/console": "~2.1", | ||
"symfony/filesystem": "~2.1", | ||
"symfony/finder": "~2.1", | ||
"nikic/php-parser": "~0.9" | ||
}, | ||
|
||
"autoload": { | ||
"psr-0": { | ||
"ClassPreloader": "src/" | ||
} | ||
}, | ||
|
||
"bin": ["classpreloader.php"], | ||
|
||
"extra": { | ||
"branch-alias": { | ||
"dev-master": "1.0-dev" | ||
} | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
uwamp/www/laravel/vendor/classpreloader/classpreloader/src/ClassPreloader/Application.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace ClassPreloader; | ||
|
||
use Symfony\Component\Finder\Finder; | ||
use Symfony\Component\Console\Application as BaseApplication; | ||
|
||
/** | ||
* ClassPreloader application CLI | ||
*/ | ||
class Application extends BaseApplication | ||
{ | ||
public function __construct() | ||
{ | ||
parent::__construct('ClassPreloader'); | ||
|
||
// Create a finder to find each non-abstract command in the filesystem | ||
$finder = new Finder(); | ||
$finder->files() | ||
->in(__DIR__ . '/Command') | ||
->notName('Abstract*') | ||
->name('*.php'); | ||
|
||
// Add each command to the CLI | ||
foreach ($finder as $file) { | ||
$filename = str_replace('\\', '/', $file->getRealpath()); | ||
$pos = strrpos($filename, '/ClassPreloader/') + strlen('/ClassPreloader/'); | ||
$class = __NAMESPACE__ . '\\' | ||
. substr(str_replace('/', '\\', substr($filename, $pos)), 0, -4); | ||
$this->add(new $class()); | ||
} | ||
} | ||
} |
87 changes: 87 additions & 0 deletions
87
uwamp/www/laravel/vendor/classpreloader/classpreloader/src/ClassPreloader/ClassList.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
<?php | ||
|
||
namespace ClassPreloader; | ||
|
||
/** | ||
* Maintains a list of classes using a sort of doubly-linked list | ||
*/ | ||
class ClassList | ||
{ | ||
/** | ||
* @var ClassNode The head node of the list | ||
*/ | ||
protected $head; | ||
|
||
/** | ||
* @var ClassNode The current node of the list | ||
*/ | ||
protected $current; | ||
|
||
public function __construct() | ||
{ | ||
$this->clear(); | ||
} | ||
|
||
/** | ||
* Clear the contents of the list and reset the head node and current node | ||
*/ | ||
public function clear() | ||
{ | ||
$this->head = new ClassNode(null); | ||
$this->current = $this->head; | ||
} | ||
|
||
/** | ||
* Traverse to the next node in the list | ||
*/ | ||
public function next() | ||
{ | ||
if (isset($this->current->next)) { | ||
$this->current = $this->current->next; | ||
} else { | ||
$this->current->next = new ClassNode(null, $this->current); | ||
$this->current = $this->current->next; | ||
} | ||
} | ||
|
||
/** | ||
* Insert a value at the current position in the list. Any currently set | ||
* value at this position will be pushed back in the list after the new | ||
* value | ||
* | ||
* @param mixed $value Value to insert | ||
*/ | ||
public function push($value) | ||
{ | ||
if (!$this->current->value) { | ||
$this->current->value = $value; | ||
} else { | ||
$temp = $this->current; | ||
$this->current = new ClassNode($value, $temp->prev); | ||
$this->current->next = $temp; | ||
$temp->prev = $this->current; | ||
if ($temp === $this->head) { | ||
$this->head = $this->current; | ||
} else { | ||
$this->current->prev->next = $this->current; | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* Traverse the ClassList and return a list of classes | ||
* | ||
* @return array | ||
*/ | ||
public function getClasses() | ||
{ | ||
$classes = array(); | ||
$current = $this->head; | ||
while ($current && $current->value) { | ||
$classes[] = $current->value; | ||
$current = $current->next; | ||
} | ||
|
||
return array_filter($classes); | ||
} | ||
} |
Oops, something went wrong.