I've found a really nice looking calender, called CakeCalender that I want to install onto my site, it uses CakePHP http://cakephp.org/ . I am having a problem setting this up and was wondering if anyone has used Cake before and if possible they would have a spare couple of minutes to help me install it correctly. I'vefollowed the instructions in the manual and it doesn't seem to work at all.
Ok I've gone through and re-uploaded the directories to the server and I get the following messages
When I try and run Cake I get
Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/usr/share/php/cake/libs/view/templates/errors/home.ctp) is not within the allowed path(s): (/tmp/:/var/tmp/:/var/www/errors/:/home/vol3/myplace.us/daveclissold/daveclissold.com/htdocs) in /home/vol3/myplace.us/daveclissold/daveclissold.com/htdocs/cake/cake/basics.php on line 1440
and when I try and run cakecalendar
Warning: require(cake/bootstrap.php) [function.require]: failed to open stream: No such file or directory in /home/vol3/myplace.us/daveclissold/daveclissold.com/htdocs/cakecalendar/webroot/index.php on line 78
Ok in /cake/app/sql/ you should find the file cakecalendar.sql. Your host probably has some way to use phpmyadmin via whatever control panel you use yes? Go into phpmyadmin and on the left pick the database you made for cakecalendar. Choose the SQL tab in the right hand pane. Now copy the contents of the file cakecalendar.sql to the textbox (Run SQL query/queries...) and click Go.
One thing to note: It's for the best that this database isnt shared with other apps you may be using.
If you get an error message about syntax then just change all these:
ENGINE=MyISAM DEFAULT CHARSET=latin1;
to this:
ENGINE=MyISAM;
and repeat the copy/paste again.
Now add this function to /cake/app/controllers/users_controller.php
[PHP]function addUser() {
$query = "INSERT INTO `users` ( `id` , `username` , `password` )
VALUES (
NULL , 'myName', 'myPass'
)";
$result = $this->User->query($query);
if(mysql_error()) {
die(mysql_error());
} else {
die('User successfully added.');
}
}
[/PHP] You should comment this function out once you have added your user.
Now the users controller doesn't use any hashing and it probably should xD. So if you are concerned then do the following before you add the user
On line 21, change this:
if(!empty($someone['User']['password']) && $someone['User']['password'] == $this->data['User']['password'])
to this:
if(!empty($someone['User']['password']) && $someone['User']['password'] == sha1($this->data['User']['password']))
then in the addUser function change:
NULL , 'myName', 'myPass'
to:
NULL , 'myName', '".sha1(myPass)."'
Ok I've done all that. I have had to edit a lot ofpaths that have been incorrect but now I've come across one that I can't edit. The error message is
Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/cake/app/tmp/cache/persistent/class.paths.php) is not within the allowed path(s): (/tmp/:/var/tmp/:/var/www/errors/:/home/vol3/myplace.us/daveclissold/daveclissold.com/htdocs) in /home/vol3/myplace.us/daveclissold/daveclissold.com/htdocs/cake/cake/basics.php on line 1056
however line 1056 reads
if(file_exists($filename)) {
and I'm not sure as to what this is referencing as class.paths.php is in the directory that it is pointing to.
That is a warning, it doesnt necessarily mean the app is broken. As long as you are not in debug mode you won't see that. So edit /cake/app/config/core.php and change:
define('DEBUG', 2); or define('DEBUG', 1);
to:
define('DEBUG', 0);
If you uploaded the calendar app it probably overwrote core.php file and set it back into debug mode.
Actually, which directory do you want the calendar installed in? I figured out that you are now trying to install it in /cakecalendar/ so you need to ditch the /cake/ directory cause it will only cause confusion.
Now make sure you edit /cakecalendar/app/config/bootstrap.php and add the following:
$modelPaths = array('/home/vol3/myplace.us/daveclissold/daveclissold.com/htdocs/cakecalendar/app/models');
Then make sure that /cakecalendar/app/config/database.php has the correct info.
Then make sure that /cakecalendar/app/config/core.php has
define(DEBUG, 0);
Just so we are clear. The calendar and cake should be in the same directory (/cakecalendar/), so the dir structure should be like so
I have re-installed everything as per your instructions and am still getting this warning on line 1056.
However when I run it using jake in joomla it sort of works I'm not able to create an admin user section or change the month, but its a start. However I really do not like joomla its a pre-installed CMS on my server so thought I'd test it there.