Cakephp Help: Task Remider App
Hello People, Please am kind of new to cakephp, I need your help. As a platform to learn cakephp, I plan to develop an app that remind you of your task that you input with the date you fill in so the app can remind you thrpugh email on that day. App have done it to a stage of adding the task to the aplication. My major problem is how will i go about the app sending email on the day the user ask it to remind him/her Please Help with this Thanks in Advance Unique -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: loading plugin in cake 1.3 bootstrap
anyone,...?? On Wednesday, January 16, 2013 6:12:55 AM UTC-8, Chris wrote: > > hi guys,... can someone help please,... > I'm having a problem loading plugin from bootstrap > > CakePlugin::load('Facebook'); > > I have also tried: > CakePlugin::load(array('Facebook' => array('bootstrap' => true))); > > nu luck,... I'm getting an error: > Fatal error: Class 'CakePlugin' not found in > > How can I do this,... > > thanks in advance > chris > > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: CakePHP and Twitter Bootstrap
I am using this and it works perfectly : https://github.com/slywalker/TwitterBootstrap I highly recommend it. On Monday, January 14, 2013 11:46:22 PM UTC-5, Chad wrote: > > I am fairly new with cakePHP too so I thought I would use a plugin like > BootstrapCake for setting up Bootstrap. It was a mistake. BootstrapCake is > not a very good implementation and there are a lot of issues with it. I > spent a lot of time fixing the templates and troubleshooting what it did > not include (it didn't include the correct css files, js files, or jquery). > My best advice is to set it up yourself. I've learned now that it is really > quite simple to set up Bootstrap on CakePHP and you will learn a lot about > CakePHP in doing it. Follow a tutorial like this to help: > http://thehappydeveloper.wordpress.com/2012/02/24/setting-up-twitter-bootstrap-with-cakephp/ > > Chad > > On Monday, January 14, 2013 11:45:33 AM UTC-8, Maximilian Schafzahl wrote: >> >> Hallo >> >> I "only" want to use the bootstrap framework to style my cakephp app. >> What's the easiest way to do this? >> >> I tried https://github.com/visionred/BootstrapCake but I cannot install >> it (console tells me that it cant find the plugin, "bake" works and paths >> seem right) and https://github.com/nodesagency/Platform-Twitter-Bootstrap. >> >> What would you prefer? I'm new to cake so please tell me your experiences >> with cakephp and theming (especially bootstrap). Thanks. Max. >> > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Cache::cleargroup() doesn't make sense to me
According to: http://book.cakephp.org/2.0/en/core-libraries/caching.html#using-groups "Groups are shared across all cache configs using the same engine and same prefix. If you are using groups and what to take advantage of group deletion, choose a common prefix for all your configs." So this seems that you can use cleargroup() to clear a specified group across all cache configs. But then why does cleargroup() take a config as a parameter which defaults to "default"? How is it going to clear the specified group across all configs if it defaults to the "default" config? Am I supposed to call it multiple times specifying a different cache config each time? Seems to defeat the purpose of groups. ex: Cache::config('short', array( 'engine' => 'File', 'duration'=> 60, 'serialize' => true, 'prefix' => 'CA', 'groups' => array('posts') )); Cache::config('med', array( 'engine' => 'File', 'duration'=> 180, 'serialize' => true, 'prefix' => 'CA', 'groups' => array('posts') )); Cache::config('long', array( 'engine' => 'File', 'duration'=> 300, 'serialize' => true, 'prefix' => 'CA', 'groups' => array('posts') )); So for the above, according to the docs and api Cache::cleargroup('posts') would clear "posts" group but only if using the 'default' config. Am I missing something? -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: Save Uploaded/Parsed File to Database Table
> > Now as far as my view goes..do I need to add an input for user_id and > > coverage_id as hidden fields? > > The user_id you can add manually after the upload with > $this->Auth->user('id') but for coverage_id you can either use a > hidden form field or add that data to the array before saving as well. > Either way, you'll need to know what the coverage_id is so you should > pass it to the action in the first place: > > echo $this->Html->link( > 'upload spreadsheet', > array( > 'controller' => 'Coverages', > 'action' => 'processSpreadsheet', > 'coverage_id' => $xxx > ) > ); > > Ok...I have a quick questionis there another way to pass the coverage_id beside the code listed above. I need to pass the coverage_id but I don't need a hyperlink. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
HTML in forms
I have integrated CKEditor with a file browser / uploads and all that is working fine except the actual image part. If I used the editor to create a table, ul ol lists the html saves in the database fine. But whenever I insert an image the code gets encoded. Example1: Random elements / table /lists saved to database, rendered view shows fine 26 Example 2 Adding image hello So the image never gets displayed. View: There is nothing for beforeSave() or edits to any of the data submitted. I cannot firure out why it only escapes the Img tag but all other HTML is fine. Any ideas how to escape => false for input? Or suggestions to fix this? Thanks, Dave -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: Routing help
Hello, I have already created the wildcard subdomain *.domian.com. I just need to know how to make the routing process. Thanks, -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Routing help
Hello, I need your help to make this routing http://domain.com/members/users/view/username/posttitle to be http://username.domain.com/posttitle Where domain.com -> My domain members -> Routing prefix users -> Controller view -> Action username -> Member username(First variable for view() action) posttitle-> Member post title(Second variable for view() action) Please help me Thanks -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: Multiple domains sharing a single database with non-unique user names
On Tue, Jan 15, 2013 at 9:09 AM, wrote: > I have a Cake 1.3 application that we have been developing for a while. The > application will support multiple domains and sub domains on a single > database. We are using the standard ACL for user login and permissions. > The problem that we have run in to is that the user name space is not unique > across domains and sub domains. For example, there could be a user jack on > sub.domain1.com and another user jack on sub2.domain1.com or a user jack on > sub1.domain2.com. There is another table that contains the relationship > between users and sub domains / domains using the user_id field in a > belongsTo relationship. Since the username column in the users table must be > unique this is problematic. For now we have come up with two approaches. > > The first is to change the username to j...@sub.domain1.com. This makes the > username unique. However, it is cumbersome for the user since they are > going to a url which is sub.domain.com/login already. Also, it would be a > problem if the sub domain name is ever changed since all of the usernames > would contain the old sub domain name. > > The other alternative is to change the users table to a view that does a > join on a shadow users table and the fully qualified domain name. The > problem with this is that it needs to be an updatable view to allow for > updating passwords and the requirements in MySQL for an updateable view seem > rather restrictive. We wouldn't want a change to either of the underlying > tables to break the login process inadvertently. > > The other wrinkle to add in to the mix is that there are some users (system > administrators) that are not associated with a sub domain / domain so we > need to support them logging in as well. > > For now we are going with the first approach under the assumption that the > downsides of that approach are less severe. However, I wanted to know if > anyone else has dealt with this type of configuration and found a better > alternative. Go with the first choice, except don't force the user to fill in the domain part. You could handle that in beforeFilter(). Check if a POST has been made containing username, and append the domain. I'm not sure about the admin part. Perhaps you could create an alternative form for admins to use which sets some flag in the POST so you don't bother doing the append. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: custom logger
Yes, or at least add a link to the SO post here in this thread. So everyone can see what the current answering status is. Also, it might make sense to use this group mainly for support regarding ideas and unconcrete ideas/concepts. Or general questions. And leave technical questions to SO for example. SO is not really up for discussions usually. and google groups might not be well suited for long excerpts of code. Just my 5 cents. Am Mittwoch, 16. Januar 2013 19:27:36 UTC+1 schrieb cricket: > > On Tue, Jan 15, 2013 at 6:42 PM, euromark > > wrote: > > Wouldnt you find it annoying to thoroughly answer a question only to see > > that this was not necessary and you just wasted your time because > somewhere > > else already answered the question to the same degree somewhere else as > it > > has been posted multiple times? > > I dunno - I dont think thats very nice. > > You only make more people work for you - the quality of the answer stays > the > > same. > > > > If you don't get the answer in a few days, why not. But simultaneously > > spamming all networks seems a bit over the top. > > ok, this is OT now but I can't let this go. While it really irks me to > see people double (or triple!) posting on *this list* I couldn't care > less if they post the same question to multiple sites. Not everyone > browses every conceivable list/forum/whatever on a daily basis. I > understand your point about answering a question that someone else may > have already replied to elsewhere, but who's to say that any given > answer is correct/complete/intelligible? Simply posting to multiple > sites isn't, imho, a "breach of netiquette", although I would agree > that it would be polite for one to update other questions elsewhere to > say that it has been answered. (With a brief synopsis, of course, for > those who come later via google.) > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: very slow response from CakePHP when performing a simple query
To begin with, you're doing a few things wrong here. Your say_hello action doesn't belong in AppController. And the query method is not the best approach, either. Also, if you're testing Cake for speed, ensure that debug is set to 0 and you've implemented caching. On Tue, Jan 15, 2013 at 2:23 PM, Quoc Lam wrote: > Hi there, > > I am new to CakePHP and is trying to setup my first "Hello World" project. > When working on that, I experienced a very slow response from CakePHP when > performing a simple query to the DB. > > Here are the steps that I have done: > > Download the CakePHP framework (2.3.0 RC1) > Create a Test DB with an empty table named "tests" inside it. > Edit the default AppController.php as following > > class AppController extends Controller { > var $uses = array('Test'); > > function say_hello() { > $this->Test->query("select * from test where id=0"); > echo "hello"; > } > } > > After that, I accessed the link http://localhost/app/say_hello, it took more > than 1 second to response. If I commented out the query statement as > following: > > class AppController extends Controller { > var $uses = array('Test'); > > function say_hello() { > //$this->Test->query("select * from test where id=0"); > echo "hello"; > } > } > > Then, the link http://localhost/app/say_hello only took around 60ms to > response. > > This doesn't seems right to me as performing a very simple query on an empty > table should not take 940ms. I also tried doing the debug with DebugKit and > it showed that more than 1s of time were spending on the ControllerAction > which is pretty simple in this case. I am not what is causing the slowness > of the response here. > > Can any of the CakePHP experienced members shed me something on how to solve > this slowness issue? > > Thanks, > > Quoc > > -- > Like Us on FaceBook https://www.facebook.com/CakePHP > Find us on Twitter http://twitter.com/CakePHP > > --- > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to cake-php@googlegroups.com. > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com. > Visit this group at http://groups.google.com/group/cake-php?hl=en. > > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: problem with nuSoap
Perhaps your XML is malformed. Or maybe it's sending the wrong headers. Try inspecting the raw output with Firebug. On Tue, Jan 15, 2013 at 3:35 AM, Manh Hung Nguyen wrote: > I have used nuSoap as vender and created a soap webservice as a cakephp > controller. > 1. route: >>> >>> Router::connect('/sms_gateway', array('controller' => 'SMS', 'action' => >>> 'receiveMO')); >>> >>> Router::connect('/soap/:controller/:action/*', array('prefix'=>'soap', >>> 'soap'=>true)); > > > 2. Server code: > >> App::uses('AppController', 'Controller'); >> App::import('Vendor','nusoap/nusoap'); >> >> class SMSController extends AppController { >> >> public $name = 'SMS'; >> public $uses = array(); >> public $autoRender = false; >> public $layout = false; >> >> function receiveMO(){ >> $server = new soap_server(); >> $namespace = false; >> $soapaction = 'http://pay.idivu.com/soap/SMS/smsIn'; >> $endpoint = 'http://pay.idivu.com/soap/SMS'; >> $server->configureWSDL('smsIn',$namespace,$soapaction); >> $server->register("smsIn", array('User_Id' => >> 'xsd:string','Service_Id'=>'xsd:string','Request_Id'=>'xsd:string','Command_Code'=>'xsd:string','Message'=>'xsd:string','User'=>'xsd:string','Pass'=>'xsd:string'),array('ketqua' >> => 'xsd:int'), $namespace, $soapaction,'rpc','literal','idivu.com'); >> >> $query = isset($HTTP_RAW_POST_DATA)? $HTTP_RAW_POST_DATA : ''; >> $server->service($query); >> exit(); >> } >> function >> soap_smsIn($userId,$serviceId,$request_id,$command_code,$info,$user,$pass){ >>// code here >> } >> } > > > 3. Client code: >> >> require_once 'nusoap/nusoap.php'; >> >> >> >> $svTest = new SoapClient("http://pay.idivu.com/sms_gateway?wsdl";); >> >> $result = $svTest->smsIn("0123456789","","0","KH","KH >> AT","user","pass"); >> >> print_r($result); >> >> > > when i run "http://pay.idivu.com/sms_gateway?wsdl";, result is an xml > document. > But when i run client code, it returns error: >> >> Fatal error: Uncaught SoapFault exception: [Client] looks like we got no >> XML document in... > > > pls help me how to use nusoap to build webservice as a cakephp controller. > Tks. > > > > -- > Like Us on FaceBook https://www.facebook.com/CakePHP > Find us on Twitter http://twitter.com/CakePHP > > --- > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to cake-php@googlegroups.com. > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com. > Visit this group at http://groups.google.com/group/cake-php?hl=en. > > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: custom logger
On Tue, Jan 15, 2013 at 6:42 PM, euromark wrote: > Wouldnt you find it annoying to thoroughly answer a question only to see > that this was not necessary and you just wasted your time because somewhere > else already answered the question to the same degree somewhere else as it > has been posted multiple times? > I dunno - I dont think thats very nice. > You only make more people work for you - the quality of the answer stays the > same. > > If you don't get the answer in a few days, why not. But simultaneously > spamming all networks seems a bit over the top. ok, this is OT now but I can't let this go. While it really irks me to see people double (or triple!) posting on *this list* I couldn't care less if they post the same question to multiple sites. Not everyone browses every conceivable list/forum/whatever on a daily basis. I understand your point about answering a question that someone else may have already replied to elsewhere, but who's to say that any given answer is correct/complete/intelligible? Simply posting to multiple sites isn't, imho, a "breach of netiquette", although I would agree that it would be polite for one to update other questions elsewhere to say that it has been answered. (With a brief synopsis, of course, for those who come later via google.) -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: viewing PDF
After a couple of hours of deep research, i noticed some capitals were missing where they should be Lessons learned be very disciplined with the orthographe Thanks for your concerns Op maandag 14 januari 2013 schreef euromark (dereurom...@gmail.com) het volgende: > Without seeing the code we cannot tell you more than PHP already does (and > which should suffice usually..) > > > Am Montag, 14. Januar 2013 09:27:35 UTC+1 schrieb Dr. Drijk: >> >> How silly, it was tagged out. >> >> But now I get another error. >> It can't get an object from an element. >> *Fatal error*: Call to a member function add() on a non-object in * >> D:\xampp\htdocs\VR\V6\app\View\Layouts\default.ctp* on line *47* >> >> >> >> Op donderdag 10 januari 2013 17:35:17 UTC+1 schreef euromark het volgende: >>> >>> You forgot the RequestHandler component, didnt you? >>> >>> >>> Am Donnerstag, 10. Januar 2013 17:19:15 UTC+1 schrieb Dr. Drijk: I'm using the CakePdf-plugin to parse a view as pdf. I added to \app\config\bootstrap.php : CakePlugin::load('CakePdf', array('bootstrap' => true, 'routes' => true)); Configure::write('CakePdf', array( 'engine' => 'CakePdf.WkHtmlToPdf', 'margin' => array( 'bottom' => 15, 'left' => 50, 'right' => 30, 'top' => 45 ), 'orientation' => 'landscape', 'download' => true )); and to app\config\routes.php: Router::parseExtensions('rss', 'json', 'xml', 'pdf'); I added the pdf-folders, and created view.ctp, and default.cpt When I try the view action : /view/1 I get the corresponding view, either when i try /view/1.pdf, I don't get a pdf-page but the same html Where did it go wrong??. -- > Like Us on FaceBook https://www.facebook.com/CakePHP > Find us on Twitter http://twitter.com/CakePHP > > --- > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to > cake-php@googlegroups.com 'cake-php@googlegroups.com');> > . > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com 'cake-php%2bunsubscr...@googlegroups.com');>. > Visit this group at http://groups.google.com/group/cake-php?hl=en. > > > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
problem with nuSoap
I have used nuSoap as vender and created a soap webservice as a cakephp controller. 1. route: > Router::connect('/sms_gateway', array('controller' => 'SMS', 'action' => >> 'receiveMO')); > > Router::connect('/soap/:controller/:action/*', array('prefix'=>'soap', >> 'soap'=>true)); > > 2. Server code: App::uses('AppController', 'Controller'); > App::import('Vendor','nusoap/nusoap'); > > class SMSController extends AppController { > > public $name = 'SMS'; > public $uses = array(); > public $autoRender = false; > public $layout = false; > > function receiveMO(){ > $server = new soap_server(); > $namespace = false; > $soapaction = 'http://pay.idivu.com/soap/SMS/smsIn'; > $endpoint = 'http://pay.idivu.com/soap/SMS'; > $server->configureWSDL('smsIn',$namespace,$soapaction); > $server->register("smsIn", array('User_Id' => > 'xsd:string','Service_Id'=>'xsd:string','Request_Id'=>'xsd:string','Command_Code'=>'xsd:string','Message'=>'xsd:string','User'=>'xsd:string','Pass'=>'xsd:string'),array('ketqua' > > => 'xsd:int'), $namespace, $soapaction,'rpc','literal','idivu.com'); > > $query = isset($HTTP_RAW_POST_DATA)? $HTTP_RAW_POST_DATA : ''; > $server->service($query); > exit(); > } > function > soap_smsIn($userId,$serviceId,$request_id,$command_code,$info,$user,$pass){ >// code here > } > } > 3. Client code: > require_once 'nusoap/nusoap.php'; > > $svTest = new SoapClient("http://pay.idivu.com/sms_gateway?wsdl";); $result = $svTest->smsIn("0123456789","","0","KH","KH > AT","user","pass"); print_r($result); when i run "http://pay.idivu.com/sms_gateway?wsdl";, result is an xml document. But when i run client code, it returns error: > *Fatal error*: Uncaught SoapFault exception: [Client] looks like we got > no XML document in... pls help me how to use nusoap to build webservice as a cakephp controller. Tks. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
What about a more flexible JsonView?
Make an interface called IRenderer, like interface IRenderer { public static function render($object, $options = array()); } where render means rendering the object into an array. The renderer is called in JsonView. Then, there could be some interesting implementation of renderer, for example, ArrayRenderer, ModelObjectRenderer, FlexibleRenderer (with this renderer, $object can be of any type). And, here's an example, which renders the attributes of an Object. value format. The attributes in value can be, * maxArrayDepth: if arrayDepth > maxArrayDepth, the attribute will not be rendered. * needed: whether the attribute is needed, can be Closure which returns TRUE or FALSE. * rendererName: the name of renderer to render the object. * value: the value of the attribute, can be Closure. */ private static function processAttributeField($fieldData, $object, $options = array()) { if ($fieldData instanceof Closure){ return $fieldData($object, $options); } else { return $fieldData; } } public static function render($object, $options = array()) { if (!isset(static::$ATTRIBUTES)) return array(); $result = array(); foreach (static::$ATTRIBUTES as $key => $value) { $necessary = true; if (isset($value["maxArrayDepth"])){ $arrayDepth = ArrayUtil::getWithDefault($options, "arrayDepth", 0); if ($arrayDepth > $value["maxArrayDepth"]){ $necessary = false; } } if ($necessary && isset($value["needed"])){ $necessary = self::processAttributeField($value["needed"], $object, $options); } if ($necessary){ if (isset($value["value"])){ $result[$key] = self::processAttributeField($value["value"], $object, $options); } else if (isset($value["rendererName"])){ if (isset($object->$key)) { $rendererName = self::processAttributeField($value["rendererName"], $object->$key, $options); $result[$key] = $rendererName::render($object->$key, $options); } } else { if (isset($object->$key)){ if ($object->$key instanceof MongoId) $result[$key] = (string)$object->$key; else $result[$key] = $object->$key; } } } } return $result; } } This solution (with renderers) is more simple and flexible. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
very slow response from CakePHP when performing a simple query
Hi there, I am new to CakePHP and is trying to setup my first "Hello World" project. When working on that, I experienced a very slow response from CakePHP when performing a simple query to the DB. Here are the steps that I have done: 1. Download the CakePHP framework (2.3.0 RC1) 2. Create a Test DB with an empty table named "tests" inside it. 3. Edit the default AppController.php as following class AppController extends Controller { var $uses = array('Test'); function say_hello() { $this->Test->query("select * from test where id=0"); echo "hello"; } } After that, I accessed the link http://localhost/app/say_hello, it took more than 1 second to response. If I commented out the query statement as following: class AppController extends Controller { var $uses = array('Test'); function say_hello() { //$this->Test->query("select * from test where id=0"); echo "hello"; } } Then, the link http://localhost/app/say_hello only took around 60ms to response. This doesn't seems right to me as performing a very simple query on an empty table should not take 940ms. I also tried doing the debug with DebugKit and it showed that more than 1s of time were spending on the ControllerAction which is pretty simple in this case. I am not what is causing the slowness of the response here. Can any of the CakePHP experienced members shed me something on how to solve this slowness issue? Thanks, Quoc -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Multiple domains sharing a single database with non-unique user names
I have a Cake 1.3 application that we have been developing for a while. The application will support multiple domains and sub domains on a single database. We are using the standard ACL for user login and permissions. The problem that we have run in to is that the user name space is not unique across domains and sub domains. For example, there could be a user jack on sub.domain1.com and another user jack on sub2.domain1.com or a user jack on sub1.domain2.com. There is another table that contains the relationship between users and sub domains / domains using the user_id field in a belongsTo relationship. Since the username column in the users table must be unique this is problematic. For now we have come up with two approaches. The first is to change the username to j...@sub.domain1.com. This makes the username unique. However, it is cumbersome for the user since they are going to a url which is sub.domain.com/login already. Also, it would be a problem if the sub domain name is ever changed since all of the usernames would contain the old sub domain name. The other alternative is to change the users table to a view that does a join on a shadow users table and the fully qualified domain name. The problem with this is that it needs to be an updatable view to allow for updating passwords and the requirements in MySQL for an updateable view seem rather restrictive. We wouldn't want a change to either of the underlying tables to break the login process inadvertently. The other wrinkle to add in to the mix is that there are some users (system administrators) that are not associated with a sub domain / domain so we need to support them logging in as well. For now we are going with the first approach under the assumption that the downsides of that approach are less severe. However, I wanted to know if anyone else has dealt with this type of configuration and found a better alternative. Thanks. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: CakePHP and Twitter Bootstrap
I am fairly new with cakePHP too so I thought I would use a plugin like BootstrapCake for setting up Bootstrap. It was a mistake. BootstrapCake is not a very good implementation and there are a lot of issues with it. I spent a lot of time fixing the templates and troubleshooting what it did not include (it didn't include the correct css files, js files, or jquery). My best advice is to set it up yourself. I've learned now that it is really quite simple to set up Bootstrap on CakePHP and you will learn a lot about CakePHP in doing it. Follow a tutorial like this to help: http://thehappydeveloper.wordpress.com/2012/02/24/setting-up-twitter-bootstrap-with-cakephp/ Chad On Monday, January 14, 2013 11:45:33 AM UTC-8, Maximilian Schafzahl wrote: > > Hallo > > I "only" want to use the bootstrap framework to style my cakephp app. > What's the easiest way to do this? > > I tried https://github.com/visionred/BootstrapCake but I cannot install > it (console tells me that it cant find the plugin, "bake" works and paths > seem right) and https://github.com/nodesagency/Platform-Twitter-Bootstrap. > > What would you prefer? I'm new to cake so please tell me your experiences > with cakephp and theming (especially bootstrap). Thanks. Max. > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: PHPUnit_Util_Skeleton_Test not found in CakePHP
Is there any official information from CakePHP on what version of PHPUnit should be used with Cake 2.2.5? On Wednesday, 16 January 2013 09:21:34 UTC-5, jsundquist wrote: > > Looks like you got your answer. > > > http://stackoverflow.com/questions/14348318/phpunit-util-skeleton-test-not-found-in-cakephp > > > On Tue, Jan 15, 2013 at 9:34 PM, Mathew >wrote: > >> I'm able to run my individual tests for each model in a plugin called >> Agg, but when I try to run a CakeTestSuite, then I get an error. >> >> class ModelsTest extends CakeTestSuite >> { >> public static function suite() >> { >> $suite = new CakeTestSuite('All model tests'); >> $suite->addTestDirectory(TESTS . 'Case' . DS . 'Model'); >> return $suite; >> } >> } >> >> Running that suite generates this error. >> >> > Fatal error: Class 'PHPUnit_Util_Skeleton_Test' not found in >> C:\work\zend\cake\Cake\TestSuite\CakeTestSuiteCommand.php on line 77 >> >> I'm using PHP 5.3.15 and have PHPUnit 3.7.12 installed with CakePHP 2.2.5 >> >> I get this error when running tests both via the web and the CLI. >> >> >> If I search for 'PHPUnit_Util_Skeleton_Test' in PEAR folder for PHPUnit >> it's not found. This seems strange to me. Am I using the wrong version of >> PHPUnit? When was this class introduced? >> >> It seems that this class is no longer used in PHPUnit 3.7.x, and I'm >> wondering if CakePHP 2.2 will only work with PHPUnit 3.6. I tried to >> uninstall the pear package, and then install the 3.6.x version but always >> installs the newest version. Any ideas on how to downgrade PHPUnit? >> >> Downgrading using the --force to install older versions of PHPUnit didn't >> resolve the problem. I tried 3.6.12, 3.6.5 and 3.5. With the 3.6.12 I got >> an error with is_file() somewhere in the PHPUnit code. >> >> Any help would be appreciated. >> >> -- >> Like Us on FaceBook https://www.facebook.com/CakePHP >> Find us on Twitter http://twitter.com/CakePHP >> >> --- >> You received this message because you are subscribed to the Google Groups >> "CakePHP" group. >> To post to this group, send email to cake...@googlegroups.com >> . >> To unsubscribe from this group, send email to >> cake-php+u...@googlegroups.com . >> Visit this group at http://groups.google.com/group/cake-php?hl=en. >> >> >> > > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: PHPUnit_Util_Skeleton_Test not found in CakePHP
Looks like you got your answer. http://stackoverflow.com/questions/14348318/phpunit-util-skeleton-test-not-found-in-cakephp On Tue, Jan 15, 2013 at 9:34 PM, Mathew wrote: > I'm able to run my individual tests for each model in a plugin called Agg, > but when I try to run a CakeTestSuite, then I get an error. > > class ModelsTest extends CakeTestSuite > { > public static function suite() > { > $suite = new CakeTestSuite('All model tests'); > $suite->addTestDirectory(TESTS . 'Case' . DS . 'Model'); > return $suite; > } > } > > Running that suite generates this error. > > > Fatal error: Class 'PHPUnit_Util_Skeleton_Test' not found in > C:\work\zend\cake\Cake\TestSuite\CakeTestSuiteCommand.php on line 77 > > I'm using PHP 5.3.15 and have PHPUnit 3.7.12 installed with CakePHP 2.2.5 > > I get this error when running tests both via the web and the CLI. > > > If I search for 'PHPUnit_Util_Skeleton_Test' in PEAR folder for PHPUnit > it's not found. This seems strange to me. Am I using the wrong version of > PHPUnit? When was this class introduced? > > It seems that this class is no longer used in PHPUnit 3.7.x, and I'm > wondering if CakePHP 2.2 will only work with PHPUnit 3.6. I tried to > uninstall the pear package, and then install the 3.6.x version but always > installs the newest version. Any ideas on how to downgrade PHPUnit? > > Downgrading using the --force to install older versions of PHPUnit didn't > resolve the problem. I tried 3.6.12, 3.6.5 and 3.5. With the 3.6.12 I got > an error with is_file() somewhere in the PHPUnit code. > > Any help would be appreciated. > > -- > Like Us on FaceBook https://www.facebook.com/CakePHP > Find us on Twitter http://twitter.com/CakePHP > > --- > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to cake-php@googlegroups.com. > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com. > Visit this group at http://groups.google.com/group/cake-php?hl=en. > > > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
loading plugin in cake 1.3 bootstrap
hi guys,... can someone help please,... I'm having a problem loading plugin from bootstrap CakePlugin::load('Facebook'); I have also tried: CakePlugin::load(array('Facebook' => array('bootstrap' => true))); nu luck,... I'm getting an error: Fatal error: Class 'CakePlugin' not found in How can I do this,... thanks in advance chris -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: Advanced find with mulitple OR/WHERE/AND conditions
On Wednesday, 16 January 2013 14:03:44 UTC+1, MetZ wrote: > > SELECT COUNT(*) AS `count` FROM `DATABASE`.`app_items` AS `Item` WHERE > `Item`.`published` = '1' AND ((`Item`.`start_date` BETWEEN '2013-01-16 > 00:00' AND '2013-01-16 23:59') OR (`Item`.`end_date` BETWEEN '2013-01-16 > 00:00' AND '2013-01-16 23:59') OR > (FIND_IN_SET('search_word',`Item`.`location_start`)) OR > (FIND_IN_SET('second_search_word',`Item`.`location_end`))) > > > The generated query appears to exactly match your find call - as such - what query are you trying to generate and in what way does it differ from the above? AD -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: Advanced find with mulitple OR/WHERE/AND conditions
SELECT COUNT(*) AS `count` FROM `DATABASE`.`app_items` AS `Item` WHERE `Item`.`published` = '1' AND ((`Item`.`start_date` BETWEEN '2013-01-16 00:00' AND '2013-01-16 23:59') OR (`Item`.`end_date` BETWEEN '2013-01-16 00:00' AND '2013-01-16 23:59') OR (FIND_IN_SET('search_word',`Item`.`location_start`)) OR (FIND_IN_SET('second_search_word',`Item`.`location_end`))) -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: Advanced find with mulitple OR/WHERE/AND conditions
Open the debug mode and see what the exact query is? -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Advanced find with mulitple OR/WHERE/AND conditions
Hi all.. I am looking to do a search for ITEMS with mulitple conditions. 1 = location_start 2= location_end 3=start_date 4=end_date Here is what I have this far: $start_date = date("Y-m-d 00:00"); $end_date = date("Y-m-d 23:59"); $conditions = array( 'Item.published' => 1, "OR" => array( array('Item.start_date BETWEEN ? AND ?' => array($start_date,$end_date)), array('Item.end_date BETWEEN ? AND ?' => array($start_date,$end_date)), array('FIND_IN_SET(\''. $this->request->data['Search']['location_from'] .'\',Item.location_start)'), array('FIND_IN_SET(\''. $this->request->data['Search']['location_to'] .'\',Item.location_end)') ) ); I can not seem to get the selection according to the dates going. Finding the items that have set dates between start_date and end_date. Item.start_date & Item.end_date are stored in db like this: Y-m-d H:i Any suggestions -Tom -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.