« first day (1097 days earlier)      last day (4077 days later) » 

00:10
can a wordpress theme page be both full width and not full width at the same time?
@TyreeBrown maybe
that kinda depends on how good you are at CSS
@tereško If it is possible I will figure it out, but thanks.
00:54
I would like to convert a single page of a PDF to a JPG but my host doesn't have imagick. Do I have other options?
CTRL+SHIFT+PRINT ?
or command+shift+3 on a mac. To take a screen shot.
Actually - on mac the preview application allows you to save PDFs as JPGs.
@zneak why do you need to convert PDF to JPG?
... smells like XY problem
@tereško, because my users upload a PDF file and I want to grab the first page as a JPG to show it as a thumbnail.
so , your question actually is, "how to get PDF thumbnail without imagick"
sure. does it help you find a different solution?
01:08
1
Q: Convert PDF to image in PHP without ImageMagick

alexykotI have a PHP site that requires PDF to image conversion, and we're obviously using imagemagick for it. However, right now we're trying to move to different hosting, and it seems like I will not be able to install imagemagick package on the new hosting to do the same thing as we do now. So the ...

looks like I have ghostscript, so that could very well do it
please don't use stars for private bookmarks
02:08
@m59 That would probably make the most sense... if when you say controller you are referring to the service object at the end of the call chain.
2 hours ago, by Tyree Brown
can a wordpress theme page be both full width and not full width at the same time?
^ That confuses me
m59
m59
@Orangepill the controller has a method that returns the requested resource. Which one made sense? The controller's handle() method get's called which will in turn call a specific method like $this->GET(). I could have handle() determine the auth, or (what sounds better to me) I could give the controller a separate method that returns that returns the auth information, then the dispatcher uses that to check the auth before calling handle() on the controller.
@Orangepill ^ that is worthy of confusion :) Screw the law of non-contradiction. Who needs logic?
02:31
@m59 controller might actually work if there is a one to one relationship with the service objects it handles
can true == !true is what I read when I saw that comment
m59
m59
@Orangepill how do you mean "one to one" and what service object? :)
@m59 Service object is the last object in the call chain that actually does something... as opposed to is something if you understand what I am saying.
m59
m59
yep
I guess it's just about the same amount of work, either way. I would just give the controller base class a method to handle auth, rather than the dispatcher. That would be kind of nice because I could override it in a controller if I needed to for some reason.
@m59 honestly you might not want to change the api at all.... just do the check in the controller and throw in the event of a access denied situation.
If a host offers their own DNS in the form of dns.host.com and you set your domains DNS to that. Then in their control panel you add the domain to your account. How do they know you own that domain? Someone else who has the same host can just as well add my domain to their account and since both will use the same DNS it will resolve to them. Is there some verification in the background I'm failing to see here?
02:41
@crypticツ I've wondered this too.
@crypticツ they probably just disallow duplicate entries in their dns tree....
@crypticツ if you are supposed to be able to set the dns record and you cant then it's a call into their support department.
@Orangepill so just make sure you add the domain before someone else does? Legit security =oP
@crypticツ I ran into that situation when taking over a website for a developer that went rouge.... just so happened that he had the original site hosted on rackspace and so did I, it was a mess.
Oct 1 at 11:13, by Dan Lugg
The thing that still seems odd to me, is, given that all I need to do is update the nameserver records at one registrar, couldn't I just spam scrape domains that might be pointed at my nameserver?
"That domain already exists." so it does check for dupes, well at least on Pair.com so whoever is quicker to add the domain wins the domains =oD
 
