CakePHP adding tables to ACL controlled application - php

Sorry if this is a noob question, I'm using the Simple ACL Controlled Application tutorial as a boilerplate and need to add (bake) a few more tables. If I create a new table then run "cake bake all" from the console, how would I go about updating the ACL as well, I believe I should only need to update the acos table, could be wrong? Is there a command I should use after the new models, views and controllers are generated?
Thanks in advance!
EDIT : I'm using the AclExtras plugin to to input all of my controllers and actions into the Acl.

To sync up your ACO using AclExtras, you would run something like this at the command line:
php "/cake/lib/Cake/Console/cake.php" AclExtras.AclExtras aco_sync

Related

How to create a mysql database and tables dynamically using symfony and doctrine

I am working on building an application which would be used to create new child applications which have their own databases.
I know we can use doctrine bundle to create tables from entity classes in symfony. I would like to know if there is a way to create a new database and some tables within the database programmatically or dynamically.
I know we can use php app/console doctrine:generate:database from the composer prompt, but i would like to do this from a class or a controller action.
Do let me know if there is a way possible.
You can either call exec() and drop the command in there or the better way, would be to follow the docs in symfony for calling console commands in a controller.
http://symfony.com/doc/current/cookbook/console/command_in_controller.html

OctoberCMS Migrate Table

I am very new to octobercms and I have experience in using laravel 4.2 .
I wanna ask how to create a table using artisan in cmd? Or is it in octobercms does not need to use cmd to create table? Any link with details tutorial to share?
Thank you.
First, you need to create a plugin : php artisan create:plugin MyCompagny.MyPlugin
Then, you can create a model (table) : php artisan create:model MyCompagny.MyPlugin Nameofthemodel
Then you can edit the migration file to fit your need, and run php artisan plugin:refresh MyCompagny.MyPlugin
Note that OctoberCMS is based on Laravel 5.0
That's it! Hope its help
Though the above answer is correct, another solution for creating tables would be using Rainlab.Builder plugin, which has its own user interface to easily create tables, Models, Controllers and many more )

Workflow migrations phalcon

Time ago I worked with yii framework.
In yii framework with yiic shell I make migration file and write actions for db: create table, alter table, create index and any actions with another (no db).
But in phalcon I don't see this. Yeah, I know about migrations, but what is it?
I make migration for my db with one table;
If I have empty db and use "phalcon migration run" then I have "table %name_table% don't exists"
And how I can use this for normal migrations?
And where phalcon save information about used migrations? Or every time start from 1.0.0 migration?
If you are using DevTools 3.1.2, run the following command to learn more about migration options in Phalcon 3
phalcon migration --help
Hope it helps
I think you need to dump one first - phalcon gen-migration
Try reading the full page and watching the tutorial video for them - http://docs.phalconphp.com/en/latest/reference/migrations.html

Acl in CakePHP - Removing this functionality

I built a project with Acl enabled - I used the CakePHP tutorial on their website to do this.
However, the project no longer needs this functionality.
I've removed all reference of Acl and Aco in my controllers, models and views (if fact I did the tutorial in reverse to remove everything) and I then deleted the three database tables that were generated in this process.
However, I still get the error:
Error: Database table acos for model Aco was not found.
On all of my controllers.
Did the acl baking process add some files I don't know about? How do I get rid of this functionality?
Try emptying your app/tmp/cache. Model relations may be caches there. After that, grep through your app directory for references to Aco and Aro. You may have missed one.
Edit: Also, make sure that your Auth component does not set Auth->authorize to actions (which uses ACL) but something else appropriate. See Auth::authorize in the CakePHP manual.

Codeigniter with Doctrine for large application

I am about to start a project on PHP and selected Codeigniter as a framework to be used after receiving lot of plus comments from Codeigniter-users ;-)
I am not much clear about which ORM to be used with codeigniter. I was advised to use Doctrine. Is there any tool available for codeigniter to create models and db mapping with Doctrine on command line?
You can use Doctrine itself for creating models. Follow the cookbook
http://www.doctrine-project.org/projects/orm/1.2/docs/cookbook/code-igniter-and-doctrine/en
to setup, so then in /application/ you can use
$ ./doctrine [command]
to create models and mappings.
Note: in this moment I'm failing to access any page at the doctrine-project.org site. May be later...

Categories