Friday, February 27, 2009

Re: Cake core is throwing unlink warnings

I created a bug on Trac:
https://trac.cakephp.org/ticket/6148


ianh wrote:
>
>
> Yes, I get this, generally when there are multiple calls going on to
> the server (Ajax or when I click around too fast!).
>
> No idea what the issue is I'm afraid but I found that changing cake/
> libs/file.php in the following two places suppresses the errors
> (rather than altering the entire php.ini which I think can get in the
> way of debugging).
>
> 1. line 156 in function open() to $this->handle = @fopen($this->path,
> $mode);
> 2. line 292 in function delete() to return @unlink($this->path);
>
> That specifcally seems to suppress these errors. I dislike having to
> modify the core, but there you go. PS, this is 1.2.1.8004 also.
>
> ianh
>
> On Feb 27, 4:56 pm, RyOnLife <ryan.mckil...@gmail.com> wrote:
>> I am also see these warnings only on AJAX pages. I am using version
>> 1.2.1.8004.
>>
>> Anyone else having this problem?
>>
>>
>>
>> Pyrite wrote:
>>
>> > I am also getting these errors intermittently. My solution, well, on
>> > my production server I don't show warnings/errors in php.ini
>>
>> > Seems to only see these on ajax pages with CakePHP 1.2 (latest as of
>> > 2/27/2009).
>>
>> > On Feb 23, 2:51 pm, RyOnLife <ryan.mckil...@gmail.com> wrote:
>> >> I am getting this (and other similar) warnings:
>>
>> >> Warning (2):
>> >> unlink(/web/php/app/tmp/cache/persistent/cake_core_core_paths)
>> >> [function.unlink]: No such file or directory [CORE/cake/libs/file.php,
>> >> line
>> >> 292]
>>
>> >> Code
>>
>> >> unlink - [internal], line ??
>> >> File::delete() - CORE/cake/libs/file.php, line 292
>> >> FileEngine::read() - CORE/cake/libs/cache/file.php, line 171
>> >> Cache::read() - CORE/cake/libs/cache.php, line 306
>> >> Configure::corePaths() - CORE/cake/libs/configure.php, line 489
>> >> Configure::buildPaths() - CORE/cake/libs/configure.php, line 591
>> >> Configure::__loadBootstrap() - CORE/cake/libs/configure.php, line 695
>> >> Configure::getInstance() - CORE/cake/libs/configure.php, line 137
>> >> include - CORE/cake/bootstrap.php, line 43
>> >> [main] - APP/webroot/index.php, line 81
>>
>> >> I checked, and the "cake_core_core_paths" file does exist at the
>> >> specified
>> >> path.
>>
>> >> Anyone know how to deal with this? Although "no such file or
>> directory"
>> >> indicates it's not the problem, I double checked my tmp folder
>> >> permissions
>> >> just to be safe.
>> >> --
>> >> View this message in
>> >>
>> context:http://n2.nabble.com/Cake-core-is-throwing-unlink-warnings-tp2374269p...
>> >> Sent from the CakePHP mailing list archive at Nabble.com.
>>
>> --
>> View this message in
>> context:http://n2.nabble.com/Cake-core-is-throwing-unlink-warnings-tp2374269p...
>> Sent from the CakePHP mailing list archive at Nabble.com.
> >
>
>

--
View this message in context: http://n2.nabble.com/Cake-core-is-throwing-unlink-warnings-tp2374269p2398421.html
Sent from the CakePHP mailing list archive at Nabble.com.


--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: Core Models not loading at all

Im still having this problem.
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: cURL problems

On Feb 27, 4:38 pm, Patrick Hereford <pheref...@gmail.com> wrote:
> My thoughts are either I am not able to make an XML object or the CURL is
> not connecting to the website.  Any advice?

Try peeking at the value of $curl_result to see what's being returned
by curl. The next thing I would suggest is make sure your second
parameter to set::check has proper casing, because set::check is case-
sensitive.
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: JQuery UI on cake

Glad you got it working none-the-less. 50% of the time after I "give
up" and look for help in the IRC channel, I solve the problem myself
before anyone answers. ;)

On Feb 27, 3:19 pm, Stu <greenmushroo...@gmail.com> wrote:
> I works!  basically I wasn't calling JQuery the right way.
>
> @Brandon: Thanks man, I failed to use common sense and check my source
> code. Hehe, rookie mistake.
>
> Cheers
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

cURL problems

Hey guys.  So here is my dilemma.  I am using cURL to get xml data from a website for validation reasons.  As soon as they hit the submit button on my form, it runs the function isValidThing().  My problem is that when I invoke the isValidThing in my controller...it ALWAYS returns false even if I know it should return true.  Here is the code:

Model Code:
<?php
uses('Xml');
    /**
     * Valid Checker: Is Valid Thing
     *
     */

class Thing extends AppModel
{
    var $name = 'Thing';
    var $useTable = 'things';

    var $validate = array(
        'thing' => array(
            'rule' => array('isValidThing'),
            'message' => 'The credentials you supplied are not valid! Please try again'
        )
    );
    function isValidThing()
    {
    $url = "http://www.website.com/sheet.xml?r=".$this->data[$this->name]['value1']."&n=".$this->data[$this->name]['value2'];
    $agent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5";
        $curl_thing = curl_init();
        curl_setopt($curl_thing, CURLOPT_URL, $url);
        curl_setopt($curl_thing, CURLOPT_HEADER, 0);
        curl_setopt($curl_thing, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($curl_thing, CURLOPT_USERAGENT, $agent);
        $curl_result = curl_exec($curl_thing);
        curl_close($curl_thing);

        $responseCharacter = new Xml();
        $responseCharacter->load($curl_result);
        $valid = set::check($responseCharacter, 'thingInfo.thing');
        return $valid;

    }
}
?>

Controller Code:
<?php
class ThingsController extends AppController {

    var $name = 'Things';
    var $uses = array('Thing');
    var $helpers = array('Form', 'Html');
    var $scaffold;
   
    function add() {
        if (!empty($this->data)) {
            $this->Thing->set($this->data);
            if ($this->Thing->isValidCharacter() == true) {
                $this->Session->setFlash($this->data['Thing']['forminput'].' Added', 'default', array('class'=>'good'));
            } else {
                $this->Session->setFlash('Please correct the errors below', 'default', array('class'=>'bad'));
            }
        }
    }
}
?>

My thoughts are either I am not able to make an XML object or the CURL is not connecting to the website.  Any advice?

--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: Saving a multiple checkbox

Sounds like the problem lies elsewhere. Do you modify $this->data in
any way in the controller action where the data is being saved? What
does your call to 'save' or 'saveAll' look like?
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: Oracle group by bug

On Feb 27, 4:09 pm, Germano <germano.c...@gmail.com> wrote:
> Hi, i try use a group by sql with a find('all') method in a oracle
> database configuration but didnt worked. I use the same $condition
> array with mysql with success.

You need to post relevant information including any and all errors you
are getting. You should consider using the 'group' option instead of
the 'conditions' to put your grouping clause. For example: $this-
>ModelName->find('all', array('group' => 'Model.field', ..... ));
where '....' is your other find options.
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---