1 hour later…
03:52
Well, that's disappointing. I see NetBeans 7.4 is released. Changelog shows under PHP:
> Editor and Rename type refactoring improvements
I reckon that must at this point mean that they finally support namespace renaming (or at least something to assist with)
NOPE.jpg
Netbeans is java based isn't it?
04:07
how does one make a new files and directories inherit the parent directories group in linux
04:28
nevermind.... helps if you have the file system mounted with acl option :)
Jay
Jay
04:50
With PDO how would I var_dump the values from $query->fetch() ?
just var_dump($query->fetch()) ?
got it
05:18
@jay are you still extending PDO for your DB abstraction?
Jay
Jay
no
I might create 3 new fnctions tho to work with
for easier inserting
No harm in that.
Jay
Jay
I use to have that banana man as my profile pic about 9 years ago
I need a regex to match:
HOPPER Pickup: JONESBORO, AR Dest: BATTLE CREEK, MI
LIVE BOTTOM Pickup: JONESBORO, AR Dest: TAYLOR, MO
HOPPER Pickup: THEODORE, AL Dest: SAINT JOSEPH, MO
HOPPER Pickup: BAY, AR Dest: OWATONNA, MN
HOPPER Pickup: BAY, AR Dest: LISBON, OH

I have \w*?\s?Pickup:\s?(\w*?),\s?\w+{2}\s?Dest:\s?\w+,\s?\w+{2}$ but its not getting me anywhere and I just started looking at regex and not sure where Im going wrong
Jay
Jay
i would love to put my software on github for people to contribute but Its not ready until this db is put in
05:26
@LouieV /([a-zA-Z, ]+) Pickup: ([a-zA-Z, ]+) Dest: ([a-zA-Z, ]+)/
Jay
Jay
it has bootstrap as one of the default templates too
@Orangepill hey thanks Ill give that a shot
@Jay If you're a bootstrap fan then you might find this interesting... it was floating around here a couple of days ago
@Orangepill thanks I was hoping to get similar results with preg_match_all
@Orangepill which it seems I should
@Jay on this question what is with all of the global calls in your methods... you aren't even using the values you are importing from global state.
Plus in general global state is bad.
Jay
Jay
05:36
the $system variable is used like this
$system->system_setting('key')
so I would be checking if the admin has set to use database or stored on the server for the sessions
If your session class has a dependency on a db object ($sql) and a $system object then those should be passed into the constructor.
Jay
Jay
its there for the future really
everything in class $system is private apart from function calls
everything thats being called and could be a security issue is run through the $secure class
My questions may seem silly but I ask them silly for good answers ;)
certain functions are private tho
you can make everything in the world private but if your class is relying on global state it is fragile.
Morning/Hello all
:)
Morning
@Jay A better approach would be to statefully interalize your dependencies like this:
public function __construct($db, $system){
    $this->db = $db;
    $this->system = $system;
    session_set_save_handler(array($this, 'open'),
                            array($this, 'close'),
                            array($this, 'read'),
                            array($this, 'write'),
                            array($this, 'destroy'),
                            array($this, 'gc'));

    // This line prevents unexpected effects when using objects as save handlers.
    register_shutdown_function('session_write_close');
Jay
Jay
05:43
but when you have so many classes its to much work man
@Jay how so?
Jay
Jay
for instance
the $template class needs every class in the software
now thats like 20+
prob more
there are two types of classes for the software
system classes which are used by the system & global classes which are used by plugins
@Jay Why does the template need that many objects?
Jay
Jay
the template class needs all the sytem classes
I've basically used the style of C++ and Maya node system
I know Maya btw
mornin
05:49
If your template class needs all of the system classes then your template class is doing too much.
morning
Jay
Jay
only modeling, rigging, texturing and some python
@Orangepill hello mr. 🍌
Jay
Jay
pages load in 0.099
@Mr.Alien ?
Jay
Jay
I guess I look at it different, if things load fast and work great then whats the point in changing it?
I am however as you know changign the db
05:51
@Jay maintenance and extendabilty
Jay
Jay
ok for instance:
that's a banana, that's what I saw in your profile pic, so mr. 🍌 :D
Jay
Jay
@Orangepill the template file structure: default.php has $template->ui_content()
which loads the content file
the content file is basically a folder: index
inside the index folder you have serveral files: config.php, design.php, ajax.php, js.php, css.php
the config is the php coding which seperates the html from design.php
ajax.php is for ajax commands on that page
ajax.php, css.php, js.php don';t even need to exist if you don;t need them
there is also a language file in this folder
in the template structure file there is also ui_side(1), ui_side(2)
but there is also a layout file which loads which layout you want
and also you can change the structure file for any page
thats just touching on about 20%
everything has a node setting attached to it as well and can be 100% controlled from the admin
as for extendability there is totally no need for me to extend the core system. The plugins do that
u can even generate your own forms and menus as well
and every page has a comment section
So your admin is writing the php files to make all this happen?
Jay
Jay
no
but you can edit the php files from the admin if you want too
the files are made by the plugin maker
the system has the default files in place after you run the installation
@Orangepill would you like to see it?
06:04
sure
Jay
Jay
templatemonster are going to demo it in 2 weeks
I am stressing because of this new db class
we'll do a skype just after 2 weeks mate :)
u got skype?
@Jay Something like this:
class PdoDBAdapter implements DbAdapter {
    private $pdo;

    public function __construct(PDO $pdo){
        $this->pdo = $pdo;
    }

    public function insert($table, $stuff){
        /** code to build your query **/
        $this->pdo->prepare($query);
        return $this->pdo->execute($params);
    }

    public function update($table, $stuff){...};
    public function delete($table, $conditions){...};
}
might be a sane approach for your db class.
@Jay I believe it addresses your concerns while using a little more best practices then your previous attempt
Jay
Jay
$dsn = CONFIG_DB_TYPE.':host=' . CONFIG_DB_HOST . ';dbname=' . CONFIG_DB_NAME;
if(CONFIG_DB_TYPE == 'mysql'){

$options = array(
PDO::ATTR_PERSISTENT => true,
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"
);
}

try{

$db = new PDO($dsn, CONFIG_DB_USER, CONFIG_DB_PASS, $options);
}catch(PDOException $e){

$this->error = $e->getMessage();
}
This is what I am working with at the moment
@Jay so you opted to use raw PDO.... good choice imho.
Jay
Jay
yea but I would like them 3 functions you created above to work with PDO raw
so its easier to update stuff
06:14
@Jay if you tape on additional functions a wrapper class akin to the one I described should work for you.
Jay
Jay
basically when I started this cms 9 years ago I was using mysql
then I converted the class to mysqli
now and I going for PDO so I don't have to convert anything anymore
Its just in my files the functions are sql_query, sql_insert, sql_update, sql_fetch, sql_num, sql_id etc..
I don't mind changing every query but I really wanted the sql_insert, sql_update, sql_delete to have their own functions
because the data is all written in arrays and I didn't want to have to change all these fully because its a lot of work
@Jay make it easy for basic CRUD functionality.
Jay
Jay
thats what I am trying
ideally I wanted it to work like this:
$result = $sql->sql_query("SELECT * blah...");
$row = $sql->sql_fetch($result);
but its not possible now because of prepared statements
I fail to see where the challenge is ?
Jay
Jay
I am new to PDO, thats the challenge
06:25
@Jay Maybe this will offer some guidance
I have to get some sleep, take it easy.
Jay
Jay
k mate see ya bud
@Jay I would suggest you take a look at this. It may offer some guidance on good practice.
Jay
Jay
ha my friends when to the drupalcon in prague
06:39
Morning.
Elo XD
Hi all, Myself Vijay can i join this group?
morning room
Good Morning
Good morning.
06:52
morningz
is everyone php developer here?
Depends what you mean by that. If those who can write php than yes, if those who use it daily, than no.
Morning, @HamZa. It's been a while. How are you?
heh, fine. I've been busy with school
And you ?
I'm fine as well. Thanks. ;)
06:58
--' I want to ask a question in Drupal SO but I have not enough rep. -- Dammit.
Does asking question require rep? oO
@Leri It does here :P
Oh, that. :D
is becoming as crappy as . Conclusion: if you want good community, you need to maintain stuff like pointer of pointer.
Goodmorning everyone
07:30
can anyone tell me how to hit a url in php
AFAIK, php can't hit.
@GangofOne-GoO Some cURL-fu ?
@Leri A php book can tho.. a junior who made a big ass fuckup knows that from experience ..
07:35
$curl = curl_init();
// set URL and other appropriate options
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, false);
// grab URL and pass it to the browser
curl_exec($curl);
if (curl_errno($curl)) {
print curl_error($curl);
} else {
curl_close($curl);
}
this is ok?
It is if it works .....
Trying usually clarifies things immensely ...
can u give me some code
echo 'Hello world'; - there you go.. it was my pleasure.
07:37
@GangofOne-GoO Probably you don't know but we have allergy on that phrase. ;)
Small Q: I have an array for example ['arrayCool'];
In that array are 10 elements like as in ['arrayCool']['1']['arrayCool']['2']['arrayCool']['3']... And so on.... What is the most efficient way to read them out ( In every ['arrayCool']['1'] are other arrays too where I have to get everytime 1 element from).
Oew.. next time I get bored.. ill make a stackoverflow version of lmgtfy.com
Jay
Jay
@GangofOne-GoO what are yo trying to do?
@Jay something he can probably do with file_get_contents('http://.....'); but don't tell him i said that.. (because its ugly. Curl is a better solution, but "harder")
Jay
Jay
@DamienOvereem haha
@GangofOne-GoO Dunno if this helps you but its a api call I made once:

