Author Topic: Making Packages?  (Read 22926 times)

Offline Basil Beard

Re: Making Packages?
« Reply #15 on: February 26, 2007, 08:29:33 am »
Ok. Question. How do I test to see if the package actually works? Should I like, create a second forum with just SMFShop 3.0 and SMF on it? I mean, if I were to try and run the package now, it would all like double up everything. And I really would be surprised if the package works on the first try.
Arrrrr!

Offline TechnoDragon

Re: Making Packages?
« Reply #16 on: February 26, 2007, 08:33:46 am »
Our illustrious admin has created a tool that you can use to test your packages...

http://server.daniel15.com/smf/package.php

that should help you at least see if it will work...

Don't tell me to get into shape...I have a shape...It is round!


Offline Basil Beard

Re: Making Packages?
« Reply #17 on: February 26, 2007, 08:48:49 am »
Ah, very nice. *looks in horror at all the errors*

Is there a way to tell where in the code these errors are being generated? Because there are alot of them and I can't find whats causes them.
Arrrrr!

Offline TechnoDragon

Re: Making Packages?
« Reply #18 on: February 26, 2007, 08:49:30 am »
I could take a look at it for you...if you like...
Don't tell me to get into shape...I have a shape...It is round!


Offline Basil Beard

Re: Making Packages?
« Reply #19 on: February 26, 2007, 09:02:22 am »
I think I figured out one of the main errors. (I commented out most of the file edits so that I had a smaller section to search for the problem). I'll let you know if I get stuck. I'll also, of course, need a way to test if the package actually does what it is supposed to do.
Arrrrr!

Offline TechnoDragon

Re: Making Packages?
« Reply #20 on: February 26, 2007, 09:03:43 am »
well, a good first start is to get it to pass daniels package thing...once that is done I can install it on my test forum
Don't tell me to get into shape...I have a shape...It is round!


Offline Basil Beard

Re: Making Packages?
« Reply #21 on: February 26, 2007, 09:13:50 am »
Ok. It has now passed Daniel's package thing. (Two errors. One time I ended the whole CDATA tag stuff with one ] instead of two. The other time I forgot a quote after my search position="after").

I'll upload the package and get you the link for the download. Keep in my this is a few steps away from the final release(for example, the food items are not coded yet). Also, assuming it doesn't work(which it most likely will not) feel free to fix any obvious errors on your own. =)

www.nomicville.com/SMFPets 1.0.zip

That should give you the package.
Arrrrr!

Offline xfollowthereaperx

Re: Making Packages?
« Reply #22 on: February 26, 2007, 11:31:17 am »
Ok. It has now passed Daniel's package thing. (Two errors. One time I ended the whole CDATA tag stuff with one ] instead of two. The other time I forgot a quote after my search position="after").

I'll upload the package and get you the link for the download. Keep in my this is a few steps away from the final release(for example, the food items are not coded yet). Also, assuming it doesn't work(which it most likely will not) feel free to fix any obvious errors on your own. =)

www.nomicville.com/SMFPets 1.0.zip

That should give you the package.
I hope these are your fault because I don't wanna fix them  :'(

1.     Execute Code     installScript.php     
2.    Extract Tree    ./Sources/shop/pets_breeds    
3.    Extract Tree    ./Sources/shop/pet_images    
4.    Extract File    ./Sources/shop/Shop-Pets.php    
5.    Extract File    ./Sources/shop/pet_engine.php    
6.    Execute Modification    ./Sources/ManagePermissions.php    Test failed
7.    Execute Modification    ./Themes/default/Profile.template.php    Test failed
8.    Execute Modification    ./Themes/default/languages/ManagePermissions.english.php    Test failed
9.    Execute Modification    ./Themes/default/languages/Shop.english.php    Test successful
10.    Execute Modification    ./Themes/default/Shop.template.php    Test failed
11.    Execute Modification    ./Sources/shop/Shop.php    Test failed
12.    Execute Modification    ./Sources/shop/Shop-Subs.php    Test failed
13.    Execute Modification    ./Sources/Profile.php    Test failed

Offline Basil Beard

Re: Making Packages?
« Reply #23 on: February 26, 2007, 11:45:37 am »
So 1/8 of them worked? <_<. I probably accidentally changed my code around while trying to fix it =(. I'll see if I can fix it tomorrow.
Arrrrr!

Offline Daniel15

Re: Making Packages?
« Reply #24 on: February 26, 2007, 06:12:04 pm »
Quote
Should I like, create a second forum with just SMFShop 3.0 and SMF on it?
Yes, this is the recommended way of testing a package. Your package must work on an unedited (well, except for SMFShop) SMF installation.

Quote
I probably accidentally changed my code around while trying to fix it =(. I'll see if I can fix it tomorrow.
The most likely problem is whitespace - Missing a tab in a <search> section, putting a line break when there is no line break, etc. test_modification.php from the Package SDK is very helpful for tracking down problems like this ;)

I only took a very quick look at your package (don't have very much free time), and I think this may be causing the problem:
Code: [Select]
<search position="after"><![CDATA[
'shop_senditems',
'shop_bank',
// End SMFShop code
]]>
</search>
It should be formatted something like:
Code: [Select]
<search position="after"><![CDATA[
'shop_senditems',
'shop_bank',
// End SMFShop code
]]></search>

The stuff outside the <![CDATA[ .... ]]> is still counted in the <search>. So, in this case, it's looking for that text folowed by two line breaks. You'll need to put the </search> straight after the ]]>.

Oh, and you may find WinMerge handy - Open your edited file, and the same file from a fresh SMF + SMFShop installation. It will show you exactly what has been changed :)

