friendsofcake / app-template Goto Github PK
View Code? Open in Web Editor NEWCakePHP2: An empty application template, for use with composer
CakePHP2: An empty application template, for use with composer
cake.bat
and cake.php
behave differently.
I setup the app-template, connect to the DB, add CakeDC's Search plugin and execute its shell through
a) cake.bat
b) cake.php
As you can see below adding --working .
fixes the issue.
cake.bat
and the *nix shell script cake
both set the working path when calling cake.php
:
app-template/app/Console/cake.bat
Line 28 in 69f700e
Line 41 in 69f700e
D:\dev\xampp\htdocs>composer -sdev create-project friendsofcake/app-template app
-template
Installing friendsofcake/app-template (dev-master 69f700e7a2154510b08201e9a50a72
a095d9b223)
- Installing friendsofcake/app-template (dev-master master)
Cloning master
Created project in app-template
Loading composer repositories with package information
Installing dependencies (including require-dev)
- Installing composer/installers (dev-master 89d77bf)
Loading from cache
- Installing josegonzalez/dotenv (0.3.0)
Downloading: 100%
- Installing cakephp/cakephp (2.5.6)
Loading from cache
- Installing friendsofcake/crud (3.0.9)
Downloading: 100%
- Installing ad7six/dsn (0.3.1)
Downloading: 100%
- Installing cakephp/debug_kit (dev-master c911030)
Loading from cache
friendsofcake/crud suggests installing cakedc/search (If you want to use the Sea
rch Listener)
Writing lock file
Generating autoload files
Do you want to remove the existing VCS (.git, .svn..) history? [Y,n]? y
D:\dev\xampp\htdocs>cd app-template
D:\dev\xampp\htdocs\app-template>composer require cakedc/migrations:*
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing cakedc/migrations (dev-master 0d62dda)
Cloning 0d62dda64f4386fb29e68e3ba4d022aa90252aee
Writing lock file
Generating autoload files
D:\dev\xampp\htdocs\app-template>cd app
D:\dev\xampp\htdocs\app-template\app>console\cake.bat Migrations.migration statu
s
Cake Migration Shell
---------------------------------------------------------------
Migrations Plugin
Current version:
#003 003_increase_class_name_length
Latest version:
#003 003_increase_class_name_length
---------------------------------------------------------------
D:\dev\xampp\htdocs\app-template\app>php console\cake.php Migrations.migration s
tatus
Error: Plugin Migrations could not be found.
#0 D:\dev\xampp\htdocs\app-template\vendor\cakephp\cakephp\lib\Cake\Core\App.php
(227): CakePlugin::path('Migrations')
#1 D:\dev\xampp\htdocs\app-template\vendor\cakephp\cakephp\lib\Cake\Core\App.php
(549): App::path('Console/Command', 'Migrations')
#2 [internal function]: App::load('MigrationShell')
#3 [internal function]: spl_autoload_call('MigrationShell')
#4 D:\dev\xampp\htdocs\app-template\vendor\cakephp\cakephp\lib\Cake\Console\Shel
lDispatcher.php(249): class_exists('MigrationShell')
#5 D:\dev\xampp\htdocs\app-template\vendor\cakephp\cakephp\lib\Cake\Console\Shel
lDispatcher.php(200): ShellDispatcher->_getShell('Migrations.migr...')
#6 D:\dev\xampp\htdocs\app-template\vendor\cakephp\cakephp\lib\Cake\Console\Shel
lDispatcher.php(66): ShellDispatcher->dispatch()
#7 D:\dev\xampp\htdocs\app-template\app\Console\cake.php(40): ShellDispatcher::r
un(Array)
#8 {main}
D:\dev\xampp\htdocs\app-template\app>php console\cake.php Migrations.migration s
tatus --working .
Cake Migration Shell
---------------------------------------------------------------
Migrations Plugin
Current version:
#003 003_increase_class_name_length
Latest version:
#003 003_increase_class_name_length
---------------------------------------------------------------
D:\dev\xampp\htdocs\app-template\app>
This is unexpected because when using a vanilla CakePHP setup this is not needed:
C:\Users\marc.wuerth\Desktop\cakephp-master\app>console\cake.bat Migrations.migr
ation status
Cake Migration Shell
---------------------------------------------------------------
Migrations Plugin
Current version:
#003 003_increase_class_name_length
Latest version:
#003 003_increase_class_name_length
---------------------------------------------------------------
C:\Users\marc.wuerth\Desktop\cakephp-master\app>php console\cake.php Migrations.
migration status
Cake Migration Shell
---------------------------------------------------------------
Migrations Plugin
Current version:
#003 003_increase_class_name_length
Latest version:
#003 003_increase_class_name_length
---------------------------------------------------------------
C:\Users\marc.wuerth\Desktop\cakephp-master\app>console\cake.bat Migrations.migr
ation status --working .
Cake Migration Shell
---------------------------------------------------------------
Migrations Plugin
Current version:
#003 003_increase_class_name_length
Latest version:
#003 003_increase_class_name_length
---------------------------------------------------------------
C:\Users\marc.wuerth\Desktop\cakephp-master\app>php console\cake.php Migrations.
migration status --working .
Cake Migration Shell
---------------------------------------------------------------
Migrations Plugin
Current version:
#003 003_increase_class_name_length
Latest version:
#003 003_increase_class_name_length
---------------------------------------------------------------
WWW_ROOT should point to the correct webroot directory.
Using this template it returns:
/vagrant/app/app/webroot/
instead of
/vagrant/app/webroot/
Running a webtest does not work on this template. Even if phpunit is added with composer.
I just tried to setup the app-template without an Config/.env
file, which leads to errors in Config/bootstrap.php
https://github.com/FriendsOfCake/app-template/blob/master/app/Config/bootstrap.php#L38
Argument 1 passed to Hash::get() must be of the type array, boolean given, called in /.../app/Config/bootstrap.php on line 38 and defined [CORE/Cake/Utility/Hash.php, line 43]
Errors happens for lines: 38, 42, 43, 44, 45, 46
Errors is due to return value from parseUrlFromEnv
https://github.com/FriendsOfCake/app-template/blob/master/app/Config/core.php#L52
We already have travis for plugins, why not for the app-template?
We definitely want to keep the same features the app-template has - maybe even expand it if necessary - so filing this bug such that we don't forget.
We should also pull in whatever changes are necessary from the cakephp/app repo.
I used the installation instructions here: #13 (comment)
I created my own cakephp app GitHub repo to use this.
When I attempted to git remote add origin git://mygithubrepo
I could not.
I checked the list of remote, I get the following:
My question is: should I remove the remote for origin and have it point to MY github repo?
Just generated a new cake3 app using app-template and the nginx error produces the following error:
2014/11/03 19:06:53 [error] 2792#0: *5 FastCGI sent in stderr: "PHP message: PHP Warning: require(/home/vagrant/Apps/cake3/vendor/cakephp/cakephp/src/bootstrap.php): failed to open stream: No such file or directory in /home/vagrant/Apps/cake3/App/Config/bootstrap.php on line 50
I am no expert but it might be looking in the wrong directory:
This would help promote the dir structure used in 3.0's app. What do you guys think?
The error on the home page: "URL rewriting is not properly configured on your server" shows up always after you change your CSS... should have some sort of note on home.ctp saying "If you've updated your css and your styles are applied, ignore this error"
Since e5ad977 the default app will fail to load, the added autoloader causes the CRUD plugin to not load properly. Adding this was discussed in #18.
Fatal error: Call to a member function addListener() on a non-object in app\Config\bootstrap.php on line 99
Call Stack
# Time Memory Function Location
1 0.0002 135088 {main}( ) ..\index.php:0
2 0.0131 991240 Dispatcher->dispatch( ) ..\index.php:110
3 0.0166 1172504 Dispatcher->_invoke( ) ..\Dispatcher.php:160
4 0.0170 1191144 Controller->startupProcess( ) ..\Dispatcher.php:182
5 0.0172 1198712 CakeEventManager->dispatch( ) ..\Controller.php:674
6 0.0172 1198712 CakeEventManager->dispatch( ) ..\CakeEventManager.php:233
7 0.0172 1198912 call_user_func ( ) ..\CakeEventManager.php:247
8 0.0172 1198928 Configure::{closure:C:\xampp\htdocs\CakePoser2\app\Config\bootstrap.php:89-100}( ) ..\CakeEventManager.php:247
9 0.0294 1473760 App::shutdown( ) ..\App.php:0
10 0.0306 1465752 App::_checkFatalError( ) ..\App.php:902
11 0.0306 1466616 call_user_func ( ) ..\App.php:929
12 0.0306 1466648 ErrorHandler::handleError( ) ..\App.php:929
13 0.0306 1467112 ErrorHandler::handleFatalError( ) ..\ErrorHandler.php:203
14 0.0312 1467992 call_user_func ( ) ..\ErrorHandler.php:252
15 0.0312 1468008 ErrorHandler::handleException( ) ..\ErrorHandler.php:252
16 0.0319 1473784 ExceptionRenderer->__construct( ) ..\ErrorHandler.php:119
17 0.0319 1473904 ExceptionRenderer->_getController( ) ..\ExceptionRenderer.php:92
18 0.0325 1517824 Controller->startupProcess( ) ..\ExceptionRenderer.php:154
19 0.0327 1525392 CakeEventManager->dispatch( ) ..\Controller.php:674
20 0.0327 1525392 CakeEventManager->dispatch( ) ..\CakeEventManager.php:233
21 0.0327 1525592 call_user_func ( ) ..\CakeEventManager.php:247
22 0.0327 1525608 Configure::{closure:app\Config\bootstrap.php:89-100}( ) ..\CakeEventManager.php:247
Unfortunately I don't have a fix for this right now, maybe some of the FoC developers has a better idea of what's going on. @ADmad ?
BTW, I also tried using CakePHP v2.4.3 by changing the composer.json and issuing a composer update
(still using PEAR), but this will give the same error. So the CakePHP 2.4.3 -> 2.4.4 update shouldn't be the problem.
:(
vagrant@precise64:/vagrant/app/app$ Console/cake test app Controller/AppController
-bash: Console/cake: Permission denied
vagrant@precise64:/vagrant/app/app$ ll Console/
total 12
drwxrwxrwx 1 vagrant vagrant 204 Feb 24 07:15 ./
drwxrwxrwx 1 vagrant vagrant 272 Feb 24 07:33 ../
-rw-rw-rw- 1 vagrant vagrant 1391 Feb 24 07:15 cake
-rw-rw-rw- 1 vagrant vagrant 1028 Feb 24 07:15 cake.bat
-rw-rw-rw- 1 vagrant vagrant 1348 Feb 24 07:15 cake.php
drwxrwxrwx 1 vagrant vagrant 102 Feb 24 07:15 Command/
I'd like to not use composer on my server - instead vendorizing the plugins and cake core - so ignoring those two directories seems like a pretty poor decision.
Would be nice if Readme file is more detailed. I had to do a composer update, after the create-project inorder for debugkit to get installed.
Just curious why this has been included. If this is more an app skeleton shouldn't it be the choice of the developer to include plugins?
Is there any reason the Schema folder is missing with all the files that should be there by default?
Include path in app/Console/cake.php
should reflect change in CakePHP-lib path after PEAR usage as per 956b63d.
I'll create a patch/PR tomorrow if not fixed yet by then (I've run out of time for today).
I've followed the bible on how to create a new app using composer. I enable redistogo and set environment variables as proposed.
The app gets up and running nicely on heroku when I'm running a single dyno. But when I try to scale the app (heroku ps:scale web=2) I get a lot of Internal Server Errors. Enabling debug mode and I found out that the error message is:
Fatal error: Uncaught exception 'CacheException' with message 'Cache engine default is not properly configured.' in /app/vendor/cakephp/cakephp/lib/Cake/Cache/Cache.php:181 Stack trace: #0 /app/vendor/cakephp/cakephp/lib/Cake/Cache/Cache.php(151): Cache::_buildEngine('default') #1 /app/app/Config/core.php(283): Cache::config('default', Array) #2 /app/vendor/cakephp/cakephp/lib/Cake/Core/Configure.php(72): include('/app/app/Config...') #3 /app/vendor/cakephp/cakephp/lib/Cake/bootstrap.php(175): Configure::bootstrap(true) #4 /app/webroot/index.php(101): include('/app/vendor/cak...') #5 {main} thrown in /app/vendor/cakephp/cakephp/lib/Cake/Cache/Cache.php on line 181
Scaling down to 1 dyno and the problem is gone. Any ideas on how to solve this?
UPDATE:
I ran a
debug(env('CACHE_URL'));
just before the call to Cache::config
I get the same result both when it works and when it fails. The connection string looks like this:
redis://redistogo:[email protected]:10290//?prefix=APP_NAME_&duration=DURATION
I don't know how to debug Cake core when running in Heroku production environment.
Update 2:
I've got the error in 2 different projects on 2 different Heroku deployments. I think @josegonzalez can reproduce it on http://pastebin.herokuapp.com/ since I've followed that tutorial.
Update 3:
I added
debug($_SERVER['DYNO']);
to see which dyno the app is running on.
Running with 2 Dynos, web.1 has 100% succes rate. web.2 mostly fails, but sometimes manage to return the page.
Running with 3 Dynos, web.1 still has 100% succes rate. web.2 fails more than before, web.3 has 100% fail rate.
This doesn't seem setup? If it is, please point it out to me, and if not, should we?
For reference, I am attempting to setup Opauth via composer and it's not being autoloaded :(
So I have a small issue. When running the command Console/cake
from within a vagrant installation will cause issues because the cake
binary is not executable[1].
As such, I'd like to include a cake
file in app
with the following contents:
#!/usr/bin/php -q
<?php
chdir(dirname(__FILE__));
include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Console' . DIRECTORY_SEPARATOR . 'cake.php';
This will allow us to do:
php cake
From within the app dir and have everything work[2]. Thoughts?
[1] See #36 for details.
[2] It will also prepend all output with #!/usr/bin/php -q
because we are including the existing cake.php
file. No real good way to avoid this without removing that from cake.php
, or extracting it somehow. Thoughts?
I got it working by setting the following in a Procfile
:
web: vendor/bin/heroku-php-apache2 webroot
Nginx didn't work, though there is no reason it shouldn't. Haven't had time to investigate thoroughly, so filing an issue to make sure this doesn't get lost.
I frequently have timeout issues when running composer install
within the vm for the cakephp repo - among others - as it's about 60mb at this point.
Calling composer install --prefer-dist
appears to work fine, though having this work OOB would be great. Thoughts?
Looks like the /tmp
folders are missing from the repo. Is this correct?
One of my biggest bug-bears is always having to create these folders in every project I bake.
I see from the composer.json
that the template is using 2.4.0-beta
which means the /tmp
should be created automatically?
This doesn't seem to be happening for me. Or was this feature introduced in 2.4.1
?
Would it be worth updating the template to use the latest stable? 2.4.2
I was thinking of having vagrant included somehow in app-template.
Would be nice to be able to do:
vagrant up --provision-with chef
or
vagrant up --provision-with ansible
Not sure if this is a smart thing to do, or in what way this could best be handled. Having the vagrant repos as separete is cleaner then including it in app-template.
Currently vagrant-x repos are installed with composer create, and will end up with /vagrant/app/app/webroot as docroot, which is also somewhat awkward. Ofcourse could move around the folders, but a simple 2 step setup would be nice to get started:
composer -sdev create-project friendsofcake/app-template ProjectName
cd ProjectName
vagrant up --provision-with ansible
I'd like to hear your thoughts about this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.