Opening CakePHP to edit with Dreamweaver? - php

just a quick question, I have just done some research and I can not find a complete solution to my problem. I am using Dreamweaver CC only because I have started working with Designers and its the edit program they use. They have no PHP knowledge and they use Dreamweaver to build all there Photoshop designs.
I have found a few sites about how to add .ctp files, but it (Dreamweaver) only lets me edit the .cpt files as PHP files and not view them. I am running the CakePHP site I am using for these tests within a VM (virtual machine) locally. But although I have setup this as a live sever and I view the controller, it just loads the missing AppController message?
So are there any way of getting Dreamweaver to load and view CakePHP completely? So my designers can edit / build their designs the way they want?
I am very stocked, CC is a very new version of Dreamweaver and yes they seem to have added, LESS and SASS support (last version I used, some time ago, was CS4) and it seems very good, nice syntax highlighter. But why don't they support frameworks, its not just CakePHP, but they seem not to support any PHP based framework? I think with the use of these frameworks, lack of support is stocking!!
I will also just as a side note, I may be building Drupal powered sites for them as well, any pointers on getting that to work in Dreamweaver to?
Many thanks
Glenn.

Your designers (in the best of luck) use some html dummy content to create css files that style it, based on a photoshop or other mockup.
You as a developer need to turn that html to a cake or any other framework template.
There's no automated way for this to be done as no tool can do the creative thinking a human mind can do. That's why dreamweaver doesn't do it. LESS and SASS are not programming languages per se, it's a way to script common CSS which is a different thing.
I believe you shouldn't be adopting to the tools your designers use and neither should they adopt the tools that help you, as much a house builder doesn't need to use a CAD to build on a blueprint created by an architect on a CAD, neither an architect needs to know how to operate machinery. You just need a common ground to talk to each other (the blueprint or HTML/CSS).
So don't force yourself to work on dreamweaver and neither force your designers to work on a code editor. Don't expect dreamweaver to (ever?) integrate a programming IDE as that would be too bloated for both developers and designers and without any true advantages to my opinion.

Related

Is there an MVC PHP framework designed for an packaged product?

The "Framework" question has been asked a bunch of times here but having read everything I can find, I can't find the answer to this question.
I'm creating everything from games, to CMS's, social applications, etc. I've used Zend and CodeUgnighter briefly, but when I deliver it, its going to have a bunch of unnecessary folders and it requires anyone who wants to modify my program to know the framework, and they've got a mountain to move if they want to update it to the latest version of the framework.
It just seems to me that frameworks were designed mostly for super large projects where its being designed for one customer, not a released program. It seems like all the big packaged php products out there make their own frameworks (vbulletin, etc).
its going to have a bunch of unnecessary folders
These uncessary folders are stored in one folder and are needed for the framework to work, is that the 10, 20, 200 Mb which is problem? Storage is cheap nowadays, why cares?
it requires anyone who wants to modify
my program to know the framework
You got it! It is an advantage, not an inconvenient. If it doesn't, the guy which will read your code will need to understand your habits, your convention, and they probably are not so common.
If you are able to write consistent code, following any conventions, why not.
But it can also gives your customer a real plus value since he knows that anyone could take back your work if you have to leave for any reasons.
they've got a mountain to move if they want to update it to the latest version of the framework.
In any case upgrading a framework, an application to a new version is most of the time a moutain since in a production environment, you need to test, and test again, to be sure your application is stable.
Most of the framework give releases notes which should let you know about backward compatibility.
It just seems to me that frameworks
were designed mostly for super large
projects.
Zend or Code Igniter fit well for medium sized project, with time you developed framework extensions and you'll be able to save time and bugs on smaller project.
It seems like all the big packaged php
products out there make their own
frameworks (vbulletin, etc).
PHP framework are youngs, most of them are 3/4 years old (Zend, Symfony). A lot of application like Vbulletin are older.
There a lot application based on common framework, but they don't target the same people.
Joomla, Drupal, Wordpress have their own framework (procedural, or object) but they target more the end-user.
However a solution like Magento, which uses Zend Framework, is designed to be extended and very customizable with extensions.
There are many light-weight PHP MVC frameworks, each with varying degrees of features and flexibility. The majority of these are going to be lacking advanced features, but will get the job done.
One that comes to mind is: http://www.kissmvc.com.
Hope that helps :)
You're right that most frameworks are tailored towards 'one size fits it all', meaning they have a lot of stuff that you won't necessarily need on every project. Which sometimes makes them a bit heavyweight. More 'modern' frameworks DO have a strong focus on modularization, but when it comes to the core there are often a lot of inter-dependencies.
One solution: Roll your own framework, dissect code from other frameworks and use parts you like/need. If you can, lean more towards using libraries that focus on specific tasks that you need. E.g. ORM for databases, you might as well use doctrine since it's area of expertise is very focused. Just as an example.
Either way, if you do it right it's a lot of work upfront trying to figure out what you even need. Start with the basics, how do your controllers work, do you need the full implementation of MVC with front controllers, action controllers, maybe page controllers for a CMS? Where can you cut corners, where not? It really depends a lot on what YOU need for your specific product (or product palette).
The other solution, like Serge mentioned, is getting a lightweight framework which really just focuses on the basics. And fill all the holes yourself, or by using 3rd party libraries where they are available.
I personally use a heavily modified version of FLOW3 (currently in alpha development) which uses a lot of cool stuff, but lacks a bit when it comes to using legacy databases (they have their own domain model implementation). Which is what I changed mostly for my version.

