Skip to content

Instantly share code, notes, and snippets.

@pmjones
Last active January 1, 2016 01:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pmjones/8074310 to your computer and use it in GitHub Desktop.
Save pmjones/8074310 to your computer and use it in GitHub Desktop.
removed trait and interface from class count
SILEX="silex-1.1.2"
AURA="Aura.Web_Project"
rm -rf $SILEX
rm -rf $AURA
echo ""
echo "=================================================="
echo "Install Silex 1.1.2 and remove tests"
echo "=================================================="
echo ""
mkdir $SILEX
cd $SILEX
echo '{
"require": {
"silex/silex": "1.1.2"
}
}' > composer.json
composer install
mkdir web
echo "<?php
\$classes_before = get_declared_classes();
require_once __DIR__.'/../vendor/autoload.php';
\$app = new Silex\Application();
\$app->get('/', function() {
return 'Hello Silex!';
});
\$app->run();
echo PHP_EOL;
var_export(array_values(array_diff(get_declared_classes(), \$classes_before)));
echo PHP_EOL;
" > web/index.php
cd ..
rm -rf $SILEX/vendor/pimple/pimple/tests
rm -rf $SILEX/vendor/silex/silex/tests
rm -rf $SILEX/vendor/symfony/debug/Symfony/Component/Debug/Tests
rm -rf $SILEX/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests
rm -rf $SILEX/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests
rm -rf $SILEX/vendor/symfony/routing/Symfony/Component/Routing/Tests
echo ""
echo "=================================================="
echo "Install Aura.Web_Project and remove tests"
echo "=================================================="
echo ""
composer create-project --prefer-dist --stability=dev aura/web-project $AURA
echo "<?php
\$classes_before = get_declared_classes();
require dirname(__DIR__) . '/vendor/aura/web-kernel/scripts/kernel.php';
echo PHP_EOL;
var_export(array_values(array_diff(get_declared_classes(), \$classes_before)));
echo PHP_EOL;
" > $AURA/web/index.php
rm -rf $AURA/vendor/aura/di/tests
rm -rf $AURA/vendor/aura/dispatcher/tests
rm -rf $AURA/vendor/aura/includer/tests
rm -rf $AURA/vendor/aura/project-kernel/tests
rm -rf $AURA/vendor/aura/router/tests
rm -rf $AURA/vendor/aura/web/tests
rm -rf $AURA/vendor/aura/web-kernel/tests
rm -rf $AURA/vendor/monolog/monolog/tests
echo ""
echo "=================================================="
echo "du: silex in total"
echo "=================================================="
echo ""
du -d 0 -h $SILEX
echo ""
echo "=================================================="
echo "du: aura in total"
echo "=================================================="
echo ""
du -d 0 -h $AURA
echo ""
echo "=================================================="
echo "cloc: silex in total"
echo "=================================================="
echo ""
cloc $SILEX
echo ""
echo "=================================================="
echo "cloc: aura in total"
echo "=================================================="
echo ""
cloc $AURA
echo ""
echo "=================================================="
echo "class count: silex in total"
echo "=================================================="
echo ""
grep -r --include="*.php" -e "^\(class\|abstract class\)" $SILEX | wc -l
echo ""
echo "=================================================="
echo "class count: aura in total"
echo "=================================================="
echo ""
grep -r --include="*.php" -e "^\(class\|abstract class\)" $AURA | wc -l
echo ""
echo "=================================================="
echo "class count: silex actually used"
echo "=================================================="
echo ""
php -S localhost:8000 -t $SILEX/web/ &
sleep 1
pid=$!
curl http://localhost:8000/
kill $pid
sleep 1
echo ""
echo ""
echo "=================================================="
echo "class count: aura actually used"
echo "=================================================="
echo ""
php -S localhost:8000 -t $AURA/web/ &
sleep 1
pid=$!
curl http://localhost:8000/
kill $pid
sleep 1
echo ""
echo ""
echo "=================================================="
echo "cloc: silex actually used"
echo "=================================================="
echo ""
cloc \
$SILEX/vendor/composer/autoload_real.php \
$SILEX/vendor/composer/ClassLoader.php \
$SILEX/vendor/pimple/pimple/lib/Pimple.php \
$SILEX/vendor/silex/silex/src/Silex/Application.php \
$SILEX/vendor/silex/silex/src/Silex/Controller.php \
$SILEX/vendor/silex/silex/src/Silex/ControllerCollection.php \
$SILEX/vendor/silex/silex/src/Silex/ControllerResolver.php \
$SILEX/vendor/silex/silex/src/Silex/EventListener/ConverterListener.php \
$SILEX/vendor/silex/silex/src/Silex/EventListener/LocaleListener.php \
$SILEX/vendor/silex/silex/src/Silex/EventListener/MiddlewareListener.php \
$SILEX/vendor/silex/silex/src/Silex/EventListener/StringToResponseListener.php \
$SILEX/vendor/silex/silex/src/Silex/ExceptionHandler.php \
$SILEX/vendor/silex/silex/src/Silex/LazyUrlMatcher.php \
$SILEX/vendor/silex/silex/src/Silex/RedirectableUrlMatcher.php \
$SILEX/vendor/silex/silex/src/Silex/Route.php \
$SILEX/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Event.php \
$SILEX/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php \
$SILEX/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/FileBag.php \
$SILEX/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/HeaderBag.php \
$SILEX/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ParameterBag.php \
$SILEX/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Request.php \
$SILEX/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/RequestStack.php \
$SILEX/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Response.php \
$SILEX/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ResponseHeaderBag.php \
$SILEX/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ServerBag.php \
$SILEX/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/ControllerResolver.php \
$SILEX/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/FilterControllerEvent.php \
$SILEX/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/FilterResponseEvent.php \
$SILEX/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/FinishRequestEvent.php \
$SILEX/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/GetResponseEvent.php \
$SILEX/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/GetResponseForControllerResultEvent.php \
$SILEX/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/KernelEvent.php \
$SILEX/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/PostResponseEvent.php \
$SILEX/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/LocaleListener.php \
$SILEX/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ResponseListener.php \
$SILEX/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/RouterListener.php \
$SILEX/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernel.php \
$SILEX/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/KernelEvents.php \
$SILEX/vendor/symfony/routing/Symfony/Component/Routing/CompiledRoute.php \
$SILEX/vendor/symfony/routing/Symfony/Component/Routing/Matcher/RedirectableUrlMatcher.php \
$SILEX/vendor/symfony/routing/Symfony/Component/Routing/Matcher/UrlMatcher.php \
$SILEX/vendor/symfony/routing/Symfony/Component/Routing/RequestContext.php \
$SILEX/vendor/symfony/routing/Symfony/Component/Routing/Route.php \
$SILEX/vendor/symfony/routing/Symfony/Component/Routing/RouteCollection.php \
$SILEX/vendor/symfony/routing/Symfony/Component/Routing/RouteCompiler.php \
echo ""
echo "=================================================="
echo "cloc: aura actually used"
echo "=================================================="
echo ""
cloc \
$AURA/vendor/aura/di/src/Config.php \
$AURA/vendor/aura/di/src/Container.php \
$AURA/vendor/aura/di/src/Factory.php \
$AURA/vendor/aura/di/src/LazyGet.php \
$AURA/vendor/aura/di/src/LazyNew.php \
$AURA/vendor/aura/dispatcher/src/Dispatcher.php \
$AURA/vendor/aura/includer/src/Includer.php \
$AURA/vendor/aura/project-kernel/src/Project.php \
$AURA/vendor/aura/project-kernel/src/ProjectKernel.php \
$AURA/vendor/aura/project-kernel/src/ProjectKernelFactory.php \
$AURA/vendor/aura/router/src/AbstractSpec.php \
$AURA/vendor/aura/router/src/Route.php \
$AURA/vendor/aura/router/src/RouteCollection.php \
$AURA/vendor/aura/router/src/RouteFactory.php \
$AURA/vendor/aura/router/src/Router.php \
$AURA/vendor/aura/web/src/Request.php \
$AURA/vendor/aura/web/src/Request/Accept.php \
$AURA/vendor/aura/web/src/Request/Accept/AbstractValues.php \
$AURA/vendor/aura/web/src/Request/Accept/Charset.php \
$AURA/vendor/aura/web/src/Request/Accept/Encoding.php \
$AURA/vendor/aura/web/src/Request/Accept/Language.php \
$AURA/vendor/aura/web/src/Request/Accept/Media.php \
$AURA/vendor/aura/web/src/Request/Accept/Value/AbstractValue.php \
$AURA/vendor/aura/web/src/Request/Accept/Value/Encoding.php \
$AURA/vendor/aura/web/src/Request/Accept/Value/Language.php \
$AURA/vendor/aura/web/src/Request/Accept/Value/Media.php \
$AURA/vendor/aura/web/src/Request/Accept/Value/ValueFactory.php \
$AURA/vendor/aura/web/src/Request/Client.php \
$AURA/vendor/aura/web/src/Request/Content.php \
$AURA/vendor/aura/web/src/Request/Files.php \
$AURA/vendor/aura/web/src/Request/Globals.php \
$AURA/vendor/aura/web/src/Request/Headers.php \
$AURA/vendor/aura/web/src/Request/Method.php \
$AURA/vendor/aura/web/src/Request/Params.php \
$AURA/vendor/aura/web/src/Request/Url.php \
$AURA/vendor/aura/web/src/Request/Values.php \
$AURA/vendor/aura/web/src/Response.php \
$AURA/vendor/aura/web/src/Response/Cache.php \
$AURA/vendor/aura/web/src/Response/Content.php \
$AURA/vendor/aura/web/src/Response/Cookies.php \
$AURA/vendor/aura/web/src/Response/Headers.php \
$AURA/vendor/aura/web/src/Response/Redirect.php \
$AURA/vendor/aura/web/src/Response/Status.php \
$AURA/vendor/aura/web-kernel/src/WebKernel.php \
$AURA/vendor/aura/web-kernel/src/WebKernelDispatcher.php \
$AURA/vendor/aura/web-kernel/src/WebKernelResponder.php \
$AURA/vendor/aura/web-kernel/src/WebKernelRouter.php \
$AURA/vendor/composer/autoload_real.php \
$AURA/vendor/composer/ClassLoader.php \
$AURA/vendor/monolog/monolog/src/Monolog/Logger.php \
$AURA/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php \
$AURA/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php \
$AURA/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php \
echo ""
echo "Done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment