pjclas
10-23-2014, 07:03 PM
So hopefully I can explain this well enough...
I am programmatically generating a thread and from what I can see I can do this in two ways:
Call the API interface to add text content - I thought this would be the right approach, but it required a session and did a bunch of session validation I didn't want or need.
Call the Library directly - This seems to avoid most of the need for a session until the afterAdd() method is called which eventually calls validate() when generating a route (while attempting to send moderator emails). The validate again requires a session.
So either way it appears that I have to generate a session (which I did using vB_Session_Cli), but I'd rather not have to create a session if I don't need to.
However, my question ultimately becomes, if I have to create a session in either case, which method would be considered the more "correct" method to creating a thread programmatically. I guess I would lean toward the first method since it performs a lot more verification. However, if I don't need that verification then it just adds unnecessary overhead... I did see a comment in content.php indicating in order to avoid hvinput validation, call the library directly instead, which is what led me down that path.
Any thoughts on this?
Also, this is a bit more tedious then it used to be to create a thread using the datamanager in vb4... so maybe I'm missing something even easier?
I am programmatically generating a thread and from what I can see I can do this in two ways:
Call the API interface to add text content - I thought this would be the right approach, but it required a session and did a bunch of session validation I didn't want or need.
Call the Library directly - This seems to avoid most of the need for a session until the afterAdd() method is called which eventually calls validate() when generating a route (while attempting to send moderator emails). The validate again requires a session.
So either way it appears that I have to generate a session (which I did using vB_Session_Cli), but I'd rather not have to create a session if I don't need to.
However, my question ultimately becomes, if I have to create a session in either case, which method would be considered the more "correct" method to creating a thread programmatically. I guess I would lean toward the first method since it performs a lot more verification. However, if I don't need that verification then it just adds unnecessary overhead... I did see a comment in content.php indicating in order to avoid hvinput validation, call the library directly instead, which is what led me down that path.
Any thoughts on this?
Also, this is a bit more tedious then it used to be to create a thread using the datamanager in vb4... so maybe I'm missing something even easier?