Django or Drupal, which one should I use that suits best my needs?

I want to learn and use Drupal or Django for the following:
dynamic web sites, medium database, multi-level users, paypal integration, content managment, speed (developing), security
I like MVC, ORM and object-oriented prg.
Which is better to jump into ? Which one is more mature, powerful, understandable, object-oriented and easier to use by the time ?
What about Python Spring ...
Also, which of these 3 are better documented, are better for a cv and have more extensions?
Known languages: php, java, mysql
Thank you !
I've built several sites on Drupal and Django, my conclusion is: if you need to create something similar to the standard drupal (or Ubercart) feature-set, you don't have much time for development, and you don't expect hight load pressure on a site - you should pick Drupal.
But if you do need to create something more or less custom (no drupal modules already available) you should go with Django - it is quicker and more pleasurable to implement custom complex features using Django. For example if my goal is to implement a second stackoverflow, I'll prefer Django because it will be extremely complicated to implement this badge-based rating system with Drupal.
P.S.
Studying Python (and Django) is an investment in your future, I think. You'll never be able to implement something similar to DropBox using drupal and php, although it could be implemented with java - but java is not so good from development speed perspective.
I'm primarily a (happy) Drupal developer these days, but a friend whose dev skills surpass mine has switched happily from Drupal to Django. Here's his set of reasons.
Drupal and Django doesn't make for a good comparison, as they are quite different.
If all you need is a simple website with a CMS and Paypal, I would go for Drupal. Drupal's strength compared Django is it's many modules (modular system), which most of the time can get you where you want. Drupal is also extremely flexible, and you can change almost anything from within your own code, and there is a huge demand for Drupal developers. You can also let site builders create content, display content and much from from within the AI.
Django on the other hand, is more simple and structured. It's based a lot more on code, making it fast and easy to develop something, but hard for non coders to change certain things. For sites that require a lot of custom coding, I usually prefer working with Django. Python is also a more structured programming language than PHP (IMO), and it's easier to make more maintainable code.
Jump into what you like or what attracts you most after getting a little overview of the capabilities and constraints. I never worked with drupal, but I can recommend django.
Consider your deployment. Pretty much every host will support Drupal. If you go with Django, you will need to select a host that supports fast_cgi or wsgi
You already know php, so just for that you might want to stick with Drupal. However, I prefer Django over Drupal for many reasons.
http://www.reddit.com/r/django/comments/bhvhz/the_onion_uses_django_and_why_it_matters_to_us/ provides some excellent background.
Basically if want things done properly with lots of flexibility, go with Django. If you're very familiar with php, don't feel like learning python, and your site requirements are basic, go with Drupal.
Something to keep in mind is that Django is a bona fide web framework, whereas Drupal is more of a web platform. That is, sometimes you have to hack Drupal to get what you want or that it doesn't fit all situations.
I had never heard of Spring Python but based on the fact that their own site is powered by Drupal, I wouldn't recommend it. Especially if you know Java already, why not consider the original Spring platform?
I've been developing with Django for more than 2 years and have built a couple of Drupal sites in the meantime (per client's specific request to use Drupal). My conclusions are the following:
Even for a smaller site I would have done it quicker building it from scratch with django (or maybe even PHP) for a simple reason, writing code for me is faster than hunting through drupal's unorganized mess of menus and options, or hunting on the web for a module that implements hack X to enable feature Y.
Migrating a site from development to production with Drupal is a big PITA. You can forget about using a VCS tool. All your work is in in the MySQL dump (including configurations, programming logic, views etc.), a few hacked up modules and the uploaded files.

