[EXTENSION] phundament Phundament 3: Yii CMS based upon independent modules and extensions
#1
Posted 13 October 2011 - 08:21 PM
The combination of p3widgets and p3media provides basic content management system (CMS) features, like dynamic widget creation and file management.
Combined in ckeditor, p3media acts as a ckfinder plugin which gives you the full power of HTML and media files for content creation via p3widgets.
It comes with a very minimalistic setup which integrates perfectly into an Yii web application skeletion and installs with one single command.
Extension Page (Download, Installation, ...)
Fork on github
Follow phundament on Twitter
DevSystem: Mac OS X 10.7 - PHP 5.3 - Apache2 - Yii 1.1 / trunk - Firefox or Safari
#2
Posted 20 October 2011 - 02:34 AM
Quote
Once the application running I'm having now routes troubles:
- rights: only assignment controller and its actions can be resolved, authItem controller and all its actions give a "404 not found" error
- yii-user: same problem with the profileField controller and its actions
- p3media: same problem with the p3Media controller - gii: same problem with "fullCrud" and "fullModel"
and finally: also in gii: portlet generator give me an exception: "PortletGenerator.widgets.ddeditor.DDEditor is invalid" (in protected/extensions/gtc/portlet/views/__comment.php line (9))
More informations:
- linux dev box with php 5.3.2, mysql 5.1.41 , apache 2.2.14 , yii 1.1.8
- I have had to comment all the stuff related to foreign keys in the migration files to be able to install the application
Let's go !
#3
Posted 20 October 2011 - 04:36 AM
I am a bit confused ... the demo page runs also on Linux, with almost the same setup as yours?!
Which download did you grab, the one from Yii extensions?
Please post the non-working URLs here, starting from index.php or your webapp folder.
For debugging ... can you try to set in config/main urlManager:
'urlFormat' => 'get',
and see if this makes any difference.
Were the tables created as MyISAM instead of InnoDB?
When we've fixed this, we'll move on to the gii stuff.
Thanks,
schmunk
Fork on github
Follow phundament on Twitter
DevSystem: Mac OS X 10.7 - PHP 5.3 - Apache2 - Yii 1.1 / trunk - Firefox or Safari
#4
Posted 20 October 2011 - 09:25 AM
Well, do not panic too much ;-)
I've installed the same phundament distribution (the one from the yiiframework/extensions/phundament page) on an another computer (with almost the same configuration) and, except the troubles with migrations, application works well.
Non working urls:
- /rights/authItem/permissions
- /rights/authItem/roles
- /rights/authItem/tasks
- /rights/authItem/operations
- /user/profileField/admin
- /user/profileField/view/1
- /user/profileField/update/1
- /p3media/p3Media/admin
- /p3media/p3Media/6
- /gii/fullCrud
- /gii/fullModel
weblog messages always showing: "Loading "XXX" module" with XXX= p3media, gii, rights or user and after that, throw a Http 404 exception.
Also:
- Alias "CommandGenerator.widgets.ddeditor.DDEditor" is invalid while calling /gii/command
- Alias "PortletGenerator.widgets.ddeditor.DDEditor" is invalid while calling /gii/portlet
Changing urlFormat from "path" to "get" give same error with for example: ?r=rights/authItem/permissions
Database tables:
some of them were created as MySam (the four "migration_module_XXX", "p3widget", the three "usr_XXX" user related tables) and other as InnoDb (the four tables for rights module, "p3_media", "p3_media_meta")
Let's go !
#5
Posted 20 October 2011 - 11:07 AM
a fresh new install is working fine (except, database migrations and errors while calling portletgenerator and commandgenerator).
Why ? I don't know yet.
Thank you for great job.
Luc
Let's go !
#6
Posted 20 October 2011 - 11:21 AM
So p3media, user, rights, ... is working fine?
Can you post the shell output when running migrations?
And portletgenerator and commandgenerator are the ones from gii (gtc)?
Fork on github
Follow phundament on Twitter
DevSystem: Mac OS X 10.7 - PHP 5.3 - Apache2 - Yii 1.1 / trunk - Firefox or Safari
#7
Posted 20 October 2011 - 05:10 PM
https://github.com/s...3admin/issues/1
Something is going wrong with the foreign keys, but I can't tell it yet.
Fork on github
Follow phundament on Twitter
DevSystem: Mac OS X 10.7 - PHP 5.3 - Apache2 - Yii 1.1 / trunk - Firefox or Safari
#8
Posted 20 October 2011 - 05:19 PM
$this->addForeignKey('fk_authitem_parent', 'AuthItemChild', 'parent', 'authitem', 'name', null, null);$this->addForeignKey('fk_authitem_parent', 'AuthItemChild', 'parent', 'authItem', 'name', null, null);in /protected/modules/p3media/migrations/m110719_000000_init.php
But since you're having also problems with p3_media this does not really make sense.
Fork on github
Follow phundament on Twitter
DevSystem: Mac OS X 10.7 - PHP 5.3 - Apache2 - Yii 1.1 / trunk - Firefox or Safari
#9
Posted 21 October 2011 - 03:46 AM
schmunk, on 20 October 2011 - 11:21 AM, said:
So p3media, user, rights, ... is working fine?
Can you post the shell output when running migrations?
And portletgenerator and commandgenerator are the ones from gii (gtc)?
./yiic migrate --migrationPath=application.modules.p3admin.modules-install.rights.migrations --migrationTable=migration_module_rights --interactive=1
gives:
applying m110402_195159_init
> create table AuthAssignment ... done (time: 0.159s)
> create table AuthItem ... done (time: 0.092s)
> create table AuthItemChild ... done (time: 0.085s)
> create table Rights ... done (time: 0.084s)
> add foreign key fk_authitem_parent: AuthItemChild (parent) references authitem (name) ...exception 'CDbException' with message 'CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 1005 Can't create table 'yii_p3.#sql-4d6_36c' (errno: 150). The SQL statement executed was: ALTER TABLE `AuthItemChild` ADD CONSTRAINT `fk_authitem_parent` FOREIGN KEY (`parent`) REFERENCES `authitem` (`name`)' in /var/www/yii/yii-1.1.8.r3324/framework/db/CDbCommand.php:336
Migration for p3item is not applied.
./yiic migrate --migrationPath=application.modules.p3media.migrations --migrationTable=migration_module_p3media --interactive=1
return no error
gtc command generator:
Alias "CommandGenerator.widgets.ddeditor.DDEditor" is invalid. Make sure it points to an existing PHP file.
error comes from file: protected/extensions/gtc/command/views/__comment.php
Hope it helps !
Cheers.
Let's go !
#10
Posted 21 October 2011 - 07:34 AM
I'll check it out Real Soon Now - but take a look at this in the mean time:
http://stackboxcms.com/
It looks very familar, no?
#11
Posted 21 October 2011 - 07:38 AM
Fork on github
Follow phundament on Twitter
DevSystem: Mac OS X 10.7 - PHP 5.3 - Apache2 - Yii 1.1 / trunk - Firefox or Safari
#12
Posted 21 October 2011 - 08:26 AM
Especially the P3 widgets.
#13
Posted 21 October 2011 - 11:35 AM
But I'll will keep this in mind.
I've also added the automatic property detection for all widgets, see screenshots.
Fork on github
Follow phundament on Twitter
DevSystem: Mac OS X 10.7 - PHP 5.3 - Apache2 - Yii 1.1 / trunk - Firefox or Safari
#14
Posted 25 October 2011 - 07:39 PM
Fork on github
Follow phundament on Twitter
DevSystem: Mac OS X 10.7 - PHP 5.3 - Apache2 - Yii 1.1 / trunk - Firefox or Safari
#15
Posted 19 November 2011 - 05:39 AM
I just downloaded and tried to make phundament3 run. But I have some issues with the image uploader.
When i open the "upload" Page, the console error I get is:
Uncaught TypeError: Object [object Object] has no method 'prop' jQuery.extend._Deferred.deferred.resolveWithjquery.js:869 jQuery.extend.readyjquery.js:420 DOMContentLoadedjquery.js:1055
The problem seems to be with the "prop" function call
$.getJSON($('#fileupload form').prop('action'), function (files) {in the file "protected/extensions/p3extensions/widgets/jquery-file-upload/init.js".
Also when dropping a file in the browser a new error shows up ... also not knowing what to do with the function "prop".
Uncaught TypeError: Object [object Object] has no method 'prop' $.widget._loadImagejquery.fileupload-ui.js:284 $.widget._renderUploadjquery.fileupload-ui.js:420 jQuery.extend.eachjquery.js:639 jQuery.fn.jQuery.eachjquery.js:263 $.widget._renderUploadjquery.fileupload-ui.js:419 $.widget.options.addjquery.fileupload-ui.js:67 b.Widget._triggerjquery-ui.min.js:23 $.widget._onAddjquery.fileupload.js:568 jQuery.extend.eachjquery.js:639 $.widget._onAddjquery.fileupload.js:562 $.widget._onDropjquery.fileupload.js:637 jQuery.event.handlejquery.js:2562 jQuery.event.add.elemData.handle.eventHandle
My OS is Windows 7 ... maybe that could be the problem? During the installation everything seemed to be fine. - no errors.
... In your demo the image uploader works fine by the way.
#16
Posted 19 November 2011 - 07:47 AM
Looks like an outdated jQuery version, did you try to run phundament with Yii 1.1.8?
Also, I am currently making some includes from CDNs here, so this won't work offline yet.
Fork on github
Follow phundament on Twitter
DevSystem: Mac OS X 10.7 - PHP 5.3 - Apache2 - Yii 1.1 / trunk - Firefox or Safari
#17
Posted 19 November 2011 - 10:33 AM
Now the drag & drop seems to work, but a new error appears after pushing the "upload" button (in the column to the right of the file size)
In Chrome:
Error: SyntaxError: Unexpected token <
In Firefox:
Error: SyntaxError: JSON.parse: unexpected non-whitespace character after JSON data
The answer of the Server looks like this:
[{"name":"54th.jpg","size":42017,"type":"image\/jpeg","url":"\/test-phundament\/p3media\/p3Media\/update?preset=raw&path=1%2F54th.jpg","thumbnail_url":"\/test-phundament\/p3media\/file\/image?preset=thumb&path=1%252F54th.jpg","delete_url":"\/test-phundament\/p3media\/import\/uploadFile?path=1%2F?file=54th.jpg","delete_type":"DELETE"}]<br />
<font size='1'><table class='xdebug-error' dir='ltr' border='1' cellspacing='0' cellpadding='1'>
<tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Fatal error: Call to undefined function mime_content_type() in C:\xampp\htdocs\test-phundament\protected\modules\p3media\controllers\ImportController.php on line <i>231</i></th></tr>
.
.
.
#18
Posted 19 November 2011 - 11:40 AM
<?php
if (!function_exists('mime_content_type ')) {
function mime_content_type($filename) {
$finfo = finfo_open(FILEINFO_MIME);
$mimetype = finfo_file($finfo, $filename);
finfo_close($finfo);
return $mimetype;
}
}
?>
Fork on github
Follow phundament on Twitter
DevSystem: Mac OS X 10.7 - PHP 5.3 - Apache2 - Yii 1.1 / trunk - Firefox or Safari
#19
Posted 06 March 2012 - 04:32 AM
First of all I want to say what a good work you do, making a base for a CMS. It looks very nice!
I am very new at all of this; php, yii, phundament, .. Hopefully my question will not sound too stupido and you can help me in the right direction. This is my first post here at the yii forum.
After installation of P3 I get an "error 500 Yiic command not found (./yiic)" clicking the Manage-link (h++p://localhost/phundament/p3admin/module?module=p3widgets)on the "Phundament 3 administration"-page. In fact the only Manage-link that doesn't give me this error are the first (h++p://localhost/phundament/p3admin/module?module=p3admin) and the last one (h++p://localhost/phundament/p3admin/module?module=gii).
Is this the way it supposed to be or is this not right? Some help here will be apriciated very much.
Setup:
- Win7
- apache
- PHP 5.3
- MySQL
The steps I took:
1. extracted framework directory of yii-1.1.10 in same root folder as where phundament will be placed (htdocs/phundament)
2. extracted phundament3 in htdocs/phundament
3. setup MySQL database for p3
4. commandline in Aptana: phundament/protected/setup-p3.sh phundament/framework/yiic
5. step1 runs, no problems, webapp is made in htdocs/phundament
6. before step 2 (db migration) I configure the protected/config/main.php file to use the MySQL database.
7. run step 2 by typing 'y' at the commandline, migration runs fine
8. run step 3 ... , no problems!
9. open webpage in browser, looks fine and most of all works also fine.
#20
Posted 06 March 2012 - 05:55 PM
tbl_authItem
//then I think the rest doesnt matter.
This is because authAssignment and others tries to put foreign keys to authItem. And if authItem doesnt exist... well there u have your error.
Re arrange the order the tables are written in the .sql file would solve this for everyone in the future:p

Help