Offline Basil Beard

Re: Making Packages?
« Reply #25 on: February 26, 2007, 10:49:13 pm »
Ok. I see yeah, I changed tabs and stuff around to make it easier to debug. Oops =P. It shouldn't be too hard to fix though... I hope. Thanks =)
Arrrrr!

Offline TechnoDragon

Re: Making Packages?
« Reply #26 on: February 27, 2007, 04:04:47 am »
Ok, I have begun attempting to integrate this into a 2.3 version of the shop (3.0 will not install no matter what I do) but I am getting some errors regarding some of the functions in the pet mod....mainly is that it keeps telling me undefinied function BLAH assumed  BLAH and they are related to the if (!class_exists( parts of the files...there are others, but these seem to be the most annoying...
Don't tell me to get into shape...I have a shape...It is round!


Offline Basil Beard

Re: Making Packages?
« Reply #27 on: February 27, 2007, 04:51:19 am »
One problem could be the difference between php 4 and php 5. I think some of my classes could require php 5. I really didn't even consider this while writing it... *hopes this isnt the case*

Anyways, I have updated my code, making sure everything is like, searchable---but it still doesn't seem to work. How does the CDATA thing work?

If my code says
Code: [Select]
APPLE


And I want to make it say

Code: [Select]
APPLE

BANANA

I should use
Code: [Select]
<operation>
<search position="before"><![CDATA[APPLE
]]>
</search>
<add><![CDATA[BANANA]]>
</add>
</operation>

Right?

(I have done this, and double checked that I can like, find the search values manually---but still I get an error for each modification when trying to upload the package.)
(I have also uploaded the new zip file, not many changes but enough that if someone wants to figgure out what I am doing wrong, they should have the newest stuff).

----

Anyways, the if_class_exists function is used to prevent class duplication(which will cause errors, I think). So if you want to get around it... thats what it needs to do. =)
« Last Edit: February 27, 2007, 04:54:26 am by Basil Beard »
Arrrrr!

Offline TechnoDragon

Re: Making Packages?
« Reply #28 on: February 27, 2007, 05:00:17 am »
ok, figured out what the error for the class_exists issue (was missing ' ' around the class name) now I get this error when I go to buy a pet

parse error, unexpected T_STRING in /BLAH/BLAH/BLAH/Sources/shop/Shop-Pets.php(175) : eval()'d code on line 2

which is this line:
Code: [Select]
if (eval($code) !== FALSE) {

Any ideas?
Don't tell me to get into shape...I have a shape...It is round!


Offline Basil Beard

Re: Making Packages?
« Reply #29 on: February 27, 2007, 05:11:37 am »
Looks like part of the code I copied from Daniel. Actually, unexpected T_STRING probably means there is a dumb error(lack of semicolon, missing quote or bracket...) because it worked fine for me, it probably got broken while packaging it. I'll look into after I find out why the installscript wont work. (I got the package to install, sans the install script =P)

And I can't spell unsigned. hehe. Now to see why other stuff are not working  :idiot2:

o_0. Like, it worked for me. I adopted pets. And now its not working for me at all  :buck2: I am doing the exact same thing daniel did in his admin code, and it still isn't working.

AHHAH! I figured it out! Dern whitespace! One sec, should be fixed and soon as I brushup on preg_replace.

Eh... the more I think about it, I think I did the same thing more than once and I am too lazy to fix my code right now. So for now, the solution will be: No breed names with whitespace  :knuppel2:
« Last Edit: February 27, 2007, 05:37:13 am by Basil Beard »
Arrrrr!