PHP CMS with independent framework

We currently use MySource Matrix CMS for large projects, Wordpress CMS for small projects and Zend Framework for bespoke applications...
I'm not trying to confuse and compare a CMS to a framework, that has been done before :-)
I want to identify a few CMSs for review that have foundations in strong (preferably independent) PHP frameworks.
The only one I have looked at is SilverStripe CMS and Sapphire Framework.
We have many clients that have a CMS for internet and/ or extranet and then various other bespoke applications that are then integrated via various means to look like they're in the CMS.
I believe it will be more productive and beneficial to have a common framework between these branches so they can be natively merged.
Hope this makes sense.
PS. I have used custom assets in MySource Matrix and specific modules in other CMS but you feel you are working for the CMS not the application you are building.
Have you looked at Expression Engine? Its built on top of the CodeIgniter MVC framework, and may provide a lot of flexibility for having parts of the site be managed content, and branching out into more application type stuff using CI when needed. Not free, but all my colleagues that use it, swear by it (so much so that I'll actually consider it for the next project that fits this profile). There are also add-ons for many of the commons problems you're likely to want to solve.
And while not PHP, the Django framework is also a nice cross between CMS and App Framework, with some really great features like DB Migrations, etc. I can honestly say that Learning Python made me a better PHP Programmer, and the projects I've done with django were fun and fast to code. Not to start a holy war, but I describe Django as Drupal without all the clutter (and yes I've worked with Drupal enough to respect and fear it at the same time ~ too much friction in the Drupal dev process for my taste).
Even if I didn't get clearly what you are looking for I was just searching for a CMS that is not bundled with a propietary PHP framework and it should also be fast, simple coded, ordered and flexible to extend.
After a lot of search I found OctoberCMS. It uses Laravel PHP framework and it's intended for wevdevelopers/programmers, may be in a future it will also support more WYSIWYG edition. Right now it's very fast and easy to extend via MVC implementations or plugins.
It has a nice code and structure to work as programmer. If you like to create content via HTML+CSS and you don't care about WYSIWYG, then this could be a great alternative.
It's a very different approach compared to other CMS bundles. I'm not saying it's better, just different.
With their slogans:
The PHP framework for web artisans
http://laravel.com
The platform that gets back to basics
https://octobercms.com
Have you tried Drupal? We have used it as a CMS and also integrated it with things like Microsoft Dynamics and UPS Worldship. It's pretty flexible like that.
I wouldn't call sapphire and independent framework for the simple fact you'll have a hard time finding many apps written in sapphire alone - sapphire pretty much is silverstripe. Theres also the issues of silverstripe using an ajax powered admin interface for much of its own functionality meaning you have to adhere to these to keep the same look and feel with the bespoke work you want to add.

From a development standpoint, what are the advantages/disadvantages of the major Content Management Systems?

