# |
Sep 29th 2016, 20:06 |
associatee |
hey guys |
# |
Sep 29th 2016, 20:05 |
sazpaimon |
If I use a component, then I can simply mock that component in $this->generate() and not have to mock out any of the controller methods |
# |
Sep 29th 2016, 20:03 |
sazpaimon |
how do I load a service class via $components/helpers/uses? That's kind of my goal here |
# |
Sep 29th 2016, 20:01 |
admad |
s/i/it |
# |
Sep 29th 2016, 20:00 |
admad |
though i can be just a general service class, doesnt have to be a component |
# |
Sep 29th 2016, 20:00 |
admad |
a wrapper class sounds good. |
# |
Sep 29th 2016, 20:00 |
sazpaimon |
only thing I can think of is make a very thin wrapper using a component, that way I can mock the SDK in $this->generate(...) |
# |
Sep 29th 2016, 19:59 |
sazpaimon |
problem is, I don't see an easy way to mock the facebook sdk in my controller unit tests. |
# |
Sep 29th 2016, 19:58 |
sazpaimon |
for instance, I want to load the Facebook SDK for a controller. The only plugin for 2.x hasn't been updated in years and uses an unsupported SDK version, so I'll need to load the latest SDK version via composer |
# |
Sep 29th 2016, 19:56 |
sazpaimon |
they aren't dev dependencies |
# |
Sep 29th 2016, 19:55 |
admad |
*load |
# |
Sep 29th 2016, 19:55 |
admad |
sazpaimon: why not just loading the dependencies using "require-dev" ? |
# |
Sep 29th 2016, 19:47 |
sazpaimon |
seems like the best way would be to wrap the dependency in a component and mock the component out in the controller test |
# |
Sep 29th 2016, 19:47 |
sazpaimon |
in cake 2, is there a way to load composer dependencies in a way that can be mocked when testing a controller? |
# |
Sep 29th 2016, 19:47 |
prepender |
with collections its like name => rows |
# |
Sep 29th 2016, 19:42 |
prepender |
I want to do like Index => [ name => name, rows => rows ] |
# |
Sep 29th 2016, 19:41 |
prepender |
I dont like how the array key is the column title |
# |
Sep 29th 2016, 19:41 |
prepender |
but I wish it formatted a little different |
# |
Sep 29th 2016, 19:34 |
Leonardo_0112 |
harry1: thanks |
# |
Sep 29th 2016, 19:27 |
harry1 |
*/30 * * * * cd /mnt/cake2/app/ andand Console/cake my_job |
# |
Sep 29th 2016, 19:26 |
harry1 |
Leonardo_0112: yes so in your cron tab you have something like |
# |
Sep 29th 2016, 19:09 |
Leonardo_0112 |
harry1: probably yes. Am I in the right way? http://book.cakephp.org/2.0/en/console-and-shells.html |
# |
Sep 29th 2016, 19:08 |
harry1 |
http://book.cakephp.org/2.0/en/console-and-shells.html |
# |
Sep 29th 2016, 19:08 |
harry1 |
Leonardo_0112: probably a cron job? |
# |
Sep 29th 2016, 18:50 |
Leonardo_0112 |
Hi guys! I'm working in a cakephp2 project and i need to automatically generate a .csv file based on database records. The csv file is already been generated by controller/model when I access a URL. What is the best way to make it run automaticaaly every day, for instance. |
# |
Sep 29th 2016, 17:37 |
admad |
;) |
# |
Sep 29th 2016, 17:36 |
noibilism |
@admad: i got itâ?¦.thanksâ?¦.some validation rules were violated |
# |
Sep 29th 2016, 17:32 |
slackebot |
~tell noibilism about gist |
# |
Sep 29th 2016, 17:32 |
slackebot |
Command sent from Slack by admad: |
# |
Sep 29th 2016, 17:32 |
admad |
show the output of `debug($entities) before passing to saveMany() |
# |
Sep 29th 2016, 17:31 |
noibilism |
@admad itâ??s not saving the data |
# |
Sep 29th 2016, 17:31 |
noibilism |
itâ??s not saving the data |
# |
Sep 29th 2016, 17:30 |
admad |
@noibilism Why do you think you are doing something wrong? |
# |
Sep 29th 2016, 17:29 |
hmic |
additionally you can use a queue to process the data more easily *and* run multiple processes at once, which is a huge gain as your machine likely has more than one core |
# |
Sep 29th 2016, 17:28 |
hmic |
still: split the qery up. your data will grow and memory will be exhausted at some point |
# |
Sep 29th 2016, 17:27 |
hmic |
because theres no memory limit on the command line in the default configuration of php on debian or ubuntu |
# |
Sep 29th 2016, 17:27 |
rudy1976s |
so I was thinking of a memory issue |
# |
Sep 29th 2016, 17:27 |
rudy1976s |
but the same query on command line has no problem |
# |
Sep 29th 2016, 17:26 |
rudy1976s |
I know I solved that way |
# |
Sep 29th 2016, 17:25 |
hmic |
rudy1976s: the answer is simple: too much! process the query in smaller chunks |
# |
Sep 29th 2016, 17:24 |
rudy1976s |
Hello , what is the memory needed to run a query which will process around 100k of records with 150k of records related with hasMany? I am facing problems with memory exhaust error, although I have already set ->bufferResults(false) |