$api_url = 'url';
$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, $api_url);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT ,0);
curl_setopt($curl, CURLOPT_TIMEOUT, 400);

if(is_array($array)){

curl_setopt($curl, CURLOPT_POSTFIELDS, $array);
}

//curl_setopt($curl, CURLOPT_POST, true);
//curl_setopt($curl, CURLOPT_HTTPGET, true);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
07:44
@Jay stop feeding helpvampires
Jay
Jay
@HamZa but we all needed and need help at some point?
Yeah, but not like this.
That guy obviously didn't bother to search and try something
Jay
Jay
@HamZa I didn;t read his full convo matey
I need help myself
foreach ($helpRequests as $helpRequest) {
    if ($helpRequest->author instanceof Humans\Programmers\HelpVampire) {
         continue;
    }

    help();
}
Damn formatting.
Someone, shoot me a podcst! :p
I want to listen to smthing new :)
( no music) :D
Jay
Jay
07:49
listen to ray charles
Ray Charles is awsome
@Leri $result = array_map(function($author){return $author instanceof Humans\Programmers\HelpVampire || help();}, $helpRequests); :p
Jay
Jay
guys how can I make it so I can reference the same functions PDO has? $db = new PDO($dns); then I can have a function fetch() which will replace the current one or add a new function ?
I have a huge Array, and I want to parse spefic pieces out of it
Jay
Jay
07:52
$in_need = true; if($in_need == true){ echo 'help me please'; }
@Duikboot loop the array and unset() ?
@Duikboot great. now do it :p
@Jay what is $array
Im going to create a small template. About how it looks like.
@Jay Inherit from PDO, but do you really need that?.
Jay
Jay
@GangofOne-GoO $array is the array you are supplying to the rest request
@Leri yea I do because I need to set some custom stuff to go off inside fetch()
@Leri any chance you could lay me some code brother
07:55
That is what I want to parse.
Jay
Jay
@GangofOne-GoO in the requested file the array will be sent as _POST values
Um, I don't have any brother, however, yes: class MyPDO extends \PDO
Basically, this.
Piece of the real array: hastebin.com/makusajije.coffee
@Jay i want to hit sms url
i have a complete url in a sting
how to chnge that in ur code
actully dude i am a android dev
dont know much about php
Jay
Jay
@GangofOne-GoO put your code somewhere man

« first day (1097 days earlier)      last day (4077 days later) »