I'm interested in using a CMS instead of building a website from scratch. However, as a software engineer, if I'm going to be using open-source tools, I'm going to use them to their full extent, including the possibility of developing plugins/extensions/modules and maybe even contributing core code.
I'm currently looking at WordPress, Drupal, and Joomla!. They all appear to have the features I need, either as core features or plugins. However, I'm curious how hard it is to learn the system and then develop for it.
Does anyone have experience with this? When using and developing WordPress, Drupal, and/or Joomla!, what were your experiences like?
I avoid Joomla like the plague. It is highly difficult to extend, especially if your use case isn't one of the ones their devs specifically designed the CMS for. Great if you want to do a small business brochure site, but if you're looking to heavily customise... ditch it. The pay-to-play nature of much of the dev community is a turnoff, too.
WordPress is very heavily specialised in the blogging direction. If that fits your needs, go for it - it's a slick, well supported, system. If you're looking for something that's a bit more complex in a CMS, though, go with...
Drupal. My favourite PHP CMS, hands down, with the exception of blogging. Functions like hook_nodeapi, hook_user, hook_form_alter, etc. make it essentially effortless to heavily tweak the function of nearly everything in the system. If I want to replace the password field in the user login form with an upload field and MD5() the uploaded file to verify the user, I can do that - without hacking core code, and in a few lines of form alteration and validation code. Pretty astounding the first couple times you do something slightly nutty like that.
I haven't used Joomla much and have never really needed to tweak Wordpress outside the design but have used Drupal quite extensively. Drupal seems to be becoming the standard for PHP CMS' which I think is quite a shame given how much is wrong with it. I won't try to tell you why you should use it, or shouldn't, but here's a few things that I find really annoying with it.
Complete lack of OOP. Ok, in Drupal 7 they're finally doing some OOP with the Abstraction Layer but the community as a whole still shuns the entire concept of OOP as it applies to the CMS as a whole. And given their dependence on modules and third party code doing a decent OOP setup would help keep the code more organized. Currently to avoid naming conflicts you need to prefix all functions and constants with your module name which can lead to some very long function names which can lead to some very long lines of code which can make things a little less readable than doing something like $node->parent()->parent()->title;
Drupal content is completely unorganized. When doing an information heavy site it's imperative that you have well organized content and Drupal simply doesn't allow this. Drupal's content management is just one large list of nodes with a few filters you can apply. There are ways you can use Drupal's taxonomy system and other modules to setup relationships but I've never found any that actually make the interface easier to navigate and make it easy to manage the content on the templates. At work I've created a module that allows this but it's required dumping weeks worth of development time into it a simple feature that any good CMS should come with out of the box.
The admin interface is absolutely rancid. This one pretty much speaks for its self but install a copy of Drupal and click around. Then take a look at say, the Radiant interface (Radiant is Rails I know, but we're talking UI here). Another example of a good UI for the admin would be FrogCMS, a PHP port of Radiant.
No ORM, and absolutely no attempt to have one, means you better like writing lots of SQL to get the data you need. While I generally have no problems with writing my own SQL it's starting to get a bit old when most good frameworks and CMS' built on them have at least some kind of ORM for you to use. Even if it's a botched one.
Drupal loves to use non-standard file extensions (.module, .info, .install, .inc, etc) so you better make sure your htaccess and/or virtual host is setup to not allow direct access to these files or all your source code will be wide open for the world to see.
Personally I think FrogCMS looks like it's off to a good start to be an up-and-comer if the maintainers allow the community to contribute to it and allow it to grow. You'll need to do more coding as it doesn't have a big feature set out of the box and doesn't have a plugin repository like Drupal or Joomla but from a coding standpoint it's setup with a pretty well done, albeit basic, MVC implementation that will help your code be more organized and easier to maintain.
I've only developed for Joomla! and have been a user of wordpress, but Joomla! development is too clumsy if you want to completely change the layout. Writing a plugin or 'component' is fairly easy if you know the way around the code, but getting it to do exactly what you want isn't so easy because it likes to force you to use it's MVC design pattern which I find too clumsy.
I've seen both the Joomla! and Drupal code base, and I'd say that Joomla!'s code is much cleaner and better documented. It also heavily uses the MVC design pattern which can be good or bad depending on your preference and what you want to use it for. It has the most extensive use of OO programming in any php project I've seen.
I haven't developed for wordpress, but as a user, automatic updates are a godsend! plugins and themes can be found and installed through an interface in wordpress itself, so as a developer you save a bit of time in trying to promote your plugin because it gets made available to everyone right away. Heavy modifications might break some of of this though, so I wouldn't recommend it if you want to modify it a lot.
Joomla!'s plugin community is heavily monotized, but there is a huge community of plugin developers. I don't know about Drupal, and most wordpress plugins are free. So that's something to consider as well if you plan on using third party plugins.
over the years, i began hating PHP, since i had to work a lot with it until i found good alternatives, so the first question i ask you is: does it have to be PHP?
but staying with PHP i'd add the following:
most people like Drupal a lot because of it's extensibility ... that's fine, but it still has some design problems ... it's is very potent and flexible and has a huge user base -> lot of plugins, big community to ask for advice etc.
when it comes to Joomla, one has to say, that in the past, this has been a really a complete mess ... but in version 1.5 the whole thing was redesigned and is now very clean ... i always laughed down at joomla, but recently i had a talk with some other developer i had worked with on several occasion, who quite conviced me, that it has become a developer friendly software ... plus, it is soooooooo damn easy to administrate ... i know no other CMS that is so easy to use (and is a "real" CMS, not a forum or blogging engine)
you might wanna have a look at Vanilla CMS ... very sexy, still slick and powerful ...
use a CMS based on a good PHP framework ... typo3 (Flow3 (IMHO really the most funky PHP framework)), something based on symfony (can't find anything, but this should be a good start), mambo (CakePHP) or maybe something based on code igniter ... you will always need to get familiar with the framework, but a) this is always good, b) if the framework is good, the app is likely to be good and extensible, c) you yourself will have a high productivity when building extensions since the framework will do a lot for you ...
finally, you might wanna have a look at opensourcecms ... always helpful ...
good luck with your choice then ... ;)
greetz
back2dos

Does anyone write really long, complex PHP apps? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
It's hard for me to imagine a php script that is more than a few hundred lines of code. It seems that, for a non-persistent environment, web-based scripting is usually done is small chunks and used for the purpose of delivering a portion of a website to the end user. I'd like to know if people are developing any type of large, or persistent, or complex apps with php, and what is it exactly you are working on. I've only done small projects for small websites, so I don't know what can be accomplished on a larger scale. It would also be nice to know what libraries you are using, and what other technologies you are integrating with. Please enlighten me so I can start to dream of bigger things!
I would look at some of the well-known open source web apps that use PHP to get a good sense of what can be accomplished, and how PHP is used in each of them. The advantage is that since they are all open source, you can actually look at the PHP code to see how various functionality was implemented.
Some good examples to look at include:
WordPress
TextPattern
MediaWiki
PhpBB *questionable code quality
SugarCRM
Joomla
Drupal
Also look at some of the popular frameworks to see what kind of functionality they offer (this should give you a good sense of what types of things PHP is most often used for):
Zend Framework
CakePHP
CodeIgniter
Symfony
For my day-job we run everything in PHP - our front-end website, our backend for agents and employees, inventory, server control interfaces, etc. These are everything from spiffy new AJAX-enabled Zend Framework apps to legacy code that we haven't ported yet. On top of that we use things like Mantis (bug tracking built in PHP), Mediawiki, and phpMyAdmin.
The only thing that isn't PHP are vendor apps because vendors love Java. The one ASP.NET application we have was actually abandoned by the vendor during the project (not really a knock against ASP.NET, that app was just the perfect definition of a runaway project and would have failed no matter what language it was written in).
With mature frameworks like Zend Framework, CodeIgnitor, and CakePHP creating just about anything in PHP is possible.
The biggest problem developing large scale programs is definitely keeping them maintainable in the long-term. Initially, a program starts out all full of ideal methods and ideas, but keeping the integrity intact, especially, over time fails, in my opinion, more often than not.
In addition, scope creep is your enemy. You HAVE to reign that in ASAP.
As far as large scale programs go the company I work for has a few internal programs constantly under development. One example is our proprietary website engine. It's a very large code-base that includes a dozen modules (user management, survey system, blogs, user galleries, etc) that allows us to build our clients sites rapidly.
We also develop our own internal project management program for managing our clients work.
You should definitely be thinking in terms of scale in the long term. In almost every project I've worked on there's a permission/group element for users involved. You might want to start thinking about the possibilities and issues involved in that and work up to more complicated functionality.
MediaWiki is one of the largest public PHP apps, and it's got very nice code. . I know some larger ones, but they're utterly awful and you'd learn nothing by reading them.
There are lots of complex OpenSource php applications. For example, the Drupal CMS, which can be considered a platform in its own right for developing other web sites.
You can browse through the source code online: http://cvs.drupal.org/viewvc.py/drupal/drupal/
+1 for Wilco
I have a software I use for some of my clients, it's a CMS, Blog, eCommerce beast, the code base is HUGE, but everything cooperates with each other nicely.
My company works on educational software. We've recently started doing web-based content delivery, including video and audio, with the backend written entirely in PHP using MySQL. We have two primary apps, one which lives on our servers and one which is delivered to the customer. One clocks in at ~42,000 lines of code (using a physical line count) and one at ~68,000 lines.
We use PEAR extensively and a recently started project is using the Zend Framework.
We use PHP at our company. (We do online language learning: http://www.livemocha.com. You should go take a look at the site. Yes, it's sort of a shameless plug, but it's also topical. :-) )
I can't give you a precise number of users, but we put out a press release a while back celebrating hitting the 3 million mark. That's a pretty large scale as web apps go.
We build on the CakePHP framework, which is based on an MVC architecture... at least in theory. In practice, they auto-generate certain methods for the models which tend to have the result of pushing some pieces of model code (caching, deciding which DB to use) into the controllers. They also have a few localization issues in 1.2 that make me think this part of the framework hasn't really reached maturity yet. That said, I find CakePHP pretty comfortable to work with overall, and you should at least take a look at it if you're considering implementing a large-scale web app in PHP. It has some excellent documentation available as well (google for "CakePHP bakery").
Get CodeIgniter and rebuild Amazon or Ebay. If you can dream it you can build it in PHP but you might not be able to maintain it because it is so easy to created bad code that works. PHP.net is your friend. Whatever framework you use make sure your read the User Guide and let it guide you.
I can't believe nobody has mentioned the MVC pattern yet. IMO, it's one of the best things you can use to help you maintain large codebases.

Categories